CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FedTimingTask.cc
Go to the documentation of this file.
5 
6 using namespace sistrip;
7 
8 // -----------------------------------------------------------------------------
9 //
11  : CommissioningTask(dqm, conn, "FedTimingTask"),
12  timing_(),
13  nBins_(
14  40) //@@ this should be from number of scope mode samples (mean booking in event loop and putting scope mode length in trigger fed)
15 {
16  LogDebug("Commissioning") << "[FedTimingTask::FedTimingTask] Constructing object...";
17 }
18 
19 // -----------------------------------------------------------------------------
20 //
21 FedTimingTask::~FedTimingTask() { LogDebug("Commissioning") << "[FedTimingTask::FedTimingTask] Destructing object..."; }
22 
23 // -----------------------------------------------------------------------------
24 //
26  LogDebug("Commissioning") << "[FedTimingTask::book]";
27 
28  uint16_t nbins = 24 * nBins_; // 24 "fine" pll skews possible
29 
31 
35  fedKey(),
37  connection().lldChannel())
38  .title();
39 
40  timing_.histo(dqm()->bookProfile(title, title, nbins, -0.5, nbins * 1. - 0.5, 1025, 0., 1025.));
41 
42  timing_.vNumOfEntries_.resize(nbins, 0);
43  timing_.vSumOfContents_.resize(nbins, 0);
44  timing_.vSumOfSquares_.resize(nbins, 0);
45 }
46 
47 // -----------------------------------------------------------------------------
48 //
49 /*
50  Some notes:
51  - use all samples
52  - extract number of samples from trigger fed
53  - need to book histos in event loop?
54  - why only use fine skew setting when filling histos? should use coarse setting as well?
55  - why do different settings every 100 events - change more freq?
56 */
58  LogDebug("Commissioning") << "[FedTimingTask::fill]";
59 
60  //@@ if scope mode length is in trigger fed, then
61  //@@ can add check here on number of digis
62  if (digis.data.size() < nBins_) {
63  edm::LogWarning("Commissioning") << "[FedTimingTask::fill]"
64  << " Unexpected number of digis! " << digis.data.size();
65  } else {
66  uint32_t pll_fine = summary.pllFine();
67  for (uint16_t coarse = 0; coarse < nBins_ /*digis.data.size()*/; coarse++) {
68  uint16_t fine = (coarse + 1) * 24 - (pll_fine + 1);
69  updateHistoSet(timing_, fine, digis.data[coarse].adc());
70  }
71  }
72 }
73 
74 // -----------------------------------------------------------------------------
75 //
77  LogDebug("Commissioning") << "[FedTimingTask::update]";
79 }
std::vector< float > vNumOfEntries_
Utility class that holds histogram title.
const std::string & title() const
std::vector< float > vSumOfContents_
const uint32_t & pllFine() const
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
uint16_t nBins_
Definition: FedTimingTask.h:21
DQMStore *const dqm() const
Class containning control, module, detector and connection information, at the level of a FED channel...
void fill(const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &) override
FedTimingTask(DQMStore *, const FedChannelConnection &)
void book() override
collection_type data
Definition: DetSet.h:80
void update() override
void histo(MonitorElement *)
tuple conn
Definition: getInfo.py:9
~FedTimingTask() override
const uint32_t & fedKey() const
std::vector< double > vSumOfSquares_
const FedChannelConnection & connection() const
Log< level::Warning, false > LogWarning
HistoSet timing_
Definition: FedTimingTask.h:19
#define LogDebug(id)