CMS 3D CMS Logo

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

#include <EcalTBH2TDCRecInfoProducer.h>

Inheritance diagram for EcalTBH2TDCRecInfoProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 EcalTBH2TDCRecInfoProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &es) override
 
 ~EcalTBH2TDCRecInfoProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

EcalTBH2TDCRecInfoAlgoalgo_
 
std::string rawInfoCollection_
 
std::string rawInfoProducer_
 
std::string recInfoCollection_
 
std::string triggerDataCollection_
 
std::string triggerDataProducer_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 15 of file EcalTBH2TDCRecInfoProducer.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file EcalTBH2TDCRecInfoProducer.cc.

References algo_, edm::ParameterSet::getParameter(), diffTwoXMLs::ranges, rawInfoCollection_, rawInfoProducer_, recInfoCollection_, EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRanges::runRanges, AlCaHLTBitMon_QueryRunRegistry::string, Ecal2004TBTDCRanges_v1_cff::tdcRanges, EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRanges::tdcZero, triggerDataCollection_, and triggerDataProducer_.

13 {
14  rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection");
15  rawInfoProducer_ = ps.getParameter<std::string>("rawInfoProducer");
16  triggerDataCollection_ = ps.getParameter<std::string>("triggerDataCollection");
17  triggerDataProducer_ = ps.getParameter<std::string>("triggerDataProducer");
18  recInfoCollection_ = ps.getParameter<std::string>("recInfoCollection");
19 
20 
21  std::vector<EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRanges> tdcRanges;
22 
23  typedef std::vector< edm::ParameterSet > Parameters;
24  Parameters ranges=ps.getParameter<Parameters>("tdcZeros");
25  for(Parameters::iterator itRanges = ranges.begin(); itRanges != ranges.end(); ++itRanges)
26  {
28  aRange.runRanges.first = itRanges->getParameter<int>("startRun");
29  aRange.runRanges.second = itRanges->getParameter<int>("endRun");
30  aRange.tdcZero = itRanges->getParameter< double >("tdcZero");
31  tdcRanges.push_back(aRange);
32  }
33 
34  produces<EcalTBTDCRecInfo>(recInfoCollection_);
35 
36  algo_ = new EcalTBH2TDCRecInfoAlgo(tdcRanges);
37 }
T getParameter(std::string const &) const
vector< ParameterSet > Parameters
string ranges
Definition: diffTwoXMLs.py:78
EcalTBH2TDCRecInfoProducer::~EcalTBH2TDCRecInfoProducer ( )
override

Definition at line 39 of file EcalTBH2TDCRecInfoProducer.cc.

References algo_.

40 {
41  if (algo_)
42  delete algo_;
43 }

Member Function Documentation

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

Definition at line 45 of file EcalTBH2TDCRecInfoProducer.cc.

References algo_, edm::Event::getByLabel(), edm::EventBase::id(), edm::HandleBase::isValid(), edm::Handle< T >::product(), edm::Event::put(), rawInfoCollection_, rawInfoProducer_, recInfoCollection_, EcalTBH2TDCRecInfoAlgo::reconstruct(), edm::EventID::run(), convertSQLiteXML::runNumber, triggerDataCollection_, triggerDataProducer_, and HcalTBTriggerData::wasBeamTrigger().

46 {
47  int runNumber = e.id().run();
48  // Get input
49  edm::Handle<HcalTBTiming> ecalRawTDC;
50  const HcalTBTiming* ecalTDCRawInfo = nullptr;
51 
52  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
53  e.getByLabel( rawInfoProducer_, ecalRawTDC);
54  if (ecalRawTDC.isValid()) {
55  ecalTDCRawInfo = ecalRawTDC.product();
56  }
57 
58 
59  if (! ecalTDCRawInfo )
60  {
61  edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str() ;
62  return;
63  }
64 
65 
66  // Get input
67  edm::Handle<HcalTBTriggerData> triggerData;
68  const HcalTBTriggerData* h2TriggerData = nullptr;
69  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
70  e.getByLabel(triggerDataProducer_, triggerData);
71  if (triggerData.isValid()) {
72  h2TriggerData = triggerData.product();
73  }
74 
75  if (! h2TriggerData )
76  {
77  edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << triggerDataCollection_.c_str();
78  return;
79  }
80 
81 
82  if (!h2TriggerData->wasBeamTrigger())
83  {
84  e.put(std::make_unique<EcalTBTDCRecInfo>(0.5),recInfoCollection_);
85  }
86  else
87  {
88  e.put(std::make_unique<EcalTBTDCRecInfo>(algo_->reconstruct(runNumber,*ecalRawTDC)),recInfoCollection_);
89  }
90 
91 
92 }
RunNumber_t run() const
Definition: EventID.h:39
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
EcalTBTDCRecInfo reconstruct(const int &runNumber, const HcalTBTiming &TDCRawInfo) const
bool isValid() const
Definition: HandleBase.h:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:464
T const * product() const
Definition: Handle.h:81
edm::EventID id() const
Definition: EventBase.h:60
bool wasBeamTrigger() const
returns true if this trigger came from beam data

Member Data Documentation

EcalTBH2TDCRecInfoAlgo* EcalTBH2TDCRecInfoProducer::algo_
private
std::string EcalTBH2TDCRecInfoProducer::rawInfoCollection_
private

Definition at line 26 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

std::string EcalTBH2TDCRecInfoProducer::rawInfoProducer_
private

Definition at line 25 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

std::string EcalTBH2TDCRecInfoProducer::recInfoCollection_
private

Definition at line 29 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

std::string EcalTBH2TDCRecInfoProducer::triggerDataCollection_
private

Definition at line 28 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

std::string EcalTBH2TDCRecInfoProducer::triggerDataProducer_
private

Definition at line 27 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().