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

const bool debug
 
edm::EDGetTokenT
< DTDigiCollection
DTDigiToken_
 
edm::ESGetToken< DTGeometry,
MuonGeometryRecord
dtGeomToken_
 
std::unique_ptr< DTRecHitBaseAlgotheAlgo
 

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 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 26 of file DTRecHitProducer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 29 of file DTRecHitProducer.cc.

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

30  : // Set verbose output
31  debug(config.getUntrackedParameter<bool>("debug", false)),
33  // Get the concrete reconstruction algo from the factory
34  theAlgo{DTRecHitAlgoFactory::get()->create(config.getParameter<string>("recAlgo"),
35  config.getParameter<ParameterSet>("recAlgoConfig"),
36  consumesCollector())} {
37  if (debug)
38  cout << "[DTRecHitProducer] Constructor called" << endl;
39 
40  produces<DTRecHitCollection>();
41 
42  DTDigiToken_ = consumes<DTDigiCollection>(config.getParameter<InputTag>("dtDigiLabel"));
43 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTDigiCollection > DTDigiToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
tuple cout
Definition: gather_cfg.py:144
#define get
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
std::unique_ptr< DTRecHitBaseAlgo > theAlgo
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
DTRecHitProducer::~DTRecHitProducer ( )
override

Destructor.

Definition at line 45 of file DTRecHitProducer.cc.

References gather_cfg::cout, and debug.

45  {
46  if (debug)
47  cout << "[DTRecHitProducer] Destructor called" << endl;
48 }
tuple cout
Definition: gather_cfg.py:144

Member Function Documentation

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

The method which produces the rechits.

Definition at line 50 of file DTRecHitProducer.cc.

References edm::OwnVector< T, P >::begin(), gather_cfg::cout, debug, DTDigiToken_, dtGeomToken_, edm::OwnVector< T, P >::empty(), edm::OwnVector< T, P >::end(), edm::EventSetup::getData(), DTGeometry::layer(), phase1PixelTopology::layer, eostools::move(), sistrip::SpyUtilities::range(), HLT_FULL_cff::recHits, edm::OwnVector< T, P >::size(), and theAlgo.

50  {
51  // Get the DT Geometry
52  const DTGeometry& dtGeom = setup.getData(dtGeomToken_);
53 
54  // Get the digis from the event
56  event.getByToken(DTDigiToken_, digis);
57 
58  // Pass the EventSetup to the algo
59  theAlgo->setES(setup);
60 
61  // Create the pointer to the collection which will store the rechits
62  auto recHitCollection = std::make_unique<DTRecHitCollection>();
63 
64  // Iterate through all digi collections ordered by LayerId
66  for (dtLayerIt = digis->begin(); dtLayerIt != digis->end(); ++dtLayerIt) {
67  // The layerId
68  const DTLayerId& layerId = (*dtLayerIt).first;
69  // Get the GeomDet from the setup
70  const DTLayer* layer = dtGeom.layer(layerId);
71 
72  // Get the iterators over the digis associated with this LayerId
73  const DTDigiCollection::Range& range = (*dtLayerIt).second;
74 
75  OwnVector<DTRecHit1DPair> recHits = theAlgo->reconstruct(layer, layerId, range);
76 
77  if (debug)
78  cout << "Number of hits in this layer: " << recHits.size() << endl;
79  if (!recHits.empty()) //FIXME: is it really needed?
80  recHitCollection->put(layerId, recHits.begin(), recHits.end());
81  }
82 
83  event.put(std::move(recHitCollection));
84 }
edm::EDGetTokenT< DTDigiCollection > DTDigiToken_
size_type size() const
Definition: OwnVector.h:300
constexpr std::array< uint8_t, layerIndexSize > layer
const uint16_t range(const Frame &aFrame)
iterator begin()
Definition: OwnVector.h:280
bool getData(T &iHolder) const
Definition: EventSetup.h:122
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
tuple cout
Definition: gather_cfg.py:144
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
std::unique_ptr< DTRecHitBaseAlgo > theAlgo
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_

Member Data Documentation

const bool DTRecHitProducer::debug
private
edm::EDGetTokenT<DTDigiCollection> DTRecHitProducer::DTDigiToken_
private

Definition at line 41 of file DTRecHitProducer.h.

Referenced by produce().

edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTRecHitProducer::dtGeomToken_
private

Definition at line 42 of file DTRecHitProducer.h.

Referenced by produce().

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

Definition at line 44 of file DTRecHitProducer.h.

Referenced by produce().