CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
SiPixelCalibConfiguration Class Reference

#include <SiPixelCalibConfiguration.h>

Public Member Functions

std::vector< short > columnPatternForEvent (const uint32_t &eventnumber) const
 
uint32_t expectedTotalEvents () const
 
std::string getCalibrationMode () const
 
std::vector< short > getColumnPattern () const
 
short getNTriggers () const
 
std::vector< short > getRowPattern () const
 
const std::vector< short > getVCalValues () const
 
uint32_t nColumnPatterns () const
 
uint32_t nextPatternChangeForEvent (const uint32_t &eventnumber) const
 
uint32_t nPatterns () const
 
uint32_t nRowPatterns () const
 
uint32_t nVCal () const
 
uint32_t patternSize () const
 
std::vector< short > rowPatternForEvent (const uint32_t &eventnumber) const
 
void setCalibrationMode (const std::string &in)
 
void setColumnPattern (const std::vector< short > &in)
 
void setNTriggers (const short &in)
 
void setRowPattern (const std::vector< short > &in)
 
void setVCalValues (const std::vector< short > &in)
 
 SiPixelCalibConfiguration ()
 
 SiPixelCalibConfiguration (const pos::PixelCalibConfiguration &fancyConfig)
 
short vcalForEvent (const uint32_t &eventnumber) const
 
short vcalIndexForEvent (const uint32_t &eventnumber) const
 
virtual ~SiPixelCalibConfiguration ()
 

Private Member Functions

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

Private Attributes

std::vector< short > fColumnPattern
 
std::string fMode
 
short fNTriggers
 
std::vector< short > fRowPattern
 
std::vector< short > fVCalValues
 

Friends

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

Detailed Description

Definition at line 19 of file SiPixelCalibConfiguration.h.

Constructor & Destructor Documentation

◆ SiPixelCalibConfiguration() [1/2]

SiPixelCalibConfiguration::SiPixelCalibConfiguration ( )
inline

Definition at line 21 of file SiPixelCalibConfiguration.h.

21 { ; }

◆ SiPixelCalibConfiguration() [2/2]

SiPixelCalibConfiguration::SiPixelCalibConfiguration ( const pos::PixelCalibConfiguration fancyConfig)

Definition at line 58 of file SiPixelCalibConfiguration.cc.

59  : fNTriggers(0),
60  fRowPattern(std::vector<short>(0)),
61  fColumnPattern(std::vector<short>(0)),
62  fVCalValues(std::vector<short>(0)),
63  fMode("unknown")
64 
65 { // copy constructor that uses the complex object
66  fNTriggers = fancyConfig.nTriggersPerPattern();
67  std::vector<int> vcalpoints(0);
68  std::cout << "scan name = " << fancyConfig.scanName(0) << std::endl;
69  std::vector<uint32_t> vcalpointsuint32 = fancyConfig.scanValues(fancyConfig.scanName(0));
70  for (size_t ical = 0; ical < vcalpointsuint32.size(); ++ical) {
71  short vcalinput = vcalpointsuint32[ical];
72 
73  std::cout << "Vcal value " << ical << " = " << vcalinput << std::endl;
74  fVCalValues.push_back(vcalinput);
75  }
76  // copy row and column patterns
77 
78  std::vector<std::vector<uint32_t> > cols = fancyConfig.columnList();
79  std::vector<std::vector<uint32_t> > rows = fancyConfig.rowList();
80  for (uint32_t i = 0; i < cols.size(); ++i) {
81  for (uint32_t j = 0; j < cols[i].size(); ++j) {
82  short colval = cols[i][j];
83  fColumnPattern.push_back(colval);
84  }
85  fColumnPattern.push_back(-1);
86  }
87  for (uint32_t i = 0; i < rows.size(); ++i) {
88  for (uint32_t j = 0; j < rows[i].size(); ++j) {
89  short rowval = rows[i][j];
90  fRowPattern.push_back(rowval);
91  }
92  fRowPattern.push_back(-1);
93  }
94  fMode = fancyConfig.mode();
95 }

