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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 () 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
 
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)
 
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::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 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 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 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 30 of file DTDataIntegrityTest.cc.

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

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

Destructor.

Definition at line 44 of file DTDataIntegrityTest.cc.

References LogTrace, and nupdates.

44  {
45 
46  LogTrace ("DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest") << "DataIntegrityTest: analyzed " << nupdates << " updates";
47 
48 }
#define LogTrace(id)

Member Function Documentation

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

Book the MEs.

Definition at line 215 of file DTDataIntegrityTest.cc.

References DQMStore::IBooker::setCurrentFolder().

215  {
216  stringstream dduId_s; dduId_s << dduId;
217 
218  ibooker.setCurrentFolder("DT/00-DataIntegrity/FED" + dduId_s.str());
219  string histoName;
220 
221 }
void DTDataIntegrityTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 200 of file DTDataIntegrityTest.cc.

References LogTrace.

200  {
201 
202  LogTrace ("DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest") <<"[DTDataIntegrityTest] endjob called!";
203 }
#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 50 of file DTDataIntegrityTest.cc.

References DQMStore::IBooker::book2D(), bookingdone, checkUros, edm::EventSetup::get(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getTH1F(), MonitorElement::getTH2F(), glbSummaryHisto, 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, MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), DQMStore::IBooker::setCurrentFolder(), summaryHisto, summaryTDCHisto, and plotscripts::wheelNumber().

