CMS 3D CMS Logo

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

#include <IRPCDigitizer.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 ()
 
 IRPCDigitizer (const edm::ParameterSet &config)
 
void setGeometry (const RPCGeometry *geom)
 sets geometry More...
 
void setRPCSimSetUp (RPCSimSetUp *simsetup)
 
 ~IRPCDigitizer ()
 

Private Attributes

const RPCGeometrytheGeometry
 
std::string theName
 
bool theNoise
 
std::unique_ptr< RPCSimtheRPCSim
 
RPCSimSetUptheSimSetUp
 

Detailed Description

Digitizer class for RPC

Author
Borislav Pavlov – University of Sofia

Definition at line 33 of file IRPCDigitizer.h.

Member Typedef Documentation

Definition at line 36 of file IRPCDigitizer.h.

Constructor & Destructor Documentation

IRPCDigitizer::IRPCDigitizer ( const edm::ParameterSet config)

Definition at line 12 of file IRPCDigitizer.cc.

References reco::get(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, theNoise, and ~IRPCDigitizer().

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

Referenced by IRPCDigitizer().

Member Function Documentation

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

Definition at line 21 of file IRPCDigitizer.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.

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

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

Definition at line 64 of file IRPCDigitizer.cc.

References RPCGeometry::idToDetUnit(), and theGeometry.

64  {
65  assert(theGeometry != nullptr);
66  const GeomDetUnit* detUnit = theGeometry->idToDetUnit(RPCDetId(detId));
67  return dynamic_cast<const RPCRoll *>(detUnit);
68 }
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: IRPCDigitizer.h:57
RPCSimSetUp* IRPCDigitizer::getRPCSimSetUp ( )
inline

Definition at line 51 of file IRPCDigitizer.h.

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

sets geometry

Definition at line 47 of file IRPCDigitizer.h.

References relativeConstraints::geom.

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

Definition at line 49 of file IRPCDigitizer.h.

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

Member Data Documentation

const RPCGeometry* IRPCDigitizer::theGeometry
private

Definition at line 57 of file IRPCDigitizer.h.

Referenced by doAction(), and findDet().

std::string IRPCDigitizer::theName
private

Definition at line 60 of file IRPCDigitizer.h.

bool IRPCDigitizer::theNoise
private

Definition at line 61 of file IRPCDigitizer.h.

Referenced by doAction(), and IRPCDigitizer().

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

Definition at line 58 of file IRPCDigitizer.h.

Referenced by doAction().

RPCSimSetUp* IRPCDigitizer::theSimSetUp
private

Definition at line 59 of file IRPCDigitizer.h.

Referenced by doAction().