CMS 3D CMS Logo

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

#include <DTNoiseAnalysisTest.h>

Inheritance diagram for DTNoiseAnalysisTest:
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

 DTNoiseAnalysisTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTNoiseAnalysisTest () 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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 beginRun (edm::Run const &run, edm::EventSetup const &context) override
 BeginRun. More...
 
void bookHistos (DQMStore::IBooker &)
 book the summary histograms More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 DQM Client Diagnostic. More...
 
- 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 Member Functions

std::string getMEName (const DTChamberId &chID)
 Get the ME name. More...
 
std::string getSynchNoiseMEName (int wheelId) const
 

Private Attributes

bool bookingdone
 
bool detailedAnalysis
 
bool doSynchNoise
 
MonitorElementglbSummarySynchNoiseHisto
 
bool isCosmics
 
double maxSynchNoiseRate
 
const DTGeometrymuonGeom
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordmuonGeomToken_
 
int nevents
 
int nMinEvts
 
std::map< int, MonitorElement * > noiseHistos
 
double noiseSafetyFactor
 
int noisyCellDef
 
std::map< int, MonitorElement * > noisyCellHistos
 
MonitorElementsummaryNoiseHisto
 
MonitorElementsummarySynchNoiseHisto
 
MonitorElementthreshChannelsHisto
 

Static Private Attributes

static constexpr float cellW = 4.2
 
static constexpr float instLumi = 20
 
static constexpr std::array< std::array< float, 4 >, 3 > kW_MB
 
static constexpr std::array< std::array< float, 4 >, 2 > lenghtSL_MB
 

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 29 of file DTNoiseAnalysisTest.h.

Constructor & Destructor Documentation

◆ DTNoiseAnalysisTest()

DTNoiseAnalysisTest::DTNoiseAnalysisTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 32 of file DTNoiseAnalysisTest.cc.

References bookingdone, detailedAnalysis, doSynchNoise, edm::ParameterSet::getUntrackedParameter(), isCosmics, LogTrace, maxSynchNoiseRate, nevents, nMinEvts, noiseSafetyFactor, and noisyCellDef.

33  : muonGeomToken_(esConsumes<edm::Transition::BeginRun>()) {
34  LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest") << "[DTNoiseAnalysisTest]: Constructor";
35 
36  // get the cfi parameters
37  noisyCellDef = ps.getUntrackedParameter<int>("noisyCellDef",
38  500); //value set in DQM/DTMonitorClient/python/dtNoiseAnalysis_cfi.py
39  isCosmics = ps.getUntrackedParameter<bool>("isCosmics", false);
40 
41  // switch on/off the summaries for the Synchronous noise
42  doSynchNoise = ps.getUntrackedParameter<bool>("doSynchNoise", false);
43  detailedAnalysis = ps.getUntrackedParameter<bool>("detailedAnalysis", false);
44  maxSynchNoiseRate = ps.getUntrackedParameter<double>("maxSynchNoiseRate", 0.001);
45  noiseSafetyFactor = ps.getUntrackedParameter<double>("noiseSafetyFactor", 5.); //for collisions
46  nMinEvts = ps.getUntrackedParameter<int>("nEventsCert", 5000);
47 
48  nevents = 0;
49 
50  bookingdone = false;
51 }
#define LogTrace(id)
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_

◆ ~DTNoiseAnalysisTest()

DTNoiseAnalysisTest::~DTNoiseAnalysisTest ( )
override

Destructor.

Definition at line 53 of file DTNoiseAnalysisTest.cc.

References LogTrace, and nevents.

53  {
54  LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest") << "DTNoiseAnalysisTest: analyzed " << nevents << " events";
55 }
#define LogTrace(id)

Member Function Documentation

◆ beginRun()

void DTNoiseAnalysisTest::beginRun ( edm::Run const &  run,
edm::EventSetup const &  context 
)
overrideprotected

BeginRun.

