Linearisation for Fenix strip input: 16 bits corresponding to input EBDataFrame output: 18 bits. More...
#include <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, const EcalTPGCrystalStatus *ecaltpBadX) |
virtual | ~EcalFenixLinearizer () |
Private Member Functions | |
int | process () |
int | setInput (const EcalMGPASample &RawSam) |
Private Attributes | |
const EcalTPGCrystalStatusCode * | badXStatus_ |
int | base_ |
bool | famos_ |
int | gainID_ |
bool | init_ |
const EcalTPGLinearizationConstant * | linConsts_ |
int | mult_ |
const EcalTPGPedestal * | peds_ |
int | shift_ |
int | strip_ |
int | uncorrectedSample_ |
std::vector< const EcalTPGCrystalStatusCode * > | vectorbadXStatus_ |
Linearisation for Fenix strip input: 16 bits corresponding to input EBDataFrame output: 18 bits.
Definition at line 19 of file EcalFenixLinearizer.h.
EcalFenixLinearizer::EcalFenixLinearizer | ( | bool | famos | ) |
Definition at line 9 of file EcalFenixLinearizer.cc.
EcalFenixLinearizer::~EcalFenixLinearizer | ( | ) | [virtual] |
Definition at line 14 of file EcalFenixLinearizer.cc.
References i, init_, and vectorbadXStatus_.
{ if (init_) { for (int i=0;i<(int)vectorbadXStatus_.size();i++){ delete vectorbadXStatus_[i]; } } }
int EcalFenixLinearizer::process | ( | ) | [private] |
Definition at line 51 of file EcalFenixLinearizer.cc.
References base_, mult_, convertSQLitetoXML_cfg::output, shift_, and uncorrectedSample_.
Referenced by process(), and EcalFenixStrip::process_part1().
void EcalFenixLinearizer::process | ( | const T & | df, |
std::vector< int > & | output_percry | ||
) |
Definition at line 52 of file EcalFenixLinearizer.h.
References i, process(), and setInput().
int EcalFenixLinearizer::setInput | ( | const EcalMGPASample & | RawSam | ) | [private] |
Definition at line 60 of file EcalFenixLinearizer.cc.
References EcalMGPASample::adc(), badXStatus_, base_, famos_, EcalMGPASample::gainId(), gainID_, EcalTPGCrystalStatusCode::getStatusCode(), linConsts_, LogDebug, cond::ecalped::mean_x12, cond::ecalped::mean_x6, mult_, peds_, EcalMGPASample::raw(), shift_, and uncorrectedSample_.
Referenced by process().
{ if(RawSam.raw()>0X3FFF) { LogDebug("EcalTPG")<<"ERROR IN INPUT SAMPLE OF FENIX LINEARIZER"; return -1; } uncorrectedSample_=RawSam.adc(); //uncorrectedSample_ is coded in the 12 LSB gainID_=RawSam.gainId(); //uncorrectedSample_ is coded in the 2 next bits! if (gainID_==0) gainID_=3; if (gainID_==1) { base_ = peds_ -> mean_x12; shift_ = linConsts_ -> shift_x12; // take into account the badX // badXStatus_ == 0 if the crystal works // badXStatus_ !=0 some problem with the crystal if (badXStatus_->getStatusCode()!=0){ mult_ = 0; } else{ mult_ = linConsts_ -> mult_x12; } } else if (gainID_==2) { base_ = peds_ -> mean_x6; shift_ = linConsts_ -> shift_x6; // take into account the badX // check if the badX has a status code=0 or 1 if (badXStatus_->getStatusCode()!=0){ mult_ = 0; } else{ mult_ = linConsts_ -> mult_x6; } } else if (gainID_==3){ base_ = peds_-> mean_x1; shift_ = linConsts_ -> shift_x1; // take into account the badX // check if the badX has a status code=0 or 1 if (badXStatus_->getStatusCode()!=0){ mult_ = 0; } else{ mult_ = linConsts_ -> mult_x1; } } if (famos_) base_=200; //FIXME by preparing a correct TPG.txt for Famos return 1; }
void EcalFenixLinearizer::setParameters | ( | uint32_t | raw, |
const EcalTPGPedestals * | ecaltpPed, | ||
const EcalTPGLinearizationConst * | ecaltpLin, | ||
const EcalTPGCrystalStatus * | ecaltpBadX | ||
) |
Definition at line 22 of file EcalFenixLinearizer.cc.
References badXStatus_, EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::find(), EcalCondObjectContainer< T >::getMap(), init_, linConsts_, peds_, runTheMatrix_dev::raw, and vectorbadXStatus_.
Referenced by EcalFenixStrip::process_part1().
{ const EcalTPGLinearizationConstMap & linMap = ecaltpLin->getMap() ; EcalTPGLinearizationConstMapIterator it=linMap.find(raw); if (it!=linMap.end()) { linConsts_=&(*it); } else edm::LogWarning("EcalTPG")<<" could not find EcalTPGLinearizationConstMap entry for "<<raw; const EcalTPGPedestalsMap & pedMap = ecaltpPed->getMap() ; EcalTPGPedestalsMapIterator itped=pedMap.find(raw); if (itped!=pedMap.end()) peds_=&(*itped); else edm::LogWarning("EcalTPG")<<" could not find EcalTPGPedestalsMap entry for "<<raw; const EcalTPGCrystalStatusMap & badXMap = ecaltpBadX->getMap(); EcalTPGCrystalStatusMapIterator itbadX=badXMap.find(raw); if (itbadX!=badXMap.end()) { badXStatus_=&(*itbadX); } else { edm::LogWarning("EcalTPG")<<" could not find EcalTPGCrystalStatusMap entry for "<<raw; badXStatus_ = new EcalTPGCrystalStatusCode(); vectorbadXStatus_.push_back(&(*badXStatus_)); init_ = true; } }
const EcalTPGCrystalStatusCode* EcalFenixLinearizer::badXStatus_ [private] |
Definition at line 34 of file EcalFenixLinearizer.h.
Referenced by setInput(), and setParameters().
int EcalFenixLinearizer::base_ [private] |
Definition at line 26 of file EcalFenixLinearizer.h.
Referenced by process(), and setInput().
bool EcalFenixLinearizer::famos_ [private] |
Definition at line 23 of file EcalFenixLinearizer.h.
Referenced by setInput().
int EcalFenixLinearizer::gainID_ [private] |
Definition at line 25 of file EcalFenixLinearizer.h.
Referenced by setInput().
bool EcalFenixLinearizer::init_ [private] |
Definition at line 30 of file EcalFenixLinearizer.h.
Referenced by setParameters(), and ~EcalFenixLinearizer().
const EcalTPGLinearizationConstant* EcalFenixLinearizer::linConsts_ [private] |
Definition at line 32 of file EcalFenixLinearizer.h.
Referenced by setInput(), and setParameters().
int EcalFenixLinearizer::mult_ [private] |
Definition at line 27 of file EcalFenixLinearizer.h.
Referenced by process(), and setInput().
const EcalTPGPedestal* EcalFenixLinearizer::peds_ [private] |
Definition at line 33 of file EcalFenixLinearizer.h.
Referenced by setInput(), and setParameters().
int EcalFenixLinearizer::shift_ [private] |
Definition at line 28 of file EcalFenixLinearizer.h.
Referenced by process(), and setInput().
int EcalFenixLinearizer::strip_ [private] |
Definition at line 29 of file EcalFenixLinearizer.h.
int EcalFenixLinearizer::uncorrectedSample_ [private] |
Definition at line 24 of file EcalFenixLinearizer.h.
Referenced by process(), and setInput().
std::vector<const EcalTPGCrystalStatusCode *> EcalFenixLinearizer::vectorbadXStatus_ [private] |
Definition at line 36 of file EcalFenixLinearizer.h.
Referenced by setParameters(), and ~EcalFenixLinearizer().