CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DTRecHitProducer Class Reference

#include <DTRecHitProducer.h>

Inheritance diagram for DTRecHitProducer:
edm::EDProducer 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::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

const bool debug
 
DTRecHitBaseAlgotheAlgo
 
edm::InputTag theDTDigiLabel
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 23 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, reco::get(), edm::ParameterSet::getParameter(), and theAlgo.

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

Destructor.

Definition at line 49 of file DTRecHitProducer.cc.

References gather_cfg::cout, debug, and theAlgo.

49  {
50  if(debug)
51  cout << "[DTRecHitProducer] Destructor called" << endl;
52  delete theAlgo;
53 }
DTRecHitBaseAlgo * theAlgo
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

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

The method which produces the rechits.

Implements edm::EDProducer.

Definition at line 57 of file DTRecHitProducer.cc.

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

57  {
58  // Get the DT Geometry
59  ESHandle<DTGeometry> dtGeom;
60  setup.get<MuonGeometryRecord>().get(dtGeom);
61 
62  // Get the digis from the event
64  event.getByLabel(theDTDigiLabel, digis);
65 
66  // Pass the EventSetup to the algo
67  theAlgo->setES(setup);
68 
69  // Create the pointer to the collection which will store the rechits
70  auto_ptr<DTRecHitCollection> recHitCollection(new DTRecHitCollection());
71 
72 
73  // Iterate through all digi collections ordered by LayerId
75  for (dtLayerIt = digis->begin();
76  dtLayerIt != digis->end();
77  ++dtLayerIt){
78  // The layerId
79  const DTLayerId& layerId = (*dtLayerIt).first;
80  // Get the GeomDet from the setup
81  const DTLayer* layer = dtGeom->layer(layerId);
82 
83  // Get the iterators over the digis associated with this LayerId
84  const DTDigiCollection::Range& range = (*dtLayerIt).second;
85 
87  theAlgo->reconstruct(layer, layerId, range);
88 
89  if(debug)
90  cout << "Number of hits in this layer: " << recHits.size() << endl;
91  if(recHits.size() > 0) //FIXME: is it really needed?
92  recHitCollection->put(layerId, recHits.begin(), recHits.end());
93  }
94 
95  event.put(recHitCollection);
96 }
edm::RangeMap< DTLayerId, edm::OwnVector< DTRecHit1DPair > > DTRecHitCollection
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.
size_type size() const
Definition: OwnVector.h:247
iterator begin()
Definition: OwnVector.h:227
virtual void setES(const edm::EventSetup &setup)=0
Pass the Event Setup to the algo at each event.
DTRecHitBaseAlgo * theAlgo
edm::InputTag theDTDigiLabel
iterator end()
Definition: OwnVector.h:232
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:121
std::pair< const_iterator, const_iterator > Range

Member Data Documentation

const bool DTRecHitProducer::debug
private

Definition at line 36 of file DTRecHitProducer.h.

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

DTRecHitBaseAlgo* DTRecHitProducer::theAlgo
private

Definition at line 40 of file DTRecHitProducer.h.

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

edm::InputTag DTRecHitProducer::theDTDigiLabel
private

Definition at line 38 of file DTRecHitProducer.h.

Referenced by produce().