end-of-line normalization
[u/mrichter/AliRoot.git] / ANALYSIS / TenderSupplies / AliTRDTenderSupply.h
CommitLineData
e75408ba 1#ifndef ALITRDTENDERSUPPLY_H
2#define ALITRDTENDERSUPPLY_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7////////////////////////////////////////////////////////////////////////
8// //
9// TRD tender, reapply pid on the fly //
10// //
11////////////////////////////////////////////////////////////////////////
12
13
14
15#include <AliTenderSupply.h>
16
00685073 17class AliTRDCalDet;
8d458e7c 18class AliESDEvent;
11fd38f5 19class AliOADBContainer;
c508f6bd 20class AliTRDonlineTrackMatching;
00685073 21
e75408ba 22class AliTRDTenderSupply: public AliTenderSupply {
23
24public:
00685073 25 enum{
26 kNNpid = 0,
27 k1DLQpid = 1,
28 k2DLQpid = 2
29 };
e75408ba 30 AliTRDTenderSupply();
31 AliTRDTenderSupply(const char *name, const AliTender *tender=NULL);
32 virtual ~AliTRDTenderSupply();
33
11fd38f5 34 void SetRunByRunCorrection(const char *filename) { fNameRunByRunCorrection = filename; }
d07644de 35// void SetLoadReferencesFromCDB() { fLoadReferences = kTRUE; fLoadReferencesFromCDB = kTRUE; }
36// void SetLoadReferencesFromFile() { fLoadReferences = kTRUE; fLoadReferencesFromCDB = kFALSE; }
11fd38f5 37 void SetLoadDeadChambersFromCDB(){ fLoadDeadChambers = kTRUE;} ;
e75408ba 38 void SetPIDmethod(Int_t pidMethod) { fPIDmethod = pidMethod; }
c508f6bd 39 void SetNormalizationFactor(Double_t norm, Int_t runMin, Int_t runMax);
51a0ce25 40 void SetNormalizationFactor(Double_t norm) { fNormalizationFactor = norm; }
00685073 41 void SetCalibLowpThreshold(Double_t pmin) { fPthreshold = pmin; };
11fd38f5 42 void SetGeoFile(const char *filename) { fGeoFile = filename; }
43 void SetDebugMode() { fDebugMode = kTRUE; }
c508f6bd 44 void SetRedoTRDMatching(Bool_t redo = kTRUE) {fRedoTrdMatching = redo;}
11fd38f5 45
e75408ba 46 virtual void Init();
47 virtual void ProcessEvent();
48
00685073 49 void SwitchOnGainCorrection() { fGainCorrection = kTRUE; }
50 void SwitchOffGainCorrection() { fGainCorrection = kFALSE; }
11fd38f5 51 void SetSlicesForPID(UInt_t min, UInt_t max) { fSlicesForPID[0] = min; fSlicesForPID[1] = max;}
00685073 52 void AddBadChamber(Int_t chamberID){fBadChamberID[fNBadChambers++] = chamberID;};
e75408ba 53
54private:
55 enum{
00685073 56 kNPlanes = 6,
57 kNStacks = 5,
58 kNChambers = 540
e75408ba 59 };
00685073 60
61 Bool_t GetTRDchamberID(AliESDtrack * const track, Int_t *detectors);
62 void SetChamberGain();
11fd38f5 63 void ApplyGainCorrection(AliESDtrack *track, const Int_t * const detectors);
64 void ApplyRunByRunCorrection(AliESDtrack *const track);
65 void MaskChambers(AliESDtrack * const track, const Int_t * const detectors);
51a0ce25 66 void LoadReferences();
11fd38f5 67 void LoadDeadChambersFromCDB();
68 void LoadRunByRunCorrection(const char *filename);
69 Bool_t IsBadChamber(Int_t chamberID);
c508f6bd 70 Double_t GetNormalizationFactor(Int_t runnumber);
00685073 71
72 AliESDEvent *fESD; //! the ESD Event
73 AliESDpid *fESDpid; //! ESD PID object
c508f6bd 74 AliTRDonlineTrackMatching *fTrdOnlineTrackMatcher; //! TRD online track matcher
00685073 75
76 AliTRDCalDet *fChamberGainOld; // TRD Chamber Gain Factor used for producing the ESD
77 AliTRDCalDet *fChamberGainNew; // New TRD Chamber Gain Factor
78 AliTRDCalDet *fChamberVdriftOld; // Old drift velocity calibration
79 AliTRDCalDet *fChamberVdriftNew; // New drift velocity calibration
11fd38f5 80 AliOADBContainer *fRunByRunCorrection; // Run by run gain correction
e75408ba 81
82 Int_t fPIDmethod; // PID method
51a0ce25 83 Double_t fNormalizationFactor; // dE/dx Normalization Factor
00685073 84 Double_t fPthreshold; // Low Momentum threshold for calibration
85 Int_t fBadChamberID[kNChambers]; // List of Bad Chambers
11fd38f5 86 UInt_t fSlicesForPID[2]; // Select range of slices used in the PID response
00685073 87 UInt_t fNBadChambers; // Number of bad chambers
11fd38f5 88 const char *fGeoFile; // File with geometry.root
00685073 89 Bool_t fGainCorrection; // Apply gain correction
d07644de 90// Bool_t fLoadReferences; // Tender Load references
91// Bool_t fLoadReferencesFromCDB; // Load References from CDB
11fd38f5 92 Bool_t fLoadDeadChambers; // Load dead chambers
51a0ce25 93 Bool_t fHasReferences; // has references loaded
11fd38f5 94 Bool_t fHasNewCalibration; // has new calibration
95 Bool_t fDebugMode; // Run in debug mode
c508f6bd 96 Bool_t fRedoTrdMatching; // Redo Track Matching
11fd38f5 97 TString fNameRunByRunCorrection; // filename with the run-by-run gain correction
7fac8669 98 TObjArray *fNormalizationFactorArray; // Array with normalisation Factors
e75408ba 99
100 AliTRDTenderSupply(const AliTRDTenderSupply&c);
101 AliTRDTenderSupply& operator= (const AliTRDTenderSupply&c);
102
103 ClassDef(AliTRDTenderSupply, 1); // TRD tender task
104};
e75408ba 105#endif
106