CMS 3D CMS Logo

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

#include <EcalTBHodoscopeRecInfoProducer.h>

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

Public Member Functions

 EcalTBHodoscopeRecInfoProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &e, const edm::EventSetup &es) override
 
 ~EcalTBHodoscopeRecInfoProducer () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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

EcalTBHodoscopeRecInfoAlgoalgo_
 
int fitMethod_
 
std::string rawInfoCollection_
 
std::string rawInfoProducer_
 
std::string recInfoCollection_
 

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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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 EcalTBHodoscopeRecInfoProducer.h.

Constructor & Destructor Documentation

◆ EcalTBHodoscopeRecInfoProducer()

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

Definition at line 11 of file EcalTBHodoscopeRecInfoProducer.cc.

11  {
12  rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection");
13  rawInfoProducer_ = ps.getParameter<std::string>("rawInfoProducer");
14  recInfoCollection_ = ps.getParameter<std::string>("recInfoCollection");
15  fitMethod_ = ps.getParameter<int>("fitMethod");
16 
17  // std::vector<double> planeShift_def;
18  // planeShift_def.push_back( -0.333 );
19  // planeShift_def.push_back( -0.333 );
20  // planeShift_def.push_back( -0.333 );
21  // planeShift_def.push_back( -0.333 );
22  std::vector<double> planeShift = ps.getParameter<std::vector<double> >("planeShift");
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<double> zPosition = ps.getParameter<std::vector<double> >("zPosition");
30 
31  produces<EcalTBHodoscopeRecInfo>(recInfoCollection_);
32 
34 }

References algo_, fitMethod_, edm::ParameterSet::getParameter(), ecal2004TBHodoscopeReconstructor_cfi::planeShift, rawInfoCollection_, rawInfoProducer_, recInfoCollection_, AlCaHLTBitMon_QueryRunRegistry::string, and ecal2004TBHodoscopeReconstructor_cfi::zPosition.

◆ ~EcalTBHodoscopeRecInfoProducer()

EcalTBHodoscopeRecInfoProducer::~EcalTBHodoscopeRecInfoProducer ( )
override

Definition at line 36 of file EcalTBHodoscopeRecInfoProducer.cc.

36 { delete algo_; }

References algo_.

Member Function Documentation

◆ produce()

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

Implements edm::EDProducer.

Definition at line 38 of file EcalTBHodoscopeRecInfoProducer.cc.

38  {
39  // Get input
40  edm::Handle<EcalTBHodoscopeRawInfo> ecalRawHodoscope;
41  const EcalTBHodoscopeRawInfo* ecalHodoRawInfo = nullptr;
42  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
43  e.getByLabel(rawInfoProducer_, ecalRawHodoscope);
44  if (ecalRawHodoscope.isValid()) {
45  ecalHodoRawInfo = ecalRawHodoscope.product();
46  }
47 
48  if (!ecalHodoRawInfo) {
49  edm::LogError("EcalTBHodoscopeRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str();
50  return;
51  }
52 
53  if ((*ecalHodoRawInfo).planes() != 4) {
54  edm::LogError("EcalTBHodoscopeRecInfoError")
55  << "Number of planes different from expected " << rawInfoCollection_.c_str();
56  return;
57  }
58 
59  // Create empty output
60 
61  e.put(std::make_unique<EcalTBHodoscopeRecInfo>(algo_->reconstruct(*ecalRawHodoscope)), recInfoCollection_);
62 }

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

Member Data Documentation

◆ algo_

EcalTBHodoscopeRecInfoAlgo* EcalTBHodoscopeRecInfoProducer::algo_
private

◆ fitMethod_

int EcalTBHodoscopeRecInfoProducer::fitMethod_
private

Definition at line 26 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer().

◆ rawInfoCollection_

std::string EcalTBHodoscopeRecInfoProducer::rawInfoCollection_
private

Definition at line 23 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer(), and produce().

◆ rawInfoProducer_

std::string EcalTBHodoscopeRecInfoProducer::rawInfoProducer_
private

Definition at line 22 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer(), and produce().

◆ recInfoCollection_

std::string EcalTBHodoscopeRecInfoProducer::recInfoCollection_
private

Definition at line 24 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer(), and produce().

EcalTBHodoscopeRecInfoProducer::rawInfoCollection_
std::string rawInfoCollection_
Definition: EcalTBHodoscopeRecInfoProducer.h:23
edm::Handle::product
T const * product() const
Definition: Handle.h:70
EcalTBHodoscopeRecInfoAlgo
Definition: EcalTBHodoscopeRecInfoAlgo.h:11
EcalTBHodoscopeRecInfoProducer::rawInfoProducer_
std::string rawInfoProducer_
Definition: EcalTBHodoscopeRecInfoProducer.h:22
EcalTBHodoscopeRecInfoProducer::fitMethod_
int fitMethod_
Definition: EcalTBHodoscopeRecInfoProducer.h:26
ecal2004TBHodoscopeReconstructor_cfi.planeShift
planeShift
Definition: ecal2004TBHodoscopeReconstructor_cfi.py:8
edm::Handle
Definition: AssociativeIterator.h:50
ecal2004TBHodoscopeReconstructor_cfi.zPosition
zPosition
Definition: ecal2004TBHodoscopeReconstructor_cfi.py:9
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalTBHodoscopeRawInfo
Definition: EcalTBHodoscopeRawInfo.h:13
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
EcalTBHodoscopeRecInfoAlgo::reconstruct
EcalTBHodoscopeRecInfo reconstruct(const EcalTBHodoscopeRawInfo &hodoscopeRawInfo) const
Definition: EcalTBHodoscopeRecInfoAlgo.cc:97
EcalTBHodoscopeRecInfoProducer::algo_
EcalTBHodoscopeRecInfoAlgo * algo_
Definition: EcalTBHodoscopeRecInfoProducer.h:27
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EcalTBHodoscopeRecInfoProducer::recInfoCollection_
std::string recInfoCollection_
Definition: EcalTBHodoscopeRecInfoProducer.h:24
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37