CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DTDataIntegrityTest Class Reference

#include <DTDataIntegrityTest.h>

Inheritance diagram for DTDataIntegrityTest:
DQMEDHarvester edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTDataIntegrityTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTDataIntegrityTest () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void bookHistos (DQMStore::IBooker &, std::string histoType, int dduId)
 Book the MEs. More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 DQM Client Diagnostic. More...
 
std::string getMEName (std::string histoType, int FEDId)
 Get the ME name. More...
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

int getROS (int uROS, int link)
 
int readOutToGeometry (int dduId, int rosNumber, int &wheel, int &sector)
 

Private Attributes

bool bookingdone
 
bool checkUros
 
int counter
 
std::map< std::string, std::map< int, MonitorElement * > > dduHistos
 
std::map< std::string, std::map< int, std::vector< MonitorElement * > > > dduVectorHistos
 
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
 
std::map< std::string, std::map< int, std::vector< MonitorElement * > > > fedVectorHistos
 
MonitorElementglbSummaryHisto
 
edm::ESHandle< DTReadOutMappingmapping
 
int nevents
 
unsigned int nLumiSegs
 
int nupdates
 
int prescaleFactor
 
int run
 
MonitorElementsummaryHisto
 
MonitorElementsummaryTDCHisto
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 27 of file DTDataIntegrityTest.h.

Constructor & Destructor Documentation

DTDataIntegrityTest::DTDataIntegrityTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 27 of file DTDataIntegrityTest.cc.

References bookingdone, checkUros, edm::ParameterSet::getUntrackedParameter(), LogTrace, and prescaleFactor.

27  : nevents(0) {
28  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest") << "[DTDataIntegrityTest]: Constructor";
29 
30  // prescale on the # of LS to update the test
31  prescaleFactor = ps.getUntrackedParameter<int>("diagnosticPrescale", 1);
32 
33  checkUros = ps.getUntrackedParameter<bool>("checkUros", false);
34 
35  bookingdone = false;
36 }
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
DTDataIntegrityTest::~DTDataIntegrityTest ( )
override

Destructor.

Definition at line 38 of file DTDataIntegrityTest.cc.

References LogTrace, and nupdates.

38  {
39  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest")
40  << "DataIntegrityTest: analyzed " << nupdates << " updates";
41 }
#define LogTrace(id)

Member Function Documentation

void DTDataIntegrityTest::bookHistos ( DQMStore::IBooker ,
std::string  histoType,
int  dduId 
)
protected

Book the MEs.

Definition at line 333 of file DTDataIntegrityTest.cc.

References HltBtagPostValidation_cff::histoName, and dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder().

333  {
334  stringstream dduId_s;
335  dduId_s << dduId;
336 
337  ibooker.setCurrentFolder("DT/00-DataIntegrity/FED" + dduId_s.str());
338  string histoName;
339 }
void DTDataIntegrityTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 318 of file DTDataIntegrityTest.cc.

References LogTrace.

318  {
319  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest") << "[DTDataIntegrityTest] endjob called!";
320 }
#define LogTrace(id)
void DTDataIntegrityTest::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

DQM Client Diagnostic.

Reimplemented from DQMEDHarvester.

Definition at line 43 of file DTDataIntegrityTest.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), bookingdone, checkUros, DOCESLOTS, dtDataIntegrityTask_cfi::fedIntegrityFolder, edm::EventSetup::get(), dqm::dqmstoreimpl::DQMStore::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), getROS(), dqm::legacy::MonitorElement::getTH1F(), dqm::legacy::MonitorElement::getTH2F(), glbSummaryHisto, mps_fire::i, edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), mapping, SiStripPI::max, FEDNumbering::MAXDTFEDID, FEDNumbering::MAXDTUROSFEDID, FEDNumbering::MINDTFEDID, FEDNumbering::MINDTUROSFEDID, nLumiSegs, nupdates, prescaleFactor, readOutToGeometry(), mps_fire::result, run, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinContent(), dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), Validation_hcalonly_cfi::sign, summaryHisto, summaryTDCHisto, makeMuonMisalignmentScenario::wheel, and plotscripts::wheelNumber().

