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

◆ RPCDigiSimLinks

Definition at line 35 of file RPCDigitizer.h.

Constructor & Destructor Documentation

◆ RPCDigitizer()

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

Definition at line 12 of file RPCDigitizer.cc.

13  : theRPCSim{RPCSimFactory::get()->create(config.getParameter<std::string>("digiModel"),
14  config.getParameter<edm::ParameterSet>("digiModelConfig"))},
15  theNoise{config.getParameter<bool>("doBkgNoise")} {}

References get, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~RPCDigitizer()

RPCDigitizer::~RPCDigitizer ( )
default

Member Function Documentation

◆ doAction()

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

Definition at line 19 of file RPCDigitizer.cc.

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

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

Referenced by RPCDigiProducer::produce(), and RPCandIRPCDigiProducer::produce().

◆ findDet()

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

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

Definition at line 55 of file RPCDigitizer.cc.

55  {
56  assert(theGeometry != nullptr);
57  const GeomDetUnit* detUnit = theGeometry->idToDetUnit(RPCDetId(detId));
58  return dynamic_cast<const RPCRoll*>(detUnit);
59 }

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

◆ getRPCSimSetUp()

RPCSimSetUp* RPCDigitizer::getRPCSimSetUp ( )
inline

Definition at line 50 of file RPCDigitizer.h.

50 { return theSimSetUp; }

References theSimSetUp.

◆ setGeometry()

void RPCDigitizer::setGeometry ( const RPCGeometry geom)
inline

sets geometry

Definition at line 46 of file RPCDigitizer.h.

46 { theGeometry = geom; }

References relativeConstraints::geom, and theGeometry.

Referenced by RPCDigiProducer::beginRun(), and RPCandIRPCDigiProducer::beginRun().

◆ setRPCSimSetUp()

void RPCDigitizer::setRPCSimSetUp ( RPCSimSetUp simsetup)
inline

Definition at line 48 of file RPCDigitizer.h.

48 { theSimSetUp = simsetup; }

References theSimSetUp.

Referenced by RPCDigiProducer::beginRun(), and RPCandIRPCDigiProducer::beginRun().

Member Data Documentation

◆ theGeometry

const RPCGeometry* RPCDigitizer::theGeometry
private

Definition at line 56 of file RPCDigitizer.h.

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

◆ theNoise

bool RPCDigitizer::theNoise
private

Definition at line 59 of file RPCDigitizer.h.

Referenced by doAction().

◆ theRPCSim

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

Definition at line 57 of file RPCDigitizer.h.

Referenced by doAction().

◆ theSimSetUp

RPCSimSetUp* RPCDigitizer::theSimSetUp
private

Definition at line 58 of file RPCDigitizer.h.

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

RPCDigitizer::theNoise
bool theNoise
Definition: RPCDigitizer.h:59
RPCDigitizer::theSimSetUp
RPCSimSetUp * theSimSetUp
Definition: RPCDigitizer.h:58
GeomDet
Definition: GeomDet.h:27
RPCDetId
Definition: RPCDetId.h:16
cms::cuda::assert
assert(be >=bs)
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
MixCollection::MixItr
Definition: MixCollection.h:61
RPCGeometry::idToDetUnit
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: RPCGeometry.cc:30
config
Definition: config.py:1
RPCDigitizer::theRPCSim
std::unique_ptr< RPCSim > theRPCSim
Definition: RPCDigitizer.h:57
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RPCDigitizer::theGeometry
const RPCGeometry * theGeometry
Definition: RPCDigitizer.h:56
edm::ParameterSet
Definition: ParameterSet.h:47
get
#define get
alignCSCRings.r
r
Definition: alignCSCRings.py:93
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
Exception
Definition: hltDiff.cc:245
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
RPCGeometry::rolls
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:44