CMS 3D CMS Logo

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

#include <RecoMuon/MuonSeedGenerator/src/RPCSeedGenerator.cc>

Inheritance diagram for RPCSeedGenerator:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 RPCSeedGenerator (const edm::ParameterSet &iConfig)
 
 ~RPCSeedGenerator () override
 
- 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
 
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 Member Functions

void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &iSetup) override
 
void endJob () override
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 

Private Attributes

std::vector< weightedTrajectorySeedcandidateweightedSeeds
 
RPCCosmicSeedrecHitFinder CosmicrecHitFinder
 
RPCSeedFinder Finder
 
std::vector< weightedTrajectorySeedgoodweightedSeeds
 
RPCSeedLayerFinder LayerFinder
 
MuonDetLayerMeasurementsmuonMeasurements
 
RPCSeedOverlapper Overlapper
 
RPCSeedrecHitFinder recHitFinder
 
edm::InputTag theRPCRecHits
 

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 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>
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 85 of file RPCSeedGenerator.cc.

Constructor & Destructor Documentation

◆ RPCSeedGenerator()

RPCSeedGenerator::RPCSeedGenerator ( const edm::ParameterSet iConfig)
explicit

Definition at line 119 of file RPCSeedGenerator.cc.

119  {
120  //register your products
121  /* Examples
122  produces<ExampleData2>();
123 
124  //if do put with a label
125  produces<ExampleData2>("label");
126  */
127 
128  // Now do what ever other initialization is needed
129  // Configure other modules
130  Finder.configure(iConfig);
131  recHitFinder.configure(iConfig);
132  CosmicrecHitFinder.configure(iConfig);
133  LayerFinder.configure(iConfig);
134  Overlapper.configure(iConfig);
135  // Register the production
136  produces<TrajectorySeedCollection>("goodSeeds");
137  produces<TrajectorySeedCollection>("candidateSeeds");
138  // Get event data Tag
139  theRPCRecHits = iConfig.getParameter<edm::InputTag>("RPCRecHitsLabel");
140 
141  // Get RPC recHits by MuonDetLayerMeasurements, while CSC and DT is set to false and with empty InputTag
143 
145  edm::InputTag(),
147  edm::InputTag(),
148  edm::InputTag(),
149  iC,
150  false,
151  false,
152  true,
153  false,
154  false);
155 
156  cout << endl << "[RPCSeedGenerator] --> Constructor called" << endl;
157 }

References gather_cfg::cout, HLT_2018_cff::Finder, edm::ParameterSet::getParameter(), and dtChamberEfficiency_cfi::theRPCRecHits.

◆ ~RPCSeedGenerator()

RPCSeedGenerator::~RPCSeedGenerator ( )
override

Definition at line 159 of file RPCSeedGenerator.cc.

159  {
160  // do anything here that needs to be done at desctruction time
161  // (e.g. close files, deallocate resources etc.)
162  cout << "[RPCSeedGenerator] --> Destructor called" << endl;
163 
164  if (muonMeasurements)
165  delete muonMeasurements;
166 }

References gather_cfg::cout.

Member Function Documentation

◆ beginJob()

void RPCSeedGenerator::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 264 of file RPCSeedGenerator.cc.

264  {
265  // Set link and EventSetup of RPCSeedFinder, PCSeedrecHitFinder, CosmicrecHitFinder, RPCSeedLayerFinder
266  cout << "set link and Geometry EventSetup of RPCSeedFinder, RPCSeedrecHitFinder, RPCCosmicSeedrecHitFinder, "
267  "RPCSeedLayerFinder and RPCSeedOverlapper"
268  << endl;
269 
274 }

References gather_cfg::cout, and HLT_2018_cff::Finder.

◆ beginRun()

void RPCSeedGenerator::beginRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 275 of file RPCSeedGenerator.cc.

◆ endJob()

void RPCSeedGenerator::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 281 of file RPCSeedGenerator.cc.

281 { cout << "All jobs completed" << endl; }

References gather_cfg::cout.

◆ produce()

void RPCSeedGenerator::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 173 of file RPCSeedGenerator.cc.