46  {
47  if (!bookingdone) {
48  //nSTAEvents = 0;
49  nupdates = 0;
50  run = 0;
51 
52  // book the summary histogram
53 
54  ibooker.setCurrentFolder("DT/00-DataIntegrity");
55 
56  summaryHisto = ibooker.book2D("DataIntegritySummary", "Summary Data Integrity", 12, 1, 13, 5, -2, 3);
57  summaryHisto->setAxisTitle("Sector", 1);
58  summaryHisto->setAxisTitle("Wheel", 2);
59 
60  ibooker.setCurrentFolder("DT/00-DataIntegrity");
61 
62  summaryTDCHisto = ibooker.book2D("DataIntegrityTDCSummary", "TDC Summary Data Integrity", 12, 1, 13, 5, -2, 3);
63  summaryTDCHisto->setAxisTitle("Sector", 1);
64  summaryTDCHisto->setAxisTitle("Wheel", 2);
65 
66  ibooker.setCurrentFolder("DT/00-DataIntegrity");
67 
68  glbSummaryHisto = ibooker.book2D("DataIntegrityGlbSummary", "Summary Data Integrity", 12, 1, 13, 5, -2, 3);
69  glbSummaryHisto->setAxisTitle("Sector", 1);
70  glbSummaryHisto->setAxisTitle("Wheel", 2);
71 
72  context.get<DTReadOutMappingRcd>().get(mapping);
73  } //booking
74  bookingdone = true;
75 
76  // counts number of lumiSegs
77  nLumiSegs = lumiSeg.id().luminosityBlock();
78  string nLumiSegs_s = to_string(nLumiSegs);
79 
80  // prescale factor
81  if (nLumiSegs % prescaleFactor != 0)
82  return;
83 
84  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest")
85  << "[DTDataIntegrityTest]: End of LS " << nLumiSegs << ", performing client operations";
86 
87  // counts number of updats
88  nupdates++;
89 
90  //Counter for x bin in the timing histos
91  counter++;
92 
93  //Loop on FED id
94  //Monitoring only real used FEDs
95  int FEDIDmax = FEDNumbering::MAXDTFEDID;
96  int FEDIDmin = FEDNumbering::MINDTFEDID;
97  if (checkUros) {
100  }
101 
102  for (int dduId = FEDIDmin; dduId <= FEDIDmax; ++dduId) {
103  LogTrace("DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest") << "[DTDataIntegrityTest]:FED Id: " << dduId;
104 
105  //Each nTimeBin onUpdate remove timing histos and book a new bunch of them
106  string dduId_s = to_string(dduId);
107 
108  string histoType;
109 
110  //Check if the list of ROS is compatible with the channels enabled
111  string rosStatusName = "DT/00-DataIntegrity/FED" + dduId_s + "/FED" + dduId_s + "_ROSStatus";
112  if (checkUros)
113  rosStatusName = "DT/00-DataIntegrity/FED" + dduId_s + "/FED" + dduId_s + "_uROSStatus";
114  MonitorElement* FED_ROSStatus = igetter.get(rosStatusName);
115 
116  // Get the error summary histo
117  string fedSummaryName = "DT/00-DataIntegrity/FED" + dduId_s + "_ROSSummary";
118  MonitorElement* FED_ROSSummary = nullptr;
119  MonitorElement* FED_ROSSummary1 = nullptr;
120  MonitorElement* FED_ROSSummary2 = nullptr;
121  string fedSummaryName1 = "";
122  string fedSummaryName2 = "";
123  string sign = "-";
124  if (checkUros) {
125  if (dduId == FEDIDmin || dduId == FEDIDmax) {
126  if (dduId == FEDIDmax)
127  sign = "";
128  fedSummaryName2 = "DT/00-DataIntegrity/ROSSummary_W" + sign + "2";
129  fedSummaryName1 = "DT/00-DataIntegrity/ROSSummary_W" + sign + "1";
130  FED_ROSSummary1 = igetter.get(fedSummaryName1);
131  FED_ROSSummary2 = igetter.get(fedSummaryName2);
132  } else {
133  fedSummaryName = "DT/00-DataIntegrity/ROSSummary_W0";
134  FED_ROSSummary1 = igetter.get(fedSummaryName);
135  FED_ROSSummary2 = igetter.get(fedSummaryName); //for wheel compatibility...
136  }
137  } else
138  FED_ROSSummary = igetter.get(fedSummaryName); //legacy case
139 
140  // Get the event length plot (used to count # of processed evts)
141  string fedEvLenName = "DT/00-DataIntegrity/FED" + dduId_s + "/FED" + dduId_s + "_EventLength";
142  MonitorElement* FED_EvLength = igetter.get(fedEvLenName);
143 
144  // Get the histos for FED integrity
145  string fedIntegrityFolder = "DT/00-DataIntegrity/";
146  MonitorElement* hFEDEntry = igetter.get(fedIntegrityFolder + "FEDEntries");
147  MonitorElement* hFEDFatal = igetter.get(fedIntegrityFolder + "FEDFatal");
148  MonitorElement* hFEDNonFatal = igetter.get(fedIntegrityFolder + "FEDNonFatal");
149 
150  if (checkUros) {
151  if (hFEDEntry) {
152  int offsetFED = 1368;
153  // Check that the FED is in the ReadOut using the FEDIntegrity histos
154  bool fedNotReadout = (hFEDEntry->getBinContent(dduId - offsetFED)) == 0;
155  int wheel = dduId - offsetFED - 2;
156  if (FED_ROSSummary1 && FED_ROSSummary2 && FED_ROSStatus && FED_EvLength && !fedNotReadout) {
157  TH2F* histoFEDSummary1 = FED_ROSSummary1->getTH2F();
158  TH2F* histoFEDSummary2 = FED_ROSSummary2->getTH2F(); // same for central FED...
159  TH2F* histoROSStatus = FED_ROSStatus->getTH2F();
160  TH1F* histoEvLength = FED_EvLength->getTH1F();
161 
162  int nFEDEvts = histoEvLength->Integral();
163  //if(dduId==FEDIDmin || dduId==FEDIDmax) nFEDEvts = nFEDEvts/2.; // split in 2 for external FEDs
164  if (!(nFEDEvts > 0))
165  continue;
166  int extraFEDevents1 = 0;
167  int extraFEDevents2 = 0;
168 
169  for (int urosNumber = 1; urosNumber <= DOCESLOTS; ++urosNumber) { // loop on the uROS
170  string urosNumber_s = to_string(urosNumber);
171  // Get the event length plot for this uROS (used to count # of processed evts)
172  string fedUrosEvLenName = "DT/00-DataIntegrity/FED" + dduId_s + "/uROS" + urosNumber_s + "/FED" + dduId_s +
173  "_uROS" + urosNumber_s + "_EventLength";
174  MonitorElement* FED_uROS_EvLength = igetter.get(fedUrosEvLenName);
175  TH1F* histoUrosEvLength = FED_uROS_EvLength->getTH1F();
176  int nFEDEvtsUros = histoUrosEvLength->Integral();
177 
178  //station 4 sectors drievn by uROS 1 & 2
179  if (urosNumber == 1) {
180  extraFEDevents1 = nFEDEvtsUros;
181  continue;
182  }
183  if (urosNumber == 2) {
184  extraFEDevents2 = nFEDEvtsUros;
185  continue;
186  }
187 
188  if (nFEDEvtsUros > 0) { //this uROS is active
189  nFEDEvtsUros = extraFEDevents1 + extraFEDevents2 + nFEDEvtsUros / 3.; // split in 3 ROS
190  float nGErrors = histoROSStatus->Integral(1, 12, urosNumber, urosNumber); //Only Global Errors,
191  //not possible to distinguish which ROS, so coumting them in the 3/12 ROSes
192 
193  int ros = getROS(urosNumber, 0);
194  for (int iros = ros; iros < (ros + 3); ++iros) {
195  // -1,0,+1 wheels
196  float nROBErrors1 = histoFEDSummary1->Integral(1, 5, iros, iros); //Errors and Not OK Flag
197  float nErrors1 = nROBErrors1 + nGErrors;
198  float result1 = 0.;
199  if (nFEDEvtsUros != 0)
200  result1 = max((float)0., ((float)nFEDEvtsUros - nROBErrors1) / (float)nFEDEvtsUros);
201  summaryHisto->setBinContent(iros, wheel + 3, result1);
202  double tdcResult1 = -2;
203  float nTDCErrors1 = histoFEDSummary1->Integral(6, 6, iros, iros); //Only TDC fatal considered
204  if (nTDCErrors1 == 0) { // no errors
205  tdcResult1 = 0.5;
206  } else { // there are errors
207  tdcResult1 = 2.5;
208  }
209  summaryTDCHisto->setBinContent(iros, wheel + 3, tdcResult1);
210 
211  // FIXME: different errors should have different weights
212  float sectPerc1 = 0.;
213  if (nFEDEvtsUros != 0)
214  sectPerc1 = max((float)0., ((float)nFEDEvtsUros - nErrors1) / (float)nFEDEvtsUros);
215  glbSummaryHisto->setBinContent(iros, wheel + 3, sectPerc1);
216  if (dduId == (FEDIDmax - 1))
217  continue; //wheel 0 case
218 
219  // -2,+2 wheels
220  float nROBErrors2 = histoFEDSummary2->Integral(1, 5, iros, iros); //Errors and Not OK Flag
221  float nErrors2 = nROBErrors2 + nGErrors;
222  float result2 = 0.;
223  if (nFEDEvtsUros != 0)
224  result2 = max((float)0., ((float)nFEDEvtsUros - nROBErrors2) / (float)nFEDEvtsUros);
225  summaryHisto->setBinContent(iros, wheel * 2 + 3, result2);
226 
227  double tdcResult2 = -2;
228  float nTDCErrors2 = histoFEDSummary2->Integral(6, 6, iros, iros); //Only TDC fatal considered
229  if (nTDCErrors2 == 0) { // no errors
230  tdcResult2 = 0.5;
231  } else { // there are errors
232  tdcResult2 = 2.5;
233  }
234  summaryTDCHisto->setBinContent(iros, wheel * 2 + 3, tdcResult2);
235 
236  // FIXME: different errors should have different weights
237  float sectPerc2 = 0.;
238  if (nFEDEvtsUros != 0)
239  sectPerc2 = max((float)0., ((float)nFEDEvtsUros - nErrors2) / (float)nFEDEvtsUros);
240  glbSummaryHisto->setBinContent(iros, wheel * 2 + 3, sectPerc2);
241  } //loop in three ros
242  } // this uROS is active
243  } //loop on uros
244  } else { // no data in this FED: it is off, no ROS suummary/status or evLength and fedNotReadout
245  for (int i = 1; i <= DOCESLOTS; ++i) {
246  summaryHisto->setBinContent(i, wheel + 3, 0.5);
247  summaryTDCHisto->setBinContent(i, wheel + 3, 1.5);
248  glbSummaryHisto->setBinContent(i, wheel + 3, 0.5);
249  if (dduId == (FEDIDmax - 1))
250  continue; //wheel 0 case
251  summaryHisto->setBinContent(i, wheel * 2 + 3, 0.5);
252  summaryTDCHisto->setBinContent(i, wheel * 2 + 3, 1.5);
253  glbSummaryHisto->setBinContent(i, wheel * 2 + 3, 0.5);
254  } //loop on uros
255  } // no data in this FED: it is off, no ROS suummary/status or evLength
256 
257  } //FEDentry
258  } else { //legacy case
259  if (hFEDEntry && hFEDFatal && hFEDNonFatal) {
260  if (FED_ROSSummary && FED_ROSStatus && FED_EvLength) {
261  TH2F* histoFEDSummary = FED_ROSSummary->getTH2F();
262  TH2F* histoROSStatus = FED_ROSStatus->getTH2F();
263  TH1F* histoEvLength = FED_EvLength->getTH1F();
264  // Check that the FED is in the ReadOut using the FEDIntegrity histos
265  bool fedNotReadout =
266  (hFEDEntry->getBinContent(dduId - 769) == 0 && hFEDFatal->getBinContent(dduId - 769) == 0 &&
267  hFEDNonFatal->getBinContent(dduId - 769) == 0);
268 
269  int nFEDEvts = histoEvLength->Integral();
270  for (int rosNumber = 1; rosNumber <= 12; ++rosNumber) { // loop on the ROS
271  int wheelNumber, sectorNumber;
272  if (!readOutToGeometry(dduId, rosNumber, wheelNumber, sectorNumber)) {
273  float nErrors = histoFEDSummary->Integral(1, 14, rosNumber, rosNumber);
274  float nROBErrors = histoROSStatus->Integral(2, 8, rosNumber, rosNumber);
275  nErrors += nROBErrors;
276  float result = 0.;
277  if (nFEDEvts != 0)
278  result = max((float)0., ((float)nFEDEvts - nROBErrors) / (float)nFEDEvts);
279  summaryHisto->setBinContent(sectorNumber, wheelNumber + 3, result);
280  int tdcResult = -2;
281  float nTDCErrors = histoFEDSummary->Integral(15, 15, rosNumber, rosNumber);
282  if (nTDCErrors == 0) { // no errors
283  tdcResult = 0;
284  } else { // there are errors
285  tdcResult = 2;
286  }
287  summaryTDCHisto->setBinContent(sectorNumber, wheelNumber + 3, tdcResult);
288  // FIXME: different errors should have different weights
289  float sectPerc = max((float)0., ((float)nFEDEvts - nErrors) / (float)nFEDEvts);
290  glbSummaryHisto->setBinContent(sectorNumber, wheelNumber + 3, sectPerc);
291 
292  if (fedNotReadout) {
293  // no data in this FED: it is off
294  summaryHisto->setBinContent(sectorNumber, wheelNumber + 3, 0);
295  summaryTDCHisto->setBinContent(sectorNumber, wheelNumber + 3, 1);
296  glbSummaryHisto->setBinContent(sectorNumber, wheelNumber + 3, 0);
297  } //fedNotReadout
298  } //mapping
299  } //loop on ros
300  } else { // no data in this FED: it is off, no ROS suummary/status or evLength
301  for (int rosNumber = 1; rosNumber <= 12; ++rosNumber) {
302  int wheelNumber, sectorNumber;
303  if (!readOutToGeometry(dduId, rosNumber, wheelNumber, sectorNumber)) {
304  summaryHisto->setBinContent(sectorNumber, wheelNumber + 3, 0);
305  summaryTDCHisto->setBinContent(sectorNumber, wheelNumber + 3, 1);
306  glbSummaryHisto->setBinContent(sectorNumber, wheelNumber + 3, 0);
307  } //mapping
308  } //loop on ros
309  } // no data in this FED: it is off, no ROS suummary/status or evLength
310 
311  } // no FED entry, fatal, nonfatal
312 
313  } //legacy case
314 
315  } // loop on dduIds
316 }
virtual TH2F * getTH2F() const
virtual TH1F * getTH1F() const
MonitorElement * summaryTDCHisto
MonitorElement * glbSummaryHisto
static const int DOCESLOTS
def wheelNumber(wheell)
Definition: plotscripts.py:47
virtual double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * summaryHisto
#define LogTrace(id)
int readOutToGeometry(int dduId, int rosNumber, int &wheel, int &sector)
edm::ESHandle< DTReadOutMapping > mapping
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
int getROS(int uROS, int link)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
string DTDataIntegrityTest::getMEName ( std::string  histoType,
int  FEDId 
)
protected

