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
DTRecSegment2DProducer Class Reference

#include <DTRecSegment2DProducer.h>

Inheritance diagram for DTRecSegment2DProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 DTRecSegment2DProducer (const edm::ParameterSet &)
 Constructor. More...
 
virtual void produce (edm::Event &event, const edm::EventSetup &setup)
 The method which produces the 2D-segments. More...
 
virtual ~DTRecSegment2DProducer ()
 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

bool debug
 
DTRecSegment2DBaseAlgotheAlgo
 
edm::InputTag theRecHits1DLabel
 

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

Producer for DT segment in one projection.

Date:
2008/01/29 13:19:54
Revision:
1.7
Author
Stefano Lacaprara - INFN Legnaro stefa.nosp@m.no.l.nosp@m.acapr.nosp@m.ara@.nosp@m.pd.in.nosp@m.fn.i.nosp@m.t
Riccardo Bellan - INFN TO ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 33 of file DTRecSegment2DProducer.h.

Constructor & Destructor Documentation

DTRecSegment2DProducer::DTRecSegment2DProducer ( const edm::ParameterSet pset)

Constructor.

Definition at line 38 of file DTRecSegment2DProducer.cc.

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

38  {
39  // Set verbose output
40  debug = pset.getUntrackedParameter<bool>("debug");
41 
42  // the name of the 1D rec hits collection
43  theRecHits1DLabel = pset.getParameter<InputTag>("recHits1DLabel");
44 
45  if(debug)
46  cout << "[DTRecSegment2DProducer] Constructor called" << endl;
47 
48  produces<DTRecSegment2DCollection>();
49 
50  // Get the concrete reconstruction algo from the factory
51  string theAlgoName = pset.getParameter<string>("Reco2DAlgoName");
52  if(debug) cout << "the Reco2D AlgoName is " << theAlgoName << endl;
53  theAlgo = DTRecSegment2DAlgoFactory::get()->create(theAlgoName,
54  pset.getParameter<ParameterSet>("Reco2DAlgoConfig"));
55 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTRecSegment2DBaseAlgo * theAlgo
tuple cout
Definition: gather_cfg.py:41
T get(const Candidate &c)
Definition: component.h:56
DTRecSegment2DProducer::~DTRecSegment2DProducer ( )
virtual

Destructor.

Definition at line 58 of file DTRecSegment2DProducer.cc.

References gather_cfg::cout, and debug.

58  {
59  if(debug)
60  cout << "[DTRecSegment2DProducer] Destructor called" << endl;
61  delete theAlgo;
62 }
DTRecSegment2DBaseAlgo * theAlgo
tuple cout
Definition: gather_cfg.py:41

Member Function Documentation

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

The method which produces the 2D-segments.

Implements edm::EDProducer.

Definition at line 65 of file DTRecSegment2DProducer.cc.

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

66  {
67  if(debug)
68  cout << "[DTRecSegment2DProducer] produce called" << endl;
69  // Get the DT Geometry
70  ESHandle<DTGeometry> dtGeom;
71  setup.get<MuonGeometryRecord>().get(dtGeom);
72 
73  theAlgo->setES(setup);
74 
75  // Get the 1D rechits from the event
77  event.getByLabel(theRecHits1DLabel, allHits);
78 
79  // Create the pointer to the collection which will store the rechits
80  auto_ptr<DTRecSegment2DCollection> segments(new DTRecSegment2DCollection());
81 
82  // Iterate through all hit collections ordered by LayerId
84  DTSuperLayerId oldSlId;
85  for (dtLayerIt = allHits->id_begin(); dtLayerIt != allHits->id_end(); ++dtLayerIt){
86  // The layerId
87  DTLayerId layerId = (*dtLayerIt);
88  const DTSuperLayerId SLId = layerId.superlayerId();
89  if (SLId==oldSlId) continue; // I'm on the same SL as before
90  oldSlId = SLId;
91 
92  if(debug) cout <<"Reconstructing the 2D segments in "<< SLId << endl;
93 
94  const DTSuperLayer* sl = dtGeom->superLayer(SLId);
95 
96  // Get all the rec hit in the same superLayer in which layerId relies
98  allHits->get(DTRangeMapAccessor::layersBySuperLayer(SLId));
99 
100  // Fill the vector with the 1D RecHit
101  vector<DTRecHit1DPair> pairs(range.first,range.second);
102 
103  if(debug) cout << "Number of 1D-RecHit pairs " << pairs.size() << endl;
104 
105  if(debug) cout << "Start the 2D-segments Reco "<< endl;
107  if(debug) cout << "Number of Reconstructed segments: " << segs.size() << endl;
108 
109  if (segs.size() > 0 )
110  segments->put(SLId, segs.begin(),segs.end());
111  }
112  event.put(segments);
113 }
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:52
static std::pair< DTLayerId, DTSuperLayerIdComparator > layersBySuperLayer(DTSuperLayerId slId)
Access by SL objects written into a RangeMap by layer.
size_type size() const
Definition: OwnVector.h:260
identifier iterator
Definition: RangeMap.h:138
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:61
edm::RangeMap< DTSuperLayerId, edm::OwnVector< DTSLRecSegment2D > > DTRecSegment2DCollection
iterator begin()
Definition: OwnVector.h:234
virtual void setES(const edm::EventSetup &setup)=0
virtual edm::OwnVector< DTSLRecSegment2D > reconstruct(const DTSuperLayer *sl, const std::vector< DTRecHit1DPair > &hits)=0
DTRecSegment2DBaseAlgo * theAlgo
iterator end()
Definition: OwnVector.h:241
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:41

Member Data Documentation

bool DTRecSegment2DProducer::debug
private

Definition at line 52 of file DTRecSegment2DProducer.h.

DTRecSegment2DBaseAlgo* DTRecSegment2DProducer::theAlgo
private

Definition at line 55 of file DTRecSegment2DProducer.h.

edm::InputTag DTRecSegment2DProducer::theRecHits1DLabel
private

Definition at line 58 of file DTRecSegment2DProducer.h.