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

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 ME0RecHitProducer (const edm::ParameterSet &config)
 Constructor. More...
 
void produce (edm::Event &event, const edm::EventSetup &setup) override
 The method which produces the rechits. More...
 
 ~ME0RecHitProducer () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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
 

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

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 
)
override

Definition at line 32 of file ME0RecHitProducer.cc.

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

The method which produces the rechits.

Definition at line 37 of file ME0RecHitProducer.cc.

References edm::OwnVector< T, P >::begin(), edm::OwnVector< T, P >::empty(), edm::OwnVector< T, P >::end(), edm::EventSetup::get(), m_token, eostools::move(), ME0RecHitBaseAlgo::reconstruct(), ME0RecHitBaseAlgo::setES(), 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.empty())
75  recHitCollection->put(me0Id, recHits.begin(), recHits.end());
76  }
77 
78  event.put(std::move(recHitCollection));
79 
80 }
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
bool empty() const
Definition: OwnVector.h:269
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:59
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().