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

#include <DTRecSegment2DExtendedProducer.h>

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

Public Member Functions

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

Producer for DT segment in one projection.

Date:
2010/02/16 17:08:17
Revision:
1.2
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 DTRecSegment2DExtendedProducer.h.

Constructor & Destructor Documentation

DTRecSegment2DExtendedProducer::DTRecSegment2DExtendedProducer ( const edm::ParameterSet pset)

Constructor.

Definition at line 38 of file DTRecSegment2DExtendedProducer.cc.

References gather_cfg::cout, debug, 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  theRecClusLabel = pset.getParameter<InputTag>("recClusLabel");
45 
46  if(debug)
47  cout << "[DTRecSegment2DExtendedProducer] Constructor called" << endl;
48 
49  produces<DTRecSegment2DCollection>();
50 
51  // Get the concrete reconstruction algo from the factory
53 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTCombinatorialExtendedPatternReco * theAlgo
tuple cout
Definition: gather_cfg.py:121
DTRecSegment2DExtendedProducer::~DTRecSegment2DExtendedProducer ( )
virtual

Destructor.

Definition at line 56 of file DTRecSegment2DExtendedProducer.cc.

References gather_cfg::cout, and debug.

56  {
57  if(debug)
58  cout << "[DTRecSegment2DExtendedProducer] Destructor called" << endl;
59  delete theAlgo;
60 }
DTCombinatorialExtendedPatternReco * theAlgo
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

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

The method which produces the 2D-segments.

Implements edm::EDProducer.

Definition at line 63 of file DTRecSegment2DExtendedProducer.cc.

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

64  {
65  if(debug)
66  cout << "[DTRecSegment2DExtendedProducer] produce called" << endl;
67  // Get the DT Geometry
68  ESHandle<DTGeometry> dtGeom;
69  setup.get<MuonGeometryRecord>().get(dtGeom);
70 
71  theAlgo->setES(setup);
72 
73  // Get the 1D rechits from the event
75  event.getByLabel(theRecHits1DLabel, allHits);
76 
77  // Get the 1D clusters from the event
79  event.getByLabel(theRecClusLabel, dtClusters);
80  theAlgo->setClusters(vector<DTSLRecCluster>(dtClusters->begin(),
81  dtClusters->end()));
82 
83  // Create the pointer to the collection which will store the rechits
84  auto_ptr<DTRecSegment2DCollection> segments(new DTRecSegment2DCollection());
85 
86  // Iterate through all hit collections ordered by LayerId
88  DTSuperLayerId oldSlId;
89  for (dtLayerIt = allHits->id_begin(); dtLayerIt != allHits->id_end(); ++dtLayerIt){
90  // The layerId
91  DTLayerId layerId = (*dtLayerIt);
92  const DTSuperLayerId SLId = layerId.superlayerId();
93  if (SLId==oldSlId) continue; // I'm on the same SL as before
94  oldSlId = SLId;
95 
96  if(debug) cout <<"Reconstructing the 2D segments in "<< SLId << endl;
97 
98  const DTSuperLayer* sl = dtGeom->superLayer(SLId);
99 
100  // Get all the rec hit in the same superLayer in which layerId relies
102  allHits->get(DTRangeMapAccessor::layersBySuperLayer(SLId));
103 
104  // Fill the vector with the 1D RecHit
105  vector<DTRecHit1DPair> pairs(range.first,range.second);
106 
107  if(debug) cout << "Number of 1D-RecHit pairs " << pairs.size() << endl;
108 
109  //if(debug) cout << "Start the 2D-segments Reco "<< endl;
111  if(debug) {
112  cout << "Number of Reconstructed segments: " << segs.size() << endl;
113  copy(segs.begin(), segs.end(),
114  ostream_iterator<DTSLRecSegment2D>(cout, "\n"));
115  }
116 
117  if (segs.size() > 0 )
118  segments->put(SLId, segs.begin(),segs.end());
119  }
120  event.put(segments);
121 }
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.
DTCombinatorialExtendedPatternReco * theAlgo
virtual edm::OwnVector< DTSLRecSegment2D > reconstruct(const DTSuperLayer *sl, const std::vector< DTRecHit1DPair > &hits)
this function is called in the producer
size_type size() const
Definition: OwnVector.h:247
identifier iterator
Definition: RangeMap.h:138
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:61
virtual void setES(const edm::EventSetup &setup)
edm::RangeMap< DTSuperLayerId, edm::OwnVector< DTSLRecSegment2D > > DTRecSegment2DCollection
iterator begin()
Definition: OwnVector.h:227
void setClusters(std::vector< DTSLRecCluster > clusters)
iterator end()
Definition: OwnVector.h:232
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

bool DTRecSegment2DExtendedProducer::debug
private

Definition at line 52 of file DTRecSegment2DExtendedProducer.h.

DTCombinatorialExtendedPatternReco* DTRecSegment2DExtendedProducer::theAlgo
private

Definition at line 55 of file DTRecSegment2DExtendedProducer.h.

edm::InputTag DTRecSegment2DExtendedProducer::theRecClusLabel
private

Definition at line 59 of file DTRecSegment2DExtendedProducer.h.

edm::InputTag DTRecSegment2DExtendedProducer::theRecHits1DLabel
private

Definition at line 58 of file DTRecSegment2DExtendedProducer.h.