CMS 3D CMS Logo

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

#include <RPCSimTriv.h>

Inheritance diagram for RPCSimTriv:
RPCSim

Public Member Functions

 RPCSimTriv (const edm::ParameterSet &config)
 
void setRandomEngine (CLHEP::HepRandomEngine &eng)
 
void simulate (const RPCRoll *roll, const edm::PSimHitContainer &rpcHits)
 
void simulateNoise (const RPCRoll *)
 
 ~RPCSimTriv ()
 
- 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 ()
 

Private Attributes

RPCSynchronizer_rpcSync
 
CLHEP::RandFlat * flatDistribution1
 
CLHEP::RandFlat * flatDistribution2
 
double gate
 
int N_hits
 
int nbxing
 
CLHEP::RandPoissonQ * poissonDistribution
 
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< 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 21 of file RPCSimTriv.h.

Constructor & Destructor Documentation

RPCSimTriv::RPCSimTriv ( const edm::ParameterSet config)

Definition at line 24 of file RPCSimTriv.cc.

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

24  : RPCSim(config){
25 
26  rate=config.getParameter<double>("Rate");
27  nbxing=config.getParameter<int>("Nbxing");
28  gate=config.getParameter<double>("Gate");
29 
30  _rpcSync = new RPCSynchronizer(config);
31 }
T getParameter(std::string const &) const
RPCSim(const edm::ParameterSet &config)
Definition: RPCSim.cc:5
double gate
Definition: RPCSimTriv.h:42
RPCSynchronizer * _rpcSync
Definition: RPCSimTriv.h:35
int nbxing
Definition: RPCSimTriv.h:40
double rate
Definition: RPCSimTriv.h:41
RPCSimTriv::~RPCSimTriv ( )

Definition at line 40 of file RPCSimTriv.cc.

References _rpcSync, flatDistribution1, flatDistribution2, and poissonDistribution.

40  {
41  delete flatDistribution1;
42  delete flatDistribution2;
43  delete poissonDistribution;
44  delete _rpcSync;
45 }
CLHEP::RandPoissonQ * poissonDistribution
Definition: RPCSimTriv.h:47
CLHEP::RandFlat * flatDistribution1
Definition: RPCSimTriv.h:45
RPCSynchronizer * _rpcSync
Definition: RPCSimTriv.h:35
CLHEP::RandFlat * flatDistribution2
Definition: RPCSimTriv.h:46

Member Function Documentation

void RPCSimTriv::init ( void  )
inlineprivatevirtual

Implements RPCSim.

Definition at line 35 of file RPCSimTriv.h.

35 {};
void RPCSimTriv::setRandomEngine ( CLHEP::HepRandomEngine &  eng)
virtual

Implements RPCSim.

Definition at line 33 of file RPCSimTriv.cc.

References _rpcSync, flatDistribution1, flatDistribution2, poissonDistribution, and RPCSynchronizer::setRandomEngine().

33  {
34  flatDistribution1 = new CLHEP::RandFlat(eng);
35  flatDistribution2 = new CLHEP::RandFlat(eng);
36  poissonDistribution = new CLHEP::RandPoissonQ(eng);
38 }
CLHEP::RandPoissonQ * poissonDistribution
Definition: RPCSimTriv.h:47
CLHEP::RandFlat * flatDistribution1
Definition: RPCSimTriv.h:45
void setRandomEngine(CLHEP::HepRandomEngine &eng)
RPCSynchronizer * _rpcSync
Definition: RPCSimTriv.h:35
CLHEP::RandFlat * flatDistribution2
Definition: RPCSimTriv.h:46
void RPCSimTriv::simulate ( const RPCRoll roll,
const edm::PSimHitContainer rpcHits 
)
virtual

Implements RPCSim.

Definition at line 48 of file RPCSimTriv.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().

50 {
51 
54  theDetectorHitMap.clear();
56 
57  const Topology& topology=roll->specs()->topology();
58  for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin();
59  _hit != rpcHits.end(); ++_hit){
60 
61  int type = _hit->particleType();
62  if (type == 13 || type == -13){
63  // Here I hould check if the RPC are up side down;
64  const LocalPoint& entr=_hit->entryPoint();
65  int time_hit = _rpcSync->getSimHitBx(&(*_hit));
66  std::pair<int, int> digi(topology.channel(entr)+1,
67  time_hit);
68 
69  theDetectorHitMap.insert(DetectorHitMap::value_type(digi,&(*_hit)));
70  strips.insert(digi);
71  }
72  }
73 }
type
Definition: HCALResponse.h:22
DetectorHitMap theDetectorHitMap
Definition: RPCSim.h:68
void setRPCSimSetUp(RPCSimSetUp *simsetup)
RPCSimSetUp * getRPCSimSetUp()
Definition: RPCSim.h:47
const RPCRollSpecs * specs() const
Definition: RPCRoll.cc:18
std::set< std::pair< int, int > > strips
Definition: RPCSim.h:57
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
Definition: RPCSim.h:32
RPCDetId id() const
Definition: RPCRoll.cc:24
Container::value_type value_type
int getSimHitBx(const PSimHit *)
RPCSynchronizer * _rpcSync
Definition: RPCSimTriv.h:35
void clear()
Definition: DetSet.h:70
RPCDigiSimLinks theRpcDigiSimLinks
Definition: RPCSim.h:70
const Topology & topology() const
Definition: RPCRollSpecs.cc:43
void RPCSimTriv::simulateNoise ( const RPCRoll roll)
virtual

