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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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 43 of file ME0RecHitProducer.h.

Constructor & Destructor Documentation

◆ ME0RecHitProducer()

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

Constructor.

Definition at line 10 of file ME0RecHitProducer.cc.

11  : // Get the concrete reconstruction algo from the factory
12  theAlgo{ME0RecHitAlgoFactory::get()->create(config.getParameter<std::string>("recAlgo"),
13  config.getParameter<edm::ParameterSet>("recAlgoConfig"))} {
14  produces<ME0RecHitCollection>();
15 
16  m_token = consumes<ME0DigiPreRecoCollection>(config.getParameter<edm::InputTag>("me0DigiLabel"));
17 }

References get, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~ME0RecHitProducer()

ME0RecHitProducer::~ME0RecHitProducer ( )
overridedefault

Destructor.

Member Function Documentation

◆ produce()

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

The method which produces the rechits.

Definition at line 21 of file ME0RecHitProducer.cc.

21  {
22  // Get the ME0 Geometry
24  setup.get<MuonGeometryRecord>().get(me0Geom);
25 
26  // Get the digis from the event
27 
29  event.getByToken(m_token, digis);
30 
31  // Pass the EventSetup to the algo
32 
33  theAlgo->setES(setup);
34 
35  // Create the pointer to the collection which will store the rechits
36 
37  auto recHitCollection = std::make_unique<ME0RecHitCollection>();
38 
39  // Iterate through all digi collections ordered by LayerId
40 
42  for (me0dgIt = digis->begin(); me0dgIt != digis->end(); ++me0dgIt) {
43  // The layerId
44  const ME0DetId& me0Id = (*me0dgIt).first;
45 
46  // Get the iterators over the digis associated with this LayerId
47  const ME0DigiPreRecoCollection::Range& range = (*me0dgIt).second;
48 
49  // Call the reconstruction algorithm
50 
51  edm::OwnVector<ME0RecHit> recHits = theAlgo->reconstruct(me0Id, range);
52 
53  if (!recHits.empty())
54  recHitCollection->put(me0Id, recHits.begin(), recHits.end());
55  }
56 
57  event.put(std::move(recHitCollection));
58 }

References get, m_token, eostools::move(), FastTimerService_cff::range, FastTrackerRecHitMaskProducer_cfi::recHits, singleTopDQM_cfi::setup, and theAlgo.

Member Data Documentation

◆ m_token

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

Definition at line 57 of file ME0RecHitProducer.h.

Referenced by produce().

◆ theAlgo

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

Definition at line 60 of file ME0RecHitProducer.h.

Referenced by produce().

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
ME0RecHitProducer::theAlgo
std::unique_ptr< ME0RecHitBaseAlgo > theAlgo
Definition: ME0RecHitProducer.h:60
edm::Handle
Definition: AssociativeIterator.h:50
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
config
Definition: config.py:1
edm::ESHandle< ME0Geometry >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
edm::ParameterSet
Definition: ParameterSet.h:36
ME0RecHitProducer::m_token
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_token
Definition: ME0RecHitProducer.h:57
ME0DetId
Definition: ME0DetId.h:16
get
#define get
eostools.move
def move(src, dest)
Definition: eostools.py:511
MuonDigiCollection::Range
std::pair< const_iterator, const_iterator > Range
Definition: MuonDigiCollection.h:95
DigiContainerIterator
Definition: MuonDigiCollection.h:30
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
edm::OwnVector
Definition: OwnVector.h:24