CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

std::vector
< weightedTrajectorySeed
candidateweightedSeeds
 
RPCCosmicSeedrecHitFinder CosmicrecHitFinder
 
RPCSeedFinder Finder
 
std::vector
< weightedTrajectorySeed
goodweightedSeeds
 
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
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 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, 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  muonMeasurements = new MuonDetLayerMeasurements (edm::InputTag(), edm::InputTag(), theRPCRecHits,iC, false, false, true);
150 
151 
152  cout << endl << "[RPCSeedGenerator] --> Constructor called" << endl;
153 }
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
tuple cout
Definition: gather_cfg.py:121
RPCSeedFinder Finder
RPCSeedLayerFinder LayerFinder
void configure(const edm::ParameterSet &iConfig)
RPCSeedGenerator::~RPCSeedGenerator ( )

Definition at line 156 of file RPCSeedGenerator.cc.

References gather_cfg::cout.

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

Member Function Documentation

void RPCSeedGenerator::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 262 of file RPCSeedGenerator.cc.

References gather_cfg::cout.

262  {
263 
264  // Set link and EventSetup of RPCSeedFinder, PCSeedrecHitFinder, CosmicrecHitFinder, RPCSeedLayerFinder
265  cout << "set link and Geometry EventSetup of RPCSeedFinder, RPCSeedrecHitFinder, RPCCosmicSeedrecHitFinder, RPCSeedLayerFinder and RPCSeedOverlapper" << endl;
266 
271 }
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)
tuple cout
Definition: gather_cfg.py:121
RPCSeedFinder Finder
std::vector< weightedTrajectorySeed > goodweightedSeeds
std::vector< weightedTrajectorySeed > candidateweightedSeeds
RPCSeedLayerFinder LayerFinder
void RPCSeedGenerator::beginRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 272 of file RPCSeedGenerator.cc.

272  {
273  CosmicrecHitFinder.setEdge(iSetup);
274  Overlapper.setEventSetup(iSetup);
276 }
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 278 of file RPCSeedGenerator.cc.

References gather_cfg::cout.

278  {
279 
280  cout << "All jobs completed" << endl;
281 }
tuple cout
Definition: gather_cfg.py:121
void RPCSeedGenerator::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 173 of file RPCSeedGenerator.cc.

References gather_cfg::cout, edm::EventSetup::get(), edm::Event::put(), and RPCLayerNumber.

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