CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTRecSegment2DExtendedProducer Class Reference

#include <DTRecSegment2DExtendedProducer.h>

Inheritance diagram for DTRecSegment2DExtendedProducer:
edm::stream::EDProducer<>

Public Member Functions

 DTRecSegment2DExtendedProducer (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &event, const edm::EventSetup &setup) override
 The method which produces the 2D-segments. More...
 
 ~DTRecSegment2DExtendedProducer () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

bool debug
 
const edm::ESGetToken< DTGeometry, MuonGeometryRecorddtGeomToken_
 
edm::EDGetTokenT< DTRecClusterCollectionrecClusToken_
 
edm::EDGetTokenT< DTRecHitCollectionrecHits1DToken_
 
DTCombinatorialExtendedPatternRecotheAlgo
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

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

Constructor & Destructor Documentation

◆ DTRecSegment2DExtendedProducer()

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

Constructor.

Definition at line 36 of file DTRecSegment2DExtendedProducer.cc.

References gather_cfg::cout, debug, muonDTDigis_cfi::pset, recClusToken_, recHits1DToken_, and theAlgo.

38  // Set verbose output
39  debug = pset.getUntrackedParameter<bool>("debug");
40 
41  // the name of the 1D rec hits collection
42  recHits1DToken_ = consumes<DTRecHitCollection>(pset.getParameter<InputTag>("recHits1DLabel"));
43  recClusToken_ = consumes<DTRecClusterCollection>(pset.getParameter<InputTag>("recClusLabel"));
44 
45  if (debug)
46  cout << "[DTRecSegment2DExtendedProducer] Constructor called" << endl;
47 
48  produces<DTRecSegment2DCollection>();
49 
50  // Get the concrete reconstruction algo from the factory
51  theAlgo =
52  new DTCombinatorialExtendedPatternReco(pset.getParameter<ParameterSet>("Reco2DAlgoConfig"), consumesCollector());
53 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
DTCombinatorialExtendedPatternReco * theAlgo
edm::EDGetTokenT< DTRecHitCollection > recHits1DToken_
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
edm::EDGetTokenT< DTRecClusterCollection > recClusToken_

◆ ~DTRecSegment2DExtendedProducer()

DTRecSegment2DExtendedProducer::~DTRecSegment2DExtendedProducer ( )
override

Destructor.

Definition at line 56 of file DTRecSegment2DExtendedProducer.cc.

References gather_cfg::cout, debug, and theAlgo.

56  {
57  if (debug)
58  cout << "[DTRecSegment2DExtendedProducer] Destructor called" << endl;
59  delete theAlgo;
60 }
DTCombinatorialExtendedPatternReco * theAlgo

Member Function Documentation

◆ produce()

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

The method which produces the 2D-segments.

Definition at line 63 of file DTRecSegment2DExtendedProducer.cc.

References edm::OwnVector< T, P >::begin(), filterCSVwithJSON::copy, gather_cfg::cout, debug, dtGeomToken_, edm::OwnVector< T, P >::empty(), edm::OwnVector< T, P >::end(), DTRangeMapAccessor::layersBySuperLayer(), eostools::move(), isotrackApplyRegressor::range, recClusToken_, recHits1DToken_, DTCombinatorialExtendedPatternReco::reconstruct(), DTCombinatorialExtendedPatternReco::setClusters(), DTCombinatorialExtendedPatternReco::setES(), singleTopDQM_cfi::setup, edm::OwnVector< T, P >::size(), DTGeometry::superLayer(), DTLayerId::superlayerId(), and theAlgo.

63  {
64  if (debug)
65  cout << "[DTRecSegment2DExtendedProducer] produce called" << endl;
66  // Get the DT Geometry
67  const DTGeometry& dtGeom = setup.getData(dtGeomToken_);
68 
70 
71  // Get the 1D rechits from the event
73  event.getByToken(recHits1DToken_, allHits);
74 
75  // Get the 1D clusters from the event
77  event.getByToken(recClusToken_, dtClusters);
78  theAlgo->setClusters(vector<DTSLRecCluster>(dtClusters->begin(), dtClusters->end()));
79 
80  // Create the pointer to the collection which will store the rechits
81  auto segments = std::make_unique<DTRecSegment2DCollection>();
82 
83  // Iterate through all hit collections ordered by LayerId
85  DTSuperLayerId oldSlId;
86  for (dtLayerIt = allHits->id_begin(); dtLayerIt != allHits->id_end(); ++dtLayerIt) {
87  // The layerId
88  DTLayerId layerId = (*dtLayerIt);
89  const DTSuperLayerId SLId = layerId.superlayerId();
90  if (SLId == oldSlId)
91  continue; // I'm on the same SL as before
92  oldSlId = SLId;
93 
94  if (debug)
95  cout << "Reconstructing the 2D segments in " << SLId << endl;
96 
97  const DTSuperLayer* sl = dtGeom.superLayer(SLId);
98 
99  // Get all the rec hit in the same superLayer in which layerId relies
101 
102  // Fill the vector with the 1D RecHit
103  vector<DTRecHit1DPair> pairs(range.first, range.second);
104 
105  if (debug)
106  cout << "Number of 1D-RecHit pairs " << pairs.size() << endl;
107 
108  //if(debug) cout << "Start the 2D-segments Reco "<< endl;
110  if (debug) {
111  cout << "Number of Reconstructed segments: " << segs.size() << endl;
112  copy(segs.begin(), segs.end(), ostream_iterator<DTSLRecSegment2D>(cout, "\n"));
113  }
114 
115  if (!segs.empty())
116  segments->put(SLId, segs.begin(), segs.end());
117  }
118  event.put(std::move(segments));
119 }
edm::OwnVector< DTSLRecSegment2D > reconstruct(const DTSuperLayer *sl, const std::vector< DTRecHit1DPair > &hits) override
this function is called in the producer
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
edm::EDGetTokenT< DTRecHitCollection > recHits1DToken_
identifier iterator
Definition: RangeMap.h:130
iterator begin()
Definition: OwnVector.h:280
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return a DTSuperLayer given its id.
Definition: DTGeometry.cc:92
size_type size() const
Definition: OwnVector.h:300
void setES(const edm::EventSetup &setup) override
iterator end()
Definition: OwnVector.h:285
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:48
bool empty() const
Definition: OwnVector.h:305
def move(src, dest)
Definition: eostools.py:511
edm::EDGetTokenT< DTRecClusterCollection > recClusToken_

Member Data Documentation

◆ debug

bool DTRecSegment2DExtendedProducer::debug
private

◆ dtGeomToken_

const edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTRecSegment2DExtendedProducer::dtGeomToken_
private

Definition at line 58 of file DTRecSegment2DExtendedProducer.h.

Referenced by produce().

◆ recClusToken_

edm::EDGetTokenT<DTRecClusterCollection> DTRecSegment2DExtendedProducer::recClusToken_
private

Definition at line 57 of file DTRecSegment2DExtendedProducer.h.

Referenced by DTRecSegment2DExtendedProducer(), and produce().

◆ recHits1DToken_

edm::EDGetTokenT<DTRecHitCollection> DTRecSegment2DExtendedProducer::recHits1DToken_
private

Definition at line 56 of file DTRecSegment2DExtendedProducer.h.

Referenced by DTRecSegment2DExtendedProducer(), and produce().

◆ theAlgo

DTCombinatorialExtendedPatternReco* DTRecSegment2DExtendedProducer::theAlgo
private