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
 
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 () 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
 
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)
 
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 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 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 EcalTBHodoscopeRecInfoProducer.h.

Constructor & Destructor Documentation

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

Definition at line 11 of file EcalTBHodoscopeRecInfoProducer.cc.

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

12 {
13  rawInfoCollection_ = ps.getParameter<std::string>("rawInfoCollection");
14  rawInfoProducer_ = ps.getParameter<std::string>("rawInfoProducer");
15  recInfoCollection_ = ps.getParameter<std::string>("recInfoCollection");
16  fitMethod_ = ps.getParameter<int>("fitMethod");
17 
18 // std::vector<double> planeShift_def;
19 // planeShift_def.push_back( -0.333 );
20 // planeShift_def.push_back( -0.333 );
21 // planeShift_def.push_back( -0.333 );
22 // planeShift_def.push_back( -0.333 );
23  std::vector<double> planeShift = ps.getParameter< std::vector<double> >("planeShift");
24 
25 // std::vector<double> zPosition_def;
26 // zPosition_def.push_back( -0.333 );
27 // zPosition_def.push_back( -0.333 );
28 // zPosition_def.push_back( -0.333 );
29 // zPosition_def.push_back( -0.333 );
30  std::vector<double> zPosition = ps.getParameter< std::vector<double> >("zPosition");
31 
32  produces<EcalTBHodoscopeRecInfo>(recInfoCollection_);
33 
34  algo_ = new EcalTBHodoscopeRecInfoAlgo(fitMethod_, planeShift, zPosition);
35 }
T getParameter(std::string const &) const
EcalTBHodoscopeRecInfoProducer::~EcalTBHodoscopeRecInfoProducer ( )
override

Definition at line 37 of file EcalTBHodoscopeRecInfoProducer.cc.

References algo_.

37  {
38  delete algo_;
39 }

Member Function Documentation

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

Definition at line 41 of file EcalTBHodoscopeRecInfoProducer.cc.

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

42 {
43  // Get input
44  edm::Handle<EcalTBHodoscopeRawInfo> ecalRawHodoscope;
45  const EcalTBHodoscopeRawInfo* ecalHodoRawInfo = nullptr;
46  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
47  e.getByLabel( rawInfoProducer_, ecalRawHodoscope);
48  if (ecalRawHodoscope.isValid()) {
49  ecalHodoRawInfo = ecalRawHodoscope.product();
50  }
51 
52  if (! ecalHodoRawInfo )
53  {
54  edm::LogError("EcalTBHodoscopeRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str() ;
55  return;
56  }
57 
58  if ( (*ecalHodoRawInfo).planes() != 4 )
59  {
60  edm::LogError("EcalTBHodoscopeRecInfoError") << "Number of planes different from expected " << rawInfoCollection_.c_str() ;
61  return;
62  }
63 
64  // Create empty output
65 
66  e.put(std::make_unique<EcalTBHodoscopeRecInfo>(algo_->reconstruct(*ecalRawHodoscope)),recInfoCollection_);
67 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
EcalTBHodoscopeRecInfo reconstruct(const EcalTBHodoscopeRawInfo &hodoscopeRawInfo) const
bool isValid() const
Definition: HandleBase.h:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:475
T const * product() const
Definition: Handle.h:81

Member Data Documentation

EcalTBHodoscopeRecInfoAlgo* EcalTBHodoscopeRecInfoProducer::algo_
private
int EcalTBHodoscopeRecInfoProducer::fitMethod_
private

Definition at line 29 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer().

std::string EcalTBHodoscopeRecInfoProducer::rawInfoCollection_
private

Definition at line 26 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer(), and produce().

std::string EcalTBHodoscopeRecInfoProducer::rawInfoProducer_
private

Definition at line 25 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer(), and produce().

std::string EcalTBHodoscopeRecInfoProducer::recInfoCollection_
private

Definition at line 27 of file EcalTBHodoscopeRecInfoProducer.h.

Referenced by EcalTBHodoscopeRecInfoProducer(), and produce().