CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
SiStripApvGain Class Reference

#include <SiStripApvGain.h>

Classes

struct  RegistryPointers
 

Public Types

typedef std::vector< float >::const_iterator ContainerIterator
 
typedef std::vector< float > InputVector
 
typedef std::pair< ContainerIterator, ContainerIteratorRange
 
typedef std::vector< unsigned int > Registry
 
typedef Registry::const_iterator RegistryConstIterator
 
typedef Registry::iterator RegistryIterator
 

Public Member Functions

void getDetIds (std::vector< uint32_t > &DetIds_) const
 
const Range getRange (const uint32_t detID) const
 
Range getRangeByPos (unsigned short pos) const
 
RegistryPointers getRegistryPointers () const
 
void printDebug (std::stringstream &ss, const TrackerTopology *trackerTopo) const
 
void printSummary (std::stringstream &ss, const TrackerTopology *trackerTopo) const
 
bool put (const uint32_t &detID, Range input)
 
 SiStripApvGain ()
 
 ~SiStripApvGain ()
 

Static Public Member Functions

static float getApvGain (uint16_t apv, const Range &range)
 
static float getStripGain (uint16_t strip, const Range &range)
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector< unsigned int > v_detids
 
std::vector< float > v_gains
 
std::vector< unsigned int > v_ibegin
 
std::vector< unsigned int > v_iend
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Stores the information of the gain for each apv using four vectors
A vector<unsigned int> (v_detids) stores the detId.
A vector<float> (v_gains) stores the value of the gain (more than one per detId).
Two vector<unsigned int> (v_ibegin and v_iend) store the correspondence of the v_detids and the ranges of values in v_gain.

The printSummary method uses SiStripDetSummary. See description therein.
The printDebug method prints the gain value for every apv of every detId.

Definition at line 25 of file SiStripApvGain.h.

Member Typedef Documentation

◆ ContainerIterator

typedef std::vector<float>::const_iterator SiStripApvGain::ContainerIterator

Definition at line 27 of file SiStripApvGain.h.

◆ InputVector

typedef std::vector<float> SiStripApvGain::InputVector

Definition at line 32 of file SiStripApvGain.h.

◆ Range

Definition at line 28 of file SiStripApvGain.h.

◆ Registry

typedef std::vector<unsigned int> SiStripApvGain::Registry

Definition at line 29 of file SiStripApvGain.h.

◆ RegistryConstIterator

typedef Registry::const_iterator SiStripApvGain::RegistryConstIterator

Definition at line 31 of file SiStripApvGain.h.

◆ RegistryIterator

typedef Registry::iterator SiStripApvGain::RegistryIterator

Definition at line 30 of file SiStripApvGain.h.

Constructor & Destructor Documentation

◆ SiStripApvGain()

SiStripApvGain::SiStripApvGain ( )
inline

Definition at line 52 of file SiStripApvGain.h.

52 {}

◆ ~SiStripApvGain()

SiStripApvGain::~SiStripApvGain ( )
inline

Definition at line 53 of file SiStripApvGain.h.

53 {}

Member Function Documentation

◆ getApvGain()

static float SiStripApvGain::getApvGain ( uint16_t  apv,
const Range range 
)
inlinestatic

◆ getDetIds()

void SiStripApvGain::getDetIds ( std::vector< uint32_t > &  DetIds_) const

Definition at line 53 of file SiStripApvGain.cc.

53  {
54  // returns vector of DetIds in map
55  // DetIds_=v_detids;
56  DetIds_.insert(DetIds_.begin(), v_detids.begin(), v_detids.end());
57 }

References v_detids.

Referenced by SiStripApvGainsDQM::fillMEsForDet(), SiStripGain::fillNewGain(), SiStripApvGainsDQM::getActiveDetIds(), and SiStripGain::getDetIds().

◆ getRange()

const SiStripApvGain::Range SiStripApvGain::getRange ( const uint32_t  detID) const

Definition at line 30 of file SiStripApvGain.cc.

