CMS 3D CMS Logo

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

#include <DTSegmentAnalysisTest.h>

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

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void bookHistos (DQMStore::IBooker &)
 
 DTSegmentAnalysisTest (const edm::ParameterSet &ps)
 Constructor. More...
 
std::string getMEName (const DTChamberId &chID, std::string histoTag)
 Get the ME name. More...
 
void performClientDiagnostic (DQMStore::IGetter &)
 Perform client diagnostic operations. More...
 
 ~DTSegmentAnalysisTest () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester ()
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 dqmBeginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &)
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Private Attributes

bool bookingdone
 
std::map< std::pair< int, int >, MonitorElement * > chi2Histos
 
bool detailedAnalysis
 
int maxPhiHit
 
int maxPhiZHit
 
const DTGeometrymuonGeom
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordmuonGeomToken_
 
int nLSs
 
unsigned int nLumiSegs
 
int nMinEvts
 
edm::ParameterSet parameters
 
bool runOnline
 
std::map< std::pair< int, int >, MonitorElement * > segmRecHitHistos
 
std::map< int, MonitorElement * > summaryHistos
 
std::string topHistoFolder
 

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
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 40 of file DTSegmentAnalysisTest.h.

Constructor & Destructor Documentation

◆ DTSegmentAnalysisTest()

DTSegmentAnalysisTest::DTSegmentAnalysisTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 38 of file DTSegmentAnalysisTest.cc.

39  : muonGeomToken_(esConsumes<edm::Transition::BeginRun>()) {
40  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest") << "[DTSegmentAnalysisTest]: Constructor";
41  parameters = ps;
42 
43  // get the cfi parameters
44  detailedAnalysis = parameters.getUntrackedParameter<bool>("detailedAnalysis", false);
45  runOnline = parameters.getUntrackedParameter<bool>("runOnline", true);
46  // top folder for the histograms in DQMStore
47  topHistoFolder = ps.getUntrackedParameter<string>("topHistoFolder", "DT/02-Segments");
48  nMinEvts = ps.getUntrackedParameter<int>("nEventsCert", 5000);
49  maxPhiHit = ps.getUntrackedParameter<int>("maxPhiHit", 7);
50  maxPhiZHit = ps.getUntrackedParameter<int>("maxPhiZHit", 11);
51 
52  nLSs = 0;
53 
54  bookingdone = false;
55 }

References bookingdone, detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), LogTrace, maxPhiHit, maxPhiZHit, nLSs, nMinEvts, parameters, runOnline, and topHistoFolder.

◆ ~DTSegmentAnalysisTest()

DTSegmentAnalysisTest::~DTSegmentAnalysisTest ( )
override

Destructor.

Definition at line 57 of file DTSegmentAnalysisTest.cc.

57  {
58  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest") << "DTSegmentAnalysisTest: analyzed " << nLSs << " LS";
59 }

References LogTrace, and nLSs.

Member Function Documentation

◆ beginRun()

void DTSegmentAnalysisTest::beginRun ( const edm::Run run,
const edm::EventSetup context 
)
override

Definition at line 61 of file DTSegmentAnalysisTest.cc.

61  {
62  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest") << "[DTSegmentAnalysisTest]: BeginRun";
63  muonGeom = &context.getData(muonGeomToken_);
64 }

References visDQMUpload::context, LogTrace, muonGeom, and muonGeomToken_.

◆ bookHistos()

void DTSegmentAnalysisTest::bookHistos ( DQMStore::IBooker ibooker)

Definition at line 260 of file DTSegmentAnalysisTest.cc.

