CMS 3D CMS Logo

EcalTBH2TDCRecInfoAlgo Class Reference

#include <RecoTBCalo/EcalTBTDCReconstructor/interface/EcalTBH2TDCRecInfoAlgo.h>

List of all members.

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< EcalTBH2TDCRangestdcZeros_

Classes

struct  EcalTBH2TDCRanges


Detailed Description

Definition at line 10 of file EcalTBH2TDCRecInfoAlgo.h.


Constructor & Destructor Documentation

EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRecInfoAlgo (  )  [inline]

Definition at line 13 of file EcalTBH2TDCRecInfoAlgo.h.

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]

Definition at line 23 of file EcalTBH2TDCRecInfoAlgo.h.

00024     {
00025     };


Member Function Documentation

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 }


Member Data Documentation

int EcalTBH2TDCRecInfoAlgo::actualRange_ [mutable, private]

Definition at line 34 of file EcalTBH2TDCRecInfoAlgo.h.

Referenced by reconstruct().

int EcalTBH2TDCRecInfoAlgo::actualRun_ [mutable, private]

Definition at line 33 of file EcalTBH2TDCRecInfoAlgo.h.

Referenced by reconstruct().

bool EcalTBH2TDCRecInfoAlgo::tdcRangeErrorMessageAlreadyDisplayed_ [mutable, private]

Definition at line 32 of file EcalTBH2TDCRecInfoAlgo.h.

Referenced by reconstruct().

std::vector<EcalTBH2TDCRanges> EcalTBH2TDCRecInfoAlgo::tdcZeros_ [private]

Definition at line 31 of file EcalTBH2TDCRecInfoAlgo.h.

Referenced by reconstruct().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:56 2009 for CMSSW by  doxygen 1.5.4