]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorEventMult.cxx
Migration of PWG2/FEMTOSCOPY to PWGCF/FEMTOSCOPY
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / AliFemto / AliFemtoCutMonitorEventMult.cxx
1 ////////////////////////////////////////////////////////////////////////////////
2 //                                                                            //
3 // AliFemtoCutMonitorEventMult - the cut monitor for particles to study    //
4 // the difference between reconstructed and true momentum                     //
5 //                                                                            //
6 ////////////////////////////////////////////////////////////////////////////////
7 #include "AliFemtoCutMonitorEventMult.h"
8 #include "AliFemtoModelHiddenInfo.h"
9 #include "AliFemtoEvent.h"
10 #include <TH1D.h>
11 #include <TH2D.h>
12 #include <TList.h>
13
14 AliFemtoCutMonitorEventMult::AliFemtoCutMonitorEventMult():
15   fEvMult(0),
16   fNormEvMult(0),
17   fSPDMult(0),
18   fMultSumPt(0),
19   freadMC(kFALSE),
20   faddhists(kFALSE),
21   fEstimateITSTPC(0),
22   fEstimateTracklets(0),
23   fEstimateITSPure(0),
24   fEst1Est2(0),
25   fEst1Est3(0),
26   fEst2Est3(0),
27   fEst1Norm(0),
28   fEst2Norm(0),
29   fEst3Norm(0)
30 {
31   // Default constructor
32   fEvMult = new TH1D("EvMult", "Event Multiplicity", 5001, -0.5, 5000.5);
33   fMultSumPt = new TH2D("EvMultSumPt","Event Multiplicity vs Total pT",5001,-0.5,5000.5,1000,0.0,100.0);
34 }
35
36 AliFemtoCutMonitorEventMult::AliFemtoCutMonitorEventMult(const char *aName):
37   AliFemtoCutMonitor(),
38   fEvMult(0),
39   fNormEvMult(0),
40   fSPDMult(0),
41   fMultSumPt(0),
42   freadMC(kFALSE),
43   faddhists(kFALSE),
44   fEstimateITSTPC(0),
45   fEstimateTracklets(0),
46   fEstimateITSPure(0),
47   fEst1Est2(0),
48   fEst1Est3(0),
49   fEst2Est3(0),
50   fEst1Norm(0),
51   fEst2Norm(0),
52   fEst3Norm(0)
53 {
54   // Normal constructor
55   char name[200];
56   snprintf(name, 200, "EvMult%s", aName);
57   fEvMult = new TH1D(name, "Event Multiplicity", 5001, -0.5, 5000.5);
58
59   snprintf(name, 200, "NormEvMult%s", aName);
60   fNormEvMult = new TH1D(name, "Normalized Event Multiplicity", 5001, -0.5, 5000.5);
61
62   if(!freadMC) {
63     snprintf(name, 200, "SPDEvMult%s", aName);
64     fSPDMult = new TH1D(name, "SPD Tracklet Multiplicity", 5001, -0.5, 5000.5);
65   }
66
67   snprintf(name, 200, "EvMultTotPt%s", aName);
68   fMultSumPt = new TH2D(name,"Event Multiplicity vs Total pT",501,-0.5,500.5,1000,0.0,100.0);
69
70   if(faddhists)
71     {
72       snprintf(name, 200, "EvMultEstITSTPC%s", aName);
73       fEstimateITSTPC = new TH1D(name, "ITS+TPC Multiplicity Estimate", 5001, -0.5, 5000.5);
74
75       snprintf(name, 200, "EvMultEstTracklets%s", aName);
76       fEstimateTracklets = new TH1D(name, "Tracklets Multiplicity Estimate", 5001, -0.5, 5000.5);
77
78       snprintf(name, 200, "EvMultEstITSPure%s", aName);
79       fEstimateITSPure = new TH1D(name, "ITS Pure Multiplicity Estimate", 8001, -0.5, 8000.5);
80
81       snprintf(name, 200, "EstITSTPCEstTracklet%s", aName);
82       fEst1Est2 = new TH2D(name,"ITS+TPC vs Tracklets",501,-0.5,5000.5,501,-0.5,500.5);
83
84       snprintf(name, 200, "EstITSTPCEstITSPure%s", aName);
85       fEst1Est3 = new TH2D(name,"ITS+TPC vs ITS Pure",501,-0.5,5000.5,801,-0.5,8000.5);
86
87       snprintf(name, 200, "EstTrackletEstITSPure%s", aName);
88       fEst2Est3 = new TH2D(name,"Tracklets vs ITS Pure",501,-0.5,5000.5,801,-0.5,8000.5);
89
90       snprintf(name, 200, "EstITSTPCNormMult%s", aName);
91       fEst1Norm = new TH2D(name,"ITS+TPC vs Normalized Mult",501,-0.5,5000.5,501,-0.5,5000.5);
92
93       snprintf(name, 200, "EstTrackletsNormMult%s", aName);
94       fEst2Norm = new TH2D(name,"Tracklets vs Normalized Mult",501,-0.5,5000.5,501,-0.5,5000.5);
95
96       snprintf(name, 200, "EstITSPureNormMult%s", aName);
97       fEst3Norm = new TH2D(name,"ITS Pure vs Normalized Mult",501,-0.5,5000.5,501,-0.5,5000.5);
98     }
99
100 }
101
102 AliFemtoCutMonitorEventMult::AliFemtoCutMonitorEventMult(const AliFemtoCutMonitorEventMult &aCut):
103   AliFemtoCutMonitor(),
104   fEvMult(0),
105   fNormEvMult(0),
106   fSPDMult(0),
107   fMultSumPt(0),
108   freadMC(kFALSE),
109   faddhists(kFALSE),
110   fEstimateITSTPC(0),
111   fEstimateTracklets(0),
112   fEstimateITSPure(0),
113   fEst1Est2(0),
114   fEst1Est3(0),
115   fEst2Est3(0),
116   fEst1Norm(0),
117   fEst2Norm(0),
118   fEst3Norm(0)
119 {
120   // copy constructor
121   if (fEvMult) delete fEvMult;
122   fEvMult = new TH1D(*aCut.fEvMult);
123
124   if (fNormEvMult) delete fNormEvMult;
125   fNormEvMult = new TH1D(*aCut.fNormEvMult);
126
127   
128   if(!freadMC){
129     if (fSPDMult) delete fSPDMult;
130     fSPDMult = new TH1D(*aCut.fSPDMult);
131   }
132
133   if (fMultSumPt) delete fMultSumPt;
134   fMultSumPt = new TH2D(*aCut.fMultSumPt);
135
136
137   if(faddhists)
138     {
139       if (fEstimateITSTPC) delete fEstimateITSTPC;
140       fEstimateITSTPC = new TH1D(*aCut.fEstimateITSTPC);
141
142       if (fEstimateTracklets) delete fEstimateTracklets;
143       fEstimateTracklets = new TH1D(*aCut.fEstimateTracklets);
144
145       if (fEstimateITSPure) delete fEstimateITSPure;
146       fEstimateITSPure = new TH1D(*aCut.fEstimateITSPure);
147
148       if (fEst1Est2) delete fEst1Est2;
149       fEst1Est2 = new TH2D(*aCut.fEst1Est2);
150
151       if (fEst1Est3) delete fEst1Est3;
152       fEst1Est3 = new TH2D(*aCut.fEst1Est3);
153
154       if (fEst2Est3) delete fEst2Est3;
155       fEst2Est3 = new TH2D(*aCut.fEst2Est3);
156
157       if (fEst1Norm) delete fEst1Norm;
158       fEst1Norm = new TH2D(*aCut.fEst1Norm);
159
160       if (fEst2Norm) delete fEst2Norm;
161       fEst2Norm = new TH2D(*aCut.fEst2Norm);
162
163       if (fEst3Norm) delete fEst3Norm;
164       fEst3Norm = new TH2D(*aCut.fEst3Norm);
165     }
166 }
167
168 AliFemtoCutMonitorEventMult::~AliFemtoCutMonitorEventMult()
169 {
170   // Destructor
171   delete fEvMult;
172   delete fNormEvMult;
173   if(!freadMC){
174     delete fSPDMult;
175   }
176   delete fMultSumPt;
177
178   if(faddhists)
179     {
180       delete fEstimateITSTPC;
181       delete fEstimateTracklets;
182       delete fEstimateITSPure;
183       delete fEst1Est2;
184       delete fEst1Est3;
185       delete fEst2Est3;
186       delete fEst1Norm;
187       delete fEst2Norm;
188       delete fEst3Norm;
189     }      
190 }
191
192 AliFemtoCutMonitorEventMult& AliFemtoCutMonitorEventMult::operator=(const AliFemtoCutMonitorEventMult& aCut)
193 {
194   // assignment operator
195   if (this == &aCut) 
196     return *this;
197
198   if (fEvMult) delete fEvMult;
199   fEvMult = new TH1D(*aCut.fEvMult);
200   
201   if (fNormEvMult) delete fNormEvMult;
202   fNormEvMult = new TH1D(*aCut.fNormEvMult);
203   
204   if(!freadMC){
205     if (fSPDMult) delete fSPDMult;
206     fSPDMult = new TH1D(*aCut.fSPDMult);
207   }
208   
209   if (fMultSumPt) delete fMultSumPt;
210   fMultSumPt = new TH2D(*aCut.fMultSumPt);
211
212
213   if(faddhists)
214     {
215       if (fEstimateITSTPC) delete fEstimateITSTPC;
216       fEstimateITSTPC = new TH1D(*aCut.fEstimateITSTPC);
217
218       if (fEstimateTracklets) delete fEstimateTracklets;
219       fEstimateTracklets = new TH1D(*aCut.fEstimateTracklets);
220
221       if (fEstimateITSPure) delete fEstimateITSPure;
222       fEstimateITSPure = new TH1D(*aCut.fEstimateITSPure);
223
224       if (fEst1Est2) delete fEst1Est2;
225       fEst1Est2 = new TH2D(*aCut.fEst1Est2);
226
227       if (fEst1Est3) delete fEst1Est3;
228       fEst1Est3 = new TH2D(*aCut.fEst1Est3);
229
230       if (fEst2Est3) delete fEst2Est3;
231       fEst2Est3 = new TH2D(*aCut.fEst2Est3);
232
233       if (fEst1Norm) delete fEst1Norm;
234       fEst1Norm = new TH2D(*aCut.fEst1Norm);
235
236       if (fEst2Norm) delete fEst2Norm;
237       fEst2Norm = new TH2D(*aCut.fEst2Norm);
238
239       if (fEst3Norm) delete fEst3Norm;
240       fEst3Norm = new TH2D(*aCut.fEst3Norm);
241     }
242
243   return *this;
244 }
245
246 AliFemtoString AliFemtoCutMonitorEventMult::Report(){ 
247   // Prepare report from the execution
248   string stemp = "*** AliFemtoCutMonitorEventMult report"; 
249   AliFemtoString returnThis = stemp;
250   return returnThis; 
251 }
252
253 void AliFemtoCutMonitorEventMult::Fill(const AliFemtoEvent* aEvent)
254 {
255   // Fill in the monitor histograms with the values from the current track
256   fEvMult->Fill(aEvent->NumberOfTracks());
257   fNormEvMult->Fill(aEvent->UncorrectedNumberOfPrimaries());
258   if(!freadMC){
259     fSPDMult->Fill(aEvent->SPDMultiplicity());
260   }
261   fMultSumPt->Fill(aEvent->UncorrectedNumberOfPrimaries(), aEvent->ZDCEMEnergy());
262
263   if(faddhists)
264     {
265       fEstimateITSTPC->Fill(aEvent->MultiplicityEstimateITSTPC());
266       fEstimateTracklets->Fill(aEvent->MultiplicityEstimateTracklets());
267       fEstimateITSPure->Fill(aEvent->MultiplicityEstimateITSPure());
268       fEst1Est2->Fill(aEvent->MultiplicityEstimateITSTPC(),aEvent->MultiplicityEstimateTracklets());
269       fEst1Est3->Fill(aEvent->MultiplicityEstimateITSTPC(),aEvent->MultiplicityEstimateITSPure());
270       fEst2Est3->Fill(aEvent->MultiplicityEstimateTracklets(),aEvent->MultiplicityEstimateITSPure());
271       fEst1Norm->Fill(aEvent->MultiplicityEstimateITSTPC(),aEvent->UncorrectedNumberOfPrimaries());
272       fEst2Norm->Fill(aEvent->MultiplicityEstimateTracklets(),aEvent->UncorrectedNumberOfPrimaries());
273       fEst3Norm->Fill(aEvent->MultiplicityEstimateITSPure(),aEvent->UncorrectedNumberOfPrimaries());
274     }
275
276 }
277
278 void AliFemtoCutMonitorEventMult::Write()
279 {
280   // Write out the relevant histograms
281   fEvMult->Write();
282   fNormEvMult->Write();
283   if(!freadMC){
284     fSPDMult->Write();
285   }
286   fMultSumPt->Write();
287
288   if(faddhists)
289     {
290       fEstimateITSTPC->Write();
291       fEstimateTracklets->Write();
292       fEstimateITSPure->Write();
293       fEst1Est2->Write();
294       fEst1Est3->Write();
295       fEst2Est3->Write();
296       fEst1Norm->Write();
297       fEst2Norm->Write();
298       fEst3Norm->Write();
299     }
300
301 }
302
303 TList *AliFemtoCutMonitorEventMult::GetOutputList()
304 {
305   TList *tOutputList = new TList();
306   tOutputList->Add(fEvMult);
307   tOutputList->Add(fNormEvMult);
308   tOutputList->Add(fSPDMult);
309   tOutputList->Add(fMultSumPt);
310
311   if(faddhists)
312     {
313       tOutputList->Add(fEstimateITSTPC);
314       tOutputList->Add(fEstimateTracklets);
315       tOutputList->Add(fEstimateITSPure);
316       tOutputList->Add(fEst1Est2);
317       tOutputList->Add(fEst1Est3);
318       tOutputList->Add(fEst2Est3);
319       tOutputList->Add(fEst1Norm);
320       tOutputList->Add(fEst2Norm);
321       tOutputList->Add(fEst3Norm);
322     }
323   
324   return tOutputList;
325 }
326
327 void AliFemtoCutMonitorEventMult::SetReadMC(Bool_t mc)
328 {
329   freadMC=mc;
330 }
331
332 void AliFemtoCutMonitorEventMult::AdditionalMultHistsOn(Bool_t addhists)
333 {
334   faddhists=addhists;
335 }
336