30  {
31  // get SiStripApvGain Range of DetId
33  if (p == v_detids.end() || *p != DetId)
34  return SiStripApvGain::Range(v_gains.end(), v_gains.end());
35  else {
36  unsigned int pd = p - v_detids.begin();
37  unsigned int ibegin = *(v_ibegin.begin() + pd);
38  unsigned int iend = *(v_iend.begin() + pd);
39  __builtin_prefetch((&v_gains.front()) + ibegin);
40  return SiStripApvGain::Range(v_gains.begin() + ibegin, v_gains.begin() + iend);
41  }
42 }

References pfDeepBoostedJetPreprocessParams_cfi::lower_bound, AlCaHLTBitMon_ParallelJobs::p, v_detids, v_gains, v_ibegin, and v_iend.

Referenced by SiStripNoisesDQM::fillMEsForDet(), SiStripApvGainsDQM::fillMEsForDet(), SiStripNoisesDQM::fillMEsForLayer(), SiStripApvGainsDQM::fillMEsForLayer(), SiStripGain::fillNewGain(), SiStripCorrelateNoise::getGainRatio(), SiStripGain::getRange(), printDebug(), and printSummary().

◆ getRangeByPos()

SiStripApvGain::Range SiStripApvGain::getRangeByPos ( unsigned short  pos) const

Definition at line 44 of file SiStripApvGain.cc.

44  {
45  if (pos > v_detids.size())
46  return Range(v_gains.end(), v_gains.end());
47  unsigned int ibegin = *(v_ibegin.begin() + pos);
48  unsigned int iend = *(v_iend.begin() + pos);
49  __builtin_prefetch((&v_gains.front()) + ibegin);
50  return SiStripApvGain::Range(v_gains.begin() + ibegin, v_gains.begin() + iend);
51 }

References v_detids, v_gains, v_ibegin, and v_iend.

Referenced by SiStripGain::getRangeByPos().

◆ getRegistryPointers()

RegistryPointers SiStripApvGain::getRegistryPointers ( ) const
inline

Definition at line 55 of file SiStripApvGain.h.

55  {
56  RegistryPointers p;
57  p.detid_begin = v_detids.begin();
58  p.detid_end = v_detids.end();
59  p.ibegin_begin = v_ibegin.begin();
60  p.ibegin_end = v_ibegin.end();
61  p.iend_begin = v_iend.begin();
62  p.iend_end = v_iend.end();
63  p.v_begin = v_gains.begin();
64  p.v_end = v_gains.end();
65 
66  return p;
67  }

References AlCaHLTBitMon_ParallelJobs::p, v_detids, v_gains, v_ibegin, and v_iend.

◆ getStripGain()

static float SiStripApvGain::getStripGain ( uint16_t  strip,
const Range range 
)
inlinestatic

Definition at line 78 of file SiStripApvGain.h.

78  {
79  uint16_t apv = strip / 128;
80  return *(range.first + apv);
81  }

References FastTimerService_cff::range, and digitizers_cfi::strip.

Referenced by SiStripNoisesDQM::fillMEsForDet(), SiStripNoisesDQM::fillMEsForLayer(), and SiStripGain::getStripGain().

◆ printDebug()

void SiStripApvGain::printDebug ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Definition at line 85 of file SiStripApvGain.cc.

85  {
86  std::vector<unsigned int>::const_iterator detid = v_detids.begin();
87  ss << "Number of detids " << v_detids.size() << std::endl;
88 
89  for (; detid != v_detids.end(); ++detid) {
91  int apv = 0;
92  for (int it = 0; it < range.second - range.first; ++it) {
93  ss << "detid " << *detid << " \t"
94  << " apv " << apv++ << " \t" << getApvGain(it, range) << " \t" << std::endl;
95  }
96  }
97 }

References getApvGain(), getRange(), FastTimerService_cff::range, contentValuesCheck::ss, and v_detids.

◆ printSummary()

void SiStripApvGain::printSummary ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Definition at line 99 of file SiStripApvGain.cc.

