]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TENDER/TenderSupplies/AliTRDTenderSupply.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / TENDER / 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 AliTRDCalDet;
18 class AliESDEvent;
19 class AliOADBContainer;
20 class AliTRDonlineTrackMatching;
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, Int_t runMin, Int_t runMax);
40   void SetNormalizationFactor(Double_t norm) { fNormalizationFactor = norm; }
41   void SetCalibLowpThreshold(Double_t pmin) { fPthreshold = pmin; };
42   void SetGeoFile(const char *filename) { fGeoFile = filename; }
43   void SetDebugMode() { fDebugMode = kTRUE; }
44   void SetRedoTRDMatching(Bool_t redo = kTRUE) {fRedoTrdMatching = redo;}
45
46   virtual void              Init();
47   virtual void              ProcessEvent();
48   
49   void SwitchOnGainCorrection() { fGainCorrection = kTRUE; }
50   void SwitchOffGainCorrection() { fGainCorrection = kFALSE; }
51   void SetSlicesForPID(UInt_t min, UInt_t max) { fSlicesForPID[0] = min; fSlicesForPID[1] = max;}
52   void AddBadChamber(Int_t chamberID){fBadChamberID[fNBadChambers++] = chamberID;};
53   
54 private:
55   enum{
56     kNPlanes = 6,
57     kNStacks = 5,
58     kNChambers = 540
59   };
60
61   Bool_t GetTRDchamberID(AliESDtrack * const track, Int_t *detectors);
62   void SetChamberGain();
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); 
66   void LoadReferences();
67   void LoadDeadChambersFromCDB();
68   void LoadRunByRunCorrection(const char *filename);
69   Bool_t IsBadChamber(Int_t chamberID);
70   Double_t GetNormalizationFactor(Int_t runnumber);
71   
72   AliESDEvent           *fESD;       //! the ESD Event
73   AliESDpid             *fESDpid;    //! ESD PID object
74   AliTRDonlineTrackMatching  *fTrdOnlineTrackMatcher;   //! TRD online track matcher
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
80   AliOADBContainer *fRunByRunCorrection;    // Run by run gain correction
81
82   Int_t fPIDmethod;                  // PID method
83   Double_t fNormalizationFactor;     // dE/dx Normalization Factor 
84   Double_t fPthreshold;              // Low Momentum threshold for calibration
85   Int_t fBadChamberID[kNChambers];   // List of Bad Chambers
86   UInt_t fSlicesForPID[2];           // Select range of slices used in the PID response
87   UInt_t fNBadChambers;              // Number of bad chambers
88   const char *fGeoFile;              // File with geometry.root
89   Bool_t fGainCorrection;            // Apply gain correction 
90 //  Bool_t fLoadReferences;            // Tender Load references
91 //  Bool_t fLoadReferencesFromCDB;     // Load References from CDB
92   Bool_t fLoadDeadChambers;          // Load dead chambers
93   Bool_t fHasReferences;             // has references loaded
94   Bool_t fHasNewCalibration;         // has new calibration
95   Bool_t fDebugMode;                 // Run in debug mode
96   Bool_t fRedoTrdMatching;           // Redo Track Matching
97   TString fNameRunByRunCorrection;   // filename with the run-by-run gain correction
98   TObjArray *fNormalizationFactorArray; // Array with normalisation Factors
99   
100   AliTRDTenderSupply(const AliTRDTenderSupply&c);
101   AliTRDTenderSupply& operator= (const AliTRDTenderSupply&c);
102   
103   ClassDef(AliTRDTenderSupply, 1);  // TRD tender task
104 };
105 #endif
106