CMS 3D CMS Logo

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

#include <DTTriggerLutTest.h>

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

 DTTriggerLutTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTTriggerLutTest () override
 Destructor. More...
 
- Public Member Functions inherited from DTLocalTriggerBaseTest
 DTLocalTriggerBaseTest ()
 Constructor. More...
 
 ~DTLocalTriggerBaseTest () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginRun (const edm::Run &r, const edm::EventSetup &c) override
 BeginRun. More...
 
void Bookings (DQMStore::IBooker &, DQMStore::IGetter &)
 
void runClientDiagnostic (DQMStore::IBooker &, DQMStore::IGetter &) override
 Run client analysis. More...
 
- Protected Member Functions inherited from DTLocalTriggerBaseTest
void beginRun (edm::Run const &run, edm::EventSetup const &context) override
 BeginRun. More...
 
void bookCmsHistos (DQMStore::IBooker &, std::string hTag, std::string folder="", bool isGlb=false)
 Book the new MEs (CMS summary) More...
 
void bookSectorHistos (DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
 Book the new MEs (for each sector) More...
 
void bookWheelHistos (DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
 Book the new MEs (for each wheel) More...
 
std::string category ()
 Get message logger name. More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 Perform client diagnostic in online. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &context) override
 Perform client diagnostic in offline. More...
 
std::string fullName (std::string htype)
 Create fullname from histo partial name. More...
 
template<class T >
TgetHisto (MonitorElement *me)
 Convert ME to Histogram fo type T. More...
 
std::string getMEName (std::string histoTag, std::string subfolder, const DTChamberId &chambid)
 Get the ME name (by chamber) More...
 
std::string getMEName (std::string histoTag, std::string subfolder, int wh)
 Get the ME name (by wheel) More...
 
std::pair< float, float > phiRange (const DTChamberId &id)
 Calculate phi range for histograms. More...
 
void setConfig (const edm::ParameterSet &ps, std::string name)
 Set configuration variables. More...
 
std::string & topFolder ()
 Get top folder name. 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 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<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)
 

Protected Attributes

const int wheelArrayShift = 3
 
- Protected Attributes inherited from DTLocalTriggerBaseTest
std::string baseFolderTM
 
std::map< std::string, MonitorElement * > cmsME
 
std::string hwSource
 
std::vector< std::string > hwSources
 
const DTGeometrymuonGeom
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordmuonGeomToken_
 
int nevents
 
unsigned int nLumiSegs
 
edm::ParameterSet parameters
 
int prescaleFactor
 
int run
 
bool runOnline
 
std::map< int, std::map< std::string, MonitorElement * > > secME
 
std::string sourceFolder
 
std::string testName
 
std::string trigSource
 
std::vector< std::string > trigSources
 
std::map< int, std::map< std::string, MonitorElement * > > whME
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Private Member Functions

void bookCmsHistos1d (DQMStore::IBooker &, std::string hTag, std::string folder="")
 
void fillWhPlot (MonitorElement *plot, int sect, int stat, float value, bool lessIsBest=true)
 Fill summary plots managing double MB4 chambers. More...
 
int performLutTest (double perc, double threshold1, double threshold2)
 Perform Lut Test logical operations. More...
 

Private Attributes

bool bookingdone
 
bool detailedAnalysis
 
double thresholdErrPhi
 
double thresholdErrPhiB
 
double thresholdWarnPhi
 
double thresholdWarnPhiB
 
double validRange
 

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)
 

Detailed Description

Definition at line 20 of file DTTriggerLutTest.h.

Constructor & Destructor Documentation

◆ DTTriggerLutTest()

DTTriggerLutTest::DTTriggerLutTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 32 of file DTTriggerLutTest.cc.

References dtNoiseAnalysis_cfi::detailedAnalysis, edm::ParameterSet::getUntrackedParameter(), dtTriggerLutTest_cfi::thresholdErrPhi, dtTriggerLutTest_cfi::thresholdErrPhiB, dtTriggerLutTest_cfi::thresholdWarnPhi, dtTriggerLutTest_cfi::thresholdWarnPhiB, and dtTriggerLutTest_cfi::validRange.

