CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCSimTriv.cc
Go to the documentation of this file.
8 
12 #include "CLHEP/Random/RandomEngine.h"
13 #include "CLHEP/Random/RandFlat.h"
14 #include <cmath>
15 #include <utility>
16 #include <map>
17 
18 //#include "CLHEP/config/CLHEP.h"
19 #include "CLHEP/Random/Random.h"
20 #include "CLHEP/Random/RandFlat.h"
21 #include "CLHEP/Random/RandPoissonQ.h"
22 
23 
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 }
32 
33 void RPCSimTriv::setRandomEngine(CLHEP::HepRandomEngine& eng){
34  flatDistribution1 = new CLHEP::RandFlat(eng);
35  flatDistribution2 = new CLHEP::RandFlat(eng);
36  poissonDistribution = new CLHEP::RandPoissonQ(eng);
38 }
39 
41  delete flatDistribution1;
42  delete flatDistribution2;
43  delete poissonDistribution;
44  delete _rpcSync;
45 }
46 
47 void
49  const edm::PSimHitContainer& rpcHits)
50 {
51 
52  //_rpcSync->setRPCSimSetUp(getRPCSimSetUp());
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  // please keep hit time always 0 for this model
67  int time_hit = 0;
68  std::pair<int, int> digi(topology.channel(entr)+1,
69  time_hit);
70 
71  theDetectorHitMap.insert(DetectorHitMap::value_type(digi,&(*_hit)));
72  strips.insert(digi);
73  }
74  }
75 }
76 
77 
79 {
80  // plase keep it empty for this model
81  return;
82 }
83 
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
CLHEP::RandPoissonQ * poissonDistribution
Definition: RPCSimTriv.h:47
RPCSimTriv(const edm::ParameterSet &config)
Definition: RPCSimTriv.cc:24
DetectorHitMap theDetectorHitMap
Definition: RPCSim.h:68
void simulateNoise(const RPCRoll *)
Definition: RPCSimTriv.cc:78
void setRandomEngine(CLHEP::HepRandomEngine &eng)
Definition: RPCSimTriv.cc:33
void simulate(const RPCRoll *roll, const edm::PSimHitContainer &rpcHits)
Definition: RPCSimTriv.cc:48
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:43
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
Definition: RPCSim.h:32
RPCDetId id() const
Definition: RPCRoll.cc:24
Definition: RPCSim.h:27
Container::value_type value_type
CLHEP::RandFlat * flatDistribution1
Definition: RPCSimTriv.h:45
void setRandomEngine(CLHEP::HepRandomEngine &eng)
double gate
Definition: RPCSimTriv.h:42
RPCSynchronizer * _rpcSync
Definition: RPCSimTriv.h:35
int nbxing
Definition: RPCSimTriv.h:40
void clear()
Definition: DetSet.h:69
std::vector< PSimHit > PSimHitContainer
double rate
Definition: RPCSimTriv.h:41
RPCDigiSimLinks theRpcDigiSimLinks
Definition: RPCSim.h:70
CLHEP::RandFlat * flatDistribution2
Definition: RPCSimTriv.h:46
const Topology & topology() const
Definition: RPCRollSpecs.cc:43