]> git.uio.no Git - u/mrichter/AliRoot.git/blob - T0/AliT0Parameters.h
Alexey: new macros for T0 visualization.
[u/mrichter/AliRoot.git] / T0 / AliT0Parameters.h
1 #ifndef ALIT0PARAMETERS_H
2 #define ALIT0PARAMETERS_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 //  T0 - T0
15 //  Should get data fromm Conditions DB.
16 //
17 # include <TNamed.h>
18 # include <TF1.h>
19 # include <TMap.h>
20 # include <TGraph.h>
21 #include <TObjArray.h>
22 class AliT0CalibData;
23 class AliCDBEntry;
24
25 class AliT0Parameters : public TNamed
26 {
27 public:
28   static AliT0Parameters* Instance();
29
30   void Init();  
31   // Set various `Fixed' parameters 
32   void SetPh2Mip(Int_t r=300)          { fPh2Mip = r; }
33   void SetmV2Mip(Int_t r=50)          { fmV2Mip = r; }
34   void SetChannelWidth(Int_t s=25)   { fChannelWidth = s;}
35   void SetmV2channel(Int_t size=320) { fmV2Channel = size; }
36   void SetQTmin(Int_t qt=13) {fQTmin = qt;}
37   void SetQTmax(Int_t qt=125) {fQTmax = qt;}
38   void SetZposition( Float_t valueC=69.7, Float_t valueA=373) {
39     fT0zPosition[0]=valueC, fT0zPosition[1]=valueA;}
40   void SetPMTeff(Int_t ipmt);  
41
42   void SetTimeDelayTVD(Float_t r=150)   { fTimeDelayTVD = r; };
43   Float_t GetTimeDelayTVD()   { return fTimeDelayTVD; }
44
45   // Set various variable parameter defaults
46   void SetSlewingLED(Int_t ipmt); 
47   void SetSlewingRec(Int_t ipmt); 
48  
49
50   // Get `Fixed' various parameters
51   Int_t GetPh2Mip()          const { return fPh2Mip; }
52   Int_t GetmV2Mip()          const { return fmV2Mip; }
53   Int_t GetChannelWidth()     const { return fChannelWidth; }
54   Int_t GetmV2channel()     const { return fmV2Channel; }
55   Int_t GetQTmin() const {return fQTmin;}
56   Int_t GetQTmax() const {return fQTmax;}
57   Double_t GetZposition(Int_t i) const {return fT0zPosition[i];}
58   Double_t GetZPosition(const char* symname) ;
59    TGraph *  GetPMTeff(Int_t ipmt) const  
60   {return (TGraph*)fPMTeff.At(ipmt);}
61   Float_t GetpmtEFF(Int_t ipmt, Float_t lambda) const
62   {return((TGraph*)fPMTeff.At(ipmt))->Eval(lambda);} 
63
64
65   Float_t GetSlewingLED(Int_t ipmt, Float_t mv) const;
66   //  {return((TGraph*)fSlewingLED.At(ipmt))->Eval(mv);} 
67   TGraph *  GetSlew(Int_t ipmt) const ; 
68   //  {return (TGraph*)fSlewingLED.At(ipmt);}
69   TGraph *  GetSlewRec(Int_t ipmt) const;  
70   //  {return (TGraph*)fSlewingRec.At(ipmt);}
71   Float_t GetSlewingRec(Int_t ipmt, Float_t mv) const;
72   //  {return((TGraph*)fSlewingRec.At(ipmt))->Eval(mv);} 
73
74   TGraph *GetWalk(Int_t ipmt )  const;// {return ((TF1*)fWalk.At(ipmt));}
75   Float_t  GetWalkVal(Int_t ipmt, Float_t mv ) const ;//{return ((TF1*)fWalk.At(ipmt))->Eval(mv);}
76    void SetWalk(Int_t ipmt) ;
77    
78   Float_t GetTimeDelayCFD(Int_t ipmt);
79   Float_t GetTimeDelayLED(Int_t ipmt);
80
81   //  TMap *LookupTable;
82
83   Int_t GetChannel(Int_t trm,  Int_t tdc, Int_t chain, Int_t channel);
84   Int_t GetNumberOfTRMs();
85   void SetNumberOfTRMs(Int_t ntrms=2) {fNumberOfTRMs = ntrms;}
86
87 protected:
88   AliT0Parameters();
89   virtual ~AliT0Parameters() {}
90   static AliT0Parameters* fgInstance; // Static singleton instance
91   
92   Bool_t fIsInit;                // Whether we've been initialised
93   Float_t  fT0zPosition[2] ;  // z-position of the two T0s
94   Int_t   fPh2Mip;            // # photoelectrons per MIP in radiator
95   Int_t   fmV2Mip;            // # mV per MIP in radiator
96   Int_t        fChannelWidth;          // channel width in ns   
97   Int_t        fmV2Channel;     // ADC mv  2  channel # (200000ps/(25*25).
98   Int_t fQTmin;                 //min  time for QTC
99   Int_t fQTmax;                 //max  time fro QTC 
100   Int_t fVariableDelayLine[24];      //time delay in VDL for trigger equvalizing
101   TObjArray fSlewingLED;  //array of slewing correction for each PMT
102   TObjArray fSlewingRec;  //array of slewing correction for Reconstruction
103   TObjArray fPMTeff; //array PMT registration efficiency
104   TObjArray fWalk; //array time-amplitude walk
105   
106   Float_t fTimeDelayLED;  //  sum time delay for LED channel
107   Float_t fTimeDelayCFD;  // sum time delay for CFD channel
108   Float_t  fTimeDelayTVD;  //time delay for TVD (vertex trigger channel)
109   
110   TMap fLookUp;           //lookup table
111   Int_t fNumberOfTRMs;    // number of TRMs in setup
112
113   static AliT0CalibData * fgCalibData; // singleton for Calibration data
114   static AliT0CalibData * fgLookUp; // singleton for Calibration data
115   static AliT0CalibData * fgSlewCorr; // singleton for Calibration data
116   
117   AliCDBEntry*   fCalibentry ;  // pointer to T0 calibration object
118   AliCDBEntry*   fLookUpentry ;  // pointer to T0 lokkup table
119   AliCDBEntry*   fSlewCorr ;  // pointer to slewing correction
120   
121   ClassDef(AliT0Parameters,2)
122     private:
123   AliT0Parameters(const  AliT0Parameters&);
124   AliT0Parameters& operator=(const AliT0Parameters&);
125
126 };
127
128 #endif
129 //____________________________________________________________________
130