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::ProductRegistryHelper

Public Member Functions

 RPCSeedGenerator (const edm::ParameterSet &iConfig)
 
 ~RPCSeedGenerator ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

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

Private Attributes

std::vector
< weightedTrajectorySeed
candidateweightedSeeds
 
RPCCosmicSeedrecHitFinder CosmicrecHitFinder
 
RPCSeedFinder Finder
 
std::vector
< weightedTrajectorySeed
goodweightedSeeds
 
RPCSeedLayerFinder LayerFinder
 
RPCSeedOverlapper Overlapper
 
RPCSeedrecHitFinder recHitFinder
 
edm::InputTag theRPCRecHits
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

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

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

Definition at line 86 of file RPCSeedGenerator.cc.

Constructor & Destructor Documentation

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

Definition at line 121 of file RPCSeedGenerator.cc.

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

122 {
123  //register your products
124  /* Examples
125  produces<ExampleData2>();
126 
127  //if do put with a label
128  produces<ExampleData2>("label");
129  */
130 
131  // Now do what ever other initialization is needed
132  // Configure other modules
133  Finder.configure(iConfig);
134  recHitFinder.configure(iConfig);
135  CosmicrecHitFinder.configure(iConfig);
136  LayerFinder.configure(iConfig);
137  Overlapper.configure(iConfig);
138  // Register the production
139  produces<TrajectorySeedCollection>("goodSeeds");
140  produces<TrajectorySeedCollection>("candidateSeeds");
141  // Get event data Tag
142  theRPCRecHits = iConfig.getParameter<edm::InputTag>("RPCRecHitsLabel");
143 
144  cout << endl << "[RPCSeedGenerator] --> Constructor called" << endl;
145 }
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)
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 148 of file RPCSeedGenerator.cc.

References gather_cfg::cout.

149 {
150  // do anything here that needs to be done at desctruction time
151  // (e.g. close files, deallocate resources etc.)
152  cout << "[RPCSeedGenerator] --> Destructor called" << endl;
153 }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

void RPCSeedGenerator::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 271 of file RPCSeedGenerator.cc.

References gather_cfg::cout.

271  {
272 
273  // Set link and EventSetup of RPCSeedFinder, PCSeedrecHitFinder, CosmicrecHitFinder, RPCSeedLayerFinder
274  cout << "set link and Geometry EventSetup of RPCSeedFinder, RPCSeedrecHitFinder, RPCCosmicSeedrecHitFinder, RPCSeedLayerFinder and RPCSeedOverlapper" << endl;
275 
280 }
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 
)
privatevirtual

Definition at line 281 of file RPCSeedGenerator.cc.

281  {
282  CosmicrecHitFinder.setEdge(iSetup);
283  Overlapper.setEventSetup(iSetup);
285 }
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  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 287 of file RPCSeedGenerator.cc.

References gather_cfg::cout.

287  {
288 
289  cout << "All jobs completed" << endl;
290 }
tuple cout
Definition: gather_cfg.py:121
void RPCSeedGenerator::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 162 of file RPCSeedGenerator.cc.

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

