Line data Source code
1 : #ifndef ALIT0PARAMETERS_H
2 : #define ALIT0PARAMETERS_H
3 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4 : * reserved.
5 : *
6 : * Alla Maevskaya INR RAS alla@inr.ru
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 : class AliT0CalibWalk;
25 : class AliT0CalibTimeEq;
26 : class AliT0CalibLatency;
27 :
28 : class AliT0Parameters : public TNamed
29 : {
30 : public:
31 : static AliT0Parameters* Instance();
32 :
33 : AliT0Parameters();
34 0 : virtual ~AliT0Parameters() {};
35 :
36 : void Init();
37 : void InitIfOnline();
38 :
39 : // Set various `Fixed' parameters
40 144 : void SetPh2Mip(Int_t r=300) { fPh2Mip = r; }
41 144 : void SetmV2Mip(Int_t r=50) { fmV2Mip = r; }
42 144 : void SetChannelWidth(Float_t s=24.4) { fChannelWidth = s;}
43 144 : void SetmV2channel(Int_t size=320) { fmV2Channel = size; }
44 144 : void SetQTmin(Int_t qt=13) {fQTmin = qt;}
45 144 : void SetQTmax(Int_t qt=125) {fQTmax = qt;}
46 : void SetZposition( Float_t valueC=69.7, Float_t valueA=373) {
47 6 : fT0zPosition[0]=valueC, fT0zPosition[1]=valueA;}
48 : void SetPMTeff(Int_t ipmt);
49 :
50 6 : void SetTimeDelayTVD(Float_t r=150) { fTimeDelayTVD = r; };
51 8 : Float_t GetTimeDelayTVD() const { return fTimeDelayTVD; }
52 :
53 :
54 : // Get `Fixed' various parameters
55 8 : Int_t GetPh2Mip() const { return fPh2Mip; }
56 0 : Int_t GetmV2Mip() const { return fmV2Mip; }
57 60 : Float_t GetChannelWidth() const { return fChannelWidth; }
58 0 : Int_t GetmV2channel() const { return fmV2Channel; }
59 0 : Int_t GetQTmin() const {return fQTmin;}
60 0 : Int_t GetQTmax() const {return fQTmax;}
61 0 : Double_t GetZposition(Int_t i) const {return fT0zPosition[i];}
62 : Double_t GetZPosition(const char* symname) ;
63 : Double_t GetZPositionShift(const char* symname);
64 :
65 :
66 :
67 : TGraph * GetPMTeff(Int_t ipmt) const
68 48 : {return (TGraph*)fPMTeff.At(ipmt);}
69 : Float_t GetpmtEFF(Int_t ipmt, Float_t lambda) const
70 0 : {return((TGraph*)fPMTeff.At(ipmt))->Eval(lambda);}
71 :
72 :
73 : TGraph *GetAmpLEDRec(Int_t ipmt) const;
74 : TGraph *GetWalk(Int_t ipmt ) const;
75 : TGraph *GetQTC(Int_t ipmt) const;
76 : TGraph *GetAmpLED(Int_t ipmt) const;
77 :
78 : Float_t GetTimeDelayCFD(Int_t ipmt);
79 : // Float_t GetTimeV0(Int_t ipmt = 512) {return fTimeV0;}
80 : Float_t GetCFD (Int_t ipmt);
81 : Float_t GetQT1(Int_t ipmt);
82 : Float_t GetPedestalOld(Int_t ipmt);
83 : Float_t GetMeanTVDC();
84 : Float_t GetMeanOrC();
85 : Float_t GetMeanOrA();
86 :
87 0 : void SetMeanT0(Float_t mean=512) { fMeanT0 = mean; };
88 0 : Float_t GetMeanT0 () {return fMeanT0;};
89 0 : void SetMeanVertex(Float_t mean=0) { fMeanVertex = mean; };
90 : Float_t GetMeanVertex ();
91 :
92 : TMap * GetMapLookup();
93 : Int_t GetChannel(Int_t trm, Int_t tdc, Int_t chain, Int_t channel);
94 : Int_t GetNumberOfTRMs();
95 0 : void SetNumberOfTRMs(Int_t ntrms=2) {fNumberOfTRMs = ntrms;}
96 :
97 : Float_t GetLatencyHPTDC();
98 : Float_t GetLatencyL1();/* {return fLatencyL1;} */
99 : Float_t GetLatencyL1A(); /* {return fLatencyL1A;}*/
100 : Float_t GetLatencyL1C(); /* {return fLatencyL1C;} */
101 :
102 0 : void SetLatencyHPTDC(Float_t lat) {fLatencyHPTDC=lat;}
103 0 : void SetLatencyL1(Float_t lat) {fLatencyL1=lat;}
104 0 : void SetLatencyL1A(Float_t lat) { fLatencyL1A=lat;}
105 0 : void SetLatencyL1C(Float_t lat) { fLatencyL1C=lat;}
106 :
107 : protected:
108 : static AliT0Parameters* fgInstance; // Static singleton instance
109 :
110 : Bool_t fIsInit; // Whether we've been initialised
111 : Float_t fT0zPosition[2] ; // z-position of the two T0s
112 : Int_t fPh2Mip; // # photoelectrons per MIP in radiator
113 : Int_t fmV2Mip; // # mV per MIP in radiator
114 : Float_t fChannelWidth; // channel width in ns
115 : Int_t fmV2Channel; // ADC mv 2 channel # (200000ps/(25*25).
116 : Int_t fQTmin; //min time for QTC
117 : Int_t fQTmax; //max time fro QTC
118 : TObjArray fAmpLEDRec; // array of amlitude vs LED-CFD (simulation & reconstruction)
119 : TObjArray fPMTeff; //array PMT registration efficiency
120 : TObjArray fWalk; //array time-amplitude walk
121 : TObjArray fQTC; //array of TGraphs for QTC vs number of MIPs
122 : TObjArray fAmpLED; //array of TGraphs for LED-CFD vs number of MIPs
123 :
124 :
125 : Float_t fTimeDelayCFD; // sum time delay for CFD channel
126 : // Float_t fTimeV0; // sum time delay for CFD channel
127 : Float_t fTimeDelayTVD; //time delay for TVD (vertex trigger channel)
128 : Float_t fMeanT0; //mean of T0distribution with vertex=0;
129 : Float_t fMeanVertex; // mean of vertex distribution;
130 :
131 : Float_t fLatencyHPTDC; // all latencies;
132 : Float_t fLatencyL1; // all latencies;
133 : Float_t fLatencyL1A; // all latencies;
134 : Float_t fLatencyL1C; // all latencies;
135 :
136 : TMap fLookUp; //lookup table
137 : Int_t fNumberOfTRMs; // number of TRMs in setup
138 :
139 : //latency
140 :
141 :
142 : static AliT0CalibTimeEq * fgCalibData; // singleton for Calibration data
143 : static AliT0CalibData * fgLookUp; // singleton for Calibration data
144 : static AliT0CalibWalk * fgSlewCorr; // singleton for Calibration data
145 : static AliT0CalibLatency * fgLatency; // singleton for Calibration data
146 :
147 : AliCDBEntry* fCalibentry ; // pointer to T0 calibration object
148 : AliCDBEntry* fLookUpentry ; // pointer to T0 lokkup table
149 : AliCDBEntry* fSlewCorr ; // pointer to slewing correction
150 : AliCDBEntry* fLatency ; // pointer to latency
151 :
152 : private:
153 : AliT0Parameters(const AliT0Parameters&);
154 : AliT0Parameters& operator=(const AliT0Parameters&);
155 :
156 20 : ClassDef(AliT0Parameters,6)
157 :
158 : };
159 :
160 : #endif
161 : //____________________________________________________________________
162 :
|