Definition at line 57 of file DTNoiseAnalysisTest.cc.

References visDQMUpload::context, muonGeom, and muonGeomToken_.

57  {
58  // Get the geometry
59  muonGeom = &context.getData(muonGeomToken_);
60 }
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
const DTGeometry * muonGeom

◆ bookHistos()

void DTNoiseAnalysisTest::bookHistos ( DQMStore::IBooker ibooker)
protected

book the summary histograms

Definition at line 235 of file DTNoiseAnalysisTest.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), detailedAnalysis, doSynchNoise, glbSummarySynchNoiseHisto, HltBtagPostValidation_cff::histoName, noiseHistos, noisyCellHistos, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), summaryNoiseHisto, summarySynchNoiseHisto, threshChannelsHisto, and makeMuonMisalignmentScenario::wheel.

Referenced by dqmEndLuminosityBlock().

235  {
236  ibooker.setCurrentFolder("DT/05-Noise");
237  string histoName;
238 
239  for (int wh = -2; wh <= 2; wh++) {
240  stringstream wheel;
241  wheel << wh;
242  histoName = "NoiseRateSummary_W" + wheel.str();
243 
244  noiseHistos[wh] = ibooker.book1D(histoName.c_str(), histoName.c_str(), 500, 0, 10000);
245  noiseHistos[wh]->setAxisTitle("rate (Hz)", 1);
246  noiseHistos[wh]->setAxisTitle("entries", 2);
247  }
248  histoName = "NoiseRateSummary";
249 
250  noiseHistos[3] = ibooker.book1D(histoName.c_str(), histoName.c_str(), 500, 0, 10000);
251  noiseHistos[3]->setAxisTitle("rate (Hz)", 1);
252  noiseHistos[3]->setAxisTitle("entries", 2);
253 
254  for (int wh = -2; wh <= 2; wh++) {
255  stringstream wheel;
256  wheel << wh;
257  histoName = "NoiseSummary_W" + wheel.str();
258 
259  noisyCellHistos[wh] = ibooker.book2D(histoName.c_str(), "# of noisy channels", 12, 1, 13, 4, 1, 5);
260  noisyCellHistos[wh]->setBinLabel(1, "MB1", 2);
261  noisyCellHistos[wh]->setBinLabel(2, "MB2", 2);
262  noisyCellHistos[wh]->setBinLabel(3, "MB3", 2);
263  noisyCellHistos[wh]->setBinLabel(4, "MB4", 2);
264  noisyCellHistos[wh]->setAxisTitle("Sector", 1);
265  }
266 
267  histoName = "NoiseSummary";
268 
269  summaryNoiseHisto = ibooker.book2D(histoName.c_str(), "# of noisy channels", 12, 1, 13, 5, -2, 3);
270  summaryNoiseHisto->setAxisTitle("Sector", 1);
271  summaryNoiseHisto->setAxisTitle("Wheel", 2);
272 
273  if (detailedAnalysis) {
274  histoName = "NoisyChannels";
275 
276  threshChannelsHisto = ibooker.book1D(histoName.c_str(), "# of noisy channels vs threshold", 15, 500, 2000);
277  threshChannelsHisto->setAxisTitle("threshold", 1);
278  threshChannelsHisto->setAxisTitle("# noisy channels", 2);
279  }
280 
281  if (doSynchNoise) {
282  ibooker.setCurrentFolder("DT/05-Noise/SynchNoise/");
283  histoName = "SynchNoiseSummary";
284 
285  summarySynchNoiseHisto = ibooker.book2D(histoName.c_str(), "Summary Synch. Noise", 12, 1, 13, 5, -2, 3);
286  summarySynchNoiseHisto->setAxisTitle("Sector", 1);
288  histoName = "SynchNoiseGlbSummary";
289 
290  glbSummarySynchNoiseHisto = ibooker.book2D(histoName.c_str(), "Summary Synch. Noise", 12, 1, 13, 5, -2, 3);
293  }
294 }
MonitorElement * threshChannelsHisto
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::map< int, MonitorElement * > noisyCellHistos
MonitorElement * summarySynchNoiseHisto
std::map< int, MonitorElement * > noiseHistos
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:221
MonitorElement * glbSummarySynchNoiseHisto
MonitorElement * summaryNoiseHisto
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 305 of file DTNoiseAnalysisTest.cc.

