CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
RPCDigitizer Class Reference

#include <RPCDigitizer.h>

Public Types

typedef edm::DetSetVector< RPCDigiSimLinkRPCDigiSimLinks
 

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
 
bool theNoise
 
std::unique_ptr< 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, theNoise, and ~RPCDigitizer().

12  :
13  theRPCSim{RPCSimFactory::get()->create(config.getParameter<std::string>("digiModel"),
14  config.getParameter<edm::ParameterSet>("digiModelConfig"))},
15  theNoise{config.getParameter<bool>("doBkgNoise")}
16 {}
T getParameter(std::string const &) const
std::unique_ptr< RPCSim > theRPCSim
Definition: RPCDigitizer.h:58
T get(const Candidate &c)
Definition: component.h:55
RPCDigitizer::~RPCDigitizer ( )
default

Referenced by RPCDigitizer().

Member Function Documentation

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

Definition at line 20 of file RPCDigitizer.cc.

References MixCollection< T >::begin(), MixCollection< T >::end(), Exception, triggerObjects_cff::id, edm::DetSetVector< T >::insert(), alignCSCRings::r, RPCGeometry::rolls(), theGeometry, theNoise, theRPCSim, and theSimSetUp.

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

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

Definition at line 63 of file RPCDigitizer.cc.

References RPCGeometry::idToDetUnit(), and theGeometry.

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

Definition at line 51 of file RPCDigitizer.h.

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

sets geometry

Definition at line 47 of file RPCDigitizer.h.

References relativeConstraints::geom.

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

Definition at line 49 of file RPCDigitizer.h.

49 {theSimSetUp = simsetup;}
RPCSimSetUp * theSimSetUp
Definition: RPCDigitizer.h:59

Member Data Documentation

const RPCGeometry* RPCDigitizer::theGeometry
private

Definition at line 57 of file RPCDigitizer.h.

Referenced by doAction(), and findDet().

bool RPCDigitizer::theNoise
private

Definition at line 60 of file RPCDigitizer.h.

Referenced by doAction(), and RPCDigitizer().

std::unique_ptr<RPCSim> RPCDigitizer::theRPCSim
private

Definition at line 58 of file RPCDigitizer.h.

Referenced by doAction().

RPCSimSetUp* RPCDigitizer::theSimSetUp
private

Definition at line 59 of file RPCDigitizer.h.

Referenced by doAction().