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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTRecHitProducer (const edm::ParameterSet &)
 Constructor. More...
 
virtual void produce (edm::Event &event, const edm::EventSetup &setup)
 The method which produces the rechits. More...
 
virtual ~DTRecHitProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

const bool debug
 
edm::EDGetTokenT< DTDigiCollectionDTDigiToken_
 
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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 ( const edm::ParameterSet config)

Constructor.

Definition at line 33 of file DTRecHitProducer.cc.

References gather_cfg::cout, debug, DTDigiToken_, reco::get(), edm::ParameterSet::getParameter(), and theAlgo.

33  :
34  // Set verbose output
35  debug(config.getUntrackedParameter<bool>("debug", false))
36 {
37  if(debug)
38  cout << "[DTRecHitProducer] Constructor called" << endl;
39 
40  produces<DTRecHitCollection>();
41 
42  DTDigiToken_ = consumes<DTDigiCollection>(config.getParameter<InputTag>("dtDigiLabel"));
43 
44  // Get the concrete reconstruction algo from the factory
45  string theAlgoName = config.getParameter<string>("recAlgo");
46  theAlgo = DTRecHitAlgoFactory::get()->create(theAlgoName,
47  config.getParameter<ParameterSet>("recAlgoConfig"));
48 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTDigiCollection > DTDigiToken_
DTRecHitBaseAlgo * theAlgo
T get(const Candidate &c)
Definition: component.h:55
DTRecHitProducer::~DTRecHitProducer ( )
virtual

Destructor.

Definition at line 50 of file DTRecHitProducer.cc.

References gather_cfg::cout, debug, and theAlgo.

50  {
51  if(debug)
52  cout << "[DTRecHitProducer] Destructor called" << endl;
53  delete theAlgo;
54 }
DTRecHitBaseAlgo * theAlgo

Member Function Documentation

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

The method which produces the rechits.

Definition at line 58 of file DTRecHitProducer.cc.

References edm::OwnVector< T, P >::begin(), gather_cfg::cout, debug, DTDigiToken_, edm::OwnVector< T, P >::end(), edm::EventSetup::get(), DTGeometry::layer(), eostools::move(), DTRecHitBaseAlgo::reconstruct(), DTRecHitBaseAlgo::setES(), edm::OwnVector< T, P >::size(), and theAlgo.

58  {
59  // Get the DT Geometry
60  ESHandle<DTGeometry> dtGeom;
61  setup.get<MuonGeometryRecord>().get(dtGeom);
62 
63  // Get the digis from the event
65  event.getByToken(DTDigiToken_, digis);
66 
67  // Pass the EventSetup to the algo
68  theAlgo->setES(setup);
69 
70  // Create the pointer to the collection which will store the rechits
71  auto recHitCollection = std::make_unique<DTRecHitCollection>();
72 
73 
74  // Iterate through all digi collections ordered by LayerId
76  for (dtLayerIt = digis->begin();
77  dtLayerIt != digis->end();
78  ++dtLayerIt){
79  // The layerId
80  const DTLayerId& layerId = (*dtLayerIt).first;
81  // Get the GeomDet from the setup
82  const DTLayer* layer = dtGeom->layer(layerId);
83 
84  // Get the iterators over the digis associated with this LayerId
85  const DTDigiCollection::Range& range = (*dtLayerIt).second;
86 
88  theAlgo->reconstruct(layer, layerId, range);
89 
90  if(debug)
91  cout << "Number of hits in this layer: " << recHits.size() << endl;
92  if(recHits.size() > 0) //FIXME: is it really needed?
93  recHitCollection->put(layerId, recHits.begin(), recHits.end());
94  }
95 
96  event.put(std::move(recHitCollection));
97 }
virtual edm::OwnVector< DTRecHit1DPair > reconstruct(const DTLayer *layer, const DTLayerId &layerId, const DTDigiCollection::Range &digiRange)
Build all hits in the range associated to the layerId, at the 1st step.
edm::EDGetTokenT< DTDigiCollection > DTDigiToken_
size_type size() const
Definition: OwnVector.h:264
iterator begin()
Definition: OwnVector.h:244
const DTLayer * layer(DTLayerId id) const
Return a layer given its id.
Definition: DTGeometry.cc:110
virtual void setES(const edm::EventSetup &setup)=0
Pass the Event Setup to the algo at each event.
DTRecHitBaseAlgo * theAlgo
iterator end()
Definition: OwnVector.h:249
const T & get() const
Definition: EventSetup.h:56
std::pair< const_iterator, const_iterator > Range
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

const bool DTRecHitProducer::debug
private

Definition at line 37 of file DTRecHitProducer.h.

Referenced by DTRecHitProducer(), produce(), and ~DTRecHitProducer().

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

Definition at line 39 of file DTRecHitProducer.h.

Referenced by DTRecHitProducer(), and produce().

DTRecHitBaseAlgo* DTRecHitProducer::theAlgo
private

Definition at line 41 of file DTRecHitProducer.h.

Referenced by DTRecHitProducer(), produce(), and ~DTRecHitProducer().