CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTRecHitProducer Class Reference

#include <DTRecHitProducer.h>

Inheritance diagram for DTRecHitProducer:
edm::stream::EDProducer<>

Public Member Functions

 DTRecHitProducer (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &event, const edm::EventSetup &setup) override
 The method which produces the rechits. More...
 
 ~DTRecHitProducer () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

const bool debug
 
edm::EDGetTokenT< DTDigiCollectionDTDigiToken_
 
std::unique_ptr< DTRecHitBaseAlgotheAlgo
 

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 1D DTRecHitPairs production. The concrete reconstruction algorithm is specified with the parameter "recAlgo" and must be configured with the "recAlgoConfig" parameter set.

Author
G. Cerminara

Definition at line 24 of file DTRecHitProducer.h.

Constructor & Destructor Documentation

◆ DTRecHitProducer()

DTRecHitProducer::DTRecHitProducer ( const edm::ParameterSet config)

Constructor.

Definition at line 28 of file DTRecHitProducer.cc.

29  : // Set verbose output
30  debug(config.getUntrackedParameter<bool>("debug", false)),
31  // Get the concrete reconstruction algo from the factory
32  theAlgo{DTRecHitAlgoFactory::get()->create(config.getParameter<string>("recAlgo"),
33  config.getParameter<ParameterSet>("recAlgoConfig"))} {
34  if (debug)
35  cout << "[DTRecHitProducer] Constructor called" << endl;
36 
37  produces<DTRecHitCollection>();
38 
39  DTDigiToken_ = consumes<DTDigiCollection>(config.getParameter<InputTag>("dtDigiLabel"));
40 }

References get.

◆ ~DTRecHitProducer()

DTRecHitProducer::~DTRecHitProducer ( )
override

Destructor.

Definition at line 42 of file DTRecHitProducer.cc.

42  {
43  if (debug)
44  cout << "[DTRecHitProducer] Destructor called" << endl;
45 }

References gather_cfg::cout, and debug.

Member Function Documentation

◆ produce()

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

The method which produces the rechits.

Definition at line 47 of file DTRecHitProducer.cc.

47  {
48  // Get the DT Geometry
49  ESHandle<DTGeometry> dtGeom;
50  setup.get<MuonGeometryRecord>().get(dtGeom);
51 
52  // Get the digis from the event
54  event.getByToken(DTDigiToken_, digis);
55 
56  // Pass the EventSetup to the algo
57  theAlgo->setES(setup);
58 
59  // Create the pointer to the collection which will store the rechits
60  auto recHitCollection = std::make_unique<DTRecHitCollection>();
61 
62  // Iterate through all digi collections ordered by LayerId
64  for (dtLayerIt = digis->begin(); dtLayerIt != digis->end(); ++dtLayerIt) {
65  // The layerId
66  const DTLayerId& layerId = (*dtLayerIt).first;
67  // Get the GeomDet from the setup
68  const DTLayer* layer = dtGeom->layer(layerId);
69 
70  // Get the iterators over the digis associated with this LayerId
71  const DTDigiCollection::Range& range = (*dtLayerIt).second;
72 
73  OwnVector<DTRecHit1DPair> recHits = theAlgo->reconstruct(layer, layerId, range);
74 
75  if (debug)
76  cout << "Number of hits in this layer: " << recHits.size() << endl;
77  if (!recHits.empty()) //FIXME: is it really needed?
78  recHitCollection->put(layerId, recHits.begin(), recHits.end());
79  }
80 
81  event.put(std::move(recHitCollection));
82 }

References gather_cfg::cout, debug, DTDigiToken_, get, DTGeometry::layer(), eostools::move(), FastTimerService_cff::range, FastTrackerRecHitMaskProducer_cfi::recHits, singleTopDQM_cfi::setup, and theAlgo.

Member Data Documentation

◆ debug

const bool DTRecHitProducer::debug
private

◆ DTDigiToken_

edm::EDGetTokenT<DTDigiCollection> DTRecHitProducer::DTDigiToken_
private

Definition at line 39 of file DTRecHitProducer.h.

Referenced by produce().

◆ theAlgo

std::unique_ptr<DTRecHitBaseAlgo> DTRecHitProducer::theAlgo
private

Definition at line 41 of file DTRecHitProducer.h.

Referenced by produce().

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::Handle< DTDigiCollection >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
config
Definition: config.py:1
edm::ESHandle< DTGeometry >
DTLayerId
Definition: DTLayerId.h:12
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
DTRecHitProducer::debug
const bool debug
Definition: DTRecHitProducer.h:37
DTRecHitProducer::theAlgo
std::unique_ptr< DTRecHitBaseAlgo > theAlgo
Definition: DTRecHitProducer.h:41
edm::ParameterSet
Definition: ParameterSet.h:47
DTGeometry::layer
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
get
#define get
DTLayer
Definition: DTLayer.h:25
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
DTRecHitProducer::DTDigiToken_
edm::EDGetTokenT< DTDigiCollection > DTDigiToken_
Definition: DTRecHitProducer.h:39
edm::OwnVector
Definition: OwnVector.h:24