]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.cxx
config file for proton HBT train analysis
[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);
acb5803e 43 fTPCdEdx = new TH2D(name, "TPC dEdx vs. momentum", 100, 0.0, 6.0, 250, 0.0, 500.0);
76ce4b5b 44
45 snprintf(name, 200, "TOFTime%s", aName);
acb5803e 46 fTOFTime = new TH2D(name, "TOF Time vs. momentum", 100, 0.1, 5.0, 400, -4000.0, 4000.0);
ceeb8ab7 47
48 snprintf(name, 200, "TOFNSigma%s", aName);
acb5803e 49 fTOFNSigma = new TH2D(name,"TOF NSigma vs. momentum", 100, 0.0, 5.0, 100, -5.0, 5.0);
ceeb8ab7 50
51 snprintf(name, 200, "TPCNSigma%s", aName);
acb5803e 52 fTPCNSigma = new TH2D(name,"TPC NSigma vs. momentum", 100, 0.0, 5.0, 100, -5.0, 5.0);
ceeb8ab7 53
54 snprintf(name, 200, "TPCTOFNSigma%s", aName);
acb5803e 55 fTPCTOFNSigma = new TH2D(name,"TPC & TOF NSigma vs. momentum", 100, 0.0, 5.0, 100, 0.0, 10.0);
76ce4b5b 56
76ce4b5b 57}
58
59AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID(const AliFemtoCutMonitorParticlePID &aCut):
60 AliFemtoCutMonitor(),
61 fTPCdEdx(0),
62 fTOFParticle(0),
63 fTOFTime(0x0),
ceeb8ab7 64 fTOFNSigma(0),
65 fTPCNSigma(0),
66 fTPCTOFNSigma(0)
67
76ce4b5b 68{
69 // copy constructor
70 if (fTPCdEdx) delete fTPCdEdx;
71 fTPCdEdx = new TH2D(*aCut.fTPCdEdx);
72
73 if (fTOFTime) delete fTOFTime;
74 fTOFTime = new TH2D(*aCut.fTOFTime);
75
ceeb8ab7 76 if (fTOFNSigma) delete fTOFNSigma;
77 fTOFNSigma= new TH2D(*aCut.fTOFNSigma);
78
79 if (fTPCNSigma) delete fTPCNSigma;
80 fTPCNSigma= new TH2D(*aCut.fTPCNSigma);
81
82 if (fTPCTOFNSigma) delete fTPCTOFNSigma;
83 fTPCTOFNSigma= new TH2D(*aCut.fTPCTOFNSigma);
76ce4b5b 84}
85
86AliFemtoCutMonitorParticlePID::~AliFemtoCutMonitorParticlePID()
87{
88 // Destructor
89 delete fTPCdEdx;
90 delete fTOFTime;
ceeb8ab7 91 delete fTOFNSigma;
92 delete fTPCNSigma;
93 delete fTPCTOFNSigma;
94
76ce4b5b 95}
96
97AliFemtoCutMonitorParticlePID& AliFemtoCutMonitorParticlePID::operator=(const AliFemtoCutMonitorParticlePID& aCut)
98{
99 // assignment operator
100 if (this == &aCut)
101 return *this;
102
103 if (fTPCdEdx) delete fTPCdEdx;
104 fTPCdEdx = new TH2D(*aCut.fTPCdEdx);
105
106 if (fTOFTime) delete fTOFTime;
107 fTOFTime = new TH2D(*aCut.fTOFTime);
108
ceeb8ab7 109 if(fTOFNSigma) delete fTOFNSigma;
110 fTOFNSigma = new TH2D(*aCut.fTOFNSigma);
111
112 if(fTPCNSigma) delete fTPCNSigma;
113 fTPCNSigma = new TH2D(*aCut.fTPCNSigma);
114
115 if(fTPCTOFNSigma) delete fTPCTOFNSigma;
116 fTPCTOFNSigma = new TH2D(*aCut.fTPCTOFNSigma);
117
76ce4b5b 118 return *this;
119}
120
121AliFemtoString AliFemtoCutMonitorParticlePID::Report(){
122 // Prepare report from the execution
123 string stemp = "*** AliFemtoCutMonitorParticlePID report";
124 AliFemtoString returnThis = stemp;
125 return returnThis;
126}
127
128void AliFemtoCutMonitorParticlePID::Fill(const AliFemtoTrack* aTrack)
129{
130 // Fill in the monitor histograms with the values from the current track
131 float tMom = aTrack->P().Mag();
132 float tdEdx = aTrack->TPCsignal();
133 float tTOF = 0.0;
134 // short tchg = aTrack->Charge();
135 if (fTOFParticle == 0) tTOF = aTrack->TOFpionTime();
136 if (fTOFParticle == 1) tTOF = aTrack->TOFkaonTime();
137 if (fTOFParticle == 2) tTOF = aTrack->TOFprotonTime();
138
139 fTPCdEdx->Fill(tMom, tdEdx);
140 fTOFTime->Fill(tMom, tTOF);
141
64536eaf 142 // float vp= aTrack->VTOF();
143 // if (vp > 0.) {
144 // fTOFTime->Fill(tMom, tTOF);
145 // if (fTOFParticle == 0) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFPi());
146 // if (fTOFParticle == 1) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFK());
147 // if (fTOFParticle == 2) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFP());
148 // }
149
150 if (fTOFParticle == 0) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFPi());
151 if (fTOFParticle == 1) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFK());
152 if (fTOFParticle == 2) fTOFNSigma->Fill(tMom, aTrack->NSigmaTOFP());
ceeb8ab7 153
154 if (fTOFParticle == 0) fTPCNSigma->Fill(tMom, aTrack->NSigmaTPCPi());
155 if (fTOFParticle == 1) fTPCNSigma->Fill(tMom, aTrack->NSigmaTPCK());
156 if (fTOFParticle == 2) fTPCNSigma->Fill(tMom, aTrack->NSigmaTPCP());
157
158 if (fTOFParticle == 0) fTPCTOFNSigma->Fill(tMom, TMath::Hypot( aTrack->NSigmaTPCPi(), aTrack->NSigmaTOFPi() )/TMath::Sqrt(2) );
159 if (fTOFParticle == 1) fTPCTOFNSigma->Fill(tMom, TMath::Hypot( aTrack->NSigmaTPCK(), aTrack->NSigmaTOFK() )/TMath::Sqrt(2) );
160 if (fTOFParticle == 2) fTPCTOFNSigma->Fill(tMom, TMath::Hypot( aTrack->NSigmaTPCP(), aTrack->NSigmaTOFP() )/TMath::Sqrt(2) );
161
76ce4b5b 162}
163
164void AliFemtoCutMonitorParticlePID::Write()
165{
166 // Write out the relevant histograms
167 fTPCdEdx->Write();
168 fTOFTime->Write();
ceeb8ab7 169 fTOFNSigma->Write();
170 fTPCNSigma->Write();
171 fTPCTOFNSigma->Write();
172
76ce4b5b 173}
174
175TList *AliFemtoCutMonitorParticlePID::GetOutputList()
176{
177 TList *tOutputList = new TList();
178 tOutputList->Add(fTPCdEdx);
179 tOutputList->Add(fTOFTime);
ceeb8ab7 180 tOutputList->Add(fTOFNSigma);
181 tOutputList->Add(fTPCNSigma);
182 tOutputList->Add(fTPCTOFNSigma);
183
76ce4b5b 184 return tOutputList;
185}