#include <EcalTBTDCRecInfoAlgo.h>
Classes | |
struct | EcalTBTDCRanges |
Public Member Functions | |
EcalTBTDCRecInfoAlgo () | |
EcalTBTDCRecInfoAlgo (const std::vector< EcalTBTDCRanges > &tdcRanges) | |
EcalTBTDCRecInfo | reconstruct (const EcalTBTDCRawInfo &TDCRawInfo, const EcalTBEventHeader &eventHeader, bool use2004OffsetConvention) const |
~EcalTBTDCRecInfoAlgo () | |
Private Attributes | |
int | actualRange_ |
int | actualRun_ |
bool | tdcRangeErrorMessageAlreadyDisplayed_ |
std::vector< EcalTBTDCRanges > | tdcRanges_ |
Definition at line 11 of file EcalTBTDCRecInfoAlgo.h.
EcalTBTDCRecInfoAlgo::EcalTBTDCRecInfoAlgo | ( | ) | [inline] |
Definition at line 17 of file EcalTBTDCRecInfoAlgo.h.
: tdcRangeErrorMessageAlreadyDisplayed_(false) {};
EcalTBTDCRecInfoAlgo::EcalTBTDCRecInfoAlgo | ( | const std::vector< EcalTBTDCRanges > & | tdcRanges | ) | [explicit] |
Definition at line 7 of file EcalTBTDCRecInfoAlgo.cc.
: tdcRanges_(tdcRanges), tdcRangeErrorMessageAlreadyDisplayed_(false), actualRun_(-1) , actualRange_(-1) { }
EcalTBTDCRecInfoAlgo::~EcalTBTDCRecInfoAlgo | ( | ) | [inline] |
Definition at line 28 of file EcalTBTDCRecInfoAlgo.h.
{ };
EcalTBTDCRecInfo EcalTBTDCRecInfoAlgo::reconstruct | ( | const EcalTBTDCRawInfo & | TDCRawInfo, |
const EcalTBEventHeader & | eventHeader, | ||
bool | use2004OffsetConvention | ||
) | const |
Definition at line 13 of file EcalTBTDCRecInfoAlgo.cc.
References actualRange_, actualRun_, gather_cfg::cout, EcalTBEventHeader::dbEventType(), i, evf::evtn::offset(), EcalTBEventHeader::runNumber(), Ecal2004TBTDCRanges_cff::tdcMax, Ecal2004TBTDCRanges_cff::tdcMin, tdcRangeErrorMessageAlreadyDisplayed_, and tdcRanges_.
Referenced by EcalTBTDCRecInfoProducer::produce().
{ if (actualRun_ != eventHeader.runNumber() ) { actualRun_ = eventHeader.runNumber(); actualRange_ = -1; for (unsigned int i=0; i<tdcRanges_.size();i++) if ( eventHeader.runNumber() <= tdcRanges_[i].runRanges.second && eventHeader.runNumber() >= tdcRanges_[i].runRanges.first ) actualRange_ = i; if (actualRange_ == -1) { edm::LogError("TDCRange not found") << "TDC range not found"; return EcalTBTDCRecInfo(-1); } } int eventType; eventType=( (eventHeader.dbEventType() == 0) ? 0 : (eventHeader.dbEventType()-1)); int tdcd = TDCRawInfo[0].tdcValue(); if( !tdcRangeErrorMessageAlreadyDisplayed_ && (tdcd < tdcRanges_[actualRange_].tdcMin[eventType] || tdcd > tdcRanges_[actualRange_].tdcMax[eventType]) ){ std::cout << " ============================" <<std::endl; std::cout << " Event type: " << eventType << std::endl; std::cout << " TDC values not correctly set Raw TDC = "<< tdcd << " (Min/Max = "<< tdcRanges_[actualRange_].tdcMin[eventType] << "/" << tdcRanges_[actualRange_].tdcMax[eventType] << std::endl; std::cout << " ============================" <<std::endl; tdcRangeErrorMessageAlreadyDisplayed_ = true; } double offset = ( (double)tdcd - (double)tdcRanges_[actualRange_].tdcMin[eventType] ) / ((double)tdcRanges_[actualRange_].tdcMax[eventType]-(double)tdcRanges_[actualRange_].tdcMin[eventType]); if (use2004OffsetConvention) offset = (1. - offset) ; return EcalTBTDCRecInfo(offset); }
int EcalTBTDCRecInfoAlgo::actualRange_ [mutable, private] |
Definition at line 39 of file EcalTBTDCRecInfoAlgo.h.
Referenced by reconstruct().
int EcalTBTDCRecInfoAlgo::actualRun_ [mutable, private] |
Definition at line 38 of file EcalTBTDCRecInfoAlgo.h.
Referenced by reconstruct().
bool EcalTBTDCRecInfoAlgo::tdcRangeErrorMessageAlreadyDisplayed_ [mutable, private] |
Definition at line 37 of file EcalTBTDCRecInfoAlgo.h.
Referenced by reconstruct().
std::vector<EcalTBTDCRanges> EcalTBTDCRecInfoAlgo::tdcRanges_ [private] |
Definition at line 36 of file EcalTBTDCRecInfoAlgo.h.
Referenced by reconstruct().