CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripCondObjectRepresent::SiStripCondDataItem< type > Class Template Reference

#include <SiStripCondObjectRepresent.h>

Public Member Functions

std::vector< typedata (unsigned int detid)
 
std::pair< std::vector< type >, std::vector< type > > demuxedData (unsigned int detid)
 
std::vector< unsigned int > detIds (bool verbose)
 
void divide (unsigned int detid, const std::vector< type > &denominator)
 
void fillAll (unsigned int detid, const std::vector< type > &store)
 
void fillByPushBack (unsigned int detid, const type &value)
 
void fillMonitor1D (const SiStripPI::OpMode &mymode, SiStripPI::Monitor1D *&mon, SiStripPI::Entry &entry, std::vector< type > &values, const unsigned int prev_det, unsigned int &prev_apv, const unsigned int detid)
 
bool isCached ()
 
void setComparedBit ()
 
void setGranularity (bool isPerStrip, bool isPerAPV)
 
 SiStripCondDataItem ()
 
void subtract (unsigned int detid, const std::vector< type > &subtractor)
 
virtual ~SiStripCondDataItem ()=default
 

Private Member Functions

void init ()
 

Private Attributes

bool m_cached
 
bool m_compared
 
std::map< unsigned int, std::vector< type > > m_info
 
bool m_servedPerAPV
 
bool m_servedPerStrip
 

Detailed Description

template<class type>
class SiStripCondObjectRepresent::SiStripCondDataItem< type >

Definition at line 45 of file SiStripCondObjectRepresent.h.

Constructor & Destructor Documentation

◆ SiStripCondDataItem()

◆ ~SiStripCondDataItem()

template<class type>
virtual SiStripCondObjectRepresent::SiStripCondDataItem< type >::~SiStripCondDataItem ( )
virtualdefault

Member Function Documentation

◆ data()

template<class type>
std::vector<type> SiStripCondObjectRepresent::SiStripCondDataItem< type >::data ( unsigned int  detid)
inline

◆ demuxedData()

template<class type>
std::pair<std::vector<type>, std::vector<type> > SiStripCondObjectRepresent::SiStripCondDataItem< type >::demuxedData ( unsigned int  detid)
inline

Definition at line 90 of file SiStripCondObjectRepresent.h.

References cms::cuda::assert(), ALCARECOPPSCalTrackBasedSel_cff::detid, Exception, SiStripCondObjectRepresent::SiStripCondDataItem< type >::m_compared, and SiStripCondObjectRepresent::SiStripCondDataItem< type >::m_info.

90  {
91  if (m_compared) {
92  std::vector<type> v1(m_info[detid].begin(), m_info[detid].begin() + m_info[detid].size() / 2);
93  std::vector<type> v2(m_info[detid].begin() + m_info[detid].size() / 2, m_info[detid].end());
94  assert(v1.size() == v2.size());
95  return std::make_pair(v1, v2);
96  } else {
97  throw cms::Exception("Logic error") << "not being in compared mode, data cannot be demultiplexed";
98  }
99  }
size
Write out results.
assert(be >=bs)
std::map< unsigned int, std::vector< type > > m_info

◆ detIds()

template<class type>
std::vector<unsigned int> SiStripCondObjectRepresent::SiStripCondDataItem< type >::detIds ( bool  verbose)
inline

Definition at line 144 of file SiStripCondObjectRepresent.h.

References gather_cfg::cout, SiStripCondObjectRepresent::SiStripCondDataItem< type >::m_info, findQualityFiles::v, and verbose.

144  {
145  std::vector<unsigned int> v;
146  for (const auto &element : m_info) {
147  if (verbose) {
148  std::cout << element.first << "\n";
149  }
150  v.push_back(element.first);
151  }
152 
153  return v;
154  }
bool verbose
std::map< unsigned int, std::vector< type > > m_info

◆ divide()

template<class type>
void SiStripCondObjectRepresent::SiStripCondDataItem< type >::divide ( unsigned int  detid,
const std::vector< type > &  denominator 
)
inline

Definition at line 62 of file SiStripCondObjectRepresent.h.

References bTagMiniDQMDeepCSV::denominator, ALCARECOPPSCalTrackBasedSel_cff::detid, Exception, and SiStripCondObjectRepresent::SiStripCondDataItem< type >::m_info.

Referenced by python.rootplot.utilities.Hist::__div__().

