StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtSectoredExample.C
1 
2 // Example of SectoredAnalysis using MDC3 data
3 
4 class StChain;
5 StChain *chain=0;
6 
7 // keep pointers to Correlation Functions global, so you can have access to them...
8 
9 class QinvCorrFctn;
10 QinvCorrFctn* QinvCF;
11 
12 void StHbtSectoredExample(Int_t nevents=100, const char *MainFile="/direct/star+data01/pwg/hbt/MDC3/MicroDst/Lanny/Peripheral/rcf0106_80_120evts.dst.root.pion.microDst")
13 
14 {
15 
16  // Dynamically link needed shared libs
17  gSystem->Load("St_base");
18  gSystem->Load("StChain");
19  gSystem->Load("St_Tables");
20  gSystem->Load("StUtilities"); // new addition 22jul99
21  gSystem->Load("StAnalysisUtilities"); // needed by V0dstMaker
22  gSystem->Load("StMagF");
23  gSystem->Load("StIOMaker");
24  gSystem->Load("StarClassLibrary");
25  gSystem->Load("StEvent");
26  gSystem->Load("StEventMaker");
27  gSystem->Load("StHbtMaker");
28 
29  cout << "Dynamic loading done" << endl;
30 
31  chain = new StChain("StChain");
32  chain->SetDebug();
33 
34 
35  // Now we add Makers to the chain...
36 
37  StHbtMaker* hbtMaker = new StHbtMaker("HBT","title");
38  cout << "StHbtMaker instantiated"<<endl;
39 
40 
41 
42  /* -------------- set up of hbt stuff ----- */
43  cout << "StHbtMaker::Init - setting up Reader and Analyses..." << endl;
44 
45  StHbtManager* TheManager = hbtMaker->HbtManager();
46 
47  // here, we instantiate the appropriate StHbtEventReader
48 
49  // use the binary reader
51  Reader->SetFileName(MainFile);
52 
53  // here would be the palce to plug in any "front-loaded" Event or Particle Cuts...
54  TheManager->SetEventReader(Reader);
55 
56  cout << "READER SET UP.... " << endl;
57 
58  // We will inistantiate an StHbtSectoredAnalysis. The cuts are the same as in StHbtExample.C
59  // with the exception of some extra initialization for the sectoring.
60 
61  // TWO PARTICLE CORRELATION FUNCTION
62 
63  // 0) now define a sectored two particle analysis.
65  // 1) set the Event cuts for the analysis
66  mikesEventCut* evcut = new mikesEventCut; // use "mike's" event cut object
67  evcut->SetEventMult(0,10000); // selected multiplicity range
68  evcut->SetVertZPos(-35.0,35.0); // selected range of vertex z-position
69  anal->SetEventCut(evcut); // this is the event cut object for this analsys
70  // 2) set the Track (particle) cuts for the analysis
71  mikesTrackCut* trkcut = new mikesTrackCut; // use "mike's" particle cut object
72  trkcut->SetNSigmaPion(-1.5,1.5); // number of Sigma in TPC dEdx away from nominal pion dEdx
73  trkcut->SetNSigmaKaon(-1000.0,1000.0); // number of Sigma in TPC dEdx away from nominal kaon dEdx
74  trkcut->SetNSigmaProton(-1000.0,1000.0); // number of Sigma in TPC dEdx away from nominal proton dEdx
75  trkcut->SetNHits(5,50); // range on number of TPC hits on the track
76  trkcut->SetPt(0.1,1.0); // range in Pt
77  trkcut->SetRapidity(-1.0,1.0); // range in rapidity
78  trkcut->SetDCA(0.0,0.5); // range in Distance of Closest Approach to primary vertex
79  trkcut->SetCharge(-1); // want negative pions
80  trkcut->SetMass(0.139); // pion mass
81  anal->SetFirstParticleCut(trkcut); // this is the track cut for the "first" particle
82  anal->SetSecondParticleCut(trkcut); // NOTE - it is also for the "second" particle -- i.e. identical particle HBT
83  // 3) set the Pair cuts for the analysis
84  mikesPairCut* paircut = new mikesPairCut; // use "mike's" pair cut object
85  anal->SetPairCut(paircut); // this is the pair cut for this analysis
86  // 4) set the number of events to mix (per event)
87  anal->SetNumEventsToMix(5);
88  // 5) now set up the correlation functions that this analysis will make
89  // this particular analysis will have one: a Q-invariant correlation function
90  QinvCF = new QinvCorrFctn("mikesQinvCF - SectoredAnalysis",50,0.0,0.2); // defines a Qinv correlation function
91  anal->AddCorrFctn(QinvCF); // adds the just-defined correlation function to the analysis
92 
93  // Now we must set up the sectoring. Momentum space will be sectored into identical cubes,
94  // of length DeltaP. The amount of momentum space to sector is determined by the min and max
95  // values of PX, PY, and PZ. Any particles that fall outside these boundaries will be
96  // collected in one large "overflow" bin. The effect is that you should see no change in the
97  // calculation of the correlation function regardless of your choice of parameters, except
98  // that you will notice the calculation at large Q will not be correct, since the sectoring
99  // eliminates those pairs.
100  //
101  // The analysis will not allow incorrect entries (such as DeltaP=0), and there are default values
102  // which are given in StHbtSectoredAnalysis.cxx
103 
104  // 6) Set parameters for sectoring
105  // Here we will use sectors of 150 MeV cubed, going from -1.05 Gev to 1.05 Gev; this gives 2744 sectors
106  anal->SetDeltaP(0.15);
107  anal->SetPXmax(1.05);
108  anal->SetPXmin(-1.05);
109  anal->SetPYmax(1.05);
110  anal->SetPYmin(-1.05);
111  anal->SetPZmax(1.05);
112  anal->SetPZmin(-1.05);
113 
114  // 7) add the Analysis to the AnalysisCollection
115  TheManager->AddAnalysis(anal);
116 
117 
118  /* ------------------ end of setting up hbt stuff ------------------ */
119 
120 
121  // now execute the chain member functions
122 
123  if (chain->Init()){ // This should call the Init() method in ALL makers
124  cout << "Initialization failed \n";
125  goto TheEnd;
126  }
127  chain->PrintInfo();
128 
129 
130  // Event loop
131  int istat=0,iev=1;
132  EventLoop: if (iev <= nevents && !istat) {
133  cout << "StHbtExample -- Working on eventNumber " << iev << " of " << nevents << endl;
134  chain->Clear();
135  istat = chain->Make(iev);
136  if (istat) {cout << "Last event processed. Status = " << istat << endl;}
137  iev++; goto EventLoop;
138  }
139 
140 
141  cout << "StHbtExample -- Done with event loop" << endl;
142 
143  chain->Finish(); // This should call the Finish() method in ALL makers
144 
145  TheEnd:
146 }
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
virtual Int_t Finish()
Definition: StChain.cxx:85
virtual Int_t Make()
Definition: StChain.cxx:110