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, CLHEP::HepRandomEngine *)
 
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)
 
void setGeometry (const RPCGeometry *geom)
 sets geometry More...
 
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 33 of file RPCDigitizer.h.

Member Typedef Documentation

Definition at line 36 of file RPCDigitizer.h.

Constructor & Destructor Documentation

RPCDigitizer::RPCDigitizer ( const edm::ParameterSet config)

Definition at line 12 of file RPCDigitizer.cc.

References reco::get(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, theName, and theRPCSim.

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

Definition at line 17 of file RPCDigitizer.cc.

References theRPCSim.

17  {
18  if( theRPCSim )
19  delete theRPCSim;
20  theRPCSim = 0;
21 }
RPCSim * theRPCSim
Definition: RPCDigitizer.h:61

Member Function Documentation

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

digitize

Definition at line 23 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, theRPCSim, and theSimSetUp.

Referenced by RPCDigiProducer::produce().

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

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

Definition at line 54 of file RPCDigitizer.h.

References theSimSetUp.

54 { return theSimSetUp; }
RPCSimSetUp * theSimSetUp
Definition: RPCDigitizer.h:62
void RPCDigitizer::setGeometry ( const RPCGeometry geom)
inline

sets geometry

Definition at line 50 of file RPCDigitizer.h.

References relativeConstraints::geom, and theGeometry.

Referenced by RPCDigiProducer::beginRun().

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

Definition at line 52 of file RPCDigitizer.h.

References theSimSetUp.

Referenced by RPCDigiProducer::beginRun().

52 {theSimSetUp = simsetup;}
RPCSimSetUp * theSimSetUp
Definition: RPCDigitizer.h:62

Member Data Documentation

const RPCGeometry* RPCDigitizer::theGeometry
private

Definition at line 60 of file RPCDigitizer.h.

Referenced by doAction(), findDet(), and setGeometry().

std::string RPCDigitizer::theName
private

Definition at line 63 of file RPCDigitizer.h.

Referenced by RPCDigitizer().

RPCSim* RPCDigitizer::theRPCSim
private

Definition at line 61 of file RPCDigitizer.h.

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

RPCSimSetUp* RPCDigitizer::theSimSetUp
private

Definition at line 62 of file RPCDigitizer.h.

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