62  {
63  if (m_info[detid].size() != denominator.size()) {
64  throw cms::Exception("Unaligned Conditions")
65  << "data size of numerator mismatched the data size of denominator";
66  }
67 
68  unsigned int counter = 0;
69  for (const auto &den : denominator) {
70  m_info[detid].at(counter) /= den;
71  counter++;
72  }
73  }
size
Write out results.
std::map< unsigned int, std::vector< type > > m_info

◆ fillAll()

template<class type>
void SiStripCondObjectRepresent::SiStripCondDataItem< type >::fillAll ( unsigned int  detid,
const std::vector< type > &  store 
)
inline

◆ fillByPushBack()

template<class type>
void SiStripCondObjectRepresent::SiStripCondDataItem< type >::fillByPushBack ( unsigned int  detid,
const type value 
)
inline

◆ fillMonitor1D()

template<class type>
void SiStripCondObjectRepresent::SiStripCondDataItem< type >::fillMonitor1D ( const SiStripPI::OpMode mymode,
SiStripPI::Monitor1D *&  mon,
SiStripPI::Entry entry,
std::vector< type > &  values,
const unsigned int  prev_det,
unsigned int &  prev_apv,
const unsigned int  detid 
)
inline

Definition at line 101 of file SiStripCondObjectRepresent.h.

References SiStripPI::APV_BASED, ALCARECOPPSCalTrackBasedSel_cff::detid, mps_splice::entry, SiStripPI::MODULE_BASED, LaserDQM_cfi::mon, SiStripPI::STRIP_BASED, sistrip::STRIPS_PER_APV, and contentValuesCheck::values.

107  {
108  unsigned int istrip = 0;
109  for (const auto &value : values) {
110  bool flush = false;
111  switch (mymode) {
112  case (SiStripPI::APV_BASED):
113  flush = (prev_det != 0 && prev_apv != istrip / sistrip::STRIPS_PER_APV);
114  break;
116  flush = (prev_det != 0 && prev_det != detid);
117  break;
118  case (SiStripPI::STRIP_BASED):
119  flush = (istrip != 0);
120  break;
121  }
122 
123  if (flush) {
124  mon->Fill(prev_apv, prev_det, entry.mean());
125  entry.reset();
126  }
127 
128  entry.add(value);
129 
130  prev_apv = istrip / sistrip::STRIPS_PER_APV;
131  istrip++;
132  }
133  }
Definition: value.py:1
static const uint16_t STRIPS_PER_APV

◆ init()

template<class type>
void SiStripCondObjectRepresent::SiStripCondDataItem< type >::init ( void  )
inlineprivate

◆ isCached()

template<class type>
bool SiStripCondObjectRepresent::SiStripCondDataItem< type >::isCached ( )
inline

◆ setComparedBit()

template<class type>
void SiStripCondObjectRepresent::SiStripCondDataItem< type >::setComparedBit ( )
inline

◆ setGranularity()

template<class type>
void SiStripCondObjectRepresent::SiStripCondDataItem< type >::setGranularity ( bool  isPerStrip,
bool  isPerAPV 
)
inline

◆ subtract()

template<class type>
void SiStripCondObjectRepresent::SiStripCondDataItem< type >::subtract ( unsigned int  detid,
const std::vector< type > &  subtractor 
)
inline

Definition at line 75 of file SiStripCondObjectRepresent.h.

References ALCARECOPPSCalTrackBasedSel_cff::detid, Exception, and SiStripCondObjectRepresent::SiStripCondDataItem< type >::m_info.

75  {
76  if (m_info[detid].size() != subtractor.size()) {
77  throw cms::Exception("Unaligned Conditions")
78  << "data size of numerator mismatched the data size of denominator";
79  }
80 
81  unsigned int counter = 0;
82  for (const auto &sub : subtractor) {
83  m_info[detid].at(counter) -= sub;
84  counter++;
85  }
86  }
size
Write out results.
std::map< unsigned int, std::vector< type > > m_info

Member Data Documentation

◆ m_cached

template<class type>
bool SiStripCondObjectRepresent::SiStripCondDataItem< type >::m_cached
private

◆ m_compared

template<class type>
bool SiStripCondObjectRepresent::SiStripCondDataItem< type >::m_compared
private

◆ m_info

template<class type>
std::map<unsigned int, std::vector<type> > SiStripCondObjectRepresent::SiStripCondDataItem< type >::m_info
private

◆ m_servedPerAPV

template<class type>
bool SiStripCondObjectRepresent::SiStripCondDataItem< type >::m_servedPerAPV
private

◆ m_servedPerStrip

template<class type>
bool SiStripCondObjectRepresent::SiStripCondDataItem< type >::m_servedPerStrip
private