CMS 3D CMS Logo

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

#include <EcalTBTDCRecInfoProducer.h>

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

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::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

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::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::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 EcalTBTDCRecInfoProducer.h.

Constructor & Destructor Documentation

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

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

Definition at line 52 of file EcalTBTDCRecInfoProducer.cc.

References algo_.

52  {
53  if (algo_)
54  delete algo_;
55 }
EcalTBTDCRecInfoAlgo * algo_

Member Function Documentation

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

Definition at line 57 of file EcalTBTDCRecInfoProducer.cc.

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

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

Member Data Documentation

EcalTBTDCRecInfoAlgo* EcalTBTDCRecInfoProducer::algo_
private
std::string EcalTBTDCRecInfoProducer::eventHeaderCollection_
private

Definition at line 28 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().

std::string EcalTBTDCRecInfoProducer::eventHeaderProducer_
private

Definition at line 27 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().

std::string EcalTBTDCRecInfoProducer::rawInfoCollection_
private

Definition at line 26 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().

std::string EcalTBTDCRecInfoProducer::rawInfoProducer_
private

Definition at line 25 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().

std::string EcalTBTDCRecInfoProducer::recInfoCollection_
private

Definition at line 29 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().

bool EcalTBTDCRecInfoProducer::use2004OffsetConvention_
private

Definition at line 30 of file EcalTBTDCRecInfoProducer.h.

Referenced by EcalTBTDCRecInfoProducer(), and produce().