305 {}

◆ dqmEndLuminosityBlock()

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

DQM Client Diagnostic.

Reimplemented from DQMEDHarvester.

Definition at line 62 of file DTNoiseAnalysisTest.cc.

References funct::abs(), bookHistos(), bookingdone, cellW, DTGeometry::chambers(), DTTopology::channels(), detailedAnalysis, doSynchNoise, dqm::impl::MonitorElement::Fill(), DTTopology::firstChannel(), nano_mu_digi_cff::float, dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getFloatValue(), getMEName(), getSynchNoiseMEName(), dqm::legacy::MonitorElement::getTH2F(), glbSummarySynchNoiseHisto, timingPdfMaker::histo, instLumi, isCosmics, dqmdumpme::k, kW_MB, nano_mu_digi_cff::layer, DTGeometry::layer(), lenghtSL_MB, LogTrace, maxSynchNoiseRate, cms::cuda::allocator::minBin, muonGeom, nevents, nMinEvts, hgchebackDigitizer_cfi::noise, noiseHistos, noiseSafetyFactor, noisyCellDef, noisyCellHistos, plotFactory::plot, dqm::impl::MonitorElement::Reset(), nano_mu_digi_cff::sector, DTChamberId::sector(), dqm::impl::MonitorElement::setBinContent(), dqm::impl::MonitorElement::setEntries(), DTLayer::specificTopology(), DTChamberId::station(), summaryNoiseHisto, summarySynchNoiseHisto, threshChannelsHisto, DTChamberId::wheel(), makeMuonMisalignmentScenario::wheel, and nano_mu_digi_cff::wire.

