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 SiStripPedestals &pedestals)
 
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 (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 CalibrationScanTask.h.

Constructor & Destructor Documentation

◆ CalibrationScanTask()

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

Definition at line 16 of file CalibrationScanTask.cc.

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

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

◆ ~CalibrationScanTask()

CalibrationScanTask::~CalibrationScanTask ( )
override

Definition at line 59 of file CalibrationScanTask.cc.

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

References LogDebug.

Member Function Documentation

◆ book()

void CalibrationScanTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 65 of file CalibrationScanTask.cc.

65  {
66  if (calib1_.find(extrainfo_) == calib1_.end()) {
67  // construct the histo titles and book two histograms: one per APV --> all strip in one APV are considered to fill histogram
69  runType_,
71  fedKey(),
73  connection().i2cAddr(0),
74  extrainfo_)
75  .title();
76 
78  calib1_[extrainfo_] = HistoSet();
80  calib1_[extrainfo_].histo(dqm()->book1D(title, title, nBins_, 0, 200));
82  calib1_[extrainfo_].histo(dqm()->book1D(title, title, nBins_, 0, 250));
83  calib1_[extrainfo_].isProfile_ = false;
84  calib1_[extrainfo_].vNumOfEntries_.resize(nBins_, 0);
85  }
86 
87  if (calib2_.find(extrainfo_) == calib2_.end()) {
89  runType_,
91  fedKey(),
93  connection().i2cAddr(1),
94  extrainfo_)
95  .title();
96 
98  calib2_[extrainfo_] = HistoSet();
100  calib2_[extrainfo_].histo(dqm()->book1D(title, title, nBins_, 0, 200));
102  calib2_[extrainfo_].histo(dqm()->book1D(title, title, nBins_, 0, 250));
103  calib2_[extrainfo_].isProfile_ = false;
104  calib2_[extrainfo_].vNumOfEntries_.resize(nBins_, 0);
105  }
106 }

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::implementation::DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripHistoTitle::title(), and runGCPTkAlMap::title.

Referenced by fill().

◆ fill()

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

Reimplemented from CommissioningTask.

Definition at line 110 of file CalibrationScanTask.cc.

110  {
111  if (lastISHA_ != summary.isha() or
112  lastVFS_ != summary.vfs()) { // triggered only when there is a change in isha and vfs
113  lastISHA_ = summary.isha();
114  lastVFS_ = summary.vfs();
115  lastCalSel_ = summary.calSel();
116  lastLatency_ = summary.latency();
117  lastCalChan_ = summary.calChan();
118  extrainfo_ = "isha_" + std::to_string(lastISHA_) + "_vfs_" + std::to_string(lastVFS_);
119  book(); // book histograms and load the right one
120  } else {
121  lastISHA_ = summary.isha();
122  lastVFS_ = summary.vfs();
123  lastCalSel_ = summary.calSel();
124  lastLatency_ = summary.latency();
125  lastCalChan_ = summary.calChan();
126  extrainfo_ = "isha_" + std::to_string(lastISHA_) + "_vfs_" + std::to_string(lastVFS_);
127  }
128 
129  // retrieve the delay from the EventSummary
130  int bin = 0;
132  bin = (100 - summary.latency()) * 8 + (7 - summary.calSel());
134  bin = (102 - summary.latency()) * 8 + (7 - summary.calSel());
135 
136  // Digis are obtained for an APV pair.strips 0->127 : calib1_ strips 128->255: calib2_
137  // then, only some strips are fired at a time, we use calChan to know that
138  int isub = lastCalChan_ < 4 ? lastCalChan_ + 4 : lastCalChan_ - 4;
139  for (int k = 0; k < 16; ++k) {
140  // all strips of the APV are merged in
142  bin,
143  digis.data[lastCalChan_ + k * 8].adc() - ped[lastCalChan_ + k * 8] -
144  (digis.data[isub + k * 8].adc() - ped[isub + k * 8]));
146  bin,
147  digis.data[128 + lastCalChan_ + k * 8].adc() - ped[128 + lastCalChan_ + k * 8] -
148  (digis.data[128 + isub + k * 8].adc() - ped[128 + isub + k * 8]));
149  }
150  update(); //TODO: temporary: find a better solution later
151 }

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

◆ setCurrentFolder()

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

Definition at line 163 of file CalibrationScanTask.cc.

163 { directory_ = dir; }

References DeadROC_duringRun::dir, and directory_.

◆ update()

void CalibrationScanTask::update ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 155 of file CalibrationScanTask.cc.

155  {
156  LogDebug("Commissioning") << "[CalibrationScanTask::update]"; // huge output
157  for (auto element : calib1_)
158  updateHistoSet(element.second);
159  for (auto element : calib2_)
160  updateHistoSet(element.second);
161 }

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, HistoSet> CalibrationScanTask::calib1_
private