References pos::PixelCalibConfiguration::columnList(), gather_cfg::cout, fColumnPattern, fMode, fNTriggers, fRowPattern, fVCalValues, mps_fire::i, dqmiolumiharvest::j, pos::PixelCalibConfiguration::mode(), pos::PixelCalibConfiguration::nTriggersPerPattern(), pos::PixelCalibConfiguration::rowList(), postprocess-scan-build::rows, pos::PixelCalibConfiguration::scanName(), and pos::PixelCalibConfiguration::scanValues().

◆ ~SiPixelCalibConfiguration()

virtual SiPixelCalibConfiguration::~SiPixelCalibConfiguration ( )
inlinevirtual

Definition at line 24 of file SiPixelCalibConfiguration.h.

24 { ; }

Member Function Documentation

◆ columnPatternForEvent()

std::vector< short > SiPixelCalibConfiguration::columnPatternForEvent ( const uint32_t &  eventnumber) const

Definition at line 14 of file SiPixelCalibConfiguration.cc.

14  {
15  std::vector<short> result;
16  uint32_t patternnumber = eventnumber / patternSize();
17  uint32_t colpatternnumber = patternnumber % nColumnPatterns();
18 
19  uint32_t nminuscol = 0;
20  for (size_t icol = 0; icol < fColumnPattern.size(); icol++) {
21  if (fColumnPattern[icol] == -1)
22  nminuscol++;
23  else if (nminuscol > colpatternnumber)
24  break;
25  else if (nminuscol == colpatternnumber) {
26  short val = fColumnPattern[icol];
27  result.push_back(val);
28  }
29  }
30  return result;
31 }

References fColumnPattern, nColumnPatterns(), patternSize(), mps_fire::result, and heppy_batch::val.

◆ expectedTotalEvents()

uint32_t SiPixelCalibConfiguration::expectedTotalEvents ( ) const

Definition at line 56 of file SiPixelCalibConfiguration.cc.

56 { return patternSize() * nPatterns(); }

References nPatterns(), and patternSize().

Referenced by SiPixelCalibDigiProducer::store().

◆ getCalibrationMode()

std::string SiPixelCalibConfiguration::getCalibrationMode ( ) const
inline

Definition at line 38 of file SiPixelCalibConfiguration.h.

38 { return fMode; }

References fMode.

◆ getColumnPattern()

std::vector<short> SiPixelCalibConfiguration::getColumnPattern ( ) const
inline

◆ getNTriggers()

short SiPixelCalibConfiguration::getNTriggers ( ) const
inline

◆ getRowPattern()

std::vector<short> SiPixelCalibConfiguration::getRowPattern ( ) const
inline

◆ getVCalValues()

const std::vector<short> SiPixelCalibConfiguration::getVCalValues ( ) const
inline

Definition at line 40 of file SiPixelCalibConfiguration.h.

40 { return fVCalValues; }

References fVCalValues.

◆ nColumnPatterns()

uint32_t SiPixelCalibConfiguration::nColumnPatterns ( ) const

Definition at line 105 of file SiPixelCalibConfiguration.cc.

105  {
106  uint32_t ncols = 0;
107 
108  for (std::vector<short>::const_iterator i = fColumnPattern.begin(); i != fColumnPattern.end(); ++i) {
109  if (*i == -1)
110  ncols++;
111  }
112  return ncols;
113 }

References fColumnPattern, mps_fire::i, and hgcalPlots::ncols.

Referenced by columnPatternForEvent(), nPatterns(), rowPatternForEvent(), and SiPixelCalibDigiProducer::setPattern().

◆ nextPatternChangeForEvent()

uint32_t SiPixelCalibConfiguration::nextPatternChangeForEvent ( const uint32_t &  eventnumber) const

Definition at line 51 of file SiPixelCalibConfiguration.cc.

51  {
52  uint32_t relative_event = eventnumber / patternSize();
53  relative_event += 1;
54  return relative_event * patternSize();
55 }

References patternSize().

◆ nPatterns()

uint32_t SiPixelCalibConfiguration::nPatterns ( ) const
inline

