]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/TenderSupplies/AliTRDTenderSupply.h
o automatic detection of 11a pass4 (Alla)
[u/mrichter/AliRoot.git] / ANALYSIS / TenderSupplies / AliTRDTenderSupply.h
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
17 class AliTRDpidRecalculator;
18 class AliTRDCalDet;
19 class AliESDEvent;
20 class AliOADBContainer;
21
22 class AliTRDTenderSupply: public AliTenderSupply {
23   
24 public:
25   enum{
26     kNNpid = 0,
27     k1DLQpid = 1,
28     k2DLQpid = 2
29   };
30   AliTRDTenderSupply();
31   AliTRDTenderSupply(const char *name, const AliTender *tender=NULL);
32   virtual ~AliTRDTenderSupply();
33
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; }
43
44   virtual void              Init();
45   virtual void              ProcessEvent();
46   
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;};
51   
52 private:
53   enum{
54     kNPlanes = 6,
55     kNStacks = 5,
56     kNChambers = 540
57   };
58
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);
68   
69   AliESDEvent           *fESD;       //! the ESD Event
70   AliESDpid             *fESDpid;    //! ESD PID object
71
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
77
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
93   
94   AliTRDTenderSupply(const AliTRDTenderSupply&c);
95   AliTRDTenderSupply& operator= (const AliTRDTenderSupply&c);
96   
97   ClassDef(AliTRDTenderSupply, 1);  // TRD tender task
98 };
99 #endif
100