260  {
261  for (int wh = -2; wh <= 2; wh++) {
262  stringstream wheel;
263  wheel << wh;
264  string histoName = "segmentSummary_W" + wheel.str();
265 
267 
268  summaryHistos[wh] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 12, 1, 13, 4, 1, 5);
269  summaryHistos[wh]->setAxisTitle("Sector", 1);
270  summaryHistos[wh]->setBinLabel(1, "MB1", 2);
271  summaryHistos[wh]->setBinLabel(2, "MB2", 2);
272  summaryHistos[wh]->setBinLabel(3, "MB3", 2);
273  summaryHistos[wh]->setBinLabel(4, "MB4", 2);
274 
275  if (detailedAnalysis) {
276  for (int sect = 1; sect <= 14; sect++) {
277  stringstream sector;
278  sector << sect;
279  string chi2HistoName = "chi2BadSegmPercentual_W" + wheel.str() + "_Sec" + sector.str();
280  ibooker.setCurrentFolder(topHistoFolder + "/Wheel" + wheel.str() + "/Tests");
281  chi2Histos[make_pair(wh, sect)] = ibooker.book1D(chi2HistoName.c_str(), chi2HistoName.c_str(), 4, 1, 5);
282  chi2Histos[make_pair(wh, sect)]->setBinLabel(1, "MB1");
283  chi2Histos[make_pair(wh, sect)]->setBinLabel(2, "MB2");
284  chi2Histos[make_pair(wh, sect)]->setBinLabel(3, "MB3");
285  chi2Histos[make_pair(wh, sect)]->setBinLabel(4, "MB4");
286 
287  string segmHistoName = "residualsOnSegmRecHitNumber_W" + wheel.str() + "_Sec" + sector.str();
288  segmRecHitHistos[make_pair(wh, sect)] = ibooker.book1D(segmHistoName.c_str(), segmHistoName.c_str(), 4, 1, 5);
289  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(1, "MB1");
290  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(2, "MB2");
291  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(3, "MB3");
292  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(4, "MB4");
293  }
294  }
295  }
296 
297  string histoName = "segmentSummary";
298 
300 
301  summaryHistos[3] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 12, 1, 13, 5, -2, 3);
302  summaryHistos[3]->setAxisTitle("Sector", 1);
303  summaryHistos[3]->setAxisTitle("Wheel", 2);
304 
305  summaryHistos[4] = ibooker.book2D("SegmentGlbSummary", histoName.c_str(), 12, 1, 13, 5, -2, 3);
306  summaryHistos[4]->setAxisTitle("Sector", 1);
307  summaryHistos[4]->setAxisTitle("Wheel", 2);
308 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), chi2Histos, detailedAnalysis, HltBtagPostValidation_cff::histoName, segmRecHitHistos, dqm::implementation::NavigatorBase::setCurrentFolder(), summaryHistos, topHistoFolder, and makeMuonMisalignmentScenario::wheel.

Referenced by dqmEndLuminosityBlock().

◆ dqmBeginLuminosityBlock()

void DTSegmentAnalysisTest::dqmBeginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &   
)
protected

Definition at line 66 of file DTSegmentAnalysisTest.cc.

66  {
67  nLSs++;
68  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
69  << "DTSegmentAnalysisTest: analyzing LS" << lumiSeg.id().luminosityBlock() << " of " << nLSs << endl;
70 }

References edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), and nLSs.

◆ dqmEndJob()

void DTSegmentAnalysisTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 94 of file DTSegmentAnalysisTest.cc.

94  {
95  if (!runOnline) {
96  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
97  << "[DTSegmentAnalysisTest]: endJob. Client called in offline mode , perform DQM client operation";
98 
99  performClientDiagnostic(igetter);
100  }
101 }

References LogTrace, performClientDiagnostic(), and runOnline.

◆ dqmEndLuminosityBlock()

void DTSegmentAnalysisTest::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 72 of file DTSegmentAnalysisTest.cc.

75  {
76  // book the histos
77 
78  if (!bookingdone)
79  bookHistos(ibooker);
80  bookingdone = true;
81 
82  // counts number of lumiSegs
83  nLumiSegs = lumiSeg.id().luminosityBlock();
84 
85  if (runOnline) {
86  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
87  << "[DTSegmentAnalysisTest]: End of LS " << nLumiSegs
88  << ". Client called in online mode , perform DQM client operation";
89 
90  performClientDiagnostic(igetter);
91  }
92 }

