CMS 3D CMS Logo

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

#include <DTLocalTriggerLutTest.h>

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

 DTLocalTriggerLutTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTLocalTriggerLutTest () 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 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 (const edm::Run &r, const edm::EventSetup &c) override
 BeginRun. More...
 
void Bookings (DQMStore::IBooker &, DQMStore::IGetter &)
 
void runClientDiagnostic (DQMStore::IBooker &ibooker, DQMStore::IGetter &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 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 fillWhPlot (MonitorElement *plot, int sect, int stat, float value, bool lessIsBest=true)
 Fill summary plots managing double MB4 chambers. More...
 
int performLutTest (double mean, double RMS, double thresholdMean, double thresholdRMS)
 Perform Lut Test logical operations. More...
 

Private Attributes

bool bookingdone
 
bool doCorrStudy
 
double thresholdPhibMean
 
double thresholdPhibRMS
 
double thresholdPhiMean
 
double thresholdPhiRMS
 

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)
 

Detailed Description

Definition at line 17 of file DTLocalTriggerLutTest.h.

Constructor & Destructor Documentation

◆ DTLocalTriggerLutTest()

DTLocalTriggerLutTest::DTLocalTriggerLutTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 33 of file DTLocalTriggerLutTest.cc.

References edm::ParameterSet::getUntrackedParameter().

