CMS 3D CMS Logo

SiStripCommissioningSource.cc
Go to the documentation of this file.
32 #include <ctime>
33 #include <iomanip>
34 #include <memory>
35 #include <sstream>
36 
37 #include <sys/types.h>
38 #include <unistd.h>
39 #include <iomanip>
40 
41 #include <arpa/inet.h>
42 #include <cstdio>
43 #include <netdb.h>
44 #include <sys/socket.h>
45 #include <sys/unistd.h>
46 #include <cstdint>
47 
48 using namespace sistrip;
49 
50 // -----------------------------------------------------------------------------
51 //
53  : dqm_(nullptr),
54  fedCablingToken_(esConsumes<edm::Transition::BeginRun>()),
55  fecCabling_(nullptr),
56  inputModuleLabel_(pset.getParameter<std::string>("InputModuleLabel")),
57  inputModuleLabelAlt_(pset.existsAs<std::string>("InputModuleLabelAlt")
58  ? pset.getParameter<std::string>("InputModuleLabelAlt")
59  : ""),
60  inputModuleLabelSummary_(pset.getParameter<std::string>("SummaryInputModuleLabel")),
61  inputClusterLabel_(
62  pset.existsAs<std::string>("InputClusterLabel") ? pset.getParameter<std::string>("InputClusterLabel") : ""),
63  filename_(pset.getUntrackedParameter<std::string>("RootFileName", sistrip::dqmSourceFileName_)),
64  run_(0),
65  partitionName_(pset.existsAs<std::string>("PartitionName") ? pset.getParameter<std::string>("PartitionName")
66  : ""),
67  time_(0),
68  isSpy_(pset.existsAs<bool>("isSpy") ? pset.getParameter<bool>("isSpy") : false),
69  taskConfigurable_(pset.getUntrackedParameter<std::string>("CommissioningTask", "UNDEFINED")),
71  tasks_(),
72  cablingTasks_(),
73  tasksExist_(false),
74  cablingTask_(false),
75  updateFreq_(pset.getUntrackedParameter<int>("HistoUpdateFreq", 1)),
76  base_(""),
77  view_(pset.getUntrackedParameter<std::string>("View", "Default")),
78  parameters_(pset) {
79  usesResource("DQMStore");
80  inputModuleSummaryToken_ = consumes<SiStripEventSummary>(edm::InputTag(inputModuleLabelSummary_));
81  digiVirginRawToken_ = mayConsume<edm::DetSetVector<SiStripRawDigi> >(edm::InputTag(inputModuleLabel_, "VirginRaw"));
83  mayConsume<edm::DetSetVector<SiStripRawDigi> >(edm::InputTag(inputModuleLabel_, "FineDelaySelection"));
84  digiReorderedToken_ = mayConsume<edm::DetSetVector<SiStripRawDigi> >(edm::InputTag(inputModuleLabel_, "Reordered"));
86  if (not isSpy_)
87  digiScopeModeToken_ = mayConsume<edm::DetSetVector<SiStripRawDigi> >(edm::InputTag(inputModuleLabel_, "ScopeMode"));
88  else {
90  mayConsume<edm::DetSetVector<SiStripRawDigi> >(edm::InputTag(inputModuleLabelAlt_, "ScopeRawDigis"));
91  clustersToken_ = mayConsume<edmNew::DetSetVector<SiStripCluster> >(edm::InputTag(inputClusterLabel_));
92  }
94  LogTrace(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
95  << " Constructing object...";
96  tasks_.clear();
97  tasks_.resize(1024, VecOfTasks(96, static_cast<CommissioningTask*>(nullptr)));
98 
99  if (task_ == sistrip::NOISE) {
101  }
105  }
106 }
107 
108 // -----------------------------------------------------------------------------
109 //
111  LogTrace(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
112  << " Destructing object...";
113 }
114 
115 // -----------------------------------------------------------------------------
116 //
118  if (!dqm_) {
119  std::stringstream ss;
120  if (!method.empty()) {
121  ss << "[SiStripCommissioningSource::" << method << "]" << std::endl;
122  } else {
123  ss << "[SiStripCommissioningSource]" << std::endl;
124  }
125  ss << " NULL pointer to DQMStore";
126  edm::LogWarning(mlDqmSource_) << ss.str();
127  return nullptr;
128  } else {
129  return dqm_;
130  }
131 }
132 
133 // -----------------------------------------------------------------------------
134 // Retrieve DQM interface, control cabling and "control view" utility
135 // class, create histogram directory structure and generate "reverse"
136 // control cabling.
138  LogTrace(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
139  << " Configuring..." << std::endl;
140 
141  // ---------- DQM back-end interface ----------
142 
144  edm::LogInfo(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
145  << " DQMStore service: " << dqm_;
146  dqm(__func__);
147 
148  // ---------- Base directory ----------
149 
150  std::stringstream dir("");
151  base_ = dir.str();
152 
153  // ---------- FED and FEC cabling ----------
154 
155  const auto& fed_cabling = setup.getData(fedCablingToken_);
156  fedCabling_ = const_cast<SiStripFedCabling*>(&fed_cabling);
157  LogDebug(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
158  << "Initialized FED cabling. Number of FEDs is " << fedCabling_->fedIds().size();
159  fecCabling_ = new SiStripFecCabling(fed_cabling);
160  if (fecCabling_->crates().empty()) {
161  std::stringstream ss;
162  ss << "[SiStripCommissioningSource::" << __func__ << "]"
163  << " Empty std::vector returned by FEC cabling object!"
164  << " Check if database connection failed...";
165  edm::LogWarning(mlDqmSource_) << ss.str();
166  }
167 
168  // ---------- Reset ----------
169 
170  tasksExist_ = false;
172  cablingTask_ = false;
173 
174  remove();
175 
177  clearTasks();
178 }
179 
180 // -----------------------------------------------------------------------------
181 //
183  LogTrace(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
184  << " Halting..." << std::endl;
185 
186  // ---------- Update histograms ----------
187  // Cabling task
188  for (TaskMap::iterator itask = cablingTasks_.begin(); itask != cablingTasks_.end(); itask++) {
189  if (itask->second) {
190  itask->second->updateHistograms();
191  }
192  }
193 
194  if (task_ == sistrip::APV_LATENCY) {
195  for (uint16_t partition = 0; partition < 4; ++partition) {
196  tasks_[0][partition]->updateHistograms();
197  }
198  } else if (task_ == sistrip::FINE_DELAY) {
199  tasks_[0][0]->updateHistograms();
200  } else {
201  // All tasks except cabling
202  uint16_t fed_id = 0;
203  uint16_t fed_ch = 0;
204  auto ifed = fedCabling_->fedIds().begin();
205  for (; ifed != fedCabling_->fedIds().end(); ifed++) {
206  auto conns = fedCabling_->fedConnections(*ifed);
207  for (auto iconn = conns.begin(); iconn != conns.end(); iconn++) {
208  if (!iconn->isConnected()) {
209  continue;
210  }
211  fed_id = iconn->fedId();
212  fed_ch = iconn->fedCh();
213  if (tasks_[fed_id][fed_ch]) {
214  tasks_[fed_id][fed_ch]->updateHistograms();
215  delete tasks_[fed_id][fed_ch];
216  }
217  }
218  }
219  }
220  // ---------- Save histos to root file ----------
221 
222  // Strip filename of ".root" extension
224  if (filename_.find(".root", 0) == std::string::npos) {
225  name = filename_;
226  } else {
227  name = filename_.substr(0, filename_.find(".root", 0));
228  }
229 
230  // Retrieve SCRATCH directory
231  std::string scratch = "SCRATCH"; //@@ remove trailing slash!!!
232  std::string dir = "";
233  if (std::getenv(scratch.c_str()) != nullptr) {
234  dir = std::getenv(scratch.c_str());
235  }
236 
237  // Add directory path
238  std::stringstream ss;
239  if (!dir.empty()) {
240  ss << dir << "/";
241  } else {
242  ss << "/tmp/";
243  }
244 
245  // Add filename with run number, host ip, pid and .root extension
246  ss << name << "_";
247  if (task_ == sistrip::DAQ_SCOPE_MODE and not partitionName_.empty()) // only for spy-runs
248  ss << partitionName_ << "_";
249 
250  directory(ss, run_);
251  ss << ".root";
252 
253  // Save file with appropriate filename (if run number is known)
254  if (!filename_.empty()) {
255  if (run_ != 0) {
256  dqm()->save(ss.str());
257  } else {
258  edm::LogWarning(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
259  << " NULL value for RunNumber! No root file saved!";
260  }
261  } else {
262  edm::LogWarning(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
263  << " NULL value for filename! No root file saved!";
264  }
265 
266  LogTrace(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
267  << " Saved all histograms to file \"" << ss.str() << "\"";
268 
269  // ---------- Delete histograms ----------
270  // Remove all MonitorElements in "SiStrip" dir and below
271  // remove();
272 
273  // Delete histogram objects
274  // clearCablingTasks();
275  // clearTasks();
276 
277  // ---------- Delete cabling ----------
278  if (fedCabling_) {
279  fedCabling_ = nullptr;
280  }
281  if (fecCabling_) {
282  delete fecCabling_;
283  fecCabling_ = nullptr;
284  }
285 }
286 
287 // ----------------------------------------------------------------------------
288 //
290  // Retrieve commissioning information from "event summary"
292  // event.getByLabel( inputModuleLabelSummary_, summary );
293  event.getByToken(inputModuleSummaryToken_, summary);
294 
295  // Check if EventSummary has info attached
296  if ((summary->runType() == sistrip::UNDEFINED_RUN_TYPE || summary->runType() == sistrip::UNKNOWN_RUN_TYPE) &&
297  summary->nullParams()) {
298  edm::LogWarning(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
299  << " Unknown/undefined RunType and NULL parameter values!"
300  << " It may be that the 'trigger FED' object was not found!";
301  }
302 
303  // Check if need to rebuild FED/FEC cabling objects for connection run
304  //cablingForConnectionRun( summary->runType() ); //@@ do not use!
305 
306  // Extract run number and forward to client
307  if (event.id().run() != run_) {
308  run_ = event.id().run();
309  createRunNumber();
310  }
311 
312  // Coarse event rate counter
313  if (!(event.id().event() % updateFreq_)) {
314  std::stringstream ss;
315  ss << "[SiStripCommissioningSource::" << __func__ << "]"
316  << " The last " << updateFreq_ << " events were processed at a rate of ";
317  if (time(nullptr) == time_) {
318  ss << ">" << updateFreq_ << " Hz";
319  } else {
320  ss << (updateFreq_ / (time(nullptr) - time_)) << " Hz";
321  }
322  edm::LogVerbatim(mlDqmSource_) << ss.str();
323  time_ = time(nullptr);
324  }
325 
326  // Create commissioning task objects
327  if (!tasksExist_) {
328  createTask(summary.product(), setup);
329  } else {
330  for (auto& v : tasks_) {
331  for (auto& t : v) {
332  t->eventSetup(&setup);
333  }
334  }
335  }
336 
337  // Retrieve raw digis with mode appropriate to task
341 
342  if (task_ == sistrip::DAQ_SCOPE_MODE) { // scop-mode runs
343  if (not isSpy_ and
344  summary->fedReadoutMode() == FED_VIRGIN_RAW) { // if the readout is virgin raw just take the VR digis
345  event.getByToken(digiVirginRawToken_, raw);
346  } else if (not isSpy_ and summary->fedReadoutMode() == FED_SCOPE_MODE) {
347  event.getByToken(digiScopeModeToken_, raw);
348  } else if (isSpy_) { // spy case take both re-ordered and scope mode
349  event.getByToken(digiScopeModeToken_, rawAlt);
350  event.getByToken(digiReorderedToken_, raw);
351  if (not inputClusterLabel_.empty())
352  event.getByToken(clustersToken_, cluster);
353  } else {
354  std::stringstream ss;
355  ss << "[SiStripCommissioningSource::" << __func__ << "]"
356  << " Requested DAQ_SCOPE_MODE but unknown FED"
357  << " readout mode retrieved from SiStripEventSummary: "
358  << SiStripEnumsAndStrings::fedReadoutMode(summary->fedReadoutMode());
359  edm::LogWarning(mlDqmSource_) << ss.str();
360  }
363  event.getByToken(digiScopeModeToken_, raw);
368  event.getByToken(digiVirginRawToken_, raw);
369  } else if (task_ == sistrip::APV_LATENCY || task_ == sistrip::FINE_DELAY) {
370  event.getByToken(digiFineDelaySelectionToken_, raw);
371  } else {
372  std::stringstream ss;
373  ss << "[SiStripCommissioningSource::" << __func__ << "]"
374  << " Unknown CommissioningTask: " << SiStripEnumsAndStrings::runType(task_)
375  << " Unable to establish FED readout mode and retrieve digi container!"
376  << " Check if SiStripEventSummary object is found/present in Event";
377  edm::LogWarning(mlDqmSource_) << ss.str();
378  return;
379  }
380 
381  // Check for NULL pointer to digi container
382  if (not raw.isValid()) {
383  std::stringstream ss;
384  ss << "[SiStripCommissioningSource::" << __func__ << "]" << std::endl
385  << " NULL pointer to DetSetVector!" << std::endl
386  << " Unable to fill histograms!";
387  edm::LogWarning(mlDqmSource_) << ss.str();
388  return;
389  }
390 
391  if (isSpy_ and not inputModuleLabelAlt_.empty() and not rawAlt.isValid()) {
392  std::stringstream ss;
393  ss << "[SiStripCommissioningSource::" << __func__ << "]" << std::endl
394  << " NULL pointer to DetSetVector!" << std::endl
395  << " Unable to fill histograms!";
396  edm::LogWarning(mlDqmSource_) << ss.str();
397  return;
398  }
399 
400  if (isSpy_ and not inputClusterLabel_.empty() and not cluster.isValid()) {
401  std::stringstream ss;
402  ss << "[SiStripCommissioningSource::" << __func__ << "]" << std::endl
403  << " NULL pointer to DetSetVector!" << std::endl
404  << " Unable to fill histograms!";
405  edm::LogWarning(mlDqmSource_) << ss.str();
406  return;
407  }
408 
409  if (!cablingTask_) {
410  fillHistos(summary.product(), *raw, *rawAlt, *cluster);
411  } else {
412  fillCablingHistos(summary.product(), *raw);
413  }
414 }
415 
416 // ----------------------------------------------------------------------------
417 //
420  // Create FEC key using DCU id and LLD channel from SiStripEventSummary
421  const SiStripModule& module = fecCabling_->module(summary->dcuId());
422  uint16_t lld_channel = (summary->deviceId() & 0x3) + 1;
423  SiStripFecKey key_object(module.key().fecCrate(),
424  module.key().fecSlot(),
425  module.key().fecRing(),
426  module.key().ccuAddr(),
427  module.key().ccuChan(),
428  lld_channel);
429  uint32_t fec_key = key_object.key();
430  std::stringstream sss;
431  sss << "[SiStripCommissioningSource::" << __func__ << "]"
432  << " Found DcuId 0x" << std::hex << std::setw(8) << std::setfill('0') << summary->dcuId() << std::dec
433  << " with Crate/FEC/Ring/CCU/Module/LLD: " << module.key().fecCrate() << "/" << module.key().fecSlot() << "/"
434  << module.key().fecRing() << "/" << module.key().ccuAddr() << "/" << module.key().ccuChan() << "/" << lld_channel;
435  edm::LogWarning(mlDqmSource_) << sss.str();
436 
437  //LogTrace(mlTest_) << "TEST : " << key_object;
438 
439  // Check on whether DCU id is found
440  if (key_object.isInvalid(sistrip::CCU_CHAN)) {
441  std::stringstream ss;
442  ss << "[SiStripCommissioningSource::" << __func__ << "]"
443  << " DcuId 0x" << std::hex << std::setw(8) << std::setfill('0') << summary->dcuId() << std::dec
444  << " in 'DAQ register' field not found in cabling map!"
445  << " (NULL values returned for FEC path)";
446  edm::LogWarning(mlDqmSource_) << ss.str();
447  return;
448  }
449 
450  // Iterate through FED ids
451  for (auto ifed = fedCabling_->fedIds().begin(); ifed != fedCabling_->fedIds().end(); ifed++) {
452  // Check if FedId is non-zero
453  if (*ifed == sistrip::invalid_) {
454  continue;
455  }
456 
457  // Container to hold median signal level for FED cabling task
458  std::map<uint16_t, float> medians;
459  medians.clear();
460  std::map<uint16_t, float> medians1;
461  medians1.clear();
462 
463  // Iterate through FED channels
464  for (uint16_t ichan = 0; ichan < 96; ichan++) {
465  // Retrieve digis for given FED key
466  uint32_t fed_key = ((*ifed & sistrip::invalid_) << 16) | (ichan & sistrip::invalid_);
467 
468  std::vector<edm::DetSet<SiStripRawDigi> >::const_iterator digis = raw.find(fed_key);
469  if (digis != raw.end()) {
470  if (digis->data.empty()) {
471  continue;
472  }
473 
474  Averages ave;
475  for (uint16_t idigi = 0; idigi < digis->data.size(); idigi++) {
476  ave.add(static_cast<uint32_t>(digis->data[idigi].adc()));
477  }
479  ave.calc(params);
480  medians[ichan] = params.median_; // Store median signal level
481  medians1[ichan] = digis->data[0].adc();
482  }
483 
484  } // fed channel loop
485 
486  // Calculate mean and spread on all (median) signal levels
487  Averages average;
488  std::map<uint16_t, float>::const_iterator ii = medians.begin();
489  for (; ii != medians.end(); ii++) {
490  average.add(ii->second);
491  }
493  average.calc(tmp);
494 
495  std::stringstream ss;
496  ss << "FED Averages:" << std::endl
497  << " nChans: " << medians.size() << std::endl
498  << " num/mean/median/rms/max/min: " << tmp.num_ << "/" << tmp.mean_ << "/" << tmp.median_ << "/" << tmp.rms_
499  << "/" << tmp.max_ << "/" << tmp.min_ << std::endl;
500  LogTrace(mlDqmSource_) << ss.str();
501 
502  // Calculate mean and spread on "filtered" data
503  Averages truncated;
504  std::map<uint16_t, float>::const_iterator jj = medians.begin();
505  for (; jj != medians.end(); jj++) {
506  if (jj->second < tmp.median_ + tmp.rms_) {
507  truncated.add(jj->second);
508  }
509  }
511  truncated.calc(params);
512 
513  std::stringstream ss1;
514  ss1 << "Truncated Averages:" << std::endl
515  << " nChans: " << medians.size() << std::endl
516  << " num/mean/median/rms/max/min: " << params.num_ << "/" << params.mean_ << "/" << params.median_ << "/"
517  << params.rms_ << "/" << params.max_ << "/" << params.min_ << std::endl;
518  LogTrace(mlDqmSource_) << ss1.str();
519 
520  // Identify channels with signal
521  std::stringstream ss2;
522  std::stringstream ss3;
523  std::map<uint16_t, float> channels;
524  std::map<uint16_t, float>::const_iterator ichan = medians.begin();
525  for (; ichan != medians.end(); ichan++) {
526  if (ichan->second > 200.) {
527  LogTrace(mlTest_) << "TEST FOUND SIGNAL HIGH: " << *ifed << " " << ichan->first << " " << ichan->second;
528  channels[ichan->first] = ichan->second;
529  }
530  ss2 //<< ichan->first << "/"
531  << ichan->second << " ";
532  ss3 //<< ichan->first << "/"
533  << medians1[ichan->first] << " ";
534  }
535 
536  ss2 << std::endl;
537  ss3 << std::endl;
538  LogTrace(mlTest_) << "DUMP for FED " << *ifed << ": " << ss2.str();
539  LogTrace(mlTest_) << "FIRST ADC VAL " << *ifed << ": " << ss3.str();
540 
541  // Fill cabling histograms
542  if (cablingTasks_.find(fec_key) != cablingTasks_.end()) {
543  if (!channels.empty()) {
544  cablingTasks_[fec_key]->fillHistograms(*summary, *ifed, channels);
545  SiStripFecKey path(fec_key);
546  std::stringstream ss;
547  ss << "[SiStripCommissioningSource::" << __func__ << "]"
548  << " Filled histogram for '" << cablingTasks_[fec_key]->myName() << "' object with FecKey: 0x" << std::hex
549  << std::setfill('0') << std::setw(8) << fec_key << std::dec
550  << " and Crate/FEC/ring/CCU/module/LLDchan: " << path.fecCrate() << "/" << path.fecSlot() << "/"
551  << path.fecRing() << "/" << path.ccuAddr() << "/" << path.ccuChan() << "/" << path.channel();
552  LogTrace(mlDqmSource_) << ss.str();
553  }
554  } else {
555  SiStripFecKey path(fec_key);
556  std::stringstream ss;
557  ss << "[SiStripCommissioningSource::" << __func__ << "]"
558  << " Unable to find CommissioningTask object with FecKey: 0x" << std::hex << std::setfill('0') << std::setw(8)
559  << fec_key << std::dec << " and Crate/FEC/ring/CCU/module/LLDchan: " << path.fecCrate() << "/"
560  << path.fecSlot() << "/" << path.fecRing() << "/" << path.ccuAddr() << "/" << path.ccuChan() << "/"
561  << path.channel();
562  edm::LogWarning(mlDqmSource_) << ss.str();
563  }
564 
565  } // fed id loop
566 }
567 
568 // ----------------------------------------------------------------------------
569 //
572  const edm::DetSetVector<SiStripRawDigi>& rawAlt,
574  // Iterate through FED ids and channels
575  std::vector<uint16_t> stripOnClusters;
576  auto ifed = fedCabling_->fedIds().begin();
577  for (; ifed != fedCabling_->fedIds().end(); ifed++) {
578  // Iterate through connected FED channels
579  auto conns = fedCabling_->fedConnections(*ifed);
580  for (auto iconn = conns.begin(); iconn != conns.end(); iconn++) {
581  if (!(iconn->fedId()) || iconn->fedId() > sistrip::valid_) {
582  continue;
583  }
584  if (!iconn->isConnected()) {
585  continue;
586  }
587 
588  // Create FED key and check if non-zero
589  // note: the key is not computed using the same formula as in commissioning histograms.
590  // beware that changes here must match changes in raw2digi and in SiStripFineDelayHit
591  uint32_t fed_key = ((iconn->fedId() & sistrip::invalid_) << 16) | (iconn->fedCh() & sistrip::invalid_);
592  // Retrieve digis for given FED key and check if found
593  std::vector<edm::DetSet<SiStripRawDigi> >::const_iterator digis = raw.find(fed_key);
594 
595  // only for spy data-taking --> tick measurement
596  std::vector<edm::DetSet<SiStripRawDigi> >::const_iterator digisAlt;
597  if (not rawAlt.empty()) {
598  digisAlt = rawAlt.find(fed_key);
599  if (digisAlt == rawAlt.end())
600  continue;
601  }
602 
603  // find the strips belonging to the clusters connected to this APV pair
604  stripOnClusters.clear();
605  if (not clusters.empty()) {
606  for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = clusters.begin(); DSViter != clusters.end();
607  DSViter++) {
608  if (DSViter->id() != iconn->detId())
609  continue; // select clusters on this module
610  for (edmNew::DetSet<SiStripCluster>::const_iterator DSiter = DSViter->begin(); DSiter != DSViter->end();
611  DSiter++) { // loop on the clusters
612  if (DSiter->firstStrip() >= iconn->apvPairNumber() * 256 and
613  DSiter->firstStrip() < (1 + iconn->apvPairNumber()) * 256) { // found the right APV
614  for (size_t istrip = 0; istrip < DSiter->amplitudes().size(); istrip++) {
615  stripOnClusters.push_back(DSiter->firstStrip() + istrip - iconn->apvPairNumber() * 256);
616  }
617  }
618  }
619  }
620  }
621 
622  if (digis != raw.end()) {
623  // tasks involving tracking have partition-level histos, so treat separately
624  if (task_ == sistrip::APV_LATENCY) {
625  if (tasks_[0][iconn->fecCrate() - 1]) {
626  tasks_[0][iconn->fecCrate() - 1]->fillHistograms(*summary, *digis);
627  } else {
628  std::stringstream ss;
629  ss << "[SiStripCommissioningSource::" << __func__ << "]"
630  << " Unable to find CommissioningTask for FEC crate " << iconn->fecCrate()
631  << ". Unable to fill histograms!";
632  edm::LogWarning(mlDqmSource_) << ss.str();
633  }
634  } else if (task_ == sistrip::FINE_DELAY) {
635  if (tasks_[0][0]) {
636  tasks_[0][0]->fillHistograms(*summary, *digis);
637  } else {
638  std::stringstream ss;
639  ss << "[SiStripCommissioningSource::" << __func__ << "]"
640  << " Unable to find global CommissioningTask for FineDelay. Unable to fill histograms!";
641  edm::LogWarning(mlDqmSource_) << ss.str();
642  }
643  } else {
644  if (tasks_[iconn->fedId()][iconn->fedCh()]) {
645  if (not rawAlt.empty() or digisAlt == rawAlt.end())
646  tasks_[iconn->fedId()][iconn->fedCh()]->fillHistograms(*summary, *digis);
647  else { // for spy-data
648  if (stripOnClusters.empty())
649  tasks_[iconn->fedId()][iconn->fedCh()]->fillHistograms(*summary, *digis, *digisAlt);
650  else {
651  tasks_[iconn->fedId()][iconn->fedCh()]->fillHistograms(*summary, *digis, *digisAlt, stripOnClusters);
652  }
653  }
654  } else {
655  std::stringstream ss;
656  ss << "[SiStripCommissioningSource::" << __func__ << "]"
657  << " Unable to find CommissioningTask object with FED key " << std::hex << std::setfill('0')
658  << std::setw(8) << fed_key << std::dec << " and FED id/ch " << iconn->fedId() << "/" << iconn->fedCh()
659  << " Unable to fill histograms!";
660  edm::LogWarning(mlDqmSource_) << ss.str();
661  }
662  }
663  } else {
664  // issue a warning only for standard runs, as latency and fine delay only deliver
665  // pseudo zero-suppressed data
667  std::stringstream ss;
668  ss << "[SiStripCommissioningSource::" << __func__ << "]"
669  << " Unable to find any DetSet containing digis for FED key " << std::hex << std::setfill('0')
670  << std::setw(8) << fed_key << std::dec << " and FED id/ch " << iconn->fedId() << "/" << iconn->fedCh();
671  edm::LogWarning(mlDqmSource_) << ss.str();
672  }
673  }
674  } // fed channel loop
675  } // fed id loop
676 }
677 
678 // -----------------------------------------------------------------------------
679 //
681  // Set commissioning task to default ("undefined") value
682  if (!run_) {
683  edm::LogWarning(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
684  << " NULL run number!";
685  return;
686  }
687 
688  // Create MonitorElement that identifies run number
690  std::stringstream run;
691  run << run_;
693 }
694 
695 // -----------------------------------------------------------------------------
696 //
698  // Set commissioning task to default ("undefined") value
700 
701  // Retrieve commissioning task from EventSummary
702  if (summary) {
703  task_ = summary->runType();
704  std::stringstream ss;
705  ss << "[SiStripCommissioningSource::" << __func__ << "]"
706  << " Identified CommissioningTask from EventSummary to be \"" << SiStripEnumsAndStrings::runType(task_) << "\"";
707  LogTrace(mlDqmSource_) << ss.str();
708  } else {
710  std::stringstream ss;
711  ss << "[SiStripCommissioningSource::" << __func__ << "]"
712  << " NULL pointer to SiStripEventSummary!"
713  << " Check SiStripEventSummary is found/present in Event";
714  edm::LogWarning(mlDqmSource_) << ss.str();
715  }
716 
717  // Override task with ParameterSet configurable (if defined)
719  if (configurable != sistrip::UNDEFINED_RUN_TYPE && configurable != sistrip::UNKNOWN_RUN_TYPE) {
720  std::stringstream ss;
721  ss << "[SiStripCommissioningSource::" << __func__ << "]"
722  << " Overriding CommissioningTask from EventSummary (\"" << SiStripEnumsAndStrings::runType(task_)
723  << "\") with value retrieved from .cfg file (\"" << SiStripEnumsAndStrings::runType(configurable) << "\")!";
724  LogTrace(mlDqmSource_) << ss.str();
725  task_ = configurable;
726  }
727 
728  // Create ME (std::string) that identifies commissioning task
731  dqm()->bookString(std::string(sistrip::taskId_) + sistrip::sep_ + task_str, task_str);
732 
733  // Check commissioning task is known / defined
735  std::stringstream ss;
736  ss << "[SiStripCommissioningSource::" << __func__ << "]"
737  << " Unexpected CommissioningTask found (" << static_cast<uint16_t>(task_) << ") \""
739  << " Unexpected value found in SiStripEventSummary and/or cfg file"
740  << " If SiStripEventSummary is not present in Event,"
741  << " check 'CommissioningTask' configurable in cfg file";
742  edm::LogWarning(mlDqmSource_) << ss.str();
743  return;
744  } else {
745  std::stringstream ss;
746  ss << "[SiStripCommissioningSource::" << __func__ << "]"
747  << " Identified CommissioningTask to be \"" << SiStripEnumsAndStrings::runType(task_) << "\"";
748  LogTrace(mlDqmSource_) << ss.str();
749  }
750 
751  // Check if commissioning task is FED cabling
752  if (task_ == sistrip::FED_CABLING) {
753  cablingTask_ = true;
754  } else {
755  cablingTask_ = false;
756  }
757 
758  std::stringstream ss;
759  ss << "[SiStripCommissioningSource::" << __func__ << "]"
760  << " CommissioningTask: " << SiStripEnumsAndStrings::runType(summary->runType());
761  LogTrace(mlDqmSource_) << ss.str();
762 
763  edm::LogVerbatim(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
764  << " Creating CommissioningTask objects and booking histograms...";
765  if (cablingTask_) {
767  } else {
769  }
770  edm::LogVerbatim(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
771  << " Finished booking histograms!";
772  tasksExist_ = true;
773 }
774 
775 // -----------------------------------------------------------------------------
776 //
778  // Iterate through FEC cabling and create commissioning task objects
779  uint16_t booked = 0;
780  for (std::vector<SiStripFecCrate>::const_iterator icrate = fecCabling_->crates().begin();
781  icrate != fecCabling_->crates().end();
782  icrate++) {
783  for (std::vector<SiStripFec>::const_iterator ifec = icrate->fecs().begin(); ifec != icrate->fecs().end(); ifec++) {
784  for (std::vector<SiStripRing>::const_iterator iring = ifec->rings().begin(); iring != ifec->rings().end();
785  iring++) {
786  for (std::vector<SiStripCcu>::const_iterator iccu = iring->ccus().begin(); iccu != iring->ccus().end();
787  iccu++) {
788  for (std::vector<SiStripModule>::const_iterator imodule = iccu->modules().begin();
789  imodule != iccu->modules().end();
790  imodule++) {
791  // Build FEC key
793  icrate->fecCrate(), ifec->fecSlot(), iring->fecRing(), iccu->ccuAddr(), imodule->ccuChan());
794 
795  // Check if FEC key is invalid
796  if (!path.isValid()) {
797  continue;
798  }
799 
800  // Set working directory prior to booking histograms
801  std::string dir = base_ + path.path();
803 
804  // Iterate through all APV pairs for this module
805  for (uint16_t ipair = 0; ipair < imodule->nApvPairs(); ipair++) {
806  // Retrieve active APV devices
807  SiStripModule::PairOfU16 apvs = imodule->activeApvPair(imodule->lldChannel(ipair));
808 
809  // Create connection object to hold all relevant info
810  FedChannelConnection conn(icrate->fecCrate(),
811  ifec->fecSlot(),
812  iring->fecRing(),
813  iccu->ccuAddr(),
814  imodule->ccuChan(),
815  apvs.first,
816  apvs.second,
817  imodule->dcuId(),
818  imodule->detId(),
819  imodule->nApvPairs());
820 
821  // Define key encoding control path
822  uint32_t key = SiStripFecKey(icrate->fecCrate(),
823  ifec->fecSlot(),
824  iring->fecRing(),
825  iccu->ccuAddr(),
826  imodule->ccuChan(),
827  imodule->lldChannel(ipair))
828  .key();
829 
830  // Check key is non zero
831  if (!key) {
832  edm::LogWarning(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
833  << " Unexpected NULL value for FEC key!";
834  continue;
835  }
836 
837  // Create cabling task objects if not already existing
838  if (cablingTasks_.find(key) == cablingTasks_.end()) {
839  if (task_ == sistrip::FED_CABLING) {
841  } else if (task_ == sistrip::UNDEFINED_RUN_TYPE) {
842  edm::LogWarning(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
843  << " Undefined CommissioningTask"
844  << " Unable to create FedCablingTask object!";
845  } else if (task_ == sistrip::UNKNOWN_RUN_TYPE) {
846  edm::LogWarning(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
847  << " Unknown CommissioningTask"
848  << " Unable to create FedCablingTask object!";
849  } else {
851  << "[SiStripCommissioningSource::" << __func__ << "]"
852  << " Unexpected CommissioningTask: " << SiStripEnumsAndStrings::runType(task_)
853  << " Unable to create FedCablingTask object!";
854  }
855 
856  // Check if key is found and, if so, book histos and set update freq
857  if (cablingTasks_.find(key) != cablingTasks_.end()) {
858  if (cablingTasks_[key]) {
859  cablingTasks_[key]->bookHistograms();
860  cablingTasks_[key]->updateFreq(1); //@@ hardwired to update every event!!!
861  booked++;
862  std::stringstream ss;
863  ss << "[SiStripCommissioningSource::" << __func__ << "]"
864  << " Booking histograms for '" << cablingTasks_[key]->myName() << "' object with key 0x"
865  << std::hex << std::setfill('0') << std::setw(8) << key << std::dec << " in directory \"" << dir
866  << "\"";
867  LogTrace(mlDqmSource_) << ss.str();
868  } else {
869  std::stringstream ss;
870  ss << "[SiStripCommissioningSource::" << __func__ << "]"
871  << " NULL pointer to CommissioningTask for key 0x" << std::hex << std::setfill('0')
872  << std::setw(8) << key << std::dec << " in directory " << dir << " Unable to book histograms!";
873  edm::LogWarning(mlDqmSource_) << ss.str();
874  }
875  } else {
876  std::stringstream ss;
877  ss << "[SiStripCommissioningSource::" << __func__ << "]"
878  << " Unable to find CommissioningTask for key 0x" << std::hex << std::setfill('0') << std::setw(8)
879  << key << std::dec << " in directory " << dir << " Unable to book histograms!";
880  edm::LogWarning(mlDqmSource_) << ss.str();
881  }
882 
883  } else {
884  std::stringstream ss;
885  ss << "[SiStripCommissioningSource::" << __func__ << "]"
886  << " CommissioningTask object already exists for key 0x" << std::hex << std::setfill('0')
887  << std::setw(8) << key << std::dec << " in directory " << dir
888  << " Unable to create FedCablingTask object!";
889  edm::LogWarning(mlDqmSource_) << ss.str();
890  }
891 
892  } // loop through apv pairs
893  } // loop through modules
894  } // loop through ccus
895  } // loop through rings
896  } // loop through fecs
897  } // loop through crates
898 
899  edm::LogVerbatim(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
900  << " Created " << booked << " CommissioningTask objects and booked histograms";
901 }
902 
903 // -----------------------------------------------------------------------------
904 //
906  uint16_t booked = 0;
907 
908  // latency has partition-level histos, so treat separately
909  if (task_ == sistrip::APV_LATENCY) {
910  for (uint16_t partition = 0; partition < 4; ++partition) {
911  // make a task for every partition; tracker-wide histo is shared
912  tasks_[0][partition] = new LatencyTask(
913  dqm(),
916  tasks_[0][partition]->eventSetup(&setup);
917  tasks_[0][partition]->bookHistograms();
918  tasks_[0][partition]->updateFreq(updateFreq_);
919  booked++;
920  }
921 
922  // fine-delay has 1 histo for the whole tracker, so treat separately
923  } else if (task_ == sistrip::FINE_DELAY) {
924  tasks_[0][0] = new FineDelayTask(dqm(), FedChannelConnection());
925  tasks_[0][0]->eventSetup(&setup);
926  tasks_[0][0]->bookHistograms();
927  tasks_[0][0]->updateFreq(updateFreq_);
928  booked++;
929 
930  } else { // now do any other task
931 
932  // Iterate through FED ids and channels
933  for (auto ifed = fedCabling_->fedIds().begin(); ifed != fedCabling_->fedIds().end(); ++ifed) {
934  // Iterate through connected FED channels
935  auto conns = fedCabling_->fedConnections(*ifed);
936  for (auto iconn = conns.begin(); iconn != conns.end(); ++iconn) {
937  // Create FEC key
938  SiStripFecKey fec_key(
939  iconn->fecCrate(), iconn->fecSlot(), iconn->fecRing(), iconn->ccuAddr(), iconn->ccuChan());
940  // Create FED key and check if non-zero
941  SiStripFedKey fed_key(
942  iconn->fedId(), SiStripFedKey::feUnit(iconn->fedCh()), SiStripFedKey::feChan(iconn->fedCh()));
943  if (!iconn->isConnected()) {
944  continue;
945  }
946 
947  // define the view in which to work and paths for histograms
948  // currently FecView (control view) and FedView (readout view)
949  // DetView (detector view) implementation has started
950  // Set working directory prior to booking histograms
951  std::stringstream dir;
952  dir << base_;
953  if (view_ == "Default") { // default
954  if (run_type == sistrip::FAST_CABLING) {
955  dir << fed_key.path(); // cabling in fed view
956  } else {
957  dir << fec_key.path(); // all other runs in control view
958  }
959  } else if (view_ == "FecView") {
960  dir << fec_key.path();
961  } else if (view_ == "FedView") {
962  dir << fed_key.path();
963  } else if (view_ == "DetView") {
964  // currently just by detid from the connection, which is empty...
966  } else {
967  edm::LogWarning(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
968  << " Invalid view " << view_ << std::endl
969  << " Histograms will end up all in the top directory.";
970  } // end if view_ == ...
971  dqm()->setCurrentFolder(dir.str());
972 
973  // Create commissioning task objects
974  if (!tasks_[iconn->fedId()][iconn->fedCh()]) {
975  if (task_ == sistrip::FAST_CABLING) {
976  tasks_[iconn->fedId()][iconn->fedCh()] = new FastFedCablingTask(dqm(), *iconn);
977  } else if (task_ == sistrip::APV_TIMING) {
978  tasks_[iconn->fedId()][iconn->fedCh()] = new ApvTimingTask(dqm(), *iconn);
979  } else if (task_ == sistrip::FED_TIMING) {
980  tasks_[iconn->fedId()][iconn->fedCh()] = new FedTimingTask(dqm(), *iconn);
981  } else if (task_ == sistrip::OPTO_SCAN) {
982  tasks_[iconn->fedId()][iconn->fedCh()] = new OptoScanTask(dqm(), *iconn);
983  } else if (task_ == sistrip::VPSP_SCAN) {
984  tasks_[iconn->fedId()][iconn->fedCh()] = new VpspScanTask(dqm(), *iconn);
985  } else if (task_ == sistrip::PEDESTALS) {
986  tasks_[iconn->fedId()][iconn->fedCh()] = new PedestalsTask(dqm(), *iconn);
987  } else if (task_ == sistrip::PEDS_ONLY) {
988  tasks_[iconn->fedId()][iconn->fedCh()] = new PedsOnlyTask(dqm(), *iconn);
989  } else if (task_ == sistrip::NOISE) {
990  tasks_[iconn->fedId()][iconn->fedCh()] = new NoiseTask(dqm(), *iconn, pedestalToken_, noiseToken_);
991  } else if (task_ == sistrip::PEDS_FULL_NOISE) {
992  tasks_[iconn->fedId()][iconn->fedCh()] = new PedsFullNoiseTask(dqm(), *iconn, parameters_);
993  } else if (task_ == sistrip::DAQ_SCOPE_MODE) {
994  tasks_[iconn->fedId()][iconn->fedCh()] = new DaqScopeModeTask(dqm(), *iconn, parameters_);
996  tasks_[iconn->fedId()][iconn->fedCh()] =
997  new CalibrationScanTask(dqm(), *iconn, task_, filename_.c_str(), run_, setup.getData(pedestalToken_));
999  tasks_[iconn->fedId()][iconn->fedCh()] =
1000  new CalibrationTask(dqm(), *iconn, task_, filename_.c_str(), run_, setup.getData(pedestalToken_));
1001  } else if (task_ == sistrip::UNDEFINED_RUN_TYPE) {
1002  edm::LogWarning(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
1003  << " Undefined CommissioningTask"
1004  << " Unable to create CommissioningTask object!";
1005  } else {
1006  edm::LogWarning(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
1007  << " Unknown CommissioningTask"
1008  << " Unable to create CommissioningTask object!";
1009  }
1010 
1011  // Check if fed_key is found and, if so, book histos and set update freq
1012  if (tasks_[iconn->fedId()][iconn->fedCh()]) {
1013  tasks_[iconn->fedId()][iconn->fedCh()]->eventSetup(&setup);
1014 
1017  tasks_[iconn->fedId()][iconn->fedCh()]->bookHistograms();
1018  else {
1020  static_cast<CalibrationScanTask*>(tasks_[iconn->fedId()][iconn->fedCh()])->setCurrentFolder(dir.str());
1022  static_cast<CalibrationTask*>(tasks_[iconn->fedId()][iconn->fedCh()])->setCurrentFolder(dir.str());
1023  }
1024  tasks_[iconn->fedId()][iconn->fedCh()]->updateFreq(updateFreq_);
1025  booked++;
1026  } else {
1027  std::stringstream ss;
1028  ss << "[SiStripCommissioningSource::" << __func__ << "]"
1029  << " NULL pointer to CommissioningTask for key 0x" << std::hex << std::setfill('0') << std::setw(8)
1030  << fed_key.key() << std::dec << " in directory " << dir.str() << " Unable to book histograms!";
1031  edm::LogWarning(mlDqmSource_) << ss.str();
1032  }
1033  } else {
1034  std::stringstream ss;
1035  ss << "[SiStripCommissioningSource::" << __func__ << "]"
1036  << " CommissioningTask object already exists for key 0x" << std::hex << std::setfill('0') << std::setw(8)
1037  << fed_key.key() << std::dec << " in directory " << dir.str()
1038  << " Unable to create CommissioningTask object!";
1039  edm::LogWarning(mlDqmSource_) << ss.str();
1040  }
1041  } // loop over fed channels
1042  } // loop over feds
1043  } // end other tasks
1044  edm::LogVerbatim(mlDqmSource_) << "[SiStripCommissioningSource::" << __func__ << "]"
1045  << " Created " << booked << " CommissioningTask objects and booked histograms";
1046 }
1047 
1048 // ----------------------------------------------------------------------------
1049 //
1051  if (cablingTasks_.empty()) {
1052  return;
1053  }
1054  for (TaskMap::iterator itask = cablingTasks_.begin(); itask != cablingTasks_.end(); itask++) {
1055  if (itask->second) {
1056  delete itask->second;
1057  }
1058  }
1059  cablingTasks_.clear();
1060 }
1061 
1062 // ----------------------------------------------------------------------------
1063 //
1065  if (tasks_.empty()) {
1066  return;
1067  }
1068  VecOfVecOfTasks::iterator ifed = tasks_.begin();
1069  for (; ifed != tasks_.end(); ifed++) {
1070  VecOfTasks::iterator ichan = ifed->begin();
1071  for (; ichan != ifed->end(); ichan++) {
1072  if (*ichan) {
1073  delete *ichan;
1074  *ichan = 0;
1075  }
1076  }
1077  ifed->resize(96, nullptr);
1078  }
1079  tasks_.resize(1024);
1080 }
1081 
1082 // ----------------------------------------------------------------------------
1083 //
1085  // TODO: remove no longer supported in DQMStore.
1086 }
1087 
1088 // -----------------------------------------------------------------------------
1089 //
1090 void SiStripCommissioningSource::directory(std::stringstream& dir, uint32_t run_number) {
1091  // Get details about host
1092  char hn[256];
1093  gethostname(hn, sizeof(hn));
1094  struct hostent* he;
1095  he = gethostbyname(hn);
1096 
1097  // Extract host name and ip
1098  std::string host_name;
1099  std::string host_ip;
1100  if (he) {
1101  host_name = std::string(he->h_name);
1102  host_ip = std::string(inet_ntoa(*(struct in_addr*)(he->h_addr)));
1103  } else {
1104  host_name = "unknown.cern.ch";
1105  host_ip = "255.255.255.255";
1106  }
1107 
1108  // Reformat IP address
1110  std::stringstream ip;
1111  //for ( uint16_t ii = 0; ii < 4; ++ii ) {
1112  while (pos != std::string::npos) {
1113  std::string::size_type tmp = host_ip.find('.', pos);
1114  if (tmp != std::string::npos) {
1115  ip << std::setw(3) << std::setfill('0') << host_ip.substr(pos, tmp - pos) << ".";
1116  pos = tmp + 1; // skip the delimiter "."
1117  } else {
1118  ip << std::setw(3) << std::setfill('0') << host_ip.substr(pos);
1119  pos = std::string::npos;
1120  }
1121  }
1122 
1123  // Get pid
1124  pid_t pid = getpid();
1125 
1126  // Construct string
1127  if (run_number) {
1128  dir << std::setw(8) << std::setfill('0') << run_number << "_";
1129  }
1130  dir << ip.str() << "_" << std::setw(5) << std::setfill('0') << pid;
1131 }
1132 
1133 // -----------------------------------------------------------------------------
1134 //
1135 // void SiStripCommissioningSource::cablingForConnectionRun( const sistrip::RunType& type ) {
1136 
1137 // if ( type == sistrip::FED_CABLING ||
1138 // type == sistrip::QUITE_FAST_CABLING ||
1139 // type == sistrip::FAST_CABLING ) {
1140 // std::stringstream ss;
1141 // ss << "[SiStripCommissioningSource::" << __func__ << "]"
1142 // << " Run type is " << SiStripEnumsAndStrings::runType( type ) << "!"
1143 // << " Checking if cabling should be rebuilt using FED and device descriptions!...";
1144 // edm::LogVerbatim(mlDqmSource_) << ss.str();
1145 // } else { return; }
1146 
1147 // // Build and retrieve SiStripConfigDb object using service
1148 // SiStripConfigDb* db = edm::Service<SiStripConfigDb>().operator->(); //@@ NOT GUARANTEED TO BE THREAD SAFE!
1149 // LogTrace(mlCabling_)
1150 // << "[SiStripCommissioningSource::" << __func__ << "]"
1151 // << " Nota bene: using the SiStripConfigDb API"
1152 // << " as a \"service\" does not presently guarantee"
1153 // << " thread-safe behaviour!...";
1154 
1155 // if ( !db ) {
1156 // edm::LogError(mlCabling_)
1157 // << "[SiStripCommissioningSource::" << __func__ << "]"
1158 // << " NULL pointer to SiStripConfigDb returned by service!"
1159 // << " Cannot check if cabling needs to be rebuilt!";
1160 // return;
1161 // }
1162 
1163 // if ( db->getFedConnections().empty() ) {
1164 // edm::LogVerbatim(mlCabling_)
1165 // << "[SiStripCommissioningSource::" << __func__ << "]"
1166 // << " Datbase does not contain FED connections!"
1167 // << " Do not need to rebuild cabling object based on FED and device descriptions!";
1168 // return;
1169 // }
1170 
1171 // if ( fecCabling_ ) { delete fecCabling_; fecCabling_ = 0; }
1172 // if ( fedCabling_ ) { delete fedCabling_; fedCabling_ = 0; }
1173 
1174 // // Build FEC cabling
1175 // fecCabling_ = new SiStripFecCabling();
1176 // SiStripConfigDb::DcuDetIdMap mapping;
1177 // SiStripFedCablingBuilderFromDb::buildFecCablingFromDevices( db,
1178 // *fecCabling_,
1179 // mapping );
1180 // // Build FED cabling
1181 // fedCabling_ = new SiStripFedCabling();
1182 // SiStripFedCablingBuilderFromDb::getFedCabling( *fecCabling_,
1183 // *fedCabling_ );
1184 
1185 // edm::LogVerbatim(mlCabling_)
1186 // << "[SiStripCommissioningSource::" << __func__ << "]"
1187 // << " Cabling object rebuilt using on FED and device descriptions!";
1188 
1189 // }
static const char runNumber_[]
Log< level::Info, true > LogVerbatim
Device and connection information at the level of a front-end module.
Definition: SiStripModule.h:24
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > digiReorderedToken_
iterator find(det_id_type id)
Definition: DetSetVector.h:264
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > digiVirginRawToken_
const uint16_t & feChan() const
void createTask(const SiStripEventSummary *const, const edm::EventSetup &)
edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > pedestalToken_
static const char dir_[]
const uint16_t & feUnit() const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
const SiStripModule & module(const FedChannelConnection &conn) const
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clustersToken_
void fillHistos(const SiStripEventSummary *const, const edm::DetSetVector< SiStripRawDigi > &, const edm::DetSetVector< SiStripRawDigi > &=edm::DetSetVector< SiStripRawDigi >(), const edmNew::DetSetVector< SiStripCluster > &=edmNew::DetSetVector< SiStripCluster >())
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
static const char mlDqmSource_[]
void createTasks(sistrip::RunType, const edm::EventSetup &)
data_type const * const_iterator
Definition: DetSetNew.h:31
bool empty() const
Return true if we contain no DetSets.
Definition: DetSetVector.h:254
static const uint16_t valid_
Definition: Constants.h:17
static const char detectorView_[]
uint16_t size_type
void analyze(const edm::Event &, const edm::EventSetup &) override
sistrip classes
#define LogTrace(id)
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
Definition: DQMStore.h:87
void directory(std::stringstream &, uint32_t run_number=0)
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
void beginRun(edm::Run const &, const edm::EventSetup &) override
static std::string runType(const sistrip::RunType &)
std::vector< CommissioningTask * > VecOfTasks
static const char sep_[]
Class containning control, module, detector and connection information, at the level of a FED channel...
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
static const char taskId_[]
void fillCablingHistos(const SiStripEventSummary *const, const edm::DetSetVector< SiStripRawDigi > &)
const uint32_t & key() const
Definition: SiStripKey.h:120
static const char dqmSourceFileName_[]
static const char mlTest_[]
Transition
Definition: Transition.h:12
const std::vector< SiStripFecCrate > & crates() const
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
ii
Definition: cuy.py:589
Log< level::Info, false > LogInfo
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > digiFineDelaySelectionToken_
static const uint16_t invalid_
Definition: Constants.h:16
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< SiStripEventSummary > inputModuleSummaryToken_
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > digiScopeModeToken_
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:808
HLT enums.
DQMStore *const dqm(std::string method="") const
conn
Definition: getInfo.py:9
static const char root_[]
Log< level::Warning, false > LogWarning
tmp
align.sh
Definition: createJobs.py:716
std::pair< uint16_t, uint16_t > PairOfU16
Definition: SiStripModule.h:40
FedsConstIterRange fedIds() const
ConnsConstIterRange fedConnections(uint16_t fed_id) const
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noiseToken_
Definition: event.py:1
Definition: Run.h:45
#define LogDebug(id)
static std::string fedReadoutMode(const sistrip::FedReadoutMode &)