CMS 3D CMS Logo

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

#include <CalibrationScanTask.h>

Inheritance diagram for CalibrationScanTask:
CommissioningTask

Public Member Functions

 CalibrationScanTask (DQMStore *, const FedChannelConnection &, const sistrip::RunType &, const char *filename, uint32_t run, const edm::EventSetup &setup)
 
void setCurrentFolder (const std::string &)
 
 ~CalibrationScanTask () 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, HistoSetcalib1_
 
std::map< std::string, HistoSetcalib2_
 
std::string directory_
 
std::string extrainfo_
 
uint32_t lastCalChan_
 
uint32_t lastCalSel_
 
uint32_t lastISHA_
 
uint32_t lastLatency_
 
uint32_t lastVFS_
 
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 (HistoSet &, const uint32_t &bin, const float &value)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin, const short &value)
 
void updateHistoSet (HistoSet &, const uint32_t &bin)
 
void updateHistoSet (CompactHistoSet &, const uint32_t &bin)
 
void updateHistoSet (HistoSet &, const float &value)
 
void updateHistoSet (CompactHistoSet &)
 
void updateHistoSet (HistoSet &)
 

Detailed Description

Definition at line 10 of file CalibrationScanTask.h.

Constructor & Destructor Documentation

CalibrationScanTask::CalibrationScanTask ( 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 CalibrationScanTask.cc.

References FedChannelConnection::apvPairNumber(), sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, FedChannelConnection::detId(), edm::EventSetup::get(), SiStripPedestals::getPed(), SiStripPedestals::getRange(), createfilelist::int, LogDebug, nBins_, ped, runType_, and digitizers_cfi::strip.

25  : CommissioningTask(dqm, conn, "CalibrationScanTask"),
26  runType_(rtype),
27  nBins_(0),
28  lastISHA_(1000),
29  lastVFS_(1000),
30  lastCalChan_(1000),
31  lastCalSel_(1000),
32  lastLatency_(1000),
33  extrainfo_(),
34  run_(run) {
35  // each latency point is 25ns, each calSel is 25/8 --> 64 points = 8 calsel + 8 latency --> as set in the DAQ configuration
37  nBins_ = 64;
38  // each latency point is 25ns, each calSel is 25/8 --> 80 points = 8 calsel + 10 latency --> as set in the DAQ configuration
40  nBins_ = 80;
41 
42  LogDebug("Commissioning") << "[CalibrationScanTask::CalibrationScanTask] Constructing object...";
43  // load the pedestals
44  edm::ESHandle<SiStripPedestals> pedestalsHandle;
45  setup.get<SiStripPedestalsRcd>().get(pedestalsHandle);
46  SiStripPedestals::Range detPedRange = pedestalsHandle->getRange(conn.detId());
47  int start = conn.apvPairNumber() * 256;
48  int stop = start + 256;
49  int value = 0;
50  ped.reserve(256);
51  LogDebug("Commissioning") << "[CalibrationScanTask::CalibrationScanTask] Loading pedestal for " << conn.detId();
52  if (conn.detId() == 0)
53  return;
54  for (int strip = start; strip < stop; ++strip) {
55  value = int(pedestalsHandle->getPed(strip, detPedRange));
56  if (value > 895)
57  value -= 1024;
58  ped.push_back(value);
59  }
60 }
#define LogDebug(id)
Definition: start.py:1
sistrip::RunType runType_
uint16_t apvPairNumber() const
std::pair< ContainerIterator, ContainerIterator > Range
std::vector< uint16_t > ped
float getPed(const uint16_t &strip, const Range &range) const
const uint32_t & detId() const
Definition: value.py:1
T get() const
Definition: EventSetup.h:73
const Range getRange(const uint32_t &detID) const
CalibrationScanTask::~CalibrationScanTask ( )
override

Definition at line 64 of file CalibrationScanTask.cc.

References LogDebug.

64  {
65  LogDebug("Commissioning") << "[CalibrationScanTask::CalibrationScanTask] Destructing object...";
66 }
#define LogDebug(id)

Member Function Documentation

void CalibrationScanTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 70 of file CalibrationScanTask.cc.

References sistrip::APV, calib1_, calib2_, sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, CommissioningTask::connection(), directory_, CommissioningTask::dqm(), sistrip::EXPERT_HISTO, extrainfo_, sistrip::FED_KEY, CommissioningTask::fedKey(), nBins_, runType_, dqm::dqmstoreimpl::DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, overlapproblemtsosanalyzer_cfi::title, and SiStripHistoTitle::title().

Referenced by fill().

70  {
71  if (calib1_.find(extrainfo_) == calib1_.end()) {
72  // construct the histo titles and book two histograms: one per APV --> all strip in one APV are considered to fill histogram
74  runType_,
76  fedKey(),
78  connection().i2cAddr(0),
79  extrainfo_)
80  .title();
81 
83  calib1_[extrainfo_] = HistoSet();
85  calib1_[extrainfo_].histo(dqm()->book1D(title, title, nBins_, 0, 200));
87  calib1_[extrainfo_].histo(dqm()->book1D(title, title, nBins_, 0, 250));
88  calib1_[extrainfo_].isProfile_ = false;
89  calib1_[extrainfo_].vNumOfEntries_.resize(nBins_, 0);
90  }
91 
92  if (calib2_.find(extrainfo_) == calib2_.end()) {
94  runType_,
96  fedKey(),
98  connection().i2cAddr(1),
99  extrainfo_)
100  .title();
101 
103  calib2_[extrainfo_] = HistoSet();
105  calib2_[extrainfo_].histo(dqm()->book1D(title, title, nBins_, 0, 200));
107  calib2_[extrainfo_].histo(dqm()->book1D(title, title, nBins_, 0, 250));
108  calib2_[extrainfo_].isProfile_ = false;
109  calib2_[extrainfo_].vNumOfEntries_.resize(nBins_, 0);
110  }
111 }
Utility class that holds histogram title.
const std::string & title() const
sistrip::RunType runType_
DQMStore *const dqm() const
std::map< std::string, HistoSet > calib2_
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:639
std::map< std::string, HistoSet > calib1_
const uint32_t & fedKey() const
const FedChannelConnection & connection() const
void CalibrationScanTask::fill ( const SiStripEventSummary summary,
const edm::DetSet< SiStripRawDigi > &  digis 
)
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 115 of file CalibrationScanTask.cc.

