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

 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
 
std::unique_ptr< 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 ~ME0RecHitProducer().

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

Destructor.

Referenced by ME0RecHitProducer().

Member Function Documentation

void ME0RecHitProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

The method which produces the rechits.

Definition at line 23 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(), and theAlgo.

23  {
24 
25  // Get the ME0 Geometry
27  setup.get<MuonGeometryRecord>().get(me0Geom);
28 
29  // Get the digis from the event
30 
32  event.getByToken(m_token,digis);
33 
34  // Pass the EventSetup to the algo
35 
36  theAlgo->setES(setup);
37 
38  // Create the pointer to the collection which will store the rechits
39 
40  auto recHitCollection = std::make_unique<ME0RecHitCollection>();
41 
42  // Iterate through all digi collections ordered by LayerId
43 
45  for (me0dgIt = digis->begin(); me0dgIt != digis->end();
46  ++me0dgIt){
47 
48  // The layerId
49  const ME0DetId& me0Id = (*me0dgIt).first;
50 
51 
52  // Get the iterators over the digis associated with this LayerId
53  const ME0DigiPreRecoCollection::Range& range = (*me0dgIt).second;
54 
55  // Call the reconstruction algorithm
56 
58  theAlgo->reconstruct(me0Id, range);
59 
60  if(!recHits.empty())
61  recHitCollection->put(me0Id, recHits.begin(), recHits.end());
62  }
63 
64  event.put(std::move(recHitCollection));
65 
66 }
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_token
iterator begin()
Definition: OwnVector.h:244
std::unique_ptr< ME0RecHitBaseAlgo > theAlgo
bool empty() const
Definition: OwnVector.h:269
iterator end()
Definition: OwnVector.h:249
T get() const
Definition: EventSetup.h:71
std::pair< const_iterator, const_iterator > Range
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 60 of file ME0RecHitProducer.h.

Referenced by ME0RecHitProducer(), and produce().

std::unique_ptr<ME0RecHitBaseAlgo> ME0RecHitProducer::theAlgo
private

Definition at line 63 of file ME0RecHitProducer.h.

Referenced by produce().