CMS 3D CMS Logo

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

#include <CalibrationTask.h>

Inheritance diagram for CalibrationTask:
CommissioningTask

Public Member Functions

 CalibrationTask (DQMStore *, const FedChannelConnection &, const sistrip::RunType &, const char *filename, uint32_t run, const SiStripPedestals &pedestals)
 
void setCurrentFolder (const std::string &)
 
 ~CalibrationTask () override
 
- Public Member Functions inherited from CommissioningTask
void bookHistograms ()
 
 CommissioningTask (DQMStore *, const FedChannelConnection &, const std::string &my_name)
 
void eventSetup (const edm::EventSetup *)
 
const uint32_t & fillCntr () const
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &)
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &, const edm::DetSet< SiStripRawDigi > &)
 
void fillHistograms (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &, const edm::DetSet< SiStripRawDigi > &, const std::vector< uint16_t > &)
 
void fillHistograms (const SiStripEventSummary &, const uint16_t &fed_id, const std::map< uint16_t, float > &fed_ch)
 
const std::string & myName () const
 
const uint32_t & updateFreq () const
 
void updateFreq (const uint32_t &)
 
void updateHistograms ()
 
virtual ~CommissioningTask ()
 

Private Member Functions

void book () override
 
void fill (const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) override
 
void update () override
 

Private Attributes

std::map< std::string, std::vector< HistoSet > > calib1_
 
std::map< std::string, std::vector< HistoSet > > calib2_
 
std::string directory_
 
std::string extrainfo_
 
uint16_t lastCalChan_
 
uint16_t lastCalSel_
 
uint16_t lastLatency_
 
uint16_t nBins_
 
std::vector< uint16_t > ped
 
uint32_t run_
 
sistrip::RunType runType_
 

Additional Inherited Members

- Public Types inherited from CommissioningTask
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from CommissioningTask
const FedChannelConnectionconnection () const
 
DQMStore *const dqm () const
 
const edm::EventSetup *const eventSetup () const
 
const uint32_t & fecKey () const
 
const uint32_t & fedKey () const
 
void updateHistoSet (CompactHistoSet &)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin, const short &value)
 
void updateHistoSet (HistoSet &)
 
void updateHistoSet (HistoSet &, const float &value)
 
void updateHistoSet (HistoSet &, const uint32_t &bin)
 
void updateHistoSet (HistoSet &, const uint32_t &bin, const float &value)
 

Detailed Description

Definition at line 12 of file CalibrationTask.h.

Constructor & Destructor Documentation

◆ CalibrationTask()

CalibrationTask::CalibrationTask ( DQMStore dqm,
const FedChannelConnection conn,
const sistrip::RunType rtype,
const char *  filename,
uint32_t  run,
const SiStripPedestals pedestals 
)

Definition at line 16 of file CalibrationTask.cc.

22  : CommissioningTask(dqm, conn, "CalibrationTask"),
23  runType_(rtype),
24  nBins_(0),
25  lastCalChan_(1000),
26  lastCalSel_(1000),
27  lastLatency_(1000),
28  extrainfo_(),
29  run_(run) {
30  // each latency point is 25ns, each calSel is 25/8 --> 64 points = 8 calsel + 8 latency --> as set in the DAQ configuration
32  nBins_ = 64;
33  // each latency point is 25ns, each calSel is 25/8 --> 80 points = 8 calsel + 10 latency --> as set in the DAQ configuration
35  nBins_ = 80;
36 
37  LogDebug("Commissioning") << "[CalibrationTask::CalibrationTask] Constructing object...";
38 
39  // load the pedestals
40  SiStripPedestals::Range detPedRange = pedestals.getRange(conn.detId());
41  int start = conn.apvPairNumber() * 256;
42  int stop = start + 256;
43  int value = 0;
44  ped.reserve(256);
45  for (int strip = start; strip < stop; ++strip) {
46  value = int(pedestals.getPed(strip, detPedRange));
47  if (value > 895)
48  value -= 1024;
49  ped.push_back(value);
50  }
51 }