51  {
52 
53 
54  if (!bookingdone) {
55 
56  //nSTAEvents = 0;
57  nupdates = 0;
58  run=0;
59 
60  // book the summary histogram
61 
62  ibooker.setCurrentFolder("DT/00-DataIntegrity");
63 
64  summaryHisto = ibooker.book2D("DataIntegritySummary","Summary Data Integrity",12,1,13,5,-2,3);
65  summaryHisto->setAxisTitle("Sector",1);
66  summaryHisto->setAxisTitle("Wheel",2);
67 
68  ibooker.setCurrentFolder("DT/00-DataIntegrity");
69 
70  summaryTDCHisto = ibooker.book2D("DataIntegrityTDCSummary","TDC Summary Data Integrity",12,1,13,5,-2,3);
71  summaryTDCHisto->setAxisTitle("Sector",1);
72  summaryTDCHisto->setAxisTitle("Wheel",2);
73 
74  ibooker.setCurrentFolder("DT/00-DataIntegrity");
75 
76  glbSummaryHisto = ibooker.book2D("DataIntegrityGlbSummary","Summary Data Integrity",12,1,13,5,-2,3);
77  glbSummaryHisto->setAxisTitle("Sector",1);
78  glbSummaryHisto->setAxisTitle("Wheel",2);
79 
80  context.get<DTReadOutMappingRcd>().get(mapping);
81 
82  }
83  bookingdone = true;
84 
85 
86  // counts number of lumiSegs
87  nLumiSegs = lumiSeg.id().luminosityBlock();
88  stringstream nLumiSegs_s; nLumiSegs_s << nLumiSegs;
89 
90  // prescale factor
91  if (nLumiSegs%prescaleFactor != 0) return;
92 
93  LogTrace ("DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest")
94  <<"[DTDataIntegrityTest]: End of LS " << nLumiSegs << ", performing client operations";
95 
96 
97  // counts number of updats
98  nupdates++;
99 
100 
101  //Counter for x bin in the timing histos
102  counter++;
103 
104  //Loop on FED id
105  //Monitoring only real used FEDs
106  int FEDIDmax=FEDNumbering::MAXDTFEDID;
107  int FEDIDmin=FEDNumbering::MINDTFEDID;
108  if (checkUros){
111  }
112  for (int dduId=FEDIDmin; dduId<=FEDIDmax; ++dduId){
113  LogTrace ("DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest")
114  <<"[DTDataIntegrityTest]:FED Id: "<<dduId;
115 
116  //Each nTimeBin onUpdate remove timing histos and book a new bunch of them
117  stringstream dduId_s; dduId_s << dduId;
118 
119  string histoType;
120 
121  //Check if the list of ROS is compatible with the channels enabled
122  string rosStatusName = "DT/00-DataIntegrity/FED" + dduId_s.str() + "/FED" + dduId_s.str() + "_ROSStatus";
123  if (checkUros) rosStatusName = "DT/00-DataIntegrity/FED" + dduId_s.str() + "/FED" + dduId_s.str() + "_uROSStatus";
124  MonitorElement * FED_ROSStatus = igetter.get(rosStatusName);
125 
126  // Get the error summary histo
127  string fedSummaryName = "DT/00-DataIntegrity/FED" + dduId_s.str() + "_ROSSummary";
128  if (checkUros) fedSummaryName = "DT/00-DataIntegrity/FED" + dduId_s.str() + "_uROSSummary";
129  MonitorElement * FED_ROSSummary = igetter.get(fedSummaryName);
130 
131  // Get the event lenght plot (used to count # of processed evts)
132  string fedEvLenName = "DT/00-DataIntegrity/FED" + dduId_s.str() + "/FED" + dduId_s.str() + "_EventLenght";
133  MonitorElement * FED_EvLenght = igetter.get(fedEvLenName);
134 
135  // Get the histos for FED integrity
136  string fedIntegrityFolder = "DT/00-DataIntegrity/";
137  MonitorElement * hFEDEntry = igetter.get(fedIntegrityFolder+"FEDEntries");
138  MonitorElement * hFEDFatal = igetter.get(fedIntegrityFolder+"FEDFatal");
139  MonitorElement * hFEDNonFatal = igetter.get(fedIntegrityFolder+"FEDNonFatal");
140 
141  if(hFEDEntry && hFEDFatal && hFEDNonFatal) {
142 
143  if(FED_ROSSummary && FED_ROSStatus && FED_EvLenght) {
144  TH2F * histoFEDSummary = FED_ROSSummary->getTH2F();
145  TH2F * histoROSStatus = FED_ROSStatus->getTH2F();
146  TH1F * histoEvLenght = FED_EvLenght->getTH1F();
147  // Check that the FED is in the ReadOut using the FEDIntegrity histos
148  bool fedNotReadout = (hFEDEntry->getBinContent(dduId-769) == 0 &&
149  hFEDFatal->getBinContent(dduId-769) == 0 &&
150  hFEDNonFatal->getBinContent(dduId-769) == 0);
151  int nFEDEvts = histoEvLenght->Integral();
152  for(int rosNumber = 1; rosNumber <= 12; ++rosNumber) { // loop on the ROS
153  int wheelNumber, sectorNumber;
154  if (!readOutToGeometry(dduId,rosNumber,wheelNumber,sectorNumber)) {
155  float nErrors = histoFEDSummary->Integral(1,14,rosNumber,rosNumber);
156  float nROBErrors = histoROSStatus->Integral(2,8,rosNumber,rosNumber);
157  nErrors += nROBErrors;
158  float result =0.;
159  if(nFEDEvts!=0)
160  result = max((float)0., ((float)nFEDEvts-nROBErrors)/(float)nFEDEvts);
161  summaryHisto->setBinContent(sectorNumber,wheelNumber+3,result);
162  int tdcResult = -2;
163  float nTDCErrors = histoFEDSummary->Integral(15,15,rosNumber,rosNumber);
164  if(nTDCErrors == 0) { // no errors
165  tdcResult = 0;
166  } else { // there are errors
167  tdcResult = 2;
168  }
169  summaryTDCHisto->setBinContent(sectorNumber,wheelNumber+3,tdcResult);
170  // FIXME: different errors should have different weights
171  float sectPerc = max((float)0., ((float)nFEDEvts-nErrors)/(float)nFEDEvts);
172  glbSummaryHisto->setBinContent(sectorNumber,wheelNumber+3,sectPerc);
173 
174  if(fedNotReadout) {
175  // no data in this FED: it is off
176  summaryHisto->setBinContent(sectorNumber,wheelNumber+3,0);
177  summaryTDCHisto->setBinContent(sectorNumber,wheelNumber+3,1);
178  glbSummaryHisto->setBinContent(sectorNumber,wheelNumber+3,0);
179  }
180  }
181  }
182 
183  } else { // no data in this FED: it is off
184  for(int rosNumber = 1; rosNumber <= 12; ++rosNumber) {
185  int wheelNumber, sectorNumber;
186  if (!readOutToGeometry(dduId,rosNumber,wheelNumber,sectorNumber)) {
187  summaryHisto->setBinContent(sectorNumber,wheelNumber+3,0);
188  summaryTDCHisto->setBinContent(sectorNumber,wheelNumber+3,1);
189  glbSummaryHisto->setBinContent(sectorNumber,wheelNumber+3,0);
190  }
191  }
192  }
193 
194  }
195 
196  }
197 
198 }
void setBinContent(int binx, double content)
set content of bin (1-D)
TH1F * getTH1F() const
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:307
MonitorElement * summaryTDCHisto
MonitorElement * glbSummaryHisto
def wheelNumber(wheell)
Definition: plotscripts.py:45
MonitorElement * summaryHisto
#define LogTrace(id)
TH2F * getTH2F() const
int readOutToGeometry(int dduId, int rosNumber, int &wheel, int &sector)
edm::ESHandle< DTReadOutMapping > mapping
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
double getBinContent(int binx) const
get content of bin (1-D)
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 205 of file DTDataIntegrityTest.cc.

