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

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void bookHistos (DQMStore::IBooker &)
 
 DTSegmentAnalysisTest (const edm::ParameterSet &ps)
 Constructor. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &c) override
 
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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () 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
 
ESProxyIndex const * esGetTokenIndices (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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

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
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

bool bookingdone
 
std::map< std::pair< int, int >, MonitorElement * > chi2Histos
 
bool detailedAnalysis
 
bool hltDQMMode
 
int maxPhiHit
 
int maxPhiZHit
 
edm::ESHandle< DTGeometrymuonGeom
 
int nevents
 
unsigned int nLumiSegs
 
int nMinEvts
 
bool normalizeHistoPlots
 
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
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 39 of file DTSegmentAnalysisTest.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 39 of file DTSegmentAnalysisTest.cc.

References dtNoiseAnalysis_cfi::detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), dtSegmentAnalysisTest_cfi::hltDQMMode, LogTrace, dtSegmentAnalysisTest_cfi::maxPhiHit, dtSegmentAnalysisTest_cfi::maxPhiZHit, cmsHarvester::nevents, dtDQMOfflineClients_cff::normalizeHistoPlots, dtDQMOfflineClients_cff::runOnline, and ALCARECODTCalibSynchCosmicsDQMClient_cff::topHistoFolder.

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  normalizeHistoPlots = parameters.getUntrackedParameter<bool>("normalizeHistoPlots", false);
46  runOnline = parameters.getUntrackedParameter<bool>("runOnline", true);
47  // top folder for the histograms in DQMStore
48  topHistoFolder = ps.getUntrackedParameter<string>("topHistoFolder", "DT/02-Segments");
49  // hlt DQM mode
50 
51  hltDQMMode = ps.getUntrackedParameter<bool>("hltDQMMode", false);
52  nMinEvts = ps.getUntrackedParameter<int>("nEventsCert", 5000);
53  maxPhiHit = ps.getUntrackedParameter<int>("maxPhiHit", 7);
54  maxPhiZHit = ps.getUntrackedParameter<int>("maxPhiZHit", 11);
55 
56  nevents = 0;
57 
58  bookingdone = false;
59 }
T getUntrackedParameter(std::string const &, T const &) const
#define LogTrace(id)
DTSegmentAnalysisTest::~DTSegmentAnalysisTest ( )
override

Destructor.

Definition at line 61 of file DTSegmentAnalysisTest.cc.

References LogTrace, and cmsHarvester::nevents.

61  {
62  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest") << "DTSegmentAnalysisTest: analyzed " << nevents << " events";
63 }
#define LogTrace(id)

Member Function Documentation

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

Definition at line 65 of file DTSegmentAnalysisTest.cc.

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

65  {
66  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest") << "[DTSegmentAnalysisTest]: BeginRun";
67 
68  context.get<MuonGeometryRecord>().get(muonGeom);
69 }
#define LogTrace(id)
edm::ESHandle< DTGeometry > muonGeom
T get() const
Definition: EventSetup.h:73
void DTSegmentAnalysisTest::bookHistos ( DQMStore::IBooker ibooker)

Definition at line 294 of file DTSegmentAnalysisTest.cc.

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

