#include <SimCalorimetry/EcalTrigPrimAlgos/interface/EcalFenixLinearizer.h>
Public Member Functions | |
EcalFenixLinearizer (bool famos) | |
template<class T> | |
void | process (const T &, std::vector< int > &) |
void | setParameters (uint32_t raw, const EcalTPGPedestals *ecaltpPed, const EcalTPGLinearizationConst *ecaltpLin) |
virtual | ~EcalFenixLinearizer () |
Private Member Functions | |
int | process () |
int | setInput (const EcalMGPASample &RawSam) |
Private Attributes | |
int | base_ |
bool | famos_ |
int | gainID_ |
const EcalTPGLinearizationConstant * | linConsts_ |
int | mult_ |
const EcalTPGPedestal * | peds_ |
int | shift_ |
int | strip_ |
int | uncorrectedSample_ |
Definition at line 17 of file EcalFenixLinearizer.h.
EcalFenixLinearizer::EcalFenixLinearizer | ( | bool | famos | ) |
EcalFenixLinearizer::~EcalFenixLinearizer | ( | ) | [virtual] |
void EcalFenixLinearizer::process | ( | const T & | df, | |
std::vector< int > & | output_percry | |||
) | [inline] |
Definition at line 46 of file EcalFenixLinearizer.h.
References i, process(), and setInput().
00047 { 00048 00049 //We know a tower numbering is: 00050 // S1 S2 S3 S4 S5 00051 // 00052 // 4 5 14 15 24 00053 // 3 6 13 16 23 00054 // 2 7 12 17 22 00055 // 1 8 11 18 21 00056 // 0 9 10 19 20 00057 for (int i=0;i<df.size();i++) { 00058 setInput(df[i]); 00059 output_percry[i]=process(); 00060 } 00061 00062 return; 00063 }
int EcalFenixLinearizer::process | ( | ) | [private] |
Definition at line 31 of file EcalFenixLinearizer.cc.
References base_, mult_, output(), shift_, and uncorrectedSample_.
Referenced by process(), and EcalFenixStrip::process_part1().
00032 { 00033 int output=(uncorrectedSample_-base_); //Substract base 00034 if(output<0) return 0; 00035 output=(output*mult_)>>(shift_+2); //Apply multiplicative factor 00036 if(output>0X3FFFF)output=0X3FFFF; //Saturation if too high 00037 return output; 00038 }
int EcalFenixLinearizer::setInput | ( | const EcalMGPASample & | RawSam | ) | [private] |
Definition at line 40 of file EcalFenixLinearizer.cc.
References EcalMGPASample::adc(), base_, famos_, EcalMGPASample::gainId(), gainID_, linConsts_, LogDebug, mult_, peds_, EcalMGPASample::raw(), shift_, and uncorrectedSample_.
Referenced by process().
00041 { 00042 if(RawSam.raw()>0X3FFF) 00043 { 00044 LogDebug("EcalTPG")<<"ERROR IN INPUT SAMPLE OF FENIX LINEARIZER"; 00045 return -1; 00046 } 00047 uncorrectedSample_=RawSam.adc(); //uncorrectedSample_ is coded in the 12 LSB 00048 gainID_=RawSam.gainId(); //uncorrectedSample_ is coded in the 2 next bits! 00049 if (gainID_==0) gainID_=3; 00050 00051 if (gainID_==1) { 00052 base_ = peds_ -> mean_x12; 00053 mult_ = linConsts_ -> mult_x12; 00054 shift_ = linConsts_ -> shift_x12; 00055 } 00056 else if (gainID_==2) { 00057 base_ = peds_ -> mean_x6; 00058 mult_ = linConsts_ -> mult_x6; 00059 shift_ = linConsts_ -> shift_x6; 00060 } 00061 else if (gainID_==3){ 00062 base_ = peds_-> mean_x1; 00063 mult_ = linConsts_ -> mult_x1; 00064 shift_ = linConsts_ -> shift_x1; 00065 } 00066 00067 if (famos_) base_=200; //FIXME by preparing a correct TPG.txt for Famos 00068 00069 return 1; 00070 }
void EcalFenixLinearizer::setParameters | ( | uint32_t | raw, | |
const EcalTPGPedestals * | ecaltpPed, | |||
const EcalTPGLinearizationConst * | ecaltpLin | |||
) |
Definition at line 16 of file EcalFenixLinearizer.cc.
References EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::find(), EcalCondObjectContainer< T >::getMap(), it, linConsts_, and peds_.
Referenced by EcalFenixStrip::process_part1().
00017 { 00018 const EcalTPGLinearizationConstMap & linMap = ecaltpLin->getMap() ; 00019 00020 EcalTPGLinearizationConstMapIterator it=linMap.find(raw); 00021 if (it!=linMap.end()) { 00022 linConsts_=&(*it); 00023 } 00024 else edm::LogWarning("EcalTPG")<<" could not find EcalTPGLinearizationConstMap entry for "<<raw; 00025 const EcalTPGPedestalsMap & pedMap = ecaltpPed->getMap() ; 00026 EcalTPGPedestalsMapIterator itped=pedMap.find(raw); 00027 if (itped!=pedMap.end()) peds_=&(*itped); 00028 else edm::LogWarning("EcalTPG")<<" could not find EcalTPGPedestalsMap entry for "<<raw; 00029 }
int EcalFenixLinearizer::base_ [private] |
bool EcalFenixLinearizer::famos_ [private] |
int EcalFenixLinearizer::gainID_ [private] |
const EcalTPGLinearizationConstant* EcalFenixLinearizer::linConsts_ [private] |
int EcalFenixLinearizer::mult_ [private] |
const EcalTPGPedestal* EcalFenixLinearizer::peds_ [private] |
int EcalFenixLinearizer::shift_ [private] |
int EcalFenixLinearizer::strip_ [private] |
Definition at line 27 of file EcalFenixLinearizer.h.
int EcalFenixLinearizer::uncorrectedSample_ [private] |