StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rho.C
1 
2 // example how to access memberfunctions from a correlation function
3 // ((MinvCorrFctn*) ((StHbtMaker*) chain->GetMaker("HBT"))->HbtManager()->Analysis(0)->CorrFctn(0))->Difference()->Draw()
4 
5 // examples to access member function from cutMonitors (here the member functions return a pointer to a histogram)
6 // ((trackCutMonitor_P_vs_Dedx*)phiAnal->FirstParticleCut()->PassMonitor(0))->Histo()->Draw()
7 // ((trackCutMonitor_P_vs_Dedx*)phiAnal->FirstParticleCut()->FailMonitor(0))->Histo()->Draw()
8 // ((eventCutMonitor_Mult*)phiAnal->EventCut()->PassMonitor(0))->Histo()->Draw()
9 
10 #define STEVENT 1
11 #define MCEVENT 0
12 #define ASSOCIATION 0
13 #define STEVENTREADER 1
14 #define MCEVENTREADER 0
15 #define ASSOCIATIONREADER 0
16 
17 #define DSTWRITER 0
18 #define DSTREADER 0
19 
20 #define ANALYSIS
21 
22 #if DSTREADER
23 #define STEVENT 0
24 #define MCEVENT 0
25 #define ASSOCIATION 0
26 #define STEVENTREADER 0
27 #define MCEVENTREADER 0
28 #define ASSOCIATIONREADER 0
29 #define DSTWRITER 0
30 #endif
31 
32 // NOTE - chain needs to be declared global so for StHbtEventReader
33 class StChain;
34 StChain *chain=0;
35 
36 // keep pointers to Correlation Functions global, so you can have access to them...
37 class QinvCorrFctn;
38 QinvCorrFctn* QinvCF;
39 
40 class QvecCorrFctn;
41 QvecCorrFctn* QvecCF;
42 
43 class MinvCorrFctn;
44 MinvCorrFctn* MinvCF;
45 MinvCorrFctn* MinvCF2;
46 MinvCorrFctn* MinvCFrho;
47 
49 MinvCorrFctnM_vs_Pt* MinvCFM_vs_Pt;
50 
52 MinvCorrFctnY_vs_Pt* MinvCFY_vs_Pt;
53 
54 class MinvCorrFctnM_vs_P;
55 MinvCorrFctnM_vs_P* MinvCFM_vs_P;
56 
57 class p1_vs_p2CorrFctn;
58 p1_vs_p2CorrFctn* p1_vs_p2_CF;
59 
60 class YCorrFctn;
61 YCorrFctn* YdiffCF;
62 
63 class pDiffCorrFctn;
64 pDiffCorrFctn* pDiffCF;
65 
66 class p_vs_angleCorrFctn;
67 p_vs_angleCorrFctn* p_vs_angleCF;
68 
69 class phiMeas_vs_phiCalcCorrFctn;
70 phiMeas_vs_phiCalcCorrFctn* phiMeas_vs_phiCalcCF;
71 
72 // keep pointers to Analysis global, so you can have access to themm ...
73 class StHbtAnalysis;
74 StHbtAnalysis* phiAnal;
75 StHbtAnalysis* phiAnal2;
76 StHbtAnalysis* phiAnal3;
77 StHbtAnalysis* deltaAnal;
78 StHbtAnalysis* rhoAnal;
79 
80 // File-scope stuff needed by setFiles, nextFile. Someone ambitious
81 // can clean this up by putting it all into a nice clean class.
82 Int_t usePath = 0;
83 Int_t nFile = 0;
84 TString thePath;
85 TString theFileName;
86 TString originalPath;
87 //class StChain;
88 //StChain *chain=0;
89 
90 TBrowser *b=0;
91 const char *venusFile ="*geant.root";
92 const char *venusPath ="/disk00001/star/auau200/venus412/default/b0_3/year_1b/hadronic_on/tfs_4/";
93 const char *dstFile ="/disk00001/star/auau200/two_photon/starlight/twogam/year_1b/hadronic_on/tfs/ric0022_01_14552evts.dst.root";
94 const char *xdfFile ="/afs/rhic.bnl.gov/star/data/samples/psc0054_07_40evts_dst.xdf";
95 const char *mdcFile ="/disk00001/star/auau200/venus412/default/b0_3/year_1b/hadronic_on/tss/psc0081_07_40evts.root";
96 const char *geantFile ="/disk00000/star/auau200/hijing135/jetq_off/b0_3/year_1b/hadronic_on/tfsr/set0041_01_53evts.geant.root";
97 const char *fileList[] = {dstFile,xdfFile,mdcFile,0};
98 
99 void wait(int n=1) {
100  for ( int i=0; i<n*1e6; i++) { /*no-op*/ }
101 }
102 void mess(const char* c="alive") {
103  for ( int i=0; i<10; i++) { cout << c << endl; }
104 }
105 
106 
107 void StHbtExampleQQ(const Int_t nevents, const Char_t **fileList);
108 
109 
110 //==========================================================================================
111 //==========================================================================================
112 void rho(const Int_t nevents=9999,
113  const Char_t *path=venusPath,
114  const Char_t *file=venusFile)
115 {
116  const char *fileListQQ[]={0,0};
117  if (path[0]=='-') {
118  fileListQQ[0]=file;
119  } else {
120  fileListQQ[0] = gSystem->ConcatFileName(path,file);
121  }
122  StHbtExampleQQ(nevents,fileListQQ);
123 }
124 //==========================================================================================
125 //==========================================================================================
126 void StHbtExampleQQ(const Int_t nevents, const Char_t **fileList)
127 {
128 
129 // Dynamically link needed shared libs
130 gSystem->Load("St_base");
131 gSystem->Load("StChain");
132 gSystem->Load("St_Tables");
133 gSystem->Load("StMagF");
134 gSystem->Load("StUtilities"); // new addition 22jul99
135 //gSystem->Load("StTreeMaker");
136 gSystem->Load("StIOMaker");
137 gSystem->Load("StarClassLibrary");
138 gSystem->Load("StEvent");
139 //gSystem->Load("StEventReaderMaker");
140 gSystem->Load("StEventMaker");
141 gSystem->Load("StMcEvent");
142 gSystem->Load("StMcEventMaker");
143 gSystem->Load("StAssociationMaker");
144 gSystem->Load("StMcAnalysisMaker");
145 
146 gSystem->Load("StHbtMaker");
147 
148 cout << " loading done " << endl;
149 
150 chain = new StChain("StChain");
151 chain->SetDebug();
152 
153 
154 StFile *setFiles= new StFile();
155 for (int ifil=0; fileList[ifil]; ifil++)
156 setFiles->AddFile(fileList[ifil]);
157 
158 
159 // ********************************
160 // Now we add Makers to the chain...
161 // ********************************
162 
163 // *************
164 // file handling
165 // *************
166 #if STEVENT
167 StIOMaker* ioMaker = new StIOMaker("IO","r",setFiles,"bfcTree");
168 ioMaker->SetDebug();
169 
170 ioMaker->SetIOMode("r");
171 ioMaker->SetDebug();
172 ioMaker->SetBranch("*",0,"0"); //deactivate all branches
173 ioMaker->SetBranch("dstBranch",0,"r"); //activate EventBranch
174 #endif
175 #if MCEVENT
176 StIOMaker* ioMaker = new StIOMaker("IO","r",setFiles,"bfcTree");
177 ioMaker->SetDebug();
178 
179 ioMaker->SetIOMode("r");
180 ioMaker->SetDebug();
181 ioMaker->SetBranch("*",0,"0"); //deactivate all branches
182 ioMaker->SetBranch("geantBranch",0,"r"); //activate EventBranch
183 #endif
184 #if ASSOCIATION
185 StIOMaker* ioMaker = new StIOMaker("IO","r",setFiles,"bfcTree");
186 ioMaker->SetDebug();
187 
188 ioMaker->SetIOMode("r");
189 ioMaker->SetDebug();
190 ioMaker->SetBranch("*",0,"0"); //deactivate all branches
191 cout << " files open" << endl;
192 ioMaker->SetBranch("geantBranch",0,"r"); //activate EventBranch
193 cout << " files open" << endl;
194 ioMaker->SetBranch("dstBranch",0,"r"); //activate EventBranch
195 cout << " files open" << endl;
196 #endif
197 
198 // ***********
199 // Event Maker
200 // ***********
201 #if STEVENT
202 StEventMaker* eventMaker = new StEventMaker("events","title");
203 cout << "Just instantiated StEventMaker... lets go StHbtMaker!" << endl;
204 #endif
205 #if MCEVENT
206 StMcEventMaker* mcEventMaker = new StMcEventMaker; // Make an instance...
207 cout << "StMcEventMaker instantiated"<<endl;
208 #endif
209 #if ASSOCIATION
210 StEventMaker* eventMaker = new StEventMaker("events","title");
211 cout << "Just instantiated StEventMaker... lets go StHbtMaker!" << endl;
212 StMcEventMaker* mcEventMaker = new StMcEventMaker; // Make an instance...
213 cout << "StMcEventMaker instantiated"<<endl;
214 StAssociationMaker* associationMaker = new StAssociationMaker; // Make an instance...
215 cout << "StAssociationMaker instantiated"<<endl;
216 #endif
217 
218 // *********
219 // Hbt Maker
220 // *********
221 
222 StHbtMaker* hbtMaker = new StHbtMaker("HBT","title");
223 cout << "StHbtMaker instantiated"<<endl;
224 // -------------- set up of hbt stuff ----- //
225 cout << "StHbtMaker::Init - setting up Reader and Analyses..." << endl;
226 
227 StHbtManager* TheManager = hbtMaker->HbtManager();
228 
229 
230 // ***********************
231 // setup HBT event readers
232 // ***********************
233 
234 #if STEVENTREADER
235 // *****************************************
236 // set up StHbtMcEventReader as Event Reader
237 // *****************************************
239 Reader->SetTheEventMaker(eventMaker); // gotta tell the reader where it should read from
240 TheManager->SetEventReader(Reader);
241 cout << "READER SET UP.... " << endl;
242 #endif
243 #if MCEVENTREADER
244 // *****************************************
245 // set up StHbtMcEventReader as Event Reader
246 // *****************************************
248 Reader->SetTheMcEventMaker(mcEventMaker); // gotta tell the reader where it should read from
249 TheManager->SetEventReader(Reader);
250 cout << "READER SET UP.... " << endl;
251 #endif
252 #if ASSOCIATIONREADER
253 // ********************************************
254 // set up StHbtAssociationReader as Event Reader
255 // ********************************************
256 // StHbtAssociationReader* Reader = new StHbtAssociationReader();
258 Reader->SetTheEventMaker(eventMaker); // gotta tell the reader where it should read from
259 Reader->SetTheMcEventMaker(mcEventMaker); // gotta tell the reader where it should read from
260 Reader->SetTheAssociationMaker(associationMaker); // gotta tell the reader where it should read from
261 Reader->SetTheMcEventMaker(mcEventMaker); // gotta tell the reader where it should read from
262 TheManager->SetEventReader(Reader);
263 // define cuts for the association maker
264 StMcParameterDB* parameterDB = StMcParameterDB::instance();
265 parameterDB->setXCut(0.1);
266 parameterDB->setZCut(0.2);
267 parameterDB->setReqCommonHits(10);
268 cout << "READER SET UP.... " << endl;
269 #endif
270 
271 #if DSTWRITER
272 // set up the front loaded cuts
273 mikesEventCut* frontLoadedEventCut = new mikesEventCut;
274 frontLoadedEventCut->SetEventMult(0,100000); // selected multiplicity range
275 frontLoadedEventCut->SetVertZPos(-35.0,35.0); // selected range of vertex z-position
276 Reader->SetEventCut(frontLoadedEventCut);
277 franksTrackCut* frontLoadedParticleCut = new franksTrackCut;
278 frontLoadedParticleCut->SetNSigmaPion(-1000.0,1000.0); // number of Sigma in TPC dEdx away from nominal pion dEdx
279 frontLoadedParticleCut->SetNSigmaKaon(-3.,3.); // number of Sigma in TPC dEdx away from nominal kaon dEdx
280 frontLoadedParticleCut->SetNSigmaProton(-1000.0,1000.0); // number of Sigma in TPC dEdx away from nominal proton dEdx
281 frontLoadedParticleCut->SetNHits(5,1000); // range on number of TPC hits on the track
282 frontLoadedParticleCut->SetP(0.0,1.0); // range in P
283 frontLoadedParticleCut->SetPt(0.0,1.0); // range in Pt
284 frontLoadedParticleCut->SetRapidity(-1.5,1.5); // range in rapidity
285 frontLoadedParticleCut->SetDCA(0.0,2.); // range in Distance of Closest Approach to primary vertex
286 frontLoadedParticleCut->SetCharge(0); // no cut on charge
287 frontLoadedParticleCut->SetMass(0.494); // kaon mass
288 Reader->SetParticleCut(frontLoadedParticleCut);
289 // set up a microDstWriter
290 StHbtAsciiReader* Writer = new StHbtAsciiReader;
291 Writer->SetFileName("/scr22/laue/test.asc");
292 TheManager->SetEventWriter(Writer);
293 cout << "WRITER SET UP.... " << endl;
294 #endif
295 
296 #if DSTREADER
297  // set up a microDstWriter
298  StHbtAsciiReader* Reader = new StHbtAsciiReader;
299  Reader->SetFileName(*fileList);
300  TheManager->SetEventReader(Reader);
301 
302  cout << "READER SET UP.... " << endl;
303 #endif
304 
305 
306  // define example particle cut and cut monitors to use in the analyses
307  // example particle cut
308  franksTrackCut* aParticleCut = new franksTrackCut; // use "frank's" particle cut object
309  aParticleCut->SetNSigmaPion(3.0,1000.0); // number of Sigma in TPC dEdx away from nominal pion dEdx
310  aParticleCut->SetNSigmaKaon(-3.,3.); // number of Sigma in TPC dEdx away from nominal kaon dEdx
311  aParticleCut->SetNSigmaProton(-1000.,-1.0); // number of Sigma in TPC dEdx away from nominal proton dEdx
312  aParticleCut->SetNHits(10,50); // range on number of TPC hits on the track
313  aParticleCut->SetP(0.0,1.0); // range in P
314  aParticleCut->SetPt(0.1,2.0); // range in Pt
315  aParticleCut->SetRapidity(-1.5,1.5); // range in rapidity
316  aParticleCut->SetDCA(0.0,2.); // range in Distance of Closest Approach to primary vertex
317  aParticleCut->SetCharge(+1); // want positive kaons
318  aParticleCut->SetMass(0.494); // kaon mass
319  // example cut monitor
320  trackCutMonitor_P_vs_Dedx* aDedxMoniPos = new trackCutMonitor_P_vs_Dedx(+1,"P_vs_Dedx +","Momentum (GeV/c) vs Energy loss (a.u.)",
321  100,0.,1.2,100,0.,1e-5);
322  trackCutMonitor_P_vs_Dedx* aDedxMoniNeg = new trackCutMonitor_P_vs_Dedx(-1,"P_vs_Dedx -","Momentum (GeV/c) vs Energy loss (a.u.)",
323  100,0.,1.2,100,0.,1e-5);
324  // now, we define another analysis that runs simultaneously with the previous one.
325  // this one looks at K+K- correlations (so NONidentical particles) in invariant mass
326 
327  // ****************************************** //
328  // * franks phi analysis - by Frank Laue, OSU //
329  // ****************************************** //
330  // 0) now define an analysis...
331  // StHbtAnalysis* phiAnal = new StHbtAnalysis;
332  phiAnal = new StHbtAnalysis;
333  // 1) set the Event cuts for the analysis
334  mikesEventCut* phiEvcut = new mikesEventCut; // use "mike's" event cut object
335  phiEvcut->SetEventMult(0,100000); // selected multiplicity range
336  phiEvcut->SetVertZPos(-35.0,35.0); // selected range of vertex z-position
337  eventCutMonitor_Mult* multMoniPass = new eventCutMonitor_Mult();
338  eventCutMonitor_Mult* multMoniFail = new eventCutMonitor_Mult();
339  phiEvcut->AddCutMonitor(multMoniPass, multMoniFail);
340  phiAnal->SetEventCut(phiEvcut); // this is the event cut object for this analsys
341  // 2) set the Track (particle) cuts for the analysis
342  franksTrackCut* kaonTrkcut = new franksTrackCut( *aParticleCut ); // copy from example
343  // new particle cut moni
344  trackCutMonitor_P_vs_Dedx* dedxMoniPosPass = new trackCutMonitor_P_vs_Dedx( *aDedxMoniPos);
345  trackCutMonitor_P_vs_Dedx* dedxMoniPosFail = new trackCutMonitor_P_vs_Dedx( *aDedxMoniPos);
346  mess("alive I");
347  kaonTrkcut->AddCutMonitor( dedxMoniPosPass, dedxMoniPosFail);
348  mess("alive II");
349  // new particle cut moni
350  trackCutMonitor_P* pMoni1 = new trackCutMonitor_P;
351  trackCutMonitor_P* pMoni2 = new trackCutMonitor_P("P","momentum (Gev/c)",20, 0., 4.);
352  mess("alive III");
353  kaonTrkcut->AddCutMonitor( pMoni1, pMoni2);
354  mess("alive IV");
355  // new particle cut moni
356  trackCutMonitor_Pt* ptMoni1 = new trackCutMonitor_Pt;
357  trackCutMonitor_Pt* ptMoni2 = new trackCutMonitor_Pt;
358  kaonTrkcut->AddCutMonitor( ptMoni1, ptMoni2);
359  // new particle cut moni
362  kaonTrkcut->AddCutMonitor( yptMoni1, yptMoni2);
363  // new particle cut moni
364  trackCutMonitor_DCA* DCAMoni1 = new trackCutMonitor_DCA("DCA","DCA (cm)",100,0.,10.);
365  trackCutMonitor_DCA* DCAMoni2 = new trackCutMonitor_DCA("DCA","DCA (cm)",100,0.,10.);
366  kaonTrkcut->AddCutMonitor( DCAMoni1, DCAMoni2 );
367  phiAnal->SetFirstParticleCut(kaonTrkcut); // this is the track cut for the "first" particle
368 
369  // copy second particle cut from first particle cut
370  franksTrackCut* antikaonTrkcut = new franksTrackCut( *((franksTrackCut*)phiAnal->FirstParticleCut()) );
371  antikaonTrkcut->SetCharge(-1);
372  phiAnal->SetSecondParticleCut(antikaonTrkcut); // this is the track cut for the "first" particle
373  // new particle cut
374  trackCutMonitor_P_vs_Dedx* dedxMoniNegPass = new trackCutMonitor_P_vs_Dedx( *aDedxMoniNeg);
375  trackCutMonitor_P_vs_Dedx* dedxMoniNegFail = new trackCutMonitor_P_vs_Dedx( *aDedxMoniNeg);
376  antikaonTrkcut->AddCutMonitor( dedxMoniNegPass, dedxMoniNegFail);
377  // 3) set the Pair cuts for the analysis
378  franksPairCut* phiPairCut = new franksPairCut; // use "frank's" pair cut object
379  phiPairCut->SetPDiff(0.,1000.); // difference of pairs in momentum
380  // phiPairCut->SetAngle(0.,180.); // opening angle
381  phiAnal->SetPairCut(phiPairCut); // this is the pair cut for this analysis
382  // 4) set the number of events to mix (per event)
383  phiAnal->SetNumEventsToMix(5);
384  mess("alive III");
385  // ********************************************************************
386  // 5) now set up the correlation functions that this analysis will make
387  // ********************************************************************
388  // define example Minv correlation function
389  MinvCorrFctn* MinvCF = new MinvCorrFctn("Minv",100,0.98,1.18);
390  MinvCF->SetEventCut(phiEvcut);
391  phiAnal->AddCorrFctn(MinvCF); // adds the just-defined correlation function to the analysis
392 
393  MinvCFY_vs_Pt = new MinvCorrFctnY_vs_Pt("MinvCF dn/d(Y_vs_Pt)",20, -2., 2., 20, 0., 2. ); // defines a Minv function
394  phiAnal->AddCorrFctn(MinvCFY_vs_Pt); // adds the just-defined correlation function to the analysis
395 
396  MinvCFM_vs_Pt = new MinvCorrFctnM_vs_Pt("MinvCM dn/d(M_vs_Pt)",50, 1.0, 1.04, 20, 0., 1. ); // defines a Minv function
397  phiAnal->AddCorrFctn(MinvCFM_vs_Pt); // adds the just-defined correlation function to the analysis
398 
399 
400  MinvCFM_vs_P = new MinvCorrFctnM_vs_P("Mass (GeV/c^2) vs Momentum (GeV/c)",50,0.98,1.08,20,0.,2.);
401  phiAnal->AddCorrFctn(MinvCFM_vs_P); // adds the just-defined correlation function to the analysis
402 
403  p1_vs_p2CF = new p1_vs_p2CorrFctn("K+ momentum (GeV/c^) vs K- momentum (GeV/c)",20,0.,2., 20,0.,2.);
404  phiAnal->AddCorrFctn(p1_vs_p2CF); // adds the just-defined correlation function to the analysis
405 
406  YCF = new YCorrFctn("Rapidity",20,-2.,2.);
407  phiAnal->AddCorrFctn(YCF); // adds the just-defined correlation function to the analysis
408 
409  pDiffCF = new pDiffCorrFctn(" p1-p2 (GeV/c)",100,0.,.1);
410  phiAnal->AddCorrFctn(pDiffCF); // adds the just-defined correlation function to the analysis
411 
412  p_vs_angleCF = new p_vs_angleCorrFctn("K+/- momentum (GeV/c^) vs opening angle",20,0.,2., 20,0.,2.*3.1415927);
413  phiAnal->AddCorrFctn(p_vs_angleCF); // adds the just-defined correlation function to the analysis
414 
415  phiMeas_vs_phiCalcCF = new phiMeas_vs_phiCalcCorrFctn(" phiMeas vs phiCalc",20,-1.,1.,20,-1.,1.);
416  phiAnal->AddCorrFctn(phiMeas_vs_phiCalcCF); // adds the just-defined correlation function to the analysis
417 
418  // now add as many more correlation functions to the Analysis as you like..
419  // 6) add the Analysis to the AnalysisCollection
420  TheManager->AddAnalysis(phiAnal);
421 
422  // **************************** //
423  // * set up second phi analysis //
424  // **************************** //
425  // 0) now define an analysis...
426  phiAnal2 = new StHbtAnalysis;
427  // 1) set the Event cuts for the analysis
428  mikesEventCut* phiEvcut2 = new mikesEventCut; // use "mike's" event cut object
429  phiEvcut2->SetEventMult(0,10000); // selected multiplicity range
430  phiEvcut2->SetVertZPos(-35.0,35.0); // selected range of vertex z-position
431  phiAnal2->SetEventCut(phiEvcut2); // use same
432  // 2) set the Track (particle) cuts for the analysis
433  // 1st particle cut
434  franksTrackCut* kaonTrkcut2 = new franksTrackCut( *aParticleCut );
435  kaonTrkcut2->SetNSigmaKaon(-2.,2.); // but tighter cut
436  trackCutMonitor_P_vs_Dedx* dedxMoniPosPass2 = new trackCutMonitor_P_vs_Dedx( *aDedxMoniPos); // copy cutMoni from example
437  trackCutMonitor_P_vs_Dedx* dedxMoniPosFail2 = new trackCutMonitor_P_vs_Dedx( *aDedxMoniPos);
438  kaonTrkcut2->AddCutMonitor( dedxMoniPosPass2, dedxMoniPosFail2);
439  phiAnal2->SetFirstParticleCut(kaonTrkcut2); // this is the track cut for the "first" particle
440  // 2nd particle cut
441  franksTrackCut* antikaonTrkcut2 = new franksTrackCut( *((franksTrackCut*)phiAnal2->FirstParticleCut()) );// copy from 1st cut
442  antikaonTrkcut2->SetCharge(-1); // but set negative charge
443  trackCutMonitor_P_vs_Dedx* dedxMoniNegPass2 = new trackCutMonitor_P_vs_Dedx( *aDedxMoniNeg); // copy cutMoni from example
444  trackCutMonitor_P_vs_Dedx* dedxMoniNegFail2 = new trackCutMonitor_P_vs_Dedx( *aDedxMoniNeg);
445  antikaonTrkcut2->AddCutMonitor( dedxMoniNegPass2, dedxMoniNegFail2);
446  phiAnal2->SetSecondParticleCut(antikaonTrkcut2); // this is the track cut for the "first" particle
447  // 3) set the Pair cuts for the analysis
448  phiAnal2->SetPairCut(phiPairCut); // use same
449  // 4) set the number of events to mix (per event)
450  phiAnal2->SetNumEventsToMix(10);
451  // 5) now set up the correlation functions that this analysis will make
452  MinvCorrFctn* MinvCF2 = new MinvCorrFctn(*MinvCF); // copy from 1st analysis
453  MinvCF2->SetEventCut(phiEvcut);
454  phiAnal2->AddCorrFctn(MinvCF2);
455  // 6) add the Analysis to the AnalysisCollection
456  // TheManager->AddAnalysis(phiAnal2);
457 
458  // **************************** //
459  // * set up second phi analysis //
460  // **************************** //
461  // 0) now define an analysis...
462  phiAnal3 = new StHbtAnalysis;
463  // 1) set the Event cuts for the analysis
464  mikesEventCut* phiEvcut3 = new mikesEventCut; // use "mike's" event cut object
465  phiEvcut3->SetEventMult(0,10000); // selected multiplicity range
466  phiEvcut3->SetVertZPos(-35.0,35.0); // selected range of vertex z-position
467  phiAnal3->SetEventCut(phiEvcut3); // use same
468  // 2) set the Track (particle) cuts for the analysis
469  // 1st particle cut
470  franksTrackCut* kaonTrkcut3 = new franksTrackCut( *aParticleCut );
471  kaonTrkcut3->SetNSigmaKaon(-1.,1.); // number of Sigma in TPC dEdx away from nominal kaon dEdx
472  trackCutMonitor_P_vs_Dedx* dedxMoniPosPass3 = new trackCutMonitor_P_vs_Dedx( *aDedxMoniPos); // copy cutMoni from example
473  trackCutMonitor_P_vs_Dedx* dedxMoniPosFail3 = new trackCutMonitor_P_vs_Dedx( *aDedxMoniPos);
474  kaonTrkcut3->AddCutMonitor( dedxMoniPosPass3, dedxMoniPosFail3);
475  phiAnal3->SetFirstParticleCut(kaonTrkcut3); // this is the track cut for the "first" particle
476  // 2nd particle cut
477  franksTrackCut* antikaonTrkcut3 = new franksTrackCut( *((franksTrackCut*)phiAnal3->FirstParticleCut()) );// copy from 1st cut
478  antikaonTrkcut3->SetCharge(-1); // but set negative charge
479  trackCutMonitor_P_vs_Dedx* dedxMoniNegPass3 = new trackCutMonitor_P_vs_Dedx( *aDedxMoniNeg); // copy cutMoni from example
480  trackCutMonitor_P_vs_Dedx* dedxMoniNegFail3 = new trackCutMonitor_P_vs_Dedx( *aDedxMoniNeg);
481  antikaonTrkcut3->AddCutMonitor( dedxMoniNegPass3, dedxMoniNegFail3);
482  phiAnal3->SetSecondParticleCut(antikaonTrkcut3); // this is the track cut for the "first" particle
483  // 3) set the Pair cuts for the analysis
484  phiAnal3->SetPairCut(phiPairCut); // use same
485  // 4) set the number of events to mix (per event)
486  phiAnal3->SetNumEventsToMix(10);
487  // 5) now set up the correlation functions that this analysis will make
488  MinvCorrFctn* MinvCF3 = new MinvCorrFctn(*MinvCF); // copy from 1st analysis
489  MinvCF3->SetEventCut(phiEvcut);
490  phiAnal3->AddCorrFctn(MinvCF3);
491  // 6) add the Analysis to the AnalysisCollection
492  // TheManager->AddAnalysis(phiAnal3);
493 
494  // ------------------ end of setting up hbt stuff ------------------ //
495 
496  // ****************************************** //
497  // * franks rho analysis - by Frank Laue, OSU //
498  // ****************************************** //
499  // 0) now define an analysis...
500  // StHbtAnalysis* rhoAnal = new StHbtAnalysis;
501  rhoAnal = new StHbtAnalysis;
502  // 1) set the Event cuts for the analysis
503  mikesEventCut* rhoEvcut = new mikesEventCut; // use "mike's" event cut object
504  rhoEvcut->SetEventMult(0,100000); // selected multiplicity range
505  rhoEvcut->SetVertZPos(-35.0,35.0); // selected range of vertex z-position
506  rhoAnal->SetEventCut(rhoEvcut); // this is the event cut object for this analsys
507  // 2) set the Track (particle) cuts for the analysis
508  franksTrackCut* piPosTrkcut = new franksTrackCut; // use "frank's" particle cut object
509  piPosTrkcut->SetNSigmaPion(-2.0,+2.0); // number of Sigma in TPC dEdx away from nominal pion dEdx
510  piPosTrkcut->SetNSigmaKaon(-1000.,+1000.); // number of Sigma in TPC dEdx away from nominal kaon dEdx
511  piPosTrkcut->SetNSigmaProton(-1000.,+1000.0); // number of Sigma in TPC dEdx away from nominal proton dEdx
512  piPosTrkcut->SetNHits(10,50); // range on number of TPC hits on the track
513  piPosTrkcut->SetP(0.1,0.5); // range in P
514  piPosTrkcut->SetPt(0.1,2.0); // range in Pt
515  piPosTrkcut->SetRapidity(-1.5,1.5); // range in rapidity
516  piPosTrkcut->SetDCA(0.0,2.); // range in Distance of Closest Approach to primary vertex
517  piPosTrkcut->SetCharge(+1); // want positive kaons
518  piPosTrkcut->SetMass(0.139); // kaon mass
519  rhoAnal->SetFirstParticleCut(piPosTrkcut); // this is the track cut for the "first" particle
520  // copy second particle cut from first particle cut
521  franksTrackCut* piNegTrkCut = new franksTrackCut( *((franksTrackCut*)rhoAnal->FirstParticleCut()) );
522  piNegTrkCut->SetCharge(-1);
523  rhoAnal->SetSecondParticleCut(piNegTrkCut); // this is the track cut for the "first" particle
524  // 3) set the Pair cuts for the analysis
525  franksPairCut* rhoPairCut = new franksPairCut; // use "frank's" pair cut object
526  rhoPairCut->SetPDiff(0.,1000.); // difference of pairs in momentum
527  // rhoPairCut->SetAngle(0.,180.); // opening angle
528  rhoAnal->SetPairCut(rhoPairCut); // this is the pair cut for this analysis
529  // 4) set the number of events to mix (per event)
530  rhoAnal->SetNumEventsToMix(3);
531  // ********************************************************************
532  // 5) now set up the correlation functions that this analysis will make
533  // ********************************************************************
534  // define example Minv correlation function
535  MinvCFrho = new MinvCorrFctn("Minv",100,0.5,0.8);
536  MinvCFrho->SetEventCut(rhoEvcut);
537  rhoAnal->AddCorrFctn(MinvCFrho); // adds the just-defined correlation function to the analysis
538 
539  // now add as many more correlation functions to the Analysis as you like..
540  // 6) add the Analysis to the AnalysisCollection
541  TheManager->AddAnalysis(rhoAnal);
542 
543  // now execute the chain member functions
544 
545  chain->Init(); // This should call the Init() method in ALL makers
546  chain->PrintInfo();
547 
548  for (Int_t iev=0;iev<nevents; iev++) {
549  cout << "StHbtExample -- Working on eventNumber " << iev << endl;
550  chain->Clear();
551  int iret = chain->Make(iev); // This should call the Make() method in ALL makers
552  if (iret) {
553  cout << "Bad return code!" << endl;
554  break;
555  }
556 
557 
558 
559  } // Event Loop
560  chain->Finish(); // This should call the Finish() method in ALL makers
561 }
562 
563 
564 
Definition: StTree.h:125
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
Definition: StIOInterFace.h:35
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
virtual Int_t Finish()
Definition: StChain.cxx:85
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...
virtual Int_t Make()
Definition: StChain.cxx:110