Definition at line 51 of file SiPixelCalibConfiguration.h.

51 { return nRowPatterns() * nColumnPatterns(); }

References nColumnPatterns(), and nRowPatterns().

Referenced by expectedTotalEvents().

◆ nRowPatterns()

uint32_t SiPixelCalibConfiguration::nRowPatterns ( ) const

Definition at line 97 of file SiPixelCalibConfiguration.cc.

97  {
98  uint32_t nrows = 0;
99  for (std::vector<short>::const_iterator i = fRowPattern.begin(); i != fRowPattern.end(); ++i) {
100  if (*i == -1)
101  nrows++;
102  }
103  return nrows;
104 }

References fRowPattern, and mps_fire::i.

Referenced by nPatterns().

◆ nVCal()

uint32_t SiPixelCalibConfiguration::nVCal ( ) const
inline

Definition at line 54 of file SiPixelCalibConfiguration.h.

54 { return fVCalValues.size(); }

References fVCalValues.

Referenced by SiPixelCalibDigiProducer::fillPixel(), and SiPixelCalibDigiProducer::produce().

◆ patternSize()

uint32_t SiPixelCalibConfiguration::patternSize ( ) const
inline

◆ rowPatternForEvent()

std::vector< short > SiPixelCalibConfiguration::rowPatternForEvent ( const uint32_t &  eventnumber) const

Definition at line 33 of file SiPixelCalibConfiguration.cc.

33  {
34  std::vector<short> result;
35  uint32_t patternnumber = eventnumber / patternSize();
36  uint32_t rowpatternnumber = patternnumber / nColumnPatterns();
37 
38  uint32_t nminusrow = 0;
39  for (size_t irow = 0; irow < fRowPattern.size(); irow++) {
40  if (fRowPattern[irow] == -1)
41  nminusrow++;
42  else if (nminusrow > rowpatternnumber)
43  break;
44  else if (nminusrow == rowpatternnumber) {
45  short val = fRowPattern[irow];
46  result.push_back(val);
47  }
48  }
49  return result;
50 }

References fRowPattern, nColumnPatterns(), patternSize(), mps_fire::result, and heppy_batch::val.

◆ serialize()

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

◆ setCalibrationMode()

void SiPixelCalibConfiguration::setCalibrationMode ( const std::string &  in)
inline

Definition at line 37 of file SiPixelCalibConfiguration.h.

37 { fMode = in; }

References fMode, and recoMuon::in.

◆ setColumnPattern()

void SiPixelCalibConfiguration::setColumnPattern ( const std::vector< short > &  in)
inline

Definition at line 35 of file SiPixelCalibConfiguration.h.

35 { fColumnPattern = in; }

References fColumnPattern, and recoMuon::in.

◆ setNTriggers()

void SiPixelCalibConfiguration::setNTriggers ( const short &  in)
inline

Definition at line 29 of file SiPixelCalibConfiguration.h.

29 { fNTriggers = in; }

References fNTriggers, and recoMuon::in.

◆ setRowPattern()

void SiPixelCalibConfiguration::setRowPattern ( const std::vector< short > &  in)
inline

Definition at line 32 of file SiPixelCalibConfiguration.h.

32 { fRowPattern = in; }

References fRowPattern, and recoMuon::in.

◆ setVCalValues()

void SiPixelCalibConfiguration::setVCalValues ( const std::vector< short > &  in)
inline

Definition at line 41 of file SiPixelCalibConfiguration.h.

41 { fVCalValues = in; }

References fVCalValues, and recoMuon::in.

◆ vcalForEvent()

short SiPixelCalibConfiguration::vcalForEvent ( const uint32_t &  eventnumber) const

Definition at line 10 of file SiPixelCalibConfiguration.cc.

10  {
11  short result = fVCalValues[vcalIndexForEvent(eventnumber)];
12  return result;
13 }

References fVCalValues, mps_fire::result, and vcalIndexForEvent().

◆ vcalIndexForEvent()

short SiPixelCalibConfiguration::vcalIndexForEvent ( const uint32_t &  eventnumber) const