65  {
66  float chRate;
67 
68  if (!bookingdone) {
69  // book the histos
70  bookHistos(ibooker);
71  }
72  bookingdone = true;
73 
74  LogVerbatim("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
75  << "[DTNoiseAnalysisTest]: End of LS transition, performing the DQM client operation";
76 
77  // Reset the summary plots
78  for (map<int, MonitorElement*>::iterator plot = noiseHistos.begin(); plot != noiseHistos.end(); ++plot) {
79  (*plot).second->Reset();
80  }
81 
82  for (map<int, MonitorElement*>::iterator plot = noisyCellHistos.begin(); plot != noisyCellHistos.end(); ++plot) {
83  (*plot).second->Reset();
84  }
85 
87 
88  vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
89  vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
90 
91  LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest") << "[DTNoiseAnalysisTest]: Fill the summary histos";
92 
93  for (; ch_it != ch_end; ++ch_it) { // loop over chambers
94  DTChamberId chID = (*ch_it)->id();
95 
96  MonitorElement* histo = igetter.get(getMEName(chID));
97 
98  if (histo) { // check the pointer
99 
100  TH2D* histo_root = histo->getTH2D();
101 
102  for (int sl = 1; sl != 4; ++sl) { // loop over SLs
103  // skip theta SL in MB4 chambers
104  if (chID.station() == 4 && sl == 2)
105  continue;
106 
107  int binYlow = ((sl - 1) * 4) + 1;
108 
109  for (int layer = 1; layer <= 4; ++layer) { // loop over layers
110 
111  // Get the layer ID
112  DTLayerId layID(chID, sl, layer);
113 
114  int nWires = muonGeom->layer(layID)->specificTopology().channels();
115  int firstWire = muonGeom->layer(layID)->specificTopology().firstChannel();
116 
117  int binY = binYlow + (layer - 1);
118 
119  for (int wire = firstWire; wire != (nWires + firstWire); wire++) { // loop over wires
120 
121  double noise = histo_root->GetBinContent(wire, binY);
122  // fill the histos
123  noiseHistos[chID.wheel()]->Fill(noise);
124  noiseHistos[3]->Fill(noise);
125  int sector = chID.sector();
126 
127  if (!isCosmics) { // for collisions
128  float k = kW_MB[2 - abs(chID.wheel())][chID.station() - 1];
129  if (chID.station() == 4) { //special geometry cases for MB4
130  if (sector == 9 || sector == 10 || sector == 11)
131  k = 0.05;
132  else if (sector == 4 && chID.wheel() == 0)
133  k = 0.25;
134  }
135  noisyCellDef =
136  cellW * instLumi * k * lenghtSL_MB[(sl % 2)][chID.station() - 1]; // background expected per chamber
138  } //else value read from DQM/DTMonitorClient/python/dtNoiseAnalysis_cfi.py
139 
140  if (noise > noisyCellDef) {
141  if (sector == 13) {
142  sector = 4;
143  } else if (sector == 14) {
144  sector = 10;
145  }
146  noisyCellHistos[chID.wheel()]->Fill(sector, chID.station());
148  }
149  }
150  }
151  }
152  }
153  }
154 
155  if (detailedAnalysis) {
157  TH1F* histo = noiseHistos[3]->getTH1F();
158  for (int step = 0; step != 15; step++) {
159  int threshBin = step + 1;
160  int minBin = 26 + step * 5;
161  int nNoisyCh = histo->Integral(minBin, 101);
162  threshChannelsHisto->setBinContent(threshBin, nNoisyCh);
163  }
164  }
165 
166  // build the summary of synch noise
167 
168  if (doSynchNoise) {
169  LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
170  << "[DTNoiseAnalysisTest]: fill summaries for synch noise" << endl;
173  for (int wheel = -2; wheel != 3; ++wheel) {
174  // Get the histo produced by DTDigiTask
175 
176  MonitorElement* histoNoiseSynch = igetter.get(getSynchNoiseMEName(wheel));
177  if (histoNoiseSynch != nullptr) {
178  for (int sect = 1; sect != 13; ++sect) { // loop over sectors
179  TH2F* histo = histoNoiseSynch->getTH2F();
180  float maxSectRate = 0;
181  for (int sta = 1; sta != 5; ++sta) {
182  if (nevents > 0)
183  chRate = histo->GetBinContent(sect, sta) / (float)nevents;
184  else
185  chRate = -1.0;
186  // in case nevents 0 e.g. counting not done
187  LogTrace("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
188  << " Wheel: " << wheel << " sect: " << sect << " station: " << sta << " rate is: " << chRate << endl;
189  if (chRate > maxSectRate)
190  maxSectRate = chRate;
191  }
192  summarySynchNoiseHisto->Fill(sect, wheel, maxSectRate > maxSynchNoiseRate ? 1 : 0);
193  float glbBinValue = 1 - 0.15 * maxSectRate / maxSynchNoiseRate;
194  glbSummarySynchNoiseHisto->Fill(sect, wheel, glbBinValue > 0 ? glbBinValue : 0);
195  }
196  } else {
197  LogWarning("DTDQM|DTMonitorClient|DTNoiseAnalysisTest")
198  << " Histo: " << getSynchNoiseMEName(wheel) << " not found!" << endl;
199  }
200  }
201  }
202 
203  string nEvtsName = "DT/EventInfo/Counters/nProcessedEventsNoise";
204 
205  MonitorElement* meProcEvts = igetter.get(nEvtsName);
206 
207  if (meProcEvts) {
208  int nProcEvts = meProcEvts->getFloatValue();
209  glbSummarySynchNoiseHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
210  summarySynchNoiseHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
211  } else {
214  LogVerbatim("DTDQM|DTMonitorClient|DTnoiseAnalysisTest")
215  << "[DTNoiseAnalysisTest] ME: " << nEvtsName << " not found!" << endl;
216  }
217 }
Log< level::Info, true > LogVerbatim
int station() const
Return the station number.
Definition: DTChamberId.h:45
MonitorElement * threshChannelsHisto
virtual void setEntries(double nentries)
set # of entries
static constexpr std::array< std::array< float, 4 >, 2 > lenghtSL_MB
std::map< int, MonitorElement * > noisyCellHistos
#define LogTrace(id)
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:79
void Fill(long long x)
std::string getSynchNoiseMEName(int wheelId) const
virtual TH2F * getTH2F() const
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
static constexpr float cellW
virtual double getFloatValue() const
static constexpr std::array< std::array< float, 4 >, 3 > kW_MB
void bookHistos(DQMStore::IBooker &)
book the summary histograms
static constexpr float instLumi
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::string getMEName(const DTChamberId &chID)
Get the ME name.
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * summarySynchNoiseHisto
std::map< int, MonitorElement * > noiseHistos
const DTGeometry * muonGeom
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
MonitorElement * glbSummarySynchNoiseHisto
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
step
Definition: StallMonitor.cc:83
Log< level::Warning, false > LogWarning
MonitorElement * summaryNoiseHisto
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:76
constexpr unsigned int minBin
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96

◆ getMEName()

string DTNoiseAnalysisTest::getMEName ( const DTChamberId chID)
private

Get the ME name.

Definition at line 219 of file DTNoiseAnalysisTest.cc.

References ALCARECODTCalibSynchCosmicsDQM_cff::folderName, nano_mu_digi_cff::sector, DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, AlCaHLTBitMon_QueryRunRegistry::string, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by dqmEndLuminosityBlock().

219  {
220  stringstream wheel;
221  wheel << chID.wheel();
222  stringstream station;
223  station << chID.station();
224  stringstream sector;
225  sector << chID.sector();
226 
227  string folderName = "DT/05-Noise/Wheel" + wheel.str() + "/Sector" + sector.str() + "/";
228 
229  string histoname =
230  folderName + string("NoiseRate") + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str();
231 
232  return histoname;
233 }
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

◆ getSynchNoiseMEName()

string DTNoiseAnalysisTest::getSynchNoiseMEName ( int  wheelId) const
private

Definition at line 296 of file DTNoiseAnalysisTest.cc.

References ALCARECODTCalibSynchCosmicsDQM_cff::folderName, AlCaHLTBitMon_QueryRunRegistry::string, and makeMuonMisalignmentScenario::wheel.

Referenced by dqmEndLuminosityBlock().

296  {
297  stringstream wheel;
298  wheel << wheelId;
299  string folderName = "DT/05-Noise/SynchNoise/";
300  string histoname = folderName + string("SyncNoiseEvents") + "_W" + wheel.str();
301 
302  return histoname;
303 }

Member Data Documentation

◆ bookingdone

bool DTNoiseAnalysisTest::bookingdone
private

Definition at line 61 of file DTNoiseAnalysisTest.h.

Referenced by dqmEndLuminosityBlock(), and DTNoiseAnalysisTest().

◆ cellW

constexpr float DTNoiseAnalysisTest::cellW = 4.2
staticprivate

Definition at line 84 of file DTNoiseAnalysisTest.h.

Referenced by dqmEndLuminosityBlock().

◆ detailedAnalysis

bool DTNoiseAnalysisTest::detailedAnalysis
private

Definition at line 71 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), dqmEndLuminosityBlock(), and DTNoiseAnalysisTest().

◆ doSynchNoise

bool DTNoiseAnalysisTest::doSynchNoise
private

Definition at line 70 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), dqmEndLuminosityBlock(), and DTNoiseAnalysisTest().

