CMS 3D CMS Logo

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

#include <RPCSimParam.h>

Inheritance diagram for RPCSimParam:
RPCSim

Public Member Functions

 RPCSimParam (const edm::ParameterSet &config)
 
void simulate (const RPCRoll *roll, const edm::PSimHitContainer &rpcHits, CLHEP::HepRandomEngine *) override
 
void simulateNoise (const RPCRoll *, CLHEP::HepRandomEngine *) override
 
 ~RPCSimParam () 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 aveCls
 
double aveEff
 
double dtimCs
 
double gate
 
double lbGate
 
int N_hits
 
int nbxing
 
double rate
 
double resEle
 
double resRPC
 
bool rpcdigiprint
 
double sspeed
 
double timOff
 

Additional Inherited Members

- Public Types inherited from RPCSim
typedef edm::DetSet< StripDigiSimLinkDigiSimLinks
 
typedef edm::DetSet< RPCDigiSimLinkRPCDigiSimLinks
 
- 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 parametrized model (ORCA-based)

Author
Marcello Maggi – INFN Bari

Definition at line 20 of file RPCSimParam.h.

Constructor & Destructor Documentation

◆ RPCSimParam()

RPCSimParam::RPCSimParam ( const edm::ParameterSet config)

Definition at line 12 of file RPCSimParam.cc.

12  : RPCSim(config) {
13  aveEff = config.getParameter<double>("averageEfficiency");
14  aveCls = config.getParameter<double>("averageClusterSize");
15  resRPC = config.getParameter<double>("timeResolution");
16  timOff = config.getParameter<double>("timingRPCOffset");
17  dtimCs = config.getParameter<double>("deltatimeAdjacentStrip");
18  resEle = config.getParameter<double>("timeJitter");
19  sspeed = config.getParameter<double>("signalPropagationSpeed");
20  lbGate = config.getParameter<double>("linkGateWidth");
21  rpcdigiprint = config.getParameter<bool>("printOutDigitizer");
22 
23  rate = config.getParameter<double>("Rate");
24  nbxing = config.getParameter<int>("Nbxing");
25  gate = config.getParameter<double>("Gate");
26 
27  if (rpcdigiprint) {
28  std::cout << "Average Efficiency = " << aveEff << std::endl;
29  std::cout << "Average Cluster Size = " << aveCls << " strips" << std::endl;
30  std::cout << "RPC Time Resolution = " << resRPC << " ns" << std::endl;
31  std::cout << "RPC Signal formation time = " << timOff << " ns" << std::endl;
32  std::cout << "RPC adjacent strip delay = " << dtimCs << " ns" << std::endl;
33  std::cout << "Electronic Jitter = " << resEle << " ns" << std::endl;
34  std::cout << "Signal propagation time = " << sspeed << " x c" << std::endl;
35  std::cout << "Link Board Gate Width = " << lbGate << " ns" << std::endl;
36  }
37 
39 }

References _rpcSync, aveCls, aveEff, gather_cfg::cout, dtimCs, gate, lbGate, nbxing, rate, resEle, resRPC, rpcdigiprint, sspeed, and timOff.

◆ ~RPCSimParam()

RPCSimParam::~RPCSimParam ( )
override

Definition at line 41 of file RPCSimParam.cc.

41 { delete _rpcSync; }

References _rpcSync.

Member Function Documentation

◆ init()

void RPCSimParam::init ( void  )
inlineoverrideprivatevirtual

Implements RPCSim.

Definition at line 30 of file RPCSimParam.h.

30 {};

◆ simulate()

void RPCSimParam::simulate ( const RPCRoll roll,
const edm::PSimHitContainer rpcHits,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Implements RPCSim.

Definition at line 43 of file RPCSimParam.cc.

43  {
46  theDetectorHitMap.clear();
48 
49  const Topology& topology = roll->specs()->topology();
50 
51  for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin(); _hit != rpcHits.end(); ++_hit) {
52  // Here I hould check if the RPC are up side down;
53  const LocalPoint& entr = _hit->entryPoint();
54  int time_hit = _rpcSync->getSimHitBx(&(*_hit), engine);
55 
56  // Effinciecy
57  float eff = CLHEP::RandFlat::shoot(engine);
58  if (eff < aveEff) {
59  int centralStrip = topology.channel(entr) + 1;
60  int fstrip = centralStrip;
61  int lstrip = centralStrip;
62  // Compute the cluster size
63  double w = CLHEP::RandFlat::shoot(engine);
64  if (w < 1.e-10)
65  w = 1.e-10;
66  int clsize = static_cast<int>(-1. * aveCls * log(w) + 1.);
67  std::vector<int> cls;
68  cls.push_back(centralStrip);
69  if (clsize > 1) {
70  for (int cl = 0; cl < (clsize - 1) / 2; cl++)
71  if (centralStrip - cl - 1 >= 1) {
72  fstrip = centralStrip - cl - 1;
73  cls.push_back(fstrip);
74  }
75  for (int cl = 0; cl < (clsize - 1) / 2; cl++)
76  if (centralStrip + cl + 1 <= roll->nstrips()) {
77  lstrip = centralStrip + cl + 1;
78  cls.push_back(lstrip);
79  }
80  if (clsize % 2 == 0) {
81  // insert the last strip according to the
82  // simhit position in the central strip
83  double deltaw = roll->centreOfStrip(centralStrip).x() - entr.x();
84  if (deltaw < 0.) {
85  if (lstrip < roll->nstrips()) {
86  lstrip++;
87  cls.push_back(lstrip);
88  }
89  } else {
90  if (fstrip > 1) {
91  fstrip--;
92  cls.push_back(fstrip);
93  }
94  }
95  }
96  }
97 
98  for (std::vector<int>::iterator i = cls.begin(); i != cls.end(); i++) {
99  // Check the timing of the adjacent strip
100  std::pair<unsigned int, int> digi(*i, time_hit);
101 
102  theDetectorHitMap.insert(DetectorHitMap::value_type(digi, &(*_hit)));
103  strips.insert(digi);
104  }
105  }
106  }
107 }

