CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
RPCSimSimple Class Reference

#include <RPCSimSimple.h>

Inheritance diagram for RPCSimSimple:
RPCSim

Public Member Functions

 RPCSimSimple (const edm::ParameterSet &config)
 
void simulate (const RPCRoll *roll, const edm::PSimHitContainer &rpcHits, CLHEP::HepRandomEngine *) override
 
void simulateNoise (const RPCRoll *, CLHEP::HepRandomEngine *) override
 
 ~RPCSimSimple () override
 
- Public Member Functions inherited from RPCSim
const DigiSimLinksdigiSimLinks () const
 
virtual void fillDigis (int rollDetId, RPCDigiCollection &digis)
 
RPCSimSetUpgetRPCSimSetUp ()
 
const RPCDigiSimLinksrpcDigiSimLinks () const
 
void setRPCSimSetUp (RPCSimSetUp *setup)
 
virtual ~RPCSim ()
 

Private Member Functions

void init () override
 

Private Attributes

RPCSynchronizer_rpcSync
 
double gate
 
int N_hits
 
int nbxing
 
double rate
 

Additional Inherited Members

- Public Types inherited from RPCSim
typedef edm::DetSet
< StripDigiSimLink
DigiSimLinks
 
typedef edm::DetSet
< RPCDigiSimLink
RPCDigiSimLinks
 
- Protected Types inherited from RPCSim
typedef std::multimap
< std::pair< unsigned int, int >
, const PSimHit *, std::less
< std::pair< unsigned int, int > > > 
DetectorHitMap
 
- Protected Member Functions inherited from RPCSim
virtual void addLinks (unsigned int strip, int bx)
 
 RPCSim (const edm::ParameterSet &config)
 
- Protected Attributes inherited from RPCSim
std::set< RPCDigiirpc_digis
 
std::set< std::pair< int, int > > strips
 
DetectorHitMap theDetectorHitMap
 
DigiSimLinks theDigiSimLinks
 
RPCDigiSimLinks theRpcDigiSimLinks
 
RPCSimSetUptheSimSetUp
 

Detailed Description

Class for the RPC strip response simulation based on a very simple model

Author
Marcello Maggi – INFN Bari

Definition at line 19 of file RPCSimSimple.h.

Constructor & Destructor Documentation

RPCSimSimple::RPCSimSimple ( const edm::ParameterSet config)

Definition at line 20 of file RPCSimSimple.cc.

References _rpcSync, gate, edm::ParameterSet::getParameter(), nbxing, and rate.

20  : RPCSim(config) {
21  rate = config.getParameter<double>("Rate");
22  nbxing = config.getParameter<int>("Nbxing");
23  gate = config.getParameter<double>("Gate");
24 
25  _rpcSync = new RPCSynchronizer(config);
26 }
RPCSynchronizer * _rpcSync
Definition: RPCSimSimple.h:29
RPCSim(const edm::ParameterSet &config)
Definition: RPCSim.cc:5
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
RPCSimSimple::~RPCSimSimple ( )
override

Definition at line 28 of file RPCSimSimple.cc.

References _rpcSync.

28 { delete _rpcSync; }
RPCSynchronizer * _rpcSync
Definition: RPCSimSimple.h:29

Member Function Documentation

void RPCSimSimple::init ( void  )
inlineoverrideprivatevirtual

Implements RPCSim.

Definition at line 29 of file RPCSimSimple.h.

