CMS 3D CMS Logo

SiStripGain.h
Go to the documentation of this file.
1 #ifndef SiStripObjects_SiStripGain_h
2 #define SiStripObjects_SiStripGain_h
3 // -*- C++ -*-
4 //
5 // Package: SiStripObjects
6 // Class : SiStripGain
7 //
39 #include <memory>
40 #include <vector>
41 
42 class TrackerTopology;
43 
44 class SiStripGain {
45 public:
47  SiStripGain(const SiStripGain &) = delete;
48  const SiStripGain &operator=(const SiStripGain &) = delete;
49 
51  inline SiStripGain(const SiStripApvGain &apvgain, const double &factor) : apvgain_(nullptr) {
52  multiply(apvgain, factor, std::make_pair("", ""));
53  }
54 
55  inline SiStripGain(const SiStripApvGain &apvgain,
56  const double &factor,
57  const std::pair<std::string, std::string> &recordLabelPair)
58  : apvgain_(nullptr) {
59  multiply(apvgain, factor, recordLabelPair);
60  }
61 
64  void multiply(const SiStripApvGain &apvgain,
65  const double &factor,
66  const std::pair<std::string, std::string> &recordLabelPair);
67 
68  // getters
69  // For the product of all apvGains
70  // -------------------------------
71  const SiStripApvGain::Range getRange(uint32_t detID) const { return apvgain_->getRange(detID); }
72  SiStripApvGain::Range getRangeByPos(unsigned short pos) const { return apvgain_->getRangeByPos(pos); }
73  static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range) {
75  }
76  static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range) {
77  return SiStripApvGain::getApvGain(apv, range);
78  }
79 
80  // For a specific apvGain
81  // ----------------------
88  const SiStripApvGain::Range getRange(const uint32_t &detID, const uint32_t index) const;
89  float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range, const uint32_t index) const;
90  float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range, const uint32_t index) const;
91 
93  void getDetIds(std::vector<uint32_t> &DetIds_) const;
94 
95  inline size_t getNumberOfTags() const { return apvgainVector_.size(); }
96  inline std::string getRcdName(const uint32_t index) const { return recordLabelPair_[index].first; }
97  inline std::string getLabelName(const uint32_t index) const { return recordLabelPair_[index].second; }
98  inline double getTagNorm(const uint32_t index) const { return normVector_[index]; }
99 
100  void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const;
101  void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const;
102 
103 private:
104  void fillNewGain(const SiStripApvGain *apvgain,
105  const double &factor,
106  const SiStripApvGain *apvgain2 = nullptr,
107  const double &factor2 = 1.);
108 
109  // ---------- member data --------------------------------
110 
111  std::vector<const SiStripApvGain *> apvgainVector_;
112  std::vector<double> normVector_;
114  std::unique_ptr<SiStripApvGain> apvgainAutoPtr_;
115  std::vector<std::pair<std::string, std::string>> recordLabelPair_;
116 };
117 
118 #endif
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
SiStripGain::operator=
const SiStripGain & operator=(const SiStripGain &)=delete
SiStripApvGain::getStripGain
static float getStripGain(uint16_t strip, const Range &range)
Definition: SiStripApvGain.h:78
SiStripGain::getLabelName
std::string getLabelName(const uint32_t index) const
Definition: SiStripGain.h:97
SiStripGain::recordLabelPair_
std::vector< std::pair< std::string, std::string > > recordLabelPair_
Definition: SiStripGain.h:115
SiStripGain
Definition: SiStripGain.h:44
TrackerTopology
Definition: TrackerTopology.h:16
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
pos
Definition: PixelAliasList.h:18
SiStripGain::multiply
void multiply(const SiStripApvGain &apvgain, const double &factor, const std::pair< std::string, std::string > &recordLabelPair)
Definition: SiStripGain.cc:17
SiStripGain::getTagNorm
double getTagNorm(const uint32_t index) const
Definition: SiStripGain.h:98
SiStripGain::normVector_
std::vector< double > normVector_
Definition: SiStripGain.h:112
SiStripGain::apvgainAutoPtr_
std::unique_ptr< SiStripApvGain > apvgainAutoPtr_
Definition: SiStripGain.h:114
SiStripApvGain::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripApvGain.cc:30
SiStripGain::apvgainVector_
std::vector< const SiStripApvGain * > apvgainVector_
Definition: SiStripGain.h:111
SiStripGain::fillNewGain
void fillNewGain(const SiStripApvGain *apvgain, const double &factor, const SiStripApvGain *apvgain2=nullptr, const double &factor2=1.)
Definition: SiStripGain.cc:39
SiStripGain::getStripGain
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
Definition: SiStripGain.h:73
SiStripGain::SiStripGain
SiStripGain()
Definition: SiStripGain.h:46
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripGain::getNumberOfTags
size_t getNumberOfTags() const
Definition: SiStripGain.h:95
SiStripGain::apvgain_
const SiStripApvGain * apvgain_
Definition: SiStripGain.h:113
SiStripGain::getRangeByPos
SiStripApvGain::Range getRangeByPos(unsigned short pos) const
Definition: SiStripGain.h:72
SiStripGain::getRange
const SiStripApvGain::Range getRange(uint32_t detID) const
Definition: SiStripGain.h:71
DQMScaleToClient_cfi.factor
factor
Definition: DQMScaleToClient_cfi.py:8
SiStripGain::getDetIds
void getDetIds(std::vector< uint32_t > &DetIds_) const
ATTENTION: we assume the detIds are the same as those from the first gain.
Definition: SiStripGain.cc:102
SiStripApvGain.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripGain::getApvGain
static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range)
Definition: SiStripGain.h:76
SiStripGain::printDebug
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Definition: SiStripGain.cc:111
SiStripApvGain::getRangeByPos
Range getRangeByPos(unsigned short pos) const
Definition: SiStripApvGain.cc:44
SiStripGain::SiStripGain
SiStripGain(const SiStripApvGain &apvgain, const double &factor)
Kept for compatibility.
Definition: SiStripGain.h:51
SiStripGain::SiStripGain
SiStripGain(const SiStripApvGain &apvgain, const double &factor, const std::pair< std::string, std::string > &recordLabelPair)
Definition: SiStripGain.h:55
SiStripApvGain::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripApvGain.h:28
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
SiStripGain::printSummary
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Definition: SiStripGain.cc:127
SiStripApvGain
Definition: SiStripApvGain.h:25
SiStripApvGain::getApvGain
static float getApvGain(uint16_t apv, const Range &range)
Definition: SiStripApvGain.h:82
SiStripGain::getRcdName
std::string getRcdName(const uint32_t index) const
Definition: SiStripGain.h:96