CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RPGaussianTailNoiseAdder Class Reference

#include <RPGaussianTailNoiseAdder.h>

Public Member Functions

simromanpot::strip_charge_map addNoise (const simromanpot::strip_charge_map &theSignal)
 
 RPGaussianTailNoiseAdder (int numStrips, double theNoiseInElectrons, double theStripThresholdInE, CLHEP::HepRandomEngine &eng, int verbosity)
 

Private Attributes

int numStrips_
 
CLHEP::HepRandomEngine & rndEngine_
 
double strips_above_threshold_prob_
 
double theNoiseInElectrons
 
double theStripThresholdInE
 
int verbosity_
 

Detailed Description

Definition at line 7 of file RPGaussianTailNoiseAdder.h.

Constructor & Destructor Documentation

◆ RPGaussianTailNoiseAdder()

RPGaussianTailNoiseAdder::RPGaussianTailNoiseAdder ( int  numStrips,
double  theNoiseInElectrons,
double  theStripThresholdInE,
CLHEP::HepRandomEngine &  eng,
int  verbosity 
)

Member Function Documentation

◆ addNoise()

simromanpot::strip_charge_map RPGaussianTailNoiseAdder::addNoise ( const simromanpot::strip_charge_map theSignal)

Definition at line 22 of file RPGaussianTailNoiseAdder.cc.

22  {
23  simromanpot::strip_charge_map the_strip_charge_map;
24 
25  // noise on strips with signal:
26  for (simromanpot::strip_charge_map::const_iterator i = theSignal.begin(); i != theSignal.end(); ++i) {
27  double noise = CLHEP::RandGauss::shoot(&(rndEngine_), 0.0, theNoiseInElectrons);
28  the_strip_charge_map[i->first] = i->second + noise;
29  if (verbosity_)
30  edm::LogInfo("RPDigiProducer") << "noise added to signal strips: " << noise << "\n";
31  }
32 
33  // noise on the other strips
34  int strips_no_above_threshold =
35  CLHEP::RandBinomial::shoot(&(rndEngine_), (long)numStrips_, strips_above_threshold_prob_);
36 
37  for (int j = 0; j < strips_no_above_threshold; j++) {
38  int strip = CLHEP::RandFlat::shootInt(&(rndEngine_), numStrips_);
39  if (the_strip_charge_map[strip] == 0) {
40  the_strip_charge_map[strip] = 2 * theStripThresholdInE;
41  //only binary decision later, no need to simulate the noise precisely,
42  //enough to know that it exceeds the threshold
43  if (verbosity_)
44  edm::LogInfo("RPDigiProducer") << "nonsignal strips noise :" << strip << " " << the_strip_charge_map[strip]
45  << "\n";
46  }
47  }
48 
49  return the_strip_charge_map;
50 }

References mps_fire::i, dqmiolumiharvest::j, gpuVertexFinder::noise, numStrips_, rndEngine_, digitizers_cfi::strip, strips_above_threshold_prob_, theNoiseInElectrons, theStripThresholdInE, and verbosity_.

Member Data Documentation

◆ numStrips_

int RPGaussianTailNoiseAdder::numStrips_
private

Definition at line 17 of file RPGaussianTailNoiseAdder.h.

Referenced by addNoise().

◆ rndEngine_

CLHEP::HepRandomEngine& RPGaussianTailNoiseAdder::rndEngine_
private

Definition at line 21 of file RPGaussianTailNoiseAdder.h.

Referenced by addNoise().

◆ strips_above_threshold_prob_

double RPGaussianTailNoiseAdder::strips_above_threshold_prob_
private

Definition at line 20 of file RPGaussianTailNoiseAdder.h.

Referenced by addNoise(), and RPGaussianTailNoiseAdder().

◆ theNoiseInElectrons

double RPGaussianTailNoiseAdder::theNoiseInElectrons
private

Definition at line 18 of file RPGaussianTailNoiseAdder.h.

Referenced by addNoise(), and RPGaussianTailNoiseAdder().

◆ theStripThresholdInE

double RPGaussianTailNoiseAdder::theStripThresholdInE
private

Definition at line 19 of file RPGaussianTailNoiseAdder.h.

Referenced by addNoise(), and RPGaussianTailNoiseAdder().

◆ verbosity_

int RPGaussianTailNoiseAdder::verbosity_
private

Definition at line 22 of file RPGaussianTailNoiseAdder.h.

Referenced by addNoise().

HIPAlignmentAlgorithm_cfi.verbosity
verbosity
Definition: HIPAlignmentAlgorithm_cfi.py:7
mps_fire.i
i
Definition: mps_fire.py:428
RPGaussianTailNoiseAdder::verbosity_
int verbosity_
Definition: RPGaussianTailNoiseAdder.h:22
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
simromanpot::strip_charge_map
std::map< unsigned short, double > strip_charge_map
Definition: RPSimTypes.h:14
RPGaussianTailNoiseAdder::theStripThresholdInE
double theStripThresholdInE
Definition: RPGaussianTailNoiseAdder.h:19
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
RPGaussianTailNoiseAdder::strips_above_threshold_prob_
double strips_above_threshold_prob_
Definition: RPGaussianTailNoiseAdder.h:20
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
gpuVertexFinder::noise
__shared__ int noise
Definition: gpuFitVertices.h:50
RPGaussianTailNoiseAdder::rndEngine_
CLHEP::HepRandomEngine & rndEngine_
Definition: RPGaussianTailNoiseAdder.h:21
RPGaussianTailNoiseAdder::numStrips_
int numStrips_
Definition: RPGaussianTailNoiseAdder.h:17
RPGaussianTailNoiseAdder::theNoiseInElectrons
double theNoiseInElectrons
Definition: RPGaussianTailNoiseAdder.h:18
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66