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::EDConsumerBase 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 ()
 
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

bool debug
 
DTCombinatorialExtendedPatternRecotheAlgo
 
edm::InputTag theRecClusLabel
 
edm::InputTag theRecHits1DLabel
 

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

Producer for DT segment in one projection.

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 31 of file DTRecSegment2DExtendedProducer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 36 of file DTRecSegment2DExtendedProducer.cc.

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

36  {
37  // Set verbose output
38  debug = pset.getUntrackedParameter<bool>("debug");
39 
40  // the name of the 1D rec hits collection
41  theRecHits1DLabel = pset.getParameter<InputTag>("recHits1DLabel");
42  theRecClusLabel = pset.getParameter<InputTag>("recClusLabel");
43 
44  if(debug)
45  cout << "[DTRecSegment2DExtendedProducer] Constructor called" << endl;
46 
47  produces<DTRecSegment2DCollection>();
48 
49  // Get the concrete reconstruction algo from the factory
51 }
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 54 of file DTRecSegment2DExtendedProducer.cc.

References gather_cfg::cout, and debug.

54  {
55  if(debug)
56  cout << "[DTRecSegment2DExtendedProducer] Destructor called" << endl;
57  delete theAlgo;
58 }
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 61 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().

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

DTCombinatorialExtendedPatternReco* DTRecSegment2DExtendedProducer::theAlgo
private

Definition at line 53 of file DTRecSegment2DExtendedProducer.h.

edm::InputTag DTRecSegment2DExtendedProducer::theRecClusLabel
private

Definition at line 57 of file DTRecSegment2DExtendedProducer.h.

edm::InputTag DTRecSegment2DExtendedProducer::theRecHits1DLabel
private

Definition at line 56 of file DTRecSegment2DExtendedProducer.h.