Fix coverity defect
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibTask.h
CommitLineData
6d3c5222 1#ifndef ALITRDCALIBTASK_H
2#define ALITRDCALIBTASK_H
3
4///////////////////////////////////////////////////////////////////////////////
5// //
6// TRD calibration task for offline calibration //
7// //
8///////////////////////////////////////////////////////////////////////////////
9
10
11class TList;
12class TObject;
13class TObjArray;
14class TH2F;
15class TH1F;
16class TH1I;
17class TProfile2D;
18class TH2I;
19class TTree;
20class AliESDEvent;
21class AliESDfriend;
22class AliESDtrack;
23class AliESDfriendTrack;
24class AliTRDtrackV1;
25class AliTRDCalibraFillHisto;
26class AliTRDcluster;
27class AliESDtrackCuts;
28class AliTRDCalDet;
29
30#include "TObjString.h"
01239968 31#include "AliAnalysisTaskSE.h"
98937691 32#include "TMath.h"
6d3c5222 33
01239968 34class AliTRDCalibTask : public AliAnalysisTaskSE {
6d3c5222 35 public:
36 AliTRDCalibTask(const char *name = "AliTRDCalibTask");
37 virtual ~AliTRDCalibTask();
38
01239968 39 // virtual void ConnectInputData(Option_t *);
40 virtual void UserCreateOutputObjects();
41 virtual void UserExec(Option_t *);
6d3c5222 42 virtual void Terminate(Option_t *);
43 virtual Bool_t Load(const Char_t *filename);
57185ead 44 virtual Bool_t Load(TList *lister);
6d3c5222 45 void Plot();
57185ead 46 virtual Long64_t Merge(TCollection *li);
47 void AddTask(const AliTRDCalibTask * calibTask);
48 TList *GetList() const {return fListHist;};
6d3c5222 49
50 void SetHisto2d(Bool_t histo2d) {fHisto2d=histo2d;};
51 void SetVector2d(Bool_t vector2d) {fVector2d=vector2d;};
52 void SetVdriftLinear(Bool_t vdriftLinear) {fVdriftLinear = vdriftLinear;};
53 void SetNbTimeBins(Int_t nbTimeBins) {fNbTimeBins=nbTimeBins;};
54
55 void SetNz(Short_t nz, Int_t i) {fNz[i]=nz;};
56 void SetNrphi(Short_t nrphi, Int_t i) {fNrphi[i]=nrphi;};
57
58 void AddSelectedTriggerClass(const char*name) {fSelectedTrigger->Add(new TObjString(name));};
59 void SetReject(Bool_t rejected) {fRejected = rejected;};
60
98937691 61 void SetESDtrackCuts(AliESDtrackCuts * const esdtrackCuts) {fEsdTrackCuts = esdtrackCuts;};
6d3c5222 62 void SetRequirePrimaryVertex(Bool_t requirePrimaryVertex) {fRequirePrimaryVertex = requirePrimaryVertex;};
63 void SetUseTPCVertex() {fVtxTPC=kTRUE ; fVtxSPD=kFALSE;}
64 void SetUseSPDVertex() {fVtxTPC=kFALSE; fVtxSPD=kTRUE ;}
65 void SetMinNbOfContributors(Int_t minNbOfContributors) {fMinNbContributors = minNbOfContributors;};
c1105918 66 void SetRangePrimaryVertexZ(Double_t rangePrimaryVertexZ) {fRangePrimaryVertexZ = TMath::Abs(rangePrimaryVertexZ);};
67 void SetMinNbTracks(Int_t minNbTracks) {fMinNbTracks = minNbTracks;};
68 void SetMaxNbTracks(Int_t maxNbTracks) {fMaxNbTracks = maxNbTracks;};
69
4c865c34 70 void SetVersionGainUsed(Int_t versionGainUsed) { fVersionGainUsed = versionGainUsed; }
71 void SetSubVersionGainUsed(Int_t subVersionGainUsed) { fSubVersionGainUsed = subVersionGainUsed; }
a2a4ec8e 72 void SetVersionGainLocalUsed(Int_t versionGainLocalUsed) { fVersionGainLocalUsed = versionGainLocalUsed; }
73 void SetSubVersionGainLocalUsed(Int_t subVersionGainLocalUsed) { fSubVersionGainLocalUsed = subVersionGainLocalUsed; }
4c865c34 74 void SetVersionVdriftUsed(Int_t versionVdriftUsed) { fVersionVdriftUsed = versionVdriftUsed; }
75 void SetSubVersionVdriftUsed(Int_t subVersionVdriftUsed) { fSubVersionVdriftUsed = subVersionVdriftUsed; }
6d3c5222 76
77 void SetLow(Int_t low) {fLow=low;};
78 void SetHigh(Int_t high) {fHigh=high;};
79 void SetFillZero(Bool_t fillZero) {fFillZero = fillZero;};
80 void SetNormalizeNbOfCluster(Bool_t normalizeNbOfCluster = kTRUE) {fNormalizeNbOfCluster = normalizeNbOfCluster;};
81 void SetMaxCluster(Float_t maxCluster) {fMaxCluster = maxCluster; };
82 void SetNbMaxCluster(Short_t nbMaxCluster) {fNbMaxCluster = nbMaxCluster; };
83 void SetOfflineTracks() {fOfflineTracks=kTRUE; fStandaloneTracks=kFALSE; };
84 void SetStandaloneTracks() {fStandaloneTracks=kTRUE; fOfflineTracks=kFALSE; };
4c865c34 85
86 void SetCalDetGain(AliTRDCalDet * const calDetGain) {fCalDetGain = calDetGain;};
6d3c5222 87
88 void SetMaxEvent(Int_t nbevents) { fMaxEvent = nbevents; };
89 void SetDebug(Int_t debug) { fDebug = debug; };
90
91 private:
a2a4ec8e 92 Bool_t SetVersionSubversion();
c1105918 93 Bool_t ParticleGood(int i) const;
a2a4ec8e 94
6d3c5222 95 AliESDEvent *fESD; //! ESD object
96 AliESDfriend *fESDfriend; //! ESD friend
97 const AliESDtrack *fkEsdTrack; //! ESD track
98 AliESDfriendTrack *fFriendTrack; //! ESD friend track
99 TObject *fCalibObject; //! calibration objects attached to the ESD friend
100 AliTRDtrackV1 *fTrdTrack; //! trdtrack
101 AliTRDcluster *fCl; //! cluster
102
103 TList *fListHist; //! list of histograms
104
105 AliTRDCalibraFillHisto *fTRDCalibraFillHisto; //! calibration analyse object
106
107 TH1I *fNEvents; //! counter
108
109 TH1F *fNbTRDTrack; //! nb ESD tracks with TRD clusters
110 TH1F *fNbTRDTrackOffline; //! nb ESD tracks with TRD clusters
111 TH1F *fNbTRDTrackStandalone; //! nb ESD tracks with TRD clusters
112 TH2F *fNbTPCTRDtrack; //! nb TPC and TRD tracks when problems
c1105918 113 TH2F *fNbGoodTracks; //! nb of good tracks
6d3c5222 114
115 TH1F *fNbTimeBin; //! nb Time Bin
116 TH1F *fNbTimeBinOffline; //! nb Time Bin offline
117 TH1F *fNbTimeBinStandalone; //! nb Time Bin standalone
118 TH1F *fNbClusters; //! nb Clusters
119 TH1F *fNbClustersOffline; //! nb Clusters offline
120 TH1F *fNbClustersStandalone; //! nb Clusters standalone
121 TH1F *fNbTracklets; //! nb Tracklets
122 TH1F *fNbTrackletsOffline; //! nb Tracklets offline
123 TH1F *fNbTrackletsStandalone; //! nb Tracklets standalone
124
98937691 125 TH2F *fAbsoluteGain; //! Absolute Gain without AliESDfriend
6d3c5222 126 TH2I *fCH2dSum; //! CH2d charge all
127 TProfile2D *fPH2dSum; //! PH2d PH all
128 TH2I *fCH2dSM; //! CH2d per SM
129 TProfile2D *fPH2dSM; //! PH2d per SM
130
98937691 131 Bool_t fHisto2d; // histo
132 Bool_t fVector2d; // vector
133 Bool_t fVdriftLinear; // vdrift Linear
6d3c5222 134
98937691 135 Int_t fNbTimeBins; // number of timebins
6d3c5222 136
137 Short_t fNz[3]; // Nz mode
138 Short_t fNrphi[3]; // Nrphi mode
139
140 TObjArray *fSelectedTrigger; // Trigger class names accepted/rejected
141 Bool_t fRejected; // Reject the selected trigger class
142
143 AliESDtrackCuts *fEsdTrackCuts; // Quality cut on the AliESDtrack
144 Bool_t fRequirePrimaryVertex; // Primary Vertex
145 Bool_t fVtxTPC; // Flag for use of TPC vertex
146 Bool_t fVtxSPD; // Flag for use of SPD vertex
147 Int_t fMinNbContributors; // Min number of contributors
98937691 148 Double_t fRangePrimaryVertexZ; // Were the primary vertex is
c1105918 149 Int_t fMinNbTracks; // Min Nb Tracks
150 Int_t fMaxNbTracks; // Max Nb Tracks
6d3c5222 151
152 Int_t fLow; // lower limit of nb of TRD clusters per tracklet
153 Int_t fHigh; // higher limit of nb of TRD clusters per tracklet
154 Bool_t fFillZero; // fill zero
155 Bool_t fNormalizeNbOfCluster; // normalize with number of clusters (per default not)
156 Float_t fRelativeScale; // relative scale for gas gain
157 Float_t fMaxCluster; // Maxcluster
158 Short_t fNbMaxCluster; // Number of tb at the end
159 Bool_t fOfflineTracks; // Only Offline refitted tracks
160 Bool_t fStandaloneTracks; // Take only standalone tracks
161
4c865c34 162 Int_t fVersionGainUsed; // VersionGainUsed
163 Int_t fSubVersionGainUsed; // SubVersionGainUsed
a2a4ec8e 164 Int_t fVersionGainLocalUsed; // VersionGainLocalUsed
165 Int_t fSubVersionGainLocalUsed; // SubVersionGainLocalUsed
4c865c34 166 Int_t fVersionVdriftUsed; // VersionVdriftUsed
167 Int_t fSubVersionVdriftUsed; // SubVersionVdriftUsed
168
6d3c5222 169 AliTRDCalDet *fCalDetGain; // Calib object gain
170
171 Int_t fMaxEvent; // max events
172 Int_t fCounter; // max events
98937691 173 Int_t fDebug; // fDebug
6d3c5222 174
175 AliTRDCalibTask(const AliTRDCalibTask&);
176 AliTRDCalibTask& operator=(const AliTRDCalibTask&);
177
178 ClassDef(AliTRDCalibTask, 1);
179};
180
21185a48 181#endif
01239968 182
c1105918 183