173  {
174  using namespace edm;
175  goodweightedSeeds.clear();
176  candidateweightedSeeds.clear();
177 
178  // Create the pointer to the Seed container
179  auto goodCollection = std::make_unique<TrajectorySeedCollection>();
180  auto candidateCollection = std::make_unique<TrajectorySeedCollection>();
181 
182  // Muon Geometry - DT, CSC and RPC
184  iSetup.get<MuonRecoGeometryRecord>().get(muonLayers);
185 
186  // Get the RPC layers
187  vector<const DetLayer*> RPCBarrelLayers = muonLayers->barrelRPCLayers();
188  const DetLayer* RB4L = RPCBarrelLayers[5];
189  const DetLayer* RB3L = RPCBarrelLayers[4];
190  const DetLayer* RB22L = RPCBarrelLayers[3];
191  const DetLayer* RB21L = RPCBarrelLayers[2];
192  const DetLayer* RB12L = RPCBarrelLayers[1];
193  const DetLayer* RB11L = RPCBarrelLayers[0];
194  vector<const DetLayer*> RPCEndcapLayers = muonLayers->endcapRPCLayers();
195  const DetLayer* REM3L = RPCEndcapLayers[0];
196  const DetLayer* REM2L = RPCEndcapLayers[1];
197  const DetLayer* REM1L = RPCEndcapLayers[2];
198  const DetLayer* REP1L = RPCEndcapLayers[3];
199  const DetLayer* REP2L = RPCEndcapLayers[4];
200  const DetLayer* REP3L = RPCEndcapLayers[5];
201 
202  // Dispatch RPC recHits to the corresponding DetLayer, 6 layers for barrel and 3 layers for each endcap
204  recHitsRPC[0] = muonMeasurements->recHits(RB11L, iEvent);
205  recHitsRPC[1] = muonMeasurements->recHits(RB12L, iEvent);
206  recHitsRPC[2] = muonMeasurements->recHits(RB21L, iEvent);
207  recHitsRPC[3] = muonMeasurements->recHits(RB22L, iEvent);
208  recHitsRPC[4] = muonMeasurements->recHits(RB3L, iEvent);
209  recHitsRPC[5] = muonMeasurements->recHits(RB4L, iEvent);
210  recHitsRPC[6] = muonMeasurements->recHits(REM1L, iEvent);
211  recHitsRPC[7] = muonMeasurements->recHits(REM2L, iEvent);
212  recHitsRPC[8] = muonMeasurements->recHits(REM3L, iEvent);
213  recHitsRPC[9] = muonMeasurements->recHits(REP1L, iEvent);
214  recHitsRPC[10] = muonMeasurements->recHits(REP2L, iEvent);
215  recHitsRPC[11] = muonMeasurements->recHits(REP3L, iEvent);
216 
217  // Print the size of recHits in each DetLayer
218  cout << "RB1in " << recHitsRPC[0].size() << " recHits" << endl;
219  cout << "RB1out " << recHitsRPC[1].size() << " recHits" << endl;
220  cout << "RB2in " << recHitsRPC[2].size() << " recHits" << endl;
221  cout << "RB2out " << recHitsRPC[3].size() << " recHits" << endl;
222  cout << "RB3 " << recHitsRPC[4].size() << " recHits" << endl;
223  cout << "RB4 " << recHitsRPC[5].size() << " recHits" << endl;
224  cout << "REM1 " << recHitsRPC[6].size() << " recHits" << endl;
225  cout << "REM2 " << recHitsRPC[7].size() << " recHits" << endl;
226  cout << "REM3 " << recHitsRPC[8].size() << " recHits" << endl;
227  cout << "REP1 " << recHitsRPC[9].size() << " recHits" << endl;
228  cout << "REP2 " << recHitsRPC[10].size() << " recHits" << endl;
229  cout << "REP3 " << recHitsRPC[11].size() << " recHits" << endl;
230 
231  // Set Input of RPCSeedFinder, PCSeedrecHitFinder, CosmicrecHitFinder, RPCSeedLayerFinder
232  recHitFinder.setInput(recHitsRPC);
233  CosmicrecHitFinder.setInput(recHitsRPC);
234  LayerFinder.setInput(recHitsRPC);
235 
236  // Set Magnetic Field EventSetup of RPCSeedFinder
237  Finder.setEventSetup(iSetup);
238 
239  // Start from filling layers to filling seeds
240  LayerFinder.fill();
241  Overlapper.setEventSetup(iSetup);
242  Overlapper.run();
243 
244  // Save seeds to event
245  for (vector<weightedTrajectorySeed>::iterator weightedseed = goodweightedSeeds.begin();
246  weightedseed != goodweightedSeeds.end();
247  ++weightedseed)
248  goodCollection->push_back((*weightedseed).first);
249  for (vector<weightedTrajectorySeed>::iterator weightedseed = candidateweightedSeeds.begin();
250  weightedseed != candidateweightedSeeds.end();
251  ++weightedseed)
252  candidateCollection->push_back((*weightedseed).first);
253 
254  // Put the seed to event
255  iEvent.put(std::move(goodCollection), "goodSeeds");
256  iEvent.put(std::move(candidateCollection), "candidateSeeds");
257 
258  // Unset the input of RPCSeedFinder, PCSeedrecHitFinder, RPCSeedLayerFinder
262 }