References bookHistos(), bookingdone, edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), nLumiSegs, performClientDiagnostic(), and runOnline.

◆ getMEName()

string DTSegmentAnalysisTest::getMEName ( const DTChamberId chID,
std::string  histoTag 
)

Get the ME name.

Definition at line 241 of file DTSegmentAnalysisTest.cc.

241  {
242  stringstream wheel;
243  wheel << chID.wheel();
244  stringstream station;
245  station << chID.station();
246  stringstream sector;
247  sector << chID.sector();
248 
249  string folderName =
250  topHistoFolder + "/Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() + "/";
251 
252  string histoname = folderName + histoTag + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str();
253 
254  if (histoTag == "numberOfSegments")
255  histoname = topHistoFolder + "/Wheel" + wheel.str() + "/" + histoTag + +"_W" + wheel.str();
256 
257  return histoname;
258 }

References ALCARECODTCalibSynchCosmicsDQM_cff::folderName, dtResolutionTest_cfi::histoTag, DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, topHistoFolder, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by performClientDiagnostic().

◆ performClientDiagnostic()

void DTSegmentAnalysisTest::performClientDiagnostic ( DQMStore::IGetter igetter)

Perform client diagnostic operations.

Definition at line 103 of file DTSegmentAnalysisTest.cc.

