1 #ifndef MACRO_FUN4ALLG4EICDETECTORMODULAR_C
2 #define MACRO_FUN4ALLG4EICDETECTORMODULAR_C
4 #include <GlobalVariables.C>
10 #include <G4_DSTReader_Beast.C>
12 #include <G4_Global.C>
30 #include <eiceval/EventEvaluatorEIC.h>
40 const
double particlemomMin = -1,
41 const
double particlemomMax = -1,
43 TString generatorSettings = "e10p250MB",
44 const
string &inputFile = "https:
45 const
string &outputFile = "G4EICDetector.root",
46 const
string &embed_input_file = "https:
48 const
string &outdir = ".")
74 if(particlemomMin==-1 && particlemomMax==-1){
79 if (particlemomMin>-1 && particlemomMax>-1){
104 if (generatorSettings.Contains(
"SimplePion"))
106 else if (generatorSettings.Contains(
"SimpleKaon"))
108 else if (generatorSettings.Contains(
"SimpleProton"))
110 else if (generatorSettings.Contains(
"SimplePhoton"))
112 else if (generatorSettings.Contains(
"SimplePiZero"))
115 std::cout <<
"You didn't specify which particle you wanted to generate, exiting" << std::endl;
129 if(particlemomMin>-1 && particlemomMax == -1){
134 if(particlemomMin > -1)
144 if (generatorSettings.Contains(
"e10p250MB") )
146 else if (generatorSettings.Contains(
"e10p250pTHard5") )
147 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_ep_MinPartonP5GeV.cfg");
148 else if (generatorSettings.Contains(
"e10p250pTHard10"))
149 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_ep_MinPartonP10GeV.cfg");
150 else if (generatorSettings.Contains(
"e10p250pTHard20"))
151 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_ep_MinPartonP20GeV.cfg");
152 else if (generatorSettings.Contains(
"e5p100MB") )
153 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e5p100.cfg");
154 else if (generatorSettings.Contains(
"e5p100pTHard5") )
155 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e5p100_MinPartonP5GeV.cfg");
156 else if (generatorSettings.Contains(
"e10p275MB") )
157 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e10p275.cfg");
158 else if (generatorSettings.Contains(
"e10p275pTHard5") )
159 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e10p275_MinPartonP5GeV.cfg");
160 else if (generatorSettings.Contains(
"e10p275pTHard10") )
161 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e10p275_MinPartonP10GeV.cfg");
162 else if (generatorSettings.Contains(
"e18p275MB") )
163 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e18p275.cfg");
164 else if (generatorSettings.Contains(
"e18p275pTHard5") )
165 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e18p275_MinPartonP5GeV.cfg");
166 else if (generatorSettings.Contains(
"e18p275pTHard10") )
167 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e18p275_MinPartonP10GeV.cfg");
171 if (generatorSettings.Contains(
"FPartTrigg")){
177 if (generatorSettings.Contains(
"FJetTrigg")){
180 if (generatorSettings.Contains(
"pTHard5"))
182 else if (generatorSettings.Contains(
"pTHard10"))
184 else if (generatorSettings.Contains(
"pTHard20"))
212 if(specialSetting.Contains(
"display"))
215 bool enableCentral =
true;
216 bool enableForwardTracking =
true;
217 bool enableElectronSide =
true;
236 if (specialSetting.Contains(
"EGEM")){
238 if (specialSetting.Contains(
"EGEMOO"))
242 if (specialSetting.Contains(
"FGEM")){
245 if (specialSetting.Contains(
"FGEMOrg")){
253 if (specialSetting.Contains(
"BARREL"))
255 if(specialSetting.Contains(
"FST"))
259 if(specialSetting.Contains(
"ALLSILICON")){
265 if(specialSetting.Contains(
"FTTL"))
267 if(specialSetting.Contains(
"ETTL"))
269 if(specialSetting.Contains(
"CTTL"))
273 if(specialSetting.Contains(
"MVTX")){
278 if(specialSetting.Contains(
"ENDCAPTPC"))
283 if (specialSetting.Contains(
"TREXTOUT"))
288 if (specialSetting.Contains(
"TRACKEVALHITS")){
301 if(specialSetting.Contains(
"FHCALSTANDALONE") || specialSetting.Contains(
"FEMCSTANDALONE") || specialSetting.Contains(
"CALOSTANDALONE"))
310 if(specialSetting.Contains(
"FHCALSTANDALONE") || specialSetting.Contains(
"FEMCSTANDALONE") || specialSetting.Contains(
"CALOSTANDALONE"))
333 if(specialSetting.Contains(
"FHCALSTANDALONE") )
342 if(specialSetting.Contains(
"FEMCSTANDALONE") )
354 if(specialSetting.Contains(
"FHCALSTANDALONE") || specialSetting.Contains(
"FEMCSTANDALONE") || specialSetting.Contains(
"CALOSTANDALONE"))
361 if (specialSetting.Contains(
"EHCAL"))
363 if(specialSetting.Contains(
"FEMCSTANDALONE") )
375 if(specialSetting.Contains(
"FHCALSTANDALONE")){
390 if(specialSetting.Contains(
"FEMCSTANDALONE")){
405 if(specialSetting.Contains(
"CALOSTANDALONE")){
540 string outputroot = outdir +
"/" + outputFile;
541 string remove_this =
".root";
542 size_t pos = outputroot.find(remove_this);
543 if (pos != string::npos){
544 outputroot.erase(pos, remove_this.length());
552 Bool_t doFullEventTree = kTRUE;
557 if(specialSetting.Contains(
"FHCALSTANDALONE")){
560 }
else if(specialSetting.Contains(
"FEMCSTANDALONE")){
563 }
else if(specialSetting.Contains(
"CALOSTANDALONE")){
590 if (specialSetting.Contains(
"TRACKEVALHITS"))
Tracking_Eval(outputroot +
"_g4tracking_eval.root", specialSetting);
618 gROOT->ProcessLine(
"Fun4AllServer *se = Fun4AllServer::instance();");
619 gROOT->ProcessLine(
"PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco(\"PHG4RECO\");");
621 cout <<
"-------------------------------------------------" << endl;
622 cout <<
"You are in event display mode. Run one event with" << endl;
623 cout <<
"se->run(1)" << endl;
624 cout <<
"Run Geant4 command with following examples" << endl;
625 gROOT->ProcessLine(
"displaycmd()");
635 cout <<
"using 0 for number of events is a bad idea when using particle generators" << endl;
636 cout <<
"it will run forever, so I just return without running anything" << endl;
650 std::cout <<
"All done" << std::endl;
662 if (specialSetting.Contains(
"BARRELV1"))
666 else if (specialSetting.Contains(
"BARRELV2"))
670 else if (specialSetting.Contains(
"BARRELV3"))
674 else if (specialSetting.Contains(
"BARRELV4"))
678 else if (specialSetting.Contains(
"BARREL"))
684 if (specialSetting.Contains(
"FSTV1"))
688 else if (specialSetting.Contains(
"FSTV2"))
692 else if (specialSetting.Contains(
"FSTV3"))
696 else if (specialSetting.Contains(
"FSTV4"))
700 else if (specialSetting.Contains(
"FSTV41"))
704 else if (specialSetting.Contains(
"FSTV42"))
708 else if (specialSetting.Contains(
"FSTVTPC"))
712 else if (specialSetting.Contains(
"FST"))
718 if (specialSetting.Contains(
"fsPHENIX"))
722 else if (specialSetting.Contains(
"EC2x"))
727 if (specialSetting.Contains(
"FullEtaAcc"))
732 if (specialSetting.Contains(
"HC2x"))
736 else if (specialSetting.Contains(
"HC4x"))
742 if (specialSetting.Contains(
"towercalib1"))
746 else if (specialSetting.Contains(
"towercalibSiPM"))
750 else if (specialSetting.Contains(
"towercalibHCALIN"))
754 else if (specialSetting.Contains(
"towercalib3"))