Get the ME name.

Definition at line 322 of file DTDataIntegrityTest.cc.

References ALCARECODTCalibSynchCosmicsDQM_cff::folderName, and HltBtagPostValidation_cff::histoName.

322  {
323  //Use the DDU name to find the ME
324  stringstream dduID_s;
325  dduID_s << FEDId;
326 
327  string folderName = "DT/00-DataIntegrity/FED" + dduID_s.str();
328 
329  string histoName = folderName + "/FED" + dduID_s.str() + "_" + histoType;
330  return histoName;
331 }
int DTDataIntegrityTest::getROS ( int  uROS,
int  link 
)
private

Definition at line 346 of file DTDataIntegrityTest.cc.

Referenced by dqmEndLuminosityBlock().

346  {
347  int slot = 0;
348  switch (uROS) {
349  case 1: {
350  slot = 5;
351  break;
352  }
353  case 2: {
354  slot = 11;
355  break;
356  }
357  case 3: {
358  slot = 1;
359  break;
360  }
361  case 4: {
362  slot = 7;
363  break;
364  }
365  case 5: {
366  slot = 2;
367  break;
368  }
369  case 6: {
370  slot = 8;
371  break;
372  }
373  case 9: {
374  slot = 9;
375  break;
376  }
377  case 10: {
378  slot = 3;
379  break;
380  }
381  case 11: {
382  slot = 10;
383  break;
384  }
385  case 12: {
386  slot = 4;
387  break;
388  }
389  }
390 
391  if (slot % 6 == 5)
392  return link + 1;
393 
394  int ros = (link / 24) + 3 * (slot % 6) - 2;
395  return ros;
396 }
int DTDataIntegrityTest::readOutToGeometry ( int  dduId,
int  rosNumber,
int &  wheel,
int &  sector 
)
private

