1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 #include "AliTRDCalOnlineGainTableMCM.h"
17 #include "AliTRDCalOnlineGainTable.h"
19 //////////////////////////////////////////////////////////////////////////////////////////////
21 // Data structure to store gaintables of the online calibration in the OCDB
22 // consisting of three classes:
23 // AliTRDCalOnlineGainTable
24 // AliTRDCalOnlineGainTableROC
25 // AliTRDCalOnlineGainTableMCM
27 // AliTRDCalOnlineGainTable is the main class from which all stored data can be accessed.
28 // The two sub-classes AliTRDCalOnlineGainTableROC and AliTRDCalOnlineGainTableMCM
29 // contain the gaintables on ROC level and on the MCM level respectively.
31 // The online calibration is used to compensate gain deviations on the pad level.
32 // For the offline reconstruction the online calibration has to be undone.
33 // The corresponding gain correction factor that was used by the online gain filter can be accessed
34 // via the functions AliTRDCalOnlineGainTable::GetGainCorrectionFactor(Int_t det, Int_t row, Int_t col)
35 // and AliTRDCalOnlineGainTable::GetGainCorrectionFactor(Int_t sector, Int_t stack, Int_t layer, Int_t row, Int_t col).
37 // With the class AliTRDCalOnlineGainTablesMCM all values used for the
38 // online calibration can be set and accessed on the MCM/channel level
40 //////////////////////////////////////////////////////////////////////////////////////////////
42 ClassImp(AliTRDCalOnlineGainTableMCM);
44 //_____________________________________________________________________________
45 AliTRDCalOnlineGainTableMCM::AliTRDCalOnlineGainTableMCM()
55 fMCMGain = AliTRDCalOnlineGainTable::UnDef;
57 for (int i=0; i<21;i++) {
65 //_____________________________________________________________________________
66 AliTRDCalOnlineGainTableMCM::~AliTRDCalOnlineGainTableMCM()
74 //_____________________________________________________________________________
75 Float_t AliTRDCalOnlineGainTableMCM::GetGainCorrectionFactor(Int_t channel)
78 // returns the Gain Correction Factor of the given channel that was used by the online gain filter
79 // 1.0 means no correction
80 // 0.9 means a correction of -10%
81 // 1.1 means a correction of +10% etc.
85 if (fFGFN[channel] < 0){
88 else if(fFGFN[channel] > 511){
92 return (fFGFN[channel]/2048.)+0.875;
97 // if the reference voltage of the ADC is not the default value
98 // this taken into account for the Gain Correction Factor
99 Float_t fAdcdac_Correction = ( 1./(1.+((Float_t)fAdcdac/31.)*(0.4/1.05)));
100 return (fAdcdac_Correction*((fFGFN[channel]/2048.)+0.875));
105 //_____________________________________________________________________________
106 Short_t AliTRDCalOnlineGainTableMCM::GetAdcdac()
109 // returns an integer between 0 and 31 which corresponds to an ADC reference voltage between 1.05V and 1.45V
110 // U_Ref = (1.05V + (fAdcdac/31)*0.4V
111 // fAdcdac is the same value for all ADCs within one MCM
118 //_____________________________________________________________________________
119 Float_t AliTRDCalOnlineGainTableMCM::GetMCMGain()
122 // returns the Gain Factor which would lead to a Gain Correction Factor of 1.0
123 // this value is the same for all channels within one MCM
124 // this value is used for the online PID
131 //_____________________________________________________________________________
132 Short_t AliTRDCalOnlineGainTableMCM::GetFGAN(Int_t channel)
135 // returns the Gain Correction Filter Additive as an interger between 0 and 15
136 // as it is loaded into the TRAP
139 if (fFGAN[channel] < 0){
142 else if(fFGAN[channel] > 511){
146 return fFGAN[channel];
152 //_____________________________________________________________________________
153 Short_t AliTRDCalOnlineGainTableMCM::GetFGFN(Int_t channel)
156 // returns the Gain Correction Filter Factors as an interger between 0 and 511
157 // as it is loaded into the TRAP
160 if (fFGFN[channel] < 0){
163 else if(fFGFN[channel] > 511){
167 return fFGFN[channel];