CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
EcalTBH2TDCRecInfoAlgo Class Reference

#include <EcalTBH2TDCRecInfoAlgo.h>

Classes

struct  EcalTBH2TDCRanges
 

Public Member Functions

 EcalTBH2TDCRecInfoAlgo ()
 
 EcalTBH2TDCRecInfoAlgo (const std::vector< EcalTBH2TDCRanges > &tdcZero)
 
EcalTBTDCRecInfo reconstruct (const int &runNumber, const HcalTBTiming &TDCRawInfo) const
 
 ~EcalTBH2TDCRecInfoAlgo ()
 

Private Attributes

int actualRange_
 
int actualRun_
 
bool tdcRangeErrorMessageAlreadyDisplayed_
 
std::vector< EcalTBH2TDCRangestdcZeros_
 

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
EcalTBH2TDCRecInfoAlgo::~EcalTBH2TDCRecInfoAlgo ( )
inline

Definition at line 23 of file EcalTBH2TDCRecInfoAlgo.h.

24  {
25  };

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(), i, evf::evtn::offset(), convertSQLiteXML::runNumber, tdcRangeErrorMessageAlreadyDisplayed_, Ecal2006TBH2TDCRanges_v0_cff::tdcZero, tdcZeros_, and HcalTBTiming::ttcL1Atime().

Referenced by EcalTBH2TDCRecInfoProducer::produce().

15 {
16  if (actualRun_ != runNumber )
17  {
19  actualRange_ = -1;
20  for (unsigned int i=0; i<tdcZeros_.size();i++)
21  if ( runNumber <= tdcZeros_[i].runRanges.second && runNumber >= tdcZeros_[i].runRanges.first )
22  actualRange_ = i;
23 
24  if (actualRange_ == -1)
25  {
26  edm::LogError("TDCRange not found") << "TDC range not found";
27  return EcalTBTDCRecInfo(-1);
28  }
29  }
30 
31  int ntdc = TDCRawInfo.BeamCoincidenceCount();
32  edm::LogInfo("") << "EcalTBH2TDCRecInfoAlgo::reconstruct # tdc hits: " << ntdc << std::endl;;
33  if(ntdc>1) {
34  for(int i=0; i<ntdc; ++i) {
35  edm::LogInfo("") << "hit i: " << i << " tdc: " << TDCRawInfo.BeamCoincidenceHits(i) << std::endl;
36  }
37  }
38 
39 
40  if(ntdc==0) {
41  edm::LogError("NoTDCHits") << "no TDC hits. TDC info not reliable" << std::endl;
42  return EcalTBTDCRecInfo(-999.);
43  }
44 
45 
46  //double tdcd = TDCRawInfo.ttcL1Atime() - TDCRawInfo.beamCoincidence();
47  double tdcd = TDCRawInfo.ttcL1Atime() - TDCRawInfo.BeamCoincidenceHits(0);
48 
49  if(
50  (tdcd < tdcZeros_[actualRange_].tdcZero -1 || tdcd > tdcZeros_[actualRange_].tdcZero + 26) )
51  {
52  edm::LogError("TDCOutOfRange") << " ============================\n"
53  << " tdc value out of range = "<< tdcd
54  << " tdcZero = " << tdcZeros_[actualRange_].tdcZero
55  << "\n"
56  << " ============================\n" <<std::endl;
58  return EcalTBTDCRecInfo(-999.);
59  }
60 
61  double offset = ( (double)tdcd - (double)tdcZeros_[actualRange_].tdcZero )
62  / 25.; //
63  // if (use2004OffsetConvention)
64  // offset = (1. - offset) ;
65  return EcalTBTDCRecInfo(offset);
66 }
int i
Definition: DBlmapReader.cc:9
double ttcL1Atime() const
Returns the Level 1 Accept time in ns.
Definition: HcalTBTiming.h:28
unsigned int offset(bool)
double BeamCoincidenceHits(int index) const
Returns the indexed hit time from Beam Coincidence.
Definition: HcalTBTiming.h:72
int BeamCoincidenceCount() const
Returns the number of hits from Beam Coincidence.
Definition: HcalTBTiming.h:45
std::vector< EcalTBH2TDCRanges > tdcZeros_

Member Data Documentation

int EcalTBH2TDCRecInfoAlgo::actualRange_
mutableprivate

Definition at line 34 of file EcalTBH2TDCRecInfoAlgo.h.

Referenced by reconstruct().

int EcalTBH2TDCRecInfoAlgo::actualRun_
mutableprivate

Definition at line 33 of file EcalTBH2TDCRecInfoAlgo.h.

Referenced by reconstruct().

bool EcalTBH2TDCRecInfoAlgo::tdcRangeErrorMessageAlreadyDisplayed_
mutableprivate

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().