]> git.uio.no Git - u/mrichter/AliRoot.git/blob - START/AliSTARTParameters.h
new digitization and reconstruction corresponded to new data format
[u/mrichter/AliRoot.git] / START / AliSTARTParameters.h
1 #ifndef ALISTARTPARAMETERS_H
2 #define ALISTARTPARAMETERS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4  * reserved. 
5  *
6  * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
7  *
8  * See cxx source for full Copyright notice                               
9  */
10
11 //____________________________________________________________________
12 //
13 //  Singleton class to handle various parameters of the
14 //  START - T0
15 //  Should get data fromm Conditions DB.
16 //
17 # include <TNamed.h>
18 # include <TF1.h>
19 # include <TGraph.h>
20 #include <TObjArray.h>
21 class AliSTARTCalibData;
22 class AliSTARTAlignData;
23 class AliCDBEntry;
24
25 class AliSTARTParameters : public TNamed
26 {
27 public:
28   static AliSTARTParameters* Instance();
29
30   void Init();  
31   // Set various `Fixed' parameters 
32   void SetPh2Mip(Int_t r=500)          { fPh2Mip = r; }
33   void SetChannelWidth(Int_t s=25)   { fChannelWidth = s;}
34   void SetmV2channel(Int_t size=320) { fmV2Channel = size; }
35   void SetQTmin(Int_t qt=13) {fQTmin = qt;}
36   void SetQTmax(Int_t qt=125) {fQTmax = qt;}
37   void SetGain(Int_t size=50) { fFixedGain = size; }
38   void SetZposition( Float_t valueC=69.7, Float_t valueA=373) {
39     fSTARTzPosition[0]=valueC, fSTARTzPosition[1]=valueA;}
40   void SetPMTeff(Int_t ipmt);  
41
42   // Set various variable parameter defaults
43   void SetTimeDelayCablesCFD(Int_t ipmt,Float_t r=150)   
44   { fTimeDelayCablesCFD[ipmt] = r;}
45   void SetTimeDelayCablesLED(Int_t ipmt,Float_t r=150)    
46   { fTimeDelayCablesLED[ipmt] = r;}
47   void SetTimeDelayPMT(Int_t ipmt,Float_t r=5)    
48   { fTimeDelayPMT[ipmt] = r;}
49   void SetTimeDelayElectronicCFD(Int_t ipmt,Float_t r=8)    
50   { fTimeDelayElectronicCFD[ipmt] = r;}
51   void SetTimeDelayElectronicLED(Int_t ipmt,Float_t r=10)  
52   { fTimeDelayElectronicLED[ipmt] = r;}
53   void SetVariableDelayLine(Int_t ipmt, Int_t v=0)  
54   { fVariableDelayLine[ipmt] = v;}
55   void SetSlewingLED(Int_t ipmt); 
56  
57
58   // Get `Fixed' various parameters
59   Int_t GetPh2Mip()          const { return fPh2Mip; }
60   Int_t GetChannelWidth()     const { return fChannelWidth; }
61   Int_t GetmV2channel()     const { return fmV2Channel; }
62   Int_t GetQTmin() const {return fQTmin;}
63   Int_t GetQTmax() const {return fQTmax;}
64   Float_t  GetGain(Int_t ipmt)        const;
65   Float_t GetZposition(Int_t i) const {return fSTARTzPosition[i];}
66   TGraph *  GetPMTeff(Int_t ipmt) const  
67   {return (TGraph*)fPMTeff.At(ipmt);}
68   Float_t GetpmtEFF(Int_t ipmt, Float_t lambda) const
69   {return((TGraph*)fPMTeff.At(ipmt))->Eval(lambda);} 
70
71   Float_t  GetTimeDelayCablesCFD(Int_t ipmt) const 
72   {return fTimeDelayCablesCFD[ipmt]; } 
73   Float_t  GetTimeDelayCablesLED(Int_t ipmt) const 
74   {return fTimeDelayCablesLED[ipmt]; } ; 
75
76   Float_t  GetTimeDelayElectronicLED(Int_t ipmt) const 
77   {return fTimeDelayElectronicLED[ipmt]; } ; 
78   Float_t  GetTimeDelayElectronicCFD(Int_t ipmt) const 
79   {return fTimeDelayElectronicCFD[ipmt]; } ; 
80   Int_t GetVariableDelayLine(Int_t ipmt) const 
81   {return fVariableDelayLine[ipmt];}
82
83   Float_t GetSlewingLED(Int_t ipmt, Float_t mv) const
84   {return((TGraph*)fSlewingLED.At(ipmt))->Eval(mv);} 
85    TGraph *  GetSlew(Int_t ipmt) const  
86   {return (TGraph*)fSlewingLED.At(ipmt);}
87
88   Float_t GetTimeDelayCFD(Int_t ipmt);
89   Float_t GetTimeDelayLED(Int_t ipmt);
90
91 protected:
92   AliSTARTParameters();
93   virtual ~AliSTARTParameters() {}
94   static AliSTARTParameters* fgInstance; // Static singleton instance
95   
96   Bool_t fIsInit;               
97   Float_t  fSTARTzPosition[2] ;  // z-position of the two STARTs
98   Int_t   fPh2Mip;            // # photoelectrons per MIP in radiator
99   Int_t        fChannelWidth;          // channel width in ns   
100   Int_t        fmV2Channel;     // ADC mv  2  channel # (200000ps/(25*25).
101   Int_t fQTmin;                 //min  time for QTC
102   Int_t fQTmax;                 //max  time fro QTC 
103   Int_t         fFixedGain;       //
104   Float_t fTimeDelayCablesCFD[24];       //! time delay in cables
105   Float_t fTimeDelayCablesLED[24];       //! time delay in cables
106   Float_t fTimeDelayElectronicCFD[24];       //! time delay in electronic
107   Float_t fTimeDelayElectronicLED[24];       //! time delay in electronic
108   Float_t fTimeDelayPMT[24];       //! time delay in PMT
109   Int_t fVariableDelayLine[24];      //time delay in VDL for trigger equvalizing
110   TObjArray fSlewingLED;  //array of slewing correction for each PMT
111   TObjArray fPMTeff; //array PMT registration efficiency
112   
113   Float_t fTimeDelayLED;  //  sum time delay for LED channel
114   Float_t fTimeDelayCFD;  // sum time delay for CFD channel
115   
116   static AliSTARTAlignData * fgAlignData; // singleton for Calibration data
117   static AliSTARTCalibData * fgCalibData; // singleton for Calibration data
118
119   AliCDBEntry*   fAlignentry ;  //pointer to START align object
120   AliCDBEntry*   fCalibentry ;  // pointer to START calibration object
121
122   ClassDef(AliSTARTParameters,1)
123 };
124
125 #endif
126 //____________________________________________________________________
127