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.

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

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 }
std::vector< EcalTBTDCRanges > tdcRanges_
Log< level::Error, false > LogError
int dbEventType() const
Returns the event type as in the H4ROOTDB.

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