References MuonDetLayerGeometry::barrelRPCLayers(), gather_cfg::cout, MuonDetLayerGeometry::endcapRPCLayers(), HLT_2018_cff::Finder, edm::EventSetup::get(), get, iEvent, eostools::move(), and RPCLayerNumber.

Member Data Documentation

◆ candidateweightedSeeds

std::vector<weightedTrajectorySeed> RPCSeedGenerator::candidateweightedSeeds
private

Definition at line 102 of file RPCSeedGenerator.cc.

◆ CosmicrecHitFinder

RPCCosmicSeedrecHitFinder RPCSeedGenerator::CosmicrecHitFinder
private

Definition at line 99 of file RPCSeedGenerator.cc.

◆ Finder

RPCSeedFinder RPCSeedGenerator::Finder
private

Definition at line 97 of file RPCSeedGenerator.cc.

◆ goodweightedSeeds

std::vector<weightedTrajectorySeed> RPCSeedGenerator::goodweightedSeeds
private

Definition at line 103 of file RPCSeedGenerator.cc.

◆ LayerFinder

RPCSeedLayerFinder RPCSeedGenerator::LayerFinder
private

Definition at line 100 of file RPCSeedGenerator.cc.

◆ muonMeasurements

MuonDetLayerMeasurements* RPCSeedGenerator::muonMeasurements
private

Definition at line 105 of file RPCSeedGenerator.cc.

◆ Overlapper

RPCSeedOverlapper RPCSeedGenerator::Overlapper
private

Definition at line 101 of file RPCSeedGenerator.cc.

◆ recHitFinder

RPCSeedrecHitFinder RPCSeedGenerator::recHitFinder
private

Definition at line 98 of file RPCSeedGenerator.cc.

◆ theRPCRecHits

edm::InputTag RPCSeedGenerator::theRPCRecHits
private

Definition at line 104 of file RPCSeedGenerator.cc.

