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::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTDataIntegrityTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTDataIntegrityTest ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) override final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void produce (edm::Event &, edm::EventSetup const &) override final
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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
 
int counter
 
std::map< std::string, std::map< int, MonitorElement * > > dduHistos
 
std::map< std::string, std::map< int, std::vector< MonitorElement * > > > dduVectorHistos
 
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
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)
 

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, 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  bookingdone = 0;
38 
39 }
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
DTDataIntegrityTest::~DTDataIntegrityTest ( )

Destructor.

Definition at line 42 of file DTDataIntegrityTest.cc.

References LogTrace, and nupdates.

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

Member Function Documentation

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

Book the MEs.

Definition at line 204 of file DTDataIntegrityTest.cc.

References DQMStore::IBooker::setCurrentFolder().

204  {
205  stringstream dduId_s; dduId_s << dduId;
206 
207  ibooker.setCurrentFolder("DT/00-DataIntegrity/FED" + dduId_s.str());
208  string histoName;
209 
210 }
void DTDataIntegrityTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 189 of file DTDataIntegrityTest.cc.

References LogTrace.

189  {
190 
191  LogTrace ("DTDQM|DTRawToDigi|DTMonitorClient|DTDataIntegrityTest") <<"[DTDataIntegrityTest] endjob called!";
192 }
#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 48 of file DTDataIntegrityTest.cc.

References DQMStore::IBooker::book2D(), bookingdone, edm::EventSetup::get(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getTH1F(), MonitorElement::getTH2F(), glbSummaryHisto, edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), mapping, hpstanc_transforms::max, FEDNumbering::MAXDTFEDID, FEDNumbering::MINDTFEDID, nLumiSegs, nupdates, prescaleFactor, readOutToGeometry(), mps_fire::result, run, MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), DQMStore::IBooker::setCurrentFolder(), summaryHisto, summaryTDCHisto, and plotscripts::wheelNumber().

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

194  {
195  //Use the DDU name to find the ME
196  stringstream dduID_s; dduID_s << FEDId;
197 
198  string folderName = "DT/00-DataIntegrity/FED" + dduID_s.str();
199 
200  string histoName = folderName + "/FED" + dduID_s.str() + "_" + histoType;
201  return histoName;
202 }
int DTDataIntegrityTest::readOutToGeometry ( int  dduId,
int  rosNumber,
int &  wheel,
int &  sector 
)
private

Definition at line 213 of file DTDataIntegrityTest.cc.

References mapping, and DTReadOutMapping::readOutToGeometry().

Referenced by dqmEndLuminosityBlock().

213  {
214 
215  int dummy;
216  return mapping->readOutToGeometry(dduId,ros,2,2,2,wheel,dummy,sector,dummy,dummy,dummy);
217 
218 }
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 70 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock(), and DTDataIntegrityTest().

int DTDataIntegrityTest::counter
private

Definition at line 63 of file DTDataIntegrityTest.h.

Referenced by counter.Counters::__getitem__().

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

Definition at line 75 of file DTDataIntegrityTest.h.

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

Definition at line 76 of file DTDataIntegrityTest.h.

MonitorElement* DTDataIntegrityTest::glbSummaryHisto
private

Definition at line 80 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock().

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

Definition at line 72 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock(), and readOutToGeometry().

int DTDataIntegrityTest::nevents
private

Definition at line 65 of file DTDataIntegrityTest.h.

unsigned int DTDataIntegrityTest::nLumiSegs
private

Definition at line 66 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 78 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock().

MonitorElement* DTDataIntegrityTest::summaryTDCHisto
private

Definition at line 79 of file DTDataIntegrityTest.h.

Referenced by dqmEndLuminosityBlock().