1 #ifndef ALITRDTENDERSUPPLY_H
2 #define ALITRDTENDERSUPPLY_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 ////////////////////////////////////////////////////////////////////////
9 // TRD tender, reapply pid on the fly //
11 ////////////////////////////////////////////////////////////////////////
15 #include <AliTenderSupply.h>
17 class AliTRDpidRecalculator;
20 class AliOADBContainer;
22 class AliTRDTenderSupply: public AliTenderSupply {
31 AliTRDTenderSupply(const char *name, const AliTender *tender=NULL);
32 virtual ~AliTRDTenderSupply();
34 void SetRunByRunCorrection(const char *filename) { fNameRunByRunCorrection = filename; }
35 void SetLoadReferencesFromCDB() { fLoadReferences = kTRUE; fLoadReferencesFromCDB = kTRUE; }
36 void SetLoadReferencesFromFile() { fLoadReferences = kTRUE; fLoadReferencesFromCDB = kFALSE; }
37 void SetLoadDeadChambersFromCDB(){ fLoadDeadChambers = kTRUE;} ;
38 void SetPIDmethod(Int_t pidMethod) { fPIDmethod = pidMethod; }
39 void SetNormalizationFactor(Double_t norm) { fNormalizationFactor = norm; }
40 void SetCalibLowpThreshold(Double_t pmin) { fPthreshold = pmin; };
41 void SetGeoFile(const char *filename) { fGeoFile = filename; }
42 void SetDebugMode() { fDebugMode = kTRUE; }
45 virtual void ProcessEvent();
47 void SwitchOnGainCorrection() { fGainCorrection = kTRUE; }
48 void SwitchOffGainCorrection() { fGainCorrection = kFALSE; }
49 void SetSlicesForPID(UInt_t min, UInt_t max) { fSlicesForPID[0] = min; fSlicesForPID[1] = max;}
50 void AddBadChamber(Int_t chamberID){fBadChamberID[fNBadChambers++] = chamberID;};
59 Bool_t GetTRDchamberID(AliESDtrack * const track, Int_t *detectors);
60 void SetChamberGain();
61 void ApplyGainCorrection(AliESDtrack *track, const Int_t * const detectors);
62 void ApplyRunByRunCorrection(AliESDtrack *const track);
63 void MaskChambers(AliESDtrack * const track, const Int_t * const detectors);
64 void LoadReferences();
65 void LoadDeadChambersFromCDB();
66 void LoadRunByRunCorrection(const char *filename);
67 Bool_t IsBadChamber(Int_t chamberID);
69 AliESDEvent *fESD; //! the ESD Event
70 AliESDpid *fESDpid; //! ESD PID object
72 AliTRDCalDet *fChamberGainOld; // TRD Chamber Gain Factor used for producing the ESD
73 AliTRDCalDet *fChamberGainNew; // New TRD Chamber Gain Factor
74 AliTRDCalDet *fChamberVdriftOld; // Old drift velocity calibration
75 AliTRDCalDet *fChamberVdriftNew; // New drift velocity calibration
76 AliOADBContainer *fRunByRunCorrection; // Run by run gain correction
78 Int_t fPIDmethod; // PID method
79 Double_t fNormalizationFactor; // dE/dx Normalization Factor
80 Double_t fPthreshold; // Low Momentum threshold for calibration
81 Int_t fBadChamberID[kNChambers]; // List of Bad Chambers
82 UInt_t fSlicesForPID[2]; // Select range of slices used in the PID response
83 UInt_t fNBadChambers; // Number of bad chambers
84 const char *fGeoFile; // File with geometry.root
85 Bool_t fGainCorrection; // Apply gain correction
86 Bool_t fLoadReferences; // Tender Load references
87 Bool_t fLoadReferencesFromCDB; // Load References from CDB
88 Bool_t fLoadDeadChambers; // Load dead chambers
89 Bool_t fHasReferences; // has references loaded
90 Bool_t fHasNewCalibration; // has new calibration
91 Bool_t fDebugMode; // Run in debug mode
92 TString fNameRunByRunCorrection; // filename with the run-by-run gain correction
94 AliTRDTenderSupply(const AliTRDTenderSupply&c);
95 AliTRDTenderSupply& operator= (const AliTRDTenderSupply&c);
97 ClassDef(AliTRDTenderSupply, 1); // TRD tender task