References _rpcSync, aveCls, aveEff, RPCRoll::centreOfStrip(), GetRecoTauVFromDQM_MC_cff::cl, edm::DetSet< T >::clear(), MillePedeFileConverter_cfg::e, RPCSim::getRPCSimSetUp(), RPCSynchronizer::getSimHitBx(), mps_fire::i, RPCRoll::id(), dqm-mbProfile::log, RPCRoll::nstrips(), DetId::rawId(), RPCSynchronizer::setRPCSimSetUp(), RPCRoll::specs(), RPCSim::strips, RPCSim::theDetectorHitMap, RPCSim::theRpcDigiSimLinks, RPCRollSpecs::topology(), ecaldqm::topology(), w, and PV3DBase< T, PVType, FrameType >::x().

◆ simulateNoise()

void RPCSimParam::simulateNoise ( const RPCRoll roll,
CLHEP::HepRandomEngine *  engine 
)
overridevirtual

Implements RPCSim.

Definition at line 109 of file RPCSimParam.cc.

109  {
110  RPCDetId rpcId = roll->id();
111  int nstrips = roll->nstrips();
112  double area = 0.0;
113 
114  if (rpcId.region() == 0) {
115  const RectangularStripTopology* top_ = dynamic_cast<const RectangularStripTopology*>(&(roll->topology()));
116  float xmin = (top_->localPosition(0.)).x();
117  float xmax = (top_->localPosition((float)roll->nstrips())).x();
118  float striplength = (top_->stripLength());
119  area = striplength * (xmax - xmin);
120  } else {
121  const TrapezoidalStripTopology* top_ = dynamic_cast<const TrapezoidalStripTopology*>(&(roll->topology()));
122  float xmin = (top_->localPosition(0.)).x();
123  float xmax = (top_->localPosition((float)roll->nstrips())).x();
124  float striplength = (top_->stripLength());
125  area = striplength * (xmax - xmin);
126  }
127 
128  double ave = rate * nbxing * gate * area * 1.0e-9;
129 
130  CLHEP::RandPoissonQ randPoissonQ(*engine, ave);
131  N_hits = randPoissonQ.fire();
132 
133  for (int i = 0; i < N_hits; i++) {
134  int strip = static_cast<int>(CLHEP::RandFlat::shoot(engine, 1, nstrips));
135  int time_hit;
136  time_hit = (static_cast<int>(CLHEP::RandFlat::shoot(engine, (nbxing * gate) / gate))) - nbxing / 2;
137  std::pair<int, int> digi(strip, time_hit);
138  strips.insert(digi);
139  }
140 }

References custom_jme_cff::area, 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, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

Member Data Documentation

◆ _rpcSync

RPCSynchronizer* RPCSimParam::_rpcSync
private

Definition at line 48 of file RPCSimParam.h.

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

◆ aveCls

double RPCSimParam::aveCls
private

Definition at line 34 of file RPCSimParam.h.

Referenced by RPCSimParam(), and simulate().

◆ aveEff

double RPCSimParam::aveEff
private

Definition at line 30 of file RPCSimParam.h.

Referenced by RPCSimParam(), and simulate().

◆ dtimCs

double RPCSimParam::dtimCs
private

Definition at line 37 of file RPCSimParam.h.

Referenced by RPCSimParam().

◆ gate

double RPCSimParam::gate
private

Definition at line 46 of file RPCSimParam.h.

Referenced by RPCSimParam(), and simulateNoise().

◆ lbGate

double RPCSimParam::lbGate
private

Definition at line 40 of file RPCSimParam.h.

Referenced by RPCSimParam().

◆ N_hits

int RPCSimParam::N_hits
private

Definition at line 43 of file RPCSimParam.h.

Referenced by simulateNoise().

◆ nbxing

int RPCSimParam::nbxing
private

Definition at line 44 of file RPCSimParam.h.

Referenced by RPCSimParam(), and simulateNoise().

◆ rate

double RPCSimParam::rate
private

Definition at line 45 of file RPCSimParam.h.

Referenced by RPCSimParam(), and simulateNoise().

