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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

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

Definition at line 87 of file RPCSeedGenerator.cc.

Constructor & Destructor Documentation

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

Definition at line 123 of file RPCSeedGenerator.cc.

References gather_cfg::cout, PixelVertexes_cfi::Finder, and edm::ParameterSet::getParameter().

124 {
125  //register your products
126  /* Examples
127  produces<ExampleData2>();
128 
129  //if do put with a label
130  produces<ExampleData2>("label");
131  */
132 
133  // Now do what ever other initialization is needed
134  // Configure other modules
135  Finder.configure(iConfig);
136  recHitFinder.configure(iConfig);
137  CosmicrecHitFinder.configure(iConfig);
138  LayerFinder.configure(iConfig);
139  Overlapper.configure(iConfig);
140  // Register the production
141  produces<TrajectorySeedCollection>("goodSeeds");
142  produces<TrajectorySeedCollection>("candidateSeeds");
143  // Get event data Tag
144  theRPCRecHits = iConfig.getParameter<edm::InputTag>("RPCRecHitsLabel");
145 
146 
147  // Get RPC recHits by MuonDetLayerMeasurements, while CSC and DT is set to false and with empty InputTag
149 
150  muonMeasurements = new MuonDetLayerMeasurements (edm::InputTag(), edm::InputTag(), theRPCRecHits, edm::InputTag(),edm::InputTag(),iC, false, false, true, false, false);
151 
152 
153  cout << endl << "[RPCSeedGenerator] --> Constructor called" << endl;
154 }
T getParameter(std::string const &) const
edm::InputTag theRPCRecHits
void configure(const edm::ParameterSet &iConfig)
RPCCosmicSeedrecHitFinder CosmicrecHitFinder
RPCSeedrecHitFinder recHitFinder
void configure(const edm::ParameterSet &iConfig)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
MuonDetLayerMeasurements * muonMeasurements
void configure(const edm::ParameterSet &iConfig)
void configure(const edm::ParameterSet &iConfig)
RPCSeedOverlapper Overlapper
RPCSeedFinder Finder
RPCSeedLayerFinder LayerFinder
void configure(const edm::ParameterSet &iConfig)
RPCSeedGenerator::~RPCSeedGenerator ( )
override

Definition at line 157 of file RPCSeedGenerator.cc.

References gather_cfg::cout.

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

Member Function Documentation

void RPCSeedGenerator::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 264 of file RPCSeedGenerator.cc.

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

264  {
265 
266  // Set link and EventSetup of RPCSeedFinder, PCSeedrecHitFinder, CosmicrecHitFinder, RPCSeedLayerFinder
267  cout << "set link and Geometry EventSetup of RPCSeedFinder, RPCSeedrecHitFinder, RPCCosmicSeedrecHitFinder, RPCSeedLayerFinder and RPCSeedOverlapper" << endl;
268 
273 }
RPCCosmicSeedrecHitFinder CosmicrecHitFinder
void setOutput(std::vector< weightedTrajectorySeed > *goodweightedRef, std::vector< weightedTrajectorySeed > *candidateweightedRef)
RPCSeedrecHitFinder recHitFinder
void setOutput(RPCSeedrecHitFinder *Ref, RPCCosmicSeedrecHitFinder *CosmicRef)
void setOutput(RPCSeedFinder *Seed)
void setOutput(RPCSeedFinder *Seed)
RPCSeedFinder Finder
std::vector< weightedTrajectorySeed > goodweightedSeeds
std::vector< weightedTrajectorySeed > candidateweightedSeeds
RPCSeedLayerFinder LayerFinder
void RPCSeedGenerator::beginRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 274 of file RPCSeedGenerator.cc.

274  {
275  CosmicrecHitFinder.setEdge(iSetup);
276  Overlapper.setEventSetup(iSetup);
278 }
void setEdge(const edm::EventSetup &iSetup)
RPCCosmicSeedrecHitFinder CosmicrecHitFinder
void setEventSetup(const edm::EventSetup &iSetup)
RPCSeedOverlapper Overlapper
std::vector< weightedTrajectorySeed > goodweightedSeeds
std::vector< weightedTrajectorySeed > candidateweightedSeeds
void setIO(std::vector< weightedTrajectorySeed > *goodweightedRef, std::vector< weightedTrajectorySeed > *candidateweightedRef)
void RPCSeedGenerator::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 280 of file RPCSeedGenerator.cc.

References gather_cfg::cout, and DEFINE_FWK_MODULE.

280  {
281 
282  cout << "All jobs completed" << endl;
283 }
void RPCSeedGenerator::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 174 of file RPCSeedGenerator.cc.

References gather_cfg::cout, PixelVertexes_cfi::Finder, edm::EventSetup::get(), eostools::move(), edm::Event::put(), and RPCLayerNumber.

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

Member Data Documentation

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

Definition at line 104 of file RPCSeedGenerator.cc.

RPCCosmicSeedrecHitFinder RPCSeedGenerator::CosmicrecHitFinder
private

Definition at line 101 of file RPCSeedGenerator.cc.

RPCSeedFinder RPCSeedGenerator::Finder
private

Definition at line 99 of file RPCSeedGenerator.cc.

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

Definition at line 105 of file RPCSeedGenerator.cc.

RPCSeedLayerFinder RPCSeedGenerator::LayerFinder
private

Definition at line 102 of file RPCSeedGenerator.cc.

MuonDetLayerMeasurements* RPCSeedGenerator::muonMeasurements
private

Definition at line 107 of file RPCSeedGenerator.cc.

RPCSeedOverlapper RPCSeedGenerator::Overlapper
private

Definition at line 103 of file RPCSeedGenerator.cc.

RPCSeedrecHitFinder RPCSeedGenerator::recHitFinder
private

Definition at line 100 of file RPCSeedGenerator.cc.

edm::InputTag RPCSeedGenerator::theRPCRecHits
private

Definition at line 106 of file RPCSeedGenerator.cc.