References newFWLiteAna::bin, book(), SiStripEventSummary::calChan(), calib1_, calib2_, sistrip::CALIBRATION_SCAN, sistrip::CALIBRATION_SCAN_DECO, SiStripEventSummary::calSel(), edm::DetSet< T >::data, extrainfo_, SiStripEventSummary::isha(), dqmdumpme::k, lastCalChan_, lastCalSel_, lastISHA_, lastLatency_, lastVFS_, SiStripEventSummary::latency(), or, ped, runType_, update(), CommissioningTask::updateHistoSet(), and SiStripEventSummary::vfs().

115  {
116  if (lastISHA_ != summary.isha() or
117  lastVFS_ != summary.vfs()) { // triggered only when there is a change in isha and vfs
118  lastISHA_ = summary.isha();
119  lastVFS_ = summary.vfs();
120  lastCalSel_ = summary.calSel();
121  lastLatency_ = summary.latency();
122  lastCalChan_ = summary.calChan();
123  extrainfo_ = "isha_" + std::to_string(lastISHA_) + "_vfs_" + std::to_string(lastVFS_);
124  book(); // book histograms and load the right one
125  } else {
126  lastISHA_ = summary.isha();
127  lastVFS_ = summary.vfs();
128  lastCalSel_ = summary.calSel();
129  lastLatency_ = summary.latency();
130  lastCalChan_ = summary.calChan();
131  extrainfo_ = "isha_" + std::to_string(lastISHA_) + "_vfs_" + std::to_string(lastVFS_);
132  }
133 
134  // retrieve the delay from the EventSummary
135  int bin = 0;
137  bin = (100 - summary.latency()) * 8 + (7 - summary.calSel());
139  bin = (102 - summary.latency()) * 8 + (7 - summary.calSel());
140 
141  // Digis are obtained for an APV pair.strips 0->127 : calib1_ strips 128->255: calib2_
142  // then, only some strips are fired at a time, we use calChan to know that
143  int isub = lastCalChan_ < 4 ? lastCalChan_ + 4 : lastCalChan_ - 4;
144  for (int k = 0; k < 16; ++k) {
145  // all strips of the APV are merged in
147  bin,
148  digis.data[lastCalChan_ + k * 8].adc() - ped[lastCalChan_ + k * 8] -
149  (digis.data[isub + k * 8].adc() - ped[isub + k * 8]));
150  updateHistoSet(calib2_[extrainfo_],
151  bin,
152  digis.data[128 + lastCalChan_ + k * 8].adc() - ped[128 + lastCalChan_ + k * 8] -
153  (digis.data[128 + isub + k * 8].adc() - ped[128 + isub + k * 8]));
154  }
155  update(); //TODO: temporary: find a better solution later
156 }
const uint32_t & vfs() const
const uint32_t & latency() const
sistrip::RunType runType_
std::vector< uint16_t > ped
const uint32_t & isha() const
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::map< std::string, HistoSet > calib2_
const uint32_t & calSel() const
std::map< std::string, HistoSet > calib1_
collection_type data
Definition: DetSet.h:81
const uint32_t & calChan() const
void CalibrationScanTask::setCurrentFolder ( const std::string &  dir)