◆ resEle

double RPCSimParam::resEle
private

Definition at line 38 of file RPCSimParam.h.

Referenced by RPCSimParam().

◆ resRPC

double RPCSimParam::resRPC
private

Definition at line 35 of file RPCSimParam.h.

Referenced by RPCSimParam().

◆ rpcdigiprint

bool RPCSimParam::rpcdigiprint
private

Definition at line 41 of file RPCSimParam.h.

Referenced by RPCSimParam().

◆ sspeed

double RPCSimParam::sspeed
private

Definition at line 39 of file RPCSimParam.h.

Referenced by RPCSimParam().

◆ timOff

double RPCSimParam::timOff
private

Definition at line 36 of file RPCSimParam.h.

Referenced by RPCSimParam().

RPCSynchronizer::setRPCSimSetUp
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: RPCSynchronizer.h:43
RPCSim::getRPCSimSetUp
RPCSimSetUp * getRPCSimSetUp()
Definition: RPCSim.h:45
RPCSimParam::_rpcSync
RPCSynchronizer * _rpcSync
Definition: RPCSimParam.h:48
mps_fire.i
i
Definition: mps_fire.py:355
TrapezoidalStripTopology::stripLength
float stripLength() const override
det heigth (strip length in the middle)
Definition: TrapezoidalStripTopology.h:63
RPCSimParam::rpcdigiprint
bool rpcdigiprint
Definition: RPCSimParam.h:41
RPCSimParam::N_hits
int N_hits
Definition: RPCSimParam.h:43
RPCDetId::region
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
RPCSimParam::aveEff
double aveEff
Definition: RPCSimParam.h:30
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
edm::DetSet::clear
void clear()
Definition: DetSet.h:71
RPCSimParam::aveCls
double aveCls
Definition: RPCSimParam.h:34
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
RPCSimParam::sspeed
double sspeed
Definition: RPCSimParam.h:39
RPCSim::RPCSim
RPCSim(const edm::ParameterSet &config)
Definition: RPCSim.cc:5
RPCDetId
Definition: RPCDetId.h:16
gather_cfg.cout
cout
Definition: gather_cfg.py:144
RPCSynchronizer
Definition: RPCSynchronizer.h:36
RPCSimParam::resEle
double resEle
Definition: RPCSimParam.h:38
RPCSynchronizer::getSimHitBx
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
Definition: RPCSynchronizer.cc:58
DDAxes::x
RPCSim::strips
std::set< std::pair< int, int > > strips
Definition: RPCSim.h:55
RectangularStripTopology::localPosition
LocalPoint localPosition(float strip) const override
Definition: RectangularStripTopology.cc:17
RPCRoll::topology
const Topology & topology() const override
Definition: RPCRoll.cc:18
RPCSimParam::gate
double gate
Definition: RPCSimParam.h:46
GetRecoTauVFromDQM_MC_cff.cl
cl
Definition: GetRecoTauVFromDQM_MC_cff.py:38
config
Definition: config.py:1
RPCRoll::id
RPCDetId id() const
Definition: RPCRoll.cc:16
RPCSimParam::resRPC
double resRPC
Definition: RPCSimParam.h:35
RectangularStripTopology
Definition: RectangularStripTopology.h:11
RPCSim::theDetectorHitMap
DetectorHitMap theDetectorHitMap
Definition: RPCSim.h:68
ecaldqm::topology
const CaloTopology * topology(nullptr)
TrapezoidalStripTopology
Definition: TrapezoidalStripTopology.h:21
w
const double w
Definition: UKUtility.cc:23
RPCSim::theRpcDigiSimLinks
RPCDigiSimLinks theRpcDigiSimLinks
Definition: RPCSim.h:70
RPCRollSpecs::topology
const Topology & topology() const override
Definition: RPCRollSpecs.cc:36
Point3DBase< float, LocalTag >
RPCSimParam::nbxing
int nbxing
Definition: RPCSimParam.h:44
RPCRoll::centreOfStrip
LocalPoint centreOfStrip(int strip) const
Definition: RPCRoll.cc:26
RPCSimParam::timOff
double timOff
Definition: RPCSimParam.h:36
RectangularStripTopology::stripLength
float stripLength() const override
Definition: RectangularStripTopology.h:44
RPCRoll::nstrips
int nstrips() const
Definition: RPCRoll.cc:24
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
RPCSimParam::dtimCs
double dtimCs
Definition: RPCSimParam.h:37
RPCSimParam::lbGate
double lbGate
Definition: RPCSimParam.h:40
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
RPCRoll::specs
const RPCRollSpecs * specs() const
Definition: RPCRoll.cc:14
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
TrapezoidalStripTopology::localPosition
LocalPoint localPosition(float strip) const override
Definition: TrapezoidalStripTopology.cc:27
Topology
Definition: Topology.h:39
RPCSimParam::rate
double rate
Definition: RPCSimParam.h:45
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
RPCSim::RPCDigiSimLinks
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
Definition: RPCSim.h:33
custom_jme_cff.area
area
Definition: custom_jme_cff.py:169
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37