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

List of all members.

Public Types

typedef
RPCDigitizer::RPCDigiSimLinks 
RPCDigitizerSimLinks

Public Member Functions

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

Private Attributes

std::string collection_for_XF
std::string mix_
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(), mix_, AlCaHLTBitMon_QueryRunRegistry::string, theDigitizer, and theRPCSimSetUp.

                                                          {

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

  //Name of Collection used for create the XF 
  mix_ = ps.getParameter<std::string>("mixLabel");
  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 65 of file RPCDigiProducer.cc.

References theDigitizer, and theRPCSimSetUp.

                                  {
  delete theDigitizer;
  delete theRPCSimSetUp;
}

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 70 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 );
}
void RPCDigiProducer::produce ( edm::Event e,
const edm::EventSetup c 
) [override, virtual]

Produces the EDM products,

Implements edm::EDProducer.

Definition at line 90 of file RPCDigiProducer.cc.

References collection_for_XF, RPCDigitizer::doAction(), edm::Event::getByLabel(), mix_, 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 ( const std::vector< RPCStripNoises::NoiseItem > &  ,
const 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().

std::string RPCDigiProducer::mix_ [private]

Definition at line 41 of file RPCDigiProducer.h.

Referenced by produce(), and RPCDigiProducer().

Definition at line 37 of file RPCDigiProducer.h.

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

Definition at line 38 of file RPCDigiProducer.h.

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