CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::EDGetTokenT
< ME0DigiPreRecoCollection
m_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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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

Reimplemented from edm::stream::EDProducerBase.

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.

Implements edm::stream::EDProducerBase.

Definition at line 37 of file ME0RecHitProducer.cc.

References edm::OwnVector< T, P >::begin(), edm::OwnVector< T, P >::end(), edm::EventSetup::get(), m_token, HLT_25ns14e33_v3_cff::recHits, 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  std::auto_ptr<ME0RecHitCollection> recHitCollection(new 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(recHitCollection);
79 
80 }
edm::RangeMap< ME0DetId, edm::OwnVector< ME0RecHit, edm::ClonePolicy< ME0RecHit > >, edm::ClonePolicy< ME0RecHit > > ME0RecHitCollection
size_type size() const
Definition: OwnVector.h:254
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:234
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:239
const T & get() const
Definition: EventSetup.h:56
std::pair< const_iterator, const_iterator > Range

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