CMS 3D CMS Logo

RPCDigitizer Class Reference

Digitizer class for RPC. More...

#include <SimMuon/RPCDigitizer/src/RPCDigitizer.h>

List of all members.

Public Types

typedef edm::DetSetVector
< RPCDigiSimLink
RPCDigiSimLinks

Public Member Functions

void doAction (MixCollection< PSimHit > &simHits, RPCDigiCollection &rpcDigis, RPCDigiSimLinks &rpcDigiSimLink)
 digitize
const RPCRollfindDet (int detId) const
 finds the rpc det unit in the geometry associated with this det ID
RPCSimSetUpgetRPCSimSetUp ()
 RPCDigitizer (const edm::ParameterSet &config)
void setGeometry (const RPCGeometry *geom)
 sets geometry
void setRPCSimSetUp (RPCSimSetUp *simsetup)
 ~RPCDigitizer ()

Private Attributes

const RPCGeometrytheGeometry
std::string theName
RPCSimtheRPCSim
RPCSimSetUptheSimSetUp


Detailed Description

Digitizer class for RPC.

Author:
Marcello Maggi -- INFN Bari

Definition at line 27 of file RPCDigitizer.h.


Member Typedef Documentation

typedef edm::DetSetVector<RPCDigiSimLink> RPCDigitizer::RPCDigiSimLinks

Definition at line 30 of file RPCDigitizer.h.


Constructor & Destructor Documentation

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 (  ) 

Definition at line 18 of file RPCDigitizer.cc.

References theRPCSim.

00018                             {
00019   if( theRPCSim )
00020     delete theRPCSim;
00021   theRPCSim = 0;
00022 }


Member Function Documentation

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 }

const RPCRoll * RPCDigitizer::findDet ( int  detId  )  const

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]

Definition at line 47 of file RPCDigitizer.h.

References theSimSetUp.

00047 { return theSimSetUp; }

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;}


Member Data Documentation

const RPCGeometry* RPCDigitizer::theGeometry [private]

Definition at line 53 of file RPCDigitizer.h.

Referenced by findDet(), and setGeometry().

std::string RPCDigitizer::theName [private]

Definition at line 56 of file RPCDigitizer.h.

Referenced by RPCDigitizer().

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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:56 2009 for CMSSW by  doxygen 1.5.4