22 char* file =
"fillListE/sl11b/Wplus0.lis",
27 char *eemcSetupPath=
"/afs/rhic.bnl.gov/star/users/kocolosk/public/StarTrigSimuSetup/";
29 TString jetTreeDir=
"/star/u/stevens4/wAnalysis/efficXsec/outEmb/jets/";
30 if(isMC==0) jetTreeDir=
"/star/data01/pwg/stevens4/wAnalysis/xSecPaper/sl11b/jets/";
32 if(isMC >= 350 && useJetFinder==2) geant=
true;
34 if(isMC) spinSort=
false;
36 int runNo=0,bht3ID=0,l2wID=0,fillNo=0;
38 printf(
"Unpack file=%s=\n",file);
39 char *file1=strstr(file,
"/R")+1;
40 printf(
"file1=%s=%s=\n",file1);
42 outF=file1; file1=outF.Data();
43 char *p1=strstr(file1,
"_");
44 char *p2=strstr(p1+1,
"_");
51 printf(
"OutF=%s=\n",outF.Data());
54 char *file1;
char *file2;
55 if(isMC==350) { file2=strstr(file,
"/W"); file1=strstr(file2,
"W"); }
56 if(isMC==351) { file2=strstr(file,
"/Wtau"); file1=strstr(file2,
"Wtau"); }
57 if(isMC==352) { file2=strstr(file,
"/Z"); file1=strstr(file2,
"Z"); }
58 assert(file1); printf(
"file1=%s=\n",file1);
59 outF=file1; outF.ReplaceAll(
".lis",
"");
60 TString nameReweight=file1; nameReweight.ReplaceAll(
".lis",
"");
61 for(
int j=0; j<10; j++) nameReweight.ReplaceAll(Form(
"%d",j),
"");
62 cout<<
"nameReweight="<<nameReweight<<endl;
65 cout<<
"bad isMC flag"<<endl;
return;
67 printf(
"TRIG ID: bht3=%d l2w=%d isMC=%d\n",bht3ID,l2wID,isMC);
69 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
70 loadSharedLibraries();
71 gROOT->LoadMacro(
"LoadLogger.C");
72 gMessMgr -> SwitchOff(
"D");
73 gMessMgr -> SwitchOn(
"I");
75 assert( !gSystem->Load(
"StDaqLib"));
78 assert( !gSystem->Load(
"StDetectorDbMaker"));
79 assert( !gSystem->Load(
"StTpcDb"));
80 assert( !gSystem->Load(
"StDbUtilities"));
81 assert( !gSystem->Load(
"StDbBroker"));
82 assert( !gSystem->Load(
"St_db_Maker"));
83 assert( !gSystem->Load(
"StEEmcUtil"));
84 assert( !gSystem->Load(
"StEEmcDbMaker"));
85 assert( !gSystem->Load(
"StTriggerFilterMaker"));
86 assert( !gSystem->Load(
"StWalgoB2009"));
88 gSystem->Load(
"StEmcRawMaker");
89 gSystem->Load(
"StEmcADCtoEMaker");
90 assert( !gSystem->Load(
"StTriggerUtilities"));
92 if(spinSort) assert( !gSystem->Load(
"StSpinDbMaker"));
94 if (useJetFinder ==1 || useJetFinder == 2){
95 cout <<
"BEGIN: loading jetfinder libs" << endl;
96 gSystem->Load(
"StEmcRawMaker");
97 gSystem->Load(
"StEmcADCtoEMaker");
98 gSystem->Load(
"StJetSkimEvent");
99 gSystem->Load(
"StJets");
100 gSystem->Load(
"StSpinDbMaker");
101 gSystem->Load(
"StEmcTriggerMaker");
102 gSystem->Load(
"StTriggerUtilities");
103 gSystem->Load(
"StMCAsymMaker");
104 gSystem->Load(
"StRandomSelector");
105 gSystem->Load(
"StJetEvent");
106 gSystem->Load(
"StJetFinder");
107 gSystem->Load(
"StJetMaker");
108 cout <<
"END: loading jetfinder libs" << endl;
111 cout <<
"\nWARN: Jet are NOT read in, W-algo will not wrk properly\n " << endl;
116 assert( !gSystem->Load(
"StMcEvent"));
117 assert( !gSystem->Load(
"StMcEventMaker"));
120 assert( !gSystem->Load(
"StEmcSimulatorMaker"));
121 assert( !gSystem->Load(
"StEEmcSimulatorMaker"));
122 assert( !gSystem->Load(
"StEpcMaker"));
125 cout <<
" loading done " << endl;
128 chain =
new StChain(
"StChain");
130 TObjArray* HList=
new TObjArray;
134 ifstream infile(file);
string line;
136 while(infile.good()){
137 getline (infile,line);
139 name.ReplaceAll(
".MuDst.root",
".geant.root");
141 setFiles->AddFile(name.Data());
143 if(j%10==0) cout<<
"Added "<<j<<
" files:"<<name.Data()<<endl;
151 ioMaker->SetBranch(
"*",0,
"0");
152 ioMaker->SetBranch(
"geantBranch",0,
"r");
156 muMk =
new StMuDstMaker(0,0,inDir,file,
"MuDst.root",nFiles);
171 dbMk->SetFlavor(
"Wbose",
"bsmdeCalib");
172 dbMk->SetFlavor(
"Wbose",
"bsmdpCalib");
177 dbMk->SetMaxEntryTime(20101215,0);
178 dbMk->SetFlavor(
"Wbose2",
"bsmdpCalib");
179 dbMk->SetFlavor(
"Wbose2",
"bsmdeCalib");
182 printf(
"???? unforeseen MC flag, ABORT\n"); assert(1==2);
190 mcEventMaker->doPrintEventInfo =
false;
194 if(useJetFinder!=1 && isMC){
200 simuTrig->setHList(HList);
203 simuTrig->useEemc(0);
204 simuTrig->eemc->setSetupPath(eemcSetupPath);
206 simuTrig->bemc->setConfig(2);
210 if (useJetFinder > 0) {
211 TString outFile =
"jets_"+outF+
".root";
212 cout <<
"BEGIN: running jet finder/reader =" <<outFile<<
"="<< endl;
215 if (useJetFinder == 1){
216 double pi = atan(1.0)*4.0;
221 bool doTowerSwapFix =
true;
222 bool use2003TowerCuts =
false;
223 bool use2006TowerCuts =
true;
226 bet4pMakerFrac100->setUse2003Cuts(use2003TowerCuts);
227 bet4pMakerFrac100->setUseEndcap(
true);
228 bet4pMakerFrac100->setUse2006Cuts(use2006TowerCuts);
231 bet4pMakerFrac100_noEEMC->setUse2003Cuts(use2003TowerCuts);
232 bet4pMakerFrac100_noEEMC->setUseEndcap(
false);
233 bet4pMakerFrac100_noEEMC->setUse2006Cuts(use2006TowerCuts);
240 anapars->setFlagMin(0);
241 anapars->setNhits(12);
242 anapars->setCutPtMin(0.2);
243 anapars->setAbsEtaMax(2.0);
244 anapars->setJetPtMin(3.5);
245 anapars->setJetEtaMax(100.0);
246 anapars->setJetEtaMin(0);
247 anapars->setJetNmin(0);
263 emcJetMaker->addAnalyzer(anapars, cpars, bet4pMakerFrac100,
"ConeJets12_100");
264 emcJetMaker->addAnalyzer(anapars, cpars, bet4pMakerFrac100_noEEMC,
"ConeJets12_100_noEEMC");
267 TChain* tree=muMk->
chain(); assert(tree);
268 int nEntries=(int) tree->GetEntries();
269 printf(
"total eve in muDst chain =%d for run=%d\n",nEntries,runNo);
270 if(nEntries<0)
return;
280 for (Int_t iev=0;iev<nEntries; iev++) {
281 if(eventCounter>=nEve)
break;
283 int stat = chain->
Make();
288 cout<<
"run R"<<runNo<<
" nEve="<<eventCounter<<
" total "; tt.Print();
289 printf(
"****************************************** \n");
293 float tMnt=(t2-t1)/60.;
294 float rate=1.*eventCounter/(t2-t1);
295 printf(
"#sorting R%d done %d of nEve= %d, CPU rate= %.1f Hz, total time %.1f minute(s) \n\n",runNo,eventCounter,nEntries,rate,tMnt);
297 cout <<
"END: jet finder " << endl;
300 if (useJetFinder == 2)
302 cout <<
"Configure to read jet trees " << endl;
304 jetReader->
InitFile(jetTreeDir+outFile);
312 WmuMk->setNameReweight(nameReweight.Data());
319 WmuMk->setTrigID(bht3ID,l2wID,runNo);
322 if (useJetFinder == 2) WmuMk->setJetTreeBranch(
"ConeJets12_100",
"ConeJets12_100_noEEMC");
324 WmuMk->setMaxDisplayEve(10);
325 WmuMk->useEtow(useEtow);
328 if(isMC==0) WmuMk->setBtowScale(0.976);
329 else WmuMk->setBtowScale(1.02);
336 WpubMk->attachWalgoMaker(WmuMk);
339 WmuMk->setHList(HList);
340 WpubMk->setHList(HList);
345 WlumiMk->attachWalgoMaker(WmuMk);
346 WlumiMk->attachMuMaker(muMk);
347 WlumiMk->setHList(HList);
355 for(
int kk=0;kk<mxSM;kk++) {
356 char ttx[100]; sprintf(ttx,
"%cspin",
'A'+kk);
357 printf(
"add spinMaker %s %d \n",ttx,kk);
359 spinMkA[kk]->attachWalgoMaker(WmuMk);
360 spinMkA[kk]->attachSpinDb(spDb);
361 spinMkA[kk]->setHList(HList);
362 if(kk==1) spinMkA[kk]->setEta(-1.,0.);
363 if(kk==2) spinMkA[kk]->setEta(0,1.);
364 if(kk==3) spinMkA[kk]->setQPT(-1);
365 if(kk==4) spinMkA[kk]->setNoEEMC();
371 ZMk->attachWalgoMaker(WmuMk);
372 ZMk->setHList(HList);
373 ZMk->setClusterFrac24(0.95);
375 ZMk->setNearEtFrac(0.88);
376 ZMk->setClusterMinEt(15);
377 ZMk->setPhi12Min(3.1416/2.);
378 ZMk->setMinZMass(73.);
379 ZMk->setMaxZMass(114.);
384 pubMcMk->attachWalgoMaker(WmuMk);
385 pubMcMk->attachZalgoMaker(ZMk);
386 pubMcMk->setHList(HList);
389 TChain* tree=muMk->
chain(); assert(tree);
390 int nEntries=(int) tree->GetEntries();
391 printf(
"total eve in muDst chain =%d\n",nEntries);
392 if(nEntries<0)
return;
402 for (Int_t iev=0;iev<nEntries; iev++) {
403 if(eventCounter>=nEve)
break;
405 int stat = chain->
Make();
412 WlumiMk->FinishRun(runNo);
414 cout<<
"run R"<<runNo<<
" nEve="<<eventCounter<<
" total "; tt.Print();
415 printf(
"****************************************** \n");
419 float tMnt=(t2-t1)/60.;
420 float rate=1.*eventCounter/(t2-t1);
421 printf(
"#sorting R%d done %d of nEve= %d, CPU rate= %.1f Hz, total time %.1f minute(s) \n\n",runNo,eventCounter,nEntries,rate,tMnt);
423 TString outFh=outF+
".wana.hist.root";
425 cout<<
"Output histo file "<<outFh<<endl;
426 hf=
new TFile(outFh,
"recreate");
430 printf(
"\n Histo saved -->%s<\n",outFh.Data());
433 printf(
"\n Failed to open Histo-file -->%s<, continue\n",outFh.Data());
void setConeRadius(double v)
Set cone radius:
maker to retrieve info from geant.root files for comparison with reco quantities from MC ...
void setAddMidpoints(bool v)
Add seeds at midpoints?
my own maker to do analysis outside of W selection
muDst based extraction of W-signal from pp500 data from 2009
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.
virtual void Clear(Option_t *option="")
User defined functions.
void setSplitFraction(double v)
split jets if E_shared/E_neighbor>splitFraction
uses tree from W-algo to find Zs
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
gathers all results from W-analysis, Jan's analysis
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 setRequireStableMidpoints(bool v)
Require stable midpoints?
void setPerformMinimization(bool v)
Let jet wander to minimum?