References sistrip::CALIBRATION, sistrip::CALIBRATION_DECO, SiStripCommissioningClient_cfg::conn, SiStripPedestals::getPed(), SiStripPedestals::getRange(), createfilelist::int, LogDebug, nBins_, ped, runType_, and digitizers_cfi::strip.

◆ ~CalibrationTask()

CalibrationTask::~CalibrationTask ( )
override

Definition at line 55 of file CalibrationTask.cc.

55  {
56  LogDebug("Commissioning") << "[CalibrationTask::CalibrationTask] Destructing object...";
57 }

References LogDebug.

Member Function Documentation

◆ book()

void CalibrationTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 61 of file CalibrationTask.cc.

61  {
62  LogDebug("Commissioning") << "[CalibrationTask::book]";
63 
64  // book 16 histograms, one for each strip in a calibration group --> APV1 --> 16 = dimension of one calChan
65  if (calib1_.find(extrainfo_) == calib1_.end()) {
67  calib1_[extrainfo_].resize(16);
68  for (int i = 0; i < 16; ++i) {
69  std::string postfix = extrainfo_ + "_istrip_" + std::to_string(i);
71  runType_,
73  fedKey(),
75  connection().i2cAddr(0),
76  postfix)
77  .title();
78 
80  calib1_[extrainfo_][i].histo(dqm()->book1D(title, title, nBins_, 0, 200));
82  calib1_[extrainfo_][i].histo(dqm()->book1D(title, title, nBins_, 0, 250));
83  calib1_[extrainfo_][i].isProfile_ = false;
84  calib1_[extrainfo_][i].vNumOfEntries_.resize(nBins_, 0);
85  }
86  }
87 
88  // book 16 histograms, one for each strip in a calibration group --> APV2 --> 16 = dimension of one calChan
89  if (calib2_.find(extrainfo_) == calib2_.end()) {
91  calib2_[extrainfo_].resize(16);
92  for (int i = 0; i < 16; ++i) {
93  std::string postfix = extrainfo_ + "_istrip_" + std::to_string(i);
95  runType_,
97  fedKey(),
99  connection().i2cAddr(1),
100  postfix)
101  .title();
102 
104  calib2_[extrainfo_][i].histo(dqm()->book1D(title, title, nBins_, 0, 200));
106  calib2_[extrainfo_][i].histo(dqm()->book1D(title, title, nBins_, 0, 250));
107 
108  calib2_[extrainfo_][i].isProfile_ = false;
109  calib2_[extrainfo_][i].vNumOfEntries_.resize(nBins_, 0);
110  }
111  }
112 }

References sistrip::APV, calib1_, calib2_, sistrip::CALIBRATION, sistrip::CALIBRATION_DECO, CommissioningTask::connection(), directory_, CommissioningTask::dqm(), sistrip::EXPERT_HISTO, extrainfo_, sistrip::FED_KEY, CommissioningTask::fedKey(), mps_fire::i, LogDebug, nBins_, runType_, dqm::implementation::DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripHistoTitle::title(), and runGCPTkAlMap::title.

Referenced by fill().

◆ fill()

void CalibrationTask::fill ( const SiStripEventSummary summary,
const edm::DetSet< SiStripRawDigi > &  digis 
)
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 116 of file CalibrationTask.cc.