99  {
100  SiStripDetSummary summaryGain{trackerTopo};
101 
102  std::vector<uint32_t>::const_iterator detid = v_detids.begin();
103  for (; detid != v_detids.end(); ++detid) {
104  Range range = getRange(*detid);
105  for (int it = 0; it < range.second - range.first; ++it) {
106  summaryGain.add(*detid, getApvGain(it, range));
107  }
108  }
109  ss << "Summary of gain values:" << std::endl;
110  summaryGain.print(ss, true);
111 }

References getApvGain(), getRange(), FastTimerService_cff::range, contentValuesCheck::ss, and v_detids.

◆ put()

bool SiStripApvGain::put ( const uint32_t &  detID,
Range  input 
)

Definition at line 8 of file SiStripApvGain.cc.

8  {
9  // put in SiStripApvGain of DetId
11  if (p != v_detids.end() && *p == DetId) {
12  edm::LogError("SiStripApvGain") << "[" << __PRETTY_FUNCTION__ << "] SiStripApvGain for DetID " << DetId
13  << " is already stored. Skippig this put" << std::endl;
14  return false;
15  }
16 
17  unsigned int sd = input.second - input.first;
18  unsigned int pd = p - v_detids.begin();
19 
20  unsigned int ibegin = v_gains.size();
21  unsigned int iend = v_gains.size() + sd;
22  v_detids.insert(p, DetId);
23  v_ibegin.insert(v_ibegin.begin() + pd, ibegin);
24  v_iend.insert(v_iend.begin() + pd, iend);
25 
26  v_gains.insert(v_gains.end(), input.first, input.second);
27  return true;
28 }

References input, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, AlCaHLTBitMon_ParallelJobs::p, sd, v_detids, v_gains, v_ibegin, and v_iend.

Referenced by SiStripGain::fillNewGain(), and SiStripCondObjBuilderFromDb::storeTiming().

◆ serialize()

template<class Archive >
void SiStripApvGain::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 94 of file SiStripApvGain.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 94 of file SiStripApvGain.h.

Member Data Documentation

◆ v_detids

std::vector<unsigned int> SiStripApvGain::v_detids
private

◆ v_gains

std::vector<float> SiStripApvGain::v_gains
private

Definition at line 89 of file SiStripApvGain.h.

Referenced by getRange(), getRangeByPos(), getRegistryPointers(), and put().

◆ v_ibegin

std::vector<unsigned int> SiStripApvGain::v_ibegin
private

Definition at line 91 of file SiStripApvGain.h.

Referenced by getRange(), getRangeByPos(), getRegistryPointers(), and put().

◆ v_iend

std::vector<unsigned int> SiStripApvGain::v_iend
private

Definition at line 92 of file SiStripApvGain.h.

Referenced by getRange(), getRangeByPos(), getRegistryPointers(), and put().

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
input
static const std::string input
Definition: EdmProvDump.cc:48
SiStripApvGain::v_iend
std::vector< unsigned int > v_iend
Definition: SiStripApvGain.h:92
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
pos
Definition: PixelAliasList.h:18
SiStripApvGain::v_ibegin
std::vector< unsigned int > v_ibegin
Definition: SiStripApvGain.h:91
SiStripApvGain::v_gains
std::vector< float > v_gains
Definition: SiStripApvGain.h:89
SiStripApvGain::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripApvGain.cc:30
SiStripApvGain::RegistryConstIterator
Registry::const_iterator RegistryConstIterator
Definition: SiStripApvGain.h:31
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
DetId
Definition: DetId.h:17
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
SiStripApvGain::RegistryIterator
Registry::iterator RegistryIterator
Definition: SiStripApvGain.h:30
SiStripApvGain::v_detids
std::vector< unsigned int > v_detids
Definition: SiStripApvGain.h:90
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiStripApvGain::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripApvGain.h:28
SiStripDetSummary
Definition: SiStripDetSummary.h:28
sd
double sd
Definition: CascadeWrapper.h:113
SiStripApvGain::getApvGain
static float getApvGain(uint16_t apv, const Range &range)
Definition: SiStripApvGain.h:82