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

◆ RPCDigiSimLinks

Definition at line 35 of file IRPCDigitizer.h.

Constructor & Destructor Documentation

◆ IRPCDigitizer()

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

Definition at line 12 of file IRPCDigitizer.cc.

References get, and AlCaHLTBitMon_QueryRunRegistry::string.

13  : theRPCSim{RPCSimFactory::get()->create(config.getParameter<std::string>("digiIRPCModel"),
14  config.getParameter<edm::ParameterSet>("digiIRPCModelConfig"))} {
15  theNoise = config.getParameter<bool>("doBkgNoise");
16 }
Definition: config.py:1
#define get
std::unique_ptr< RPCSim > theRPCSim
Definition: IRPCDigitizer.h:57

◆ ~IRPCDigitizer()

IRPCDigitizer::~IRPCDigitizer ( )
default

Member Function Documentation

◆ doAction()

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

Definition at line 20 of file IRPCDigitizer.cc.

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

Referenced by RPCandIRPCDigiProducer::produce().

23  {
24  theRPCSim->setRPCSimSetUp(theSimSetUp);
25 
26  // arrange the hits by roll
27  std::map<int, edm::PSimHitContainer> hitMap;
28  for (MixCollection<PSimHit>::MixItr hitItr = simHits.begin(); hitItr != simHits.end(); ++hitItr) {
29  hitMap[hitItr->detUnitId()].push_back(*hitItr);
30  }
31 
32  if (!theGeometry) {
33  throw cms::Exception("Configuration")
34  << "IRPCDigitizer requires the RPCGeometry \n which is not present in the configuration file. You must add "
35  "the service\n in the configuration file or remove the modules that require it.";
36  }
37 
38  const std::vector<const RPCRoll*>& rpcRolls = theGeometry->rolls();
39  for (auto r = rpcRolls.begin(); r != rpcRolls.end(); r++) {
40  RPCDetId id = (*r)->id();
41  const edm::PSimHitContainer& rollSimHits = hitMap[id];
42 
43  if ((*r)->isIRPC()) {
44  theRPCSim->simulate(*r, rollSimHits, engine);
45 
46  if (theNoise) {
47  theRPCSim->simulateNoise(*r, engine);
48  }
49  }
50 
51  theRPCSim->fillDigis((*r)->id(), rpcDigis);
52  rpcDigiSimLink.insert(theRPCSim->rpcDigiSimLinks());
53  }
54 }
const RPCGeometry * theGeometry
Definition: IRPCDigitizer.h:56
RPCSimSetUp * theSimSetUp
Definition: IRPCDigitizer.h:58
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:44
std::vector< PSimHit > PSimHitContainer
std::unique_ptr< RPCSim > theRPCSim
Definition: IRPCDigitizer.h:57

◆ findDet()

const RPCRoll * IRPCDigitizer::findDet ( int  detId) const

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

Definition at line 56 of file IRPCDigitizer.cc.

References cms::cuda::assert(), RPCGeometry::idToDetUnit(), and theGeometry.

56  {
57  assert(theGeometry != nullptr);
58  const GeomDetUnit* detUnit = theGeometry->idToDetUnit(RPCDetId(detId));
59  return dynamic_cast<const RPCRoll*>(detUnit);
60 }
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: RPCGeometry.cc:30
assert(be >=bs)
const RPCGeometry * theGeometry
Definition: IRPCDigitizer.h:56

◆ getRPCSimSetUp()

RPCSimSetUp* IRPCDigitizer::getRPCSimSetUp ( )
inline

Definition at line 50 of file IRPCDigitizer.h.

References theSimSetUp.

50 { return theSimSetUp; }
RPCSimSetUp * theSimSetUp
Definition: IRPCDigitizer.h:58

◆ setGeometry()

void IRPCDigitizer::setGeometry ( const RPCGeometry geom)
inline

sets geometry

Definition at line 46 of file IRPCDigitizer.h.

References relativeConstraints::geom, and theGeometry.

Referenced by RPCandIRPCDigiProducer::beginRun().

46 { theGeometry = geom; }
const RPCGeometry * theGeometry
Definition: IRPCDigitizer.h:56

◆ setRPCSimSetUp()

void IRPCDigitizer::setRPCSimSetUp ( RPCSimSetUp simsetup)
inline

Definition at line 48 of file IRPCDigitizer.h.

References theSimSetUp.

Referenced by RPCandIRPCDigiProducer::beginRun().

48 { theSimSetUp = simsetup; }
RPCSimSetUp * theSimSetUp
Definition: IRPCDigitizer.h:58

Member Data Documentation

◆ theGeometry

const RPCGeometry* IRPCDigitizer::theGeometry
private

Definition at line 56 of file IRPCDigitizer.h.

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

◆ theName

std::string IRPCDigitizer::theName
private

Definition at line 59 of file IRPCDigitizer.h.

◆ theNoise

bool IRPCDigitizer::theNoise
private

Definition at line 60 of file IRPCDigitizer.h.

Referenced by doAction().

◆ theRPCSim

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

Definition at line 57 of file IRPCDigitizer.h.

Referenced by doAction().

◆ theSimSetUp

RPCSimSetUp* IRPCDigitizer::theSimSetUp
private

Definition at line 58 of file IRPCDigitizer.h.

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