Definition at line 29 of file CalibrationScanTask.h.

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

◆ calib2_

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

Definition at line 29 of file CalibrationScanTask.h.

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

◆ directory_

std::string CalibrationScanTask::directory_
private

Definition at line 35 of file CalibrationScanTask.h.

Referenced by book(), and setCurrentFolder().

◆ extrainfo_

std::string CalibrationScanTask::extrainfo_
private

Definition at line 34 of file CalibrationScanTask.h.

Referenced by book(), and fill().

◆ lastCalChan_

uint32_t CalibrationScanTask::lastCalChan_
private

Definition at line 32 of file CalibrationScanTask.h.

Referenced by fill().

◆ lastCalSel_

uint32_t CalibrationScanTask::lastCalSel_
private

Definition at line 32 of file CalibrationScanTask.h.

Referenced by fill().

◆ lastISHA_

uint32_t CalibrationScanTask::lastISHA_
private

Definition at line 32 of file CalibrationScanTask.h.

Referenced by fill().

◆ lastLatency_

uint32_t CalibrationScanTask::lastLatency_
private

Definition at line 32 of file CalibrationScanTask.h.

Referenced by fill().

◆ lastVFS_

uint32_t CalibrationScanTask::lastVFS_
private

Definition at line 32 of file CalibrationScanTask.h.

Referenced by fill().

◆ nBins_

uint16_t CalibrationScanTask::nBins_
private

Definition at line 31 of file CalibrationScanTask.h.

Referenced by book(), and CalibrationScanTask().

◆ ped

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

Definition at line 33 of file CalibrationScanTask.h.

Referenced by CalibrationScanTask(), and fill().

◆ run_

uint32_t CalibrationScanTask::run_
private

Definition at line 36 of file CalibrationScanTask.h.

◆ runType_

sistrip::RunType CalibrationScanTask::runType_
private

Definition at line 28 of file CalibrationScanTask.h.

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

sistrip::CALIBRATION_SCAN
Definition: ConstantsForRunType.h:87
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
CalibrationScanTask::directory_
std::string directory_
Definition: CalibrationScanTask.h:35
start
Definition: start.py:1
SiStripPedestals::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripPedestals.h:51
CommissioningTask::connection
const FedChannelConnection & connection() const
Definition: CommissioningTask.h:189
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CalibrationScanTask::run_
uint32_t run_
Definition: CalibrationScanTask.h:36
CalibrationScanTask::ped
std::vector< uint16_t > ped
Definition: CalibrationScanTask.h:33
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
CalibrationScanTask::nBins_
uint16_t nBins_
Definition: CalibrationScanTask.h:31
CommissioningTask::fedKey
const uint32_t & fedKey() const
Definition: CommissioningTask.h:192
CalibrationScanTask::lastCalChan_
uint32_t lastCalChan_
Definition: CalibrationScanTask.h:32
CalibrationScanTask::runType_
sistrip::RunType runType_
Definition: CalibrationScanTask.h:28
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
CalibrationScanTask::extrainfo_
std::string extrainfo_
Definition: CalibrationScanTask.h:34
SiStripPedestals::getRange
const Range getRange(const uint32_t &detID) const
Definition: SiStripPedestals.cc:28
CalibrationScanTask::lastLatency_
uint32_t lastLatency_
Definition: CalibrationScanTask.h:32
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
CalibrationScanTask::lastVFS_
uint32_t lastVFS_
Definition: CalibrationScanTask.h:32
sistrip::APV
Definition: ConstantsForGranularity.h:79
createfilelist.int
int
Definition: createfilelist.py:10
edmLumisInFiles.summary
summary
Definition: edmLumisInFiles.py:39
CalibrationScanTask::calib2_
std::map< std::string, HistoSet > calib2_
Definition: CalibrationScanTask.h:29
CommissioningTask::updateHistoSet
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
Definition: CommissioningTask.cc:274
value
Definition: value.py:1
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
sistrip::CALIBRATION_SCAN_DECO
Definition: ConstantsForRunType.h:88
CalibrationScanTask::lastCalSel_
uint32_t lastCalSel_
Definition: CalibrationScanTask.h:32
writedatasetfile.run
run
Definition: writedatasetfile.py:27
CommissioningTask::dqm
DQMStore *const dqm() const
Definition: CommissioningTask.h:188
CalibrationScanTask::calib1_
std::map< std::string, HistoSet > calib1_
Definition: CalibrationScanTask.h:29
CalibrationScanTask::book
void book() override
Definition: CalibrationScanTask.cc:65
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
or
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
CalibrationScanTask::lastISHA_
uint32_t lastISHA_
Definition: CalibrationScanTask.h:32
CalibrationScanTask::update
void update() override
Definition: CalibrationScanTask.cc:155
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
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23