CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
RPCDigitizer Class Reference

#include <RPCDigitizer.h>

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 More...
 
RPCSimSetUpgetRPCSimSetUp ()
 
 RPCDigitizer (const edm::ParameterSet &config, CLHEP::HepRandomEngine &)
 
void setGeometry (const RPCGeometry *geom)
 sets geometry More...
 
void setRPCSimSetUp (RPCSimSetUp *simsetup)
 
 ~RPCDigitizer ()
 

Private Attributes

const RPCGeometrytheGeometry
 
std::string theName
 
bool theNoise
 
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, theNoise, and theRPCSim.

12  {
13  theName = config.getParameter<std::string>("digiModel");
14  theRPCSim = RPCSimFactory::get()->create(theName,config.getParameter<edm::ParameterSet>("digiModelConfig"));
15  theRPCSim->setRandomEngine(eng);
16  theNoise=config.getParameter<bool>("doBkgNoise");
17 }
T getParameter(std::string const &) const
RPCSim * theRPCSim
Definition: RPCDigitizer.h:55
std::string theName
Definition: RPCDigitizer.h:57
T get(const Candidate &c)
Definition: component.h:55
RPCDigitizer::~RPCDigitizer ( )

Definition at line 19 of file RPCDigitizer.cc.

References theRPCSim.

19  {
20  if( theRPCSim )
21  delete theRPCSim;
22  theRPCSim = 0;
23 }
RPCSim * theRPCSim
Definition: RPCDigitizer.h:55

Member Function Documentation

void RPCDigitizer::doAction ( MixCollection< PSimHit > &  simHits,
RPCDigiCollection rpcDigis,
RPCDigiSimLinks rpcDigiSimLink 
)

digitize

Definition at line 25 of file RPCDigitizer.cc.

References MixCollection< T >::begin(), MixCollection< T >::end(), edm::hlt::Exception, RPCSim::fillDigis(), edm::DetSetVector< T >::insert(), alignCSCRings::r, RPCGeometry::rolls(), RPCSim::rpcDigiSimLinks(), RPCSim::setRPCSimSetUp(), RPCSim::simulate(), RPCSim::simulateNoise(), theGeometry, theNoise, theRPCSim, and theSimSetUp.

Referenced by RPCDigiProducer::produce().

28 {
29 
31 
32  // arrange the hits by roll
33  std::map<int, edm::PSimHitContainer> hitMap;
34  for(MixCollection<PSimHit>::MixItr hitItr = simHits.begin();
35  hitItr != simHits.end(); ++hitItr)
36  {
37  hitMap[hitItr->detUnitId()].push_back(*hitItr);
38  }
39 
40  if ( ! theGeometry) {
41  throw cms::Exception("Configuration")
42  << "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.";
43  }
44 
45 
46  std::vector<RPCRoll*> rpcRolls = theGeometry->rolls() ;
47  for(std::vector<RPCRoll*>::iterator r = rpcRolls.begin();
48  r != rpcRolls.end(); r++){
49 
50  const edm::PSimHitContainer & rollSimHits = hitMap[(*r)->id()];
51 
52 // LogDebug("RPCDigitizer") << "RPCDigitizer: found " << rollSimHits.size()
53 // <<" hit(s) in the rpc roll";
54 
55  theRPCSim->simulate(*r,rollSimHits);
56  if(theNoise){
58  }
59  theRPCSim->fillDigis((*r)->id(),rpcDigis);
60  rpcDigiSimLink.insert(theRPCSim->rpcDigiSimLinks());
61  }
62 }
const RPCDigiSimLinks & rpcDigiSimLinks() const
Definition: RPCSim.h:50
RPCSim * theRPCSim
Definition: RPCDigitizer.h:55
RPCSimSetUp * theSimSetUp
Definition: RPCDigitizer.h:56
iterator end()
void setRPCSimSetUp(RPCSimSetUp *setup)
Definition: RPCSim.h:45
virtual void fillDigis(int rollDetId, RPCDigiCollection &digis)
Definition: RPCSim.cc:10
iterator begin()
const RPCGeometry * theGeometry
Definition: RPCDigitizer.h:54
virtual void simulateNoise(const RPCRoll *roll)=0
std::vector< PSimHit > PSimHitContainer
virtual void simulate(const RPCRoll *roll, const edm::PSimHitContainer &rpcHits)=0
const std::vector< RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:67
const RPCRoll * RPCDigitizer::findDet ( int  detId) const

finds the rpc det unit in the geometry associated with this det ID

Definition at line 64 of file RPCDigitizer.cc.

References RPCGeometry::idToDetUnit(), RPCDetId, and theGeometry.

64  {
65  assert(theGeometry != 0);
66  const GeomDetUnit* detUnit = theGeometry->idToDetUnit(RPCDetId(detId));
67  return dynamic_cast<const RPCRoll *>(detUnit);
68 }
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: RPCGeometry.cc:48
const RPCGeometry * theGeometry
Definition: RPCDigitizer.h:54
RPCSimSetUp* RPCDigitizer::getRPCSimSetUp ( )
inline

Definition at line 48 of file RPCDigitizer.h.

References theSimSetUp.

48 { return theSimSetUp; }
RPCSimSetUp * theSimSetUp
Definition: RPCDigitizer.h:56
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().

44 {theGeometry = geom;}
const RPCGeometry * theGeometry
Definition: RPCDigitizer.h:54
void RPCDigitizer::setRPCSimSetUp ( RPCSimSetUp simsetup)
inline

Definition at line 46 of file RPCDigitizer.h.

References theSimSetUp.

Referenced by RPCDigiProducer::beginRun().

46 {theSimSetUp = simsetup;}
RPCSimSetUp * theSimSetUp
Definition: RPCDigitizer.h:56

Member Data Documentation

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

bool RPCDigitizer::theNoise
private

Definition at line 58 of file RPCDigitizer.h.

Referenced by doAction(), and 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().