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 (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, 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::ESRecordsToProductResolverIndices 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<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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 39 of file DTSegmentAnalysisTest.h.

Constructor & Destructor Documentation

◆ DTSegmentAnalysisTest()

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

Constructor.

Definition at line 36 of file DTSegmentAnalysisTest.cc.

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

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

◆ ~DTSegmentAnalysisTest()

DTSegmentAnalysisTest::~DTSegmentAnalysisTest ( )
override

Destructor.

Definition at line 55 of file DTSegmentAnalysisTest.cc.

References LogTrace, and nLSs.

55  {
56  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest") << "DTSegmentAnalysisTest: analyzed " << nLSs << " LS";
57 }
#define LogTrace(id)

Member Function Documentation

◆ beginRun()

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

Definition at line 59 of file DTSegmentAnalysisTest.cc.

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

59  {
60  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest") << "[DTSegmentAnalysisTest]: BeginRun";
61  muonGeom = &context.getData(muonGeomToken_);
62 }
#define LogTrace(id)
const DTGeometry * muonGeom
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_

◆ bookHistos()

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

Definition at line 258 of file DTSegmentAnalysisTest.cc.

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

Referenced by dqmEndLuminosityBlock().

258  {
259  for (int wh = -2; wh <= 2; wh++) {
260  stringstream wheel;
261  wheel << wh;
262  string histoName = "segmentSummary_W" + wheel.str();
263 
265 
266  summaryHistos[wh] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 12, 1, 13, 4, 1, 5);
267  summaryHistos[wh]->setAxisTitle("Sector", 1);
268  summaryHistos[wh]->setBinLabel(1, "MB1", 2);
269  summaryHistos[wh]->setBinLabel(2, "MB2", 2);
270  summaryHistos[wh]->setBinLabel(3, "MB3", 2);
271  summaryHistos[wh]->setBinLabel(4, "MB4", 2);
272 
273  if (detailedAnalysis) {
274  for (int sect = 1; sect <= 14; sect++) {
275  stringstream sector;
276  sector << sect;
277  string chi2HistoName = "chi2BadSegmPercentual_W" + wheel.str() + "_Sec" + sector.str();
278  ibooker.setCurrentFolder(topHistoFolder + "/Wheel" + wheel.str() + "/Tests");
279  chi2Histos[make_pair(wh, sect)] = ibooker.book1D(chi2HistoName.c_str(), chi2HistoName.c_str(), 4, 1, 5);
280  chi2Histos[make_pair(wh, sect)]->setBinLabel(1, "MB1");
281  chi2Histos[make_pair(wh, sect)]->setBinLabel(2, "MB2");
282  chi2Histos[make_pair(wh, sect)]->setBinLabel(3, "MB3");
283  chi2Histos[make_pair(wh, sect)]->setBinLabel(4, "MB4");
284 
285  string segmHistoName = "residualsOnSegmRecHitNumber_W" + wheel.str() + "_Sec" + sector.str();
286  segmRecHitHistos[make_pair(wh, sect)] = ibooker.book1D(segmHistoName.c_str(), segmHistoName.c_str(), 4, 1, 5);
287  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(1, "MB1");
288  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(2, "MB2");
289  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(3, "MB3");
290  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(4, "MB4");
291  }
292  }
293  }
294 
295  string histoName = "segmentSummary";
296 
298 
299  summaryHistos[3] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 12, 1, 13, 5, -2, 3);
300  summaryHistos[3]->setAxisTitle("Sector", 1);
301  summaryHistos[3]->setAxisTitle("Wheel", 2);
302 
303  summaryHistos[4] = ibooker.book2D("SegmentGlbSummary", histoName.c_str(), 12, 1, 13, 5, -2, 3);
304  summaryHistos[4]->setAxisTitle("Sector", 1);
305  summaryHistos[4]->setAxisTitle("Wheel", 2);
306 }
std::map< std::pair< int, int >, MonitorElement * > chi2Histos
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::map< int, MonitorElement * > summaryHistos
std::map< std::pair< int, int >, MonitorElement * > segmRecHitHistos
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:212
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ dqmBeginLuminosityBlock()

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

Definition at line 64 of file DTSegmentAnalysisTest.cc.

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

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

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 92 of file DTSegmentAnalysisTest.cc.

References LogTrace, performClientDiagnostic(), and runOnline.

