#include <RPCDigitizer.h>
Public Types | |
typedef edm::DetSetVector < RPCDigiSimLink > | RPCDigiSimLinks |
Public Member Functions | |
void | doAction (MixCollection< PSimHit > &simHits, RPCDigiCollection &rpcDigis, RPCDigiSimLinks &rpcDigiSimLink) |
const RPCRoll * | findDet (int detId) const |
finds the rpc det unit in the geometry associated with this det ID | |
RPCSimSetUp * | getRPCSimSetUp () |
RPCDigitizer (const edm::ParameterSet &config, CLHEP::HepRandomEngine &) | |
void | setGeometry (const RPCGeometry *geom) |
sets geometry | |
void | setRPCSimSetUp (RPCSimSetUp *simsetup) |
~RPCDigitizer () | |
Private Attributes | |
const RPCGeometry * | theGeometry |
std::string | theName |
RPCSim * | theRPCSim |
RPCSimSetUp * | theSimSetUp |
Digitizer class for RPC
Definition at line 28 of file RPCDigitizer.h.
Definition at line 31 of file RPCDigitizer.h.
RPCDigitizer::RPCDigitizer | ( | const edm::ParameterSet & | config, |
CLHEP::HepRandomEngine & | eng | ||
) |
Definition at line 12 of file RPCDigitizer.cc.
References reco::get(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, theName, and theRPCSim.
{ theName = config.getParameter<std::string>("digiModel"); theRPCSim = RPCSimFactory::get()->create(theName,config.getParameter<edm::ParameterSet>("digiModelConfig")); theRPCSim->setRandomEngine(eng); }
RPCDigitizer::~RPCDigitizer | ( | ) |
void RPCDigitizer::doAction | ( | MixCollection< PSimHit > & | simHits, |
RPCDigiCollection & | rpcDigis, | ||
RPCDigiSimLinks & | rpcDigiSimLink | ||
) |
digitize
Definition at line 24 of file RPCDigitizer.cc.
References MixCollection< T >::begin(), MixCollection< T >::end(), Exception, RPCSim::fillDigis(), edm::DetSetVector< T >::insert(), alignCSCRings::r, RPCGeometry::rolls(), RPCSim::rpcDigiSimLinks(), RPCSim::setRPCSimSetUp(), RPCSim::simulate(), RPCSim::simulateNoise(), theGeometry, theRPCSim, and theSimSetUp.
Referenced by RPCDigiProducer::produce().
{ theRPCSim->setRPCSimSetUp(theSimSetUp); // arrange the hits by roll std::map<int, edm::PSimHitContainer> hitMap; for(MixCollection<PSimHit>::MixItr hitItr = simHits.begin(); hitItr != simHits.end(); ++hitItr) { hitMap[hitItr->detUnitId()].push_back(*hitItr); } if ( ! theGeometry) { throw cms::Exception("Configuration") << "RPCDigitizer requires the RPCGeometry \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."; } std::vector<RPCRoll*> rpcRolls = theGeometry->rolls() ; for(std::vector<RPCRoll*>::iterator r = rpcRolls.begin(); r != rpcRolls.end(); r++){ const edm::PSimHitContainer & rollSimHits = hitMap[(*r)->id()]; // LogDebug("RPCDigitizer") << "RPCDigitizer: found " << rollSimHits.size() // <<" hit(s) in the rpc roll"; theRPCSim->simulate(*r,rollSimHits); theRPCSim->simulateNoise(*r); theRPCSim->fillDigis((*r)->id(),rpcDigis); rpcDigiSimLink.insert(theRPCSim->rpcDigiSimLinks()); } }
const RPCRoll * RPCDigitizer::findDet | ( | int | detId | ) | const |
finds the rpc det unit in the geometry associated with this det ID
Definition at line 61 of file RPCDigitizer.cc.
References RPCGeometry::idToDetUnit(), RPCDetId, and theGeometry.
{ assert(theGeometry != 0); const GeomDetUnit* detUnit = theGeometry->idToDetUnit(RPCDetId(detId)); return dynamic_cast<const RPCRoll *>(detUnit); }
RPCSimSetUp* RPCDigitizer::getRPCSimSetUp | ( | ) | [inline] |
void RPCDigitizer::setGeometry | ( | const RPCGeometry * | geom | ) | [inline] |
sets geometry
Definition at line 44 of file RPCDigitizer.h.
References relativeConstraints::geom, and theGeometry.
Referenced by RPCDigiProducer::beginRun().
{theGeometry = geom;}
void RPCDigitizer::setRPCSimSetUp | ( | RPCSimSetUp * | simsetup | ) | [inline] |
Definition at line 46 of file RPCDigitizer.h.
References theSimSetUp.
Referenced by RPCDigiProducer::beginRun().
{theSimSetUp = simsetup;}
const RPCGeometry* RPCDigitizer::theGeometry [private] |
Definition at line 54 of file RPCDigitizer.h.
Referenced by doAction(), findDet(), and setGeometry().
std::string RPCDigitizer::theName [private] |
Definition at line 57 of file RPCDigitizer.h.
Referenced by RPCDigitizer().
RPCSim* RPCDigitizer::theRPCSim [private] |
Definition at line 55 of file RPCDigitizer.h.
Referenced by doAction(), RPCDigitizer(), and ~RPCDigitizer().
RPCSimSetUp* RPCDigitizer::theSimSetUp [private] |
Definition at line 56 of file RPCDigitizer.h.
Referenced by doAction(), getRPCSimSetUp(), and setRPCSimSetUp().