294  {
295  for (int wh = -2; wh <= 2; wh++) {
296  stringstream wheel;
297  wheel << wh;
298  string histoName = "segmentSummary_W" + wheel.str();
299 
300  ibooker.setCurrentFolder(topHistoFolder);
301 
302  summaryHistos[wh] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 12, 1, 13, 4, 1, 5);
303  summaryHistos[wh]->setAxisTitle("Sector", 1);
304  summaryHistos[wh]->setBinLabel(1, "MB1", 2);
305  summaryHistos[wh]->setBinLabel(2, "MB2", 2);
306  summaryHistos[wh]->setBinLabel(3, "MB3", 2);
307  summaryHistos[wh]->setBinLabel(4, "MB4", 2);
308 
309  if (detailedAnalysis) {
310  for (int sect = 1; sect <= 14; sect++) {
311  stringstream sector;
312  sector << sect;
313  string chi2HistoName = "chi2BadSegmPercentual_W" + wheel.str() + "_Sec" + sector.str();
314  ibooker.setCurrentFolder(topHistoFolder + "/Wheel" + wheel.str() + "/Tests");
315  chi2Histos[make_pair(wh, sect)] = ibooker.book1D(chi2HistoName.c_str(), chi2HistoName.c_str(), 4, 1, 5);
316  chi2Histos[make_pair(wh, sect)]->setBinLabel(1, "MB1");
317  chi2Histos[make_pair(wh, sect)]->setBinLabel(2, "MB2");
318  chi2Histos[make_pair(wh, sect)]->setBinLabel(3, "MB3");
319  chi2Histos[make_pair(wh, sect)]->setBinLabel(4, "MB4");
320 
321  string segmHistoName = "residualsOnSegmRecHitNumber_W" + wheel.str() + "_Sec" + sector.str();
322  segmRecHitHistos[make_pair(wh, sect)] = ibooker.book1D(segmHistoName.c_str(), segmHistoName.c_str(), 4, 1, 5);
323  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(1, "MB1");
324  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(2, "MB2");
325  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(3, "MB3");
326  segmRecHitHistos[make_pair(wh, sect)]->setBinLabel(4, "MB4");
327  }
328  }
329  }
330 
331  string histoName = "segmentSummary";
332 
333  ibooker.setCurrentFolder(topHistoFolder);
334 
335  summaryHistos[3] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 12, 1, 13, 5, -2, 3);
336  summaryHistos[3]->setAxisTitle("Sector", 1);
337  summaryHistos[3]->setAxisTitle("Wheel", 2);
338 
339  summaryHistos[4] = ibooker.book2D("SegmentGlbSummary", histoName.c_str(), 12, 1, 13, 5, -2, 3);
340  summaryHistos[4]->setAxisTitle("Sector", 1);
341  summaryHistos[4]->setAxisTitle("Wheel", 2);
342 }
std::map< std::pair< int, int >, MonitorElement * > chi2Histos
std::map< int, MonitorElement * > summaryHistos
std::map< std::pair< int, int >, MonitorElement * > segmRecHitHistos
void DTSegmentAnalysisTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 95 of file DTSegmentAnalysisTest.cc.

References dqm::dqmstoreimpl::DQMStore::IGetter::get(), dtSegmentAnalysisTest_cfi::hltDQMMode, LogTrace, dtDQMOfflineClients_cff::normalizeHistoPlots, DTTimeEvolutionHisto::normalizeTo(), dtDQMOfflineClients_cff::runOnline, ALCARECODTCalibSynchCosmicsDQMClient_cff::topHistoFolder, and makeMuonMisalignmentScenario::wheel.

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 
103  if (normalizeHistoPlots) {
104  LogTrace("DTDQM|DTMonitorClient|DTSegmentAnalysisTest") << " Performing time-histo normalization" << endl;
105  MonitorElement* hNevtPerLS = nullptr;
106 
107  if (hltDQMMode)
108  hNevtPerLS = igetter.get(topHistoFolder + "/NevtPerLS");
109  else
110  hNevtPerLS = igetter.get("DT/EventInfo/NevtPerLS");
111 
112  if (hNevtPerLS != nullptr) {
113  for (int wheel = -2; wheel != 3; ++wheel) { // loop over wheels
114  for (int sector = 1; sector <= 12; ++sector) { // loop over sectors
115  stringstream wheelstr;
116  wheelstr << wheel;
117  stringstream sectorstr;
118  sectorstr << sector;
119  string sectorHistoName = topHistoFolder + "/Wheel" + wheelstr.str() + "/Sector" + sectorstr.str() +
120  "/NSegmPerEvent_W" + wheelstr.str() + "_Sec" + sectorstr.str();
121 
122  //FR get the histo from here (igetter available!) ...
123  MonitorElement* histoGot = igetter.get(sectorHistoName);
124 
125  //FR ...and just make with it a DTTimeEvolutionHisto
126  DTTimeEvolutionHisto hNSegmPerLS(histoGot);
127 
128  hNSegmPerLS.normalizeTo(hNevtPerLS);
129  }
130  }
131  } else {
132  LogError("DTDQM|DTMonitorClient|DTSegmentAnalysisTest") << "Histo NevtPerLS not found!" << endl;
133  }
134  }
135 }
#define LogTrace(id)
void performClientDiagnostic(DQMStore::IGetter &)
Perform client diagnostic operations.
void DTSegmentAnalysisTest::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 71 of file DTSegmentAnalysisTest.cc.

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

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