92  {
93  if (!runOnline) {
94  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
95  << "[DTSegmentAnalysisTest]: endJob. Client called in offline mode , perform DQM client operation";
96 
97  performClientDiagnostic(igetter);
98  }
99 }
#define LogTrace(id)
void performClientDiagnostic(DQMStore::IGetter &)
Perform client diagnostic operations.

◆ 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 70 of file DTSegmentAnalysisTest.cc.

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

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

◆ getMEName()

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

Get the ME name.

Definition at line 239 of file DTSegmentAnalysisTest.cc.

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

Referenced by performClientDiagnostic().

239  {
240  stringstream wheel;
241  wheel << chID.wheel();
242  stringstream station;
243  station << chID.station();
244  stringstream sector;
245  sector << chID.sector();
246 
247  string folderName =
248  topHistoFolder + "/Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() + "/";
249 
250  string histoname = folderName + histoTag + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str();
251 
252  if (histoTag == "numberOfSegments")
253  histoname = topHistoFolder + "/Wheel" + wheel.str() + "/" + histoTag + +"_W" + wheel.str();
254 
255  return histoname;
256 }
int station() const
Return the station number.
Definition: DTChamberId.h:45
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:42
int sector() const
Definition: DTChamberId.h:52

◆ performClientDiagnostic()

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

Perform client diagnostic operations.

Definition at line 101 of file DTSegmentAnalysisTest.cc.

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, nano_mu_digi_cff::sector, DTChamberId::sector(), segmRecHitHistos, DTChamberId::station(), summaryHistos, DiMuonV_cfg::threshold, mps_merge::weight, and DTChamberId::wheel().

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

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

Member Data Documentation

◆ bookingdone

bool DTSegmentAnalysisTest::bookingdone
private

Definition at line 78 of file DTSegmentAnalysisTest.h.

Referenced by dqmEndLuminosityBlock(), and DTSegmentAnalysisTest().

◆ chi2Histos

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

Definition at line 85 of file DTSegmentAnalysisTest.h.

Referenced by bookHistos(), and performClientDiagnostic().

◆ detailedAnalysis

bool DTSegmentAnalysisTest::detailedAnalysis
private

◆ maxPhiHit

int DTSegmentAnalysisTest::maxPhiHit
private

Definition at line 73 of file DTSegmentAnalysisTest.h.

Referenced by DTSegmentAnalysisTest(), and performClientDiagnostic().

◆ maxPhiZHit

int DTSegmentAnalysisTest::maxPhiZHit
private

Definition at line 74 of file DTSegmentAnalysisTest.h.

Referenced by DTSegmentAnalysisTest(), and performClientDiagnostic().

◆ muonGeom

const DTGeometry* DTSegmentAnalysisTest::muonGeom
private

Definition at line 82 of file DTSegmentAnalysisTest.h.

Referenced by beginRun(), and performClientDiagnostic().

◆ muonGeomToken_

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

Definition at line 81 of file DTSegmentAnalysisTest.h.

Referenced by beginRun().

◆ nLSs

int DTSegmentAnalysisTest::nLSs
private

◆ nLumiSegs

unsigned int DTSegmentAnalysisTest::nLumiSegs
private

Definition at line 68 of file DTSegmentAnalysisTest.h.

Referenced by dqmEndLuminosityBlock().

◆ nMinEvts

int DTSegmentAnalysisTest::nMinEvts
private

Definition at line 71 of file DTSegmentAnalysisTest.h.

Referenced by DTSegmentAnalysisTest(), and performClientDiagnostic().

◆ parameters

edm::ParameterSet DTSegmentAnalysisTest::parameters
private

Definition at line 80 of file DTSegmentAnalysisTest.h.

Referenced by DTSegmentAnalysisTest(), and performClientDiagnostic().

◆ runOnline

bool DTSegmentAnalysisTest::runOnline
private

Definition at line 76 of file DTSegmentAnalysisTest.h.

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

◆ segmRecHitHistos

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

Definition at line 86 of file DTSegmentAnalysisTest.h.

Referenced by bookHistos(), and performClientDiagnostic().

◆ summaryHistos

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

Definition at line 87 of file DTSegmentAnalysisTest.h.

Referenced by bookHistos(), and performClientDiagnostic().

◆ topHistoFolder

std::string DTSegmentAnalysisTest::topHistoFolder
private

Definition at line 89 of file DTSegmentAnalysisTest.h.

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