CMS 3D CMS Logo

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...
 
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::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

bool debug
 
edm::EDGetTokenT< DTRecClusterCollectionrecClusToken_
 
edm::EDGetTokenT< DTRecHitCollectionrecHits1DToken_
 
DTCombinatorialExtendedPatternRecotheAlgo
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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 32 of file DTRecSegment2DExtendedProducer.h.

Constructor & Destructor Documentation

◆ DTRecSegment2DExtendedProducer()

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

Constructor.

Definition at line 35 of file DTRecSegment2DExtendedProducer.cc.

35  {
36  // Set verbose output
37  debug = pset.getUntrackedParameter<bool>("debug");
38 
39  // the name of the 1D rec hits collection
40  recHits1DToken_ = consumes<DTRecHitCollection>(pset.getParameter<InputTag>("recHits1DLabel"));
41  recClusToken_ = consumes<DTRecClusterCollection>(pset.getParameter<InputTag>("recClusLabel"));
42 
43  if (debug)
44  cout << "[DTRecSegment2DExtendedProducer] Constructor called" << endl;
45 
46  produces<DTRecSegment2DCollection>();
47 
48  // Get the concrete reconstruction algo from the factory
49  theAlgo = new DTCombinatorialExtendedPatternReco(pset.getParameter<ParameterSet>("Reco2DAlgoConfig"));
50 }

References gather_cfg::cout, debug, and muonDTDigis_cfi::pset.

◆ ~DTRecSegment2DExtendedProducer()

DTRecSegment2DExtendedProducer::~DTRecSegment2DExtendedProducer ( )
override

Destructor.

Definition at line 53 of file DTRecSegment2DExtendedProducer.cc.

53  {
54  if (debug)
55  cout << "[DTRecSegment2DExtendedProducer] Destructor called" << endl;
56  delete theAlgo;
57 }

References gather_cfg::cout, and debug.

Member Function Documentation

◆ produce()

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

The method which produces the 2D-segments.

Implements edm::EDProducer.

Definition at line 60 of file DTRecSegment2DExtendedProducer.cc.

60  {
61  if (debug)
62  cout << "[DTRecSegment2DExtendedProducer] produce called" << endl;
63  // Get the DT Geometry
64  ESHandle<DTGeometry> dtGeom;
65  setup.get<MuonGeometryRecord>().get(dtGeom);
66 
68 
69  // Get the 1D rechits from the event
71  event.getByToken(recHits1DToken_, allHits);
72 
73  // Get the 1D clusters from the event
75  event.getByToken(recClusToken_, dtClusters);
76  theAlgo->setClusters(vector<DTSLRecCluster>(dtClusters->begin(), dtClusters->end()));
77 
78  // Create the pointer to the collection which will store the rechits
79  auto segments = std::make_unique<DTRecSegment2DCollection>();
80 
81  // Iterate through all hit collections ordered by LayerId
83  DTSuperLayerId oldSlId;
84  for (dtLayerIt = allHits->id_begin(); dtLayerIt != allHits->id_end(); ++dtLayerIt) {
85  // The layerId
86  DTLayerId layerId = (*dtLayerIt);
87  const DTSuperLayerId SLId = layerId.superlayerId();
88  if (SLId == oldSlId)
89  continue; // I'm on the same SL as before
90  oldSlId = SLId;
91 
92  if (debug)
93  cout << "Reconstructing the 2D segments in " << SLId << endl;
94 
95  const DTSuperLayer* sl = dtGeom->superLayer(SLId);
96 
97  // Get all the rec hit in the same superLayer in which layerId relies
99 
100  // Fill the vector with the 1D RecHit
101  vector<DTRecHit1DPair> pairs(range.first, range.second);
102 
103  if (debug)
104  cout << "Number of 1D-RecHit pairs " << pairs.size() << endl;
105 
106  //if(debug) cout << "Start the 2D-segments Reco "<< endl;
108  if (debug) {
109  cout << "Number of Reconstructed segments: " << segs.size() << endl;
110  copy(segs.begin(), segs.end(), ostream_iterator<DTSLRecSegment2D>(cout, "\n"));
111  }
112 
113  if (!segs.empty())
114  segments->put(SLId, segs.begin(), segs.end());
115  }
116  event.put(std::move(segments));
117 }

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

Member Data Documentation

◆ debug

bool DTRecSegment2DExtendedProducer::debug
private

◆ recClusToken_

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

Definition at line 55 of file DTRecSegment2DExtendedProducer.h.

◆ recHits1DToken_

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

Definition at line 54 of file DTRecSegment2DExtendedProducer.h.

◆ theAlgo

DTCombinatorialExtendedPatternReco* DTRecSegment2DExtendedProducer::theAlgo
private

Definition at line 51 of file DTRecSegment2DExtendedProducer.h.

DTSuperLayerId
Definition: DTSuperLayerId.h:12
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
edm::OwnVector::end
iterator end()
Definition: OwnVector.h:285
DTRecSegment2DExtendedProducer::debug
bool debug
Definition: DTRecSegment2DExtendedProducer.h:48
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
edm::ESHandle< DTGeometry >
DTCombinatorialExtendedPatternReco::reconstruct
edm::OwnVector< DTSLRecSegment2D > reconstruct(const DTSuperLayer *sl, const std::vector< DTRecHit1DPair > &hits) override
this function is called in the producer
Definition: DTCombinatorialExtendedPatternReco.cc:50
DTLayerId
Definition: DTLayerId.h:12
edm::ParameterSet
Definition: ParameterSet.h:47
DTRangeMapAccessor::layersBySuperLayer
static std::pair< DTLayerId, DTSuperLayerIdComparator > layersBySuperLayer(DTSuperLayerId slId)
Access by SL objects written into a RangeMap by layer.
Definition: DTRangeMapAccessor.cc:15
DTRecSegment2DExtendedProducer::theAlgo
DTCombinatorialExtendedPatternReco * theAlgo
Definition: DTRecSegment2DExtendedProducer.h:51
DTCombinatorialExtendedPatternReco::setClusters
void setClusters(const std::vector< DTSLRecCluster > &clusters)
Definition: DTCombinatorialExtendedPatternReco.cc:84
get
#define get
DTRecSegment2DExtendedProducer::recHits1DToken_
edm::EDGetTokenT< DTRecHitCollection > recHits1DToken_
Definition: DTRecSegment2DExtendedProducer.h:54
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
DTRecSegment2DExtendedProducer::recClusToken_
edm::EDGetTokenT< DTRecClusterCollection > recClusToken_
Definition: DTRecSegment2DExtendedProducer.h:55
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
DTCombinatorialExtendedPatternReco
Definition: DTCombinatorialExtendedPatternReco.h:42
edm::OwnVector::size
size_type size() const
Definition: OwnVector.h:300
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
DTCombinatorialExtendedPatternReco::setES
void setES(const edm::EventSetup &setup) override
Definition: DTCombinatorialExtendedPatternReco.cc:78
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::OwnVector
Definition: OwnVector.h:24