Definition at line 5 of file SiPixelCalibConfiguration.cc.

5  {
6  uint32_t relative_event = std::abs((int32_t)eventnumber - 1) % patternSize();
7  short relative_pattern = relative_event / getNTriggers();
8  return relative_pattern;
9 }

References funct::abs(), getNTriggers(), and patternSize().

Referenced by SiPixelCalibDigiProducer::fill(), and vcalForEvent().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 63 of file SiPixelCalibConfiguration.h.

◆ cond::serialization::access

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

Definition at line 63 of file SiPixelCalibConfiguration.h.

Member Data Documentation

◆ fColumnPattern

std::vector<short> SiPixelCalibConfiguration::fColumnPattern
private

◆ fMode

std::string SiPixelCalibConfiguration::fMode
private

◆ fNTriggers

short SiPixelCalibConfiguration::fNTriggers
private

◆ fRowPattern

std::vector<short> SiPixelCalibConfiguration::fRowPattern
private

◆ fVCalValues

std::vector<short> SiPixelCalibConfiguration::fVCalValues
private
hgcalPlots.ncols
ncols
Definition: hgcalPlots.py:104
mps_fire.i
i
Definition: mps_fire.py:428
SiPixelCalibConfiguration::fColumnPattern
std::vector< short > fColumnPattern
Definition: SiPixelCalibConfiguration.h:59
SiPixelCalibConfiguration::nRowPatterns
uint32_t nRowPatterns() const
Definition: SiPixelCalibConfiguration.cc:97
SiPixelCalibConfiguration::fRowPattern
std::vector< short > fRowPattern
Definition: SiPixelCalibConfiguration.h:58
SiPixelCalibConfiguration::getNTriggers
short getNTriggers() const
Definition: SiPixelCalibConfiguration.h:28
gather_cfg.cout
cout
Definition: gather_cfg.py:144
pos::PixelCalibConfiguration::nTriggersPerPattern
unsigned int nTriggersPerPattern() const
Definition: PixelCalibConfiguration.h:108
SiPixelCalibConfiguration::nPatterns
uint32_t nPatterns() const
Definition: SiPixelCalibConfiguration.h:51
SiPixelCalibConfiguration::nColumnPatterns
uint32_t nColumnPatterns() const
Definition: SiPixelCalibConfiguration.cc:105
SiPixelCalibConfiguration::fMode
std::string fMode
Definition: SiPixelCalibConfiguration.h:61
SiPixelCalibConfiguration::patternSize
uint32_t patternSize() const
Definition: SiPixelCalibConfiguration.h:50
SiPixelCalibConfiguration::fNTriggers
short fNTriggers
Definition: SiPixelCalibConfiguration.h:57
pos::PixelCalibConfiguration::rowList
const std::vector< std::vector< unsigned int > > & rowList() const
Definition: PixelCalibConfiguration.h:159
pos::PixelCalibConfiguration::scanValues
std::vector< unsigned int > scanValues(std::string dac) const
Definition: PixelCalibConfiguration.h:149
SiPixelCalibConfiguration::vcalIndexForEvent
short vcalIndexForEvent(const uint32_t &eventnumber) const
Definition: SiPixelCalibConfiguration.cc:5
pos::PixelCalibConfiguration::columnList
const std::vector< std::vector< unsigned int > > & columnList() const
Definition: PixelCalibConfiguration.h:158
recoMuon::in
Definition: RecoMuonEnumerators.h:6
pos::PixelCalibConfiguration::scanName
std::string scanName(unsigned int iscan) const
Definition: PixelCalibConfiguration.h:148
SiPixelCalibConfiguration::fVCalValues
std::vector< short > fVCalValues
Definition: SiPixelCalibConfiguration.h:60
heppy_batch.val
val
Definition: heppy_batch.py:351
pos::PixelCalibConfiguration::mode
std::string mode() const override
Definition: PixelCalibConfiguration.h:173
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
postprocess-scan-build.rows
rows
Definition: postprocess-scan-build.py:23