RPCSeedLayerFinder::setInput
void setInput(MuonRecHitContainer(&recHitsRPC)[12])
Definition: RPCSeedLayerFinder.cc:36
RPCSeedLayerFinder::setOutput
void setOutput(RPCSeedrecHitFinder *Ref, RPCCosmicSeedrecHitFinder *CosmicRef)
Definition: RPCSeedLayerFinder.cc:46
MuonRecHitContainer
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
Definition: CosmicMuonSmoother.h:31
DetLayer
Definition: DetLayer.h:21
MuonDetLayerGeometry::barrelRPCLayers
const std::vector< const DetLayer * > & barrelRPCLayers() const
return the barrel RPC DetLayers, inside-out
Definition: MuonDetLayerGeometry.cc:179
RPCCosmicSeedrecHitFinder::unsetInput
void unsetInput()
Definition: RPCCosmicSeedrecHitFinder.cc:94
MuonDetLayerMeasurements
Definition: MuonDetLayerMeasurements.h:41
edm
HLT enums.
Definition: AlignableModifier.h:19
RPCSeedGenerator::LayerFinder
RPCSeedLayerFinder LayerFinder
Definition: RPCSeedGenerator.cc:100
gather_cfg.cout
cout
Definition: gather_cfg.py:144
RPCSeedrecHitFinder::setOutput
void setOutput(RPCSeedFinder *Seed)
Definition: RPCSeedrecHitFinder.cc:53
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:71
RPCSeedGenerator::goodweightedSeeds
std::vector< weightedTrajectorySeed > goodweightedSeeds
Definition: RPCSeedGenerator.cc:103
RPCCosmicSeedrecHitFinder::setInput
void setInput(MuonRecHitContainer(&recHits)[12])
Definition: RPCCosmicSeedrecHitFinder.cc:56
RPCSeedGenerator::muonMeasurements
MuonDetLayerMeasurements * muonMeasurements
Definition: RPCSeedGenerator.cc:105
RPCSeedLayerFinder::unsetInput
void unsetInput()
Definition: RPCSeedLayerFinder.cc:44
MuonRecoGeometryRecord
Definition: MuonRecoGeometryRecord.h:17
RPCSeedFinder::configure
void configure(const edm::ParameterSet &iConfig)
Definition: RPCSeedFinder.cc:23
RPCLayerNumber
#define RPCLayerNumber
Definition: RPCCosmicSeedrecHitFinder.h:18
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
RPCSeedGenerator::theRPCRecHits
edm::InputTag theRPCRecHits
Definition: RPCSeedGenerator.cc:104
RPCSeedrecHitFinder::unsetInput
void unsetInput()
Definition: RPCSeedrecHitFinder.cc:52
edm::ESHandle< MuonDetLayerGeometry >
RPCSeedGenerator::Finder
RPCSeedFinder Finder
Definition: RPCSeedGenerator.cc:97
RPCSeedOverlapper::configure
void configure(const edm::ParameterSet &iConfig)
Definition: RPCSeedOverlapper.cc:21
RPCSeedOverlapper::setEventSetup
void setEventSetup(const edm::EventSetup &iSetup)
Definition: RPCSeedOverlapper.cc:37
RPCSeedrecHitFinder::setInput
void setInput(MuonRecHitContainer(&recHits)[12])
Definition: RPCSeedrecHitFinder.cc:46
iEvent
int iEvent
Definition: GenABIO.cc:224
RPCSeedGenerator::Overlapper
RPCSeedOverlapper Overlapper
Definition: RPCSeedGenerator.cc:101
RPCSeedFinder::setOutput
void setOutput(std::vector< weightedTrajectorySeed > *goodweightedRef, std::vector< weightedTrajectorySeed > *candidateweightedRef)
Definition: RPCSeedFinder.cc:28
get
#define get
MuonDetLayerMeasurements::recHits
MuonRecHitContainer recHits(const DetLayer *layer, const edm::Event &iEvent)
returns the rechits which are on the layer
Definition: MuonDetLayerMeasurements.cc:417
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
RPCSeedGenerator::CosmicrecHitFinder
RPCCosmicSeedrecHitFinder CosmicrecHitFinder
Definition: RPCSeedGenerator.cc:99
RPCSeedGenerator::recHitFinder
RPCSeedrecHitFinder recHitFinder
Definition: RPCSeedGenerator.cc:98
RPCSeedGenerator::candidateweightedSeeds
std::vector< weightedTrajectorySeed > candidateweightedSeeds
Definition: RPCSeedGenerator.cc:102
RPCCosmicSeedrecHitFinder::setOutput
void setOutput(RPCSeedFinder *Seed)
Definition: RPCCosmicSeedrecHitFinder.cc:100
RPCSeedLayerFinder::configure
void configure(const edm::ParameterSet &iConfig)
Definition: RPCSeedLayerFinder.cc:21
RPCSeedOverlapper::run
void run()
Definition: RPCSeedOverlapper.cc:42
RPCCosmicSeedrecHitFinder::configure
void configure(const edm::ParameterSet &iConfig)
Definition: RPCCosmicSeedrecHitFinder.cc:46
RPCSeedOverlapper::setIO
void setIO(std::vector< weightedTrajectorySeed > *goodweightedRef, std::vector< weightedTrajectorySeed > *candidateweightedRef)
Definition: RPCSeedOverlapper.cc:28
MuonDetLayerGeometry::endcapRPCLayers
const std::vector< const DetLayer * > & endcapRPCLayers() const
return the endcap RPC DetLayers, -Z to +Z
Definition: MuonDetLayerGeometry.cc:181
edm::InputTag
Definition: InputTag.h:15
RPCSeedLayerFinder::fill
void fill()
Definition: RPCSeedLayerFinder.cc:52
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
RPCSeedFinder::setEventSetup
void setEventSetup(const edm::EventSetup &iSetup)
Definition: RPCSeedFinder.cc:42
RPCSeedrecHitFinder::configure
void configure(const edm::ParameterSet &iConfig)
Definition: RPCSeedrecHitFinder.cc:36
RPCCosmicSeedrecHitFinder::setEdge
void setEdge(const edm::EventSetup &iSetup)
Definition: RPCCosmicSeedrecHitFinder.cc:66