44 void makeEEmcTreePart1( Long_t neventsIn = -1,
45 Long_t neventsOut = -1,
46 const Char_t *inputFileName =
"",
47 const Char_t *outputFileName =
"McEEmcTree.root",
48 Int_t displayFreq = 1000,
50 Char_t* eemcSetupPath =
"/star/u/sgliske/Share/StarTrigSimuSetup/",
52 Bool_t noMCdateTime = 0,
53 Bool_t skipMcTreeMaker = 0 ){
55 std::cout <<
"***** Loading libraries *****" << endl;
57 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
58 loadSharedLibraries();
59 assert( !gSystem->Load(
"StDetectorDbMaker"));
60 assert( !gSystem->Load(
"StTpcDb"));
61 assert( !gSystem->Load(
"StDbUtilities"));
62 assert( !gSystem->Load(
"StDbBroker"));
63 assert( !gSystem->Load(
"St_db_Maker"));
64 assert( !gSystem->Load(
"StEEmcUtil"));
65 assert( !gSystem->Load(
"StEEmcDbMaker"));
66 assert( !gSystem->Load(
"StEEmcA2EMaker"));
67 assert( !gSystem->Load(
"StDaqLib"));
68 assert( !gSystem->Load(
"StEmcRawMaker"));
69 assert( !gSystem->Load(
"StEmcADCtoEMaker"));
71 assert( !gSystem->Load(
"StMcEvent"));
72 assert( !gSystem->Load(
"StMcEventMaker"));
73 assert( !gSystem->Load(
"StEmcSimulatorMaker"));
74 assert( !gSystem->Load(
"StEEmcSimulatorMaker"));
75 assert( !gSystem->Load(
"StEpcMaker"));
77 assert( !gSystem->Load(
"StSpinDbMaker") );
78 assert( !gSystem->Load(
"StTriggerUtilities"));
79 assert( !gSystem->Load(
"StEEmcPoolEEmcTreeContainers") );
80 assert( !gSystem->Load(
"StEEmcTreeMaker") );
84 std::cout <<
"***** Done loading libraries *****" << endl;
85 std::cout <<
"***** Instanciating all the classes *****" << endl;
90 analysisChain =
new StChain(
"eemcAnalysisChain");
98 TString geantFileName = inputFileName;
99 geantFileName.ReplaceAll(
"MuDst",
"geant");
100 ioMaker->SetFile(geantFileName);
103 ioMaker->SetBranch(
"*",0,
"1");
104 ioMaker->SetBranch(
"geantBranch",0,
"r");
105 ioMaker->SetBranch(
"minimcBranch",0,
"r");
111 Int_t nfiles = 10000;
112 muDstMaker =
new StMuDstMaker( 0, 0,
"", inputFileName,
"MuDst", nfiles );
115 muDstMaker->
SetStatus(
"PrimaryVertices",1);
126 mcEventMaker->doPrintEventInfo =
false;
134 starDatabase =
new St_db_Maker(
"StarDb",
"MySQL:StarDb",
"MySQL:StarDb",
"$STAR/StarDb");
135 starDatabase->SetAttr(
"blacklist",
"fgt");
136 starDatabase->SetAttr(
"blacklist",
"svt");
137 starDatabase->SetAttr(
"blacklist",
"tpc");
138 starDatabase->SetAttr(
"blacklist",
"ftpc");
140 if( isMC && noMCdateTime )
141 starDatabase->SetDateTime(20060512,43500);
152 gMessMgr->SwitchOff(
"D");
153 gMessMgr->SwitchOff(
"I");
168 a2EMakerPtr->
source(
"MuDst",1);
191 energyMakerPtr->setStripThres( isMC ? 0.0 : 0.001 );
192 energyMakerPtr->setTowerThres( isMC ? 0.0 : 1.0 );
224 simuTrig->setMC(isMC);
226 simuTrig->useEemc(0);
227 simuTrig->eemc->setSetupPath(eemcSetupPath);
230 TObjArray* HList=
new TObjArray;
231 simuTrig->setHList(HList);
234 int eemcDsmSetup[20];
235 memset(eemcDsmSetup, 0,
sizeof(eemcDsmSetup));
237 if( trigVer ==
'd' ){
245 }
else if ( trigVer ==
'e' ){
253 }
else if ( trigVer ==
'f' ){
261 }
else if ( trigVer ==
'g' ){
269 }
else if ( trigVer ==
'h' ){
278 cerr <<
"Invalid trigger version" << endl;
282 simuTrig->eemc->setDsmSetup(eemcDsmSetup);
286 simL2Mk->setSetupPath(eemcSetupPath);
288 if (isMC) simL2Mk->setMC();
289 simuTrig->useL2(simL2Mk);
295 treeMakerPtr->
setTreeStatus( StEEmcTreeMaker_t::PART_1, StEEmcTreeMaker_t::WRITE, outputFileName );
296 treeMakerPtr->
setTreeStatus( StEEmcTreeMaker_t::PART_2, StEEmcTreeMaker_t::IGNORE,
"" );
297 treeMakerPtr->
setTreeStatus( StEEmcTreeMaker_t::PART_3, StEEmcTreeMaker_t::IGNORE,
"" );
298 treeMakerPtr->setMaxNumEvents( neventsIn );
299 treeMakerPtr->setEEmcEnergyMkr( energyMakerPtr );
300 treeMakerPtr->doSpinInfoIO( !isMC );
301 treeMakerPtr->doEvtHddrIO( 1 );
302 treeMakerPtr->setHTTPthres( 0, 0 );
307 treeMakerPtr->setSpinInfoMkr( spinInfoMakerPtr );
310 if( isMC && !skipMcTreeMaker ){
312 TString filename = outputFileName;
313 if( filename.Contains(
"EEmcTree") )
314 filename.ReplaceAll(
"EEmcTree",
"McEEmcTree" );
315 else if ( filename.EndsWith(
".root") )
316 filename.ReplaceAll(
".root",
".McEEmcTree.root");
318 filename +=
".McEEmcTree.root";
319 filename.ReplaceAll(
"_Part1",
"");
320 filename.ReplaceAll(
".Part1",
"");
323 mcTreeMakerPtr->setEnergyThreshold( 0.0 );
324 mcTreeMakerPtr->addTrigger( -999 );
325 mcTreeMakerPtr->
setTreeStatus( StMcEEmcTreeMaker_t::WRITE, filename.Data() );
329 std::cout <<
"***** Done instanciating all the classes *****" << endl;
330 analysisChain->
ls(3);
336 std::cout <<
"***** Initializing all makers in the analysis chain *****" << std::endl;
338 analysisChain->Init();
340 std::cout <<
"***** Initialization done *****" << std::endl;
351 neventsOut = 1<<30-1;
355 for( ; nevents <= neventsIn && treeMakerPtr->getNumPart1EventsWritten() < neventsOut && !ierr; ++nevents ){
357 analysisChain->
Clear();
360 ierr = analysisChain->
Make();
363 if( (nevents+1) % displayFreq == 1 ){
365 std::cout <<
"***** finished event number " << nevents <<
", " << treeMakerPtr->getNumPart1EventsWritten() <<
" *****" << std::endl;
369 std::cout <<
"***** ERROR FLAG " << ierr <<
" on event number " << nevents <<
" *****" << endl;
EEmc ADC –> energy maker.
void printStatus()
monitering status
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
void source(const Char_t *, Int_t=0)
void setAddPed(Bool_t a=true)
Add pedestal offsets from DB.
virtual void Clear(Option_t *option="")
User defined functions.
void setTreeStatus(treeTypeEnum_t type, iostatus_t iostatus, const Char_t *fileName)
modifiers
void setTreeStatus(iostatus_t iostatus, const Char_t *fileName)
modifiers
void threshold(Float_t cut, Int_t layer)
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
Bool_t doPrintMemoryInfo
lots of screen output
void SetStatus(const char *arrType, int status)
void setSmearPed(Bool_t s=true)
Smear the pedestal with sigma from DB.
StTrigCounter(const Char_t *myName, Int_t trigID=117001)
constructor
void database(const Char_t *)
Set the name of the EEMC database, init obtains pointer.