1 #ifndef ALITRDFEEPARAM_H
2 #define ALITRDFEEPARAM_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 ////////////////////////////////////////////////////////////////////////////
10 // TRD front end electronics parameters class //
11 // Contains all FEE (MCM, TRAP, PASA) related //
12 // parameters, constants, and mapping. //
15 // Ken Oyama (oyama@physi.uni-heidelberg.de) //
17 ////////////////////////////////////////////////////////////////////////////
23 class AliTRDCommonParam;
27 //_____________________________________________________________________________
28 class AliTRDfeeParam : public TObject
33 AliTRDfeeParam(TRootIoCtor *);
34 AliTRDfeeParam(const AliTRDfeeParam &p);
35 virtual ~AliTRDfeeParam();
36 AliTRDfeeParam &operator=(const AliTRDfeeParam &p);
37 virtual void Copy(TObject &p) const;
39 static AliTRDfeeParam *Instance(); // Singleton
40 static void Terminate();
42 // Translation from MCM to Pad and vice versa
43 virtual Int_t GetPadRowFromMCM(Int_t irob, Int_t imcm) const;
44 virtual Int_t GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const;
45 virtual Int_t GetExtendedPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const;
46 virtual Int_t GetMCMfromPad(Int_t irow, Int_t icol) const;
47 virtual Int_t GetMCMfromSharedPad(Int_t irow, Int_t icol) const;
48 virtual Int_t GetROBfromPad(Int_t irow, Int_t icol) const;
49 virtual Int_t GetROBfromSharedPad(Int_t irow, Int_t icol) const;
50 virtual Int_t GetRobSide(Int_t irob) const;
51 virtual Int_t GetColSide(Int_t icol) const;
53 static UInt_t AliToExtAli(Int_t rob, Int_t aliid); // Converts the MCM-ROB combination to the extended MCM ALICE ID (used to address MCMs on the SCSN Bus)
54 static Int_t ExtAliToAli( UInt_t dest, UShort_t linkpair, UShort_t rocType, Int_t *list, Int_t listSize); // translates an extended MCM ALICE ID to a list of MCMs
55 static Short_t ChipmaskToMCMlist( UInt_t cmA, UInt_t cmB, UShort_t linkpair, Int_t *mcmList, Int_t listSize );
56 static Short_t GetRobAB( UShort_t robsel, UShort_t linkpair ); // Returns the chamber side (A=0, B=0) of a ROB
58 static Float_t GetSamplingFrequency() { return (Float_t)fgkLHCfrequency / 4000000.0; }
59 static Int_t GetNmcmRob() { return fgkNmcmRob; }
60 static Int_t GetNmcmRobInRow() { return fgkNmcmRobInRow; }
61 static Int_t GetNmcmRobInCol() { return fgkNmcmRobInCol; }
62 static Int_t GetNrobC0() { return fgkNrobC0; }
63 static Int_t GetNrobC1() { return fgkNrobC1; }
64 static Int_t GetNadcMcm() { return fgkNadcMcm; }
65 // static Int_t GetNtimebin() { return fgkNtimebin; }
66 static Int_t GetNcol() { return fgkNcol; }
67 static Int_t GetNcolMcm() { return fgkNcolMcm; }
68 static Int_t GetNrowC0() { return fgkNrowC0; }
69 static Int_t GetNrowC1() { return fgkNrowC1; }
71 // static Int_t GetADCpedestal() { return fgkADCpedestal; }
72 // static Int_t GetADCnoise() { return fgkADCnoise; }
73 static Int_t GetADCDAC() { return fgkADCDAC; }
75 static Bool_t IsPFon() { return fgkPFon; }
76 static Bool_t IsGFon() { return fgkGFon; }
77 static Bool_t IsTFon() { return fgkTFon; }
79 static Int_t GetPFtimeConstant() { return fgkPFtimeConstant; }
80 static Int_t GetPFeffectPedestal() { return fgkPFeffectPedestal; }
83 static Int_t GetQacc0Start() { return fgkPREPqAcc0Start; }
84 static Int_t GetQacc0End() { return fgkPREPqAcc0End; }
85 static Int_t GetQacc1Start() { return fgkPREPqAcc1Start; }
86 static Int_t GetQacc1End() { return fgkPREPqAcc1End; }
87 Float_t GetMinClusterCharge() const { return fgkMinClusterCharge; }
88 static Int_t GetLinearFitStart() { return fgkPREPLinearFitStart; }
89 static Int_t GetLinearFitEnd() { return fgkPREPLinearFitEnd; }
91 // Float_t GetClusThr() { return fClusThr; };
92 // Float_t GetPadThr() const { return fPadThr; };
93 // Int_t GetTailCancelation() const { return fTCOn; };
94 // Int_t GetNexponential() const { return fTCnexp; };
95 //virtual void GetFilterParam(Float_t &r1, Float_t &r2, Float_t &c1, Float_t &c2, Float_t &ped) const;
96 // Int_t GetFilterType() const { return fFilterType; };
98 static Int_t GetTFtype() { return fgkTFtype; }
99 //static Int_t GetTFnExp() { return fgkTFnExp; }
100 Int_t GetTFnExp() const { return fTFnExp; }
101 Float_t GetTFr1() const { return fTFr1; }
102 Float_t GetTFr2() const { return fTFr2; }
103 Float_t GetTFc1() const { return fTFc1; }
104 Float_t GetTFc2() const { return fTFc2; }
107 Bool_t GetTracklet() const { return fgTracklet; }
108 static void SetTracklet(Bool_t trackletSim = kTRUE) { fgTracklet = trackletSim; }
109 Int_t GetMaxNrOfTracklets() const { return fgkMaxNrOfTracklets; }
110 Bool_t GetMCTrackletOutput() const { return fgkMCTrackletOutput; }
112 static Float_t GetTFattPar() { return ((Float_t) fgkTFattPar1) / ((Float_t) fgkTFattPar2); }
113 Float_t GetTFf0() const { return 1.0 + fgkTFon*(-1.0+GetTFattPar()); } // 1 if TC off
115 void SetEBsglIndThr(Int_t val);
116 Int_t GetEBsglIndThr() const { return fEBsglIndThr; }
118 void SetEBsumIndThr(Int_t val);
119 Int_t GetEBsumIndThr() const { return fEBsumIndThr; }
121 void SetEBindLUT(Int_t val);
122 Int_t GetEBindLUT() const { return fEBindLUT; }
124 void SetEBignoreNeighbour(Int_t val);
125 Int_t GetEBignoreNeighbour() const { return fEBignoreNeighbour; }
127 // Concerning raw data format
128 Int_t GetRAWversion() const { return fRAWversion; }
129 void SetRAWversion( Int_t rawver );
130 Bool_t GetRAWstoreRaw() const { return fRAWstoreRaw; }
131 void SetRAWstoreRaw( Bool_t storeraw ) { fRAWstoreRaw = storeraw; }
138 static AliTRDfeeParam *fgInstance; // Singleton instance
139 static Bool_t fgTerminated; // Defines if this class has already been terminated
141 AliTRDCommonParam *fCP; // TRD common parameters class
143 // Remark: ISO C++ allows initialization of static const values only for integer.
145 // Basic Geometrical numbers
146 static const Int_t fgkLHCfrequency = 40079000 ; // [Hz] LHC clock (should be moved to STEER?)
147 static const Int_t fgkNmcmRob = 16; // Number of MCMs per ROB (old fgkMCMmax)
148 static const Int_t fgkNmcmRobInRow = 4; // Number of MCMs per ROB in row dir. (old fgkMCMrow)
149 static const Int_t fgkNmcmRobInCol = 4; // Number of MCMs per ROB in col dir. (old fgkMCMrow)
150 static const Int_t fgkNrobC0 = 6; // Number of ROBs per C0 chamber (old fgkROBmaxC0)
151 static const Int_t fgkNrobC1 = 8; // Number of ROBs per C1 chamber (old fgkROBmaxC1)
152 static const Int_t fgkNadcMcm = 21; // Number of ADC channels per MCM (old fgkADCmax)
153 // static const Int_t fgkNtimebin = 24; // Number of Time bins should come from calibDB
154 static const Int_t fgkNcol = 144; // Number of pads per padplane row(old fgkColmax)
155 static const Int_t fgkNcolMcm = 18; // Number of pads per MCM (old fgkPadmax)
156 static const Int_t fgkNrowC0 = 12; // Number of Rows per C0 chamber (old fgkRowmaxC0)
157 static const Int_t fgkNrowC1 = 16; // Number of Rows per C1 chamber (old fgkRowmaxC1)
159 // ADC intrinsic parameters
160 static const Int_t fgkADCDAC = 0; // 5 bit ADC gain parameter
162 // TRAP filter global setup
163 static const Bool_t fgkPFon = kTRUE; // Pedestal Filter enable/disable flag.
164 static const Bool_t fgkGFon = kFALSE; // Gain correction Filter enable/disable flag
165 static const Bool_t fgkTFon = kTRUE; // Tail cancelation Filter enable/disable flag (old name fTCOn)
168 static const Int_t fgkPFtimeConstant = 0; // 0 for fastest, 3 for slowest (no effect, probably)
169 static const Int_t fgkPFeffectPedestal = 10; // [in ADC units] the desired baseline (Additive)
172 static const Int_t fgkGFnoise = 0; // Noise level increased by gain filter x 100 [in ADC] (to be measured)
175 static const Int_t fgkTFtype = 1; // TC type (0=analog, 1=digital, 2=MI, 3=close to electronics) (old name fFilterType)
177 // OLD TF setup (calculated from above) (valid only for fgkTFsimType = 0 or 1)
178 //static const Int_t fgkTFnExp = 1; // Number of exponential for simType 0 and 1
179 Int_t fTFnExp; // Number of exponential for simType 0 and 1
181 // Tracklet processing on/off
182 static Bool_t fgTracklet; // tracklet processing
184 static const Int_t fgkMaxNrOfTracklets = 4; // Max. nr of tracklet words for one mcm
186 // additional tracklet folder structure output,
187 // containing all necessary Monte Carlo information; maybe this should go somewhere else;
188 static const Bool_t fgkMCTrackletOutput = kTRUE; // Default should be kTRUE
190 // following need Instance because initialized in constructor
191 Float_t fTFr1; // Time constant [us] long (old name fR1)
192 Float_t fTFr2; // Time constant [us] short(old name fR2)
193 Float_t fTFc1; // Weight long (old name fC1)
194 Float_t fTFc2; // Weight short (old name fC2)
196 // here is for TRAP simulation (not yet used)
197 static const Int_t fgkTFdecayWeightL = 270; // 0 to 1024 corresponds to 0 to 0.5
198 static const Int_t fgkTFdecayParL = 348; // 0 to 511 corresponds to 0.75 to 1
199 static const Int_t fgkTFdecayParS = 449; // 0 to 511 correponds to 0.25 to 0.5
200 static const Int_t fgkTFattPar1 = 45; // attenuationParameter = fgkTFattenuationParameter1/fgkTFattenuationParameter2
201 static const Int_t fgkTFattPar2 = 14; // = -alphaL/ln(lambdaL)-(1-alphaL)/ln(lambdaS)
204 Int_t fEBsglIndThr; // EBIS in ADC units
205 Int_t fEBsumIndThr; // EBIT in ADC units
206 Int_t fEBindLUT; // EBIL lookup table
207 Int_t fEBignoreNeighbour; // EBIN 0:include neighbor
209 // Charge accumulators
210 static const Int_t fgkPREPqAcc0Start = 5; // Preprocessor Charge Accumulator 0 Start
211 static const Int_t fgkPREPqAcc0End = 10; // Preprocessor Charge Accumulator 0 End
212 static const Int_t fgkPREPqAcc1Start = 11; // Preprocessor Charge Accumulator 1 Start
213 static const Int_t fgkPREPqAcc1End = 20; // Preprocessor Charge Accumulator 1 End
214 static const Int_t fgkMinClusterCharge = 20; // Hit detection [in ADC units]
217 static const Int_t fgkPREPLinearFitStart = 5; // Time constants for linear fit
218 static const Int_t fgkPREPLinearFitEnd = 20; // Time constants for linear fit
220 // OLD TRAP processing parameters calculated from above
221 //static const Float_t fClusThr; // Cluster threshold
222 //static const Float_t fPadThr; // Pad threshold
224 // For raw production
225 Int_t fRAWversion; // Raw data production version
226 static const Int_t fgkMaxRAWversion = 3; // Maximum raw version number supported
227 Bool_t fRAWstoreRaw; // Store unfiltered data for raw data stream
233 ClassDef(AliTRDfeeParam,3) // The TRD front end electronics parameter