]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.cxx
Testing the patch
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / AliFemto / AliFemtoCutMonitorParticlePID.cxx
CommitLineData
76ce4b5b 1////////////////////////////////////////////////////////////////////////////////
2// //
3// AliFemtoCutMonitorParticlePID - the cut monitor for particles to study //
4// various aspects of the PID determination //
5// //
6////////////////////////////////////////////////////////////////////////////////
7#include "AliFemtoCutMonitorParticlePID.h"
8#include "AliFemtoModelHiddenInfo.h"
9#include <TH1D.h>
10#include <TH2D.h>
11#include <TList.h>
12#include <TMath.h>
13
14AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID():
15 fTPCdEdx(0),
16 fTOFParticle(0),
17 fTOFTime(0x0),
ceeb8ab7 18 fTOFNSigma(0),
19 fTPCNSigma(0),
20 fTPCTOFNSigma(0)
76ce4b5b 21{
22 // Default constructor
acb5803e 23 fTPCdEdx = new TH2D("TPCdEdx", "TPC dEdx vs. momentum", 100, 0.0, 5.0, 250, 0.0, 500.0);
24 fTOFTime = new TH2D("TOFTime", "TOF Time vs. momentum", 100, 0.1, 5.0, 400, -4000.0, 4000.0);
25 fTOFNSigma = new TH2D("TOFNSigma","TOF NSigma vs. momentum", 100, 0.0, 5.0, 100, -5.0, 5.0);
26 fTPCNSigma = new TH2D("TPCNSigma","TPC NSigma vs. momentum", 100, 0.0, 5.0, 100, -5.0, 5.0);
27 fTPCTOFNSigma = new TH2D("TPCTOFNSigma","TPC & TOF NSigma vs. momentum", 100, 0.0, 5.0, 100, 0.0, 10.0);
ceeb8ab7 28
76ce4b5b 29}
30
31AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID(const char *aName, Int_t aTOFParticle):
32 AliFemtoCutMonitor(),
33 fTPCdEdx(0),
34 fTOFParticle(aTOFParticle),
35 fTOFTime(0x0),
ceeb8ab7 36 fTOFNSigma(0),
37 fTPCNSigma(0),
38 fTPCTOFNSigma(0)
76ce4b5b 39{
40 // Normal constructor
41 char name[200];
42 snprintf(name, 200, "TPCdEdx%s", aName);
130ef00d 43 // fTPCdEdx = new TH2D(name, "TPC dEdx vs. momentum", 100, 0.0, 6.0, 250, 0.0, 500.0);
44 fTPCdEdx = new TH2D(name, "TPC dEdx vs. momentum", 200, 0.1, 4.0, 250, 0.0, 500.0);
76ce4b5b 45
46 snprintf(name, 200, "TOFTime%s", aName);
acb5803e 47 fTOFTime = new TH2D(name, "TOF Time vs. momentum", 100, 0.1, 5.0, 400, -4000.0, 4000.0);
ceeb8ab7 48
49 snprintf(name, 200, "TOFNSigma%s", aName);
acb5803e 50 fTOFNSigma = new TH2D(name,"TOF NSigma vs. momentum", 100, 0.0, 5.0, 100, -5.0, 5.0);
ceeb8ab7 51
52 snprintf(name, 200, "TPCNSigma%s", aName);
acb5803e 53 fTPCNSigma = new TH2D(name,"TPC NSigma vs. momentum", 100, 0.0, 5.0, 100, -5.0, 5.0);
ceeb8ab7 54
55 snprintf(name, 200, "TPCTOFNSigma%s", aName);
acb5803e 56 fTPCTOFNSigma = new TH2D(name,"TPC & TOF NSigma vs. momentum", 100, 0.0, 5.0, 100, 0.0, 10.0);
76ce4b5b 57
76ce4b5b 58}
59
60AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID(const AliFemtoCutMonitorParticlePID &aCut):
61 AliFemtoCutMonitor(),
62 fTPCdEdx(0),
63 fTOFParticle(0),
64 fTOFTime(0x0),
ceeb8ab7 65 fTOFNSigma(0),
66 fTPCNSigma(0),
67 fTPCTOFNSigma(0)
68
76ce4b5b 69{
70 // copy constructor
71 if (fTPCdEdx) delete fTPCdEdx;
72 fTPCdEdx = new TH2D(*aCut.fTPCdEdx);
73
74 if (fTOFTime) delete fTOFTime;
75 fTOFTime = new TH2D(*aCut.fTOFTime);
76
ceeb8ab7 77 if (fTOFNSigma) delete fTOFNSigma;
78 fTOFNSigma= new TH2D(*aCut.fTOFNSigma);
79
80 if (fTPCNSigma) delete fTPCNSigma;
81 fTPCNSigma= new TH2D(*aCut.fTPCNSigma);
82
83 if (fTPCTOFNSigma) delete fTPCTOFNSigma;
84 fTPCTOFNSigma= new TH2D(*aCut.fTPCTOFNSigma);
76ce4b5b 85}
86
87AliFemtoCutMonitorParticlePID::~AliFemtoCutMonitorParticlePID()
88{
89 // Destructor
90 delete fTPCdEdx;
91 delete fTOFTime;
ceeb8ab7 92 delete fTOFNSigma;
93 delete fTPCNSigma;
94 delete fTPCTOFNSigma;
95
76ce4b5b 96}
97
98AliFemtoCutMonitorParticlePID& AliFemtoCutMonitorParticlePID::operator=(const AliFemtoCutMonitorParticlePID& aCut)
99{
100 // assignment operator
91bce940 101 if (this == &aCut)
76ce4b5b 102 return *this;
103
104 if (fTPCdEdx) delete fTPCdEdx;
105 fTPCdEdx = new TH2D(*aCut.fTPCdEdx);
106
107 if (fTOFTime) delete fTOFTime;
108 fTOFTime = new TH2D(*aCut.fTOFTime);
91bce940 109
ceeb8ab7 110 if(fTOFNSigma) delete fTOFNSigma;
111 fTOFNSigma = new TH2D(*aCut.fTOFNSigma);
112
113 if(fTPCNSigma) delete fTPCNSigma;
114 fTPCNSigma = new TH2D(*aCut.fTPCNSigma);
115
116 if(fTPCTOFNSigma) delete fTPCTOFNSigma;
117 fTPCTOFNSigma = new TH2D(*aCut.fTPCTOFNSigma);
118
76ce4b5b 119 return *this;
120}
121
91bce940 122AliFemtoString AliFemtoCutMonitorParticlePID::Report(){
76ce4b5b 123 // Prepare report from the execution
91bce940 124 string stemp = "*** AliFemtoCutMonitorParticlePID report";
76ce4b5b 125 AliFemtoString returnThis = stemp;
91bce940 126 return returnThis;
76ce4b5b 127}
128
129void AliFemtoCutMonitorParticlePID::Fill(const AliFemtoTrack* aTrack)
130{
131 // Fill in the monitor histograms with the values from the current track
132 float tMom = aTrack->P().Mag();
133 float tdEdx = aTrack->TPCsignal();
134 float tTOF = 0.0;
135 // short tchg = aTrack->Charge();
136 if (fTOFParticle == 0) tTOF = aTrack->TOFpionTime();
137 if (fTOFParticle == 1) tTOF = aTrack->TOFkaonTime();
138 if (fTOFParticle == 2) tTOF = aTrack->TOFprotonTime();
139
140 fTPCdEdx->Fill(tMom, tdEdx);
141 fTOFTime->Fill(tMom, tTOF);
142
64536eaf 143 // float vp= aTrack->VTOF();
144 // if (vp > 0.) {
145 // fTOFTime->Fill(tMom, tTOF);
146 // if (fTOFParticle == 0) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFPi());
147 // if (fTOFParticle == 1) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFK());
148 // if (fTOFParticle == 2) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFP());
149 // }
150
151 if (fTOFParticle == 0) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFPi());
152 if (fTOFParticle == 1) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFK());
153 if (fTOFParticle == 2) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFP());
ceeb8ab7 154
155 if (fTOFParticle == 0) fTPCNSigma->Fill(tMom, aTrack->NSigmaTPCPi());
156 if (fTOFParticle == 1) fTPCNSigma->Fill(tMom, aTrack->NSigmaTPCK());
157 if (fTOFParticle == 2) fTPCNSigma->Fill(tMom, aTrack->NSigmaTPCP());
158
91bce940 159 if (fTOFParticle == 0) fTPCTOFNSigma->Fill(tMom, TMath::Hypot( aTrack->NSigmaTPCPi(), aTrack->NSigmaTOFPi() ) );
160 if (fTOFParticle == 1) fTPCTOFNSigma->Fill(tMom, TMath::Hypot( aTrack->NSigmaTPCK(), aTrack->NSigmaTOFK() ) );
161 if (fTOFParticle == 2) fTPCTOFNSigma->Fill(tMom, TMath::Hypot( aTrack->NSigmaTPCP(), aTrack->NSigmaTOFP() ) );
ceeb8ab7 162
76ce4b5b 163}
164
165void AliFemtoCutMonitorParticlePID::Write()
166{
167 // Write out the relevant histograms
168 fTPCdEdx->Write();
169 fTOFTime->Write();
ceeb8ab7 170 fTOFNSigma->Write();
171 fTPCNSigma->Write();
172 fTPCTOFNSigma->Write();
173
76ce4b5b 174}
175
176TList *AliFemtoCutMonitorParticlePID::GetOutputList()
177{
178 TList *tOutputList = new TList();
179 tOutputList->Add(fTPCdEdx);
180 tOutputList->Add(fTOFTime);
ceeb8ab7 181 tOutputList->Add(fTOFNSigma);
182 tOutputList->Add(fTPCNSigma);
183 tOutputList->Add(fTPCTOFNSigma);
184
76ce4b5b 185 return tOutputList;
186}