CMS 3D CMS Logo

DTDAQInfo.cc
Go to the documentation of this file.
1 
2 /*
3  * See header file for a description of this class.
4  *
5  * \author G. Cerminara - INFN Torino
6  *
7  * threadsafe version (//-) oct/nov 2014 - WATWanAbdullah ncpp-um-my
8  *
9  */
10 
11 
14 
18 
21 
25 
26 
29 
31 
32 
33 
34 using namespace std;
35 using namespace edm;
36 
37 
38 
40 
41  bookingdone = false;
42  checkUros = pset.getUntrackedParameter<bool>("checkUros",true);
43 }
44 
46 
48  edm::EventSetup const & setup) {
49 
50  if (!bookingdone) {
51  // retrieve the mapping
52  setup.get<DTReadOutMappingRcd>().get(mapping);
53 
54  // book the ME
55  // global fraction
56 
57  ibooker.setCurrentFolder("DT/EventInfo");
58 
59  totalDAQFraction = ibooker.bookFloat("DAQSummary");
60  totalDAQFraction->Fill(-1);
61 
62  // map
63  daqMap = ibooker.book2D("DAQSummaryMap","DT Certification Summary Map",12,1,13,5,-2,3);
64  daqMap->setAxisTitle("sector",1);
65  daqMap->setAxisTitle("wheel",2);
66 
67  // Wheel "fractions" -> will be 0 or 1
68 
69  ibooker.setCurrentFolder("DT/EventInfo/DAQContents");
70  for(int wheel = -2; wheel != 3; ++wheel) {
71  stringstream streams;
72  streams << "DT_Wheel" << wheel;
73 
74  daqFractions[wheel] = ibooker.bookFloat(streams.str());
75  daqFractions[wheel]->Fill(-1);
76  }
77  bookingdone = true;
78  } //booking done
79 
80  // create a record key for RunInfoRcd
82 
83  if(setup.find(recordKey) != nullptr) {
84  // reset to 0
85  totalDAQFraction->Fill(0.);
86  daqFractions[-2]->Fill(0.);
87  daqFractions[-1]->Fill(0.);
88  daqFractions[-0]->Fill(0.);
89  daqFractions[1]->Fill(0.);
90  daqFractions[2]->Fill(0.);
91 
92 
93  daqMap->Reset();
94  //get fed summary information
95  ESHandle<RunInfo> sumFED;
96  setup.get<RunInfoRcd>().get(sumFED);
97  vector<int> fedInIDs = sumFED->m_fed_in;
98 
99  // the range of DT feds
100  static const int FEDIDmin = FEDNumbering::MINDTFEDID;
101  static const int FEDIDMax = FEDNumbering::MAXDTFEDID;
102 
103  //FIXME for uROS FEDIDs once mapping has been defined
104  if (checkUros) { LogTrace("DQM|DTMonitorClient|DTDAQInfo")
105  << "Checking uROS FEDs as Legacy FEDs"<< endl;}
106 
107  // loop on all active feds
108  for(vector<int>::const_iterator fed = fedInIDs.begin();
109  fed != fedInIDs.end();
110  ++fed) {
111  // check if the fed is in the DT range
112  if(!(*fed >= FEDIDmin && *fed <= FEDIDMax)) continue;
113 
114  // check if the 12 channels are connected to any sector and fill the wheel percentage accordignly
115  int wheel = -99;
116  int sector = -99;
117  int dummy = -99;
118  for(int ros = 1; ros != 13; ++ros) {
119  if(!mapping->readOutToGeometry(*fed,ros,2,2,2,wheel,dummy,sector,dummy,dummy,dummy)) {
120  LogTrace("DQM|DTMonitorClient|DTDAQInfo")
121  << "FED: " << *fed << " Ch: " << ros << " wheel: " << wheel << " Sect: " << sector << endl;
122  daqFractions[wheel]->Fill(daqFractions[wheel]->getFloatValue() + 1./12.);
123  totalDAQFraction->Fill(totalDAQFraction->getFloatValue() + 1./60.);
124  daqMap->Fill(sector,wheel);
125  }
126  }
127  }
128  } else {
129  LogWarning("DQM|DTMonitorClient|DTDAQInfo") << "*** Warning: record key not found for RunInfoRcd" << endl;
130  totalDAQFraction->Fill(-1);
131  for(int wheel = -2; wheel != 3; ++wheel) {
132  daqFractions[wheel]->Fill(-1);
133  }
134  return;
135  }
136 }
137 
139 
140 
141 
142 
T getUntrackedParameter(std::string const &, T const &) const
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:76
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: DTDAQInfo.cc:47
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
void Fill(long long x)
std::vector< int > m_fed_in
Definition: RunInfo.h:26
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: DTDAQInfo.cc:138
~DTDAQInfo() override
Destructor.
Definition: DTDAQInfo.cc:45
#define LogTrace(id)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
HLT enums.
T get() const
Definition: EventSetup.h:63
boost::optional< eventsetup::EventSetupRecordGeneric > find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:88
DTDAQInfo(const edm::ParameterSet &pset)
Constructor.
Definition: DTDAQInfo.cc:39
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:112
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)