CMS 3D CMS Logo

LatencyTask.cc
Go to the documentation of this file.
7 
8 #define NBINS (192)
9 #define LOWBIN (-4800)
10 #define HIGHBIN (0)
11 
12 // -----------------------------------------------------------------------------
13 // static initialization
16 
17 // -----------------------------------------------------------------------------
18 //
20  : CommissioningTask(dqm, conn, "LatencyTask"), firstReading_(-1) {
21  LogDebug("Commissioning") << "[LatencyTask::LatencyTask] Constructing object...";
22 }
23 
24 // -----------------------------------------------------------------------------
25 //
26 LatencyTask::~LatencyTask() { LogDebug("Commissioning") << "[LatencyTask::LatencyTask] Destructing object..."; }
27 
28 // -----------------------------------------------------------------------------
29 //
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 }
144 
145 // -----------------------------------------------------------------------------
146 //
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 }
181 
182 // -----------------------------------------------------------------------------
183 //
185  LogDebug("Commissioning") << "[LatencyTask::update]";
190 }
CommissioningTask::HistoSet::vSumOfSquares_
std::vector< double > vSumOfSquares_
Definition: CommissioningTask.h:46
LatencyTask::book
void book() override
Definition: LatencyTask.cc:30
MessageLogger.h
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
edm::DetSet
Definition: DetSet.h:23
sistrip::DET_KEY
Definition: ConstantsForKeyType.h:32
LatencyTask::timingPartition_
HistoSet timingPartition_
Definition: LatencyTask.h:23
SiStripKey::key
const uint32_t & key() const
Definition: SiStripKey.h:120
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
DQMStore.h
SiStripDetId.h
LatencyTask::clusterPartition_
HistoSet clusterPartition_
Definition: LatencyTask.h:24
CommissioningTask
Definition: CommissioningTask.h:24
CommissioningTask::HistoSet
Definition: CommissioningTask.h:38
CommissioningTask::HistoSet::vNumOfEntries_
std::vector< float > vNumOfEntries_
Definition: CommissioningTask.h:44
dqm::legacy::DQMStore
Definition: DQMStore.h:727
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
LatencyTask::fill
void fill(const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) override
Definition: LatencyTask.cc:147
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
LatencyTask.h
seedmultiplicitymonitor_newtracking_cfi.nBins
nBins
Definition: seedmultiplicitymonitor_newtracking_cfi.py:8
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CommissioningTask::HistoSet::isProfile_
bool isProfile_
Definition: CommissioningTask.h:47
FedChannelConnection
Class containning control, module, detector and connection information, at the level of a FED channel...
Definition: FedChannelConnection.h:26
dqm::implementation::DQMStore::pwd
std::string pwd() override
Definition: DQMStore.h:567
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
CommissioningTask::HistoSet::histo
void histo(MonitorElement *)
Definition: CommissioningTask.cc:89
HIGHBIN
#define HIGHBIN
Definition: LatencyTask.cc:10
SiStripKey::path
const std::string & path() const
Definition: SiStripKey.h:121
LatencyTask::LatencyTask
LatencyTask(DQMStore *, const FedChannelConnection &)
Definition: LatencyTask.cc:19
LatencyTask::~LatencyTask
~LatencyTask() override
Definition: LatencyTask.cc:26
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
SiStripDetKey.h
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
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
SiStripHistoTitle.h
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:67
dqm
Definition: DQMStore.h:18
NBINS
#define NBINS
Definition: LatencyTask.cc:8
SiStripEventSummary
Definition: SiStripEventSummary.h:22
LatencyTask::timing_
static HistoSet timing_
Definition: LatencyTask.h:21
LatencyTask::update
void update() override
Definition: LatencyTask.cc:184