205  {
206  //Use the DDU name to find the ME
207  stringstream dduID_s; dduID_s << FEDId;
208 
209  string folderName = "DT/00-DataIntegrity/FED" + dduID_s.str();
210 
211  string histoName = folderName + "/FED" + dduID_s.str() + "_" + histoType;
212  return histoName;
213 }
int DTDataIntegrityTest::readOutToGeometry ( int  dduId,
int  rosNumber,
int &  wheel,
int &  sector 
)
private

Definition at line 224 of file DTDataIntegrityTest.cc.

References mapping, and DTReadOutMapping::readOutToGeometry().

Referenced by dqmEndLuminosityBlock().

224  {
225 
226  int dummy;
227  return mapping->readOutToGeometry(dduId,ros,2,2,2,wheel,dummy,sector,dummy,dummy,dummy);
228 
229 }
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 72 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock(), and DTDataIntegrityTest().

bool DTDataIntegrityTest::checkUros
private

Definition at line 62 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock(), and DTDataIntegrityTest().

int DTDataIntegrityTest::counter
private

Definition at line 65 of file DTDataIntegrityTest.h.

Referenced by counter.Counters::__getitem__().

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

Definition at line 77 of file DTDataIntegrityTest.h.

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

Definition at line 78 of file DTDataIntegrityTest.h.

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

Definition at line 80 of file DTDataIntegrityTest.h.

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

Definition at line 81 of file DTDataIntegrityTest.h.

MonitorElement* DTDataIntegrityTest::glbSummaryHisto
private

Definition at line 85 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock().

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

Definition at line 74 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock(), and readOutToGeometry().

int DTDataIntegrityTest::nevents
private

Definition at line 67 of file DTDataIntegrityTest.h.

unsigned int DTDataIntegrityTest::nLumiSegs
private

Definition at line 68 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock().

int DTDataIntegrityTest::nupdates
private

Definition at line 56 of file DTDataIntegrityTest.h.

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

int DTDataIntegrityTest::prescaleFactor
private

Definition at line 59 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock(), and DTDataIntegrityTest().

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

Definition at line 83 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock().

MonitorElement* DTDataIntegrityTest::summaryTDCHisto
private

Definition at line 84 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock().