1 #include "ERDecayLi9DetoLi10_Li9n_p.h" 3 #include "TVirtualMC.h" 4 #include "TLorentzVector.h" 6 #include "TMCProcess.h" 9 #include "FairRunSim.h" 15 #include "ERLi10MCEventHeader.h" 17 ERDecayLi9DetoLi10_Li9n_p::ERDecayLi9DetoLi10_Li9n_p():
19 fTargetReactionFinish(kFALSE),
27 fRnd =
new TRandom3();
28 FairRunSim* run = FairRunSim::Instance();
29 FairIon* Li10Ion =
new FairIon(
"Li10",3,10,3);
30 run->AddNewIon(Li10Ion);
31 FairIon* Li9Ion =
new FairIon(
"Li9",3,9,3);
32 run->AddNewIon(Li9Ion);
35 Bool_t ERDecayLi9DetoLi10_Li9n_p::Init(){
37 fLi10 = TDatabasePDG::Instance()->GetParticle(
"Li10");
39 std::cerr <<
"-W- ERDecayLi9DetoLi10_Li9n_p: Ion Li10 not found in database!" << endl;
43 fLi9 = TDatabasePDG::Instance()->GetParticle(
"Li9");
45 std::cerr <<
"-W- ERDecayLi9DetoLi10_Li9n_p: Ion Li9 not found in database!" << endl;
49 fH2 = TDatabasePDG::Instance()->GetParticle(
"Deuteron");
51 std::cerr <<
"-W- ERDecayLi9DetoLi10_Li9n_p: Ion Deuteron not found in database!" << endl;
55 fn = TDatabasePDG::Instance()->GetParticle(
"neutron");
57 std::cerr <<
"-W- ERDecayLi9DetoLi10_Li9n_p: Particle neutron not found in database!" << endl;
61 fp = TDatabasePDG::Instance()->GetParticle(
"proton");
63 std::cerr <<
"-W- ERDecayLi9DetoLi10_Li9n_p: Particle proton not found in database!" << endl;
71 ERDecayLi9DetoLi10_Li9n_p::~ERDecayLi9DetoLi10_Li9n_p(){
77 if (gMC->TrackPid() == 1000030090 && !fTargetReactionFinish && TString(gMC->CurrentVolName()).Contains(
"target")){
78 gMC->SetMaxStep(0.001);
79 TLorentzVector curPos;
80 gMC->TrackPosition(curPos);
82 if (curPos.Z() > fTargetReactZ){
83 std::cout <<
"Start reation in target. Defined pos: " << fTargetReactZ <<
", current pos: " << curPos.Z() << endl;
84 FairRunSim* run = FairRunSim::Instance();
86 header->SetReactionTime(gMC->TrackTime() * 1.0e09);
88 const double E10Li=600*10e-6;
89 const double mass9Li=fLi9->Mass();
90 const double mass1H=fp->Mass();
91 const double mass2H=fH2->Mass();
92 const double massn=fn->Mass();
93 const double mass10Li=fLi10->Mass();
94 double beam_total_energy = gMC->Etot();
95 double beam_T=beam_total_energy - mass9Li;
96 const double pin9Li = sqrt(beam_T*beam_T+2*mass9Li*beam_T);
98 TLorentzVector Vin9Li(0,0,pin9Li,beam_T+mass9Li);
99 TLorentzVector V2H (0,0,0,mass2H);
100 TLorentzVector Vofcm = Vin9Li+V2H;
101 TVector3 boost_vector = Vofcm.BoostVector();
102 Vin9Li.Boost(-boost_vector);
103 V2H.Boost(-boost_vector);
104 double Ecm = Vin9Li.E()+V2H.E();
105 double theta_cm = TMath::ACos(fRnd->Uniform(0.99,1.));
106 double phi_cm = fRnd->Uniform(0.0,2*TMath::Pi());
108 const double Ecm10Li=0.5*(Ecm*Ecm + mass10Li*mass10Li-mass1H*mass1H)/Ecm;
109 const double Ecmp=0.5*(Ecm*Ecm-mass10Li*mass10Li+mass1H*mass1H)/Ecm;
110 const double pcm10Li = sqrt(Ecm10Li*Ecm10Li-mass10Li*mass10Li);
111 TVector3 pcm = Vin9Li.Vect();
114 pcm.SetTheta(theta_cm);
117 TLorentzVector V10Li=TLorentzVector(pcm,Ecm10Li);
118 TLorentzVector V1H=TLorentzVector(-pcm,Ecmp);
119 V10Li.Boost(boost_vector);
120 V1H.Boost(boost_vector);
123 double theta_p1 = TMath::ACos(fRnd->Uniform(-1.00,1.00));
124 double phi_p1 = fRnd->Uniform(0.0,2*TMath::Pi());
126 TVector3 boost_vector1 = V10Li.BoostVector();
129 double ecm1 = mass10Li;
131 const double Ecm9Li= 0.5*(ecm1*ecm1+mass9Li*mass9Li-massn*massn)/ecm1;
133 const double pcm9Li = sqrt(Ecm9Li*Ecm9Li-mass9Li*mass9Li);
135 TVector3 pcm1(pcm9Li*TMath::Sin(theta_p1)*TMath::Cos(phi_p1),
136 pcm9Li*TMath::Sin(theta_p1)*TMath::Sin(phi_p1),
137 pcm9Li*TMath::Cos(theta_p1));
139 TLorentzVector V9Li(pcm1,mass9Li);
141 V9Li.Boost(boost_vector1);
143 TLorentzVector Vn(-pcm1,massn);
144 Vn.Boost(boost_vector1);
147 gMC->GetStack()->PushTrack(1, 0, 2212,
148 V1H.Px(),V1H.Py(),V1H.Pz(),
149 V1H.E(), curPos.X(), curPos.Y(), curPos.Z(),
150 gMC->TrackTime(), 0., 0., 0.,
151 kPDecay, newTrackNb,mass1H, 0);
153 gMC->GetStack()->PushTrack(1, 0, 2112,
154 Vn.Px(),Vn.Py(),Vn.Pz(),
155 Vn.E(), curPos.X(), curPos.Y(), curPos.Z(),
156 gMC->TrackTime(), 0., 0., 0.,
157 kPDecay, newTrackNb, massn, 0);
169 fTargetReactionFinish = kTRUE;
170 gMC->SetMaxStep(100.);
176 void ERDecayLi9DetoLi10_Li9n_p::BeginEvent(){
177 fTargetReactionFinish = kFALSE;
179 fTargetReactZ = fRnd->Uniform()*(.025+0.006);
180 FairRunSim* run = FairRunSim::Instance();
182 header->SetReactionPos(fTargetReactZ);
183 fSecondaryIonPDG = -1;
186 void ERDecayLi9DetoLi10_Li9n_p::FinishEvent(){