1 #ifndef MACRO_FUN4ALLG4EICDETECTOR_C
2 #define MACRO_FUN4ALLG4EICDETECTOR_C
4 #include <GlobalVariables.C>
12 #include <G4_Global.C>
29 #include <eiceval/EventEvaluatorEIC.h>
38 const
double particlemomMin = -1,
39 const
double particlemomMax = -1,
41 TString generatorSettings = "e10p250MB",
42 const
string &inputFile = "https:
43 const
string &outputFile = "G4EICDetector.root",
44 const
string &embed_input_file = "https:
46 const
string &outdir = ".")
75 if(particlemomMin==-1 && particlemomMax==-1){
80 if (particlemomMin>-1 && particlemomMax>-1){
105 if (generatorSettings.Contains(
"SimplePion"))
107 else if (generatorSettings.Contains(
"SimpleKaon"))
109 else if (generatorSettings.Contains(
"SimpleProton"))
111 else if (generatorSettings.Contains(
"SimplePhoton"))
113 else if (generatorSettings.Contains(
"SimpleNeutron"))
115 else if (generatorSettings.Contains(
"SimpleElectron"))
117 else if (generatorSettings.Contains(
"SimplePiZero"))
120 std::cout <<
"You didn't specify which particle you wanted to generate, exiting" << std::endl;
128 if (generatorSettings.Contains(
"central"))
130 else if (generatorSettings.Contains(
"bck"))
132 else if (generatorSettings.Contains(
"fwd"))
139 if(particlemomMin>-1 && particlemomMax == -1){
145 if(particlemomMin > -1)
155 if (generatorSettings.Contains(
"e10p250MB") )
157 else if (generatorSettings.Contains(
"e10p250pTHard5") )
158 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_ep_MinPartonP5GeV.cfg");
159 else if (generatorSettings.Contains(
"e10p250pTQ210"))
160 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_ep_QSquare10GeV.cfg");
161 else if (generatorSettings.Contains(
"e10p250pTHard10"))
162 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_ep_MinPartonP10GeV.cfg");
163 else if (generatorSettings.Contains(
"e10p250pTHard20"))
164 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_ep_MinPartonP20GeV.cfg");
165 else if (generatorSettings.Contains(
"e5p100MB") )
166 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e5p100.cfg");
167 else if (generatorSettings.Contains(
"e5p100pTHard5") )
168 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e5p100_MinPartonP5GeV.cfg");
169 else if (generatorSettings.Contains(
"e10p275MB") )
170 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e10p275.cfg");
171 else if (generatorSettings.Contains(
"e10p275pTHard5") )
172 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e10p275_MinPartonP5GeV.cfg");
173 else if (generatorSettings.Contains(
"e10p275pTHard10") )
174 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e10p275_MinPartonP10GeV.cfg");
175 else if (generatorSettings.Contains(
"e18p275MB") )
176 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e18p275.cfg");
177 else if (generatorSettings.Contains(
"e18p275pTHard5") )
178 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e18p275_MinPartonP5GeV.cfg");
179 else if (generatorSettings.Contains(
"e18p275pTHard10") )
180 INPUTGENERATOR::Pythia6->set_config_file(
string(getenv(
"CALIBRATIONROOT")) +
"/Generators/phpythia6_e18p275_MinPartonP10GeV.cfg");
184 if (generatorSettings.Contains(
"FPartTrigg")){
190 if (generatorSettings.Contains(
"FJetTrigg")){
193 if (generatorSettings.Contains(
"pTHard5"))
195 else if (generatorSettings.Contains(
"pTHard10"))
197 else if (generatorSettings.Contains(
"pTHard20"))
227 if(specialSetting.Contains(
"display"))
230 bool enableCentral =
true;
231 bool enableForwardTracking =
true;
232 bool enableElectronSide =
true;
257 if (specialSetting.Contains(
"EGEM")){
259 if (specialSetting.Contains(
"EGEMOO"))
265 if (specialSetting.Contains(
"FGEM")){
268 if (specialSetting.Contains(
"FGEMOrg")){
276 if (specialSetting.Contains(
"BARREL"))
278 if(specialSetting.Contains(
"FST"))
282 if(specialSetting.Contains(
"ALLSILICON")){
288 if(specialSetting.Contains(
"TTL")){
295 if(specialSetting.Contains(
"MVTX")){
300 if(specialSetting.Contains(
"ENDCAPTPC"))
305 if (specialSetting.Contains(
"INNERTRACKING")) {
308 if (specialSetting.Contains(
"TREXTOUT"))
329 if (specialSetting.Contains(
"BECAL") ){
355 if(specialSetting.Contains(
"FEMCSTANDALONE") || specialSetting.Contains(
"LFHCAL"))
363 if(specialSetting.Contains(
"DRCALO")){
366 if(!specialSetting.Contains(
"FwdConfig") && !specialSetting.Contains(
"FwdSquare")){
375 if ( specialSetting.Contains(
"LFHCAL")){
389 if (specialSetting.Contains(
"EEMCH")){
395 if(specialSetting.Contains(
"noEHCAL"))
404 if (specialSetting.Contains(
"TRACKEVALHITS")){
425 if(specialSetting.Contains(
"STANDALONE") ){
455 if(specialSetting.Contains(
"PIPE")){
459 if(specialSetting.Contains(
"Magnet"))
461 if(specialSetting.Contains(
"ALLSILICON"))
463 if(specialSetting.Contains(
"CEMC"))
465 if(specialSetting.Contains(
"DR"))
467 if(specialSetting.Contains(
"FEMC"))
469 if(specialSetting.Contains(
"FHCAL") && !specialSetting.Contains(
"LFHCAL"))
471 if(specialSetting.Contains(
"LFHCAL"))
473 if(specialSetting.Contains(
"BECAL"))
475 if(specialSetting.Contains(
"EHCAL"))
477 if(specialSetting.Contains(
"EEMCH"))
479 if(specialSetting.Contains(
"CHCAL")){
483 if(specialSetting.Contains(
"DIRC"))
486 if(specialSetting.Contains(
"FWDCALO")){
490 if(specialSetting.Contains(
"FWDLCALO")){
494 if(specialSetting.Contains(
"BARCALO")){
500 if(specialSetting.Contains(
"BCKCALO")){
504 if(specialSetting.Contains(
"TTL")){
508 if(specialSetting.Contains(
"FTTL"))
510 if(specialSetting.Contains(
"ETTL")){
515 if(specialSetting.Contains(
"CTTL")){
622 if(specialSetting.Contains(
"3T")){
737 string outputroot = outdir +
"/" + outputFile;
738 string remove_this =
".root";
739 size_t pos = outputroot.find(remove_this);
740 if (pos != string::npos){
741 outputroot.erase(pos, remove_this.length());
749 bool doFullEventTree =
true;
753 if(specialSetting.Contains(
"GEOMETRYTREE"))
793 if (specialSetting.Contains(
"TRACKEVALHITS"))
Tracking_Eval(outputroot +
"_g4tracking_eval.root", specialSetting);
818 if (specialSetting.Contains(
"viewer")){
819 gROOT->ProcessLine(
"PHG4Reco *g4 = QTGui();");
822 gROOT->ProcessLine(
"Fun4AllServer *se = Fun4AllServer::instance();");
823 gROOT->ProcessLine(
"PHG4Reco *g4 = (PHG4Reco *) se->getSubsysReco(\"PHG4RECO\");");
825 cout <<
"-------------------------------------------------" << endl;
826 cout <<
"You are in event display mode. Run one event with" << endl;
827 cout <<
"se->run(1)" << endl;
828 cout <<
"Run Geant4 command with following examples" << endl;
829 gROOT->ProcessLine(
"displaycmd()");
839 cout <<
"using 0 for number of events is a bad idea when using particle generators" << endl;
840 cout <<
"it will run forever, so I just return without running anything" << endl;
854 std::cout <<
"All done" << std::endl;
866 if (specialSetting.Contains(
"BARRELV1"))
870 else if (specialSetting.Contains(
"BARRELV2"))
874 else if (specialSetting.Contains(
"BARRELV3"))
878 else if (specialSetting.Contains(
"BARRELV4"))
882 else if (specialSetting.Contains(
"BARREL"))
888 if (specialSetting.Contains(
"FSTV1"))
892 else if (specialSetting.Contains(
"FSTV2"))
896 else if (specialSetting.Contains(
"FSTV3"))
900 else if (specialSetting.Contains(
"FSTV4"))
904 else if (specialSetting.Contains(
"FSTV41"))
908 else if (specialSetting.Contains(
"FSTV42"))
912 else if (specialSetting.Contains(
"FSTVTPC"))
916 else if (specialSetting.Contains(
"FST"))
922 if (specialSetting.Contains(
"fsPHENIX"))
926 else if (specialSetting.Contains(
"EC2x"))
930 else if (specialSetting.Contains(
"ROS"))
935 if (specialSetting.Contains(
"FullEtaAcc"))
940 if (specialSetting.Contains(
"ASYM"))
946 if (specialSetting.Contains(
"XDEPTH"))
951 if (specialSetting.Contains(
"wDR"))
958 if (specialSetting.Contains(
"FwdConfig"))
966 if (specialSetting.Contains(
"FwdSquare"))
975 if (specialSetting.Contains(
"HC2x"))
980 if (specialSetting.Contains(
"FHCFeTungsten"))
984 if (specialSetting.Contains(
"FHCFeTungsten"))
988 else if (specialSetting.Contains(
"HC4x"))
993 if (specialSetting.Contains(
"towercalib1"))
997 else if (specialSetting.Contains(
"towercalibSiPM"))
1001 else if (specialSetting.Contains(
"towercalibHCALIN"))
1005 else if (specialSetting.Contains(
"towercalib3"))
1010 if (specialSetting.Contains(
"DRTungsten"))
1014 if (specialSetting.Contains(
"DRQuartz"))
1018 if (specialSetting.Contains(
"DRPMMA"))
1022 if (specialSetting.Contains(
"DRTUBES"))
1028 if (specialSetting.Contains(
"purePbWO4"))
1033 if (specialSetting.Contains(
"BECAL")){
1039 if (specialSetting.Contains(
"EEMCH"))
1044 if (specialSetting.Contains(
"TTLEMd"))
1046 else if (specialSetting.Contains(
"TTLEMl"))
1048 else if (specialSetting.Contains(
"TTLEMs"))
1050 else if (specialSetting.Contains(
"TTLF"))
1053 if (specialSetting.Contains(
"LYSO")){
1057 if (specialSetting.Contains(
"TTLBasicGeo")){
1064 if (specialSetting.Contains(
"ACLGAD"))
1066 else if (specialSetting.Contains(
"LGLGAD"))
1069 if (specialSetting.Contains(
"ALLSILICONV3"))
1073 if (specialSetting.Contains(
"OIRC"))
1077 if (specialSetting.Contains(
"FWDDETS")){