#include <SimMuon/RPCDigitizer/src/RPCDigitizer.h>
Public Types | |
typedef edm::DetSetVector < RPCDigiSimLink > | RPCDigiSimLinks |
Public Member Functions | |
void | doAction (MixCollection< PSimHit > &simHits, RPCDigiCollection &rpcDigis, RPCDigiSimLinks &rpcDigiSimLink) |
digitize | |
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) | |
void | setGeometry (const RPCGeometry *geom) |
sets geometry | |
void | setRPCSimSetUp (RPCSimSetUp *simsetup) |
~RPCDigitizer () | |
Private Attributes | |
const RPCGeometry * | theGeometry |
std::string | theName |
RPCSim * | theRPCSim |
RPCSimSetUp * | theSimSetUp |
Definition at line 27 of file RPCDigitizer.h.
Definition at line 30 of file RPCDigitizer.h.
RPCDigitizer::RPCDigitizer | ( | const edm::ParameterSet & | config | ) |
Definition at line 13 of file RPCDigitizer.cc.
References DBSPlugin::get(), edm::ParameterSet::getParameter(), theName, and theRPCSim.
00013 { 00014 theName = config.getParameter<std::string>("digiModel"); 00015 theRPCSim = RPCSimFactory::get()->create(theName,config.getParameter<edm::ParameterSet>("digiModelConfig")); 00016 }
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(), RPCSim::fillDigis(), findDet(), edm::DetSetVector< T >::insert(), LogDebug, RPCSim::rpcDigiSimLinks(), RPCSim::setRPCSimSetUp(), RPCSim::simulate(), RPCSim::simulateNoise(), theRPCSim, and theSimSetUp.
Referenced by RPCDigiProducer::produce().
00027 { 00028 00029 theRPCSim->setRPCSimSetUp(theSimSetUp); 00030 00031 // arrange the hits by roll 00032 std::map<int, edm::PSimHitContainer> hitMap; 00033 for(MixCollection<PSimHit>::MixItr hitItr = simHits.begin(); 00034 hitItr != simHits.end(); ++hitItr) 00035 { 00036 hitMap[hitItr->detUnitId()].push_back(*hitItr); 00037 } 00038 00039 // now loop over rolls and run the simulation for each one 00040 for(std::map<int, edm::PSimHitContainer>::const_iterator hitMapItr = hitMap.begin(); 00041 hitMapItr != hitMap.end(); ++hitMapItr) 00042 { 00043 int rollDetId = hitMapItr->first; 00044 const RPCRoll* roll = this->findDet(rollDetId); 00045 const edm::PSimHitContainer & rollSimHits = hitMapItr->second; 00046 00047 LogDebug("RPCDigitizer") << "RPCDigitizer: found " << rollSimHits.size() <<" hit(s) in the rpc roll"; 00048 TimeMe t2("RPCSim"); 00049 00050 theRPCSim->simulate(roll,rollSimHits); 00051 theRPCSim->simulateNoise(roll); 00052 theRPCSim->fillDigis(rollDetId,rpcDigis); 00053 rpcDigiSimLink.insert(theRPCSim->rpcDigiSimLinks()); 00054 00055 } 00056 }
finds the rpc det unit in the geometry associated with this det ID
Definition at line 58 of file RPCDigitizer.cc.
References RPCGeometry::idToDetUnit(), and theGeometry.
Referenced by doAction().
00058 { 00059 assert(theGeometry != 0); 00060 const GeomDetUnit* detUnit = theGeometry->idToDetUnit(RPCDetId(detId)); 00061 return dynamic_cast<const RPCRoll *>(detUnit); 00062 }
RPCSimSetUp* RPCDigitizer::getRPCSimSetUp | ( | ) | [inline] |
void RPCDigitizer::setGeometry | ( | const RPCGeometry * | geom | ) | [inline] |
sets geometry
Definition at line 43 of file RPCDigitizer.h.
References theGeometry.
Referenced by RPCDigiProducer::beginRun().
00043 {theGeometry = geom;}
void RPCDigitizer::setRPCSimSetUp | ( | RPCSimSetUp * | simsetup | ) | [inline] |
Definition at line 45 of file RPCDigitizer.h.
References theSimSetUp.
Referenced by RPCDigiProducer::beginRun().
00045 {theSimSetUp = simsetup;}
const RPCGeometry* RPCDigitizer::theGeometry [private] |
std::string RPCDigitizer::theName [private] |
RPCSim* RPCDigitizer::theRPCSim [private] |
Definition at line 54 of file RPCDigitizer.h.
Referenced by doAction(), RPCDigitizer(), and ~RPCDigitizer().
RPCSimSetUp* RPCDigitizer::theSimSetUp [private] |
Definition at line 55 of file RPCDigitizer.h.
Referenced by doAction(), getRPCSimSetUp(), and setRPCSimSetUp().