CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GEMSimTriv.cc
Go to the documentation of this file.
4 
8 
12 
13 #include "CLHEP/Random/RandomEngine.h"
14 #include "CLHEP/Random/RandFlat.h"
15 #include "CLHEP/Random/RandPoissonQ.h"
16 
17 #include <cmath>
18 #include <utility>
19 #include <map>
20 
21 
23  GEMSim(config)
24 {
25  rate_ = config.getParameter<double>("rate");
26  nbxing_ = config.getParameter<int>("nbxing");
27  gate_ = config.getParameter<double>("gate");
28 
29  sync_ = new GEMSynchronizer(config);
30 }
31 
32 void GEMSimTriv::setRandomEngine(CLHEP::HepRandomEngine& eng)
33 {
34  flatDistr1_ = new CLHEP::RandFlat(eng);
35  flatDistr2_ = new CLHEP::RandFlat(eng);
36  poissonDistr_ = new CLHEP::RandPoissonQ(eng);
37  sync_->setRandomEngine(eng);
38 }
39 
40 
42 {
43  if (flatDistr1_) delete flatDistr1_;
44  if (flatDistr2_) delete flatDistr2_;
45  if (poissonDistr_) delete poissonDistr_;
46  delete sync_;
47 }
48 
51 {
52  //_gemSync->setGEMSimSetUp(getGEMSimSetUp());
54  detectorHitMap_.clear();
56 
57  const Topology& topology = roll->specs()->topology();
58 
59  for (const auto & hit: simHits)
60  {
61  if (std::abs(hit.particleType()) != 13) continue;
62 
63  // Here I hould check if the RPC are up side down;
64  auto entry = hit.entryPoint();
65 
66  //int time_hit = _gemSync->getSimHitBx(&(*_hit));
67  // please keep hit time always 0 for this model
68  int time_hit = 0;
69  std::pair<int, int> digi(topology.channel(entry) + 1, time_hit);
70 
72  strips_.insert(digi);
73  }
74 }
75 
76 
78 {
79  // please keep it empty for this model
80  return;
81 }
T getParameter(std::string const &) const
GEMSynchronizer * sync_
Definition: GEMSimTriv.h:41
DetectorHitMap detectorHitMap_
Definition: GEMSim.h:67
void setRandomEngine(CLHEP::HepRandomEngine &eng)
void simulate(const GEMEtaPartition *roll, const edm::PSimHitContainer &rpcHits)
Definition: GEMSimTriv.cc:49
Definition: GEMSim.h:26
edm::DetSet< StripDigiSimLink > StripDigiSimLinks
Definition: GEMSim.h:30
CLHEP::RandFlat * flatDistr1_
Definition: GEMSimTriv.h:48
std::set< std::pair< int, int > > strips_
Definition: GEMSim.h:54
GEMDetId id() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const Topology & topology() const
GEMSimTriv(const edm::ParameterSet &config)
Definition: GEMSimTriv.cc:22
CLHEP::RandFlat * flatDistr2_
Definition: GEMSimTriv.h:49
void setRandomEngine(CLHEP::HepRandomEngine &eng)
Definition: GEMSimTriv.cc:32
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int nbxing_
Definition: GEMSimTriv.h:43
Container::value_type value_type
double rate_
Definition: GEMSimTriv.h:44
const GEMEtaPartitionSpecs * specs() const
tuple simHits
Definition: trackerHits.py:16
void clear()
Definition: DetSet.h:69
CLHEP::RandPoissonQ * poissonDistr_
Definition: GEMSimTriv.h:50
void simulateNoise(const GEMEtaPartition *)
Definition: GEMSimTriv.cc:77
std::vector< PSimHit > PSimHitContainer
double gate_
Definition: GEMSimTriv.h:45
StripDigiSimLinks stripDigiSimLinks_
Definition: GEMSim.h:68