#include <RecoTBCalo/EcalTBTDCReconstructor/interface/EcalTBH2TDCRecInfoAlgo.h>
Public Member Functions | |
EcalTBH2TDCRecInfoAlgo (const std::vector< EcalTBH2TDCRanges > &tdcZero) | |
EcalTBH2TDCRecInfoAlgo () | |
EcalTBTDCRecInfo | reconstruct (const int &runNumber, const HcalTBTiming &TDCRawInfo) const |
~EcalTBH2TDCRecInfoAlgo () | |
Private Attributes | |
int | actualRange_ |
int | actualRun_ |
bool | tdcRangeErrorMessageAlreadyDisplayed_ |
std::vector< EcalTBH2TDCRanges > | tdcZeros_ |
Classes | |
struct | EcalTBH2TDCRanges |
Definition at line 10 of file EcalTBH2TDCRecInfoAlgo.h.
EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRecInfoAlgo | ( | ) | [inline] |
Definition at line 13 of file EcalTBH2TDCRecInfoAlgo.h.
00013 : tdcRangeErrorMessageAlreadyDisplayed_(false) {};
EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRecInfoAlgo | ( | const std::vector< EcalTBH2TDCRanges > & | tdcZero | ) | [explicit] |
Definition at line 8 of file EcalTBH2TDCRecInfoAlgo.cc.
00008 : 00009 tdcZeros_(tdcZeros), actualRun_(-1) , actualRange_(-1) 00010 { 00011 00012 }
EcalTBH2TDCRecInfoAlgo::~EcalTBH2TDCRecInfoAlgo | ( | ) | [inline] |
EcalTBTDCRecInfo EcalTBH2TDCRecInfoAlgo::reconstruct | ( | const int & | runNumber, | |
const HcalTBTiming & | TDCRawInfo | |||
) | const |
tdcRangeErrorMessageAlreadyDisplayed_ &&
Definition at line 14 of file EcalTBH2TDCRecInfoAlgo.cc.
References actualRange_, actualRun_, HcalTBTiming::BeamCoincidenceCount(), HcalTBTiming::BeamCoincidenceHits(), lat::endl(), i, offset, tdcRangeErrorMessageAlreadyDisplayed_, Ecal2006TBH2TDCRanges_v0_cff::tdcZero, tdcZeros_, and HcalTBTiming::ttcL1Atime().
Referenced by EcalTBH2TDCRecInfoProducer::produce().
00015 { 00016 if (actualRun_ != runNumber ) 00017 { 00018 actualRun_ = runNumber; 00019 actualRange_ = -1; 00020 for (unsigned int i=0; i<tdcZeros_.size();i++) 00021 if ( runNumber <= tdcZeros_[i].runRanges.second && runNumber >= tdcZeros_[i].runRanges.first ) 00022 actualRange_ = i; 00023 00024 if (actualRange_ == -1) 00025 { 00026 edm::LogError("TDCRange not found") << "TDC range not found"; 00027 return EcalTBTDCRecInfo(-1); 00028 } 00029 } 00030 00031 int ntdc = TDCRawInfo.BeamCoincidenceCount(); 00032 edm::LogInfo("") << "EcalTBH2TDCRecInfoAlgo::reconstruct # tdc hits: " << ntdc << std::endl;; 00033 if(ntdc>1) { 00034 for(int i=0; i<ntdc; ++i) { 00035 edm::LogInfo("") << "hit i: " << i << " tdc: " << TDCRawInfo.BeamCoincidenceHits(i) << std::endl; 00036 } 00037 } 00038 00039 00040 if(ntdc==0) { 00041 edm::LogError("NoTDCHits") << "no TDC hits. TDC info not reliable" << std::endl; 00042 return EcalTBTDCRecInfo(-999.); 00043 } 00044 00045 00046 //double tdcd = TDCRawInfo.ttcL1Atime() - TDCRawInfo.beamCoincidence(); 00047 double tdcd = TDCRawInfo.ttcL1Atime() - TDCRawInfo.BeamCoincidenceHits(0); 00048 00049 if( 00050 (tdcd < tdcZeros_[actualRange_].tdcZero -1 || tdcd > tdcZeros_[actualRange_].tdcZero + 26) ) 00051 { 00052 edm::LogError("TDCOutOfRange") << " ============================\n" 00053 << " tdc value out of range = "<< tdcd 00054 << " tdcZero = " << tdcZeros_[actualRange_].tdcZero 00055 << "\n" 00056 << " ============================\n" <<std::endl; 00057 tdcRangeErrorMessageAlreadyDisplayed_ = true; 00058 return EcalTBTDCRecInfo(-999.); 00059 } 00060 00061 double offset = ( (double)tdcd - (double)tdcZeros_[actualRange_].tdcZero ) 00062 / 25.; // 00063 // if (use2004OffsetConvention) 00064 // offset = (1. - offset) ; 00065 return EcalTBTDCRecInfo(offset); 00066 }
int EcalTBH2TDCRecInfoAlgo::actualRange_ [mutable, private] |
int EcalTBH2TDCRecInfoAlgo::actualRun_ [mutable, private] |
bool EcalTBH2TDCRecInfoAlgo::tdcRangeErrorMessageAlreadyDisplayed_ [mutable, private] |
std::vector<EcalTBH2TDCRanges> EcalTBH2TDCRecInfoAlgo::tdcZeros_ [private] |