CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

RPCDigitizer Class Reference

#include <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)
const RPCRollfindDet (int detId) const
 finds the rpc det unit in the geometry associated with this det ID
RPCSimSetUpgetRPCSimSetUp ()
 RPCDigitizer (const edm::ParameterSet &config, CLHEP::HepRandomEngine &)
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 28 of file RPCDigitizer.h.


Member Typedef Documentation

Definition at line 31 of file RPCDigitizer.h.


Constructor & Destructor Documentation

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

Definition at line 18 of file RPCDigitizer.cc.

References theRPCSim.

                            {
  if( theRPCSim )
    delete theRPCSim;
  theRPCSim = 0;
}

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

Definition at line 48 of file RPCDigitizer.h.

References theSimSetUp.

{ return theSimSetUp; }
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().

void RPCDigitizer::setRPCSimSetUp ( RPCSimSetUp simsetup) [inline]

Definition at line 46 of file RPCDigitizer.h.

References theSimSetUp.

Referenced by RPCDigiProducer::beginRun().

{theSimSetUp = simsetup;}

Member Data Documentation

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

Definition at line 55 of file RPCDigitizer.h.

Referenced by doAction(), RPCDigitizer(), and ~RPCDigitizer().

Definition at line 56 of file RPCDigitizer.h.

Referenced by doAction(), getRPCSimSetUp(), and setRPCSimSetUp().