CMS 3D CMS Logo

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

#include <LatencyTask.h>

Inheritance diagram for LatencyTask:
CommissioningTask

Public Member Functions

 LatencyTask (DQMStore *, const FedChannelConnection &)
 
 ~LatencyTask () 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

HistoSet clusterPartition_
 
int firstReading_
 
HistoSet timingPartition_
 

Static Private Attributes

static HistoSet cluster_
 
static HistoSet timing_
 

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 11 of file LatencyTask.h.

Constructor & Destructor Documentation

◆ LatencyTask()

LatencyTask::LatencyTask ( DQMStore dqm,
const FedChannelConnection conn 
)

Definition at line 19 of file LatencyTask.cc.

References LogDebug.

20  : CommissioningTask(dqm, conn, "LatencyTask"), firstReading_(-1) {
21  LogDebug("Commissioning") << "[LatencyTask::LatencyTask] Constructing object...";
22 }
int firstReading_
Definition: LatencyTask.h:25
conn
Definition: getInfo.py:9
Definition: DQMStore.h:18
#define LogDebug(id)

◆ ~LatencyTask()

LatencyTask::~LatencyTask ( )
override

Definition at line 26 of file LatencyTask.cc.

References LogDebug.

26 { LogDebug("Commissioning") << "[LatencyTask::LatencyTask] Destructing object..."; }
#define LogDebug(id)

Member Function Documentation

◆ book()

void LatencyTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 30 of file LatencyTask.cc.

References sistrip::APV_LATENCY, cluster_, sistrip::extrainfo::clusterCharge_, clusterPartition_, CommissioningTask::connection(), sistrip::DET_KEY, CommissioningTask::dqm(), sistrip::EXPERT_HISTO, HIGHBIN, CommissioningTask::HistoSet::histo(), CommissioningTask::HistoSet::isProfile_, SiStripKey::key(), LogDebug, LOWBIN, seedmultiplicitymonitor_newtracking_cfi::nBins, NBINS, sistrip::extrainfo::occupancy_, sistrip::PARTITION, SiStripKey::path(), dqm::implementation::DQMStore::pwd(), dqm::implementation::DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, timing_, timingPartition_, runGCPTkAlMap::title, sistrip::TRACKER, CommissioningTask::HistoSet::vNumOfEntries_, CommissioningTask::HistoSet::vSumOfContents_, and CommissioningTask::HistoSet::vSumOfSquares_.

30  {
31  LogDebug("Commissioning") << "[LatencyTask::book]";
32 
34  int nBins = NBINS;
35  SiStripDetKey detkeytracker((uint32_t)0);
36  SiStripDetKey detkeypartition((uint16_t)(connection().fecCrate()));
37 
38  // see if the global timing histogram is already booked
39  if (timing_.histo()) {
40  // if already booked, use it
41  LogDebug("Commissioning") << "[LatencyTask::book] using existing histogram.";
42  } else {
43  // make a new histo on the tracker level if not existing yet
44  LogDebug("Commissioning") << "[LatencyTask::book] booking a new histogram in " << dqm()->pwd();
45  // construct the histo title
49  detkeytracker.key(),
51  0,
53  .title();
54  dqm()->setCurrentFolder(detkeytracker.path());
55  timing_.histo(dqm()->bookProfile(title,
56  title, // name and title
57  nBins,
58  LOWBIN,
59  HIGHBIN, // binning + range
60  100,
61  0.,
62  -1.,
63  "s")); // Y range : automatic
64  timing_.vNumOfEntries_.resize(nBins, 0);
65  timing_.vSumOfContents_.resize(nBins, 0);
66  timing_.vSumOfSquares_.resize(nBins, 0);
67  }
68  // make a new histo on the partition level if not existing yet
69  LogDebug("Commissioning") << "[LatencyTask::book] booking a new histogram in " << dqm()->pwd();
70  // histo title
74  detkeypartition.key(),
76  0,
78  .title();
79  dqm()->setCurrentFolder(detkeypartition.path());
80  timingPartition_.histo(dqm()->bookProfile(title,
81  title, // name and title
82  nBins,
83  LOWBIN,
84  HIGHBIN, // binning + range
85  100,
86  0.,
87  -1.,
88  "s")); // Y range : automatic
92 
93  // see if the global cluster histogram is already booked
94  if (cluster_.histo()) {
95  // if already booked, use it
96  LogDebug("Commissioning") << "[LatencyTask::book] using existing histogram.";
97  } else {
98  // make a new histo on the tracker level if not existing yet
99  LogDebug("Commissioning") << "[LatencyTask::book] booking a new histogram in " << dqm()->pwd();
100  // construct the histo title
104  detkeytracker.key(),
106  0,
108  .title();
109  dqm()->setCurrentFolder(detkeytracker.path());
110  cluster_.histo(dqm()->book1D(title,
111  title, // name and title
112  nBins,
113  LOWBIN,
114  HIGHBIN)); // binning + range
115  cluster_.isProfile_ = false;
116  cluster_.vNumOfEntries_.resize(nBins, 0);
117  cluster_.vSumOfContents_.resize(nBins, 0);
118  cluster_.vSumOfSquares_.resize(nBins, 0);
119  }
120  // make a new histo on the partition level if not existing yet
121  LogDebug("Commissioning") << "[LatencyTask::book] booking a new histogram in " << dqm()->pwd();
122  // histo title
126  detkeypartition.key(),
128  0,
130  .title();
131  dqm()->setCurrentFolder(detkeypartition.path());
132  clusterPartition_.histo(dqm()->book1D(title,
133  title, // name and title
134  nBins,
135  LOWBIN,
136  HIGHBIN)); // binning + range
141 
142  LogDebug("Commissioning") << "[LatencyTask::book] done";
143 }
std::vector< float > vNumOfEntries_
static HistoSet timing_
Definition: LatencyTask.h:21
Utility class that holds histogram title.
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
std::vector< float > vSumOfContents_
std::string pwd() override
Definition: DQMStore.h:644
#define HIGHBIN
Definition: LatencyTask.cc:10
static const char occupancy_[]
HistoSet clusterPartition_
Definition: LatencyTask.h:24
HistoSet timingPartition_
Definition: LatencyTask.h:23
DQMStore *const dqm() const
Utility class that identifies a position within the strip tracker geometrical structure, down to the level of an APV25 chip.
Definition: SiStripDetKey.h:28
#define LOWBIN
Definition: LatencyTask.cc:9
static const char clusterCharge_[]
static HistoSet cluster_
Definition: LatencyTask.h:22
#define NBINS
Definition: LatencyTask.cc:8
void histo(MonitorElement *)
std::vector< double > vSumOfSquares_
const FedChannelConnection & connection() const
#define LogDebug(id)