Definition at line 341 of file DTDataIntegrityTest.cc.

References mapping, and DTReadOutMapping::readOutToGeometry().

Referenced by dqmEndLuminosityBlock().

341  {
342  int dummy;
343  return mapping->readOutToGeometry(dduId, ros, 2, 2, 2, wheel, dummy, sector, dummy, dummy, dummy);
344 }
int readOutToGeometry(int dduId, int rosId, int robId, int tdcId, int channelId, DTWireId &wireId) const
transform identifiers
edm::ESHandle< DTReadOutMapping > mapping

Member Data Documentation

bool DTDataIntegrityTest::bookingdone
private

Definition at line 71 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock(), and DTDataIntegrityTest().

bool DTDataIntegrityTest::checkUros
private

Definition at line 61 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock(), and DTDataIntegrityTest().

int DTDataIntegrityTest::counter
private

Definition at line 64 of file DTDataIntegrityTest.h.

Referenced by counter.Counters::__getitem__().

std::map<std::string, std::map<int, MonitorElement *> > DTDataIntegrityTest::dduHistos
private

Definition at line 76 of file DTDataIntegrityTest.h.

std::map<std::string, std::map<int, std::vector<MonitorElement *> > > DTDataIntegrityTest::dduVectorHistos
private

Definition at line 77 of file DTDataIntegrityTest.h.

