CMS 3D CMS Logo

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() [1/2]

EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRecInfoAlgo ( )
inline

Definition at line 12 of file EcalTBH2TDCRecInfoAlgo.h.

◆ EcalTBH2TDCRecInfoAlgo() [2/2]

EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRecInfoAlgo ( const std::vector< EcalTBH2TDCRanges > &  tdcZero)
explicit

Definition at line 8 of file EcalTBH2TDCRecInfoAlgo.cc.

◆ ~EcalTBH2TDCRecInfoAlgo()

EcalTBH2TDCRecInfoAlgo::~EcalTBH2TDCRecInfoAlgo ( )
inline

Definition at line 21 of file EcalTBH2TDCRecInfoAlgo.h.

21 {};

Member Function Documentation

◆ reconstruct()

EcalTBTDCRecInfo EcalTBH2TDCRecInfoAlgo::reconstruct ( const int &  runNumber,
const HcalTBTiming TDCRawInfo 
) const

tdcRangeErrorMessageAlreadyDisplayed_ &&

Definition at line 11 of file EcalTBH2TDCRecInfoAlgo.cc.

11  {
12  if (actualRun_ != runNumber) {
14  actualRange_ = -1;
15  for (unsigned int i = 0; i < tdcZeros_.size(); i++)
16  if (runNumber <= tdcZeros_[i].runRanges.second && runNumber >= tdcZeros_[i].runRanges.first)
17  actualRange_ = i;
18 
19  if (actualRange_ == -1) {
20  edm::LogError("TDCRange not found") << "TDC range not found";
21  return EcalTBTDCRecInfo(-1);
22  }
23  }
24 
25  int ntdc = TDCRawInfo.BeamCoincidenceCount();
26  edm::LogInfo("") << "EcalTBH2TDCRecInfoAlgo::reconstruct # tdc hits: " << ntdc << std::endl;
27  ;
28  if (ntdc > 1) {
29  for (int i = 0; i < ntdc; ++i) {
30  edm::LogInfo("") << "hit i: " << i << " tdc: " << TDCRawInfo.BeamCoincidenceHits(i) << std::endl;
31  }
32  }
33 
34  if (ntdc == 0) {
35  edm::LogError("NoTDCHits") << "no TDC hits. TDC info not reliable" << std::endl;
36  return EcalTBTDCRecInfo(-999.);
37  }
38 
39  //double tdcd = TDCRawInfo.ttcL1Atime() - TDCRawInfo.beamCoincidence();
40  double tdcd = TDCRawInfo.ttcL1Atime() - TDCRawInfo.BeamCoincidenceHits(0);
41 
42  if (
43  (tdcd < tdcZeros_[actualRange_].tdcZero - 1 || tdcd > tdcZeros_[actualRange_].tdcZero + 26)) {
44  edm::LogError("TDCOutOfRange") << " ============================\n"
45  << " tdc value out of range = " << tdcd
46  << " tdcZero = " << tdcZeros_[actualRange_].tdcZero << "\n"
47  << " ============================\n"
48  << std::endl;
50  return EcalTBTDCRecInfo(-999.);
51  }
52 
53  double offset = ((double)tdcd - (double)tdcZeros_[actualRange_].tdcZero) / 25.; //
54  // if (use2004OffsetConvention)
55  // offset = (1. - offset) ;
56  return EcalTBTDCRecInfo(offset);
57 }

References actualRange_, actualRun_, HcalTBTiming::BeamCoincidenceCount(), HcalTBTiming::BeamCoincidenceHits(), mps_fire::i, hltrates_dqm_sourceclient-live_cfg::offset, convertSQLiteXML::runNumber, tdcRangeErrorMessageAlreadyDisplayed_, Ecal2006TBH2TDCRanges_v0_cff::tdcZero, tdcZeros_, and HcalTBTiming::ttcL1Atime().

Referenced by EcalTBH2TDCRecInfoProducer::produce().

Member Data Documentation

◆ actualRange_

int EcalTBH2TDCRecInfoAlgo::actualRange_
mutableprivate

Definition at line 29 of file EcalTBH2TDCRecInfoAlgo.h.

Referenced by reconstruct().

◆ actualRun_

int EcalTBH2TDCRecInfoAlgo::actualRun_
mutableprivate

Definition at line 28 of file EcalTBH2TDCRecInfoAlgo.h.

Referenced by reconstruct().

◆ tdcRangeErrorMessageAlreadyDisplayed_

bool EcalTBH2TDCRecInfoAlgo::tdcRangeErrorMessageAlreadyDisplayed_
mutableprivate

Definition at line 27 of file EcalTBH2TDCRecInfoAlgo.h.

Referenced by reconstruct().

◆ tdcZeros_

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

Definition at line 26 of file EcalTBH2TDCRecInfoAlgo.h.

Referenced by reconstruct().

mps_fire.i
i
Definition: mps_fire.py:355
EcalTBH2TDCRecInfoAlgo::tdcZeros_
std::vector< EcalTBH2TDCRanges > tdcZeros_
Definition: EcalTBH2TDCRecInfoAlgo.h:26
edm::LogInfo
Definition: MessageLogger.h:254
EcalTBH2TDCRecInfoAlgo::tdcRangeErrorMessageAlreadyDisplayed_
bool tdcRangeErrorMessageAlreadyDisplayed_
Definition: EcalTBH2TDCRecInfoAlgo.h:27
Ecal2006TBH2TDCRanges_v1_cff.tdcZeros
tdcZeros
Definition: Ecal2006TBH2TDCRanges_v1_cff.py:3
Ecal2006TBH2TDCRanges_v0_cff.tdcZero
tdcZero
Definition: Ecal2006TBH2TDCRanges_v0_cff.py:3
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
HcalTBTiming::BeamCoincidenceHits
double BeamCoincidenceHits(int index) const
Returns the indexed hit time from Beam Coincidence.
Definition: HcalTBTiming.h:71
edm::LogError
Definition: MessageLogger.h:183
EcalTBH2TDCRecInfoAlgo::actualRun_
int actualRun_
Definition: EcalTBH2TDCRecInfoAlgo.h:28
HcalTBTiming::ttcL1Atime
double ttcL1Atime() const
Returns the Level 1 Accept time in ns.
Definition: HcalTBTiming.h:27
HcalTBTiming::BeamCoincidenceCount
int BeamCoincidenceCount() const
Returns the number of hits from Beam Coincidence.
Definition: HcalTBTiming.h:44
EcalTBTDCRecInfo
Definition: EcalTBTDCRecInfo.h:12
EcalTBH2TDCRecInfoAlgo::actualRange_
int actualRange_
Definition: EcalTBH2TDCRecInfoAlgo.h:29
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82