29 {};
void RPCSimSimple::simulate ( const RPCRoll roll,
const edm::PSimHitContainer rpcHits,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Implements RPCSim.

Definition at line 30 of file RPCSimSimple.cc.

References _rpcSync, edm::DetSet< T >::clear(), RPCSim::getRPCSimSetUp(), RPCSynchronizer::getSimHitBx(), RPCRoll::id(), DetId::rawId(), RPCSynchronizer::setRPCSimSetUp(), RPCRoll::specs(), RPCSim::strips, RPCSim::theDetectorHitMap, RPCSim::theRpcDigiSimLinks, and RPCRollSpecs::topology().

30  {
33  theDetectorHitMap.clear();
35 
36  const Topology& topology = roll->specs()->topology();
37  for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
38  // Here I hould check if the RPC are up side down;
39  const LocalPoint& entr = _hit->entryPoint();
40  int time_hit = _rpcSync->getSimHitBx(&(*_hit), engine);
41  // const LocalPoint& exit=_hit->exitPoint();
42 
43  std::pair<int, int> digi(topology.channel(entr) + 1, time_hit);
44 
45  theDetectorHitMap.insert(DetectorHitMap::value_type(digi, &(*_hit)));
46  strips.insert(digi);
47  }
48 }
RPCSynchronizer * _rpcSync
Definition: RPCSimSimple.h:29
DetectorHitMap theDetectorHitMap
Definition: RPCSim.h:68
void setRPCSimSetUp(RPCSimSetUp *simsetup)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
RPCSimSetUp * getRPCSimSetUp()
Definition: RPCSim.h:45
const RPCRollSpecs * specs() const
Definition: RPCRoll.cc:14
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
Definition: RPCSim.h:33
RPCDetId id() const
Definition: RPCRoll.cc:16
std::set< std::pair< int, int > > strips
Definition: RPCSim.h:55
const Topology & topology() const override
Definition: RPCRollSpecs.cc:36
void clear()
Definition: DetSet.h:71
RPCDigiSimLinks theRpcDigiSimLinks
Definition: RPCSim.h:70
void RPCSimSimple::simulateNoise ( const RPCRoll roll,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Implements RPCSim.

Definition at line 50 of file RPCSimSimple.cc.

References gate, mps_fire::i, RPCRoll::id(), RectangularStripTopology::localPosition(), TrapezoidalStripTopology::localPosition(), N_hits, nbxing, RPCRoll::nstrips(), rate, RPCDetId::region(), digitizers_cfi::strip, RectangularStripTopology::stripLength(), TrapezoidalStripTopology::stripLength(), RPCSim::strips, RPCRoll::topology(), x, hlt_dqm_clientPB-live_cfg::xmax, and hlt_dqm_clientPB-live_cfg::xmin.

50  {
51  RPCDetId rpcId = roll->id();
52  int nstrips = roll->nstrips();
53  double area = 0.0;
54 
55  if (rpcId.region() == 0) {
56  const RectangularStripTopology* top_ = dynamic_cast<const RectangularStripTopology*>(&(roll->topology()));
57  float xmin = (top_->localPosition(0.)).x();
58  float xmax = (top_->localPosition((float)roll->nstrips())).x();
59  float striplength = (top_->stripLength());
60  area = striplength * (xmax - xmin);
61  } else {
62  const TrapezoidalStripTopology* top_ = dynamic_cast<const TrapezoidalStripTopology*>(&(roll->topology()));
63  float xmin = (top_->localPosition(0.)).x();
64  float xmax = (top_->localPosition((float)roll->nstrips())).x();
65  float striplength = (top_->stripLength());
66  area = striplength * (xmax - xmin);
67  }
68 
69  double ave = rate * nbxing * gate * area * 1.0e-9;
70 
71  CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
72  N_hits = randPoissonQ.fire();
73 
74  for (int i = 0; i < N_hits; i++) {
75  int strip = static_cast<int>(CLHEP::RandFlat::shoot(engine, 1, nstrips));
76  int time_hit;
77  time_hit = (static_cast<int>(CLHEP::RandFlat::shoot(engine, (nbxing * gate) / gate))) - nbxing / 2;
78  std::pair<int, int> digi(strip, time_hit);
79  strips.insert(digi);
80  }
81 }
LocalPoint localPosition(float strip) const override
int nstrips() const
Definition: RPCRoll.cc:24
float stripLength() const override
RPCDetId id() const
Definition: RPCRoll.cc:16
std::set< std::pair< int, int > > strips
Definition: RPCSim.h:55
const Topology & topology() const override
Definition: RPCRoll.cc:18
float stripLength() const override
det heigth (strip length in the middle)
LocalPoint localPosition(float strip) const override
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53

Member Data Documentation

RPCSynchronizer* RPCSimSimple::_rpcSync
private

Definition at line 29 of file RPCSimSimple.h.

Referenced by RPCSimSimple(), simulate(), and ~RPCSimSimple().

double RPCSimSimple::gate
private

Definition at line 35 of file RPCSimSimple.h.

Referenced by RPCSimSimple(), and simulateNoise().

int RPCSimSimple::N_hits
private

Definition at line 32 of file RPCSimSimple.h.

Referenced by simulateNoise().

int RPCSimSimple::nbxing
private

Definition at line 33 of file RPCSimSimple.h.

Referenced by RPCSimSimple(), and simulateNoise().

double RPCSimSimple::rate
private

Definition at line 34 of file RPCSimSimple.h.

Referenced by RPCSimSimple(), and simulateNoise().