CMS 3D CMS Logo

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

#include <EcalTBTDCRecInfoProducer.h>

Inheritance diagram for EcalTBTDCRecInfoProducer:
edm::stream::EDProducer<>

Public Member Functions

 EcalTBTDCRecInfoProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &es) override
 
 ~EcalTBTDCRecInfoProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

EcalTBTDCRecInfoAlgoalgo_
 
std::string eventHeaderCollection_
 
std::string eventHeaderProducer_
 
std::string rawInfoCollection_
 
std::string rawInfoProducer_
 
std::string recInfoCollection_
 
bool use2004OffsetConvention_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 15 of file EcalTBTDCRecInfoProducer.h.

Constructor & Destructor Documentation

◆ EcalTBTDCRecInfoProducer()

EcalTBTDCRecInfoProducer::EcalTBTDCRecInfoProducer ( const edm::ParameterSet ps)
explicit

Definition at line 11 of file EcalTBTDCRecInfoProducer.cc.

References algo_, eventHeaderCollection_, eventHeaderProducer_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), diffTwoXMLs::ranges, rawInfoCollection_, rawInfoProducer_, recInfoCollection_, EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::runRanges, AlCaHLTBitMon_QueryRunRegistry::string, EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::tdcMax, EcalTBTDCRecInfoAlgo::EcalTBTDCRanges::tdcMin, Ecal2004TBTDCRanges_v1_cff::tdcRanges, and use2004OffsetConvention_.

11  {
12  rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection");
13  rawInfoProducer_ = ps.getParameter<std::string>("rawInfoProducer");
14  eventHeaderCollection_ = ps.getParameter<std::string>("eventHeaderCollection");
15  eventHeaderProducer_ = ps.getParameter<std::string>("eventHeaderProducer");
16  recInfoCollection_ = ps.getParameter<std::string>("recInfoCollection");
17 
18  // std::vector<double> planeShift_def;
19  // planeShift_def.push_back( -0.333 );
20  // planeShift_def.push_back( -0.333 );
21  // planeShift_def.push_back( -0.333 );
22  // planeShift_def.push_back( -0.333 );
23 
24  // std::vector<double> zPosition_def;
25  // zPosition_def.push_back( -0.333 );
26  // zPosition_def.push_back( -0.333 );
27  // zPosition_def.push_back( -0.333 );
28  // zPosition_def.push_back( -0.333 );
29  std::vector<EcalTBTDCRecInfoAlgo::EcalTBTDCRanges> tdcRanges;
30 
31  typedef std::vector<edm::ParameterSet> Parameters;
32  Parameters ranges = ps.getParameter<Parameters>("tdcRanges");
33  for (Parameters::iterator itRanges = ranges.begin(); itRanges != ranges.end(); ++itRanges) {
35  aRange.runRanges.first = itRanges->getParameter<int>("startRun");
36  aRange.runRanges.second = itRanges->getParameter<int>("endRun");
37  aRange.tdcMin = itRanges->getParameter<std::vector<double> >("tdcMin");
38  aRange.tdcMax = itRanges->getParameter<std::vector<double> >("tdcMax");
39  tdcRanges.push_back(aRange);
40  }
41 
42  use2004OffsetConvention_ = ps.getUntrackedParameter<bool>("use2004OffsetConvention", false);
43 
44  produces<EcalTBTDCRecInfo>(recInfoCollection_);
45 
47 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T getUntrackedParameter(std::string const &, T const &) const
EcalTBTDCRecInfoAlgo * algo_
string ranges
Definition: diffTwoXMLs.py:79
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:32

◆ ~EcalTBTDCRecInfoProducer()

EcalTBTDCRecInfoProducer::~EcalTBTDCRecInfoProducer ( )
override

Definition at line 49 of file EcalTBTDCRecInfoProducer.cc.

References algo_.

49  {
50  if (algo_)
51  delete algo_;
52 }
EcalTBTDCRecInfoAlgo * algo_

Member Function Documentation

◆ produce()

void EcalTBTDCRecInfoProducer::produce ( edm::Event e,
const edm::EventSetup es 
)
override

Definition at line 54 of file EcalTBTDCRecInfoProducer.cc.

References algo_, MillePedeFileConverter_cfg::e, eventHeaderCollection_, eventHeaderProducer_, edm::HandleBase::isValid(), edm::Handle< T >::product(), rawInfoCollection_, rawInfoProducer_, recInfoCollection_, EcalTBTDCRecInfoAlgo::reconstruct(), and use2004OffsetConvention_.

54  {
55  // Get input
57  const EcalTBTDCRawInfo* ecalTDCRawInfo = nullptr;
58 
59  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
60  e.getByLabel(rawInfoProducer_, ecalRawTDC);
61  if (ecalRawTDC.isValid()) {
62  ecalTDCRawInfo = ecalRawTDC.product();
63  }
64 
65  if (!ecalTDCRawInfo) {
66  edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str();
67  return;
68  }
69 
70  if ((*ecalTDCRawInfo).size() < 1) {
71  edm::LogError("EcalTBTDcRecInfoError")
72  << "Less than one TDC good channel found. Aborting" << rawInfoCollection_.c_str();
73  return;
74  }
75  // Get input
76  edm::Handle<EcalTBEventHeader> tbEventHeader;
77  const EcalTBEventHeader* ecalEventHeader = nullptr;
78  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
79  e.getByLabel(eventHeaderProducer_, tbEventHeader);
80  if (tbEventHeader.isValid()) {
81  ecalEventHeader = tbEventHeader.product();
82  }
83 
84  if (!ecalEventHeader) {
85  edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << eventHeaderCollection_.c_str();
86  return;
87  }
88 
89  // Create empty output
90 
91  e.put(std::make_unique<EcalTBTDCRecInfo>(algo_->reconstruct(*ecalRawTDC, *tbEventHeader, use2004OffsetConvention_)),
93 }
T const * product() const
Definition: Handle.h:70
Log< level::Error, false > LogError
EcalTBTDCRecInfoAlgo * algo_
bool isValid() const
Definition: HandleBase.h:70
EcalTBTDCRecInfo reconstruct(const EcalTBTDCRawInfo &TDCRawInfo, const EcalTBEventHeader &eventHeader, bool use2004OffsetConvention) const

Member Data Documentation

◆ algo_

EcalTBTDCRecInfoAlgo* EcalTBTDCRecInfoProducer::algo_
private

◆ eventHeaderCollection_

std::string EcalTBTDCRecInfoProducer::eventHeaderCollection_
private

Definition at line 25 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().

◆ eventHeaderProducer_

std::string EcalTBTDCRecInfoProducer::eventHeaderProducer_
private

Definition at line 24 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().

◆ rawInfoCollection_

std::string EcalTBTDCRecInfoProducer::rawInfoCollection_
private

Definition at line 23 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().

◆ rawInfoProducer_

std::string EcalTBTDCRecInfoProducer::rawInfoProducer_
private

Definition at line 22 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().

◆ recInfoCollection_

std::string EcalTBTDCRecInfoProducer::recInfoCollection_
private

Definition at line 26 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().

◆ use2004OffsetConvention_

bool EcalTBTDCRecInfoProducer::use2004OffsetConvention_
private

Definition at line 27 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().