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
 
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
 
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::vector< ModuleDescription const * > &modules, 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
 
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
 
edm::ESHandle< DTGeometrymuonGeom
 
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 39 of file DTSegmentAnalysisTest.h.

Constructor & Destructor Documentation

◆ DTSegmentAnalysisTest()

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

Constructor.

Definition at line 39 of file DTSegmentAnalysisTest.cc.

39  {
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 dtNoiseAnalysis_cfi::detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), LogTrace, dtSegmentAnalysisTest_cfi::maxPhiHit, dtSegmentAnalysisTest_cfi::maxPhiZHit, dtDQMOfflineClients_cff::runOnline, and ALCARECODTCalibSynchCosmicsDQMClient_cff::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.

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 
64  context.get<MuonGeometryRecord>().get(muonGeom);
65 }

References edm::EventSetup::get(), edm::get(), and LogTrace.

◆ bookHistos()

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

Definition at line 261 of file DTSegmentAnalysisTest.cc.

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

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dtNoiseAnalysis_cfi::detailedAnalysis, HltBtagPostValidation_cff::histoName, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), ALCARECODTCalibSynchCosmicsDQMClient_cff::topHistoFolder, and makeMuonMisalignmentScenario::wheel.

◆ dqmBeginLuminosityBlock()

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

Definition at line 67 of file DTSegmentAnalysisTest.cc.

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

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

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 95 of file DTSegmentAnalysisTest.cc.

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

References LogTrace, and dtDQMOfflineClients_cff::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 73 of file DTSegmentAnalysisTest.cc.

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

References bookHistos(), edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), and dtDQMOfflineClients_cff::runOnline.

◆ getMEName()

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

Get the ME name.

Definition at line 242 of file DTSegmentAnalysisTest.cc.

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

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

◆ performClientDiagnostic()

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

Perform client diagnostic operations.

Definition at line 104 of file DTSegmentAnalysisTest.cc.

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

References funct::abs(), newFWLiteAna::bin, dtNoiseAnalysis_cfi::detailedAnalysis, HcalObjRepresent::Fill(), dqm::implementation::IGetter::get(), MonitorElementData::QReport::getBadChannels(), dqm::impl::MonitorElement::getFloatValue(), dqm::legacy::MonitorElement::getTH1F(), dqm::legacy::MonitorElement::getTH2F(), timingPdfMaker::histo, createfilelist::int, genParticles_cff::map, dtSegmentAnalysisTest_cfi::maxPhiHit, dtSegmentAnalysisTest_cfi::maxPhiZHit, LaserClient_cfi::nbins, DTChamberId::sector(), DTChamberId::station(), remoteMonitoring_LED_IterMethod_cfg::threshold, mps_merge::weight, and DTChamberId::wheel().

Member Data Documentation

◆ bookingdone

bool DTSegmentAnalysisTest::bookingdone
private

Definition at line 78 of file DTSegmentAnalysisTest.h.

◆ chi2Histos

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

Definition at line 84 of file DTSegmentAnalysisTest.h.

◆ detailedAnalysis

bool DTSegmentAnalysisTest::detailedAnalysis
private

Definition at line 70 of file DTSegmentAnalysisTest.h.

◆ maxPhiHit

int DTSegmentAnalysisTest::maxPhiHit
private

Definition at line 73 of file DTSegmentAnalysisTest.h.

◆ maxPhiZHit

int DTSegmentAnalysisTest::maxPhiZHit
private

Definition at line 74 of file DTSegmentAnalysisTest.h.

◆ muonGeom

edm::ESHandle<DTGeometry> DTSegmentAnalysisTest::muonGeom
private

Definition at line 81 of file DTSegmentAnalysisTest.h.

◆ nLSs

int DTSegmentAnalysisTest::nLSs
private

Definition at line 67 of file DTSegmentAnalysisTest.h.

◆ nLumiSegs

unsigned int DTSegmentAnalysisTest::nLumiSegs
private

Definition at line 68 of file DTSegmentAnalysisTest.h.

◆ nMinEvts

int DTSegmentAnalysisTest::nMinEvts
private

Definition at line 71 of file DTSegmentAnalysisTest.h.

◆ parameters

edm::ParameterSet DTSegmentAnalysisTest::parameters
private

Definition at line 80 of file DTSegmentAnalysisTest.h.

◆ runOnline

bool DTSegmentAnalysisTest::runOnline
private

Definition at line 76 of file DTSegmentAnalysisTest.h.

◆ segmRecHitHistos

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

Definition at line 85 of file DTSegmentAnalysisTest.h.

◆ summaryHistos

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

Definition at line 86 of file DTSegmentAnalysisTest.h.

◆ topHistoFolder

std::string DTSegmentAnalysisTest::topHistoFolder
private

Definition at line 88 of file DTSegmentAnalysisTest.h.

relativeConstraints.station
station
Definition: relativeConstraints.py:67
mps_merge.weight
weight
Definition: mps_merge.py:88
DTSegmentAnalysisTest::muonGeom
edm::ESHandle< DTGeometry > muonGeom
Definition: DTSegmentAnalysisTest.h:81
DTSegmentAnalysisTest::maxPhiHit
int maxPhiHit
Definition: DTSegmentAnalysisTest.h:73
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
DTSegmentAnalysisTest::chi2Histos
std::map< std::pair< int, int >, MonitorElement * > chi2Histos
Definition: DTSegmentAnalysisTest.h:84
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DTSegmentAnalysisTest::bookHistos
void bookHistos(DQMStore::IBooker &)
Definition: DTSegmentAnalysisTest.cc:261
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:478
DTSegmentAnalysisTest::maxPhiZHit
int maxPhiZHit
Definition: DTSegmentAnalysisTest.h:74
DTSegmentAnalysisTest::nLumiSegs
unsigned int nLumiSegs
Definition: DTSegmentAnalysisTest.h:68
DTSegmentAnalysisTest::segmRecHitHistos
std::map< std::pair< int, int >, MonitorElement * > segmRecHitHistos
Definition: DTSegmentAnalysisTest.h:85
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
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:70
DTSegmentAnalysisTest::nMinEvts
int nMinEvts
Definition: DTSegmentAnalysisTest.h:71
DTSegmentAnalysisTest::summaryHistos
std::map< int, MonitorElement * > summaryHistos
Definition: DTSegmentAnalysisTest.h:86
dqm::impl::MonitorElement::getFloatValue
virtual double getFloatValue() const
Definition: MonitorElement.cc:917
DTSegmentAnalysisTest::topHistoFolder
std::string topHistoFolder
Definition: DTSegmentAnalysisTest.h:88
DTSegmentAnalysisTest::nLSs
int nLSs
Definition: DTSegmentAnalysisTest.h:67
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:78
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
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:651
DTSegmentAnalysisTest::performClientDiagnostic
void performClientDiagnostic(DQMStore::IGetter &)
Perform client diagnostic operations.
Definition: DTSegmentAnalysisTest.cc:104
HltBtagPostValidation_cff.histoName
histoName
Definition: HltBtagPostValidation_cff.py:17
DTSegmentAnalysisTest::runOnline
bool runOnline
Definition: DTSegmentAnalysisTest.h:76
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:224
DTSegmentAnalysisTest::getMEName
std::string getMEName(const DTChamberId &chID, std::string histoTag)
Get the ME name.
Definition: DTSegmentAnalysisTest.cc:242
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
DTSegmentAnalysisTest::parameters
edm::ParameterSet parameters
Definition: DTSegmentAnalysisTest.h:80
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:490