◆ fill()

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

Reimplemented from CommissioningTask.

Definition at line 147 of file LatencyTask.cc.

References newFWLiteAna::bin, cluster_, clusterPartition_, edm::DetSet< T >::data, phase2TrackerDigitizer_cfi::delay, firstReading_, HIGHBIN, createfilelist::int, LogDebug, LOWBIN, NBINS, nano_mu_digi_cff::strip, edmLumisInFiles::summary, timing_, timingPartition_, and CommissioningTask::updateHistoSet().

147  {
148  LogDebug("Commissioning") << "[LatencyTask::fill]";
149  // retrieve the delay from the EventSummary
150  int32_t delay = static_cast<int32_t>(summary.latency());
151  if (firstReading_ == -1)
153  float correctedDelay = 0.;
154  LogDebug("Commissioning") << "[LatencyTask::fill]; the delay is " << delay;
155  // loop on the strips to find the (maybe) non-zero digi
156  unsigned int nclusters = 0;
157  for (unsigned int strip = 0; strip < digis.data.size(); strip++) {
158  if (digis.data[strip].adc() != 0) {
159  // count the "cluster"
160  ++nclusters;
161  // no TOF correction is applied.
162  // 2 reasons: the effect is a priori to thin to be seen with 25ns steps
163  // and it biases the result by one clock due to the 25bins in the HistoSet
164  correctedDelay = delay * (-25.); // no TOF correction is applied.
165  // compute the bin
166  int bin = int((correctedDelay - LOWBIN) / ((HIGHBIN - LOWBIN) / NBINS));
167  LogDebug("Commissioning") << "[LatencyTask::fill]; using a hit with value " << (digis.data[strip].adc() & 0xff)
168  << " at corrected delay of " << correctedDelay << " in bin " << bin;
169  updateHistoSet(timing_, bin, digis.data[strip].adc() & 0xff);
170  LogDebug("Commissioning") << "HistoSet timing Updated " << strip << " " << digis.data.size();
171  updateHistoSet(timingPartition_, bin, digis.data[strip].adc() & 0xff);
172  LogDebug("Commissioning") << "HistoSet timingPartition Updated " << strip << " " << digis.data.size();
173  }
174  }
175  // set the occupancy
176  int bin = int((delay * (-25.) - LOWBIN) / ((HIGHBIN - LOWBIN) / NBINS));
177  LogDebug("Commissioning") << "[LatencyTask::fill]; occupancy is " << nclusters;
178  updateHistoSet(cluster_, bin, nclusters);
179  updateHistoSet(clusterPartition_, bin, nclusters);
180 }
static HistoSet timing_
Definition: LatencyTask.h:21
#define HIGHBIN
Definition: LatencyTask.cc:10
int firstReading_
Definition: LatencyTask.h:25
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
HistoSet clusterPartition_
Definition: LatencyTask.h:24
HistoSet timingPartition_
Definition: LatencyTask.h:23
#define LOWBIN
Definition: LatencyTask.cc:9
static HistoSet cluster_
Definition: LatencyTask.h:22
#define NBINS
Definition: LatencyTask.cc:8
collection_type data
Definition: DetSet.h:80
#define LogDebug(id)

◆ update()

void LatencyTask::update ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 184 of file LatencyTask.cc.

References cluster_, clusterPartition_, LogDebug, timing_, timingPartition_, and CommissioningTask::updateHistoSet().

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

184  {
185  LogDebug("Commissioning") << "[LatencyTask::update]";
190 }
static HistoSet timing_
Definition: LatencyTask.h:21
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
HistoSet clusterPartition_
Definition: LatencyTask.h:24
HistoSet timingPartition_
Definition: LatencyTask.h:23
static HistoSet cluster_
Definition: LatencyTask.h:22
#define LogDebug(id)

Member Data Documentation

◆ cluster_

CommissioningTask::HistoSet LatencyTask::cluster_
staticprivate

Definition at line 22 of file LatencyTask.h.

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

◆ clusterPartition_

HistoSet LatencyTask::clusterPartition_
private

Definition at line 24 of file LatencyTask.h.

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

◆ firstReading_

int LatencyTask::firstReading_
private

Definition at line 25 of file LatencyTask.h.

Referenced by fill().

◆ timing_

CommissioningTask::HistoSet LatencyTask::timing_
staticprivate

Definition at line 21 of file LatencyTask.h.

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

◆ timingPartition_

HistoSet LatencyTask::timingPartition_
private

Definition at line 23 of file LatencyTask.h.

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