CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
EcalTBTDCRecInfoAlgo Class Reference

#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< EcalTBTDCRangestdcRanges_
 

Detailed Description

Definition at line 10 of file EcalTBTDCRecInfoAlgo.h.

Constructor & Destructor Documentation

◆ EcalTBTDCRecInfoAlgo() [1/2]

EcalTBTDCRecInfoAlgo::EcalTBTDCRecInfoAlgo ( )
inline

Definition at line 12 of file EcalTBTDCRecInfoAlgo.h.

◆ EcalTBTDCRecInfoAlgo() [2/2]

EcalTBTDCRecInfoAlgo::EcalTBTDCRecInfoAlgo ( const std::vector< EcalTBTDCRanges > &  tdcRanges)
explicit

◆ ~EcalTBTDCRecInfoAlgo()

EcalTBTDCRecInfoAlgo::~EcalTBTDCRecInfoAlgo ( )
inline

Definition at line 22 of file EcalTBTDCRecInfoAlgo.h.

22 {};

Member Function Documentation

◆ reconstruct()

EcalTBTDCRecInfo EcalTBTDCRecInfoAlgo::reconstruct ( const EcalTBTDCRawInfo TDCRawInfo,
const EcalTBEventHeader eventHeader,
bool  use2004OffsetConvention 
) const

Definition at line 10 of file EcalTBTDCRecInfoAlgo.cc.

12  {
13  if (actualRun_ != eventHeader.runNumber()) {
14  actualRun_ = eventHeader.runNumber();
15  actualRange_ = -1;
16  for (unsigned int i = 0; i < tdcRanges_.size(); i++)
17  if (eventHeader.runNumber() <= tdcRanges_[i].runRanges.second &&
18  eventHeader.runNumber() >= tdcRanges_[i].runRanges.first)
19  actualRange_ = i;
20 
21  if (actualRange_ == -1) {
22  edm::LogError("TDCRange not found") << "TDC range not found";
23  return EcalTBTDCRecInfo(-1);
24  }
25  }
26 
27  int eventType;
28  eventType = ((eventHeader.dbEventType() == 0) ? 0 : (eventHeader.dbEventType() - 1));
29 
30  int tdcd = TDCRawInfo[0].tdcValue();
31 
34  std::cout << " ============================" << std::endl;
35  std::cout << " Event type: " << eventType << std::endl;
36  std::cout << " TDC values not correctly set Raw TDC = " << tdcd
37  << " (Min/Max = " << tdcRanges_[actualRange_].tdcMin[eventType] << "/"
38  << tdcRanges_[actualRange_].tdcMax[eventType] << std::endl;
39  std::cout << " ============================" << std::endl;
41  }
42 
43  double offset =
44  ((double)tdcd - (double)tdcRanges_[actualRange_].tdcMin[eventType]) /
47  offset = (1. - offset);
48  return EcalTBTDCRecInfo(offset);
49 }

References actualRange_, actualRun_, gather_cfg::cout, EcalTBEventHeader::dbEventType(), hcalcalib_dqm_sourceclient-live_cfg::eventType, mps_fire::i, hltrates_dqm_sourceclient-live_cfg::offset, EcalTBEventHeader::runNumber(), Ecal2004TBTDCRanges_cff::tdcMax, Ecal2004TBTDCRanges_cff::tdcMin, tdcRangeErrorMessageAlreadyDisplayed_, tdcRanges_, and ecal2004TBWeightUncalibRecHit_cfi::use2004OffsetConvention.

Referenced by EcalTBTDCRecInfoProducer::produce().

Member Data Documentation

◆ actualRange_

int EcalTBTDCRecInfoAlgo::actualRange_
mutableprivate

Definition at line 32 of file EcalTBTDCRecInfoAlgo.h.

Referenced by reconstruct().

◆ actualRun_

int EcalTBTDCRecInfoAlgo::actualRun_
mutableprivate

Definition at line 31 of file EcalTBTDCRecInfoAlgo.h.

Referenced by reconstruct().

◆ tdcRangeErrorMessageAlreadyDisplayed_

bool EcalTBTDCRecInfoAlgo::tdcRangeErrorMessageAlreadyDisplayed_
mutableprivate

Definition at line 30 of file EcalTBTDCRecInfoAlgo.h.

Referenced by reconstruct().

◆ tdcRanges_

std::vector<EcalTBTDCRanges> EcalTBTDCRecInfoAlgo::tdcRanges_
private

Definition at line 29 of file EcalTBTDCRecInfoAlgo.h.

Referenced by reconstruct().

mps_fire.i
i
Definition: mps_fire.py:428
EcalTBTDCRecInfoAlgo::tdcRangeErrorMessageAlreadyDisplayed_
bool tdcRangeErrorMessageAlreadyDisplayed_
Definition: EcalTBTDCRecInfoAlgo.h:30
Ecal2004TBTDCRanges_v1_cff.tdcRanges
tdcRanges
Definition: Ecal2004TBTDCRanges_v1_cff.py:3
gather_cfg.cout
cout
Definition: gather_cfg.py:144
Ecal2004TBTDCRanges_cff.tdcMin
tdcMin
Definition: Ecal2004TBTDCRanges_cff.py:3
EcalTBEventHeader::runNumber
int runNumber() const
Definition: EcalTBEventHeader.h:37
EcalTBTDCRecInfoAlgo::tdcRanges_
std::vector< EcalTBTDCRanges > tdcRanges_
Definition: EcalTBTDCRecInfoAlgo.h:29
Ecal2004TBTDCRanges_cff.tdcMax
tdcMax
Definition: Ecal2004TBTDCRanges_cff.py:4
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
hcalcalib_dqm_sourceclient-live_cfg.eventType
eventType
Definition: hcalcalib_dqm_sourceclient-live_cfg.py:197
EcalTBEventHeader::dbEventType
int dbEventType() const
Returns the event type as in the H4ROOTDB.
Definition: EcalTBEventHeader.cc:53
ecal2004TBWeightUncalibRecHit_cfi.use2004OffsetConvention
use2004OffsetConvention
Definition: ecal2004TBWeightUncalibRecHit_cfi.py:4
EcalTBTDCRecInfo
Definition: EcalTBTDCRecInfo.h:12
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
EcalTBTDCRecInfoAlgo::actualRun_
int actualRun_
Definition: EcalTBTDCRecInfoAlgo.h:31
EcalTBTDCRecInfoAlgo::actualRange_
int actualRange_
Definition: EcalTBTDCRecInfoAlgo.h:32