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 | Static Private Attributes
DTRecHitProducer Class Reference

#include <DTRecHitProducer.h>

Inheritance diagram for DTRecHitProducer:
edm::EDProducer edm::ProducerBase 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 ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

DTRecHitBaseAlgotheAlgo
 
edm::InputTag theDTDigiLabel
 

Static Private Attributes

static bool debug
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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.

Date:
2010/02/20 21:00:58
Revision:
1.3
Author
G. Cerminara

Definition at line 25 of file DTRecHitProducer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 35 of file DTRecHitProducer.cc.

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

35  {
36  // Set verbose output
37  debug = config.getUntrackedParameter<bool>("debug", false);
38 
39  if(debug)
40  cout << "[DTRecHitProducer] Constructor called" << endl;
41 
42  produces<DTRecHitCollection>();
43 
44  theDTDigiLabel = config.getParameter<InputTag>("dtDigiLabel");
45 
46  // Get the concrete reconstruction algo from the factory
47  string theAlgoName = config.getParameter<string>("recAlgo");
48  theAlgo = DTRecHitAlgoFactory::get()->create(theAlgoName,
49  config.getParameter<ParameterSet>("recAlgoConfig"));
50 }
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:56
DTRecHitProducer::~DTRecHitProducer ( )
virtual

Destructor.

Definition at line 52 of file DTRecHitProducer.cc.

References gather_cfg::cout, and debug.

52  {
53  if(debug)
54  cout << "[DTRecHitProducer] Destructor called" << endl;
55  delete theAlgo;
56 }
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 60 of file DTRecHitProducer.cc.

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

60  {
61  // Get the DT Geometry
62  ESHandle<DTGeometry> dtGeom;
63  setup.get<MuonGeometryRecord>().get(dtGeom);
64 
65  // Get the digis from the event
67  event.getByLabel(theDTDigiLabel, digis);
68 
69  // Pass the EventSetup to the algo
70  theAlgo->setES(setup);
71 
72  // Create the pointer to the collection which will store the rechits
73  auto_ptr<DTRecHitCollection> recHitCollection(new DTRecHitCollection());
74 
75 
76  // Iterate through all digi collections ordered by LayerId
78  for (dtLayerIt = digis->begin();
79  dtLayerIt != digis->end();
80  ++dtLayerIt){
81  // The layerId
82  const DTLayerId& layerId = (*dtLayerIt).first;
83  // Get the GeomDet from the setup
84  const DTLayer* layer = dtGeom->layer(layerId);
85 
86  // Get the iterators over the digis associated with this LayerId
87  const DTDigiCollection::Range& range = (*dtLayerIt).second;
88 
90  theAlgo->reconstruct(layer, layerId, range);
91 
92  if(debug)
93  cout << "Number of hits in this layer: " << recHits.size() << endl;
94  if(recHits.size() > 0) //FIXME: is it really needed?
95  recHitCollection->put(layerId, recHits.begin(), recHits.end());
96  }
97 
98  event.put(recHitCollection);
99 }
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

bool DTRecHitProducer::debug
staticprivate

Definition at line 38 of file DTRecHitProducer.h.

DTRecHitBaseAlgo* DTRecHitProducer::theAlgo
private

Definition at line 42 of file DTRecHitProducer.h.

edm::InputTag DTRecHitProducer::theDTDigiLabel
private

Definition at line 40 of file DTRecHitProducer.h.