CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/SimMuon/RPCDigitizer/src/RPCSim.cc

Go to the documentation of this file.
00001 #include "RPCSim.h"
00002 #include "SimMuon/RPCDigitizer/src/RPCSimSetUp.h"
00003 #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
00004 
00005 RPCSim::RPCSim(const edm::ParameterSet& config)
00006 {
00007 }
00008 
00009 void
00010 RPCSim::fillDigis(int rollDetId, RPCDigiCollection& digis)
00011 {
00012   //  theRpcDigiSimLinks.clear();
00013   std::vector<std::pair<int,int> > vdigi;
00014   vdigi.clear();
00015 
00016   for (std::set< std::pair<int,int> >::iterator i=strips.begin();
00017        i!=strips.end(); i++){
00018     if(i->second != -999){
00019       RPCDigi rpcDigi(i->first,i->second);
00020       //NCA
00021       digis.insertDigi(RPCDetId(rollDetId),rpcDigi);
00022       this->addLinks(i->first,i->second);
00023     }
00024   }
00025   strips.clear();
00026 }
00027 
00028 void RPCSim::addLinks(unsigned int strip, int bx) {
00029 
00030   std::pair<unsigned int, int > digi(strip, bx);
00031   std::pair<DetectorHitMap::iterator, DetectorHitMap::iterator> channelHitItr 
00032      = theDetectorHitMap.equal_range(digi);
00033 
00034   for( DetectorHitMap::iterator hitItr = channelHitItr.first; 
00035                                 hitItr != channelHitItr.second; ++hitItr){
00036     const PSimHit * hit = (hitItr->second);
00037 
00038     if(hit != 0) {
00039       theRpcDigiSimLinks.push_back( RPCDigiSimLink(digi, hit->entryPoint(),hit->momentumAtEntry(),
00040                                                    hit->timeOfFlight(),hit->energyLoss(),hit->particleType(), 
00041                                                    hit->detUnitId(), hit->trackId(), hit->eventId(), hit->processType() ) );
00042 
00043     }
00044   }
00045 }
00046 
00047 
00048 
00049