CMS 3D CMS Logo

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

#include <ME0RecHitProducer.h>

Inheritance diagram for ME0RecHitProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 ME0RecHitProducer (const edm::ParameterSet &config)
 Constructor. More...
 
virtual void produce (edm::Event &event, const edm::EventSetup &setup) override
 The method which produces the rechits. More...
 
virtual ~ME0RecHitProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::EDGetTokenT< ME0DigiPreRecoCollectionm_token
 
ME0RecHitBaseAlgotheAlgo
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Module for ME0RecHit production.

Date
2014/02/04 10:53:23
Revision
1.1
Author
M. Maggim – INFN Bari

Definition at line 44 of file ME0RecHitProducer.h.

Constructor & Destructor Documentation

ME0RecHitProducer::ME0RecHitProducer ( const edm::ParameterSet config)

Constructor.

Definition at line 11 of file ME0RecHitProducer.cc.

References reco::get(), edm::ParameterSet::getParameter(), m_token, AlCaHLTBitMon_QueryRunRegistry::string, and theAlgo.

11  {
12 
13  produces<ME0RecHitCollection>();
14 
15  m_token = consumes<ME0DigiPreRecoCollection>( config.getParameter<edm::InputTag>("me0DigiLabel") );
16 
17 
18  // Get the concrete reconstruction algo from the factory
19 
20  std::string theAlgoName = config.getParameter<std::string>("recAlgo");
21  theAlgo = ME0RecHitAlgoFactory::get()->create(theAlgoName,
22  config.getParameter<edm::ParameterSet>("recAlgoConfig"));
23 }
T getParameter(std::string const &) const
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_token
ME0RecHitBaseAlgo * theAlgo
T get(const Candidate &c)
Definition: component.h:55
ME0RecHitProducer::~ME0RecHitProducer ( )
virtual

Destructor.

Definition at line 26 of file ME0RecHitProducer.cc.

References theAlgo.

26  {
27  delete theAlgo;
28 }
ME0RecHitBaseAlgo * theAlgo

Member Function Documentation

void ME0RecHitProducer::beginRun ( const edm::Run r,
const edm::EventSetup setup 
)
overridevirtual

Definition at line 32 of file ME0RecHitProducer.cc.

32  {
33 }
void ME0RecHitProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

The method which produces the rechits.

Definition at line 37 of file ME0RecHitProducer.cc.

References edm::OwnVector< T, P >::begin(), edm::OwnVector< T, P >::end(), edm::EventSetup::get(), m_token, eostools::move(), ME0RecHitBaseAlgo::reconstruct(), ME0RecHitBaseAlgo::setES(), edm::OwnVector< T, P >::size(), and theAlgo.

37  {
38 
39  // Get the ME0 Geometry
41  setup.get<MuonGeometryRecord>().get(me0Geom);
42 
43  // Get the digis from the event
44 
46  event.getByToken(m_token,digis);
47 
48  // Pass the EventSetup to the algo
49 
50  theAlgo->setES(setup);
51 
52  // Create the pointer to the collection which will store the rechits
53 
54  auto recHitCollection = std::make_unique<ME0RecHitCollection>();
55 
56  // Iterate through all digi collections ordered by LayerId
57 
59  for (me0dgIt = digis->begin(); me0dgIt != digis->end();
60  ++me0dgIt){
61 
62  // The layerId
63  const ME0DetId& me0Id = (*me0dgIt).first;
64 
65 
66  // Get the iterators over the digis associated with this LayerId
67  const ME0DigiPreRecoCollection::Range& range = (*me0dgIt).second;
68 
69  // Call the reconstruction algorithm
70 
72  theAlgo->reconstruct(me0Id, range);
73 
74  if(recHits.size() > 0)
75  recHitCollection->put(me0Id, recHits.begin(), recHits.end());
76  }
77 
78  event.put(std::move(recHitCollection));
79 
80 }
size_type size() const
Definition: OwnVector.h:264
virtual void setES(const edm::EventSetup &setup)=0
Pass the Event Setup to the algo at each event.
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_token
iterator begin()
Definition: OwnVector.h:244
ME0RecHitBaseAlgo * theAlgo
virtual edm::OwnVector< ME0RecHit > reconstruct(const ME0DetId &me0Id, const ME0DigiPreRecoCollection::Range &digiRange)
Build all hits in the range associated to the me0Id, at the 1st step.
iterator end()
Definition: OwnVector.h:249
const T & get() const
Definition: EventSetup.h:56
std::pair< const_iterator, const_iterator > Range
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::EDGetTokenT<ME0DigiPreRecoCollection> ME0RecHitProducer::m_token
private

Definition at line 63 of file ME0RecHitProducer.h.

Referenced by ME0RecHitProducer(), and produce().

ME0RecHitBaseAlgo* ME0RecHitProducer::theAlgo
private

Definition at line 66 of file ME0RecHitProducer.h.

Referenced by ME0RecHitProducer(), produce(), and ~ME0RecHitProducer().