116  {
117  LogDebug("Commissioning") << "[CalibrationTask::fill]";
118 
119  if (lastCalChan_ != summary.calChan()) { // change in the calChan value
120  lastCalChan_ = summary.calChan();
121  lastLatency_ = summary.latency();
122  lastCalSel_ = summary.calSel();
123  extrainfo_ = "calChan_" + std::to_string(lastCalChan_);
124  book(); // book histograms and load the right one
125  } else {
126  lastCalChan_ = summary.calChan();
127  lastLatency_ = summary.latency();
128  lastCalSel_ = summary.calSel();
129  extrainfo_ = "calChan_" + std::to_string(lastCalChan_);
130  }
131 
132  // Check if CalChan changed. In that case, save, reset histo, change title, and continue
133  int isub = lastCalChan_ < 4 ? lastCalChan_ + 4 : lastCalChan_ - 4;
134  int bin = 0;
135 
137  bin = (100 - summary.latency()) * 8 + (7 - summary.calSel());
139  bin = (102 - summary.latency()) * 8 + (7 - summary.calSel());
140 
141  // Fill the histograms data-ped -(data-ped)_isub, the second term corresponds to the common mode substraction, looking at a strip far away.
142  for (int k = 0; k < 16; ++k) {
144  bin,
145  digis.data[lastCalChan_ + k * 8].adc() - ped[lastCalChan_ + k * 8] -
146  (digis.data[isub + k * 8].adc() - ped[isub + k * 8]));
148  bin,
149  digis.data[128 + lastCalChan_ + k * 8].adc() - ped[128 + lastCalChan_ + k * 8] -
150  (digis.data[128 + isub + k * 8].adc() - ped[128 + isub + k * 8]));
151  }
152  update(); //TODO: temporary: find a better solution later
153 }

References newFWLiteAna::bin, book(), calib1_, calib2_, sistrip::CALIBRATION, sistrip::CALIBRATION_DECO, edm::DetSet< T >::data, extrainfo_, dqmdumpme::k, lastCalChan_, lastCalSel_, lastLatency_, LogDebug, ped, runType_, edmLumisInFiles::summary, update(), and CommissioningTask::updateHistoSet().

◆ setCurrentFolder()

void CalibrationTask::setCurrentFolder ( const std::string &  dir)

Definition at line 171 of file CalibrationTask.cc.

171 { directory_ = dir; }

References DeadROC_duringRun::dir, and directory_.

◆ update()

void CalibrationTask::update ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 157 of file CalibrationTask.cc.

157  {
158  LogDebug("Commissioning") << "[CalibrationTask::update]"; // huge output
159 
160  for (const auto& element : calib1_) { // all pulse for different calChan
161  for (auto vecelement : element.second) // all strips in a calCan
162  updateHistoSet(vecelement);
163  }
164 
165  for (const auto& element : calib2_) { // all pulse for different calChan
166  for (auto vecelement : element.second) // all strips in a calCan
167  updateHistoSet(vecelement);
168  }
169 }

