]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/TRD/AliTRDv0Monitor.cxx
add stub for GetRefFigure function
[u/mrichter/AliRoot.git] / PWG1 / TRD / AliTRDv0Monitor.cxx
CommitLineData
0ed6f095 1/**************************************************************************
2* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercialf purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
16/////////////////////////////////////////////////////
17//
18// Monitor V0 for TRD
19//
20// Authors:
21// Markus Heide <mheide@uni-muenster.de>
22//////////////////////////////////////////////////////
23
24#include "TPDGCode.h"
25#include "TFile.h"
26#include "TTree.h"
27#include "TEventList.h"
28#include "TObjArray.h"
29#include "TH2.h"
30#include "TH2F.h"
31#include "TH1I.h"
32#include "TList.h"
33
34#include "AliLog.h"
35#include "AliESDtrack.h"
36#include "AliPID.h"
37#include "AliTRDv0Monitor.h"
38#include "info/AliTRDv0Info.h"
39
40
41ClassImp(AliTRDv0Monitor)
42
43//________________________________________________________________________
44AliTRDv0Monitor::AliTRDv0Monitor()
45 :AliTRDrecoTask()
46 ,fOutput(NULL)
47 ,hQualityReductions(NULL)
48 ,fV0s(NULL)
49 ,fData(NULL)
50 ,fInfo(NULL)
51 ,fP(-1.)
52{
53 //
54 // Default constructor
55 //
56 SetNameTitle("v0Monitor", "Reference V0 Monitor");
57}
58
59//________________________________________________________________________
60AliTRDv0Monitor::AliTRDv0Monitor(const char *name, const char *title)
61 :AliTRDrecoTask(name, title)
62 ,fOutput(NULL)
63 ,hQualityReductions(NULL)
64 ,fV0s(NULL)
65 ,fData(NULL)
66 ,fInfo(NULL)
67 ,fP(-1.)
68{
69 //
70 // Default constructor
71 //
72 DefineInput(2, TObjArray::Class()); // v0 list
73 DefineInput(3, TObjArray::Class()); // pid info list
74 DefineOutput(1, TList::Class());
75
76}
77
78
79//________________________________________________________________________
80AliTRDv0Monitor::~AliTRDv0Monitor()
81{
82 if(fOutput) delete fOutput;
83}
129a3fe2 84
85//________________________________________________________________________
86Bool_t AliTRDv0Monitor::GetRefFigure(Int_t /*ifig*/)
87{
88 AliInfo("Implementation on going ...");
89 return kTRUE;
90}
91
0ed6f095 92//________________________________________________________________________
93void AliTRDv0Monitor::UserCreateOutputObjects()
94{
95 // Create histograms
96 // Called once
97
98
99 fOutput = new TList;
100 fOutput->SetName("V0Monitoring");
101
102
103 const char *samplename[AliPID::kSPECIES] = {"electrons","muons","pions","kaons","protons"};
104 const char *decayname[AliTRDv0Info::kNDecays] = {"gamma","K0s","Lambda","AntiLambda"};
105 const char *detectorname[kNDets] = {"ITS","TPC","TOF"};
106
107 hQualityReductions = new TH1I(Form("hQualityReductions"),Form("Number of tracks cut out by different quality cut steps"),11,-9,2);
108 fOutput->Add(hQualityReductions);
109
110 for(Int_t ipart = 0;ipart < AliPID::kSPECIES; ipart++){
111 hCutReductions[ipart] = new TH1I(Form("hCutReductions_%s",samplename[ipart]),Form("Number of tracks cut out by different cut steps for %s",samplename[ipart]),19,-17,2);
112 fOutput->Add(hCutReductions[ipart]);
113 for(Int_t idetector = 0; idetector < kNDets; idetector++){
114 hDetPID[idetector][ipart] = new TH2F(Form("hDetector_%s_%s",detectorname[idetector],samplename[ipart]),Form("%s Likelihood for %s vs. momentum",detectorname[idetector], samplename[ipart]),100,0.,10.,100, 0., 1.);
115
116 fOutput->Add(hDetPID[idetector][ipart]);
117 }
118 hComPID[ipart] = new TH2F(Form("hComPID_%s",samplename[ipart]),Form("Combined TPC/TOF PID: Likelihood for %s",samplename[ipart]),100,0.,10.,100,0.,1.);
119
120 fOutput->Add(hComPID[ipart]);
121
122 for(Int_t cutstep = 0; cutstep < kNCutSteps; cutstep++){
123 hTPCdEdx[ipart][cutstep] = new TH2F(Form("hTPCdEdx_%s_[%d]",samplename[ipart],cutstep),Form("TPC dE/dx for %s [%d]",samplename[ipart],cutstep),100,0.,10.,300,0.,300.);
124
125 fOutput->Add(hTPCdEdx[ipart][cutstep]);
126 }
127 }
128
129 for(Int_t iDecay = 0; iDecay < AliTRDv0Info::kNDecays; iDecay++){
130 for(Int_t cutstep =0; cutstep < kNCutSteps; cutstep++){
131 hV0Chi2ndf[iDecay][cutstep] = new TH2F(Form("hV0Chi2ndf_%s_[%d]",decayname[iDecay],cutstep),Form("Chi2/NDF vs. momentum"),100,0.,10.,500, 0., 500.);
132
133 fOutput->Add(hV0Chi2ndf[iDecay][cutstep]);
134
135 hPsiPair[iDecay][cutstep] = new TH2F(Form("hV0PsiPair_%s_[%d]",decayname[iDecay],cutstep),Form("Psi_pair vs. momentum"),100,0.,10.,200, 0., 1.6);
136
137 fOutput->Add(hPsiPair[iDecay][cutstep]);
138
139 hPointAngle[iDecay][cutstep] = new TH2F(Form("hPointAngle_%s_[%d]",decayname[iDecay],cutstep),Form("Pointing Angle vs. momentum"),100,0.,10.,500, 0., 1.6);
140 fOutput->Add(hPointAngle[iDecay][cutstep]);
141
142 hDCA[iDecay][cutstep] = new TH2F(Form("hDCA_%s_[%d]",decayname[iDecay],cutstep),Form("V0 Daughter DCA vs. momentum"),100,0.,10.,500, 0., 1.);
143
144 fOutput->Add(hDCA[iDecay][cutstep]);
145
146 hOpenAngle[iDecay][cutstep] = new TH2F(Form("hOpenAngle_%s_[%d]",decayname[iDecay],cutstep),Form("Opening Angle vs. momentum"),100,0.,10.,500, 0., 1.6);
147
148 fOutput->Add(hOpenAngle[iDecay][cutstep]);
149
150 hRadius[iDecay][cutstep] = new TH2F(Form("hRadius_%s_[%d]",decayname[iDecay],cutstep),Form("V0 Generation Radius vs. momentum"),100,0.,10.,500, 0., 150.);
151
152 fOutput->Add(hRadius[iDecay][cutstep]);
153
154
155
156
157 }
158
159 hInvMass[iDecay] = new TH2F(Form("hInvMass_%s",decayname[iDecay]),Form("Invariant Mass vs. momentum"),100,0.,10.,500, 0., 2.);
160
161 fOutput->Add(hInvMass[iDecay]);
162
163 }
164
165 /*TH1F *hV0mcPID[AliPID::kSPECIES][AliPID::kSPECIES];
166 Int_t nPBins = 200;
167
168
169
170 for(Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++){
171 for(Int_t iSample = 0; iSample < AliPID::kSPECIES; iSample++){
172
173 hV0mcPID[iSample][iSpecies] = new TH1F(Form("hV0mcPID_%s_is_%s",name[iSample],name[iSpecies]),Form("%s contained in %s sample",name[iSpecies],name[iSample]), nPBins, 0.2, 13.);
174 }
175 }*/
176}
177//________________________________________________________________________
178void AliTRDv0Monitor::UserExec(Option_t *)
179{
180 // Main loop
181 // Called for each event
182
183 if(!(fTracks = dynamic_cast<TObjArray*>(GetInputData(1)))) return;
184 if(!(fV0s = dynamic_cast<TObjArray*>(GetInputData(2)))) return;
185 if(!(fInfo = dynamic_cast<TObjArray*>(GetInputData(3)))) return;
186
187
188 AliTRDtrackInfo *track = NULL;
189 AliTRDv0Info *v0(NULL);
190
191
192
193 for(Int_t itrk=0; itrk<fTracks->GetEntriesFast(); itrk++){
194 track = (AliTRDtrackInfo*)fTracks->UncheckedAt(itrk);
195 for(Int_t iv(0); iv<fV0s->GetEntriesFast(); iv++){
196 if(!(v0 = (AliTRDv0Info*)fV0s->At(iv))) continue;
197 if(!v0->HasTrack(track)) continue;
198 ULong_t status = track->GetStatus();
199 if(!(status&AliESDtrack::kTRDpid)) continue;
200
201 hQualityReductions->Fill(v0->fQuality);//fills integer codes for tracks cut out by track/V0 quality cuts
202
203 if(!(v0->fQuality == 1))continue;
204
205 for(Int_t part = 0; part < AliPID::kSPECIES; part++){
206 hCutReductions[part]->Fill(v0->GetPID(part,track));//fill in numbers of tracks eliminated by different PID cuts
207 }
208
209
210 for(Int_t idecay(0), part(-1); idecay < AliTRDv0Info::kNDecays; idecay++){//loop over decay types considered for reference data
211
212 if(idecay == AliTRDv0Info::kLambda){ //protons and pions from Lambda
213 part = AliPID::kProton;
214 } else if(idecay == AliTRDv0Info::kAntiLambda) { //antiprotons and pions from Anti-Lambda
215 part = AliPID::kProton;
216 } else if(idecay == AliTRDv0Info::kK0s) {//pions from K0s
217 part = AliPID::kPion;
218 } else if(idecay == AliTRDv0Info::kGamma) {//electrons from conversions
219 part = AliPID::kElectron;
220 }
221
222 //fill histograms with track/V0 quality cuts only
223 hPsiPair[idecay][0]->Fill(v0->fV0Momentum,v0->fPsiPair);//Angle between daughter momentum plane and plane perpendicular to magnetic field
224 hInvMass[idecay]->Fill(v0->fV0Momentum,v0->fInvMass[idecay]);//Invariant mass
225 hPointAngle[idecay][0]->Fill(v0->fV0Momentum,v0->fPointingAngle);// = TMath::ACos(esdv0->GetV0CosineOfPointingAngle()); // Cosine of pointing angle
226 hOpenAngle[idecay][0]->Fill(v0->fV0Momentum,v0->fOpenAngle);// opening angle between daughters
227 hDCA[idecay][0]->Fill(v0->fV0Momentum,v0->fDCA);// Distance of closest approach of daughter tracks
228 hV0Chi2ndf[idecay][0]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);//Kalman Filter Chi2/NDF
229 hRadius[idecay][0]->Fill(v0->fV0Momentum,v0->fRadius);//distance of decay/conversion from primary vertex in x-y plane
230
231 if(v0->HasTrack(track) == -1){
232 hTPCdEdx[part][0]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);//TPC dE/dx for negative track
233 }
234 else if(v0->HasTrack(track) == 1){
235 hTPCdEdx[part][0]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);//TPC dE/dx for positive track
236 }
237 //fill histograms after invariant mass cuts
238 if((v0->fInvMass[idecay] < v0->fUpInvMass[idecay][0])&&(v0->fInvMass[idecay]> v0->fDownInvMass[idecay])){
239 hV0Chi2ndf[idecay][1]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);
240 hPsiPair[idecay][1]->Fill(v0->fV0Momentum,v0->fPsiPair);
241 hPointAngle[idecay][1]->Fill(v0->fV0Momentum,v0->fPointingAngle);
242 hOpenAngle[idecay][1]->Fill(v0->fV0Momentum,v0->fOpenAngle);
243 hDCA[idecay][1]->Fill(v0->fV0Momentum,v0->fDCA);
244 hRadius[idecay][1]->Fill(v0->fV0Momentum,v0->fRadius);
245 if(v0->HasTrack(track) == -1)
246 hTPCdEdx[part][1]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);
247 else if(v0->HasTrack(track) == 1)
248 hTPCdEdx[part][1]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);
249
250 }
251
252 //fill histograms after all reference selection cuts
253 if(v0->GetPID(part,track)==1){
254 hV0Chi2ndf[idecay][2]->Fill(v0->fV0Momentum,v0->fChi2ndf[idecay]);
255 hPsiPair[idecay][2]->Fill(v0->fV0Momentum,v0->fPsiPair);
256 hPointAngle[idecay][2]->Fill(v0->fV0Momentum,v0->fPointingAngle);
257 hOpenAngle[idecay][2]->Fill(v0->fV0Momentum,v0->fOpenAngle);
258 hDCA[idecay][2]->Fill(v0->fV0Momentum,v0->fDCA);
259 hRadius[idecay][2]->Fill(v0->fV0Momentum,v0->fRadius);
260 if(v0->HasTrack(track) == -1)
261 hTPCdEdx[part][2]->Fill(v0->fTrackN->P(),v0->fTPCdEdx[AliTRDv0Info::kNeg]);
262 else if(v0->HasTrack(track) == 1)
263 hTPCdEdx[part][2]->Fill(v0->fTrackP->P(),v0->fTPCdEdx[AliTRDv0Info::kPos]);
264
265 }
266 }
267 }
268 }
269 PostData(1, fOutput);
270}
271//_______________________________________________________________________
272
273/*Int_t AliTRDv0Monitor::GetPDG(Int_t index)
274{//yet to come
275
276
277
278}*/
279//_______________________________________________________________________
280