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 edm::EventSetup &setup)
 
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 10 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 edm::EventSetup setup 
)

Definition at line 19 of file CalibrationTask.cc.

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

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

◆ ~CalibrationTask()

CalibrationTask::~CalibrationTask ( )
override

Definition at line 60 of file CalibrationTask.cc.

60  {
61  LogDebug("Commissioning") << "[CalibrationTask::CalibrationTask] Destructing object...";
62 }

References LogDebug.

Member Function Documentation

◆ book()

void CalibrationTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 66 of file CalibrationTask.cc.

66  {
67  LogDebug("Commissioning") << "[CalibrationTask::book]";
68 
69  // book 16 histograms, one for each strip in a calibration group --> APV1 --> 16 = dimension of one calChan
70  if (calib1_.find(extrainfo_) == calib1_.end()) {
72  calib1_[extrainfo_].resize(16);
73  for (int i = 0; i < 16; ++i) {
74  std::string postfix = extrainfo_ + "_istrip_" + std::to_string(i);
76  runType_,
78  fedKey(),
80  connection().i2cAddr(0),
81  postfix)
82  .title();
83 
85  calib1_[extrainfo_][i].histo(dqm()->book1D(title, title, nBins_, 0, 200));
87  calib1_[extrainfo_][i].histo(dqm()->book1D(title, title, nBins_, 0, 250));
88  calib1_[extrainfo_][i].isProfile_ = false;
89  calib1_[extrainfo_][i].vNumOfEntries_.resize(nBins_, 0);
90  }
91  }
92 
93  // book 16 histograms, one for each strip in a calibration group --> APV2 --> 16 = dimension of one calChan
94  if (calib2_.find(extrainfo_) == calib2_.end()) {
96  calib2_[extrainfo_].resize(16);
97  for (int i = 0; i < 16; ++i) {
98  std::string postfix = extrainfo_ + "_istrip_" + std::to_string(i);
100  runType_,
102  fedKey(),
103  sistrip::APV,
104  connection().i2cAddr(1),
105  postfix)
106  .title();
107 
109  calib2_[extrainfo_][i].histo(dqm()->book1D(title, title, nBins_, 0, 200));
111  calib2_[extrainfo_][i].histo(dqm()->book1D(title, title, nBins_, 0, 250));
112 
113  calib2_[extrainfo_][i].isProfile_ = false;
114  calib2_[extrainfo_][i].vNumOfEntries_.resize(nBins_, 0);
115  }
116  }
117 }

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 121 of file CalibrationTask.cc.

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

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 176 of file CalibrationTask.cc.

176 { directory_ = dir; }

References DeadROC_duringRun::dir, and directory_.

◆ update()

void CalibrationTask::update ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 162 of file CalibrationTask.cc.

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

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 27 of file CalibrationTask.h.

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

◆ calib2_

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

Definition at line 28 of file CalibrationTask.h.

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

◆ directory_

std::string CalibrationTask::directory_
private

Definition at line 33 of file CalibrationTask.h.

Referenced by book(), and setCurrentFolder().

◆ extrainfo_

std::string CalibrationTask::extrainfo_
private

Definition at line 32 of file CalibrationTask.h.

Referenced by book(), and fill().

◆ lastCalChan_

uint16_t CalibrationTask::lastCalChan_
private

Definition at line 31 of file CalibrationTask.h.

Referenced by fill().

◆ lastCalSel_

uint16_t CalibrationTask::lastCalSel_
private

Definition at line 31 of file CalibrationTask.h.

Referenced by fill().

◆ lastLatency_

uint16_t CalibrationTask::lastLatency_
private

Definition at line 31 of file CalibrationTask.h.

Referenced by fill().

◆ nBins_

uint16_t CalibrationTask::nBins_
private

Definition at line 30 of file CalibrationTask.h.

Referenced by book(), and CalibrationTask().

◆ ped

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

Definition at line 34 of file CalibrationTask.h.

Referenced by CalibrationTask(), and fill().

◆ run_

uint32_t CalibrationTask::run_
private

Definition at line 35 of file CalibrationTask.h.

◆ runType_

sistrip::RunType CalibrationTask::runType_
private

Definition at line 26 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:162
CalibrationTask::extrainfo_
std::string extrainfo_
Definition: CalibrationTask.h:32
SiStripPedestals::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripPedestals.h:51
CalibrationTask::calib2_
std::map< std::string, std::vector< HistoSet > > calib2_
Definition: CalibrationTask.h:28
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:31
SiStripPedestalsRcd
Definition: SiStripCondDataRecords.h:43
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
CalibrationTask::lastCalSel_
uint16_t lastCalSel_
Definition: CalibrationTask.h:31
CalibrationTask::book
void book() override
Definition: CalibrationTask.cc:66
CommissioningTask::fedKey
const uint32_t & fedKey() const
Definition: CommissioningTask.h:192
CalibrationTask::nBins_
uint16_t nBins_
Definition: CalibrationTask.h:30
sistrip::EXPERT_HISTO
Definition: ConstantsForHistoType.h:29
edm::ESHandle< SiStripPedestals >
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
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripPedestals::getRange
const Range getRange(const uint32_t &detID) const
Definition: SiStripPedestals.cc:28
CalibrationTask::run_
uint32_t run_
Definition: CalibrationTask.h:35
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
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:27
get
#define get
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:26
CalibrationTask::directory_
std::string directory_
Definition: CalibrationTask.h:33
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:31
CalibrationTask::ped
std::vector< uint16_t > ped
Definition: CalibrationTask.h:34
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23