CMS 3D CMS Logo

ClusterNoiseFP420.h
Go to the documentation of this file.
1 #ifndef ClusterNoiseFP420_h
2 #define ClusterNoiseFP420_h
3 
4 #include <vector>
5 #include <map>
6 #include <iostream>
7 #include <cstdint>
8 //#define mynsdebug0
9 
10 typedef float ElectrodNoise;
11 typedef bool ElectrodDisable;
12 
14 public:
17 
18  class ElectrodData {
19  public:
20  ElectrodNoise getNoise() const { return static_cast<ElectrodNoise>(std::abs(Data) / 10.0); }
21  ElectrodDisable getDisable() const { return ((Data > 0) ? false : true); } // if Data <=0 then electrode is disable
22  void setData(short data) { Data = data; }
23  void setData(float noise_, bool disable_) {
24  short noise = static_cast<short>(noise_ * 10.0 + 0.5) & 0x01FF;
25  Data =
26  (disable_ ? -1 : 1) * noise; // Data = sign(+/-1) * Noise(Adc count). if Data <=0 then electrode is disable
27 
28 #ifdef mynsdebug0
29  std::cout << std::fixed << "ClusterNoiseFP420.h:: ElectrodData: noise= " << noise_ << " \t"
30  << ": disable= " << disable_ << " \t"
31  << "sign Data(=noise*10.0 + 0.5)= " << Data << " \t"
32  << "in getNoise we do: abs(Data)/10.0, so it is OK"
33  << " \t" << std::endl;
34 #endif
35  };
36 
37  private:
38  //the short type is assured to be 16 bit in CMSSW???
39  short Data; // Data = sign(+/-1) * Noise(Adc count). if Data <=0 then electrode is disable
40  };
41 
42  std::map<uint32_t, std::vector<ElectrodData> > m_noises;
43 };
44 
45 typedef std::vector<ClusterNoiseFP420::ElectrodData> ElectrodNoiseVector;
46 typedef std::vector<ClusterNoiseFP420::ElectrodData>::const_iterator ElectrodNoiseVectorIterator;
47 typedef std::map<uint32_t, ElectrodNoiseVector> ElectrodNoiseMap;
48 typedef std::map<uint32_t, ElectrodNoiseVector>::const_iterator ElectrodNoiseMapIterator;
49 
50 #endif
ElectrodNoiseMapIterator
std::map< uint32_t, ElectrodNoiseVector >::const_iterator ElectrodNoiseMapIterator
Definition: ClusterNoiseFP420.h:48
ClusterNoiseFP420::m_noises
std::map< uint32_t, std::vector< ElectrodData > > m_noises
Definition: ClusterNoiseFP420.h:42
ClusterNoiseFP420::ElectrodData
Definition: ClusterNoiseFP420.h:18
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
sistrip::extrainfo::noise_
static const char noise_[]
Definition: ConstantsForDqm.h:47
gather_cfg.cout
cout
Definition: gather_cfg.py:144
ClusterNoiseFP420::ElectrodData::getDisable
ElectrodDisable getDisable() const
Definition: ClusterNoiseFP420.h:21
ElectrodNoiseVector
std::vector< ClusterNoiseFP420::ElectrodData > ElectrodNoiseVector
Definition: ClusterNoiseFP420.h:45
ClusterNoiseFP420::ElectrodData::Data
short Data
Definition: ClusterNoiseFP420.h:35
ClusterNoiseFP420
Definition: ClusterNoiseFP420.h:13
hgcalDigitizer_cfi.noise
noise
Definition: hgcalDigitizer_cfi.py:155
ClusterNoiseFP420::ElectrodData::getNoise
ElectrodNoise getNoise() const
Definition: ClusterNoiseFP420.h:20
ClusterNoiseFP420::ElectrodData::setData
void setData(float noise_, bool disable_)
Definition: ClusterNoiseFP420.h:23
ElectrodNoise
float ElectrodNoise
Definition: ClusterNoiseFP420.h:10
ClusterNoiseFP420::~ClusterNoiseFP420
~ClusterNoiseFP420()
Definition: ClusterNoiseFP420.cc:11
ElectrodDisable
bool ElectrodDisable
Definition: ClusterNoiseFP420.h:11
ClusterNoiseFP420::ElectrodData::setData
void setData(short data)
Definition: ClusterNoiseFP420.h:22
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ElectrodNoiseMap
std::map< uint32_t, ElectrodNoiseVector > ElectrodNoiseMap
Definition: ClusterNoiseFP420.h:47
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ElectrodNoiseVectorIterator
std::vector< ClusterNoiseFP420::ElectrodData >::const_iterator ElectrodNoiseVectorIterator
Definition: ClusterNoiseFP420.h:46
ClusterNoiseFP420::ClusterNoiseFP420
ClusterNoiseFP420()
Definition: ClusterNoiseFP420.cc:10