Definition at line 168 of file CalibrationScanTask.cc.

References DeadROC_duringRun::dir, and directory_.

void CalibrationScanTask::update ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 160 of file CalibrationScanTask.cc.

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

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), fill(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

160  {
161  LogDebug("Commissioning") << "[CalibrationScanTask::update]"; // huge output
162  for (auto element : calib1_)
163  updateHistoSet(element.second);
164  for (auto element : calib2_)
165  updateHistoSet(element.second);
166 }
#define LogDebug(id)
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::map< std::string, HistoSet > calib2_
std::map< std::string, HistoSet > calib1_

Member Data Documentation

std::map<std::string, HistoSet> CalibrationScanTask::calib1_
private

Definition at line 27 of file CalibrationScanTask.h.

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

std::map<std::string, HistoSet> CalibrationScanTask::calib2_
private

Definition at line 27 of file CalibrationScanTask.h.

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

std::string CalibrationScanTask::directory_
private

Definition at line 33 of file CalibrationScanTask.h.

Referenced by book(), and setCurrentFolder().

std::string CalibrationScanTask::extrainfo_
private

Definition at line 32 of file CalibrationScanTask.h.

Referenced by book(), and fill().

uint32_t CalibrationScanTask::lastCalChan_
private

Definition at line 30 of file CalibrationScanTask.h.

Referenced by fill().

uint32_t CalibrationScanTask::lastCalSel_
private

Definition at line 30 of file CalibrationScanTask.h.

Referenced by fill().

uint32_t CalibrationScanTask::lastISHA_
private

Definition at line 30 of file CalibrationScanTask.h.

Referenced by fill().

uint32_t CalibrationScanTask::lastLatency_
private

Definition at line 30 of file CalibrationScanTask.h.

Referenced by fill().

uint32_t CalibrationScanTask::lastVFS_
private

Definition at line 30 of file CalibrationScanTask.h.

Referenced by fill().

uint16_t CalibrationScanTask::nBins_
private

Definition at line 29 of file CalibrationScanTask.h.

Referenced by book(), and CalibrationScanTask().

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

Definition at line 31 of file CalibrationScanTask.h.

Referenced by CalibrationScanTask(), and fill().

uint32_t CalibrationScanTask::run_
private

Definition at line 34 of file CalibrationScanTask.h.

sistrip::RunType CalibrationScanTask::runType_
private

Definition at line 26 of file CalibrationScanTask.h.

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