18 #define USE_PYTHIA8_DECAYER
21 void geometry( TString tag, Bool_t agml=
true )
23 TString cmd =
"DETP GEOM "; cmd += tag;
24 if ( !geant_maker ) geant_maker = (
St_geant_Maker *)chain->GetMaker(
"geant");
25 geant_maker -> LoadGeometry(cmd);
29 void command( TString cmd )
31 if ( !geant_maker ) geant_maker = (
St_geant_Maker *)chain->GetMaker(
"geant");
32 geant_maker -> Do( cmd );
45 void trig(
int runId,
int eventId,
double vz )
48 _primary -> SetVertex( 0.1, -0.1, vz );
49 _primary -> SetSigma ( 0.1E-12, 0.1E-12, 0.1E-12 );
63 void Pythia8( TString config=
"pp:W", Double_t ckin3=0.0, Double_t ckin4=-1.0 )
77 pythia8->
Set(
"WeakSingleBoson:all=off");
78 pythia8->
Set(
"WeakSingleBoson:ffbar2W=on");
79 pythia8->
Set(
"24:onMode=0");
80 pythia8->
Set(
"24:onIfAny 11 -11");
83 if ( config==
"pp:minbias" )
89 pythia8->
Set(
"HardQCD:all = on");
92 if ( config==
"pp:heavyflavor:D0jets" )
94 pythia8->
Set(
"HardQCD:gg2ccbar = on");
95 pythia8->
Set(
"HardQCD:qqbar2ccbar = on");
96 pythia8->
Set(
"Charmonium:all = on");
98 pythia8->
Set(
"421:mayDecay = 0");
107 pythia8 -> Set(Form(
"PhaseSpace:ptHatMin=%f", ckin3 ));
108 pythia8 -> Set(Form(
"PhaseSpace:ptHatMax=%f", ckin4 ));
110 _primary -> AddGenerator( pythia8 );
116 TString runfile =
"";
118 void getNextRun(
int& event,
int& run,
double& z ) {
120 static ifstream myfile;
125 myfile.open(runfile.Data());
129 if ( myfile.eof() ) {
137 myfile >> run >>
event >> x >> y >> z;
143 void starsim( Int_t nevents=10000, Int_t runnumber=15117062, TString runfile_=
"15117062.dat",
int sequence=0,
int dummy = 0 )
152 const int stride = 1;
154 int rngSeed = runnumber * stride + sequence;
162 TString basename = Form(
"rcf22000_%s_%i_%ievts",runfile.Data(),sequence,nevents);
164 gROOT->ProcessLine(
".L bfc.C");
166 TString simple =
"y2014x geant gstar usexgeom agml sdt20140530 DbV20150316 misalign ";
170 gSystem->Load(
"libVMC.so");
172 gSystem->Load(
"StarGeneratorUtil.so");
173 gSystem->Load(
"StarGeneratorEvent.so");
174 gSystem->Load(
"StarGeneratorBase.so" );
175 #ifdef USE_PYTHIA8_DECAYER
176 gSystem->Load(
"StarGeneratorDecay.so" );
178 gSystem->Load(
"Pythia8_3_03.so" );
180 gSystem->Load(
"libMathMore.so" );
183 gSystem->Load(
"xgeometry.so" );
185 gSystem->Load(
"$OPTSTAR/lib/libfastjet.so");
186 gSystem->Load(
"StarGeneratorFilt.so" );
187 gSystem->Load(
"FastJetFilter.so" );
208 _primary -> SetFileName(
"pythia8.starsim.root");
209 _primary->SetAttr(
"beamline", 1);
210 chain -> AddBefore(
"geant", _primary );
219 Pythia8(
"pp:heavyflavor:D0jets", ckin3, ckin4 );
221 #ifdef USE_PYTHIA8_DECAYER
230 decayPy8->
Set(
"421:onMode = 0");
232 decayPy8->
Set(
"421:onIfMatch = 321 -211");
237 double mass, lifetime, charge;
238 int tracktype, pdgcode, g3code;
251 command(
"call gstar_part");
262 _primary -> AddFilter( filter );
268 _primary->SetAttr(
"FilterKeepAll",
int(0));
308 command(
"gkine -4 0");
309 command( Form(
"gfile o %s.fzd",basename.Data()) );
316 for (
int _s=0;_s<stride;_s++) {
317 getNextRun( event, runnumber, z );
318 if ( 0==runnumber ) {
319 std::cout <<
"End of run file encountered" << std::endl;
325 command( Form(
"rung %i %i", runnumber, event ) );
327 trig( event, runnumber, z );
329 if ( count++ > nevents ) {
330 std::cout <<
"Last event requested" << std::endl;
337 std::cout <<
"Finishing up" << std::endl;
349 command(
"call agexit");
void SetFrame(const Char_t *frame, const Double_t val)
void SetPhiRange(Double_t phimin, Double_t phimax)
Set phi range. Particles falling outside this range will be dropped from simulation.
virtual void Clear(Option_t *option="")
User defined functions.
static StarParticleData & instance()
Returns a reference to the single instance of this class.
TParticlePDG * GetParticle(const Char_t *name)
Get a particle by name.
Main filter class. Goes anywhere in the chain, filters StarGenEvent objects.
Interface to PDG information.
void SetBlue(const Char_t *b)
Sets the particle species for the blue beam.
Connects VMC to class(es) which handle particle decays.
static void seed(UInt_t s)
Filter which requires one or more particles in the final state of the event record.
Base class for event records.
Main steering class for event generation.
void AddDecayer(Int_t pdgid, TVirtualMCDecayer *decayer)
void SetYell(const Char_t *y)
Sets the particle species for the yellow beam.
void SetPtRange(Double_t ptmin, Double_t ptmax=-1)
Set PT range. Particles falling outside this range will be dropped from simulation.
void SetDebug(int dbg=1)
Set the debug level.
static void capture()
Capture gRandom random number generator.
void SetEtaRange(Double_t etamin, Double_t etamax)
Set rapidity range. Particles falling outside this range will be dropped from simulation.
void Set(const char *s)
Pass a string to Pythia8::Pythia::readString(), for user configuration.
TParticlePDG * AddParticleToG3(const char *name, const double mass, const double lifetime, const double charge, const int tracktype, const int pdgcode, const int g3code, const double *bratio=0, const int *mode=0)
void Set(const char *cmd)
Modify pythia8 behavior.