103  {
104  summaryHistos[3]->Reset();
105  summaryHistos[4]->Reset();
106  vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
107  vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
108 
109  for (; ch_it != ch_end; ++ch_it) {
110  DTChamberId chID = (*ch_it)->id();
111 
112  MonitorElement* hNHits = igetter.get(getMEName(chID, "h4DSegmNHits"));
113  MonitorElement* hSegmOcc = igetter.get(getMEName(chID, "numberOfSegments"));
114 
115  if (hNHits && hSegmOcc) {
116  TH1F* hNHits_root = hNHits->getTH1F();
117  TH2F* hSegmOcc_root = hSegmOcc->getTH2F();
118  TH2F* summary_histo_root = summaryHistos[3]->getTH2F();
119 
120  int sector = chID.sector();
121  if (sector == 13)
122  sector = 4;
123  if (sector == 14)
124  sector = 10;
125 
126  if ((chID.station() != 4 && hNHits_root->GetMaximumBin() < maxPhiZHit) ||
127  (chID.station() == 4 && hNHits_root->GetMaximumBin() < maxPhiHit)) {
128  summaryHistos[chID.wheel()]->setBinContent(sector, chID.station(), 1);
129  if (summary_histo_root->GetBinContent(sector, chID.wheel() + 3) < 1)
130  summaryHistos[3]->setBinContent(sector, chID.wheel() + 3, 1);
131  } else
132  summaryHistos[chID.wheel()]->setBinContent(sector, chID.station(), 0);
133 
134  if (detailedAnalysis) {
135  if (chID.station() != 4)
136  segmRecHitHistos[make_pair(chID.wheel(), chID.sector())]->Fill(chID.station(),
137  abs(12 - hNHits_root->GetMaximumBin()));
138  else
139  segmRecHitHistos[make_pair(chID.wheel(), chID.sector())]->Fill(chID.station(),
140  abs(8 - hNHits_root->GetMaximumBin()));
141  }
142 
143  TH2F* summary2_histo_root = summaryHistos[3]->getTH2F();
144  float weight = 0.001;
145  if (hSegmOcc_root->GetBinContent(sector, chID.station()) == 0) {
146  summaryHistos[chID.wheel()]->setBinContent(sector, chID.station(), 2);
147  if (summary2_histo_root->GetBinContent(sector, chID.wheel() + 3) < 2)
148  summaryHistos[3]->setBinContent(sector, chID.wheel() + 3, 2);
149  } else {
150  // Fill the percentage of segment occupancy
151  weight = 1. / 4.;
152  if ((sector == 4 || sector == 10) && chID.station() == 4)
153  weight = 1. / 8.;
154  }
155  summaryHistos[4]->Fill(sector, chID.wheel(), weight);
156  } else {
157  LogVerbatim("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
158  << "[DTSegmentAnalysisTest]: histos not found!!"; // FIXME
159  }
160 
161  if (detailedAnalysis) { // switch on detailed analysis
162 
163  //test on chi2 segment quality
164 
165  MonitorElement* chi2_histo = igetter.get(getMEName(chID, "h4DChi2"));
166  if (chi2_histo) {
167  TH1F* chi2_histo_root = chi2_histo->getTH1F();
168  double threshold = parameters.getUntrackedParameter<double>("chi2Threshold", 5);
169  double maximum = chi2_histo_root->GetXaxis()->GetXmax();
170  double minimum = chi2_histo_root->GetXaxis()->GetXmin();
171  int nbins = chi2_histo_root->GetXaxis()->GetNbins();
172  int thresholdBin = int(threshold / ((maximum - minimum) / nbins));
173 
174  double badSegments = 0;
175  for (int bin = thresholdBin; bin <= nbins; bin++) {
176  badSegments += chi2_histo_root->GetBinContent(bin);
177  }
178 
179  if (chi2_histo_root->GetEntries() != 0) {
180  double badSegmentsPercentual = badSegments / double(chi2_histo_root->GetEntries());
181  chi2Histos[make_pair(chID.wheel(), chID.sector())]->Fill(chID.station(), badSegmentsPercentual);
182  }
183  } else {
184  LogVerbatim("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
185  << "[DTSegmentAnalysisTest]: Histo: " << getMEName(chID, "h4DChi2") << " not found!" << endl;
186  }
187  } // end of switch for detailed analysis
188 
189  } //loop over all the chambers
190 
191  string nEvtsName = "DT/EventInfo/Counters/nProcessedEventsSegment";
192 
193  MonitorElement* meProcEvts = igetter.get(nEvtsName);
194 
195  if (meProcEvts) {
196  int nProcEvts = meProcEvts->getFloatValue();
197  summaryHistos[4]->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
198  } else {
199  summaryHistos[4]->setEntries(nMinEvts + 1);
200  LogVerbatim("DTDQM|DTMonitorClient|DTOccupancyTest")
201  << "[DTOccupancyTest] ME: " << nEvtsName << " not found!" << endl;
202  }
203 
204  if (detailedAnalysis) {
205  string chi2CriterionName = parameters.getUntrackedParameter<string>("chi2TestName", "chi2InRange");
206  for (map<pair<int, int>, MonitorElement*>::const_iterator histo = chi2Histos.begin(); histo != chi2Histos.end();
207  histo++) {
208  const QReport* theChi2QReport = (*histo).second->getQReport(chi2CriterionName);
209  if (theChi2QReport) {
210  vector<dqm::me_util::Channel> badChannels = theChi2QReport->getBadChannels();
211  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
212  channel++) {
213  LogError("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
214  << "Wheel: " << (*histo).first.first << " Sector: " << (*histo).first.second
215  << " Bad stations: " << (*channel).getBin() << " Contents : " << (*channel).getContents();
216  }
217  }
218  }
219 
220  string segmRecHitCriterionName =
221  parameters.getUntrackedParameter<string>("segmRecHitTestName", "segmRecHitInRange");
222  for (map<pair<int, int>, MonitorElement*>::const_iterator histo = segmRecHitHistos.begin();
223  histo != segmRecHitHistos.end();
224  histo++) {
225  const QReport* theSegmRecHitQReport = (*histo).second->getQReport(segmRecHitCriterionName);
226  if (theSegmRecHitQReport) {
227  vector<dqm::me_util::Channel> badChannels = theSegmRecHitQReport->getBadChannels();
228  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
229  channel++) {
230  LogError("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
231  << "Wheel: " << (*histo).first.first << " Sector: " << (*histo).first.second
232  << " Bad stations on recHit number: " << (*channel).getBin()
233  << " Contents : " << (*channel).getContents();
234  }
235  }
236  }
237 
238  } // end of detailedAnalysis
239 }

References funct::abs(), newFWLiteAna::bin, DTGeometry::chambers(), chi2Histos, detailedAnalysis, HcalObjRepresent::Fill(), dqm::implementation::IGetter::get(), MonitorElementData::QReport::getBadChannels(), dqm::impl::MonitorElement::getFloatValue(), getMEName(), dqm::legacy::MonitorElement::getTH1F(), dqm::legacy::MonitorElement::getTH2F(), edm::ParameterSet::getUntrackedParameter(), timingPdfMaker::histo, createfilelist::int, genParticles_cff::map, maxPhiHit, maxPhiZHit, muonGeom, LaserClient_cfi::nbins, nMinEvts, parameters, DTChamberId::sector(), segmRecHitHistos, DTChamberId::station(), summaryHistos, remoteMonitoring_LED_IterMethod_cfg::threshold, mps_merge::weight, and DTChamberId::wheel().

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

Member Data Documentation

◆ bookingdone

bool DTSegmentAnalysisTest::bookingdone
private

Definition at line 79 of file DTSegmentAnalysisTest.h.

Referenced by dqmEndLuminosityBlock(), and DTSegmentAnalysisTest().

◆ chi2Histos

std::map<std::pair<int, int>, MonitorElement *> DTSegmentAnalysisTest::chi2Histos
private

Definition at line 86 of file DTSegmentAnalysisTest.h.

Referenced by bookHistos(), and performClientDiagnostic().

◆ detailedAnalysis

bool DTSegmentAnalysisTest::detailedAnalysis
private

◆ maxPhiHit

int DTSegmentAnalysisTest::maxPhiHit
private

Definition at line 74 of file DTSegmentAnalysisTest.h.

Referenced by DTSegmentAnalysisTest(), and performClientDiagnostic().

◆ maxPhiZHit

int DTSegmentAnalysisTest::maxPhiZHit
private

Definition at line 75 of file DTSegmentAnalysisTest.h.

Referenced by DTSegmentAnalysisTest(), and performClientDiagnostic().

◆ muonGeom

const DTGeometry* DTSegmentAnalysisTest::muonGeom
private

Definition at line 83 of file DTSegmentAnalysisTest.h.

Referenced by beginRun(), and performClientDiagnostic().

◆ muonGeomToken_

edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTSegmentAnalysisTest::muonGeomToken_
private

Definition at line 82 of file DTSegmentAnalysisTest.h.

Referenced by beginRun().

◆ nLSs

int DTSegmentAnalysisTest::nLSs
private

◆ nLumiSegs

unsigned int DTSegmentAnalysisTest::nLumiSegs
private

Definition at line 69 of file DTSegmentAnalysisTest.h.

Referenced by dqmEndLuminosityBlock().

◆ nMinEvts

int DTSegmentAnalysisTest::nMinEvts
private

Definition at line 72 of file DTSegmentAnalysisTest.h.

Referenced by DTSegmentAnalysisTest(), and performClientDiagnostic().

◆ parameters

edm::ParameterSet DTSegmentAnalysisTest::parameters
private

Definition at line 81 of file DTSegmentAnalysisTest.h.

Referenced by DTSegmentAnalysisTest(), and performClientDiagnostic().

◆ runOnline

bool DTSegmentAnalysisTest::runOnline
private

Definition at line 77 of file DTSegmentAnalysisTest.h.

Referenced by dqmEndJob(), dqmEndLuminosityBlock(), and DTSegmentAnalysisTest().

◆ segmRecHitHistos

std::map<std::pair<int, int>, MonitorElement *> DTSegmentAnalysisTest::segmRecHitHistos
private

Definition at line 87 of file DTSegmentAnalysisTest.h.

Referenced by bookHistos(), and performClientDiagnostic().

◆ summaryHistos

std::map<int, MonitorElement *> DTSegmentAnalysisTest::summaryHistos
private

Definition at line 88 of file DTSegmentAnalysisTest.h.

Referenced by bookHistos(), and performClientDiagnostic().

◆ topHistoFolder

std::string DTSegmentAnalysisTest::topHistoFolder
private

Definition at line 90 of file DTSegmentAnalysisTest.h.

Referenced by bookHistos(), DTSegmentAnalysisTest(), and getMEName().

DTSegmentAnalysisTest::muonGeomToken_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
Definition: DTSegmentAnalysisTest.h:82
DTSegmentAnalysisTest::muonGeom
const DTGeometry * muonGeom
Definition: DTSegmentAnalysisTest.h:83
relativeConstraints.station
station
Definition: relativeConstraints.py:67
mps_merge.weight
weight
Definition: mps_merge.py:88
DTSegmentAnalysisTest::maxPhiHit
int maxPhiHit
Definition: DTSegmentAnalysisTest.h:74
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:278
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
DTSegmentAnalysisTest::chi2Histos
std::map< std::pair< int, int >, MonitorElement * > chi2Histos
Definition: DTSegmentAnalysisTest.h:86
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DTSegmentAnalysisTest::bookHistos
void bookHistos(DQMStore::IBooker &)
Definition: DTSegmentAnalysisTest.cc:260
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:479
DTSegmentAnalysisTest::maxPhiZHit
int maxPhiZHit
Definition: DTSegmentAnalysisTest.h:75
DTSegmentAnalysisTest::nLumiSegs
unsigned int nLumiSegs
Definition: DTSegmentAnalysisTest.h:69
visDQMUpload.context
context
Definition: visDQMUpload.py:37
DTSegmentAnalysisTest::segmRecHitHistos
std::map< std::pair< int, int >, MonitorElement * > segmRecHitHistos
Definition: DTSegmentAnalysisTest.h:87
DTGeometry::chambers
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
MonitorElementData::QReport::getBadChannels
const std::vector< DQMChannel > & getBadChannels() const
Definition: MonitorElementCollection.h:116
DTSegmentAnalysisTest::detailedAnalysis
bool detailedAnalysis
Definition: DTSegmentAnalysisTest.h:71
DTSegmentAnalysisTest::nMinEvts
int nMinEvts
Definition: DTSegmentAnalysisTest.h:72
DTSegmentAnalysisTest::summaryHistos
std::map< int, MonitorElement * > summaryHistos
Definition: DTSegmentAnalysisTest.h:88
dqm::impl::MonitorElement::getFloatValue
virtual double getFloatValue() const
Definition: MonitorElement.cc:920
DTSegmentAnalysisTest::topHistoFolder
std::string topHistoFolder
Definition: DTSegmentAnalysisTest.h:90
DTSegmentAnalysisTest::nLSs
int nLSs
Definition: DTSegmentAnalysisTest.h:68
dtResolutionTest_cfi.histoTag
histoTag
Definition: dtResolutionTest_cfi.py:21
MonitorElementData::QReport
Definition: MonitorElementCollection.h:55
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
createfilelist.int
int
Definition: createfilelist.py:10
DTSegmentAnalysisTest::bookingdone
bool bookingdone
Definition: DTSegmentAnalysisTest.h:79
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
ALCARECODTCalibSynchCosmicsDQM_cff.folderName
folderName
Definition: ALCARECODTCalibSynchCosmicsDQM_cff.py:9
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
DTSegmentAnalysisTest::performClientDiagnostic
void performClientDiagnostic(DQMStore::IGetter &)
Perform client diagnostic operations.
Definition: DTSegmentAnalysisTest.cc:103
HltBtagPostValidation_cff.histoName
histoName
Definition: HltBtagPostValidation_cff.py:17
DTSegmentAnalysisTest::runOnline
bool runOnline
Definition: DTSegmentAnalysisTest.h:77
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
genParticles_cff.map
map
Definition: genParticles_cff.py:11
DTChamberId
Definition: DTChamberId.h:14
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
DTSegmentAnalysisTest::getMEName
std::string getMEName(const DTChamberId &chID, std::string histoTag)
Get the ME name.
Definition: DTSegmentAnalysisTest.cc:241
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
DTSegmentAnalysisTest::parameters
edm::ParameterSet parameters
Definition: DTSegmentAnalysisTest.h:81
weight
Definition: weight.py:1
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:491