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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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_.

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 
33  algo_ = new EcalTBH2TDCRecInfoAlgo(tdcRanges);
34 }
T getParameter(std::string const &) const
vector< ParameterSet > Parameters
string ranges
Definition: diffTwoXMLs.py:79
EcalTBH2TDCRecInfoProducer::~EcalTBH2TDCRecInfoProducer ( )
override

Definition at line 36 of file EcalTBH2TDCRecInfoProducer.cc.

References algo_.

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

Member Function Documentation

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

Definition at line 41 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().

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 }
RunNumber_t run() const
Definition: EventID.h:38
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
EcalTBTDCRecInfo reconstruct(const int &runNumber, const HcalTBTiming &TDCRawInfo) const
bool isValid() const
Definition: HandleBase.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
T const * product() const
Definition: Handle.h:69
edm::EventID id() const
Definition: EventBase.h:59
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 23 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

std::string EcalTBH2TDCRecInfoProducer::rawInfoProducer_
private

Definition at line 22 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

std::string EcalTBH2TDCRecInfoProducer::recInfoCollection_
private

Definition at line 26 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

std::string EcalTBH2TDCRecInfoProducer::triggerDataCollection_
private

Definition at line 25 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().

std::string EcalTBH2TDCRecInfoProducer::triggerDataProducer_
private

Definition at line 24 of file EcalTBH2TDCRecInfoProducer.h.

Referenced by EcalTBH2TDCRecInfoProducer(), and produce().