CMS 3D CMS Logo

RPVFATSimulator.cc
Go to the documentation of this file.
4 #include <vector>
5 #include <iostream>
6 
7 RPVFATSimulator::RPVFATSimulator(const edm::ParameterSet &params, RPDetId det_id) : params_(params), det_id_(det_id) {
8  threshold_ = params.getParameter<double>("RPVFATThreshold");
9  dead_strip_probability_ = params.getParameter<double>("RPDeadStripProbability");
10  dead_strips_simulation_on_ = params.getParameter<bool>("RPDeadStripSimulationOn");
12  verbosity_ = params.getParameter<int>("RPVerbosity");
13  links_persistence_ = params.getParameter<bool>("RPDigiSimHitRelationsPresistence");
14 }
15 
17  simromanpot::strip_charge_map_links_type &theSignalProvenance,
18  std::vector<TotemRPDigi> &output_digi,
19  simromanpot::DigiPrimaryMapType &output_digi_links) {
20  for (simromanpot::strip_charge_map::const_iterator i = signals.begin(); i != signals.end(); ++i) {
21  //one threshold per hybrid
22  unsigned short strip_no = i->first;
23  if (i->second > threshold_ && (!dead_strips_simulation_on_ || dead_strips_.find(strip_no) == dead_strips_.end())) {
24  output_digi.push_back(TotemRPDigi(strip_no));
25  if (links_persistence_) {
26  output_digi_links.push_back(theSignalProvenance[strip_no]);
27  if (verbosity_) {
28  edm::LogInfo("RPVFatSimulator") << " digi links size=" << theSignalProvenance[strip_no].size() << "\n";
29  for (unsigned int u = 0; u < theSignalProvenance[strip_no].size(); ++u) {
30  edm::LogInfo("RPVFatSimulator")
31  << " digi: particle=" << theSignalProvenance[strip_no][u].first
32  << " energy [electrons]=" << theSignalProvenance[strip_no][u].second << "\n";
33  }
34  }
35  }
36  }
37  }
38 
39  if (verbosity_) {
40  for (unsigned int i = 0; i < output_digi.size(); ++i) {
41  edm::LogInfo("RPVFATSimulator") << output_digi[i].stripNumber() << "\n";
42  }
43  }
44 }
std::vector< std::vector< std::pair< int, double > > > DigiPrimaryMapType
Definition: RPSimTypes.h:22
std::map< unsigned short, std::vector< std::pair< int, double > > > strip_charge_map_links_type
Definition: RPSimTypes.h:28
unsigned short strips_no_
RPVFATSimulator(const edm::ParameterSet &params, RPDetId det_id)
uint32_t RPDetId
Definition: RPSimTypes.h:11
Log< level::Info, false > LogInfo
std::map< unsigned short, double > strip_charge_map
Definition: RPSimTypes.h:14
void ConvertChargeToHits(const simromanpot::strip_charge_map &signals, simromanpot::strip_charge_map_links_type &theSignalProvenance, std::vector< TotemRPDigi > &output_digi, simromanpot::DigiPrimaryMapType &output_digi_links)
Geometrical and topological information on RP silicon detector. Uses coordinate a frame with origin i...
Definition: RPTopology.h:19
dead_strip_set dead_strips_
unsigned short DetStripNo() const
Definition: RPTopology.h:42
double dead_strip_probability_
bool dead_strips_simulation_on_