32  {
33  setConfig(ps, "DTTriggerLut");
34  baseFolderTM = "DT/03-LocalTrigger-TM/";
35  thresholdWarnPhi = ps.getUntrackedParameter<double>("thresholdWarnPhi");
36  thresholdErrPhi = ps.getUntrackedParameter<double>("thresholdErrPhi");
37  thresholdWarnPhiB = ps.getUntrackedParameter<double>("thresholdWarnPhiB");
38  thresholdErrPhiB = ps.getUntrackedParameter<double>("thresholdErrPhiB");
39  validRange = ps.getUntrackedParameter<double>("validRange");
40  detailedAnalysis = ps.getUntrackedParameter<bool>("detailedAnalysis");
41 
42  bookingdone = false;
43 }
T getUntrackedParameter(std::string const &, T const &) const
void setConfig(const edm::ParameterSet &ps, std::string name)
Set configuration variables.

◆ ~DTTriggerLutTest()

DTTriggerLutTest::~DTTriggerLutTest ( )
override

Destructor.

Definition at line 45 of file DTTriggerLutTest.cc.

45 {}

Member Function Documentation

◆ beginRun()

void DTTriggerLutTest::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

BeginRun.

Definition at line 94 of file DTTriggerLutTest.cc.

References DTLocalTriggerBaseTest::beginRun(), c, and alignCSCRings::r.

void beginRun(edm::Run const &run, edm::EventSetup const &context) override
BeginRun.

◆ bookCmsHistos1d()

void DTTriggerLutTest::bookCmsHistos1d ( DQMStore::IBooker ,
std::string  hTag,
std::string  folder = "" 
)
private

Definition at line 294 of file DTTriggerLutTest.cc.

References makeHippyCampaign::basedir, dqm::implementation::IBooker::book1D(), taus_updatedMVAIds_cff::category, printsummarytable::folder, newFWLiteAna::fullName, LogTrace, hlt_dqm_clientPB-live_cfg::me, dqm::implementation::NavigatorBase::setCurrentFolder(), and L1TBPTX_cfi::testName.

294  {
295  string basedir = topFolder();
296  if (!folder.empty()) {
297  basedir += folder + "/";
298  }
299  ibooker.setCurrentFolder(basedir);
300 
301  string hName = fullName(hTag);
302  LogTrace(category()) << "[" << testName << "Test]: booking " << basedir << hName;
303 
304  MonitorElement* me = ibooker.book1D(hName.c_str(), hName.c_str(), 101, -0.005, 1.005);
305  me->setAxisTitle("Percentage", 1);
306  cmsME[hName] = me;
307 }
std::string & topFolder()
Get top folder name.
#define LogTrace(id)
std::string category()
Get message logger name.
std::map< std::string, MonitorElement * > cmsME
std::string fullName(std::string htype)
Create fullname from histo partial name.

◆ Bookings()

void DTTriggerLutTest::Bookings ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
protected

Definition at line 47 of file DTTriggerLutTest.cc.

References dtNoiseAnalysis_cfi::detailedAnalysis, dtFineDelayCorr_cfi::hwSource, and dtFineDelayCorr_cfi::hwSources.

