22 char* file =
"st_W_12037063_raw_1380001_1201.MuDst.root",
34 char *eemcSetupPath =
"/afs/rhic.bnl.gov/star/users/kocolosk/public/StarTrigSimuSetup/";
36 if (isMC && useJetFinder == 2) geant =
true;
38 if (isMC) spinSort =
false;
40 string inputPathFile(file);
42 size_t iLastSlash = inputPathFile.find_last_of(
"/");
46 if (iLastSlash != string::npos)
47 inputPath = inputPathFile.substr(0, iLastSlash);
50 string inputFile = inputPathFile.substr(iLastSlash + 1);
52 printf(
"Input path: %s\n", inputPath.c_str());
53 printf(
"Input file: %s\n", inputFile.c_str());
55 TString outF = inputFile;
56 outF = outF.ReplaceAll(
".MuDst.root",
"");
57 outF = outF.ReplaceAll(
".lis",
"");
65 char *file1 = strstr(file,
"cn100");
68 printf(
"file1: %s\n", file1);
72 fileG.ReplaceAll(
"MuDst",
"geant");
75 printf(
"Output file: %s\n", outF.Data());
77 printf(
"TRIG ID: L2BW=%d, L2EW=%d isMC=%d useJetFinder=%d\n", idL2BWtrg, idL2EWtrg, isMC, useJetFinder );
79 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
80 loadSharedLibraries();
81 gROOT->LoadMacro(
"LoadLogger.C");
82 gMessMgr->SwitchOff(
"D");
83 gMessMgr->SwitchOn(
"I");
85 assert( !gSystem->Load(
"StDaqLib"));
88 assert( !gSystem->Load(
"StDetectorDbMaker"));
89 assert( !gSystem->Load(
"StTpcDb"));
90 assert( !gSystem->Load(
"StDbUtilities"));
91 assert( !gSystem->Load(
"StDbBroker"));
92 assert( !gSystem->Load(
"St_db_Maker"));
93 assert( !gSystem->Load(
"StEEmcUtil"));
94 assert( !gSystem->Load(
"StEEmcDbMaker"));
95 assert( !gSystem->Load(
"StTriggerFilterMaker"));
96 assert( !gSystem->Load(
"StWalgo2011"));
97 assert( !gSystem->Load(
"StTriggerUtilities"));
98 assert( !gSystem->Load(
"StSpinDbMaker"));
100 if (useJetFinder == 1 || useJetFinder == 2) {
101 cout <<
"BEGIN: loading jetfinder libs" << endl;
102 gSystem->Load(
"StEmcRawMaker");
103 gSystem->Load(
"StEmcADCtoEMaker");
104 gSystem->Load(
"StJetSkimEvent");
105 gSystem->Load(
"StJets");
106 gSystem->Load(
"StSpinDbMaker");
107 gSystem->Load(
"StEmcTriggerMaker");
108 gSystem->Load(
"StTriggerUtilities");
109 gSystem->Load(
"StMCAsymMaker");
110 gSystem->Load(
"StRandomSelector");
111 gSystem->Load(
"StJetEvent");
112 gSystem->Load(
"StJetFinder");
113 gSystem->Load(
"StJetMaker");
114 cout <<
"END: loading jetfinder libs" << endl;
117 cout <<
"\nWARN: Jet are NOT read in, W-algo will not wrk properly\n " << endl;
122 assert( !gSystem->Load(
"StMcEvent"));
123 assert( !gSystem->Load(
"StMcEventMaker"));
126 assert( !gSystem->Load(
"StEmcSimulatorMaker"));
127 assert( !gSystem->Load(
"StEEmcSimulatorMaker"));
128 assert( !gSystem->Load(
"StEpcMaker"));
131 cout <<
" loading done " << endl;
134 chain =
new StChain(
"StChain");
137 TObjArray* HList =
new TObjArray;
142 printf(
"\n %s \n\n", fileG.Data());
143 ioMaker->SetFile(fileG.Data());
146 ioMaker->SetBranch(
"*", 0,
"1");
147 ioMaker->SetBranch(
"geantBranch", 0,
"r");
148 ioMaker->SetBranch(
"minimcBranch", 0,
"r");
161 stMuDstMaker->
SetStatus(
"PrimaryVertices", 1);
162 stMuDstMaker->
SetStatus(
"GlobalTracks", 1);
163 stMuDstMaker->
SetStatus(
"PrimaryTracks", 1);
165 TChain* stMuDstMakerChain = stMuDstMaker->
chain();
167 assert(stMuDstMakerChain);
169 int nEntries = (int) stMuDstMakerChain->GetEntries();
172 Error(
"rdMuWana2011",
"Invalid number of events %d", nEntries)
176 printf("Total number of events in muDst chain = %d\n", nEntries);
183 dbMk->SetFlavor(
"Wbose2",
"bsmdeCalib");
184 dbMk->SetFlavor(
"Wbose2",
"bsmdpCalib");
185 dbMk->SetFlavor(
"sim",
"bemcCalib");
186 dbMk->SetFlavor(
"sim",
"eemcPMTcal");
189 printf(
"???? unforeseen MC flag, ABORT\n");
197 #if 0 // drop abs lumi for now
198 if (!isMC && strstr(file,
"fillListPhys")) {
200 filterMaker->addTrigger(230420);
201 filterMaker->addTrigger(230411);
202 filterMaker->addTrigger(bht3ID);
208 mcEventMaker->doPrintEventInfo =
false;
212 if (geant && useJetFinder != 1) {
227 simuTrig->setHList(HList);
228 simuTrig->setMC(isMC);
230 simuTrig->useEemc(0);
231 simuTrig->eemc->setSetupPath(eemcSetupPath);
233 simuTrig->bemc->setConfig(2);
236 TString jetFile = jetDir;
239 if (useJetFinder > 0) {
243 jetFile += outF +
".root";
244 cout <<
"BEGIN: running jet finder/reader =" << jetFile <<
"=" << endl;
248 if (useJetFinder == 1)
250 double pi = atan(1.0) * 4.0;
256 bool doTowerSwapFix =
true;
257 bool use2003TowerCuts =
false;
258 bool use2006TowerCuts =
true;
262 bet4pMakerFrac100->setUse2003Cuts(use2003TowerCuts);
263 bet4pMakerFrac100->setUseEndcap(
true);
264 bet4pMakerFrac100->setUse2006Cuts(use2006TowerCuts);
268 bet4pMakerFrac100_noEEMC->setUse2003Cuts(use2003TowerCuts);
269 bet4pMakerFrac100_noEEMC->setUseEndcap(
false);
270 bet4pMakerFrac100_noEEMC->setUse2006Cuts(use2006TowerCuts);
278 anapars->setFlagMin(0);
279 anapars->setNhits(12);
280 anapars->setCutPtMin(0.2);
281 anapars->setAbsEtaMax(2.0);
282 anapars->setJetPtMin(3.5);
283 anapars->setJetEtaMax(100.0);
284 anapars->setJetEtaMin(0);
285 anapars->setJetNmin(0);
301 emcJetMaker->addAnalyzer(anapars, cpars, bet4pMakerFrac100,
"ConeJets12_100");
302 emcJetMaker->addAnalyzer(anapars, cpars, bet4pMakerFrac100_noEEMC,
"ConeJets12_100_noEEMC");
309 int eventCounter = 0;
313 for (Int_t iev = 0; iev < nEntries; iev++) {
314 if (eventCounter >= nEve)
break;
316 int stat = chain->
Make();
321 cout <<
"run " << file <<
" nEve=" << eventCounter <<
" total ";
323 printf(
"****************************************** \n");
326 if (t2 == t1) t2 = t1 + 1;
327 float tMnt = (t2 - t1) / 60.;
328 float rate = 1.*eventCounter / (t2 - t1);
330 printf(
"jets sorting done %d of nEve= %d, CPU rate= %.1f Hz, total time %.1f minute(s) \n\n", eventCounter, nEntries, rate, tMnt);
332 cout <<
"END: jet finder " << endl;
337 if (useJetFinder == 2) {
338 cout <<
"Configure to read jet trees " << endl;
352 WmuMk->setTrigID(idL2BWtrg, idL2EWtrg);
355 TString treeFileName = wtreeDir;
356 treeFileName += outF;
357 treeFileName +=
".Wtree.root";
359 WmuMk->setTreeName(treeFileName);
361 if (useJetFinder == 2)
362 WmuMk->setJetTreeBranch(
"ConeJets12_100",
"ConeJets12_100_noEEMC");
364 WmuMk->setMaxDisplayEve(100);
373 WpubMk->attachWalgoMaker(WmuMk);
377 WmuMk->setHList(HList);
378 WpubMk->setHList(HList);
386 for (
int kk = 0; kk < mxSM; kk++) {
388 sprintf(ttx,
"%cspin",
'A' + kk);
389 printf(
"add spinMaker %s %d \n", ttx, kk);
391 spinMkA[kk]->attachWalgoMaker(WmuMk);
392 spinMkA[kk]->attachSpinDb(spDb);
393 spinMkA[kk]->setHList(HList);
394 if (kk == 1) spinMkA[kk]->setEta(-1., 0.);
395 if (kk == 2) spinMkA[kk]->setEta(0, 1.);
396 if (kk == 3) spinMkA[kk]->setQPT(-1);
397 if (kk == 4) spinMkA[kk]->setNoEEMC();
403 pubMcMk->attachWalgoMaker(WmuMk);
404 pubMcMk->setHList(HList);
409 ZMk->attachWalgoMaker(WmuMk);
410 ZMk->setHList(HList);
411 ZMk->setNearEtFrac(0.88);
412 ZMk->setClusterMinEt(15);
413 ZMk->setPhi12Min(3.1416 / 2.);
414 ZMk->setMinZMass(73.);
415 ZMk->setMaxZMass(114.);
422 int eventCounter = 0;
427 for (Int_t iev = 0; iev < nEntries; iev++) {
428 Info(
"rdMuWana2011",
"Analyzing event %d", iev);
429 if (eventCounter >= nEve)
break;
431 int stat = chain->
Make();
438 cout <<
"run " << file <<
" nEve=" << eventCounter <<
" total ";
441 printf(
"****************************************** \n");
444 if (t2 == t1) t2 = t1 + 1;
445 float tMnt = (t2 - t1) / 60.;
446 float rate = 1.*eventCounter / (t2 - t1);
448 printf(
"#sorting %s done %d of nEve= %d, CPU rate= %.1f Hz, total time %.1f minute(s) \n\n", file, eventCounter, nEntries, rate, tMnt);
451 TString histFileName = histDir;
452 histFileName += outF;
453 histFileName +=
".wana.hist.root";
455 cout <<
"Output histo file " << histFileName << endl;
457 hf =
new TFile(histFileName,
"recreate");
462 printf(
"\n Histo saved -->%s<\n", outFh.Data());
465 printf(
"\n Failed to open Histo-file -->%s<, continue\n", outFh.Data());
void setConeRadius(double v)
Set cone radius:
gathers all results from W-analysis, Jan's analysis
maker to retrieve info from geant.root files for comparison with reco quantities from MC ...
void setAddMidpoints(bool v)
Add seeds at midpoints?
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
virtual void InitFile(const char *file)
Recover the TTree from file and prepare for reading.
void setAddPed(Bool_t a=true)
Add pedestal offsets from DB.
virtual void Clear(Option_t *option="")
User defined functions.
void setSplitFraction(double v)
split jets if E_shared/E_neighbor>splitFraction
void setGridSpacing(int nEta, double etaMin, double etaMax, int nPhi, double phiMin, double phiMax)
Set the grid spacing:
void setDoSplitMerge(bool v)
Do Split/Merge step?
void setDebug(bool v)
Toggle debug streams on/off.
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...
void setSeedEtMin(double v)
minimum et threshold to be considered a seed
virtual void ls(Option_t *option="") const
Bool_t doPrintMemoryInfo
lots of screen output
void setAssocEtMin(double v)
minimum et threshold to be considered for addition to the seed
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
void SetStatus(const char *arrType, int status)
void setSmearPed(Bool_t s=true)
Smear the pedestal with sigma from DB.
muDst based extraction of W-signal from pp500 data from 2011
void setRequireStableMidpoints(bool v)
Require stable midpoints?
uses tree from W-algo to find Zs
void setCalibSpread(StDetectorId det, float spread)
smear simulator calibration coefficients using Gaussian with this RMS.
void setPerformMinimization(bool v)
Let jet wander to minimum?