]>
Commit | Line | Data |
---|---|---|
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 | virtual ~AliT0Parameters() {}; | |
35 | ||
36 | void Init(); | |
37 | void InitIfOnline(); | |
38 | ||
39 | // Set various `Fixed' parameters | |
40 | void SetPh2Mip(Int_t r=300) { fPh2Mip = r; } | |
41 | void SetmV2Mip(Int_t r=50) { fmV2Mip = r; } | |
42 | void SetChannelWidth(Float_t s=24.4) { fChannelWidth = s;} | |
43 | void SetmV2channel(Int_t size=320) { fmV2Channel = size; } | |
44 | void SetQTmin(Int_t qt=13) {fQTmin = qt;} | |
45 | void SetQTmax(Int_t qt=125) {fQTmax = qt;} | |
46 | void SetZposition( Float_t valueC=69.7, Float_t valueA=373) { | |
47 | fT0zPosition[0]=valueC, fT0zPosition[1]=valueA;} | |
48 | void SetPMTeff(Int_t ipmt); | |
49 | ||
50 | void SetTimeDelayTVD(Float_t r=150) { fTimeDelayTVD = r; }; | |
51 | Float_t GetTimeDelayTVD() const { return fTimeDelayTVD; } | |
52 | ||
53 | ||
54 | // Get `Fixed' various parameters | |
55 | Int_t GetPh2Mip() const { return fPh2Mip; } | |
56 | Int_t GetmV2Mip() const { return fmV2Mip; } | |
57 | Float_t GetChannelWidth() const { return fChannelWidth; } | |
58 | Int_t GetmV2channel() const { return fmV2Channel; } | |
59 | Int_t GetQTmin() const {return fQTmin;} | |
60 | Int_t GetQTmax() const {return fQTmax;} | |
61 | 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 | {return (TGraph*)fPMTeff.At(ipmt);} | |
69 | Float_t GetpmtEFF(Int_t ipmt, Float_t lambda) const | |
70 | {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 | void SetMeanT0(Float_t mean=512) { fMeanT0 = mean; }; | |
82 | Float_t GetMeanT0 () {return fMeanT0;}; | |
83 | void SetMeanVertex(Float_t mean=0) { fMeanVertex = mean; }; | |
84 | Float_t GetMeanVertex (); | |
85 | ||
86 | TMap * GetMapLookup(); | |
87 | Int_t GetChannel(Int_t trm, Int_t tdc, Int_t chain, Int_t channel); | |
88 | Int_t GetNumberOfTRMs(); | |
89 | void SetNumberOfTRMs(Int_t ntrms=2) {fNumberOfTRMs = ntrms;} | |
90 | ||
91 | Float_t GetLatencyHPTDC(); | |
92 | Float_t GetLatencyL1();/* {return fLatencyL1;} */ | |
93 | Float_t GetLatencyL1A(); /* {return fLatencyL1A;}*/ | |
94 | Float_t GetLatencyL1C(); /* {return fLatencyL1C;} */ | |
95 | ||
96 | void SetLatencyHPTDC(Float_t lat) {fLatencyHPTDC=lat;} | |
97 | void SetLatencyL1(Float_t lat) {fLatencyL1=lat;} | |
98 | void SetLatencyL1A(Float_t lat) { fLatencyL1A=lat;} | |
99 | void SetLatencyL1C(Float_t lat) { fLatencyL1C=lat;} | |
100 | ||
101 | protected: | |
102 | static AliT0Parameters* fgInstance; // Static singleton instance | |
103 | ||
104 | Bool_t fIsInit; // Whether we've been initialised | |
105 | Float_t fT0zPosition[2] ; // z-position of the two T0s | |
106 | Int_t fPh2Mip; // # photoelectrons per MIP in radiator | |
107 | Int_t fmV2Mip; // # mV per MIP in radiator | |
108 | Float_t fChannelWidth; // channel width in ns | |
109 | Int_t fmV2Channel; // ADC mv 2 channel # (200000ps/(25*25). | |
110 | Int_t fQTmin; //min time for QTC | |
111 | Int_t fQTmax; //max time fro QTC | |
112 | TObjArray fAmpLEDRec; // array of amlitude vs LED-CFD (simulation & reconstruction) | |
113 | TObjArray fPMTeff; //array PMT registration efficiency | |
114 | TObjArray fWalk; //array time-amplitude walk | |
115 | TObjArray fQTC; //array of TGraphs for QTC vs number of MIPs | |
116 | TObjArray fAmpLED; //array of TGraphs for LED-CFD vs number of MIPs | |
117 | ||
118 | ||
119 | Float_t fTimeDelayCFD; // sum time delay for CFD channel | |
120 | // Float_t fTimeV0; // sum time delay for CFD channel | |
121 | Float_t fTimeDelayTVD; //time delay for TVD (vertex trigger channel) | |
122 | Float_t fMeanT0; //mean of T0distribution with vertex=0; | |
123 | Float_t fMeanVertex; // mean of vertex distribution; | |
124 | ||
125 | Float_t fLatencyHPTDC; // all latencies; | |
126 | Float_t fLatencyL1; // all latencies; | |
127 | Float_t fLatencyL1A; // all latencies; | |
128 | Float_t fLatencyL1C; // all latencies; | |
129 | ||
130 | TMap fLookUp; //lookup table | |
131 | Int_t fNumberOfTRMs; // number of TRMs in setup | |
132 | ||
133 | //latency | |
134 | ||
135 | ||
136 | static AliT0CalibTimeEq * fgCalibData; // singleton for Calibration data | |
137 | static AliT0CalibData * fgLookUp; // singleton for Calibration data | |
138 | static AliT0CalibWalk * fgSlewCorr; // singleton for Calibration data | |
139 | static AliT0CalibLatency * fgLatency; // singleton for Calibration data | |
140 | ||
141 | AliCDBEntry* fCalibentry ; // pointer to T0 calibration object | |
142 | AliCDBEntry* fLookUpentry ; // pointer to T0 lokkup table | |
143 | AliCDBEntry* fSlewCorr ; // pointer to slewing correction | |
144 | AliCDBEntry* fLatency ; // pointer to latency | |
145 | ||
146 | private: | |
147 | AliT0Parameters(const AliT0Parameters&); | |
148 | AliT0Parameters& operator=(const AliT0Parameters&); | |
149 | ||
150 | ClassDef(AliT0Parameters,6) | |
151 | ||
152 | }; | |
153 | ||
154 | #endif | |
155 | //____________________________________________________________________ | |
156 |