std::map<std::string, std::map<int, MonitorElement *> > DTDataIntegrityTest::fedHistos
private

Definition at line 79 of file DTDataIntegrityTest.h.

std::map<std::string, std::map<int, std::vector<MonitorElement *> > > DTDataIntegrityTest::fedVectorHistos
private

Definition at line 80 of file DTDataIntegrityTest.h.

MonitorElement* DTDataIntegrityTest::glbSummaryHisto
private

Definition at line 84 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock().

edm::ESHandle<DTReadOutMapping> DTDataIntegrityTest::mapping
private

Definition at line 73 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock(), and readOutToGeometry().

int DTDataIntegrityTest::nevents
private

Definition at line 66 of file DTDataIntegrityTest.h.

unsigned int DTDataIntegrityTest::nLumiSegs
private

Definition at line 67 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock().

int DTDataIntegrityTest::nupdates
private

Definition at line 55 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock(), and ~DTDataIntegrityTest().

int DTDataIntegrityTest::prescaleFactor
private

Definition at line 58 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock(), and DTDataIntegrityTest().

int DTDataIntegrityTest::run
private
MonitorElement* DTDataIntegrityTest::summaryHisto
private

Definition at line 82 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock().

MonitorElement* DTDataIntegrityTest::summaryTDCHisto
private

Definition at line 83 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock().