28 const
char* secondary_spectro,
29 const
char* primary_kine,
31 THaPhysicsModule(name,description), fMX(secondary_mass),
32 fSpectroName(secondary_spectro), fSpectro(NULL),
33 fPrimaryName(primary_kine), fPrimary(NULL)
42 DefineVariables( kDelete );
50 THaPhysicsModule::Clear(opt);
51 fTheta_xq = fPhi_xq = fTheta_bq = fPhi_bq = fXangle = fPmiss
52 = fPmiss_x = fPmiss_y = fPmiss_z = fEmiss = fMrecoil = fErecoil
53 = fTX = fTB = fPX_cm = fTheta_x_cm = fPhi_x_cm = fTheta_b_cm
54 = fPhi_b_cm = fTX_cm = fTB_cm = fTtot_cm = fMandelS = fMandelT
65 if( mode == kDefine && fIsSetup )
return kOK;
66 fIsSetup = ( mode == kDefine );
69 {
"th_xq",
"Polar angle of detected particle with q (rad)",
71 {
"ph_xq",
"Azimuth of detected particle with scattering plane (rad)",
73 {
"th_bq",
"Polar angle of recoil system with q (rad)",
"fTheta_bq" },
74 {
"ph_bq",
"Azimuth of recoil system with scattering plane (rad)",
76 {
"xangle",
"Angle of detected particle with scattered electron (rad)",
78 {
"pmiss",
"Missing momentum magnitude (GeV), nuclear physics "
79 "definition (-pB)",
"fPmiss" },
80 {
"pmiss_x",
"x-component of p_miss wrt q (GeV)",
"fPmiss_x" },
81 {
"pmiss_y",
"y-component of p_miss wrt q (GeV)",
"fPmiss_y" },
82 {
"pmiss_z",
"z-component of p_miss, along q (GeV)",
"fPmiss_z" },
83 {
"emiss_nuc",
"Missing energy (GeV), nuclear physics definition "
84 "omega-Tx-Tb",
"fEmiss_nuc" },
85 {
"emiss",
"Missing energy (GeV), ENGINE definition "
86 "omega-Mt-Ex",
"fEmiss" },
87 {
"Mrecoil",
"Invariant mass of recoil system (GeV)",
"fMrecoil" },
88 {
"MMpi",
"Missing mass under assumption hadron is a pion (GeV)",
"fMMpi" },
89 {
"MMK",
"Missing mass under assumption hadron is a kaon (GeV)",
"fMMK" },
90 {
"MMp",
"Missing mass under assumption hadron is a proton (GeV)",
"fMMp" },
91 {
"Erecoil",
"Total energy of recoil system (GeV)",
"fErecoil" },
92 {
"Prec_x",
"x-component of recoil system in lab (GeV/c)",
"fB.X()" },
93 {
"Prec_y",
"y-component of recoil system in lab (GeV/c)",
"fB.Y()" },
94 {
"Prec_z",
"z-component of recoil system in lab (GeV/c)",
"fB.Z()" },
95 {
"tx",
"Kinetic energy of detected particle (GeV)",
"fTX" },
96 {
"tb",
"Kinetic energy of recoil system (GeV)",
"fTB" },
97 {
"px_cm",
"Magnitude of X momentum in CM system (GeV)",
"fPX_cm" },
98 {
"thx_cm",
"Polar angle of X in CM system wrt q (rad)",
"fTheta_x_cm" },
99 {
"phx_cm",
"Azimuth of X in CM system wrt q (rad)",
"fPhi_x_cm" },
100 {
"thb_cm",
"Polar angle of recoil systm in CM wrt q (rad)",
102 {
"phb_cm",
"Azimuth of recoil system in CM wrt q (rad)",
"fPhi_b_cm" },
103 {
"tx_cm",
"Kinetic energy of X in CM (GeV)",
"fTX_cm" },
104 {
"tb_cm",
"Kinetic energy of B in CM (GeV)",
"fTB_cm" },
105 {
"t_tot_cm",
"Total CM kinetic energy",
"fTtot_cm" },
106 {
"MandelS",
"Mandelstam s for secondary vertex (GeV^2)",
"fMandelS" },
107 {
"MandelT",
"Mandelstam t for secondary vertex (GeV^2)",
"fMandelT" },
108 {
"MandelU",
"Mandelstam u for secondary vertex (GeV^2)",
"fMandelU" },
111 return DefineVarsFromList( vars, mode );
129 ( FindModule( fSpectroName.Data(),
"THcHallCSpectrometer"));
131 fStatus = kInitError;
136 ( FindModule( fPrimaryName.Data(),
"THcPrimaryKine"));
138 fStatus = kInitError;
142 if( (fStatus=THaPhysicsModule::Init( run_time )) != kOK ) {
153 if( !IsOK() )
return -1;
159 THaTrackInfo* trkifo = fSpectro->GetTrackInfo();
160 if( !trkifo || !trkifo->IsOK() )
return 1;
163 if( !fPrimary->DataValid() )
return 2;
166 Double_t xptar = trkifo->GetTheta() + fOopCentralOffset;
168 fSpectro->TransportToLab(trkifo->GetP(), xptar, trkifo->GetPhi(), pvect);
171 fX.SetVectM( pvect, fMX );
178 Double_t omega = fPrimary->GetOmega();
198 fTheta_xq = xq.
Theta();
200 fTheta_bq = bq.
Theta();
207 fPmiss = p_miss.
Mag();
210 fPmiss_x = p_miss.
X();
211 fPmiss_y = p_miss.
Y();
212 fPmiss_z = p_miss.
Z();
220 fTB = fB.E() - fMrecoil;
227 fEmiss_nuc = omega - fTX - fTB;
229 fEmiss = omega + pA->
M() - fX.E();
242 if ( fMX > 0.12957018 && fMX < 0.14957018 ){
243 fMMpi =
sqrt(abs((fEmiss*fEmiss)-(fPmiss*fPmiss)));
244 fMMK =
sqrt(abs((
pow(fEmiss+(
sqrt((fMass_pi*fMass_pi)+(
pow((pvect.
Mag()), 2))))-(
sqrt((fMass_K*fMass_K)+(
pow((pvect.
Mag()), 2)))), 2)-(fPmiss*fPmiss))));
245 fMMp =
sqrt(abs((
pow(fEmiss+(
sqrt((fMass_pi*fMass_pi)+(
pow((pvect.
Mag()), 2))))-(
sqrt((fMass_p*fMass_p)+(
pow((pvect.
Mag()), 2)))), 2)-(fPmiss*fPmiss))));
248 else if (fMX > 0.483677 && fMX < 0.503677 ){
249 fMMpi =
sqrt(abs((
pow(fEmiss+(
sqrt((fMass_K*fMass_K)+(
pow((pvect.
Mag()), 2))))-(
sqrt((fMass_pi*fMass_pi)+(
pow((pvect.
Mag()), 2)))), 2)-(fPmiss*fPmiss))));
250 fMMK =
sqrt(abs((fEmiss*fEmiss)-(fPmiss*fPmiss)));
251 fMMp =
sqrt(abs((
pow(fEmiss+(
sqrt((fMass_K*fMass_K)+(
pow((pvect.
Mag()), 2))))-(
sqrt((fMass_p*fMass_p)+(
pow((pvect.
Mag()), 2)))), 2)-(fPmiss*fPmiss))));
254 else if (fMX > 0.92828 && fMX < 0.94828 ){
255 fMMpi =
sqrt(abs((
pow(fEmiss+(
sqrt((fMass_p*fMass_p)+(
pow((pvect.
Mag()), 2))))-(
sqrt((fMass_pi*fMass_pi)+(
pow((pvect.
Mag()), 2)))), 2)-(fPmiss*fPmiss))));
256 fMMK =
sqrt(abs((
pow(fEmiss+(
sqrt((fMass_p*fMass_p)+(
pow((pvect.
Mag()), 2))))-(
sqrt((fMass_K*fMass_K)+(
pow((pvect.
Mag()), 2)))), 2)-(fPmiss*fPmiss))));
257 fMMp =
sqrt(abs((fEmiss*fEmiss)-(fPmiss*fPmiss)));
261 fMMpi =
sqrt(abs((
pow(fEmiss+(
sqrt((fMX*fMX)+(
pow((pvect.
Mag()), 2))))-(
sqrt((fMass_pi*fMass_pi)+(
pow((pvect.
Mag()), 2)))), 2)-(fPmiss*fPmiss))));
262 fMMK =
sqrt(abs((
pow(fEmiss+(
sqrt((fMX*fMX)+(
pow((pvect.
Mag()), 2))))-(
sqrt((fMass_K*fMass_K)+(
pow((pvect.
Mag()), 2)))), 2)-(fPmiss*fPmiss))));
263 fMMp =
sqrt(abs((
pow(fEmiss+(
sqrt((fMX*fMX)+(
pow((pvect.
Mag()), 2))))-(
sqrt((fMass_p*fMass_p)+(
pow((pvect.
Mag()), 2)))), 2)-(fPmiss*fPmiss))));
292 x_cm_vect *= rot_to_A1;
300 fTheta_x_cm = x_cm.Theta();
301 fPhi_x_cm = x_cm.Phi();
302 fTheta_b_cm = b_cm.Theta();
303 fPhi_b_cm = b_cm.Phi();
306 fTX_cm = x_cm.E() - fMX;
307 fTB_cm = b_cm.E() - fMrecoil;
308 fTtot_cm = fTX_cm + fTB_cm;
315 fMandelS = (*pQ+*pA).M2();
316 fMandelT = (*pQ-fX).M2();
317 fMandelU = (*pQ-fB).M2();
327 fMass_pi = 0.13957018;
332 prefix[0] = tolower(
GetName()[0]);
335 fOopCentralOffset = 0.0;
337 {
"_oopcentral_offset",&fOopCentralOffset,kDouble, 0, 1},
338 {
"partmass", &fMX, kDouble },
342 cout <<
"THcSecondaryKine particleMASS: " << fMX << endl;
353 PrintInitError(
"SetMX()");
362 PrintInitError(
"SetSpectrometer()");
371 PrintInitError(
"SetPrimary()");
std::string GetName(const std::string &scope_name)
void SetPrimary(const char *name)
int Invert(LASymMatrix &)
void Boost(Double_t, Double_t, Double_t)
Class for the Calculate kinematics of scattering of the secondary (hadron) particle.
ClassImp(THcSecondaryKine) THcSecondaryKine
double beta(double x, double y)
double pow(double, double)
void SetSpectrometer(const char *name)
virtual Int_t Process(const THaEvData &)
VecExpr< UnaryOp< Sqrt< T >, SVector< T, D >, T >, T, D > sqrt(const SVector< T, D > &rhs)
virtual ~THcSecondaryKine()
Double_t Angle(const TVector3 &v) const
LVector boost(const LVector &v, const BoostVector &b)
virtual void Clear(Option_t *opt="")
virtual Int_t ReadDatabase(const TDatime &date)
Int_t LoadParmValues(const DBRequest *list, const char *prefix="")
Retrieve parameter values from the parameter cache.
virtual Int_t DefineVariables(EMode mode=kDefine)
virtual EStatus Init(const TDatime &run_time)
TRotation & SetZAxis(const TVector3 &axis)
R__EXTERN class THcParmList * gHcParms
Class for the Calculate kinematics of scattering of the primary (beam) particle. These are usually th...
A standard Hall C spectrometer apparatus.