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
 
 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< DTRecHitCollectionrecHits1DToken_
 
std::unique_ptr< DTRecSegment2DBaseAlgotheAlgo
 

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 33 of file DTRecSegment2DProducer.h.

Constructor & Destructor Documentation

◆ DTRecSegment2DProducer()

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

Constructor.

Definition at line 36 of file DTRecSegment2DProducer.cc.

References get, and muonDTDigis_cfi::pset.

37  : theAlgo{DTRecSegment2DAlgoFactory::get()->create(pset.getParameter<string>("Reco2DAlgoName"),
38  pset.getParameter<ParameterSet>("Reco2DAlgoConfig"),
39  consumesCollector())},
41  // Set verbose output
42  debug = pset.getUntrackedParameter<bool>("debug");
43 
44  // the name of the 1D rec hits collection
45  recHits1DToken_ = consumes<DTRecHitCollection>(pset.getParameter<InputTag>("recHits1DLabel"));
46 
47  if (debug)
48  cout << "[DTRecSegment2DProducer] Constructor called" << endl;
49 
50  produces<DTRecSegment2DCollection>();
51 
52  // Get the concrete reconstruction algo from the factory
53  if (debug)
54  cout << "the Reco2D AlgoName is " << pset.getParameter<string>("Reco2DAlgoName") << endl;
55 }
edm::EDGetTokenT< DTRecHitCollection > recHits1DToken_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
std::unique_ptr< DTRecSegment2DBaseAlgo > theAlgo
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
#define get

◆ ~DTRecSegment2DProducer()

DTRecSegment2DProducer::~DTRecSegment2DProducer ( )
override

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 }

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 64 of file DTRecSegment2DProducer.cc.

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

64  {
65  if (debug)
66  cout << "[DTRecSegment2DProducer] produce called" << endl;
67  // Get the DT Geometry
68  DTGeometry const& dtGeom = setup.getData(dtGeomToken_);
69 
70  theAlgo->setES(setup);
71 
72  // Get the 1D rechits from the event
74  event.getByToken(recHits1DToken_, allHits);
75 
76  // Create the pointer to the collection which will store the rechits
77  auto segments = std::make_unique<DTRecSegment2DCollection>();
78 
79  // Iterate through all hit collections ordered by LayerId
81  DTSuperLayerId oldSlId;
82  for (dtLayerIt = allHits->id_begin(); dtLayerIt != allHits->id_end(); ++dtLayerIt) {
83  // The layerId
84  DTLayerId layerId = (*dtLayerIt);
85  const DTSuperLayerId SLId = layerId.superlayerId();
86  if (SLId == oldSlId)
87  continue; // I'm on the same SL as before
88  oldSlId = SLId;
89 
90  if (debug)
91  cout << "Reconstructing the 2D segments in " << SLId << endl;
92 
93  const DTSuperLayer* sl = dtGeom.superLayer(SLId);
94 
95  // Get all the rec hit in the same superLayer in which layerId relies
97 
98  // Fill the vector with the 1D RecHit
99  vector<DTRecHit1DPair> pairs(range.first, range.second);
100 
101  if (debug)
102  cout << "Number of 1D-RecHit pairs " << pairs.size() << endl;
103 
104  if (debug)
105  cout << "Start the 2D-segments Reco " << endl;
106  OwnVector<DTSLRecSegment2D> segs = theAlgo->reconstruct(sl, pairs);
107  if (debug)
108  cout << "Number of Reconstructed segments: " << segs.size() << endl;
109 
110  if (!segs.empty())
111  segments->put(SLId, segs.begin(), segs.end());
112  }
113  event.put(std::move(segments));
114 }
edm::EDGetTokenT< DTRecHitCollection > recHits1DToken_
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.
identifier iterator
Definition: RangeMap.h:130
iterator begin()
Definition: OwnVector.h:280
std::unique_ptr< DTRecSegment2DBaseAlgo > theAlgo
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
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
iterator end()
Definition: OwnVector.h:285
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

Member Data Documentation

◆ debug

bool DTRecSegment2DProducer::debug
private

◆ dtGeomToken_

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

Definition at line 55 of file DTRecSegment2DProducer.h.

Referenced by produce().

◆ recHits1DToken_

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

Definition at line 54 of file DTRecSegment2DProducer.h.

Referenced by produce().

◆ theAlgo

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

Definition at line 52 of file DTRecSegment2DProducer.h.

Referenced by produce().