StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CorrectResolution.C
1 
2 #define USE_MICRODST
3 
4 
5 void CorrectResolution(Int_t nevents=100)
6 {
7 
8  // Dynamically link needed shared libs
9  gSystem->Load("St_base");
10  gSystem->Load("StChain");
11  gSystem->Load("St_Tables");
12  gSystem->Load("StUtilities"); // new addition 22jul99
13  gSystem->Load("StAnalysisUtilities"); // needed by V0dstMaker
14  gSystem->Load("StMagF");
15  gSystem->Load("StIOMaker");
16  gSystem->Load("StarClassLibrary");
17  gSystem->Load("StEvent");
18  gSystem->Load("StEventMaker");
19  gSystem->Load("StHbtMaker");
20 
21  cout << "Dynamic loading done" << endl;
22 
23  chain = new StChain("StChain");
24  chain->SetDebug();
25 
26 
27 #ifndef USE_MICRODST
28 
29  StIOMaker* ioMaker = new StIOMaker("IO","r","/star/rcf/data07/reco/P00hg/2000/07/st_physics_*dst.root","bfcTree");
30  ioMaker->SetDebug();
31 
32  ioMaker->SetIOMode("r");
33  ioMaker->SetDebug();
34  ioMaker->SetBranch("*",0,"0"); //deactivate all branches
35  ioMaker->SetBranch("dstBranch",0,"r"); //activate EventBranch
36 
37 
38  StEventMaker* eventMaker = new StEventMaker("events","title");
39  cout << "Just instantiated StEventMaker... lets go StHbtMaker!" << endl;
40 #endif
41 
42 
43 
44  // Now we add Makers to the chain...
45 
46  StHbtMaker* hbtMaker = new StHbtMaker("HBT","title");
47  cout << "StHbtMaker instantiated"<<endl;
48 
49 
50  /* -------------- set up of hbt stuff ----- */
51  cout << "StHbtMaker::Init - setting up Reader and Analyses..." << endl;
52 
53  StHbtManager* TheManager = hbtMaker->HbtManager();
54 
55  // here, we instantiate the appropriate StHbtEventReader
56 
57 
58 
59 
60 #ifdef USE_MICRODST
61  StHbtBinaryReader* Reader = new StHbtBinaryReader("-","microDst.lis");
62 #else
64  Reader->SetTheEventMaker(eventMaker); // gotta tell the reader where it should read from
65 #endif
66 
67 
68  // here would be the palce to plug in any "front-loaded" Event or Particle Cuts...
69  TheManager->SetEventReader(Reader);
70 
71 
72  StHbtVertexAnalysis* anal;
73  mikesEventCut* FrontLoadedEvcut;
75  mikesTrackCut* trkcut;
76  qualityPairCut* qpc;
77  ManyPairCuts* MPC;
78  EntranceSepPairCut* espc;
79  StHbtCoulomb* cc;
80 
81  QinvCorrFctn* QinvCF;
82  BPLCMSFrame3DCorrFctn* BpLcmsCF;
83  char* QinvCF_name;
84  char* BP_name;
85  int MultLo,MultHi;
86  float pTLo,pTHi;
87  int charge;
88 
89  // SPEED IT UP -- FRONT-LOADED EVENT CUT and TRACK CUT
90 
91  FrontLoadedEvcut = new mikesEventCut;
92  FrontLoadedEvcut->SetEventMult(30,100000);
93  FrontLoadedEvcut->SetVertZPos(-75.0,75.0);
94  Reader->SetEventCut(FrontLoadedEvcut);
95 
96  // Removed Front-loaded Track cut
97 
98  cout << "READER SET UP.... " << endl;
99 
100 
101 
102 
103  /* MOST CENTRAL PIMINUS hi-pT (5) */
104 
105  QinvCF_name = "Qinvmm3hi";
106  BP_name = "BPLCMSmm3hi";
107  MultLo = 174;
108  MultHi = 500;
109  pTLo = 0.325;
110  pTHi = 0.45;
111  charge = -1;
112 
113  anal = new StHbtVertexAnalysis(10,-75.0,75.0);
114  // 1) set the Event cuts for the analysis
115  evcut = new mikesStarStandardEventCut;
116  evcut->SetEventMult(MultLo,MultHi);
117  evcut->SetVertZPos(-75.0,75.0);
118  anal->SetEventCut(evcut);
119  // 2) set the Track (particle) cuts for the analysis
120  trkcut = new mikesTrackCut;
121  trkcut->SetNSigmaPion(-3.0,3.0);
122  trkcut->SetNSigmaKaon(-1000.0,1000.0);
123  trkcut->SetNSigmaProton(-1000.0,1000.0);
124  trkcut->SetNHits(5,50);
125  trkcut->SetPt(pTLo,pTHi);
126  trkcut->SetRapidity(-0.5,0.5);
127  trkcut->SetDCA(0.0,3.0);
128  trkcut->SetCharge(charge);
129  trkcut->SetMass(0.139);
130  anal->SetFirstParticleCut(trkcut);
131  anal->SetSecondParticleCut(trkcut);
132  // 3) set the Pair cuts for the analysis - this one uses ManyPairCuts
133  MPC = new ManyPairCuts;
134  qpc = new qualityPairCut;
135  qpc->SetQualityCut(-0.5,0.6);
136  MPC->AddPairCut(qpc);
137  espc = new EntranceSepPairCut;
138  espc->SetEntranceSepRange(2.5,2000.0);
139  MPC->AddPairCut(espc);
140  anal->SetPairCut(MPC);
141  // 4) set the number of events to mix (per event)
142  anal->SetNumEventsToMix(10);
143  // 5) now set up the correlation functions that this analysis will make
144  // QinvCF = new QinvCorrFctn(QinvCF_name,40,0.0,0.20);
145  // anal->AddCorrFctn(QinvCF);
146  BpLcmsCF = new BPLCMSFrame3DCorrFctn(BP_name,40,0.0,0.2);
147  cc = new StHbtCoulomb;
148  cc->SetRadius(5.0);
149  BpLcmsCF->SetCoulombCorrection(cc);
150  //
151  // now set up momentumResolutionCorrection stuff
152  //
153  StHbtSmearPair* smear = new StHbtSmearPair;
154  smear->SetFractionalPtRes(0.02);
155  smear->SetPhiRes_a(0.00112);
156  smear->SetPhiRes_b(0.000563);
157  smear->SetPhiRes_alpha(-1.51);
158  smear->SetThetaRes_a(0.00136);
159  smear->SetThetaRes_b(0.000776);
160  smear->SetThetaRes_alpha(-1.53);
161  BpLcmsCF->SetSmearPair(smear);
162  //
163  BpLcmsCF->SetLambda(0.65);
164  BpLcmsCF->SetRout(4.52);
165  BpLcmsCF->SetRside(5.00);
166  BpLcmsCF->SetRlong(5.43);
167 
168 
169  anal->AddCorrFctn(BpLcmsCF);
170  // 7) add the Analysis to the AnalysisCollection
171  TheManager->AddAnalysis(anal);
172 
173 
174 
175  /* ------------------ end of setting up hbt stuff ------------------ */
176 
177 
178  // now execute the chain member functions
179 
180  if (chain->Init()){ // This should call the Init() method in ALL makers
181  cout << "Initialization failed \n";
182  goto TheEnd;
183  }
184  chain->PrintInfo();
185 
186 
187  // Event loop
188  int istat=0,iev=1;
189  EventLoop: if (iev <= nevents && !istat) {
190  cout << "StHbtExample -- Working on eventNumber " << iev << " of " << nevents << endl;
191  chain->Clear();
192  istat = chain->Make(iev);
193  if (istat) {cout << "Last event processed. Status = " << istat << endl;}
194  iev++; goto EventLoop;
195  }
196 
197 
198  cout << "StHbtExample -- Done with event loop" << endl;
199 
200  chain->Finish(); // This should call the Finish() method in ALL makers
201 
202  TheEnd:
203 
204  TFile histoOutput("ThreeDHBT.root","recreate");
205 
206  for (int ia=0; ia<1; ia++){
207  StHbtVertexAnalysis* Vanal = (StHbtVertexAnalysis*)(hbtMaker->HbtManager()->Analysis(ia));
208 // QinvCorrFctn* qcf = (QinvCorrFctn*)(Vanal->CorrFctn(0));
209 // qcf->Numerator()->Write();
210 // qcf->Denominator()->Write();
211 // qcf->Ratio()->Write();
212  BPLCMSFrame3DCorrFctn* bpcf = (BPLCMSFrame3DCorrFctn*)(Vanal->CorrFctn(0));
213  bpcf->Numerator()->Write();
214  bpcf->Denominator()->Write();
215  bpcf->Ratio()->Write();
216  //
217  bpcf->mIDNumHisto->Write();
218  bpcf->mIDDenHisto->Write();
219  bpcf->mIDRatHisto->Write();
220  bpcf->mSMNumHisto->Write();
221  bpcf->mSMDenHisto->Write();
222  bpcf->mSMRatHisto->Write();
223  bpcf->mCorrectionHisto->Write();
224  bpcf->mCorrCFHisto->Write();
225  }
226 
227  histoOutput.Close();
228 
229 
230 }
231 
232 
233 
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
virtual Int_t Make()
Definition: StChain.cxx:110