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 ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 15 of file EcalTBH2TDCRecInfoProducer.h.

Constructor & Destructor Documentation

◆ EcalTBH2TDCRecInfoProducer()

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

Definition at line 12 of file EcalTBH2TDCRecInfoProducer.cc.

12  {
13  rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection");
14  rawInfoProducer_ = ps.getParameter<std::string>("rawInfoProducer");
15  triggerDataCollection_ = ps.getParameter<std::string>("triggerDataCollection");
16  triggerDataProducer_ = ps.getParameter<std::string>("triggerDataProducer");
17  recInfoCollection_ = ps.getParameter<std::string>("recInfoCollection");
18 
19  std::vector<EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRanges> tdcRanges;
20 
21  typedef std::vector<edm::ParameterSet> Parameters;
22  Parameters ranges = ps.getParameter<Parameters>("tdcZeros");
23  for (Parameters::iterator itRanges = ranges.begin(); itRanges != ranges.end(); ++itRanges) {
25  aRange.runRanges.first = itRanges->getParameter<int>("startRun");
26  aRange.runRanges.second = itRanges->getParameter<int>("endRun");
27  aRange.tdcZero = itRanges->getParameter<double>("tdcZero");
28  tdcRanges.push_back(aRange);
29  }
30 
31  produces<EcalTBTDCRecInfo>(recInfoCollection_);
32 
34 }

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_.

◆ ~EcalTBH2TDCRecInfoProducer()

EcalTBH2TDCRecInfoProducer::~EcalTBH2TDCRecInfoProducer ( )
override

Definition at line 36 of file EcalTBH2TDCRecInfoProducer.cc.

36  {
37  if (algo_)
38  delete algo_;
39 }

References algo_.

Member Function Documentation

◆ produce()

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

Implements edm::EDProducer.

Definition at line 41 of file EcalTBH2TDCRecInfoProducer.cc.

41  {
42  int runNumber = e.id().run();
43  // Get input
44  edm::Handle<HcalTBTiming> ecalRawTDC;
45  const HcalTBTiming* ecalTDCRawInfo = nullptr;
46 
47  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
48  e.getByLabel(rawInfoProducer_, ecalRawTDC);
49  if (ecalRawTDC.isValid()) {
50  ecalTDCRawInfo = ecalRawTDC.product();
51  }
52 
53  if (!ecalTDCRawInfo) {
54  edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str();
55  return;
56  }
57 
58  // Get input
60  const HcalTBTriggerData* h2TriggerData = nullptr;
61  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
62  e.getByLabel(triggerDataProducer_, triggerData);
63  if (triggerData.isValid()) {
64  h2TriggerData = triggerData.product();
65  }
66 
67  if (!h2TriggerData) {
68  edm::LogError("EcalTBTDCRecInfoError") << "Error! can't get the product " << triggerDataCollection_.c_str();
69  return;
70  }
71 
72  if (!h2TriggerData->wasBeamTrigger()) {
73  e.put(std::make_unique<EcalTBTDCRecInfo>(0.5), recInfoCollection_);
74  } else {
75  e.put(std::make_unique<EcalTBTDCRecInfo>(algo_->reconstruct(runNumber, *ecalRawTDC)), recInfoCollection_);
76  }
77 }

References algo_, MillePedeFileConverter_cfg::e, edm::HandleBase::isValid(), edm::Handle< T >::product(), rawInfoCollection_, rawInfoProducer_, recInfoCollection_, EcalTBH2TDCRecInfoAlgo::reconstruct(), convertSQLiteXML::runNumber, triggerDataCollection_, triggerDataProducer_, and HcalTBTriggerData::wasBeamTrigger().

Member Data Documentation

◆ algo_

EcalTBH2TDCRecInfoAlgo* EcalTBH2TDCRecInfoProducer::algo_
private

◆ rawInfoCollection_

std::string EcalTBH2TDCRecInfoProducer::rawInfoCollection_
private

Definition at line 23 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

◆ rawInfoProducer_

std::string EcalTBH2TDCRecInfoProducer::rawInfoProducer_
private

Definition at line 22 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

◆ recInfoCollection_

std::string EcalTBH2TDCRecInfoProducer::recInfoCollection_
private

Definition at line 26 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

◆ triggerDataCollection_

std::string EcalTBH2TDCRecInfoProducer::triggerDataCollection_
private

Definition at line 25 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

◆ triggerDataProducer_

std::string EcalTBH2TDCRecInfoProducer::triggerDataProducer_
private

Definition at line 24 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

diffTwoXMLs.ranges
string ranges
Definition: diffTwoXMLs.py:79
EcalTBH2TDCRecInfoAlgo
Definition: EcalTBH2TDCRecInfoAlgo.h:10
edm::Handle::product
T const * product() const
Definition: Handle.h:70
Ecal2004TBTDCRanges_v1_cff.tdcRanges
tdcRanges
Definition: Ecal2004TBTDCRanges_v1_cff.py:3
EcalTBH2TDCRecInfoProducer::triggerDataProducer_
std::string triggerDataProducer_
Definition: EcalTBH2TDCRecInfoProducer.h:24
EcalTBH2TDCRecInfoProducer::recInfoCollection_
std::string recInfoCollection_
Definition: EcalTBH2TDCRecInfoProducer.h:26
edm::Handle
Definition: AssociativeIterator.h:50
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRanges::runRanges
std::pair< int, int > runRanges
Definition: EcalTBH2TDCRecInfoAlgo.h:15
HcalTBTiming
Definition: HcalTBTiming.h:17
EcalTBH2TDCRecInfoProducer::rawInfoProducer_
std::string rawInfoProducer_
Definition: EcalTBH2TDCRecInfoProducer.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogError
Definition: MessageLogger.h:183
HcalTBTriggerData
Definition: HcalTBTriggerData.h:17
EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRanges
Definition: EcalTBH2TDCRecInfoAlgo.h:14
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
EcalTBH2TDCRecInfoProducer::triggerDataCollection_
std::string triggerDataCollection_
Definition: EcalTBH2TDCRecInfoProducer.h:25
EcalTBH2TDCRecInfoProducer::algo_
EcalTBH2TDCRecInfoAlgo * algo_
Definition: EcalTBH2TDCRecInfoProducer.h:28
EcalTBH2TDCRecInfoAlgo::EcalTBH2TDCRanges::tdcZero
double tdcZero
Definition: EcalTBH2TDCRecInfoAlgo.h:16
EcalTBH2TDCRecInfoAlgo::reconstruct
EcalTBTDCRecInfo reconstruct(const int &runNumber, const HcalTBTiming &TDCRawInfo) const
Definition: EcalTBH2TDCRecInfoAlgo.cc:11
EcalTBH2TDCRecInfoProducer::rawInfoCollection_
std::string rawInfoCollection_
Definition: EcalTBH2TDCRecInfoProducer.h:23
HcalTBTriggerData::wasBeamTrigger
bool wasBeamTrigger() const
returns true if this trigger came from beam data
Definition: HcalTBTriggerData.h:73
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
Parameters
vector< ParameterSet > Parameters
Definition: HLTMuonPlotter.cc:25
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37