23 #define STEVENTREADER 0
24 #define MCEVENTREADER 0
25 #define ASSOCIATIONREADER 0
27 #define GSTARTXTREADER 0
32 #define BINARYWRITER 0
33 #define BINARYREADER 1
39 #define STEVENTREADER 0
40 #define MCEVENTREADER 0
41 #define ASSOCIATIONREADER 0
48 #define STEVENTREADER 0
49 #define MCEVENTREADER 0
50 #define ASSOCIATIONREADER 0
77 class MinvCorrFctnM_vs_P;
78 MinvCorrFctnM_vs_P* MinvCFM_vs_P;
80 class p1_vs_p2CorrFctn;
81 p1_vs_p2CorrFctn* p1_vs_p2_CF;
87 pDiffCorrFctn* pDiffCF;
89 class p_vs_angleCorrFctn;
90 p_vs_angleCorrFctn* p_vs_angleCF;
92 class phiMeas_vs_phiCalcCorrFctn;
93 phiMeas_vs_phiCalcCorrFctn* phiMeas_vs_phiCalcCF;
111 TString originalPath;
116 const char *venusFile =
"set*geant.root";
117 const char *venusPath =
"/disk00001/star/auau200/venus412/default/b0_3/year_1b/hadronic_on/tfs_4/";
118 const char *dstFile =
"/disk00001/star/auau200/two_photon/starlight/twogam/year_1b/hadronic_on/tfs/ric0022_01_14552evts.dst.root";
119 const char *xdfFile =
"/afs/rhic.bnl.gov/star/data/samples/psc0054_07_40evts_dst.xdf";
120 const char *mdcFile =
"/disk00001/star/auau200/venus412/default/b0_3/year_1b/hadronic_on/tss/psc0081_07_40evts.root";
121 const char *geantFile =
"/disk00000/star/auau200/hijing135/jetq_off/b0_3/year_1b/hadronic_on/tfsr/set0041_01_53evts.geant.root";
122 const char *fileList[] = {dstFile,xdfFile,mdcFile,0};
125 for (
int i=0; i<n*1e6; i++) { }
127 void mess(
const char* c=
"alive") {
128 for (
int i=0; i<10; i++) { cout << c << endl; }
132 void StHbtExampleQQ(
const Int_t nevents,
const Char_t **fileList,
const char*);
137 void StHbtExampleII(
const Int_t nevents=9999,
138 const Char_t *path=venusPath,
139 const Char_t *file=venusFile,
140 const char* histoFile=
"test.histo.root")
142 const char *fileListQQ[]={0,0};
146 fileListQQ[0] = gSystem->ConcatFileName(path,file);
148 StHbtExampleQQ(nevents,fileListQQ,histoFile);
152 void StHbtExampleQQ(
const Int_t nevents,
const Char_t **fileList,
const char* histoFile)
156 gSystem->Load(
"St_base");
157 gSystem->Load(
"StChain");
158 gSystem->Load(
"St_Tables");
159 gSystem->Load(
"StMagF");
160 gSystem->Load(
"StUtilities");
161 gSystem->Load(
"StTreeMaker");
162 gSystem->Load(
"StIOMaker");
163 gSystem->Load(
"StarClassLibrary");
165 gSystem->Load(
"xdf2root");
166 gSystem->Load(
"St_xdfin_Maker");
168 gSystem->Load(
"StEvent");
169 gSystem->Load(
"StEventMaker");
170 gSystem->Load(
"StMcEvent");
171 gSystem->Load(
"StMcEventMaker");
172 gSystem->Load(
"StAssociationMaker");
173 gSystem->Load(
"StMcAnalysisMaker");
175 gSystem->Load(
"StHbtMaker");
176 gSystem->Load(
"global_Tables");
178 cout <<
" loading done " << endl;
180 chain =
new StChain(
"StChain");
185 for (
int ifil=0; fileList[ifil]; ifil++)
186 setFiles->AddFile(fileList[ifil]);
202 ioMaker->SetBranch(
"*",0,
"0");
203 ioMaker->SetBranch(
"dstBranch",0,
"r");
211 ioMaker->SetBranch(
"*",0,
"0");
212 ioMaker->SetBranch(
"geantBranch",0,
"r");
220 ioMaker->SetBranch(
"*",0,
"0");
221 cout <<
" files open" << endl;
222 ioMaker->SetBranch(
"geantBranch",0,
"r");
223 cout <<
" files open" << endl;
224 ioMaker->SetBranch(
"dstBranch",0,
"r");
225 cout <<
" files open" << endl;
230 ioMaker->SetBranch(
"*",0,
"r");
238 eventMaker->doLoadTpcHits=0;
239 eventMaker->doLoadFtpcHits=0;
240 eventMaker->doLoadSvtHits=0;
241 cout <<
"Just instantiated StEventMaker... lets go StHbtMaker!" << endl;
245 cout <<
"StMcEventMaker instantiated"<<endl;
249 cout <<
"Just instantiated StEventMaker... lets go StHbtMaker!" << endl;
251 cout <<
"StMcEventMaker instantiated"<<endl;
253 cout <<
"StAssociationMaker instantiated"<<endl;
261 cout <<
"StHbtMaker instantiated"<<endl;
265 cout <<
"StHbtMaker::Init - setting up Reader and Analyses..." << endl;
278 Reader->SetTheEventMaker(eventMaker);
279 TheManager->SetEventReader(Reader);
280 cout <<
"READER SET UP.... " << endl;
287 Reader->SetTheMcEventMaker(mcEventMaker);
288 TheManager->SetEventReader(Reader);
289 cout <<
"READER SET UP.... " << endl;
291 #if ASSOCIATIONREADER
297 Reader->SetTheEventMaker(eventMaker);
298 Reader->SetTheMcEventMaker(mcEventMaker);
299 Reader->SetTheAssociationMaker(associationMaker);
300 Reader->SetTheMcEventMaker(mcEventMaker);
301 TheManager->SetEventReader(Reader);
304 parameterDB->setXCut(0.1);
305 parameterDB->setZCut(0.2);
306 parameterDB->setReqCommonHits(10);
307 cout <<
"READER SET UP.... " << endl;
312 asciiWriter->SetFileName(
"test1.asc");
313 TheManager->AddEventWriter(asciiWriter);
316 asciiFrontLoadedEventCut->SetEventMult(0,100000);
317 asciiFrontLoadedEventCut->SetVertZPos(-35.0,35.0);
318 asciiWriter->SetEventCut(asciiFrontLoadedEventCut);
320 asciiFrontLoadedTrackCut->SetNSigmaPion(-1000.0,1000.0);
321 asciiFrontLoadedTrackCut->SetNSigmaKaon(-3.,3.);
322 asciiFrontLoadedTrackCut->SetNSigmaProton(-1000.0,1000.0);
323 asciiFrontLoadedTrackCut->SetNHits(5,1000);
324 asciiFrontLoadedTrackCut->SetP(0.0,5.0);
325 asciiFrontLoadedTrackCut->SetPt(0.0,5.0);
326 asciiFrontLoadedTrackCut->SetRapidity(-1.5,1.5);
327 asciiFrontLoadedTrackCut->SetDCA(0.0,2.);
328 asciiFrontLoadedTrackCut->SetCharge(0);
329 asciiFrontLoadedTrackCut->SetMass(0.494);
332 cout <<
"WRITER SET UP.... " << endl;
337 Reader->SetFileName(*fileList);
339 TheManager->SetEventReader(Reader);
340 cout <<
"READER SET UP.... " << endl;
346 binaryWriter->SetFileName(
"test1.bin");
347 TheManager->AddEventWriter(binaryWriter);
350 binaryFrontLoadedEventCut->SetEventMult(0,100000);
351 binaryFrontLoadedEventCut->SetVertZPos(-35.0,35.0);
352 binaryWriter->SetEventCut(binaryFrontLoadedEventCut);
354 binaryFrontLoadedTrackCut->SetNSigmaPion(-1000.0,1000.0);
355 binaryFrontLoadedTrackCut->SetNSigmaKaon(-3.,3.);
356 binaryFrontLoadedTrackCut->SetNSigmaProton(-1000.0,1000.0);
357 binaryFrontLoadedTrackCut->SetNHits(5,1000);
358 binaryFrontLoadedTrackCut->SetP(0.0,5.0);
359 binaryFrontLoadedTrackCut->SetPt(0.0,5.0);
360 binaryFrontLoadedTrackCut->SetRapidity(-1.5,1.5);
361 binaryFrontLoadedTrackCut->SetDCA(0.0,2.);
362 binaryFrontLoadedTrackCut->SetCharge(0);
363 binaryFrontLoadedTrackCut->SetMass(0.494);
364 binaryWriter->SetTrackCut(binaryFrontLoadedTrackCut);
365 cout <<
"WRITER SET UP.... " << endl;
372 TheManager->SetEventReader(Reader);
373 cout <<
"READER SET UP.... " << endl;
377 StHbtXDFReader* Reader =
new StHbtXDFReader(
"evgen",
"evgen/particle");
378 Reader->AddAcceptedParticle(-321);
379 Reader->AddAcceptedParticle(+321);
380 Reader->AddAcceptedMother(333);
386 TheManager->SetEventReader(Reader);
387 cout <<
"READER SET UP.... " << endl;
392 Reader->SetFileName(
"/star/rcf/data06/evgen/auau200/hbt/default/midcentral/year_2000/hadronic_on/gen/evgen.41.evt");
393 TheManager->SetEventReader(Reader);
400 aTrackCut->SetNSigmaPion(3.0,1000.0);
401 aTrackCut->SetNSigmaKaon(-3.,3.);
402 aTrackCut->SetNSigmaProton(-1000.,-1.0);
403 aTrackCut->SetNHits(5,50);
404 aTrackCut->SetP(0.2,0.8);
405 aTrackCut->SetPt(0.0,5.0);
406 aTrackCut->SetRapidity(-1.5,1.5);
407 aTrackCut->SetDCA(0.0,2.);
408 aTrackCut->SetCharge(+1);
409 aTrackCut->SetMass(0.494);
425 phiEvcut->SetEventMult(0,100000);
426 phiEvcut->SetVertZPos(-35.0,35.0);
429 phiEvcut->AddCutMonitor(multMoniPass, multMoniFail);
430 phiAnal->SetEventCut(phiEvcut);
436 kaonTrkcut->AddCutMonitor( dedxMoniPosPass, dedxMoniPosFail);
440 kaonTrkcut->AddCutMonitor( pMoni1, pMoni2);
444 kaonTrkcut->AddCutMonitor( ptMoni1, ptMoni2);
448 kaonTrkcut->AddCutMonitor( yptMoni1, yptMoni2);
452 kaonTrkcut->AddCutMonitor( DCAMoni1, DCAMoni2 );
453 phiAnal->SetFirstParticleCut(kaonTrkcut);
457 antikaonTrkcut->SetCharge(-1);
458 phiAnal->SetSecondParticleCut(antikaonTrkcut);
462 antikaonTrkcut->AddCutMonitor( dedxMoniNegPass, dedxMoniNegFail);
467 phiAnal->SetPairCut(phiPairCut);
469 phiAnal->SetNumEventsToMix(3);
475 phiAnal->AddCorrFctn(MinvCF);
478 phiAnal->AddCorrFctn(MinvCFArm);
480 MinvCFY_vs_Pt =
new MinvCorrFctnY_vs_Pt(
"MinvCF dn/d(Y_vs_Pt)",31, -1.5, 1.5, 20, 0., 2. );
481 phiAnal->AddCorrFctn(MinvCFY_vs_Pt);
483 MinvCFM_vs_Pt =
new MinvCorrFctnM_vs_Pt(
"MinvCM dn/d(M_vs_Pt)",100,0.98, 1.18, 40, 0., 2. );
484 phiAnal->AddCorrFctn(MinvCFM_vs_Pt);
508 TheManager->AddAnalysis(phiAnal);
518 eeEvcut->SetEventMult(0,100000);
519 eeEvcut->SetVertZPos(-35.0,35.0);
520 eeAnal->SetEventCut(eeEvcut);
523 electronTrkCut->SetNSigmaElectron(-1e2,+1e2);
524 electronTrkCut->SetNSigmaPion(-1e5,+1e5);
525 electronTrkCut->SetNSigmaKaon(-1e5,+1e5);
526 electronTrkCut->SetNSigmaProton(-1e5,+1e5);
528 electronTrkCut->SetNSigmaElectron(-3,+3);
529 electronTrkCut->SetNSigmaPion(-1e5,+1e5);
530 electronTrkCut->SetNSigmaKaon(-1e5,+1e5);
531 electronTrkCut->SetNSigmaProton(-1e5,+1e5);
533 electronTrkCut->SetNHits(5,100);
534 electronTrkCut->SetP(0.,2.0);
535 electronTrkCut->SetPt(0.0,2.0);
536 electronTrkCut->SetRapidity(-1.5,1.5);
537 electronTrkCut->SetDCA(2.0,50);
538 electronTrkCut->SetCharge(+1);
539 electronTrkCut->SetMass(0.000511);
543 electronTrkCut->AddCutMonitor( dedxMoniPosPass, dedxMoniPosFail);
547 electronTrkCut->AddCutMonitor( pMoni1, pMoni2);
551 electronTrkCut->AddCutMonitor( ptMoni1, ptMoni2);
555 electronTrkCut->AddCutMonitor( yptMoni1, yptMoni2);
559 electronTrkCut->AddCutMonitor( DCAMoni1, DCAMoni2 );
560 eeAnal->SetFirstParticleCut(electronTrkCut);
564 antiElectronTrkCut->SetCharge(-1);
565 eeAnal->SetSecondParticleCut(antiElectronTrkCut);
569 antiElectronTrkCut->AddCutMonitor( dedxMoniNegPass, dedxMoniNegFail);
574 eeAnal->SetPairCut(eePairCut);
576 eeAnal->SetNumEventsToMix(2);
582 eeAnal->AddCorrFctn(MinvLikeSignCFconv);
584 eeAnal->AddCorrFctn(MinvLikeSignCF);
588 TheManager->AddAnalysis(eeAnal);
595 ((
franksTrackCut*)lambdaAnal->FirstParticleCut())->SetNSigmaPion(-1000.0,1000.0);
596 ((
franksTrackCut*)lambdaAnal->FirstParticleCut())->SetNSigmaKaon(-1000.0,1000.0);
597 ((
franksTrackCut*)lambdaAnal->FirstParticleCut())->SetNSigmaProton(-3.0,3.0);
601 ((
franksTrackCut*)lambdaAnal->FirstParticleCut())->SetMass(0.938);
602 ((
franksTrackCut*)lambdaAnal->FirstParticleCut())->SetDCA(8.0,16.);
603 ((
franksTrackCut*)lambdaAnal->SecondParticleCut())->SetNSigmaPion(-3.0,3.0);
604 ((
franksTrackCut*)lambdaAnal->SecondParticleCut())->SetNSigmaKaon(-1000.0,1000.0);
605 ((
franksTrackCut*)lambdaAnal->SecondParticleCut())->SetNSigmaProton(-1000.0,1000.0);
608 ((
franksTrackCut*)lambdaAnal->SecondParticleCut())->SetCharge(-1);
609 ((
franksTrackCut*)lambdaAnal->SecondParticleCut())->SetMass(0.139);
610 ((
franksTrackCut*)lambdaAnal->SecondParticleCut())->SetDCA(8.0,16.);
619 lambdaAnal2->SetPairCut(lambdaAnal2PairCut);
630 rhoEvcut->SetEventMult(0,100000);
631 rhoEvcut->SetVertZPos(-35.0,35.0);
632 rhoAnal->SetEventCut(rhoEvcut);
635 piPosTrkcut->SetNSigmaPion(-2.0,+2.0);
636 piPosTrkcut->SetNSigmaKaon(-1000.,+1000.);
637 piPosTrkcut->SetNSigmaProton(-1000.,+1000.0);
638 piPosTrkcut->SetNHits(10,50);
639 piPosTrkcut->SetP(0.1,0.5);
640 piPosTrkcut->SetPt(0.1,2.0);
641 piPosTrkcut->SetRapidity(-1.5,1.5);
642 piPosTrkcut->SetDCA(0.0,2.);
643 piPosTrkcut->SetCharge(+1);
644 piPosTrkcut->SetMass(0.139);
645 rhoAnal->SetFirstParticleCut(piPosTrkcut);
648 piNegTrkCut->SetCharge(-1);
649 rhoAnal->SetSecondParticleCut(piNegTrkCut);
655 rhoAnal->SetPairCut(rhoPairCut);
657 rhoAnal->SetNumEventsToMix(10);
677 deltaEvcut->SetEventMult(0,100000);
678 deltaEvcut->SetVertZPos(-35.0,35.0);
679 deltaAnal->SetEventCut(deltaEvcut);
682 pionTrkcut->SetNSigmaPion(-2.0,+2.0);
683 pionTrkcut->SetNSigmaKaon(-1000.,+1000.);
684 pionTrkcut->SetNSigmaProton(-1000.,+1000.0);
685 pionTrkcut->SetNHits(10,50);
686 pionTrkcut->SetP(0.1,0.5);
687 pionTrkcut->SetPt(0.1,2.0);
688 pionTrkcut->SetRapidity(-1.5,1.5);
689 pionTrkcut->SetDCA(0.0,2.);
690 pionTrkcut->SetCharge(+1);
691 pionTrkcut->SetMass(0.139);
692 deltaAnal->SetFirstParticleCut(pionTrkcut);
695 protonTrkcut->SetNSigmaPion(-1000.0,+1000.0);
696 protonTrkcut->SetNSigmaProton(-2.,+2.0);
697 protonTrkcut->SetMass(0.938);
698 deltaAnal->SetSecondParticleCut(protonTrkcut);
704 deltaAnal->SetPairCut(deltaPairCut);
706 deltaAnal->SetNumEventsToMix(10);
712 deltaAnal->AddCorrFctn(MinvCFdelta);
726 for (Int_t iev=0;iev<nevents; iev++) {
727 cout <<
"StHbtExample -- Working on eventNumber " << iev << endl;
729 int iret = chain->
Make(iev);
731 cout <<
"Bad return code!" << endl;
737 cout <<
" End of Analysis " << endl;
739 TFile histoOutput(histoFile,
"recreate");
740 MinvCF->Numerator()->Write();
741 MinvCF->Denominator()->Write();
742 MinvCF->Difference()->Write();
743 MinvCFY_vs_Pt->Numerator()->Write();
744 MinvCFY_vs_Pt->Denominator()->Write();
745 MinvCFY_vs_Pt->Difference()->Write();
746 MinvCFM_vs_Pt->Numerator()->Write();
747 MinvCFM_vs_Pt->Denominator()->Write();
748 MinvCFM_vs_Pt->Difference()->Write();
749 MinvCFArm->Numerator()->Write();
750 MinvCFArm->Denominator()->Write();
751 MinvCFArm->Difference()->Write();
753 histoOutput->Write();
754 histoOutput->Close();
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
virtual void Clear(Option_t *option="")
User defined functions.
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...