Implements RPCSim.

Definition at line 76 of file RPCSimTriv.cc.

References compareJSON::const, flatDistribution1, flatDistribution2, gate, i, RPCRoll::id(), RectangularStripTopology::localPosition(), TrapezoidalStripTopology::localPosition(), N_hits, nbxing, RPCRoll::nstrips(), poissonDistribution, rate, RPCDetId::region(), strip(), RectangularStripTopology::stripLength(), TrapezoidalStripTopology::stripLength(), RPCSim::strips, RPCRoll::topology(), and vdt::x.

77 {
78 
79  RPCDetId rpcId = roll->id();
80  int nstrips = roll->nstrips();
81  double area = 0.0;
82 
83  if ( rpcId.region() == 0 )
84  {
85  const RectangularStripTopology* top_ = dynamic_cast<const
86  RectangularStripTopology*>(&(roll->topology()));
87  float xmin = (top_->localPosition(0.)).x();
88  float xmax = (top_->localPosition((float)roll->nstrips())).x();
89  float striplength = (top_->stripLength());
90  area = striplength*(xmax-xmin);
91  }
92  else
93  {
94  const TrapezoidalStripTopology* top_=dynamic_cast<const TrapezoidalStripTopology*>(&(roll->topology()));
95  float xmin = (top_->localPosition(0.)).x();
96  float xmax = (top_->localPosition((float)roll->nstrips())).x();
97  float striplength = (top_->stripLength());
98  area = striplength*(xmax-xmin);
99  }
100 
101 
102  double ave = rate*nbxing*gate*area*1.0e-9;
103 
104  N_hits = poissonDistribution->fire(ave);
105 
106  for (int i = 0; i < N_hits; i++ ){
107  int strip = static_cast<int>(flatDistribution1->fire(1,nstrips));
108  int time_hit;
109  time_hit = (static_cast<int>(flatDistribution2->fire((nbxing*gate)/gate))) - nbxing/2;
110  std::pair<int, int> digi(strip,time_hit);
111  strips.insert(digi);
112  }
113 }
int i
Definition: DBlmapReader.cc:9
const Topology & topology() const
Definition: RPCRoll.cc:30
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
CLHEP::RandPoissonQ * poissonDistribution
Definition: RPCSimTriv.h:47
virtual float stripLength() const
int nstrips() const
Definition: RPCRoll.cc:46
std::set< std::pair< int, int > > strips
Definition: RPCSim.h:57
RPCDetId id() const
Definition: RPCRoll.cc:24
int N_hits
Definition: RPCSimTriv.h:39
CLHEP::RandFlat * flatDistribution1
Definition: RPCSimTriv.h:45
double gate
Definition: RPCSimTriv.h:42
string const
Definition: compareJSON.py:14
virtual LocalPoint localPosition(float strip) const
int nbxing
Definition: RPCSimTriv.h:40
virtual LocalPoint localPosition(float strip) const
x
Definition: VDTMath.h:216
double rate
Definition: RPCSimTriv.h:41
virtual float stripLength() const
det heigth (strip length in the middle)
CLHEP::RandFlat * flatDistribution2
Definition: RPCSimTriv.h:46
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:67

Member Data Documentation

RPCSynchronizer* RPCSimTriv::_rpcSync
private

Definition at line 35 of file RPCSimTriv.h.

Referenced by RPCSimTriv(), setRandomEngine(), simulate(), and ~RPCSimTriv().

CLHEP::RandFlat* RPCSimTriv::flatDistribution1
private

Definition at line 45 of file RPCSimTriv.h.

Referenced by setRandomEngine(), simulateNoise(), and ~RPCSimTriv().

CLHEP::RandFlat* RPCSimTriv::flatDistribution2
private

Definition at line 46 of file RPCSimTriv.h.

Referenced by setRandomEngine(), simulateNoise(), and ~RPCSimTriv().

double RPCSimTriv::gate
private

Definition at line 42 of file RPCSimTriv.h.

Referenced by RPCSimTriv(), and simulateNoise().

int RPCSimTriv::N_hits
private

Definition at line 39 of file RPCSimTriv.h.

Referenced by simulateNoise().

int RPCSimTriv::nbxing
private

Definition at line 40 of file RPCSimTriv.h.

Referenced by RPCSimTriv(), and simulateNoise().

CLHEP::RandPoissonQ* RPCSimTriv::poissonDistribution
private

Definition at line 47 of file RPCSimTriv.h.

Referenced by setRandomEngine(), simulateNoise(), and ~RPCSimTriv().

double RPCSimTriv::rate
private

Definition at line 41 of file RPCSimTriv.h.

Referenced by RPCSimTriv(), and simulateNoise().