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 class SiStripDetInfo;
44 
45 class SiStripGain {
46 public:
48  SiStripGain(const SiStripGain &) = delete;
49  const SiStripGain &operator=(const SiStripGain &) = delete;
50 
52  inline SiStripGain(const SiStripApvGain &apvgain, const double &factor, const SiStripDetInfo &detInfo)
53  : apvgain_(nullptr) {
54  multiply(apvgain, factor, std::make_pair("", ""), detInfo);
55  }
56 
57  inline SiStripGain(const SiStripApvGain &apvgain,
58  const double &factor,
59  const std::pair<std::string, std::string> &recordLabelPair,
60  const SiStripDetInfo &detInfo)
61  : apvgain_(nullptr) {
62  multiply(apvgain, factor, recordLabelPair, detInfo);
63  }
64 
67  void multiply(const SiStripApvGain &apvgain,
68  const double &factor,
69  const std::pair<std::string, std::string> &recordLabelPair,
70  const SiStripDetInfo &detInfo);
71 
72  // getters
73  // For the product of all apvGains
74  // -------------------------------
75  const SiStripApvGain::Range getRange(uint32_t detID) const { return apvgain_->getRange(detID); }
76  SiStripApvGain::Range getRangeByPos(unsigned short pos) const { return apvgain_->getRangeByPos(pos); }
77  static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range) {
79  }
80  static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range) {
81  return SiStripApvGain::getApvGain(apv, range);
82  }
83 
84  // For a specific apvGain
85  // ----------------------
92  const SiStripApvGain::Range getRange(const uint32_t &detID, const uint32_t index) const;
93  float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range, const uint32_t index) const;
94  float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range, const uint32_t index) const;
95 
97  void getDetIds(std::vector<uint32_t> &DetIds_) const;
98 
99  inline size_t getNumberOfTags() const { return apvgainVector_.size(); }
100  inline std::string getRcdName(const uint32_t index) const { return recordLabelPair_[index].first; }
101  inline std::string getLabelName(const uint32_t index) const { return recordLabelPair_[index].second; }
102  inline double getTagNorm(const uint32_t index) const { return normVector_[index]; }
103 
104  void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const;
105  void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const;
106 
107 private:
108  void fillNewGain(const SiStripApvGain *apvgain,
109  const double &factor,
110  SiStripDetInfo const &detInfo,
111  const SiStripApvGain *apvgain2 = nullptr,
112  const double &factor2 = 1.);
113 
114  // ---------- member data --------------------------------
115 
116  std::vector<const SiStripApvGain *> apvgainVector_;
117  std::vector<double> normVector_;
119  std::unique_ptr<SiStripApvGain> apvgainAutoPtr_;
120  std::vector<std::pair<std::string, std::string>> recordLabelPair_;
121 };
122 
123 #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:101
SiStripGain::recordLabelPair_
std::vector< std::pair< std::string, std::string > > recordLabelPair_
Definition: SiStripGain.h:120
SiStripGain::SiStripGain
SiStripGain(const SiStripApvGain &apvgain, const double &factor, const SiStripDetInfo &detInfo)
Kept for compatibility.
Definition: SiStripGain.h:52
SiStripGain
Definition: SiStripGain.h:45
TrackerTopology
Definition: TrackerTopology.h:16
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
pos
Definition: PixelAliasList.h:18
SiStripGain::getTagNorm
double getTagNorm(const uint32_t index) const
Definition: SiStripGain.h:102
SiStripGain::normVector_
std::vector< double > normVector_
Definition: SiStripGain.h:117
SiStripGain::apvgainAutoPtr_
std::unique_ptr< SiStripApvGain > apvgainAutoPtr_
Definition: SiStripGain.h:119
SiStripApvGain::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripApvGain.cc:30
SiStripGain::fillNewGain
void fillNewGain(const SiStripApvGain *apvgain, const double &factor, SiStripDetInfo const &detInfo, const SiStripApvGain *apvgain2=nullptr, const double &factor2=1.)
Definition: SiStripGain.cc:40
SiStripGain::apvgainVector_
std::vector< const SiStripApvGain * > apvgainVector_
Definition: SiStripGain.h:116
SiStripGain::getStripGain
static float getStripGain(const uint16_t &strip, const SiStripApvGain::Range &range)
Definition: SiStripGain.h:77
SiStripGain::SiStripGain
SiStripGain()
Definition: SiStripGain.h:47
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripGain::getNumberOfTags
size_t getNumberOfTags() const
Definition: SiStripGain.h:99
SiStripGain::apvgain_
const SiStripApvGain * apvgain_
Definition: SiStripGain.h:118
SiStripGain::getRangeByPos
SiStripApvGain::Range getRangeByPos(unsigned short pos) const
Definition: SiStripGain.h:76
SiStripGain::getRange
const SiStripApvGain::Range getRange(uint32_t detID) const
Definition: SiStripGain.h:75
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
SiStripGain::SiStripGain
SiStripGain(const SiStripApvGain &apvgain, const double &factor, const std::pair< std::string, std::string > &recordLabelPair, const SiStripDetInfo &detInfo)
Definition: SiStripGain.h:57
SiStripApvGain.h
SiStripGain::getApvGain
static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range)
Definition: SiStripGain.h:80
SiStripGain::printDebug
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Definition: SiStripGain.cc:111
SiStripGain::multiply
void multiply(const SiStripApvGain &apvgain, const double &factor, const std::pair< std::string, std::string > &recordLabelPair, const SiStripDetInfo &detInfo)
Definition: SiStripGain.cc:17
SiStripApvGain::getRangeByPos
Range getRangeByPos(unsigned short pos) const
Definition: SiStripApvGain.cc:44
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripApvGain::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripApvGain.h:28
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
SiStripDetInfo
Definition: SiStripDetInfo.h:29
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:100