CMS 3D CMS Logo

RPCRecHitProducer Class Reference

Module for RPCRecHit production. More...

#include <RecoLocalMuon/RPCRecHit/src/RPCRecHitProducer.h>

Inheritance diagram for RPCRecHitProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void produce (edm::Event &event, const edm::EventSetup &setup)
 The method which produces the rechits.
 RPCRecHitProducer (const edm::ParameterSet &)
 Constructor.
virtual ~RPCRecHitProducer ()
 Destructor.

Private Attributes

RPCRecHitBaseAlgotheAlgo
edm::InputTag theRPCDigiLabel


Detailed Description

Module for RPCRecHit production.

Date
2008/01/29 12:53:03
Revision
1.2
Author:
M. Maggim -- INFN Bari

Definition at line 23 of file RPCRecHitProducer.h.


Constructor & Destructor Documentation

RPCRecHitProducer::RPCRecHitProducer ( const edm::ParameterSet config  ) 

Constructor.

Definition at line 35 of file RPCRecHitProducer.cc.

References DBSPlugin::get(), edm::ParameterSet::getParameter(), theAlgo, and theRPCDigiLabel.

00035                                                               {
00036   // Set verbose output
00037 
00038   produces<RPCRecHitCollection>();
00039 
00040   theRPCDigiLabel = config.getParameter<InputTag>("rpcDigiLabel");
00041   
00042   // Get the concrete reconstruction algo from the factory
00043   string theAlgoName = config.getParameter<string>("recAlgo");
00044   theAlgo = RPCRecHitAlgoFactory::get()->create(theAlgoName,
00045                                                 config.getParameter<ParameterSet>("recAlgoConfig"));
00046 }

RPCRecHitProducer::~RPCRecHitProducer (  )  [virtual]

Destructor.

Definition at line 48 of file RPCRecHitProducer.cc.

References theAlgo.

00048                                      {
00049   delete theAlgo;
00050 }


Member Function Documentation

void RPCRecHitProducer::produce ( edm::Event event,
const edm::EventSetup setup 
) [virtual]

The method which produces the rechits.

Implements edm::EDProducer.

Definition at line 54 of file RPCRecHitProducer.cc.

References edm::OwnVector< T, P >::begin(), edm::OwnVector< T, P >::end(), edm::EventSetup::get(), range, RPCRecHitBaseAlgo::reconstruct(), RPCRecHitBaseAlgo::setES(), edm::OwnVector< T, P >::size(), theAlgo, and theRPCDigiLabel.

00054                                                                      {
00055   // Get the RPC Geometry
00056   ESHandle<RPCGeometry> rpcGeom;
00057   setup.get<MuonGeometryRecord>().get(rpcGeom);
00058 
00059   // Get the digis from the event
00060   Handle<RPCDigiCollection> digis; 
00061   event.getByLabel(theRPCDigiLabel,digis);
00062 
00063   // Pass the EventSetup to the algo
00064   theAlgo->setES(setup);
00065 
00066   // Create the pointer to the collection which will store the rechits
00067   auto_ptr<RPCRecHitCollection> recHitCollection(new RPCRecHitCollection());
00068 
00069 
00070   // Iterate through all digi collections ordered by LayerId   
00071   RPCDigiCollection::DigiRangeIterator rpcdgIt;
00072   for (rpcdgIt = digis->begin(); rpcdgIt != digis->end();
00073        ++rpcdgIt){
00074        
00075     // The layerId
00076     const RPCDetId& rpcId = (*rpcdgIt).first;
00077     // Get the GeomDet from the setup
00078     const RPCRoll* roll = rpcGeom->roll(rpcId);
00079 
00080     // Get the iterators over the digis associated with this LayerId
00081     const RPCDigiCollection::Range& range = (*rpcdgIt).second;
00082     
00083     OwnVector<RPCRecHit> recHits =
00084       theAlgo->reconstruct(*roll, rpcId, range);
00085     
00086     if(recHits.size() > 0) //FIXME: is it really needed?
00087       recHitCollection->put(rpcId, recHits.begin(), recHits.end());
00088   }
00089 
00090   event.put(recHitCollection);
00091 }


Member Data Documentation

RPCRecHitBaseAlgo* RPCRecHitProducer::theAlgo [private]

Definition at line 39 of file RPCRecHitProducer.h.

Referenced by produce(), RPCRecHitProducer(), and ~RPCRecHitProducer().

edm::InputTag RPCRecHitProducer::theRPCDigiLabel [private]

Definition at line 37 of file RPCRecHitProducer.h.

Referenced by produce(), and RPCRecHitProducer().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:05 2009 for CMSSW by  doxygen 1.5.4