18#include <TLorentzVector.h>
48 RegisterInputCollection(
"InputCollection",
"telescope data inherit from TTelescopeData",
fInputColName,
50 RegisterInputCollection(
"InputTrackCollection",
"tracking data inherit from TTrack",
fInputTrackColName,
52 RegisterOutputCollection(
"OutputCollection",
"reconstracted reaction information using TGTIK method",
fOutputColName,
56 RegisterProcessorParameter(
"ParticleZArray",
"particle atomic numbers of the reaction",
fParticleZArray, init_i_vec);
57 RegisterProcessorParameter(
"ParticleAArray",
"particle mass numbers of the reaction",
fParticleAArray, init_i_vec);
60 RegisterProcessorParameter(
"ExcitedEnergy",
"excited energy",
fExcitedEnergy, -1.0);
63 TString(
"prm_detectors"), &
fDetectorPrm,
"TClonesArray",
"art::crib::TDetectorParameter");
65 TString(
"prm_targets"), &
fTargetPrm,
"TClonesArray",
"art::crib::TTargetParameter");
66 RegisterProcessorParameter(
"UseCenterPosition",
"custom, use center position at the detecgtor",
fDoCenterPos,
false);
85 SetStateError(Form(
"input not found: %s",
fInputColName.Data()));
95 const TClass *
const cl1 = (*fInData)->GetClass();
96 const TClass *
const cl2 = (*fInTrackData)->GetClass();
97 if (!(cl1->InheritsFrom(art::crib::TTelescopeData::Class()))) {
98 SetStateError(Form(
"%s need to inherit from TTelescopeData",
fInputColName.Data()));
101 if (!(cl2->InheritsFrom(art::TTrack::Class()))) {
117 SetStateError(
"Particle array size should be 4 in the steering file");
132 Info(
"Init",
"reconstract the reaction: %d%s + %d%s -> %d%s + %d%s <- detect",
138 Info(
"Init",
"\tQ-value: %lf MeV", (
M1 +
M2) - (
M3 +
M4));
141 fOutData =
new TClonesArray(
"art::crib::TReactionInfo");
145 gRandom->SetSeed(time(
nullptr));
154 Int_t nData = (*fInData)->GetEntriesFast();
157 else if (nData != 1) {
158 std::cerr <<
"warning: the input " <<
fInputColName <<
" entry number is not 1, but " << nData << std::endl;
161 Int_t nTrackData = (*fInTrackData)->GetEntriesFast();
164 if (nTrackData != 1) {
165 std::cerr <<
"warning: the input " <<
fInputTrackColName <<
" entry number is not 1, but " << nTrackData
172 const TTrack *
const TrackData =
dynamic_cast<const TTrack *
>(inTrackData);
182 Double_t excited_energy = 0.0;
195 outData->
SetXYZ(TrackData->GetX(z), TrackData->GetY(z), z);
201 outData->
SetThetaL((180.0 / TMath::Pi()) * ALab);
213 if (!IsValid(energy))
233 std::cerr <<
"parameter is not found" << std::endl;
234 return {kInvalidD, kInvalidD};
239 Double_t stripSize[2] = {Prm->
GetSize(0) / (Double_t)stripNum[0], Prm->
GetSize(1) / (Double_t)stripNum[1]};
241 Double_t det_x, det_y;
244 else if (stripID[0] >= 0 && stripID[0] < stripNum[0])
245 det_x = -Prm->
GetSize(0) / 2.0 + stripSize[0] * (Double_t)stripID[0];
251 else if (stripID[1] >= 0 && stripID[1] < stripNum[1])
252 det_y = -Prm->
GetSize(1) / 2.0 + stripSize[1] * (Double_t)stripID[1];
256 TVector3 detect_position(det_x, det_y, Prm->
GetDistance());
257 detect_position.RotateY(Prm->
GetAngle());
260 TVector3 reaction_position(track->GetX(z), track->GetY(z), z);
261 TVector3 track_direction(track->GetX(1.) - track->GetX(0.), track->GetY(1.) - track->GetY(0.), 1.0);
263 Double_t theta = track_direction.Angle(detect_position - reaction_position);
266 return {energy, theta};
284 Double_t alpha = (
M2 * (
M1 +
M2)) / (2.0 *
M1);
285 Double_t beta = (
M4 * (
M3 +
M4)) / (2.0 *
M3);
286 Double_t qvalue = (
M1 +
M2) - (
M3 +
M4);
288 Double_t v4 = TMath::Sqrt(2.0 * energy /
M4);
290 if (TMath::Abs(alpha - beta) < 1.0e-5) {
291 Double_t vcm_elastic = -(qvalue - beta * v4 * v4) / (2.0 * beta * v4 * TMath::Cos(theta));
292 if (vcm_elastic < 0) {
293 std::cerr <<
"vcm < 0! : vcm = " << vcm_elastic
294 <<
", det_energy : " << energy <<
", theta : " << theta << std::endl;
297 return alpha * vcm_elastic * vcm_elastic;
299 Double_t b = (beta * v4 * TMath::Cos(theta)) / (alpha - beta);
300 Double_t c = (qvalue - beta * v4 * v4) / (alpha - beta);
301 Double_t D = b * b - c;
303 if (TMath::Abs(D) < 1.0e-5) {
306 std::cerr <<
"b^2 - c = " << D <<
" < 0, det_energy : " << energy <<
", theta : " << theta << std::endl;
311 Double_t vcm = -b + TMath::Sqrt(D);
313 std::cerr <<
"vcm < 0! : vcm = " << -b <<
" + " << TMath::Sqrt(D) <<
", det_energy : " << energy
314 <<
", theta : " << theta << std::endl;
318 return alpha * vcm * vcm;
326 Double_t alpha = (
M2 * (
M1 +
M2)) / (2.0 *
M1);
327 Double_t beta = (
M4 * (
M3 +
M4)) / (2.0 *
M3);
328 Double_t qvalue = (
M1 +
M2) - (
M3 +
M4);
330 Double_t v4 = TMath::Sqrt(2.0 * ELab /
M4);
331 Double_t vcm = TMath::Sqrt(Ecm / alpha);
332 Double_t v4cm = TMath::Sqrt((Ecm + qvalue) / beta);
334 Double_t theta_cm = TMath::ACos((v4 * TMath::Cos(ALab) - vcm) / v4cm);
ClassImp(TReconstProcessor)
for solid target reconstruction
Double_t GetCenterRotPos(Int_t id) const
Double_t GetAngle() const
Int_t GetStripNum(Int_t id) const
Double_t GetSize(Int_t id) const
Double_t GetDistance() const
void SetEnergy(Double_t arg)
void SetExEnergy(Double_t arg)
void SetThetaL(Double_t arg)
void SetTheta(Double_t arg)
void SetBeamEnergy(Double_t arg)
void SetXYZ(Double_t x, Double_t y, Double_t z)
Double_t GetEcm_classic_kinematics(Double_t energy, Double_t theta)
Get Ecm from detected particle information (classic kinematics)
TClonesArray * fOutData
output object (TClonesArray(art::TReactionInfo))
Double_t GetCMAngle(Double_t ELab, Double_t Ecm, Double_t ALab)
Get Lab Angle after reconstruction.
IntVec_t fParticleZArray
reaction particles Atomic num array
IntVec_t fParticleAArray
reaction particles Mass num array
std::pair< Double_t, Double_t > GetELabALabPair(Double_t z, const TTrack *track, const TTelescopeData *data)
Get LAB energy and angle from detected particle information.
TString fInputTrackColName
input tracking collection name (art::TTrack)
TReconstProcessor()
Default constructor.
Double_t GetEcmFromDetectParticle(Double_t z, const TTrack *track, const TTelescopeData *data)
Get Ecm from detected particle information.
void Init(TEventCollection *col) override
Initialization.
TString fInputColName
input telescope collection name (art::TTelescopeData)
void Process() override
Main process.
TString fDetectorParameterName
detector parameter name (art::TDetectorParameter)
TClonesArray ** fInTrackData
tracking input object (TClonesArray(art::TTrack))
TString fOutputColName
output collection name (art::TReactionInfo)
~TReconstProcessor() override
Default destructor.
Double_t GetEcm_kinematics(Double_t energy, Double_t theta, Double_t low_e, Double_t high_e)
Get Ecm from detected particle information (relativity kinematics)
TClonesArray ** fTargetPrm
target parameter obejct (TClonesArray(art::TTargetParameter))
Double_t fExcitedEnergy
Excited Energy.
TClonesArray ** fInData
telescope input object (TClonesArray(art::TTelescopeData))
TClonesArray ** fDetectorPrm
detector parameter object (TClonesArray(art::TDetectorParameter))
TString fTargetParameterName
target parameter name (art::TTargetParameter)
Bool_t fDoCenterPos
Flag of custom processor.
Double_t GetEtotal() const