CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

edm::ESGetToken< ME0Geometry,
MuonGeometryRecord
m_me0GeomToken
 
edm::EDGetTokenT
< ME0DigiPreRecoCollection
m_token
 
std::unique_ptr
< ME0RecHitBaseAlgo
theAlgo
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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 10 of file ME0RecHitProducer.cc.

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

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  m_me0GeomToken = esConsumes<ME0Geometry, MuonGeometryRecord>();
18 }
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > m_me0GeomToken
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_token
std::unique_ptr< ME0RecHitBaseAlgo > theAlgo
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define get
ME0RecHitProducer::~ME0RecHitProducer ( )
overridedefault

Destructor.

Member Function Documentation

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

The method which produces the rechits.

Definition at line 22 of file ME0RecHitProducer.cc.

References edm::OwnVector< T, P >::begin(), edm::OwnVector< T, P >::empty(), edm::OwnVector< T, P >::end(), edm::EventSetup::getHandle(), m_me0GeomToken, m_token, eostools::move(), sistrip::SpyUtilities::range(), HLT_FULL_cff::recHits, and theAlgo.

22  {
23  // Get the ME0 Geometry
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 }
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > m_me0GeomToken
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_token
const uint16_t range(const Frame &aFrame)
iterator begin()
Definition: OwnVector.h:280
std::unique_ptr< ME0RecHitBaseAlgo > theAlgo
bool empty() const
Definition: OwnVector.h:305
def move
Definition: eostools.py:511
iterator end()
Definition: OwnVector.h:285
std::pair< const_iterator, const_iterator > Range
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157

Member Data Documentation

edm::ESGetToken<ME0Geometry, MuonGeometryRecord> ME0RecHitProducer::m_me0GeomToken
private

Definition at line 64 of file ME0RecHitProducer.h.

Referenced by produce().

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

Definition at line 58 of file ME0RecHitProducer.h.

Referenced by produce().

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

Definition at line 61 of file ME0RecHitProducer.h.

Referenced by produce().