References calib1_, calib2_, LogDebug, and CommissioningTask::updateHistoSet().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), fill(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

Member Data Documentation

◆ calib1_

std::map<std::string, std::vector<HistoSet> > CalibrationTask::calib1_
private

Definition at line 29 of file CalibrationTask.h.

Referenced by book(), fill(), and update().

◆ calib2_

std::map<std::string, std::vector<HistoSet> > CalibrationTask::calib2_
private

Definition at line 30 of file CalibrationTask.h.

Referenced by book(), fill(), and update().

◆ directory_

std::string CalibrationTask::directory_
private

Definition at line 35 of file CalibrationTask.h.

Referenced by book(), and setCurrentFolder().

◆ extrainfo_

std::string CalibrationTask::extrainfo_
private

Definition at line 34 of file CalibrationTask.h.

Referenced by book(), and fill().

◆ lastCalChan_

uint16_t CalibrationTask::lastCalChan_
private

Definition at line 33 of file CalibrationTask.h.

Referenced by fill().

◆ lastCalSel_

uint16_t CalibrationTask::lastCalSel_
private

Definition at line 33 of file CalibrationTask.h.

Referenced by fill().

◆ lastLatency_

uint16_t CalibrationTask::lastLatency_
private

Definition at line 33 of file CalibrationTask.h.

Referenced by fill().

◆ nBins_

uint16_t CalibrationTask::nBins_
private

Definition at line 32 of file CalibrationTask.h.

Referenced by book(), and CalibrationTask().

◆ ped

std::vector<uint16_t> CalibrationTask::ped
private

Definition at line 36 of file CalibrationTask.h.

Referenced by CalibrationTask(), and fill().

◆ run_

uint32_t CalibrationTask::run_
private

Definition at line 37 of file CalibrationTask.h.

◆ runType_

sistrip::RunType CalibrationTask::runType_
private

Definition at line 28 of file CalibrationTask.h.

Referenced by book(), CalibrationTask(), and fill().

runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
mps_fire.i
i
Definition: mps_fire.py:428
start
Definition: start.py:1
sistrip::CALIBRATION
Definition: ConstantsForRunType.h:73
CalibrationTask::update
void update() override
Definition: CalibrationTask.cc:157
CalibrationTask::extrainfo_
std::string extrainfo_
Definition: CalibrationTask.h:34
SiStripPedestals::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripPedestals.h:51
CalibrationTask::calib2_
std::map< std::string, std::vector< HistoSet > > calib2_
Definition: CalibrationTask.h:30
CommissioningTask::connection
const FedChannelConnection & connection() const
Definition: CommissioningTask.h:189
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
CalibrationTask::lastLatency_
uint16_t lastLatency_
Definition: CalibrationTask.h:33
CalibrationTask::lastCalSel_
uint16_t lastCalSel_
Definition: CalibrationTask.h:33
CalibrationTask::book
void book() override
Definition: CalibrationTask.cc:61
CommissioningTask::fedKey
const uint32_t & fedKey() const
Definition: CommissioningTask.h:192
CalibrationTask::nBins_
uint16_t nBins_
Definition: CalibrationTask.h:32
sistrip::EXPERT_HISTO
Definition: ConstantsForHistoType.h:29
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
dqmdumpme.k
k
Definition: dqmdumpme.py:60
CommissioningTask::CommissioningTask
CommissioningTask()
Definition: CommissioningTask.h:143
SiStripPedestals::getRange
const Range getRange(const uint32_t &detID) const
Definition: SiStripPedestals.cc:28
CalibrationTask::run_
uint32_t run_
Definition: CalibrationTask.h:37
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
sistrip::CALIBRATION_DECO
Definition: ConstantsForRunType.h:93
sistrip::APV
Definition: ConstantsForGranularity.h:79
createfilelist.int
int
Definition: createfilelist.py:10
edmLumisInFiles.summary
summary
Definition: edmLumisInFiles.py:39
CommissioningTask::updateHistoSet
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
Definition: CommissioningTask.cc:274
value
Definition: value.py:1
CalibrationTask::calib1_
std::map< std::string, std::vector< HistoSet > > calib1_
Definition: CalibrationTask.h:29
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
writedatasetfile.run
run
Definition: writedatasetfile.py:27
CommissioningTask::dqm
DQMStore *const dqm() const
Definition: CommissioningTask.h:188
CalibrationTask::runType_
sistrip::RunType runType_
Definition: CalibrationTask.h:28
CalibrationTask::directory_
std::string directory_
Definition: CalibrationTask.h:35
SiStripHistoTitle::title
const std::string & title() const
Definition: SiStripHistoTitle.h:109
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
SiStripHistoTitle
Utility class that holds histogram title.
Definition: SiStripHistoTitle.h:20
dqm
Definition: DQMStore.h:18
SiStripPedestals::getPed
float getPed(const uint16_t &strip, const Range &range) const
Definition: SiStripPedestals.cc:51
sistrip::FED_KEY
Definition: ConstantsForKeyType.h:30
CalibrationTask::lastCalChan_
uint16_t lastCalChan_
Definition: CalibrationTask.h:33
CalibrationTask::ped
std::vector< uint16_t > ped
Definition: CalibrationTask.h:36
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23