]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleYPt.cxx
updates in macros for Femto QA in train
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / AliFemto / AliFemtoCutMonitorParticleYPt.cxx
CommitLineData
76ce4b5b 1////////////////////////////////////////////////////////////////////////////////
2// //
3// AliFemtoCutMonitorParticleYPt - the cut monitor for particles to study //
4// the difference between reconstructed and true momentum //
5// //
6////////////////////////////////////////////////////////////////////////////////
7#include "AliFemtoCutMonitorParticleYPt.h"
8#include "AliFemtoModelHiddenInfo.h"
9#include <TH1D.h>
10#include <TH2D.h>
11#include <TList.h>
12#include <TMath.h>
13
14AliFemtoCutMonitorParticleYPt::AliFemtoCutMonitorParticleYPt():
15 fYPt(0),
16 fYPhi(0),
17 fPtPhi(0),
18 fEtaPhi(0),
19 fEtaPt(0),
20 fEtaPhiW(0),
21 fEtaPtW(0),
22 fDCARPt(0),
23 fDCAZPt(0),
24 fMass(0.13957)
25{
26 // Default constructor
1777446b 27 fYPt = new TH2D("YPt", "Rapidity vs Pt", 140, -1.4, 1.4, 100, 0.0, 5.0);
76ce4b5b 28 fYPhi = new TH2D("YPhi", "Rapidity vs Phi", 140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
1777446b 29 fPtPhi = new TH2D("PtPhi", "Pt vs Phi", 100, 0.0, 5.0, 100, -TMath::Pi(), TMath::Pi());
76ce4b5b 30 fEtaPhi = new TH2D("EtaPhi", "Pseudorapidity vs Phi", 140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
1777446b 31 fEtaPt = new TH2D("EtaPt", "Pseudorapidity vs Pt", 140, -1.4, 1.4, 100, 0.0, 5.0);
76ce4b5b 32 // fEtaPhiW = new TH2D("EtaPhiW", "Pseudorapidity vs Phi chi2/N weighted", 140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
1777446b 33 // fEtaPtW = new TH2D("EtaPtW", "Pseudorapidity vs Pt chi2/N weighted", 140, -1.4, 1.4, 100, 0.0, 5.0)
34 ;
35 fDCARPt = new TH2D("DCARPt", "DCA in XY vs. Pt", 400, -3.0, 3.0, 100,0.0,5.0);
36 fDCAZPt = new TH2D("DCAZPt", "DCA in Z vs. Pt", 400, -3.0, 3.0, 100,0.0,5.0);
76ce4b5b 37}
38
39AliFemtoCutMonitorParticleYPt::AliFemtoCutMonitorParticleYPt(const char *aName, float aMass):
40 AliFemtoCutMonitor(),
41 fYPt(0),
42 fYPhi(0),
43 fPtPhi(0),
44 fEtaPhi(0),
45 fEtaPt(0),
46 fEtaPhiW(0),
47 fEtaPtW(0),
48 fDCARPt(0),
49 fDCAZPt(0),
50 fMass(aMass)
51{
52 // Normal constructor
53 char name[200];
54 snprintf(name, 200, "YPt%s", aName);
ceeb8ab7 55 fYPt = new TH2D(name, "Rapdity vs Pt", 140, -1.4, 1.4, 100, 0.0, 5.0);
76ce4b5b 56 snprintf(name, 200, "YPhi%s", aName);
57 fYPhi = new TH2D(name, "Rapidity vs Phi", 140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
58 snprintf(name, 200, "PtPhi%s", aName);
ceeb8ab7 59 fPtPhi = new TH2D(name, "Pt vs Phi", 100, 0.0, 5.0, 100, -TMath::Pi(), TMath::Pi());
76ce4b5b 60 snprintf(name, 200, "EtaPhi%s", aName);
61 fEtaPhi = new TH2D(name, "Pseudorapidity vs Phi", 140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
62 snprintf(name, 200, "EtaPt%s", aName);
ceeb8ab7 63 fEtaPt = new TH2D(name, "Pseudorapidity vs Pt", 140, -1.4, 1.4, 100, 0.0, 5.0);
76ce4b5b 64 // snprintf(name, 200, "EtaPhiW%s", aName);
65 // fEtaPhiW = new TH2D(name, "Pseudorapidity vs Phi chi2/N weighted", 140, -1.4, 1.4, 100, -TMath::Pi(), TMath::Pi());
66 // snprintf(name, 200, "EtaPtW%s", aName);
67 // fEtaPtW = new TH2D(name, "Pseudorapidity vs Pt chi2/N weighted", 140, -1.4, 1.4, 100, 0.0, 2.0);
68 snprintf(name, 200, "DCARPt%s", aName);
ceeb8ab7 69 fDCARPt = new TH2D(name, "DCA in XY vs. Pt", 400, -3.0, 3.0, 100,0.0,3.0);
76ce4b5b 70 snprintf(name, 200, "DCAZPt%s", aName);
ceeb8ab7 71 fDCAZPt = new TH2D(name, "DCA in Z vs. Pt", 400, -3.0, 3.0, 100,0.0,3.0);
76ce4b5b 72}
73
74AliFemtoCutMonitorParticleYPt::AliFemtoCutMonitorParticleYPt(const AliFemtoCutMonitorParticleYPt &aCut):
75 AliFemtoCutMonitor(),
76 fYPt(0),
77 fYPhi(0),
78 fPtPhi(0),
79 fEtaPhi(0),
80 fEtaPt(0),
81 fEtaPhiW(0),
82 fEtaPtW(0),
83 fDCARPt(0),
84 fDCAZPt(0),
85 fMass(0.13957)
86{
87 // copy constructor
88 fYPt = new TH2D(*aCut.fYPt);
89 fYPhi = new TH2D(*aCut.fYPhi);
90 fPtPhi = new TH2D(*aCut.fPtPhi);
91 fEtaPhi = new TH2D(*aCut.fEtaPhi);
92 fEtaPt = new TH2D(*aCut.fEtaPt);
93 // fEtaPhiW = new TH2D(*aCut.fEtaPhiW);
94 // fEtaPtW = new TH2D(*aCut.fEtaPtW);
95 fDCARPt = new TH2D(*aCut.fDCARPt);
96 fDCAZPt = new TH2D(*aCut.fDCAZPt);
97 fMass = aCut.fMass;
98}
99
100AliFemtoCutMonitorParticleYPt::~AliFemtoCutMonitorParticleYPt()
101{
102 // Destructor
103 delete fYPt;
104 delete fYPhi;
105 delete fPtPhi;
106 delete fEtaPhi;
107 delete fEtaPt;
108 // delete fEtaPhiW;
109 // delete fEtaPtW;
110 delete fDCARPt;
111 delete fDCAZPt;
112}
113
114AliFemtoCutMonitorParticleYPt& AliFemtoCutMonitorParticleYPt::operator=(const AliFemtoCutMonitorParticleYPt& aCut)
115{
116 // assignment operator
117 if (this == &aCut)
118 return *this;
119
120 if (fYPt) delete fYPt;
121 fYPt = new TH2D(*aCut.fYPt);
122 if (fYPhi) delete fYPhi;
123 fYPhi = new TH2D(*aCut.fYPhi);
124 if (fPtPhi) delete fPtPhi;
125 fPtPhi = new TH2D(*aCut.fPtPhi);
126 if (fEtaPhi) delete fEtaPhi;
127 fEtaPhi = new TH2D(*aCut.fEtaPhi);
128 if (fEtaPt) delete fEtaPt;
129 fEtaPt = new TH2D(*aCut.fEtaPt);
130 // if (fEtaPhiW) delete fEtaPhiW;
131 // fEtaPhiW = new TH2D(*aCut.fEtaPhiW);
132 // if (fEtaPtW) delete fEtaPtW;
133 // fEtaPtW = new TH2D(*aCut.fEtaPtW);
134 if (fDCARPt) delete fDCARPt;
135 fDCARPt = new TH2D(*aCut.fDCARPt);
136 if (fDCAZPt) delete fDCAZPt;
137 fDCAZPt = new TH2D(*aCut.fDCAZPt);
138
139 return *this;
140}
141
142AliFemtoString AliFemtoCutMonitorParticleYPt::Report(){
143 // Prepare report from the execution
144 string stemp = "*** AliFemtoCutMonitorParticleYPt report";
145 AliFemtoString returnThis = stemp;
146 return returnThis;
147}
148
149void AliFemtoCutMonitorParticleYPt::Fill(const AliFemtoTrack* aTrack)
150{
151 // Fill in the monitor histograms with the values from the current track
152 float tEnergy = ::sqrt(aTrack->P().Mag2()+fMass*fMass);
1777446b 153 if(tEnergy==abs(aTrack->P().z())) tEnergy+=0.001;
76ce4b5b 154 float tRapidity = 0.5*::log((tEnergy+aTrack->P().z())/(tEnergy-aTrack->P().z()));
155 float tPt = ::sqrt((aTrack->P().x())*(aTrack->P().x())+(aTrack->P().y())*(aTrack->P().y()));
4eac0b05 156
157 float tEta;
158 if(aTrack->P().Theta()==0)
159 tEta=0;
160 else
161 tEta = -TMath::Log(TMath::Tan(aTrack->P().Theta()/2.0));
76ce4b5b 162 float tPhi = aTrack->P().Phi();
163 // float chi2w;
164 float dcar = aTrack->ImpactD();
165 float dcaz = aTrack->ImpactZ();
166 // if (aTrack->TPCncls() > 0)
167 // chi2w = aTrack->TPCchi2()/aTrack->TPCncls();
168 // else
169 // chi2w = 6.0;
170
171 // cout << " CMYPt: " << fYPt << " " << fYPt->GetEntries() << " " << tRapidity << " " << tPt << endl;
172
173 fYPt->Fill(tRapidity, tPt);
174 fYPhi->Fill(tRapidity, tPhi);
175 fPtPhi->Fill(tPt, tPhi);
176 fEtaPhi->Fill(tEta, tPhi);
177 fEtaPt->Fill(tEta, tPt);
178 // fEtaPhiW->Fill(tEta, tPhi, chi2w);
179 // fEtaPtW->Fill(tEta, tPt, chi2w);
180 fDCARPt->Fill(dcar, tPt);
181 fDCAZPt->Fill(dcaz, tPt);
182}
183
184void AliFemtoCutMonitorParticleYPt::Write()
185{
186 // Write out the relevant histograms
187 fYPt->Write();
188 fYPhi->Write();
189 fPtPhi->Write();
190 fEtaPhi->Write();
191 fEtaPt->Write();
192 // fEtaPhiW->Write();
193 // fEtaPtW->Write();
194 fDCARPt->Write();
195 fDCAZPt->Write();
196}
197
198TList *AliFemtoCutMonitorParticleYPt::GetOutputList()
199{
200 TList *tOutputList = new TList();
1777446b 201 tOutputList->Add(fYPt);
202 tOutputList->Add(fYPhi);
76ce4b5b 203 tOutputList->Add(fPtPhi);
204 tOutputList->Add(fEtaPhi);
205 tOutputList->Add(fEtaPt);
206 // tOutputList->Add(fEtaPhiW);
207 // tOutputList->Add(fEtaPtW);
208 tOutputList->Add(fDCARPt);
209 tOutputList->Add(fDCAZPt);
210
211 return tOutputList;
212}