◆ glbSummarySynchNoiseHisto

MonitorElement* DTNoiseAnalysisTest::glbSummarySynchNoiseHisto
private

Definition at line 81 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), and dqmEndLuminosityBlock().

◆ instLumi

constexpr float DTNoiseAnalysisTest::instLumi = 20
staticprivate

Definition at line 85 of file DTNoiseAnalysisTest.h.

Referenced by dqmEndLuminosityBlock().

◆ isCosmics

bool DTNoiseAnalysisTest::isCosmics
private

Definition at line 69 of file DTNoiseAnalysisTest.h.

Referenced by dqmEndLuminosityBlock(), and DTNoiseAnalysisTest().

◆ kW_MB

constexpr std::array<std::array<float, 4>, 3> DTNoiseAnalysisTest::kW_MB
staticprivate
Initial value:
= {
{{{0.41, 0.08, 0.01, 0.15}},
{{0.17, 0.04, 0.01, 0.15}},
{{0.06, 0.02, 0.01, 0.15}}}}

Definition at line 86 of file DTNoiseAnalysisTest.h.

Referenced by dqmEndLuminosityBlock().

◆ lenghtSL_MB

constexpr std::array<std::array<float, 4>, 2> DTNoiseAnalysisTest::lenghtSL_MB
staticprivate
Initial value:
= {
{{{206, 252, 302, 0}}, {{240, 240, 240, 240}}}}

