CMS 3D CMS Logo

FedTimingTask.cc
Go to the documentation of this file.
5 
6 using namespace sistrip;
7 
8 // -----------------------------------------------------------------------------
9 //
11  const FedChannelConnection& conn ) :
12  CommissioningTask( dqm, conn, "FedTimingTask" ),
13  timing_(),
14  nBins_(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 //
22  LogDebug("Commissioning") << "[FedTimingTask::FedTimingTask] Destructing object...";
23 }
24 
25 // -----------------------------------------------------------------------------
26 //
28  LogDebug("Commissioning") << "[FedTimingTask::book]";
29 
30  uint16_t nbins = 24 * nBins_; // 24 "fine" pll skews possible
31 
33 
37  fedKey(),
39  connection().lldChannel() ).title();
40 
41  timing_.histo( dqm()->bookProfile( title, title,
42  nbins, -0.5, nbins*1.-0.5,
43  1025, 0., 1025. ) );
44 
45  timing_.vNumOfEntries_.resize(nbins,0);
46  timing_.vSumOfContents_.resize(nbins,0);
47  timing_.vSumOfSquares_.resize(nbins,0);
48 
49 }
50 
51 // -----------------------------------------------------------------------------
52 //
53 /*
54  Some notes:
55  - use all samples
56  - extract number of samples from trigger fed
57  - need to book histos in event loop?
58  - why only use fine skew setting when filling histos? should use coarse setting as well?
59  - why do different settings every 100 events - change more freq?
60 */
62  const edm::DetSet<SiStripRawDigi>& digis ) {
63  LogDebug("Commissioning") << "[FedTimingTask::fill]";
64 
65  //@@ if scope mode length is in trigger fed, then
66  //@@ can add check here on number of digis
67  if ( digis.data.size() < nBins_ ) {
68  edm::LogWarning("Commissioning") << "[FedTimingTask::fill]"
69  << " Unexpected number of digis! "
70  << digis.data.size();
71  } else {
72 
73  uint32_t pll_fine = summary.pllFine();
74  for ( uint16_t coarse = 0; coarse < nBins_/*digis.data.size()*/; coarse++ ) {
75  uint16_t fine = (coarse+1)*24 - (pll_fine+1);
76  updateHistoSet( timing_, fine, digis.data[coarse].adc() );
77  }
78 
79  }
80 
81 }
82 
83 // -----------------------------------------------------------------------------
84 //
86  LogDebug("Commissioning") << "[FedTimingTask::update]";
88 }
89 
90 
#define LogDebug(id)
std::vector< float > vNumOfEntries_
Utility class that holds histogram title.
virtual void fill(const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &)
const std::string & title() const
std::vector< float > vSumOfContents_
const uint32_t & pllFine() const
sistrip classes
virtual void book()
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
uint16_t nBins_
Definition: FedTimingTask.h:25
Class containning control, module, detector and connection information, at the level of a FED channel...
virtual ~FedTimingTask()
virtual void update()
FedTimingTask(DQMStore *, const FedChannelConnection &)
DQMStore *const dqm() const
collection_type data
Definition: DetSet.h:78
void histo(MonitorElement *)
const uint32_t & fedKey() const
std::vector< double > vSumOfSquares_
const FedChannelConnection & connection() const
HistoSet timing_
Definition: FedTimingTask.h:23