]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/hfe/AliHFEemcalPIDqa.cxx
Updates + addition of EMCal
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEemcalPIDqa.cxx
CommitLineData
c2690925 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-commercial 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// Class AliHFEemcalPIDqa
17//
18// Monitoring EMCAL PID in the HFE PID montioring framework. The following
19// quantities are monitored:
20// TPC Signal distribution
21// (Always as function of momentum, particle species and centrality
22// before and after cut)
23// More information about the PID monitoring framework can be found in
24// AliHFEpidQAmanager.cxx and AliHFEdetPIDqa.cxx
25//
26// Author:
27//
28// Shingo Sakai <ssakai@lbl.gov>
29#include <TClass.h>
30#include <TH2.h>
31#include <THnSparse.h>
32#include <TString.h>
33
34#include "AliLog.h"
35#include "AliPID.h"
36#include "AliVParticle.h"
37#include "AliVTrack.h"
38#include "AliESDtrack.h"
39#include "AliHFEcollection.h"
40#include "AliHFEpid.h"
41#include "AliHFEpidBase.h"
42#include "AliHFEpidQAmanager.h"
43#include "AliHFEpidTPC.h"
44#include "AliHFEpidEMCAL.h"
45#include "AliHFEtools.h"
46#include "AliHFEemcalPIDqa.h"
47
48ClassImp(AliHFEpidEMCAL)
49
50//_________________________________________________________
51AliHFEemcalPIDqa::AliHFEemcalPIDqa():
52 AliHFEdetPIDqa()
53 , fHistos(NULL)
54{
55 //
56 // Dummy constructor
57 //
58}
59
60//_________________________________________________________
61AliHFEemcalPIDqa::AliHFEemcalPIDqa(const char* name):
62 AliHFEdetPIDqa(name, "QA for EMCAL")
63 , fHistos(NULL)
64{
65 //
66 // Default constructor
67 //
68}
69
70//_________________________________________________________
71AliHFEemcalPIDqa::AliHFEemcalPIDqa(const AliHFEemcalPIDqa &o):
72 AliHFEdetPIDqa(o)
73 , fHistos()
74{
75 //
76 // Copy constructor
77 //
78 o.Copy(*this);
79}
80
81//_________________________________________________________
82AliHFEemcalPIDqa &AliHFEemcalPIDqa::operator=(const AliHFEemcalPIDqa &o){
83 //
84 // Do assignment
85 //
86 AliHFEdetPIDqa::operator=(o);
87 if(&o != this) o.Copy(*this);
88 return *this;
89}
90
91//_________________________________________________________
92AliHFEemcalPIDqa::~AliHFEemcalPIDqa(){
93 //
94 // Destructor
95 //
96 if(fHistos) delete fHistos;
97}
98
99//_________________________________________________________
100void AliHFEemcalPIDqa::Copy(TObject &o) const {
101 //
102 // Make copy
103 //
104 AliHFEemcalPIDqa &target = dynamic_cast<AliHFEemcalPIDqa &>(o);
105 if(target.fHistos){
106 delete target.fHistos;
107 target.fHistos = NULL;
108 }
109 if(fHistos) target.fHistos = new AliHFEcollection(*fHistos);
110}
111
112//_________________________________________________________
113Long64_t AliHFEemcalPIDqa::Merge(TCollection *coll){
114 //
115 // Merge with other objects
116 //
117 if(!coll) return 0;
118 if(coll->IsEmpty()) return 1;
119
120 TIter it(coll);
121 AliHFEemcalPIDqa *refQA = NULL;
122 TObject *o = NULL;
123 Long64_t count = 0;
124 TList listHistos;
125 while((o = it())){
126 refQA = dynamic_cast<AliHFEemcalPIDqa *>(o);
127 if(!refQA) continue;
128
129 listHistos.Add(refQA->fHistos);
130 count++;
131 }
132 fHistos->Merge(&listHistos);
133 return count + 1;
134}
135
136//_________________________________________________________
137void AliHFEemcalPIDqa::Initialize(){
138 //
139 // Define Histograms
140 //
141
142 fHistos = new AliHFEcollection("emcalqahistos", "Collection of EMCAL QA histograms");
143
144 // Make common binning
145 const Int_t kCentralityBins = 11;
146 const Double_t kMinP = 0.;
147 const Double_t kMaxP = 20.;
148 const Double_t kTPCSigMim = 40.;
149 const Double_t kTPCSigMax = 140.;
150
151 // 1st histogram: TPC dEdx with/without EMCAL (p, pT, TPC Signal, Centrality)
152 Int_t nBins[4] = {20, 20, 400, kCentralityBins};
153 Double_t min[4] = {kMinP, kMinP, kTPCSigMim, 0};
154 Double_t max[4] = {kMaxP, kMaxP, kTPCSigMax, 11.};
155 fHistos->CreateTHnSparse("EMCAL_TPCdedx", "EMCAL signal; species; p [GeV/c]; pT [GeV/c] ; TPC signal [a.u.]; Centrality", 4, nBins, min, max);
156
157}
158
159//_________________________________________________________
160void AliHFEemcalPIDqa::ProcessTrack(const AliHFEpidObject *track,AliHFEdetPIDqa::EStep_t /*step*/){
161 //
162 // Fill TPC histograms
163 //
164 //AliHFEpidObject::AnalysisType_t anatype = track->IsESDanalysis() ? AliHFEpidObject::kESDanalysis : AliHFEpidObject::kAODanalysis;
165 Float_t centrality = track->GetCentrality();
166
167 const AliVTrack *vtrack = dynamic_cast<const AliVTrack *>(track->GetRecTrack());
168 const AliESDtrack *esdtrack = dynamic_cast<const AliESDtrack *>(vtrack);
169
170 Double_t contentSignal[4];
171 contentSignal[0] = track->GetRecTrack()->P();
172 contentSignal[1] = track->GetRecTrack()->Pt();
173 contentSignal[2] = esdtrack->GetTPCsignal(); //?
174 contentSignal[3] = centrality;
175 //printf("ProcessTrack ; Print Content %g; %g; %g; %g \n",contentSignal[0],contentSignal[1],contentSignal[2],contentSignal[3]);
176 fHistos->Fill("EMCAL_TPCdedx", contentSignal);
177}
178
179//_________________________________________________________
180TH1 *AliHFEemcalPIDqa::GetHistogram(const char *name){
181 //
182 // Get the histogram
183 //
184 if(!fHistos) return NULL;
185 TObject *histo = fHistos->Get(name);
186 if(!histo->InheritsFrom("TH1")) return NULL;
187 return dynamic_cast<TH1 *>(histo);
188}
189