CMS 3D CMS Logo

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

#include <DTRecSegment2DProducer.h>

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

Public Member Functions

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

Private Attributes

bool debug
 
edm::EDGetTokenT< DTRecHitCollectionrecHits1DToken_
 
std::unique_ptr< DTRecSegment2DBaseAlgotheAlgo
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 31 of file DTRecSegment2DProducer.h.

Constructor & Destructor Documentation

◆ DTRecSegment2DProducer()

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

Constructor.

Definition at line 36 of file DTRecSegment2DProducer.cc.

37  : theAlgo{DTRecSegment2DAlgoFactory::get()->create(pset.getParameter<string>("Reco2DAlgoName"),
38  pset.getParameter<ParameterSet>("Reco2DAlgoConfig"))} {
39  // Set verbose output
40  debug = pset.getUntrackedParameter<bool>("debug");
41 
42  // the name of the 1D rec hits collection
43  recHits1DToken_ = consumes<DTRecHitCollection>(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  if (debug)
52  cout << "the Reco2D AlgoName is " << pset.getParameter<string>("Reco2DAlgoName") << endl;
53 }

References get, and muonDTDigis_cfi::pset.

◆ ~DTRecSegment2DProducer()

DTRecSegment2DProducer::~DTRecSegment2DProducer ( )
override

Destructor.

Definition at line 56 of file DTRecSegment2DProducer.cc.

56  {
57  if (debug)
58  cout << "[DTRecSegment2DProducer] Destructor called" << endl;
59 }

References gather_cfg::cout, and debug.

Member Function Documentation

◆ produce()

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

The method which produces the 2D-segments.

Definition at line 62 of file DTRecSegment2DProducer.cc.

62  {
63  if (debug)
64  cout << "[DTRecSegment2DProducer] 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.getByToken(recHits1DToken_, allHits);
74 
75  // Create the pointer to the collection which will store the rechits
76  auto segments = std::make_unique<DTRecSegment2DCollection>();
77 
78  // Iterate through all hit collections ordered by LayerId
80  DTSuperLayerId oldSlId;
81  for (dtLayerIt = allHits->id_begin(); dtLayerIt != allHits->id_end(); ++dtLayerIt) {
82  // The layerId
83  DTLayerId layerId = (*dtLayerIt);
84  const DTSuperLayerId SLId = layerId.superlayerId();
85  if (SLId == oldSlId)
86  continue; // I'm on the same SL as before
87  oldSlId = SLId;
88 
89  if (debug)
90  cout << "Reconstructing the 2D segments in " << SLId << endl;
91 
92  const DTSuperLayer* sl = dtGeom->superLayer(SLId);
93 
94  // Get all the rec hit in the same superLayer in which layerId relies
96 
97  // Fill the vector with the 1D RecHit
98  vector<DTRecHit1DPair> pairs(range.first, range.second);
99 
100  if (debug)
101  cout << "Number of 1D-RecHit pairs " << pairs.size() << endl;
102 
103  if (debug)
104  cout << "Start the 2D-segments Reco " << endl;
105  OwnVector<DTSLRecSegment2D> segs = theAlgo->reconstruct(sl, pairs);
106  if (debug)
107  cout << "Number of Reconstructed segments: " << segs.size() << endl;
108 
109  if (!segs.empty())
110  segments->put(SLId, segs.begin(), segs.end());
111  }
112  event.put(std::move(segments));
113 }

References edm::OwnVector< T, P >::begin(), gather_cfg::cout, debug, edm::OwnVector< T, P >::empty(), edm::OwnVector< T, P >::end(), get, DTRangeMapAccessor::layersBySuperLayer(), eostools::move(), FastTimerService_cff::range, recHits1DToken_, singleTopDQM_cfi::setup, edm::OwnVector< T, P >::size(), DTGeometry::superLayer(), DTLayerId::superlayerId(), and theAlgo.

Member Data Documentation

◆ debug

bool DTRecSegment2DProducer::debug
private

◆ recHits1DToken_

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

Definition at line 53 of file DTRecSegment2DProducer.h.

Referenced by produce().

◆ theAlgo

std::unique_ptr<DTRecSegment2DBaseAlgo> DTRecSegment2DProducer::theAlgo
private

Definition at line 50 of file DTRecSegment2DProducer.h.

Referenced by produce().

DTSuperLayerId
Definition: DTSuperLayerId.h:12
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
edm::OwnVector::end
iterator end()
Definition: OwnVector.h:285
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTSuperLayer
Definition: DTSuperLayer.h:24
edm::Handle< DTRecHitCollection >
edm::RangeMap::id_iterator
identifier iterator
Definition: RangeMap.h:130
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
edm::OwnVector::empty
bool empty() const
Definition: OwnVector.h:305
DTRecSegment2DProducer::recHits1DToken_
edm::EDGetTokenT< DTRecHitCollection > recHits1DToken_
Definition: DTRecSegment2DProducer.h:53
edm::ESHandle< DTGeometry >
DTLayerId
Definition: DTLayerId.h:12
edm::ParameterSet
Definition: ParameterSet.h:36
DTRangeMapAccessor::layersBySuperLayer
static std::pair< DTLayerId, DTSuperLayerIdComparator > layersBySuperLayer(DTSuperLayerId slId)
Access by SL objects written into a RangeMap by layer.
Definition: DTRangeMapAccessor.cc:15
DTRecSegment2DProducer::debug
bool debug
Definition: DTRecSegment2DProducer.h:47
get
#define get
edm::RangeMap::range
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
eostools.move
def move(src, dest)
Definition: eostools.py:511
DTLayerId::superlayerId
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:45
DTRecSegment2DProducer::theAlgo
std::unique_ptr< DTRecSegment2DBaseAlgo > theAlgo
Definition: DTRecSegment2DProducer.h:50
DTGeometry::superLayer
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return a DTSuperLayer given its id.
Definition: DTGeometry.cc:92
edm::OwnVector::begin
iterator begin()
Definition: OwnVector.h:280
edm::OwnVector::size
size_type size() const
Definition: OwnVector.h:300
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::OwnVector
Definition: OwnVector.h:24