Definition at line 93 of file DTSegmentAnalysisTest.cc.

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

Get the ME name.

Definition at line 275 of file DTSegmentAnalysisTest.cc.

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

275  {
276  stringstream wheel;
277  wheel << chID.wheel();
278  stringstream station;
279  station << chID.station();
280  stringstream sector;
281  sector << chID.sector();
282 
283  string folderName =
284  topHistoFolder + "/Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() + "/";
285 
286  string histoname = folderName + histoTag + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str();
287 
288  if (histoTag == "numberOfSegments")
289  histoname = topHistoFolder + "/Wheel" + wheel.str() + "/" + histoTag + +"_W" + wheel.str();
290 
291  return histoname;
292 }
int sector() const
Definition: DTChamberId.h:49
int station() const
Return the station number.
Definition: DTChamberId.h:42
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
void DTSegmentAnalysisTest::performClientDiagnostic ( DQMStore::IGetter igetter)

Perform client diagnostic operations.

Definition at line 137 of file DTSegmentAnalysisTest.cc.

References funct::abs(), newFWLiteAna::bin, dtNoiseAnalysis_cfi::detailedAnalysis, HcalObjRepresent::Fill(), dqm::dqmstoreimpl::DQMStore::IGetter::get(), 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(), MessageLogger_cff::threshold, mps_merge::weight, and DTChamberId::wheel().