163 {
164  using namespace edm;
165  /* This is an event example
166  //Read 'ExampleData' from the Event
167  Handle<ExampleData> pIn;
168  iEvent.getByLabel("example",pIn);
169 
170  //Use the ExampleData to create an ExampleData2 which
171  // is put into the Event
172  std::auto_ptr<ExampleData2> pOut(new ExampleData2(*pIn));
173  iEvent.put(pOut);
174  */
175 
176  /* this is an EventSetup example
177  //Read SetupData from the SetupRecord in the EventSetup
178  ESHandle<SetupData> pSetup;
179  iSetup.get<SetupRecord>().get(pSetup);
180  */
181 
182  // clear weighted Seeds from last reconstruction
183  goodweightedSeeds.clear();
184  candidateweightedSeeds.clear();
185 
186  // Create the pointer to the Seed container
187  auto_ptr<TrajectorySeedCollection> goodCollection(new TrajectorySeedCollection());
188  auto_ptr<TrajectorySeedCollection> candidateCollection(new TrajectorySeedCollection());
189 
190  // Muon Geometry - DT, CSC and RPC
192  iSetup.get<MuonRecoGeometryRecord>().get(muonLayers);
193 
194  // Get the RPC layers
195  vector<DetLayer*> RPCBarrelLayers = muonLayers->barrelRPCLayers();
196  const DetLayer* RB4L = RPCBarrelLayers[5];
197  const DetLayer* RB3L = RPCBarrelLayers[4];
198  const DetLayer* RB22L = RPCBarrelLayers[3];
199  const DetLayer* RB21L = RPCBarrelLayers[2];
200  const DetLayer* RB12L = RPCBarrelLayers[1];
201  const DetLayer* RB11L = RPCBarrelLayers[0];
202  vector<DetLayer*> RPCEndcapLayers = muonLayers->endcapRPCLayers();
203  const DetLayer* REM3L = RPCEndcapLayers[0];
204  const DetLayer* REM2L = RPCEndcapLayers[1];
205  const DetLayer* REM1L = RPCEndcapLayers[2];
206  const DetLayer* REP1L = RPCEndcapLayers[3];
207  const DetLayer* REP2L = RPCEndcapLayers[4];
208  const DetLayer* REP3L = RPCEndcapLayers[5];
209 
210  // Get RPC recHits by MuonDetLayerMeasurements, while CSC and DT is set to false and with empty InputTag
211  MuonDetLayerMeasurements muonMeasurements(edm::InputTag(), edm::InputTag(), theRPCRecHits, false, false, true);
212 
213  // Dispatch RPC recHits to the corresponding DetLayer, 6 layers for barrel and 3 layers for each endcap
215  recHitsRPC[0] = muonMeasurements.recHits(RB11L, iEvent);
216  recHitsRPC[1] = muonMeasurements.recHits(RB12L, iEvent);
217  recHitsRPC[2] = muonMeasurements.recHits(RB21L, iEvent);
218  recHitsRPC[3] = muonMeasurements.recHits(RB22L, iEvent);
219  recHitsRPC[4] = muonMeasurements.recHits(RB3L, iEvent);
220  recHitsRPC[5] = muonMeasurements.recHits(RB4L, iEvent);
221  recHitsRPC[6] = muonMeasurements.recHits(REM1L, iEvent);
222  recHitsRPC[7] = muonMeasurements.recHits(REM2L, iEvent);
223  recHitsRPC[8] = muonMeasurements.recHits(REM3L, iEvent);
224  recHitsRPC[9] = muonMeasurements.recHits(REP1L, iEvent);
225  recHitsRPC[10] = muonMeasurements.recHits(REP2L, iEvent);
226  recHitsRPC[11] = muonMeasurements.recHits(REP3L, iEvent);
227 
228  // Print the size of recHits in each DetLayer
229  cout << "RB1in " << recHitsRPC[0].size() << " recHits" << endl;
230  cout << "RB1out " << recHitsRPC[1].size() << " recHits" << endl;
231  cout << "RB2in " << recHitsRPC[2].size() << " recHits" << endl;
232  cout << "RB2out " << recHitsRPC[3].size() << " recHits" << endl;
233  cout << "RB3 " << recHitsRPC[4].size() << " recHits" << endl;
234  cout << "RB4 " << recHitsRPC[5].size() << " recHits" << endl;
235  cout << "REM1 " << recHitsRPC[6].size() << " recHits" << endl;
236  cout << "REM2 " << recHitsRPC[7].size() << " recHits" << endl;
237  cout << "REM3 " << recHitsRPC[8].size() << " recHits" << endl;
238  cout << "REP1 " << recHitsRPC[9].size() << " recHits" << endl;
239  cout << "REP2 " << recHitsRPC[10].size() << " recHits" << endl;
240  cout << "REP3 " << recHitsRPC[11].size() << " recHits" << endl;
241 
242  // Set Input of RPCSeedFinder, PCSeedrecHitFinder, CosmicrecHitFinder, RPCSeedLayerFinder
243  recHitFinder.setInput(recHitsRPC);
244  CosmicrecHitFinder.setInput(recHitsRPC);
245  LayerFinder.setInput(recHitsRPC);
246 
247  // Set Magnetic Field EventSetup of RPCSeedFinder
248  Finder.setEventSetup(iSetup);
249 
250  // Start from filling layers to filling seeds
251  LayerFinder.fill();
252  Overlapper.run();
253 
254  // Save seeds to event
255  for(vector<weightedTrajectorySeed>::iterator weightedseed = goodweightedSeeds.begin(); weightedseed != goodweightedSeeds.end(); ++weightedseed)
256  goodCollection->push_back((*weightedseed).first);
257  for(vector<weightedTrajectorySeed>::iterator weightedseed = candidateweightedSeeds.begin(); weightedseed != candidateweightedSeeds.end(); ++weightedseed)
258  candidateCollection->push_back((*weightedseed).first);
259 
260  // Put the seed to event
261  iEvent.put(goodCollection, "goodSeeds");
262  iEvent.put(candidateCollection, "candidateSeeds");
263 
264  // Unset the input of RPCSeedFinder, PCSeedrecHitFinder, RPCSeedLayerFinder
268 
269 }
void setEventSetup(const edm::EventSetup &iSetup)
edm::InputTag theRPCRecHits
void setInput(MuonRecHitContainer(&recHits)[12])
RPCCosmicSeedrecHitFinder CosmicrecHitFinder
RPCSeedrecHitFinder recHitFinder
void setInput(MuonRecHitContainer(&recHits)[12])
#define RPCLayerNumber
std::vector< TrajectorySeed > TrajectorySeedCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
void setInput(MuonRecHitContainer(&recHitsRPC)[12])
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 103 of file RPCSeedGenerator.cc.

RPCCosmicSeedrecHitFinder RPCSeedGenerator::CosmicrecHitFinder
private

Definition at line 100 of file RPCSeedGenerator.cc.

RPCSeedFinder RPCSeedGenerator::Finder
private

Definition at line 98 of file RPCSeedGenerator.cc.

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

Definition at line 104 of file RPCSeedGenerator.cc.

RPCSeedLayerFinder RPCSeedGenerator::LayerFinder
private

Definition at line 101 of file RPCSeedGenerator.cc.

RPCSeedOverlapper RPCSeedGenerator::Overlapper
private

Definition at line 102 of file RPCSeedGenerator.cc.

RPCSeedrecHitFinder RPCSeedGenerator::recHitFinder
private

Definition at line 99 of file RPCSeedGenerator.cc.

edm::InputTag RPCSeedGenerator::theRPCRecHits
private

Definition at line 105 of file RPCSeedGenerator.cc.