next50 trigger mask in AliHLTGlobalEsdConverterComponent
[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;
54f2ff1c 17class TH2S;
6d3c5222 18class TProfile2D;
19class TH2I;
20class TTree;
21class AliESDEvent;
22class AliESDfriend;
23class AliESDtrack;
24class AliESDfriendTrack;
25class AliTRDtrackV1;
54f2ff1c 26class AliTRDseedV1;
6d3c5222 27class AliTRDCalibraFillHisto;
28class AliTRDcluster;
29class AliESDtrackCuts;
30class AliTRDCalDet;
b2277aa2 31class AliTRDCalibChamberStatus;
6d3c5222 32
33#include "TObjString.h"
01239968 34#include "AliAnalysisTaskSE.h"
98937691 35#include "TMath.h"
6d3c5222 36
01239968 37class AliTRDCalibTask : public AliAnalysisTaskSE {
6d3c5222 38 public:
39 AliTRDCalibTask(const char *name = "AliTRDCalibTask");
40 virtual ~AliTRDCalibTask();
41
01239968 42 // virtual void ConnectInputData(Option_t *);
43 virtual void UserCreateOutputObjects();
44 virtual void UserExec(Option_t *);
6d3c5222 45 virtual void Terminate(Option_t *);
46 virtual Bool_t Load(const Char_t *filename);
57185ead 47 virtual Bool_t Load(TList *lister);
57185ead 48 virtual Long64_t Merge(TCollection *li);
49 void AddTask(const AliTRDCalibTask * calibTask);
54f2ff1c 50 Bool_t FindP1TrackPHtrackletV1Test(const AliTRDseedV1 *tracklet, Int_t nbclusters);
57185ead 51 TList *GetList() const {return fListHist;};
6d3c5222 52
54f2ff1c 53 void SetOnInstance(Bool_t onInstance) {fOnInstance=onInstance;};
6d3c5222 54 void SetHisto2d(Bool_t histo2d) {fHisto2d=histo2d;};
55 void SetVector2d(Bool_t vector2d) {fVector2d=vector2d;};
56 void SetVdriftLinear(Bool_t vdriftLinear) {fVdriftLinear = vdriftLinear;};
a0bb5615 57 void SetExbAlt(Bool_t exbalt) {fExbAlt = exbalt;};
6d3c5222 58 void SetNbTimeBins(Int_t nbTimeBins) {fNbTimeBins=nbTimeBins;};
5f689709 59 void SetNumberBinCharge(Short_t nbBinCharge) {fNumberBinCharge=nbBinCharge;};
4f3bd513 60 void SetRangeCharge(Float_t rangeCharge) {fRangeCharge=rangeCharge;};
61 void SetVdBindx(Short_t vdBindx) {fVdBindx=vdBindx;};
62 void SetVdBindy(Short_t vdBindy) {fVdBindy=vdBindy;};
63 void SetVdRangedx(Double_t vdRangex) {fVdRangex=vdRangex;};
64 void SetVdRangedy(Double_t vdRangey) {fVdRangey=vdRangey;};
5f689709 65 void SetDebugLevelTRDCalibraFillHisto(Short_t debugLevelTRDCalibraFillHisto) {fDebugLevelTRDCalibraFillHisto = debugLevelTRDCalibraFillHisto;};
66
6d3c5222 67
68 void SetNz(Short_t nz, Int_t i) {fNz[i]=nz;};
69 void SetNrphi(Short_t nrphi, Int_t i) {fNrphi[i]=nrphi;};
70
5f689709 71 void SetSelectTrigger(Bool_t selectTrigger) {fSelectTrigger = selectTrigger;};
6d3c5222 72 void AddSelectedTriggerClass(const char*name) {fSelectedTrigger->Add(new TObjString(name));};
73 void SetReject(Bool_t rejected) {fRejected = rejected;};
74
98937691 75 void SetESDtrackCuts(AliESDtrackCuts * const esdtrackCuts) {fEsdTrackCuts = esdtrackCuts;};
6d3c5222 76 void SetRequirePrimaryVertex(Bool_t requirePrimaryVertex) {fRequirePrimaryVertex = requirePrimaryVertex;};
77 void SetUseTPCVertex() {fVtxTPC=kTRUE ; fVtxSPD=kFALSE;}
78 void SetUseSPDVertex() {fVtxTPC=kFALSE; fVtxSPD=kTRUE ;}
79 void SetMinNbOfContributors(Int_t minNbOfContributors) {fMinNbContributors = minNbOfContributors;};
c1105918 80 void SetRangePrimaryVertexZ(Double_t rangePrimaryVertexZ) {fRangePrimaryVertexZ = TMath::Abs(rangePrimaryVertexZ);};
d02c70b8 81 void SetRejectPileUpWithSPD(Bool_t rejectPileUpWithSPD) {fRejectPileUpWithSPD = rejectPileUpWithSPD;};
c1105918 82 void SetMinNbTracks(Int_t minNbTracks) {fMinNbTracks = minNbTracks;};
83 void SetMaxNbTracks(Int_t maxNbTracks) {fMaxNbTracks = maxNbTracks;};
5f689709 84 void SetCutWithVdriftCalib(Bool_t cutWithVdriftCalib) {fCutWithVdriftCalib = cutWithVdriftCalib;};
85 void SetMinNbTRDtracklets(Int_t minNbTRDtracklets) {fMinNbTRDtracklets = minNbTRDtracklets;};
86 void SetMinTRDMometum(Double_t minTRDMomentum) {fMinTRDMomentum = minTRDMomentum;};
532be2d4 87 void SetScaleGainWithTPCSignal(Bool_t scaleGainWithTPCSignal) {fScaleGainWithTPCSignal = scaleGainWithTPCSignal;};
88
4c865c34 89 void SetVersionGainUsed(Int_t versionGainUsed) { fVersionGainUsed = versionGainUsed; }
90 void SetSubVersionGainUsed(Int_t subVersionGainUsed) { fSubVersionGainUsed = subVersionGainUsed; }
a2a4ec8e 91 void SetVersionGainLocalUsed(Int_t versionGainLocalUsed) { fVersionGainLocalUsed = versionGainLocalUsed; }
92 void SetSubVersionGainLocalUsed(Int_t subVersionGainLocalUsed) { fSubVersionGainLocalUsed = subVersionGainLocalUsed; }
4c865c34 93 void SetVersionVdriftUsed(Int_t versionVdriftUsed) { fVersionVdriftUsed = versionVdriftUsed; }
94 void SetSubVersionVdriftUsed(Int_t subVersionVdriftUsed) { fSubVersionVdriftUsed = subVersionVdriftUsed; }
6d3c5222 95
96 void SetLow(Int_t low) {fLow=low;};
97 void SetHigh(Int_t high) {fHigh=high;};
98 void SetFillZero(Bool_t fillZero) {fFillZero = fillZero;};
99 void SetNormalizeNbOfCluster(Bool_t normalizeNbOfCluster = kTRUE) {fNormalizeNbOfCluster = normalizeNbOfCluster;};
100 void SetMaxCluster(Float_t maxCluster) {fMaxCluster = maxCluster; };
101 void SetNbMaxCluster(Short_t nbMaxCluster) {fNbMaxCluster = nbMaxCluster; };
102 void SetOfflineTracks() {fOfflineTracks=kTRUE; fStandaloneTracks=kFALSE; };
103 void SetStandaloneTracks() {fStandaloneTracks=kTRUE; fOfflineTracks=kFALSE; };
4c865c34 104
105 void SetCalDetGain(AliTRDCalDet * const calDetGain) {fCalDetGain = calDetGain;};
6d3c5222 106
107 void SetMaxEvent(Int_t nbevents) { fMaxEvent = nbevents; };
108 void SetDebug(Int_t debug) { fDebug = debug; };
109
9a8b0e85 110 Bool_t IsPHQon() const {return fPHQon;}
111 void SetPHQon(const Bool_t kphq){ fPHQon = kphq; }
112
6d3c5222 113 private:
a2a4ec8e 114 Bool_t SetVersionSubversion();
c1105918 115 Bool_t ParticleGood(int i) const;
a2a4ec8e 116
6d3c5222 117 AliESDEvent *fESD; //! ESD object
6d3c5222 118 const AliESDtrack *fkEsdTrack; //! ESD track
119 AliESDfriendTrack *fFriendTrack; //! ESD friend track
120 TObject *fCalibObject; //! calibration objects attached to the ESD friend
121 AliTRDtrackV1 *fTrdTrack; //! trdtrack
122 AliTRDcluster *fCl; //! cluster
123
124 TList *fListHist; //! list of histograms
125
126 AliTRDCalibraFillHisto *fTRDCalibraFillHisto; //! calibration analyse object
b2277aa2 127 AliTRDCalibChamberStatus *fTRDChamberStatus; //! calibration chamber status
6d3c5222 128
129 TH1I *fNEvents; //! counter
a5dcf618 130 TH1I *fNEventsInput; //! counter
6d3c5222 131
132 TH1F *fNbTRDTrack; //! nb ESD tracks with TRD clusters
133 TH1F *fNbTRDTrackOffline; //! nb ESD tracks with TRD clusters
134 TH1F *fNbTRDTrackStandalone; //! nb ESD tracks with TRD clusters
135 TH2F *fNbTPCTRDtrack; //! nb TPC and TRD tracks when problems
c1105918 136 TH2F *fNbGoodTracks; //! nb of good tracks
6d3c5222 137
138 TH1F *fNbTimeBin; //! nb Time Bin
139 TH1F *fNbTimeBinOffline; //! nb Time Bin offline
140 TH1F *fNbTimeBinStandalone; //! nb Time Bin standalone
141 TH1F *fNbClusters; //! nb Clusters
142 TH1F *fNbClustersOffline; //! nb Clusters offline
143 TH1F *fNbClustersStandalone; //! nb Clusters standalone
144 TH1F *fNbTracklets; //! nb Tracklets
145 TH1F *fNbTrackletsOffline; //! nb Tracklets offline
146 TH1F *fNbTrackletsStandalone; //! nb Tracklets standalone
147
98937691 148 TH2F *fAbsoluteGain; //! Absolute Gain without AliESDfriend
6d3c5222 149 TH2I *fCH2dSum; //! CH2d charge all
150 TProfile2D *fPH2dSum; //! PH2d PH all
151 TH2I *fCH2dSM; //! CH2d per SM
152 TProfile2D *fPH2dSM; //! PH2d per SM
54f2ff1c 153 TH2I *fCH2dTest; //! CH2d for test
154 TProfile2D *fPH2dTest; //! PH2d for test
155 TH2S *fLinearVdriftTest; //! VdriftLinear for test
6d3c5222 156
54f2ff1c 157 Bool_t fOnInstance; // On Instance
98937691 158 Bool_t fHisto2d; // histo
159 Bool_t fVector2d; // vector
160 Bool_t fVdriftLinear; // vdrift Linear
a0bb5615 161 Bool_t fExbAlt; // alternative exb calculation
6d3c5222 162
5f689709 163 Short_t fDebugLevelTRDCalibraFillHisto; // Debug Level Fill Histo
98937691 164 Int_t fNbTimeBins; // number of timebins
5f689709 165 Short_t fNumberBinCharge; // Number of bins for the gain factor
4f3bd513 166 Float_t fRangeCharge; // Range Charge
167 Short_t fVdBindx; // Nb of bin in vd histos x
168 Short_t fVdBindy; // Nb of bin in vd histos y
169 Double_t fVdRangex; // Range vd histos x
170 Double_t fVdRangey; // Range vd histos y
6d3c5222 171
172 Short_t fNz[3]; // Nz mode
173 Short_t fNrphi[3]; // Nrphi mode
174
5f689709 175 Bool_t fSelectTrigger; // Select trigger
6d3c5222 176 TObjArray *fSelectedTrigger; // Trigger class names accepted/rejected
177 Bool_t fRejected; // Reject the selected trigger class
178
179 AliESDtrackCuts *fEsdTrackCuts; // Quality cut on the AliESDtrack
180 Bool_t fRequirePrimaryVertex; // Primary Vertex
181 Bool_t fVtxTPC; // Flag for use of TPC vertex
182 Bool_t fVtxSPD; // Flag for use of SPD vertex
183 Int_t fMinNbContributors; // Min number of contributors
98937691 184 Double_t fRangePrimaryVertexZ; // Were the primary vertex is
d02c70b8 185 Bool_t fRejectPileUpWithSPD; // Reject pile-up events with SPD
c1105918 186 Int_t fMinNbTracks; // Min Nb Tracks
187 Int_t fMaxNbTracks; // Max Nb Tracks
5f689709 188 Bool_t fCutWithVdriftCalib; // CutWithVdriftCalib for the gain and PH
189 Int_t fMinNbTRDtracklets; // Min number of TRD tracklets
190 Float_t fMinTRDMomentum; // Min TRD momentum
532be2d4 191 Bool_t fScaleGainWithTPCSignal; // Scale the TPC gain with the TPC signal
5f689709 192
6d3c5222 193 Int_t fLow; // lower limit of nb of TRD clusters per tracklet
194 Int_t fHigh; // higher limit of nb of TRD clusters per tracklet
195 Bool_t fFillZero; // fill zero
196 Bool_t fNormalizeNbOfCluster; // normalize with number of clusters (per default not)
197 Float_t fRelativeScale; // relative scale for gas gain
198 Float_t fMaxCluster; // Maxcluster
199 Short_t fNbMaxCluster; // Number of tb at the end
200 Bool_t fOfflineTracks; // Only Offline refitted tracks
201 Bool_t fStandaloneTracks; // Take only standalone tracks
202
d085ba91 203 Int_t fFirstRunGain; // FirstRunGainUsed
4c865c34 204 Int_t fVersionGainUsed; // VersionGainUsed
205 Int_t fSubVersionGainUsed; // SubVersionGainUsed
d085ba91 206 Int_t fFirstRunGainLocal; // FirstRunGainLocalUsed
a2a4ec8e 207 Int_t fVersionGainLocalUsed; // VersionGainLocalUsed
208 Int_t fSubVersionGainLocalUsed; // SubVersionGainLocalUsed
d085ba91 209 Int_t fFirstRunVdrift; // FirstRunVdriftUsed
4c865c34 210 Int_t fVersionVdriftUsed; // VersionVdriftUsed
211 Int_t fSubVersionVdriftUsed; // SubVersionVdriftUsed
b2277aa2 212 Int_t fFirstRunExB; // FirstRunExBUsed
213 Int_t fVersionExBUsed; // VersionExBUsed
214 Int_t fSubVersionExBUsed; // SubVersionExBUsed
4c865c34 215
6d3c5222 216 AliTRDCalDet *fCalDetGain; // Calib object gain
217
218 Int_t fMaxEvent; // max events
219 Int_t fCounter; // max events
6d3c5222 220
9a8b0e85 221 Bool_t fPHQon; //switch of phq
222
6d3c5222 223 AliTRDCalibTask(const AliTRDCalibTask&);
224 AliTRDCalibTask& operator=(const AliTRDCalibTask&);
225
d02c70b8 226 ClassDef(AliTRDCalibTask, 5);
6d3c5222 227};
228
21185a48 229#endif
01239968 230
c1105918 231