137  {
138  summaryHistos[3]->Reset();
139  summaryHistos[4]->Reset();
140  vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
141  vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
142 
143  for (; ch_it != ch_end; ++ch_it) {
144  DTChamberId chID = (*ch_it)->id();
145 
146  MonitorElement* hNHits = igetter.get(getMEName(chID, "h4DSegmNHits"));
147  MonitorElement* hSegmOcc = igetter.get(getMEName(chID, "numberOfSegments"));
148 
149  if (hNHits && hSegmOcc) {
150  TH1F* hNHits_root = hNHits->getTH1F();
151  TH2F* hSegmOcc_root = hSegmOcc->getTH2F();
152  TH2F* summary_histo_root = summaryHistos[3]->getTH2F();
153 
154  int sector = chID.sector();
155  if (sector == 13)
156  sector = 4;
157  if (sector == 14)
158  sector = 10;
159 
160  if ((chID.station() != 4 && hNHits_root->GetMaximumBin() < maxPhiZHit) ||
161  (chID.station() == 4 && hNHits_root->GetMaximumBin() < maxPhiHit)) {
162  summaryHistos[chID.wheel()]->setBinContent(sector, chID.station(), 1);
163  if (summary_histo_root->GetBinContent(sector, chID.wheel() + 3) < 1)
164  summaryHistos[3]->setBinContent(sector, chID.wheel() + 3, 1);
165  } else
166  summaryHistos[chID.wheel()]->setBinContent(sector, chID.station(), 0);
167 
168  if (detailedAnalysis) {
169  if (chID.station() != 4)
170  segmRecHitHistos[make_pair(chID.wheel(), chID.sector())]->Fill(chID.station(),
171  abs(12 - hNHits_root->GetMaximumBin()));
172  else
173  segmRecHitHistos[make_pair(chID.wheel(), chID.sector())]->Fill(chID.station(),
174  abs(8 - hNHits_root->GetMaximumBin()));
175  }
176 
177  TH2F* summary2_histo_root = summaryHistos[3]->getTH2F();
178  float weight = 0.001;
179  if (hSegmOcc_root->GetBinContent(sector, chID.station()) == 0) {
180  summaryHistos[chID.wheel()]->setBinContent(sector, chID.station(), 2);
181  if (summary2_histo_root->GetBinContent(sector, chID.wheel() + 3) < 2)
182  summaryHistos[3]->setBinContent(sector, chID.wheel() + 3, 2);
183  } else {
184  // Fill the percentage of segment occupancy
185  weight = 1. / 4.;
186  if ((sector == 4 || sector == 10) && chID.station() == 4)
187  weight = 1. / 8.;
188  }
189  summaryHistos[4]->Fill(sector, chID.wheel(), weight);
190  } else {
191  LogVerbatim("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
192  << "[DTSegmentAnalysisTest]: histos not found!!"; // FIXME
193  }
194 
195  if (detailedAnalysis) { // switch on detailed analysis
196 
197  //test on chi2 segment quality
198 
199  MonitorElement* chi2_histo = igetter.get(getMEName(chID, "h4DChi2"));
200  if (chi2_histo) {
201  TH1F* chi2_histo_root = chi2_histo->getTH1F();
202  double threshold = parameters.getUntrackedParameter<double>("chi2Threshold", 5);
203  double maximum = chi2_histo_root->GetXaxis()->GetXmax();
204  double minimum = chi2_histo_root->GetXaxis()->GetXmin();
205  int nbins = chi2_histo_root->GetXaxis()->GetNbins();
206  int thresholdBin = int(threshold / ((maximum - minimum) / nbins));
207 
208  double badSegments = 0;
209  for (int bin = thresholdBin; bin <= nbins; bin++) {
210  badSegments += chi2_histo_root->GetBinContent(bin);
211  }
212 
213  if (chi2_histo_root->GetEntries() != 0) {
214  double badSegmentsPercentual = badSegments / double(chi2_histo_root->GetEntries());
215  chi2Histos[make_pair(chID.wheel(), chID.sector())]->Fill(chID.station(), badSegmentsPercentual);
216  }
217  } else {
218  LogVerbatim("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
219  << "[DTSegmentAnalysisTest]: Histo: " << getMEName(chID, "h4DChi2") << " not found!" << endl;
220  }
221  } // end of switch for detailed analysis
222 
223  } //loop over all the chambers
224 
225  string nEvtsName = "DT/EventInfo/Counters/nProcessedEventsSegment";
226 
227  MonitorElement* meProcEvts = igetter.get(nEvtsName);
228 
229  if (meProcEvts) {
230  int nProcEvts = meProcEvts->getFloatValue();
231  summaryHistos[4]->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
232  } else {
233  summaryHistos[4]->setEntries(nMinEvts + 1);
234  LogVerbatim("DTDQM|DTMonitorClient|DTOccupancyTest")
235  << "[DTOccupancyTest] ME: " << nEvtsName << " not found!" << endl;
236  }
237 
238  if (detailedAnalysis) {
239  string chi2CriterionName = parameters.getUntrackedParameter<string>("chi2TestName", "chi2InRange");
240  for (map<pair<int, int>, MonitorElement*>::const_iterator histo = chi2Histos.begin(); histo != chi2Histos.end();
241  histo++) {
242  const QReport* theChi2QReport = (*histo).second->getQReport(chi2CriterionName);
243  if (theChi2QReport) {
244  vector<dqm::me_util::Channel> badChannels = theChi2QReport->getBadChannels();
245  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
246  channel++) {
247  LogError("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
248  << "Wheel: " << (*histo).first.first << " Sector: " << (*histo).first.second
249  << " Bad stations: " << (*channel).getBin() << " Contents : " << (*channel).getContents();
250  }
251  }
252  }
253 
254  string segmRecHitCriterionName =
255  parameters.getUntrackedParameter<string>("segmRecHitTestName", "segmRecHitInRange");
256  for (map<pair<int, int>, MonitorElement*>::const_iterator histo = segmRecHitHistos.begin();
257  histo != segmRecHitHistos.end();
258  histo++) {
259  const QReport* theSegmRecHitQReport = (*histo).second->getQReport(segmRecHitCriterionName);
260  if (theSegmRecHitQReport) {
261  vector<dqm::me_util::Channel> badChannels = theSegmRecHitQReport->getBadChannels();
262  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
263  channel++) {
264  LogError("DTDQM|DTMonitorClient|DTSegmentAnalysisTest")
265  << "Wheel: " << (*histo).first.first << " Sector: " << (*histo).first.second
266  << " Bad stations on recHit number: " << (*channel).getBin()
267  << " Contents : " << (*channel).getContents();
268  }
269  }
270  }
271 
272  } // end of detailedAnalysis
273 }
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
virtual TH2F * getTH2F() const
const std::vector< DQMChannel > & getBadChannels() const
Definition: QReport.h:37
std::map< std::pair< int, int >, MonitorElement * > chi2Histos
virtual TH1F * getTH1F() const
Definition: weight.py:1
std::map< int, MonitorElement * > summaryHistos
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::string getMEName(const DTChamberId &chID, std::string histoTag)
Get the ME name.
std::map< std::pair< int, int >, MonitorElement * > segmRecHitHistos
edm::ESHandle< DTGeometry > muonGeom
virtual double getFloatValue() const
int sector() const
Definition: DTChamberId.h:49
int station() const
Return the station number.
Definition: DTChamberId.h:42
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39

Member Data Documentation

bool DTSegmentAnalysisTest::bookingdone
private

Definition at line 78 of file DTSegmentAnalysisTest.h.

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

Definition at line 84 of file DTSegmentAnalysisTest.h.

bool DTSegmentAnalysisTest::detailedAnalysis
private

Definition at line 70 of file DTSegmentAnalysisTest.h.

bool DTSegmentAnalysisTest::hltDQMMode
private

Definition at line 91 of file DTSegmentAnalysisTest.h.

int DTSegmentAnalysisTest::maxPhiHit
private

Definition at line 73 of file DTSegmentAnalysisTest.h.

int DTSegmentAnalysisTest::maxPhiZHit
private

Definition at line 74 of file DTSegmentAnalysisTest.h.

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

Definition at line 81 of file DTSegmentAnalysisTest.h.

int DTSegmentAnalysisTest::nevents
private

Definition at line 67 of file DTSegmentAnalysisTest.h.

unsigned int DTSegmentAnalysisTest::nLumiSegs
private

Definition at line 68 of file DTSegmentAnalysisTest.h.

int DTSegmentAnalysisTest::nMinEvts
private

Definition at line 71 of file DTSegmentAnalysisTest.h.

bool DTSegmentAnalysisTest::normalizeHistoPlots
private

Definition at line 87 of file DTSegmentAnalysisTest.h.

edm::ParameterSet DTSegmentAnalysisTest::parameters
private
bool DTSegmentAnalysisTest::runOnline
private

Definition at line 76 of file DTSegmentAnalysisTest.h.

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

Definition at line 85 of file DTSegmentAnalysisTest.h.

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

Definition at line 86 of file DTSegmentAnalysisTest.h.

std::string DTSegmentAnalysisTest::topHistoFolder
private

Definition at line 89 of file DTSegmentAnalysisTest.h.