1 #include "StarLightGen.h"
4 #include "randomgenerator.h"
5 #include "TDatabasePDG.h"
6 #include "TParticlePDG.h"
8 #include "StarGenerator/UTIL/StarRandom.h"
9 #include "StarGenerator/EVENT/StarGenAAEvent.h"
10 #include "StarGenerator/EVENT/StarGenPPEvent.h"
11 #include "StarGenerator/EVENT/StarGenParticle.h"
13 #include "inputParameters.h"
19 Double_t rndm_( Int_t *idummy ){
37 ParametersInt[
"BEAM_1_Z"] = 79;
38 ParametersInt[
"BEAM_1_A"] = 197;
39 ParametersInt[
"BEAM_2_Z"] = 79;
40 ParametersInt[
"BEAM_2_A"] = 197;
41 ParametersDouble[
"BEAM_GAMMA"] = 106;
42 ParametersDouble[
"W_MAX"] = 4.0;
43 ParametersDouble[
"W_MIN"] = 0.0;
44 ParametersInt[
"W_N_BINS"] = 40;
45 ParametersDouble[
"RAP_MAX"] = 4.;
46 ParametersInt[
"RAP_N_BINS"] = 80;
47 ParametersInt[
"CUT_PT"] = 0;
48 ParametersDouble[
"PT_MIN"] = 1.0;
49 ParametersDouble[
"PT_MAX"] = 3.0;
50 ParametersInt[
"CUT_ETA"] = 0;
51 ParametersInt[
"ETA_MIN"] = -10;
52 ParametersInt[
"ETA_MAX"] = 10;
53 ParametersInt[
"PROD_MODE"] = 2;
54 ParametersInt[
"PROD_PID"] = 444;
55 ParametersInt[
"BREAKUP_MODE"] = 5;
56 ParametersInt[
"INTERFERENCE"] = 0;
57 ParametersDouble[
"IF_STRENGTH"] = 1.;
58 ParametersInt[
"COHERENT"] = 1;
59 ParametersDouble[
"INCO_FACTOR"] = 1.;
60 ParametersDouble[
"BFORD"] = 9.5;
61 ParametersDouble[
"INT_PT_MAX"] = 0.24;
62 ParametersInt[
"INT_PT_N_BINS"] = 120;
63 ParametersInt[
"RND_SEED"] = 12345;
64 ParametersInt[
"OUTPUT_FORMAT"] = 0;
74 Double_t ProtonMass = 0.938272046;
76 Double_t NeutronMass = 0.939565378;
79 map<TString,Int_t> A, Z;
80 A[
"p"] = 1; Z[
"p"] = 1;
81 A[
"n"] = 1; Z[
"n"] = 0;
82 A[
"d"] = 2; Z[
"d"] = 1;
83 A[
"He3"] = 3; Z[
"He3"] = 2;
84 A[
"Au"] = 197; Z[
"Au"] = 79;
85 A[
"Cu"] = 64; Z[
"Cu"] = 29;
86 A[
"U"] = 238; Z[
"U"] = 92;
89 A[
"proton"] =1; Z[
"proton"] =1;
90 A[
"neutron"] =1; Z[
"neutron"] =0;
91 A[
"deuteron"] =2; Z[
"deuteron"] =1;
92 A[
"e-"] =0; Z[
"e-"] =0;
93 A[
"electron"] =0; Z[
"electron"] =0;
94 A[
"e+"] =0; Z[
"e+"] =0;
95 A[
"positron"] =0; Z[
"positron"] =0;
98 TString myBlue =
mBlue;
99 TString myYell =
mYell;
106 ParametersInt[
"BEAM_1_A"] = A[myBlue];
107 ParametersInt[
"BEAM_1_Z"] = Z[myBlue];
108 ParametersInt[
"BEAM_2_A"] = A[myYell];
109 ParametersInt[
"BEAM_2_Z"] = Z[myYell];
115 ParametersDouble[
"BEAM_GAMMA"] =
mRootS/(((Z[myBlue]+Z[myYell])*ProtonMass)+((A[myBlue]-Z[myBlue]+A[myYell]-Z[myYell])*NeutronMass));
124 ParametersDouble[
"BEAM_GAMMA"] =
mRootS/(((Z[myBlue]+Z[myYell])*ProtonMass)+((A[myBlue]-Z[myBlue]+A[myYell]-Z[myYell])*NeutronMass));
146 return StMaker::Init();
156 upcEvent event = mSTARlight -> produceEvent();
169 const std::vector<starlightParticle> &particles = *(
event.getParticles());
172 for ( UInt_t i=0;i<particles.size();i++ )
174 Int_t q = particles[i].getCharge();
175 Int_t
id = particles[i].getPdgCode();
177 Int_t mother1 = ParametersInt[
"PROD_PID"];
178 Int_t mother2 = ParametersInt[
"PROD_PID"];
181 Double_t px = particles[i].GetPx();
182 Double_t py = particles[i].GetPy();
183 Double_t pz = particles[i].GetPz();
184 Double_t energy = particles[i].GetE();
185 Double_t mass = particles[i].M();
197 mEvent -> AddParticle( stat,
id, mother1, mother2, daughter1, daughter2, px, py, pz, energy, mass, vx, vy, vz, vt );
218 event -> process = ParametersInt[
"PROD_PID"];
219 event -> subprocess = 0;
221 event -> idParton1 = 0;
222 event -> idParton2 = 0;
223 event -> xParton1 = 0;
224 event -> xParton2 = 0;
229 event -> valence1 = 0;
230 event -> valence2 = 0;
236 event -> thetaHat = 0;
256 event -> process = ParametersInt[
"PROD_PID"];
257 event -> subprocess = 0;
259 event -> idParton1 = 0;
260 event -> idParton2 = 0;
261 event -> xParton1 = 0;
262 event -> xParton2 = 0;
267 event -> valence1 = 0;
268 event -> valence2 = 0;
274 event -> thetaHat = 0;
281 void StarLightGen::ProcessParameters()
284 std::ofstream params_out;
285 params_out.open(
"starlight.in" );
286 for(map<TString,Double_t>::iterator i = ParametersDouble.begin(); i != ParametersDouble.end(); i++)
288 params_out << i->first <<
" = " << i->second << endl;
290 for(map<TString,Int_t>::iterator i = ParametersInt.begin(); i != ParametersInt.end(); i++)
292 params_out << i->first <<
" = " << i->second << endl;
298 _parameters -> init(
"starlight.in" );
299 mSTARlight -> setInputParameters( _parameters );
301 mSTARlight -> init();
304 void StarLightGen::SetEtaCut( Double_t low, Double_t high )
306 ParametersDouble[
"ETA_MIN"] = low;
307 ParametersDouble[
"ETA_MAX"] = high;
308 ParametersInt[
"CUT_ETA"] = 1;
311 void StarLightGen::SetPtCut( Double_t low, Double_t high )
313 ParametersDouble[
"PT_MIN"] = low;
314 ParametersDouble[
"PT_MAX"] = high;
315 ParametersInt[
"CUT_PT"] = 1;
318 void StarLightGen::SetRapidityValues( Double_t high, Int_t bins )
320 ParametersDouble[
"RAP_MAX"] = high;
321 ParametersInt[
"RAP_N_BINS"] = bins;
324 void StarLightGen::SetWValues( Double_t low, Double_t high, Int_t bins )
326 ParametersDouble[
"W_MIN"] = low;
327 ParametersDouble[
"W_MAX"] = high;
328 ParametersInt[
"W_N_BINS"] = bins;
331 void StarLightGen::SetProductionMode( Int_t mode )
333 ParametersInt[
"PROD_MODE"] = mode;
336 void StarLightGen::SetProductionPID( Int_t pid )
338 ParametersInt[
"PROD_PID"] = pid;
341 void StarLightGen::SetBreakupMode( Int_t mode )
343 ParametersInt[
"BREAKUP_MODE"] = mode;
346 void StarLightGen::SetInterference( Double_t percent )
348 if( (percent > 1) || (percent<0) )
350 cout <<
"starSTARlight::SetInterference( Double_t percent ) : percent must be a value between 0 and 1." << endl;
351 assert( (percent > 1) || (percent<0) );
354 ParametersDouble[
"IF_STRENGTH"] = percent;
355 ParametersInt[
"INTERFERENCE"] = 1;
358 void StarLightGen::SetIncoherence( Double_t percent )
360 if( (percent > 1) || (percent<0) )
362 cout <<
"starSTARlight::SetIncoherence( Double_t percent ) : percent must be a value between 0 and 1." << endl;
363 assert( (percent > 1) || (percent<0) );
366 ParametersDouble[
"INCO_FACTOR"] = percent;
367 ParametersInt[
"COHERENT"] = 0;
370 void StarLightGen::SetBFORD( Double_t value )
372 ParametersDouble[
"BFORD"] = value;
375 void StarLightGen::SetInterferencePtValues( Double_t high, Int_t bins )
377 ParametersDouble[
"INT_PT_MAX"] = high;
378 ParametersInt[
"INT_PT_N_BINS"] = bins;
void FillAA(StarGenEvent *event)
(Optional) Method to fill a AA event
StarLightGen(const Char_t *name="STARlight")
Double_t mRootS
CMS energy or incident beam momentum for fixed target collisions.
static StarRandom & Instance()
Obtain the single instance of the random number generator.
TString mYell
Name of the yellow beam particle (-z)
Event record tailored to heavy ion collisions.
Event record class tailored to PP kinematics.
TLorentzVector mYellMomentum
4-Momentum of the yellow beam
ABC for defining event generator interfaces.
StarGenEvent * mEvent
Generated event.
void FillPP(StarGenEvent *event)
(Optional) Method to fill a PP event
TLorentzVector mBlueMomentum
4-Momentum of the blue beam
Interface to the StarLightGen (c++ version) event generator.
Double_t flat() const
Return a random number uniformly distributed between 0 and 1.
Base class for event records.
TString mFrame
Frame of the collision, i.e. CMS, FIXT, 3MOM, 4MOM, 5MOM.
TString mBlue
Name of the blue beam particle (+z)