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

Constructor & Destructor Documentation

◆ LatencyTask()

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

Definition at line 19 of file LatencyTask.cc.

20  : CommissioningTask(dqm, conn, "LatencyTask"), firstReading_(-1) {
21  LogDebug("Commissioning") << "[LatencyTask::LatencyTask] Constructing object...";
22 }

References LogDebug.

◆ ~LatencyTask()

LatencyTask::~LatencyTask ( )
override

Definition at line 26 of file LatencyTask.cc.

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

References LogDebug.

Member Function Documentation

◆ book()

void LatencyTask::book ( )
overrideprivatevirtual

Reimplemented from CommissioningTask.

Definition at line 30 of file LatencyTask.cc.

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 }

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_.

◆ fill()

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

Reimplemented from CommissioningTask.

Definition at line 147 of file LatencyTask.cc.

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 }

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

◆ update()

void LatencyTask::update ( )
overrideprivatevirtual

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().

CommissioningTask::HistoSet::vSumOfSquares_
std::vector< double > vSumOfSquares_
Definition: CommissioningTask.h:46
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
CommissioningTask::HistoSet::vSumOfContents_
std::vector< float > vSumOfContents_
Definition: CommissioningTask.h:45
sistrip::TRACKER
Definition: ConstantsForGranularity.h:64
LatencyTask::firstReading_
int firstReading_
Definition: LatencyTask.h:25
sistrip::DET_KEY
Definition: ConstantsForKeyType.h:32
LatencyTask::timingPartition_
HistoSet timingPartition_
Definition: LatencyTask.h:23
CommissioningTask::connection
const FedChannelConnection & connection() const
Definition: CommissioningTask.h:189
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
sistrip::extrainfo::occupancy_
static const char occupancy_[]
Definition: ConstantsForDqm.h:60
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
LatencyTask::clusterPartition_
HistoSet clusterPartition_
Definition: LatencyTask.h:24
CommissioningTask::HistoSet::vNumOfEntries_
std::vector< float > vNumOfEntries_
Definition: CommissioningTask.h:44
sistrip::extrainfo::clusterCharge_
static const char clusterCharge_[]
Definition: ConstantsForDqm.h:59
sistrip::EXPERT_HISTO
Definition: ConstantsForHistoType.h:29
LatencyTask::cluster_
static HistoSet cluster_
Definition: LatencyTask.h:22
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
seedmultiplicitymonitor_newtracking_cfi.nBins
nBins
Definition: seedmultiplicitymonitor_newtracking_cfi.py:8
CommissioningTask::CommissioningTask
CommissioningTask()
Definition: CommissioningTask.h:143
CommissioningTask::HistoSet::isProfile_
bool isProfile_
Definition: CommissioningTask.h:47
dqm::implementation::DQMStore::pwd
std::string pwd() override
Definition: DQMStore.h:567
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
CommissioningTask::HistoSet::histo
void histo(MonitorElement *)
Definition: CommissioningTask.cc:89
HIGHBIN
#define HIGHBIN
Definition: LatencyTask.cc:10
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
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
SiStripDetKey
Utility class that identifies a position within the strip tracker geometrical structure,...
Definition: SiStripDetKey.h:28
CommissioningTask::dqm
DQMStore *const dqm() const
Definition: CommissioningTask.h:188
LOWBIN
#define LOWBIN
Definition: LatencyTask.cc:9
sistrip::APV_LATENCY
Definition: ConstantsForRunType.h:76
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
SiStripHistoTitle
Utility class that holds histogram title.
Definition: SiStripHistoTitle.h:20
sistrip::PARTITION
Definition: ConstantsForGranularity.h:65
phase2TrackerDigitizer_cfi.delay
delay
Definition: phase2TrackerDigitizer_cfi.py:49
dqm
Definition: DQMStore.h:18
NBINS
#define NBINS
Definition: LatencyTask.cc:8
LatencyTask::timing_
static HistoSet timing_
Definition: LatencyTask.h:21