Definition at line 90 of file DTNoiseAnalysisTest.h.

Referenced by dqmEndLuminosityBlock().

◆ maxSynchNoiseRate

double DTNoiseAnalysisTest::maxSynchNoiseRate
private

Definition at line 72 of file DTNoiseAnalysisTest.h.

Referenced by dqmEndLuminosityBlock(), and DTNoiseAnalysisTest().

◆ muonGeom

const DTGeometry* DTNoiseAnalysisTest::muonGeom
private

Definition at line 65 of file DTNoiseAnalysisTest.h.

Referenced by beginRun(), and dqmEndLuminosityBlock().

◆ muonGeomToken_

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

Definition at line 64 of file DTNoiseAnalysisTest.h.

Referenced by beginRun().

◆ nevents

int DTNoiseAnalysisTest::nevents
private

◆ nMinEvts

int DTNoiseAnalysisTest::nMinEvts
private

Definition at line 59 of file DTNoiseAnalysisTest.h.

Referenced by dqmEndLuminosityBlock(), and DTNoiseAnalysisTest().

◆ noiseHistos

std::map<int, MonitorElement*> DTNoiseAnalysisTest::noiseHistos
private

Definition at line 76 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), and dqmEndLuminosityBlock().

◆ noiseSafetyFactor

double DTNoiseAnalysisTest::noiseSafetyFactor
private

Definition at line 73 of file DTNoiseAnalysisTest.h.

Referenced by dqmEndLuminosityBlock(), and DTNoiseAnalysisTest().

◆ noisyCellDef

int DTNoiseAnalysisTest::noisyCellDef
private

Definition at line 68 of file DTNoiseAnalysisTest.h.

Referenced by dqmEndLuminosityBlock(), and DTNoiseAnalysisTest().

◆ noisyCellHistos

std::map<int, MonitorElement*> DTNoiseAnalysisTest::noisyCellHistos
private

Definition at line 77 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), and dqmEndLuminosityBlock().

◆ summaryNoiseHisto

MonitorElement* DTNoiseAnalysisTest::summaryNoiseHisto
private

Definition at line 78 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), and dqmEndLuminosityBlock().

◆ summarySynchNoiseHisto

MonitorElement* DTNoiseAnalysisTest::summarySynchNoiseHisto
private

Definition at line 80 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), and dqmEndLuminosityBlock().

◆ threshChannelsHisto

MonitorElement* DTNoiseAnalysisTest::threshChannelsHisto
private

Definition at line 79 of file DTNoiseAnalysisTest.h.

Referenced by bookHistos(), and dqmEndLuminosityBlock().