17 void runTrigTreeMaker(
const Char_t *file=
"rcf10063_2_6000evts.MuDst.root",
const Char_t* fileOut =
"rcf10063_2_6000evts.TrigTree-A.root", Char_t trigVer =
'g', Int_t nevents = 10000000,
18 Int_t flagMC = 1,
const Char_t *eemcSetupPath=
"/star/u/sgliske/Share/StarTrigSimuSetup/" ){
24 int L2ConfigYear=2006;
29 TString outDir=
"./outL2/";
31 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
32 loadSharedLibraries();
33 assert( !gSystem->Load(
"StDetectorDbMaker"));
34 assert( !gSystem->Load(
"StTpcDb"));
35 assert( !gSystem->Load(
"StDbUtilities"));
36 assert( !gSystem->Load(
"StDbBroker"));
37 assert( !gSystem->Load(
"St_db_Maker"));
38 assert( !gSystem->Load(
"StEEmcUtil"));
39 assert( !gSystem->Load(
"StEEmcDbMaker"));
40 assert( !gSystem->Load(
"StDaqLib"));
41 assert( !gSystem->Load(
"StEmcRawMaker"));
42 assert( !gSystem->Load(
"StEmcADCtoEMaker"));
44 assert( !gSystem->Load(
"StMcEvent"));
45 assert( !gSystem->Load(
"StMcEventMaker"));
46 assert( !gSystem->Load(
"StEmcSimulatorMaker"));
47 assert( !gSystem->Load(
"StEEmcSimulatorMaker"));
48 assert( !gSystem->Load(
"StEpcMaker"));
50 assert( !gSystem->Load(
"StTriggerUtilities"));
51 assert( !gSystem->Load(
"StSpinDbMaker") );
52 assert( !gSystem->Load(
"StEEmcPoolEEmcTreeContainers") );
53 assert( !gSystem->Load(
"StEEmcTreeMaker") );
55 gROOT->Macro(
"LoadLogger.C");
56 cout <<
" loading done " << endl;
63 geantFile.ReplaceAll(
"MuDst.root",
"geant.root");
64 printf(
"geantFile=%s\n", geantFile.Data());
66 ioMaker->SetFile(geantFile);
67 ioMaker->SetIOMode(
"r");
68 ioMaker->SetBranch(
"*",0,
"0");
69 ioMaker->SetBranch(
"geantBranch",0,
"r");
74 printf(
" Analyzing file=%s\n",file);
83 dbMk =
new St_db_Maker(
"StarDb",
"MySQL:StarDb",
"MySQL:StarDb",
"$STAR/StarDb");
85 dbMk =
new St_db_Maker(
"Calibrations",
"MySQL:Calibrations_emc");
86 dbMk->SetAttr(
"blacklist",
"fgt");
87 dbMk->SetAttr(
"blacklist",
"svt");
88 dbMk->SetAttr(
"blacklist",
"tpc");
89 dbMk->SetAttr(
"blacklist",
"ftpc");
98 TObjArray* HList=
new TObjArray;
105 if (flagMC && useBemc) {
107 if (bemcConfig == 1) {
112 if (flagMC==0 && useBemc){
114 if (bemcConfig == 1) {
122 if (0 && flagMC==1 && useEemc){
144 simuTrig->setHList(HList);
145 simuTrig->setMC(flagMC);
148 simuTrig->useEemc(0);
149 simuTrig->eemc->setSetupPath(eemcSetupPath);
153 simuTrig->bemc->setConfig(bemcConfig);
156 if(flagMC && useEemc==2){
159 int eemcDsmSetup[20];
160 memset(eemcDsmSetup, 0,
sizeof(eemcDsmSetup));
162 if( trigVer ==
'd' ){
170 }
else if ( trigVer ==
'e' ){
178 }
else if ( trigVer ==
'f' ){
186 }
else if ( trigVer ==
'g' ){
194 }
else if ( trigVer ==
'h' || trigVer ==
'i' ){
203 cerr <<
"Invalid trigger version" << endl;
208 simuTrig->eemc->setDsmSetup(eemcDsmSetup);
228 simL2Mk->setSetupPath(eemcSetupPath);
230 simL2Mk->setOutPath(outDir.Data());
231 if (flagMC) simL2Mk->setMC();
232 simuTrig->useL2(simL2Mk);
237 treeMkr->addTrigger( -999 );
241 cout <<
"******* Initialize *******" << endl ;
243 cout <<
"******* done with initializing *******" << endl;
245 for (Int_t iev=0;iev<nevents; iev++) {
247 cout <<
"Working on eventNumber:\t" << iev <<
"\tof:\t"<<nevents<<endl;
250 int iret = chain->
Make(iev);
253 cout << iev <<
" Bad return code!" << endl;
281 cout <<
"****************************************** " << endl;
282 cout <<
"total number of events " << total << endl;
283 cout <<
"****************************************** " << endl;
285 if (outputL2Histo==1) {
288 printf(
"=%s=\n",fileMu.Data());
289 if(fileMu.Contains(
".lis")) fileMu.ReplaceAll(
".lis",
".trgSim");
290 if(fileMu.Contains(
".MuDst.root")) fileMu.ReplaceAll(
".MuDst.root",
".trgSim");
291 TString outF=outDir+fileMu;
293 printf(
"=%s=\n",outF.Data());
294 hf=
new TFile(outF,
"recreate");
296 cout <<
"HList not saved, or seg faults" << endl;
301 printf(
"\n Failed to open Histo-file -->%s<, continue\n",outF.Data());
void setAddPed(Bool_t a=true)
Add pedestal offsets from DB.
virtual void Clear(Option_t *option="")
User defined functions.
void setCheckStatus(StDetectorId det, bool flag)
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...
virtual void ls(Option_t *option="") const
void setSmearPed(Bool_t s=true)
Smear the pedestal with sigma from DB.
void setCalibSpread(StDetectorId det, float spread)
smear simulator calibration coefficients using Gaussian with this RMS.
void setCheckStatus(StDetectorId det, int flag, const char *option="")