CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FedCablingTask.cc
Go to the documentation of this file.
6 #include <algorithm>
7 #include <sstream>
8 #include <iomanip>
9 
10 using namespace sistrip;
11 
12 // -----------------------------------------------------------------------------
13 //
15  const FedChannelConnection& conn ) :
16  CommissioningTask( dqm, conn, "FedCablingTask" ),
17  histos_()
18 {}
19 
20 // -----------------------------------------------------------------------------
21 //
23 }
24 
25 // -----------------------------------------------------------------------------
26 //
28 
29  histos_.resize(2);
30 
32  uint16_t nbins = 0;
33  std::string extra_info = "";
34  for ( uint16_t iter = 0; iter < 2; iter++ ) {
35 
36  // Define number of histo bins and title
37  if ( iter == 0 ) { nbins = 1024; extra_info = sistrip::feDriver_; }
38  else if ( iter == 1 ) { nbins = 96; extra_info = sistrip::fedChannel_; }
39  else {
41  << "[FedCablingTask::" << __func__ << "]"
42  << " Unexpected number of HistoSets: " << iter;
43  }
44 
48  fedKey(),
50  connection().lldChannel(),
51  extra_info ).title();
52 
53  histos_[iter].histo( dqm()->bookProfile( title, title,
54  nbins, -0.5, nbins*1.-0.5,
55  1025, 0., 1025. ) );
56 
57  histos_[iter].vNumOfEntries_.resize(nbins,0);
58  histos_[iter].vSumOfContents_.resize(nbins,0);
59  histos_[iter].vSumOfSquares_.resize(nbins,0);
60 
61  }
62 
63 }
64 
65 // -----------------------------------------------------------------------------
66 //
68  const uint16_t& fed_id,
69  const std::map<uint16_t,float>& fed_ch ) {
70 
71  if ( fed_ch.empty() ) {
73  << "[FedCablingTask::" << __func__ << "]"
74  << " No FED channels with high signal!";
75  return;
76  } else {
78  << "[FedCablingTask::" << __func__ << "]"
79  << " Found " << fed_ch.size()
80  << " FED channels with high signal!";
81  }
82 
83  std::map<uint16_t,float>::const_iterator ichan = fed_ch.begin();
84  for ( ; ichan != fed_ch.end(); ichan++ ) {
85  updateHistoSet( histos_[0], fed_id, ichan->second );
86  updateHistoSet( histos_[1], ichan->first, ichan->second );
87  }
88 
89 }
90 
91 // -----------------------------------------------------------------------------
92 //
94  for ( uint32_t iter = 0; iter < histos_.size(); iter++ ) {
95  updateHistoSet( histos_[iter] );
96  }
97 }
98 
99 
100 
static const char feDriver_[]
Utility class that holds histogram title.
const std::string & title() const
static const char mlDqmSource_[]
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
std::vector< HistoSet > histos_
Class containning control, module, detector and connection information, at the level of a FED channel...
virtual void book()
static const char fedChannel_[]
#define LogTrace(id)
FedCablingTask(DQMStore *, const FedChannelConnection &)
DQMStore *const dqm() const
virtual void update()
virtual void fill(const SiStripEventSummary &, const uint16_t &fed_id, const std::map< uint16_t, float > &fed_ch)
const uint32_t & fedKey() const
virtual ~FedCablingTask()
const FedChannelConnection & connection() const
tuple conn
Definition: results_mgr.py:53