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 }
RPVFATSimulator::verbosity_
int verbosity_
Definition: RPVFATSimulator.h:26
simromanpot::DigiPrimaryMapType
std::vector< std::vector< std::pair< int, double > > > DigiPrimaryMapType
Definition: RPSimTypes.h:22
mps_fire.i
i
Definition: mps_fire.py:428
RPVFATSimulator.h
MessageLogger.h
RPVFATSimulator::dead_strips_
dead_strip_set dead_strips_
Definition: RPVFATSimulator.h:25
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
simromanpot::strip_charge_map
std::map< unsigned short, double > strip_charge_map
Definition: RPSimTypes.h:14
RPVFATSimulator::strips_no_
unsigned short strips_no_
Definition: RPVFATSimulator.h:28
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
RPVFATSimulator::ConvertChargeToHits
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)
Definition: RPVFATSimulator.cc:16
TotemRPDigi
Definition: TotemRPDigi.h:15
RPVFATSimulator::threshold_
double threshold_
Definition: RPVFATSimulator.h:29
RPTopology
Geometrical and topological information on RP silicon detector. Uses coordinate a frame with origin i...
Definition: RPTopology.h:18
edm::ParameterSet
Definition: ParameterSet.h:47
RPVFATSimulator::dead_strip_probability_
double dead_strip_probability_
Definition: RPVFATSimulator.h:23
RPVFATSimulator::dead_strips_simulation_on_
bool dead_strips_simulation_on_
Definition: RPVFATSimulator.h:24
RPTopology::DetStripNo
unsigned short DetStripNo() const
Definition: RPTopology.h:47
RPDetId
uint32_t RPDetId
Definition: RPSimTypes.h:11
simromanpot::strip_charge_map_links_type
std::map< unsigned short, std::vector< std::pair< int, double > > > strip_charge_map_links_type
Definition: RPSimTypes.h:28
RPTopology.h
RPVFATSimulator::RPVFATSimulator
RPVFATSimulator(const edm::ParameterSet &params, RPDetId det_id)
Definition: RPVFATSimulator.cc:7
RPVFATSimulator::links_persistence_
bool links_persistence_
Definition: RPVFATSimulator.h:30