47  {
48  bookingdone = true;
49 
50  vector<string>::const_iterator iTr = trigSources.begin();
51  vector<string>::const_iterator trEnd = trigSources.end();
52  vector<string>::const_iterator iHw = hwSources.begin();
53  vector<string>::const_iterator hwEnd = hwSources.end();
54 
55  //Booking
56  if (parameters.getUntrackedParameter<bool>("staticBooking")) {
57  for (; iTr != trEnd; ++iTr) {
58  trigSource = (*iTr);
59  for (; iHw != hwEnd; ++iHw) {
60  hwSource = (*iHw);
61  // Loop over the TriggerUnits
62  for (int wh = -2; wh <= 2; ++wh) {
63  if (detailedAnalysis) {
64  bookWheelHistos(ibooker, wh, "PhiResidualPercentage");
65  bookWheelHistos(ibooker, wh, "PhibResidualPercentage");
66  }
67 
68  bookWheelHistos(ibooker, wh, "PhiLutSummary", "Summaries");
69  bookWheelHistos(ibooker, wh, "PhibLutSummary", "Summaries");
70 
71  if (detailedAnalysis) {
72  bookWheelHistos(ibooker, wh, "PhiResidualMean");
73  bookWheelHistos(ibooker, wh, "PhiResidualRMS");
74  bookWheelHistos(ibooker, wh, "PhibResidualMean");
75  bookWheelHistos(ibooker, wh, "PhibResidualRMS");
76  bookWheelHistos(ibooker, wh, "CorrelationFactorPhi");
77  bookWheelHistos(ibooker, wh, "CorrelationFactorPhib");
78  bookWheelHistos(ibooker, wh, "DoublePeakFlagPhib");
79  }
80  }
81 
82  bookCmsHistos(ibooker, "TrigLutSummary", "", true);
83  bookCmsHistos(ibooker, "PhiLutSummary");
84  bookCmsHistos(ibooker, "PhibLutSummary");
85  if (detailedAnalysis) {
86  bookCmsHistos1d(ibooker, "PhiPercentageSummary");
87  bookCmsHistos1d(ibooker, "PhibPercentageSummary");
88  }
89  }
90  }
91  }
92 }
std::vector< std::string > trigSources
void bookCmsHistos1d(DQMStore::IBooker &, std::string hTag, std::string folder="")
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > hwSources
void bookWheelHistos(DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
Book the new MEs (for each wheel)
void bookCmsHistos(DQMStore::IBooker &, std::string hTag, std::string folder="", bool isGlb=false)
Book the new MEs (CMS summary)

◆ fillWhPlot()

void DTTriggerLutTest::fillWhPlot ( MonitorElement plot,
int  sect,
int  stat,
float  value,
bool  lessIsBest = true 
)
private

Fill summary plots managing double MB4 chambers.

Definition at line 309 of file DTTriggerLutTest.cc.

References plotFactory::plot.

309  {
310  if (sect > 12) {
311  int scsect = sect == 13 ? 4 : 10;
312  if ((value > plot->getBinContent(scsect, stat)) == lessIsBest) {
313  plot->setBinContent(scsect, stat, value);
314  }
315  } else {
316  plot->setBinContent(sect, stat, value);
317  }
318 
319  return;
320 }
Definition: value.py:1

◆ performLutTest()

int DTTriggerLutTest::performLutTest ( double  perc,
double  threshold1,
double  threshold2 
)
private

Perform Lut Test logical operations.

Definition at line 285 of file DTTriggerLutTest.cc.

References mps_fire::result.

285  {
286  bool isInWarn = perc < thresholdWarn;
287  bool isInErr = perc < thresholdErr;
288 
289  int result = isInErr ? 2 : isInWarn ? 3 : 0;
290 
291  return result;
292 }

◆ runClientDiagnostic()

void DTTriggerLutTest::runClientDiagnostic ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Run client analysis.

Implements DTLocalTriggerBaseTest.

Definition at line 96 of file DTTriggerLutTest.cc.

References reco::ceil(), alignCSCRings::corr, dtNoiseAnalysis_cfi::detailedAnalysis, newFWLiteAna::fullName, dqm::implementation::IGetter::get(), dtFineDelayCorr_cfi::hwSource, dtFineDelayCorr_cfi::hwSources, edm::max(), cms::cuda::allocator::maxBin, Mean, SiStripPI::rms, edm_modernize_messagelogger::stat, dtTriggerLutTest_cfi::thresholdErrPhi, dtTriggerLutTest_cfi::thresholdErrPhiB, dtTriggerLutTest_cfi::thresholdWarnPhi, dtTriggerLutTest_cfi::thresholdWarnPhiB, dtTriggerLutTest_cfi::validRange, and DTChamberId::wheel().

96  {
97  if (!bookingdone)
98  Bookings(ibooker, igetter);
99 
100  // Reset lut percentage 1D summaries
101  if (detailedAnalysis) {
102  cmsME.find(fullName("PhiPercentageSummary"))->second->Reset();
103  cmsME.find(fullName("PhibPercentageSummary"))->second->Reset();
104  }
105 
106  // Loop over Trig & Hw sources
107  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
108  trigSource = (*iTr);
109  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
110  hwSource = (*iHw);
111  vector<const DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
112  vector<const DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
113  for (; chIt != chEnd; ++chIt) {
114  DTChamberId chId((*chIt)->id());
115  int wh = chId.wheel();
116  int sect = chId.sector();
117  int stat = chId.station();
118 
119  std::map<std::string, MonitorElement*>& innerME = whME[wh];
120 
121  // Make Phi Residual Summary
122  TH1F* PhiResidual = getHisto<TH1F>(igetter.get(getMEName("PhiResidual", "Segment", chId)));
123  int phiSummary = 1;
124  if (PhiResidual && PhiResidual->GetEntries() > 10) {
125  if (innerME.find(fullName("PhiResidualPercentage")) == innerME.end()) {
126  bookWheelHistos(ibooker, wh, "PhiResidualPercentage");
127  }
128 
129  float rangeBin = validRange / (PhiResidual->GetBinWidth(1));
130  float center = (PhiResidual->GetNbinsX()) / 2.;
131  float perc =
132  (PhiResidual->Integral(floor(center - rangeBin), ceil(center + rangeBin))) / (PhiResidual->Integral());
133  fillWhPlot(innerME.find(fullName("PhiResidualPercentage"))->second, sect, stat, perc, false);
134  phiSummary = performLutTest(perc, thresholdWarnPhi, thresholdErrPhi);
135  if (detailedAnalysis)
136  cmsME.find(fullName("PhiPercentageSummary"))->second->Fill(perc);
137  }
138 
139  fillWhPlot(innerME.find(fullName("PhiLutSummary"))->second, sect, stat, phiSummary);
140 
141  if (detailedAnalysis) {
142  if ((phiSummary == 0) || (phiSummary == 3)) { //Information on the Peak
143 
144  if (innerME.find(fullName("PhiResidualMean")) == innerME.end()) {
145  bookWheelHistos(ibooker, wh, "PhiResidualMean");
146  bookWheelHistos(ibooker, wh, "PhiResidualRMS");
147  }
148 
149  float center = (PhiResidual->GetNbinsX()) / 2.;
150  float rangeBin = validRange / (PhiResidual->GetBinWidth(1));
151  PhiResidual->GetXaxis()->SetRange(floor(center - rangeBin), ceil(center + rangeBin));
152  float max = PhiResidual->GetMaximumBin();
153  float maxBin = PhiResidual->GetXaxis()->FindBin(max);
154  float nBinMax = 0.5 / (PhiResidual->GetBinWidth(1));
155  PhiResidual->GetXaxis()->SetRange(floor(maxBin - nBinMax), ceil(maxBin + nBinMax));
156  float Mean = PhiResidual->GetMean();
157  float rms = PhiResidual->GetRMS();
158 
159  fillWhPlot(innerME.find(fullName("PhiResidualMean"))->second, sect, stat, Mean);
160  fillWhPlot(innerME.find(fullName("PhiResidualRMS"))->second, sect, stat, rms);
161  }
162 
163  TH2F* TrackPhitkvsPhitrig = getHisto<TH2F>(igetter.get(getMEName("PhitkvsPhitrig", "Segment", chId)));
164 
165  if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries() > 100) {
166  float corr = TrackPhitkvsPhitrig->GetCorrelationFactor();
167  if (innerME.find(fullName("CorrelationFactorPhi")) == innerME.end()) {
168  bookWheelHistos(ibooker, wh, "CorrelationFactorPhi");
169  }
170  fillWhPlot(innerME.find(fullName("CorrelationFactorPhi"))->second, sect, stat, corr, false);
171  }
172  }
173 
174  // Make Phib Residual Summary
175  TH1F* PhibResidual = getHisto<TH1F>(igetter.get(getMEName("PhibResidual", "Segment", chId)));
176  int phibSummary = stat == 3 ? -1 : 1; // station 3 has no meaningful MB3 phi bending information
177 
178  if (stat != 3 && PhibResidual &&
179  PhibResidual->GetEntries() > 10) { // station 3 has no meaningful MB3 phi bending information
180 
181  if (innerME.find(fullName("PhibResidualPercentage")) == innerME.end()) {
182  bookWheelHistos(ibooker, wh, "PhibResidualPercentage");
183  }
184 
185  float rangeBin = validRange / (PhibResidual->GetBinWidth(1));
186  float center = (PhibResidual->GetNbinsX()) / 2.;
187  float perc =
188  (PhibResidual->Integral(floor(center - rangeBin), ceil(center + rangeBin))) / (PhibResidual->Integral());
189 
190  fillWhPlot(innerME.find(fullName("PhibResidualPercentage"))->second, sect, stat, perc, false);
191  phibSummary = performLutTest(perc, thresholdWarnPhiB, thresholdErrPhiB);
192  if (detailedAnalysis)
193  cmsME.find(fullName("PhibPercentageSummary"))->second->Fill(perc);
194  }
195 
196  fillWhPlot(innerME.find(fullName("PhibLutSummary"))->second, sect, stat, phibSummary);
197 
198  if (detailedAnalysis) {
199  if ((phibSummary == 0) || (phibSummary == 3)) {
200  if (innerME.find(fullName("PhibResidualMean")) == innerME.end()) {
201  bookWheelHistos(ibooker, wh, "PhibResidualMean");
202  bookWheelHistos(ibooker, wh, "PhibResidualRMS");
203  }
204 
205  float center = (PhibResidual->GetNbinsX()) / 2.;
206  float rangeBin = validRange / (PhibResidual->GetBinWidth(1));
207  PhibResidual->GetXaxis()->SetRange(floor(center - rangeBin), ceil(center + rangeBin));
208  float max = PhibResidual->GetMaximumBin();
209  float maxBin = PhibResidual->GetXaxis()->FindBin(max);
210  float nBinMax = 0.5 / (PhibResidual->GetBinWidth(1));
211  PhibResidual->GetXaxis()->SetRange(floor(maxBin - nBinMax), ceil(maxBin + nBinMax));
212  float Mean = PhibResidual->GetMean();
213  float rms = PhibResidual->GetRMS();
214 
215  fillWhPlot(innerME.find(fullName("PhibResidualMean"))->second, sect, stat, Mean);
216  fillWhPlot(innerME.find(fullName("PhibResidualRMS"))->second, sect, stat, rms);
217  }
218 
219  TH2F* TrackPhibtkvsPhibtrig = getHisto<TH2F>(igetter.get(getMEName("PhibtkvsPhibtrig", "Segment", chId)));
220  if (TrackPhibtkvsPhibtrig && TrackPhibtkvsPhibtrig->GetEntries() > 100) {
221  float corr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
222  if (innerME.find(fullName("CorrelationFactorPhib")) == innerME.end()) {
223  bookWheelHistos(ibooker, wh, "CorrelationFactorPhib");
224  }
225 
226  fillWhPlot(innerME.find(fullName("CorrelationFactorPhib"))->second, sect, stat, corr, false);
227  }
228  }
229  }
230  }
231  }
232 
233  // Barrel Summary Plots
234  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
235  trigSource = (*iTr);
236  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
237  hwSource = (*iHw);
238  for (int wh = -2; wh <= 2; ++wh) {
239  std::map<std::string, MonitorElement*>* innerME = &(whME[wh]);
240 
241  TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(fullName("PhiLutSummary"))->second);
242  TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(fullName("PhibLutSummary"))->second);
243 
244  for (int sect = 1; sect <= 12; ++sect) {
245  int phiSectorTotal = 0; // CB dai 1 occhio a questo
246  int phibSectorTotal = 0;
247  int nullphi = 0;
248  int nullphib = 0;
249  int phiStatus = 5;
250  int phibStatus = 5;
251  int glbStatus = 0;
252 
253  for (int stat = 1; stat <= 4; ++stat) {
254  if (phiWhSummary->GetBinContent(sect, stat) == 2) {
255  phiSectorTotal += 1;
256  glbStatus += 1;
257  }
258  if (phiWhSummary->GetBinContent(sect, stat) == 1)
259  nullphi += 1;
260  if (phibWhSummary->GetBinContent(sect, stat) == 2) {
261  phibSectorTotal += 1;
262  glbStatus += 1;
263  }
264  if (phibWhSummary->GetBinContent(sect, stat) == 1)
265  nullphib += 1;
266  }
267  if (nullphi != 4)
268  phiStatus = phiSectorTotal;
269  else
270  phiStatus = 5;
271  if (nullphib != 3)
272  phibStatus = phibSectorTotal;
273  else
274  phibStatus = 5;
275 
276  cmsME.find("TrigLutSummary")->second->setBinContent(sect, wh + wheelArrayShift, glbStatus);
277  cmsME.find(fullName("PhiLutSummary"))->second->setBinContent(sect, wh + wheelArrayShift, phiStatus);
278  cmsME.find(fullName("PhibLutSummary"))->second->setBinContent(sect, wh + wheelArrayShift, phibStatus);
279  }
280  }
281  }
282  }
283 }
constexpr int32_t ceil(float num)
std::vector< std::string > trigSources
constexpr unsigned int maxBin
int performLutTest(double perc, double threshold1, double threshold2)
Perform Lut Test logical operations.
void fillWhPlot(MonitorElement *plot, int sect, int stat, float value, bool lessIsBest=true)
Fill summary plots managing double MB4 chambers.
std::map< int, std::map< std::string, MonitorElement * > > whME
dictionary corr
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:680
std::string getMEName(std::string histoTag, std::string subfolder, const DTChamberId &chambid)
Get the ME name (by chamber)
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
std::map< std::string, MonitorElement * > cmsME
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
std::vector< std::string > hwSources
void bookWheelHistos(DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
Book the new MEs (for each wheel)
std::string fullName(std::string htype)
Create fullname from histo partial name.
const int wheelArrayShift

Member Data Documentation

◆ bookingdone

bool DTTriggerLutTest::bookingdone
private

Definition at line 52 of file DTTriggerLutTest.h.

◆ detailedAnalysis

bool DTTriggerLutTest::detailedAnalysis
private

Definition at line 50 of file DTTriggerLutTest.h.

◆ thresholdErrPhi

double DTTriggerLutTest::thresholdErrPhi
private

Definition at line 47 of file DTTriggerLutTest.h.

◆ thresholdErrPhiB

double DTTriggerLutTest::thresholdErrPhiB
private

Definition at line 48 of file DTTriggerLutTest.h.

◆ thresholdWarnPhi

double DTTriggerLutTest::thresholdWarnPhi
private

Definition at line 47 of file DTTriggerLutTest.h.

◆ thresholdWarnPhiB

double DTTriggerLutTest::thresholdWarnPhiB
private

Definition at line 48 of file DTTriggerLutTest.h.

◆ validRange

double DTTriggerLutTest::validRange
private

Definition at line 49 of file DTTriggerLutTest.h.

◆ wheelArrayShift

const int DTTriggerLutTest::wheelArrayShift = 3
protected

Definition at line 36 of file DTTriggerLutTest.h.