33  {
34  setConfig(ps, "DTLocalTriggerLut");
35  baseFolderTM = "DT/03-LocalTrigger-TM/";
36  thresholdPhiMean = ps.getUntrackedParameter<double>("thresholdPhiMean", 1.5);
37  thresholdPhiRMS = ps.getUntrackedParameter<double>("thresholdPhiRMS", .5);
38  thresholdPhibMean = ps.getUntrackedParameter<double>("thresholdPhibMean", 1.5);
39  thresholdPhibRMS = ps.getUntrackedParameter<double>("thresholdPhibRMS", .8);
40  doCorrStudy = ps.getUntrackedParameter<bool>("doCorrelationStudy", false);
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.

◆ ~DTLocalTriggerLutTest()

DTLocalTriggerLutTest::~DTLocalTriggerLutTest ( )
override

Destructor.

Definition at line 45 of file DTLocalTriggerLutTest.cc.

45 {}

Member Function Documentation

◆ beginRun()

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

BeginRun.

Definition at line 97 of file DTLocalTriggerLutTest.cc.

References DTLocalTriggerBaseTest::beginRun(), and DummyCfis::c.

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

◆ Bookings()

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

Definition at line 47 of file DTLocalTriggerLutTest.cc.

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

47  {
48  vector<string>::const_iterator iTr = trigSources.begin();
49  vector<string>::const_iterator trEnd = trigSources.end();
50  vector<string>::const_iterator iHw = hwSources.begin();
51  vector<string>::const_iterator hwEnd = hwSources.end();
52 
53  //Booking
54  if (parameters.getUntrackedParameter<bool>("staticBooking", true)) {
55  for (; iTr != trEnd; ++iTr) {
56  trigSource = (*iTr);
57  for (; iHw != hwEnd; ++iHw) {
58  hwSource = (*iHw);
59  // Loop over the TriggerUnits
60  for (int wh = -2; wh <= 2; ++wh) {
61  bookWheelHistos(ibooker, wh, "PhiResidualMean");
62  bookWheelHistos(ibooker, wh, "PhiResidualRMS");
63  bookWheelHistos(ibooker, wh, "PhibResidualMean");
64  bookWheelHistos(ibooker, wh, "PhibResidualRMS");
65  if (doCorrStudy) {
66  bookWheelHistos(ibooker, wh, "PhiTkvsTrigSlope");
67  bookWheelHistos(ibooker, wh, "PhiTkvsTrigIntercept");
68  bookWheelHistos(ibooker, wh, "PhiTkvsTrigCorr");
69  bookWheelHistos(ibooker, wh, "PhibTkvsTrigSlope");
70  bookWheelHistos(ibooker, wh, "PhibTkvsTrigIntercept");
71  bookWheelHistos(ibooker, wh, "PhibTkvsTrigCorr");
72  }
73  }
74  }
75  }
76  }
77 
78  // Summary test histo booking (only static)
79  for (iTr = trigSources.begin(); iTr != trEnd; ++iTr) {
80  trigSource = (*iTr);
81  for (iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
82  hwSource = (*iHw);
83  // Loop over the TriggerUnits
84  for (int wh = -2; wh <= 2; ++wh) {
85  bookWheelHistos(ibooker, wh, "PhiLutSummary");
86  bookWheelHistos(ibooker, wh, "PhibLutSummary");
87  }
88 
89  bookCmsHistos(ibooker, "PhiLutSummary");
90  bookCmsHistos(ibooker, "PhibLutSummary");
91  }
92  }
93 
94  bookingdone = true;
95 }
std::vector< std::string > trigSources
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 DTLocalTriggerLutTest::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 DTLocalTriggerLutTest.cc.

References plotFactory::plot.

309  {
310  if (sect > 12) {
311  int scsect = sect == 13 ? 4 : 10;
312  if ((fabs(value) > fabs(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 DTLocalTriggerLutTest::performLutTest ( double  mean,
double  RMS,
double  thresholdMean,
double  thresholdRMS 
)
private

Perform Lut Test logical operations.

Definition at line 302 of file DTLocalTriggerLutTest.cc.

References SiStripPI::mean, and RMS.

302  {
303  bool meanErr = fabs(mean) > thresholdMean;
304  bool rmsErr = RMS > thresholdRMS;
305 
306  return (meanErr || rmsErr) ? 2 + (meanErr != rmsErr) : 0;
307 }

◆ runClientDiagnostic()

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

Run client analysis.

Implements DTLocalTriggerBaseTest.

Definition at line 101 of file DTLocalTriggerLutTest.cc.

References validateAlignments::category, spr::find(), newFWLiteAna::fullName, dqm::implementation::IGetter::get(), dtFineDelayCorr_cfi::hwSource, dtFineDelayCorr_cfi::hwSources, edm::second(), edm_modernize_messagelogger::stat, L1TBPTX_cfi::testName, and DTChamberId::wheel().

101  {
102  if (!bookingdone)
103  Bookings(ibooker, igetter);
104 
105  // Loop over Trig & Hw sources
106  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
107  trigSource = (*iTr);
108  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
109  hwSource = (*iHw);
110  vector<const DTChamber*>::const_iterator chIt = muonGeom->chambers().begin();
111  vector<const DTChamber*>::const_iterator chEnd = muonGeom->chambers().end();
112  for (; chIt != chEnd; ++chIt) {
113  DTChamberId chId((*chIt)->id());
114  int wh = chId.wheel();
115  int sect = chId.sector();
116  int stat = chId.station();
117 
118  if (doCorrStudy) {
119  // Perform Correlation Plots analysis (TM + segment Phi)
120 
121  TH2F* TrackPhitkvsPhitrig = getHisto<TH2F>(igetter.get(getMEName("PhitkvsPhitrig", "Segment", chId)));
122 
123  if (TrackPhitkvsPhitrig && TrackPhitkvsPhitrig->GetEntries() > 10) {
124  // Fill client histos
125  if (whME[wh].find(fullName("PhiTkvsTrigCorr")) == whME[wh].end()) {
126  bookWheelHistos(ibooker, wh, "PhiTkvsTrigSlope");
127  bookWheelHistos(ibooker, wh, "PhiTkvsTrigIntercept");
128  bookWheelHistos(ibooker, wh, "PhiTkvsTrigCorr");
129  }
130 
131  TProfile* PhitkvsPhitrigProf = TrackPhitkvsPhitrig->ProfileX();
132  double phiInt = 0;
133  double phiSlope = 0;
134  double phiCorr = 0;
135  try {
136  TF1 ffPhi("mypol1", "pol1");
137  PhitkvsPhitrigProf->Fit(&ffPhi, "CQO");
138  phiInt = ffPhi.GetParameter(0);
139  phiSlope = ffPhi.GetParameter(1);
140  phiCorr = TrackPhitkvsPhitrig->GetCorrelationFactor();
141  } catch (cms::Exception& iException) {
142  edm::LogError(category()) << "[" << testName << "Test]: Error fitting PhitkvsPhitrig for Wheel " << wh
143  << " Sector " << sect << " Station " << stat;
144  }
145 
146  std::map<std::string, MonitorElement*>& innerME = whME[wh];
147  fillWhPlot(innerME.find(fullName("PhiTkvsTrigSlope"))->second, sect, stat, phiSlope - 1);
148  fillWhPlot(innerME.find(fullName("PhiTkvsTrigIntercept"))->second, sect, stat, phiInt);
149  fillWhPlot(innerME.find(fullName("PhiTkvsTrigCorr"))->second, sect, stat, phiCorr, false);
150  }
151 
152  // Perform Correlation Plots analysis (TM + segment Phib)
153  TH2F* TrackPhibtkvsPhibtrig = getHisto<TH2F>(igetter.get(getMEName("PhibtkvsPhibtrig", "Segment", chId)));
154 
155  if (stat != 3 && TrackPhibtkvsPhibtrig &&
156  TrackPhibtkvsPhibtrig->GetEntries() > 10) { // station 3 has no meaningful MB3 phi bending information
157 
158  // Fill client histos
159  if (whME[wh].find(fullName("PhibTkvsTrigCorr")) == whME[wh].end()) {
160  bookWheelHistos(ibooker, wh, "PhibTkvsTrigSlope");
161  bookWheelHistos(ibooker, wh, "PhibTkvsTrigIntercept");
162  bookWheelHistos(ibooker, wh, "PhibTkvsTrigCorr");
163  }
164 
165  TProfile* PhibtkvsPhibtrigProf = TrackPhibtkvsPhibtrig->ProfileX();
166  double phibInt = 0;
167  double phibSlope = 0;
168  double phibCorr = 0;
169  try {
170  TF1 ffPhib("ffPhib", "pol1");
171  PhibtkvsPhibtrigProf->Fit(&ffPhib, "CQO");
172  phibInt = ffPhib.GetParameter(0);
173  phibSlope = ffPhib.GetParameter(1);
174  phibCorr = TrackPhibtkvsPhibtrig->GetCorrelationFactor();
175  } catch (cms::Exception& iException) {
176  edm::LogError(category()) << "[" << testName << "Test]: Error fitting PhibtkvsPhibtrig for Wheel " << wh
177  << " Sector " << sect << " Station " << stat;
178  }
179 
180  std::map<std::string, MonitorElement*>& innerME = whME[wh];
181  fillWhPlot(innerME.find(fullName("PhibTkvsTrigSlope"))->second, sect, stat, phibSlope - 1);
182  fillWhPlot(innerME.find(fullName("PhibTkvsTrigIntercept"))->second, sect, stat, phibInt);
183  fillWhPlot(innerME.find(fullName("PhibTkvsTrigCorr"))->second, sect, stat, phibCorr, false);
184  }
185  }
186 
187  // Make Phi Residual Summary
188 
189  TH1F* PhiResidual = getHisto<TH1F>(igetter.get(getMEName("PhiResidual", "Segment", chId)));
190  int phiSummary = 1;
191 
192  if (PhiResidual && PhiResidual->GetEffectiveEntries() > 10) {
193  // Fill client histos
194  if (whME[wh].find(fullName("PhiResidualMean")) == whME[wh].end()) {
195  bookWheelHistos(ibooker, wh, "PhiResidualMean");
196  bookWheelHistos(ibooker, wh, "PhiResidualRMS");
197  }
198 
199  double peak = PhiResidual->GetBinCenter(PhiResidual->GetMaximumBin());
200  double phiMean = 0;
201  double phiRMS = 0;
202  try {
203  TF1 ffPhi("ffPhi", "gaus");
204  PhiResidual->Fit(&ffPhi, "CQO", "", peak - 5, peak + 5);
205  phiMean = ffPhi.GetParameter(1);
206  phiRMS = ffPhi.GetParameter(2);
207  } catch (cms::Exception& iException) {
208  edm::LogError(category()) << "[" << testName << "Test]: Error fitting PhiResidual for Wheel " << wh
209  << " Sector " << sect << " Station " << stat;
210  }
211 
212  std::map<std::string, MonitorElement*>& innerME = whME[wh];
213  fillWhPlot(innerME.find(fullName("PhiResidualMean"))->second, sect, stat, phiMean);
214  fillWhPlot(innerME.find(fullName("PhiResidualRMS"))->second, sect, stat, phiRMS);
215 
216  phiSummary = performLutTest(phiMean, phiRMS, thresholdPhiMean, thresholdPhiRMS);
217  }
218  fillWhPlot(whME[wh].find(fullName("PhiLutSummary"))->second, sect, stat, phiSummary);
219 
220  // Make Phib Residual Summary
221  TH1F* PhibResidual = getHisto<TH1F>(igetter.get(getMEName("PhibResidual", "Segment", chId)));
222  int phibSummary = stat == 3 ? 0 : 1; // station 3 has no meaningful MB3 phi bending information
223 
224  if (stat != 3 && PhibResidual &&
225  PhibResidual->GetEffectiveEntries() > 10) { // station 3 has no meaningful MB3 phi bending information
226 
227  // Fill client histos
228  if (whME[wh].find(fullName("PhibResidualMean")) == whME[wh].end()) {
229  bookWheelHistos(ibooker, wh, "PhibResidualMean");
230  bookWheelHistos(ibooker, wh, "PhibResidualRMS");
231  }
232 
233  double peak = PhibResidual->GetBinCenter(PhibResidual->GetMaximumBin());
234  double phibMean = 0;
235  double phibRMS = 0;
236  try {
237  TF1 ffPhib("ffPhib", "gaus");
238  PhibResidual->Fit(&ffPhib, "CQO", "", peak - 5, peak + 5);
239  phibMean = ffPhib.GetParameter(1);
240  phibRMS = ffPhib.GetParameter(2);
241  } catch (cms::Exception& iException) {
242  edm::LogError(category()) << "[" << testName << "Test]: Error fitting PhibResidual for Wheel " << wh
243  << " Sector " << sect << " Station " << stat;
244  }
245 
246  std::map<std::string, MonitorElement*>& innerME = whME[wh];
247  fillWhPlot(innerME.find(fullName("PhibResidualMean"))->second, sect, stat, phibMean);
248  fillWhPlot(innerME.find(fullName("PhibResidualRMS"))->second, sect, stat, phibRMS);
249 
250  phibSummary = performLutTest(phibMean, phibRMS, thresholdPhibMean, thresholdPhibRMS);
251  }
252  fillWhPlot(whME[wh].find(fullName("PhibLutSummary"))->second, sect, stat, phibSummary);
253  }
254  }
255  }
256 
257  // Barrel Summary Plots
258  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
259  trigSource = (*iTr);
260  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
261  hwSource = (*iHw);
262  for (int wh = -2; wh <= 2; ++wh) {
263  std::map<std::string, MonitorElement*>* innerME = &(whME[wh]);
264 
265  TH2F* phiWhSummary = getHisto<TH2F>(innerME->find(fullName("PhiLutSummary"))->second);
266  TH2F* phibWhSummary = getHisto<TH2F>(innerME->find(fullName("PhibLutSummary"))->second);
267  for (int sect = 1; sect <= 12; ++sect) {
268  int phiErr = 0;
269  int phibErr = 0;
270  int phiNoData = 0;
271  int phibNoData = 0;
272  for (int stat = 1; stat <= 4; ++stat) {
273  switch (static_cast<int>(phiWhSummary->GetBinContent(sect, stat))) {
274  case 1:
275  phiNoData++;
276  [[fallthrough]];
277  case 2:
278  case 3:
279  phiErr++;
280  }
281  switch (static_cast<int>(phibWhSummary->GetBinContent(sect, stat))) {
282  case 1:
283  phibNoData++;
284  [[fallthrough]];
285  case 2:
286  case 3:
287  phibErr++;
288  }
289  }
290  if (phiNoData == 4)
291  phiErr = 5;
292  if (phibNoData == 3)
293  phibErr = 5; // MB3 has no phib information
294  cmsME.find(fullName("PhiLutSummary"))->second->setBinContent(sect, wh + wheelArrayShift, phiErr);
295  cmsME.find(fullName("PhibLutSummary"))->second->setBinContent(sect, wh + wheelArrayShift, phibErr);
296  }
297  }
298  }
299  }
300 }
std::vector< std::string > trigSources
int performLutTest(double mean, double RMS, double thresholdMean, double thresholdRMS)
Perform Lut Test logical operations.
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
void fillWhPlot(MonitorElement *plot, int sect, int stat, float value, bool lessIsBest=true)
Fill summary plots managing double MB4 chambers.
U second(std::pair< T, U > const &p)
std::map< int, std::map< std::string, MonitorElement * > > whME
std::string category()
Get message logger name.
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
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:42
std::map< std::string, MonitorElement * > cmsME
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.

Member Data Documentation

◆ bookingdone

bool DTLocalTriggerLutTest::bookingdone
private

Definition at line 47 of file DTLocalTriggerLutTest.h.

◆ doCorrStudy

bool DTLocalTriggerLutTest::doCorrStudy
private

Definition at line 45 of file DTLocalTriggerLutTest.h.

◆ thresholdPhibMean

double DTLocalTriggerLutTest::thresholdPhibMean
private

Definition at line 43 of file DTLocalTriggerLutTest.h.

◆ thresholdPhibRMS

double DTLocalTriggerLutTest::thresholdPhibRMS
private

Definition at line 44 of file DTLocalTriggerLutTest.h.

◆ thresholdPhiMean

double DTLocalTriggerLutTest::thresholdPhiMean
private

Definition at line 43 of file DTLocalTriggerLutTest.h.

◆ thresholdPhiRMS

double DTLocalTriggerLutTest::thresholdPhiRMS
private

Definition at line 44 of file DTLocalTriggerLutTest.h.

◆ wheelArrayShift

const int DTLocalTriggerLutTest::wheelArrayShift = 3
protected

Definition at line 34 of file DTLocalTriggerLutTest.h.