CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

RPCDigiProducer Class Reference

#include <RPCDigiProducer.h>

Inheritance diagram for RPCDigiProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Types

typedef
RPCDigitizer::RPCDigiSimLinks 
RPCDigitizerSimLinks

Public Member Functions

virtual void beginRun (edm::Run &, const edm::EventSetup &)
virtual void endRun (edm::Run &, const edm::EventSetup &)
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 RPCDigiProducer (const edm::ParameterSet &ps)
void setRPCSetUp (std::vector< RPCStripNoises::NoiseItem >, std::vector< double >)
virtual ~RPCDigiProducer ()

Private Attributes

std::string collection_for_XF
RPCDigitizertheDigitizer
RPCSimSetUptheRPCSimSetUp

Detailed Description

Definition at line 19 of file RPCDigiProducer.h.


Member Typedef Documentation

Definition at line 23 of file RPCDigiProducer.h.


Constructor & Destructor Documentation

RPCDigiProducer::RPCDigiProducer ( const edm::ParameterSet ps) [explicit]

Definition at line 39 of file RPCDigiProducer.cc.

References collection_for_XF, Exception, edm::ParameterSet::getParameter(), theDigitizer, and theRPCSimSetUp.

                                                          {

  produces<RPCDigiCollection>();
  produces<RPCDigitizerSimLinks>("RPCDigiSimLink");

  //Name of Collection used for create the XF 
  collection_for_XF = ps.getParameter<std::string>("InputCollection");

  edm::Service<edm::RandomNumberGenerator> rng;
  if ( ! rng.isAvailable()) {
   throw cms::Exception("Configuration")
     << "RPCDigitizer requires the RandomNumberGeneratorService\n"
        "which is not present in the configuration file.  You must add the service\n"
        "in the configuration file or remove the modules that require it.";
  }


  CLHEP::HepRandomEngine& engine = rng->getEngine();

  theRPCSimSetUp =  new RPCSimSetUp(ps);
  theDigitizer = new RPCDigitizer(ps,engine);


}
RPCDigiProducer::~RPCDigiProducer ( ) [virtual]

Definition at line 64 of file RPCDigiProducer.cc.

References theDigitizer, and theRPCSimSetUp.

                                  {
  delete theDigitizer;
  delete theRPCSimSetUp;
}

Member Function Documentation

void RPCDigiProducer::beginRun ( edm::Run r,
const edm::EventSetup eventSetup 
) [virtual]

Reimplemented from edm::EDProducer.

Definition at line 69 of file RPCDigiProducer.cc.

References edm::EventSetup::get(), RPCDigitizer::setGeometry(), RPCSimSetUp::setGeometry(), RPCSimSetUp::setRPCSetUp(), RPCDigitizer::setRPCSimSetUp(), theDigitizer, and theRPCSimSetUp.

                                                                         {

  edm::ESHandle<RPCGeometry> hGeom;
  eventSetup.get<MuonGeometryRecord>().get( hGeom );
  const RPCGeometry *pGeom = &*hGeom;

  edm::ESHandle<RPCStripNoises> noiseRcd;
  eventSetup.get<RPCStripNoisesRcd>().get(noiseRcd);

   edm::ESHandle<RPCClusterSize> clsRcd;
   eventSetup.get<RPCClusterSizeRcd>().get(clsRcd);

   theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
//    theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), noiseRcd->getCls());
  
  theDigitizer->setGeometry( pGeom );
  theRPCSimSetUp->setGeometry( pGeom );
  theDigitizer->setRPCSimSetUp( theRPCSimSetUp );
}
virtual void RPCDigiProducer::endRun ( edm::Run ,
const edm::EventSetup  
) [inline, virtual]

Reimplemented from edm::EDProducer.

Definition at line 29 of file RPCDigiProducer.h.

{;}
void RPCDigiProducer::produce ( edm::Event e,
const edm::EventSetup c 
) [virtual]

Produces the EDM products,

Implements edm::EDProducer.

Definition at line 89 of file RPCDigiProducer.cc.

References collection_for_XF, RPCDigitizer::doAction(), edm::Event::getByLabel(), edm::Handle< T >::product(), edm::Event::put(), and theDigitizer.

                                                                          {

  edm::Handle<CrossingFrame<PSimHit> > cf;
  e.getByLabel("mix", collection_for_XF, cf);

  std::auto_ptr<MixCollection<PSimHit> > 
    hits( new MixCollection<PSimHit>(cf.product()) );

  // Create empty output
  std::auto_ptr<RPCDigiCollection> pDigis(new RPCDigiCollection());
  std::auto_ptr<RPCDigitizerSimLinks> RPCDigitSimLink(new RPCDigitizerSimLinks() );

  // run the digitizer
  theDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink);

  // store them in the event
  e.put(pDigis);
  e.put(RPCDigitSimLink,"RPCDigiSimLink");
}
void RPCDigiProducer::setRPCSetUp ( std::vector< RPCStripNoises::NoiseItem ,
std::vector< double >   
)

Member Data Documentation

std::string RPCDigiProducer::collection_for_XF [private]

Definition at line 42 of file RPCDigiProducer.h.

Referenced by produce(), and RPCDigiProducer().

Definition at line 38 of file RPCDigiProducer.h.

Referenced by beginRun(), produce(), RPCDigiProducer(), and ~RPCDigiProducer().

Definition at line 39 of file RPCDigiProducer.h.

Referenced by beginRun(), RPCDigiProducer(), and ~RPCDigiProducer().