23 if(isMC==0) jetDir=
"./";
27 if(isMC) spinSort=
false;
31 printf(
"Unpack file=%s=\n",file);
32 char *file1=strstr(file,
"/R")+1;
33 printf(
"file1=%s=%s=\n",file1);
34 outF=file1; file1=outF.Data();
35 printf(
"OutF=%s=\n",outF.Data());
40 if(isMC==100) file1=strstr(file,
"j");
42 if(isMC==350) file1=strstr(file,
"W");
43 if(isMC==351) file1=strstr(file,
"Wminus_tau");
44 if(isMC==352) file1=strstr(file,
"Z");
45 assert(file1); printf(
"file1=%s=\n",file1);
49 cout<<
"bad isMC flag"<<endl;
return;
51 outF=outF.ReplaceAll(
".lis",
"");
52 outF.ReplaceAll(
".MuDst.root",
"");
53 printf(
"TRIG ID: L2BW=%d, L2EW=%d isMC=%d useJetFinder=%d\n",idL2BWtrg,idL2EWtrg,isMC, useJetFinder );
56 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
57 loadSharedLibraries();
58 gROOT->LoadMacro(
"LoadLogger.C");
59 gMessMgr -> SwitchOff(
"D");
60 gMessMgr -> SwitchOn(
"I");
62 assert( !gSystem->Load(
"StDaqLib"));
65 assert( !gSystem->Load(
"StDetectorDbMaker"));
66 assert( !gSystem->Load(
"StTpcDb"));
67 assert( !gSystem->Load(
"StDbUtilities"));
68 assert( !gSystem->Load(
"StDbBroker"));
69 assert( !gSystem->Load(
"St_db_Maker"));
70 assert( !gSystem->Load(
"StEEmcUtil"));
71 assert( !gSystem->Load(
"StEEmcDbMaker"));
72 assert( !gSystem->Load(
"StSpinDbMaker"));
73 assert( !gSystem->Load(
"StTriggerFilterMaker"));
74 assert( !gSystem->Load(
"StTriggerUtilities"));
77 if (useJetFinder ==1 || useJetFinder == 2){
78 cout <<
"BEGIN: loading jetfinder libs" << endl;
79 gSystem->Load(
"StEmcRawMaker");
80 gSystem->Load(
"StEmcADCtoEMaker");
81 gSystem->Load(
"StEmcTriggerMaker");
82 gSystem->Load(
"StMCAsymMaker");
83 gSystem->Load(
"StRandomSelector");
84 gSystem->Load(
"libfastjet.so");
85 gSystem->Load(
"libsiscone.so");
86 gSystem->Load(
"libsiscone_spherical.so");
87 gSystem->Load(
"libfastjetplugins.so");
88 gSystem->Load(
"StJetFinder");
89 gSystem->Load(
"StJetSkimEvent");
90 gSystem->Load(
"StJets");
91 gSystem->Load(
"StJetEvent");
92 gSystem->Load(
"StJetMaker");
93 cout <<
"END: loading jetfinder libs" << endl;
96 cout <<
"\nWARN: Jet are NOT read in, W-algo will not wrk properly\n " << endl;
100 assert( !gSystem->Load(
"StWalgo2011"));
103 assert( !gSystem->Load(
"StMcEvent"));
104 assert( !gSystem->Load(
"StMcEventMaker"));
107 cout <<
" loading done " << endl;
110 chain =
new StChain(
"StChain");
112 TObjArray* HList=
new TObjArray;
113 TObjArray* HListTpc=
new TObjArray;
118 ifstream infile(file);
string line;
120 while(infile.good()){
121 getline (infile,line);
123 name.ReplaceAll(
".MuDst.root",
".geant.root");
124 name.ReplaceAll(
"muDst/",
"geant/");
126 setFiles->AddFile(name.Data());
128 if(j%10==0) cout<<
"Added "<<j<<
" files:"<<name.Data()<<endl;
136 ioMaker->SetBranch(
"*",0,
"0");
137 ioMaker->SetBranch(
"geantBranch",0,
"r");
141 muMk =
new StMuDstMaker(0,0,muDir,file,
"MuDst.root",nFiles);
155 TChain* tree=muMk->
chain(); assert(tree);
156 int nEntries=(int) tree->GetEntries();
157 printf(
"total eve in muDst chain =%d\n",nEntries);
158 if(nEntries<0)
return;
166 dbMk->SetFlavor(
"Wbose2",
"bsmdeCalib");
167 dbMk->SetFlavor(
"Wbose2",
"bsmdpCalib");
170 if(isMC>=350) dbMk->SetMaxEntryTime(20130520,0);
173 printf(
"???? unforeseen MC flag, ABORT\n"); assert(1==2);
182 mcEventMaker->doPrintEventInfo =
false;
187 if (useJetFinder > 0) {
188 TString jetFile = jetDir; jetFile+=
"jets_"+outF+
".root";
189 cout <<
"BEGIN: running jet finder/reader =" <<jetFile<<
"="<< endl;
193 if(spinSort || useJetFinder == 1 ) spDb=
new StSpinDbMaker(
"spinDb");
196 if (useJetFinder == 1){
197 double pi = atan(1.0)*4.0;
203 jetmaker->setJetFile(jetFile);
207 anapars12->useTpc =
true;
208 anapars12->useBemc =
true;
209 anapars12->useEemc =
true;
238 anapars12_noEEMC->useTpc =
true;
239 anapars12_noEEMC->useBemc =
true;
240 anapars12_noEEMC->useEemc =
true;
270 AntiKtR060Pars->setRparam(0.6);
273 AntiKtR060Pars->setPtMin(3.5);
278 AntiKtR050Pars->setRparam(0.5);
281 AntiKtR050Pars->setPtMin(3.5);
283 jetmaker->addBranch(
"AntiKtR060NHits12",anapars12,AntiKtR060Pars);
284 jetmaker->addBranch(
"AntiKtR060NHits12_noEEMC",anapars12_noEEMC,AntiKtR060Pars);
285 jetmaker->addBranch(
"AntiKtR050NHits12",anapars12,AntiKtR050Pars);
286 jetmaker->addBranch(
"AntiKtR050NHits12_noEEMC",anapars12_noEEMC,AntiKtR050Pars);
296 for (Int_t iev=0;iev<nEntries; iev++) {
297 if(eventCounter>=nEve)
break;
299 if(iev%100 == 0) cout<<
"iev="<<iev<<endl;
300 int stat = chain->
Make();
304 cout<<
"run "<<file<<
" nEve="<<eventCounter<<
" total "; tt.Print();
305 printf(
"****************************************** \n");
309 float tMnt=(t2-t1)/60.;
310 float rate=1.*eventCounter/(t2-t1);
311 printf(
"#sorting done %d of nEve= %d, CPU rate= %.1f Hz, total time %.1f minute(s) \n\n",eventCounter,nEntries,rate,tMnt);
313 cout <<
"END: jet finder " << endl;
323 WmuMk->setTrigID(idL2BWtrg,idL2EWtrg);
326 TString outFtree=wtreeDir; outFtree+=outF; outFtree+=
".Wtree.root";
327 WmuMk->setTreeName(outFtree);
329 if (useJetFinder == 2) {
330 cout <<
"Configure to read jet trees " << endl;
331 WmuMk->chainJetFile(jetFile);
332 WmuMk->setJetTreeBranch(
"AntiKtR060NHits12",
"AntiKtR060NHits12_noEEMC");
335 WmuMk->setMaxDisplayEve(100);
341 WpubMk->attachWalgoMaker(WmuMk);
345 WmuMk->setHList(HList);
346 WmuMk->setHListTpc(HListTpc);
347 WpubMk->setHList(HList);
350 WmuMk->attachSpinDb(spDb);
353 for(
int kk=0;kk<mxSM;kk++) {
354 char ttx[100]; sprintf(ttx,
"%cspin",
'A'+kk);
355 printf(
"add spinMaker %s %d \n",ttx,kk);
357 spinMkA[kk]->attachWalgoMaker(WmuMk);
358 spinMkA[kk]->setHList(HList);
359 if(kk==1) spinMkA[kk]->setEta(-1.,0.);
360 if(kk==2) spinMkA[kk]->setEta(0,1.);
361 if(kk==3) spinMkA[kk]->setQPT(
false);
362 if(kk==4) spinMkA[kk]->setNoEEMC();
368 pubMcMk->attachWalgoMaker(WmuMk);
369 pubMcMk->setHList(HList);
374 ZMk->attachWalgoMaker(WmuMk);
375 ZMk->setHList(HList);
376 ZMk->setNearEtFrac(0.88);
377 ZMk->setClusterMinEt(15);
378 ZMk->setPhi12Min(3.1416/2.);
379 ZMk->setMinZMass(73.);
380 ZMk->setMaxZMass(114.);
392 for (Int_t iev=0;iev<nEntries; iev++) {
393 if(eventCounter>=nEve)
break;
395 int stat = chain->
Make();
401 cout<<
"run "<<file<<
" nEve="<<eventCounter<<
" total "; tt.Print();
402 printf(
"****************************************** \n");
406 float tMnt=(t2-t1)/60.;
407 float rate=1.*eventCounter/(t2-t1);
408 printf(
"#sorting %s done %d of nEve= %d, CPU rate= %.1f Hz, total time %.1f minute(s) \n\n",file,eventCounter,nEntries,rate,tMnt);
413 TString outFh=histDir; outFh+=outF; outFh+=
".wana.hist.root";
415 cout<<
"Output histo file "<<outFh<<endl;
417 hf=
new TFile(outFh,
"recreate");
422 TDirectory *tpc = hf->mkdir(
"tpc");
425 printf(
"\n Histo saved -->%s<\n",outFh.Data());
427 printf(
"\n Failed to open Histo-file -->%s<, continue\n",outFh.Data());
gathers all results from W-analysis, Jan's analysis
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
virtual void Clear(Option_t *option="")
User defined functions.
static const int Best
automatic selection of the best (based on N)
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
maker to retrieve info from geant.root files for comparison with reco quantities from MC ...
Bool_t doPrintMemoryInfo
lots of screen output
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
void SetStatus(const char *arrType, int status)
static const int E_scheme
muDst based extraction of W-signal from pp500 data from 2011
static const int antikt_algorithm
uses tree from W-algo to find Zs