CMS 3D CMS Logo

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

#include <DTLocalTriggerTest.h>

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

 DTLocalTriggerTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTLocalTriggerTest () 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 fillGlobalSummary (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 Attributes

bool bookingdone
 
int nMinEvts
 

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 14 of file DTLocalTriggerTest.h.

Constructor & Destructor Documentation

◆ DTLocalTriggerTest()

DTLocalTriggerTest::DTLocalTriggerTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 33 of file DTLocalTriggerTest.cc.

References edm::ParameterSet::getUntrackedParameter().

33  {
34  setConfig(ps, "DTLocalTrigger");
35  baseFolderTM = "DT/03-LocalTrigger-TM/";
36  nMinEvts = ps.getUntrackedParameter<int>("nEventsCert", 5000);
37 
38  bookingdone = false;
39 }
T getUntrackedParameter(std::string const &, T const &) const
void setConfig(const edm::ParameterSet &ps, std::string name)
Set configuration variables.

◆ ~DTLocalTriggerTest()

DTLocalTriggerTest::~DTLocalTriggerTest ( )
override

Destructor.

Definition at line 41 of file DTLocalTriggerTest.cc.

41 {}

Member Function Documentation

◆ beginRun()

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

BeginRun.

Definition at line 105 of file DTLocalTriggerTest.cc.

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

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

◆ Bookings()

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

Definition at line 43 of file DTLocalTriggerTest.cc.

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

43  {
44  vector<string>::const_iterator iTr = trigSources.begin();
45  vector<string>::const_iterator trEnd = trigSources.end();
46  vector<string>::const_iterator iHw = hwSources.begin();
47  vector<string>::const_iterator hwEnd = hwSources.end();
48 
49  //Booking
50  if (parameters.getUntrackedParameter<bool>("staticBooking", true)) {
51  for (; iTr != trEnd; ++iTr) {
52  trigSource = (*iTr);
53  for (; iHw != hwEnd; ++iHw) {
54  hwSource = (*iHw);
55  // Loop over the TriggerUnits
56  for (int wh = -2; wh <= 2; ++wh) {
57  for (int sect = 1; sect <= 12; ++sect) {
58  bookSectorHistos(ibooker, wh, sect, "BXDistribPhiIn");
59  bookSectorHistos(ibooker, wh, sect, "QualDistribPhiIn");
60  bookSectorHistos(ibooker, wh, sect, "BXDistribPhiOut");
61  bookSectorHistos(ibooker, wh, sect, "QualDistribPhiOut");
62  }
63 
64  bookWheelHistos(ibooker, wh, "CorrectBXPhiIn");
65  bookWheelHistos(ibooker, wh, "ResidualBXPhiIn");
66  bookWheelHistos(ibooker, wh, "CorrFractionPhiIn");
67  bookWheelHistos(ibooker, wh, "2ndFractionPhiIn");
68  bookWheelHistos(ibooker, wh, "TriggerInclusivePhiIn");
69 
70  bookWheelHistos(ibooker, wh, "CorrectBXPhiOut");
71  bookWheelHistos(ibooker, wh, "ResidualBXPhiOut");
72  bookWheelHistos(ibooker, wh, "CorrFractionPhiOut");
73  bookWheelHistos(ibooker, wh, "2ndFractionPhiOut");
74  bookWheelHistos(ibooker, wh, "TriggerInclusivePhiOut");
75  }
76  }
77  }
78  }
79  // Summary test histo booking (only static)
80  for (iTr = trigSources.begin(); iTr != trEnd; ++iTr) {
81  trigSource = (*iTr);
82  for (iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
83  hwSource = (*iHw);
84  // Loop over the TriggerUnits
85  for (int wh = -2; wh <= 2; ++wh) {
86  bookWheelHistos(ibooker, wh, "CorrFractionSummaryIn", "Summaries");
87  bookWheelHistos(ibooker, wh, "2ndFractionSummaryIn", "Summaries");
88  bookWheelHistos(ibooker, wh, "CorrFractionSummaryOut", "Summaries");
89  bookWheelHistos(ibooker, wh, "2ndFractionSummaryOut", "Summaries");
90  }
91  bookCmsHistos(ibooker, "CorrFractionSummaryIn");
92  bookCmsHistos(ibooker, "2ndFractionSummaryIn");
93  bookCmsHistos(ibooker, "CorrFractionSummaryOut");
94  bookCmsHistos(ibooker, "2ndFractionSummaryOut");
95 
96  if (hwSource == "TM") {
97  bookCmsHistos(ibooker, "TrigGlbSummary", "", true);
98  }
99  }
100  }
101 
102  bookingdone = true;
103 }
std::vector< std::string > trigSources
T getUntrackedParameter(std::string const &, T const &) const
void bookSectorHistos(DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
Book the new MEs (for each sector)
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)

◆ fillGlobalSummary()

void DTLocalTriggerTest::fillGlobalSummary ( DQMStore::IGetter igetter)
protected

Definition at line 430 of file DTLocalTriggerTest.cc.

References taus_updatedMVAIds_cff::category, alignCSCRings::corr, newFWLiteAna::fullName, dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getFloatValue(), dtFineDelayCorr_cfi::hwSource, LogTrace, edm::min(), edm::second(), and L1TBPTX_cfi::testName.

430  {
431  float glbPerc[5] = {1., 0.9, 0.6, 0.3, 0.01};
432  trigSource = "";
433  hwSource = "TM";
434 
435  int nSecReadout = 0;
436 
437  for (int wh = -2; wh <= 2; ++wh) {
438  for (int sect = 1; sect <= 12; ++sect) {
439  float maxErr = 8.;
440  int corr = cmsME.find(fullName("CorrFractionSummaryIn"))->second->getBinContent(sect, wh + wheelArrayShift);
441  int second = cmsME.find(fullName("2ndFractionSummaryIn"))->second->getBinContent(sect, wh + wheelArrayShift);
442  int lut = 0;
443  MonitorElement* lutsME = igetter.get(topFolder() + "Summaries/TrigLutSummary");
444  if (lutsME) {
445  lut = lutsME->getBinContent(sect, wh + wheelArrayShift);
446  maxErr += 4;
447  } else {
448  LogTrace(category()) << "[" << testName << "Test]: TM Lut test Summary histo not found." << endl;
449  }
450  (corr < 5 || second < 5) && nSecReadout++;
451  int errcode = ((corr < 5 ? corr : 4) + (second < 5 ? second : 4) + (lut < 5 ? lut : 4));
452  errcode = min(int((errcode / maxErr + 0.01) * 4), 4);
453  cmsME.find("TrigGlbSummary")->second->setBinContent(sect, wh + wheelArrayShift, glbPerc[errcode]);
454  }
455  }
456 
457  if (!nSecReadout)
458  cmsME.find("TrigGlbSummary")->second->Reset(); // white histo id TM is not RO
459 
460  string nEvtsName = "DT/EventInfo/Counters/nProcessedEventsTrigger";
461  MonitorElement* meProcEvts = igetter.get(nEvtsName);
462 
463  if (meProcEvts) {
464  int nProcEvts = meProcEvts->getFloatValue();
465  cmsME.find("TrigGlbSummary")->second->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
466  } else {
467  cmsME.find("TrigGlbSummary")->second->setEntries(nMinEvts + 1);
468  LogVerbatim(category()) << "[" << testName << "Test]: ME: " << nEvtsName << " not found!" << endl;
469  }
470 }
Log< level::Info, true > LogVerbatim
std::string & topFolder()
Get top folder name.
#define LogTrace(id)
U second(std::pair< T, U > const &p)
dictionary corr
virtual double getFloatValue() const
std::string category()
Get message logger name.
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
std::map< std::string, MonitorElement * > cmsME
std::string fullName(std::string htype)
Create fullname from histo partial name.
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ runClientDiagnostic()

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

Run client analysis.

Implements DTLocalTriggerBaseTest.

Definition at line 109 of file DTLocalTriggerTest.cc.

References L1TStage2uGTEmulatorClient_cff::BX, mps_fire::end, spr::find(), newFWLiteAna::fullName, dqm::implementation::IGetter::get(), dtFineDelayCorr_cfi::hwSource, dtFineDelayCorr_cfi::hwSources, and edm_modernize_messagelogger::stat.

109  {
110  if (!bookingdone)
111  Bookings(ibooker, igetter);
112 
113  // Loop over Trig & Hw sources
114  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
115  trigSource = (*iTr);
116 
117  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
118  hwSource = (*iHw);
119  // Loop over the TriggerUnits
120  for (int stat = 1; stat <= 4; ++stat) {
121  for (int wh = -2; wh <= 2; ++wh) {
122  for (int sect = 1; sect <= 12; ++sect) {
123  DTChamberId chId(wh, stat, sect);
124  int sector_id = (wh + wheelArrayShift) + (sect - 1) * 5;
125 
126  // IN part
127  TH2F* BXvsQual = getHisto<TH2F>(igetter.get(getMEName("BXvsQual_In", "LocalTriggerPhiIn", chId)));
128  TH1F* BestQual = getHisto<TH1F>(igetter.get(getMEName("BestQual_In", "LocalTriggerPhiIn", chId)));
129  TH2F* Flag1stvsQual = getHisto<TH2F>(igetter.get(getMEName("Flag1stvsQual_In", "LocalTriggerPhiIn", chId)));
130  if (BXvsQual && Flag1stvsQual && BestQual) {
131  int corrSummary = 1;
132  int secondSummary = 1;
133  //default values for histograms
134  double BX_OK = 51.;
135  double BXMean = 51.;
136  double corrFrac = 0.;
137  double secondFrac = 0.;
138  double besttrigs = 0.;
139  if (BestQual->GetEntries() > 1) {
140  TH1D* BXHH = BXvsQual->ProjectionY("", 6, 7, "");
141  TH1D* Flag1st = Flag1stvsQual->ProjectionY();
142  int BXOK_bin = BXHH->GetEntries() >= 1 ? BXHH->GetMaximumBin() : 51;
143  BXMean = BXHH->GetEntries() >= 1 ? BXHH->GetMean() : 51;
144  BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
145  double trigsFlag2nd = Flag1st->GetBinContent(2);
146  double trigs = Flag1st->GetEntries();
147  besttrigs = BestQual->GetEntries();
148  double besttrigsCorr = BestQual->Integral(5, 7, "");
149  delete BXHH;
150  delete Flag1st;
151 
152  corrFrac = besttrigsCorr / besttrigs;
153  secondFrac = trigsFlag2nd / trigs;
154  if (corrFrac < parameters.getUntrackedParameter<double>("corrFracError", .5)) {
155  corrSummary = 2;
156  } else if (corrFrac < parameters.getUntrackedParameter<double>("corrFracWarning", .6)) {
157  corrSummary = 3;
158  } else {
159  corrSummary = 0;
160  }
161  if (secondFrac > parameters.getUntrackedParameter<double>("secondFracError", .2)) {
162  secondSummary = 2;
163  } else if (secondFrac > parameters.getUntrackedParameter<double>("secondFracWarning", .1)) {
164  secondSummary = 3;
165  } else {
166  secondSummary = 0;
167  }
168 
169  if (secME[sector_id].find(fullName("BXDistribPhiIn")) == secME[sector_id].end()) {
170  bookSectorHistos(ibooker, wh, sect, "QualDistribPhiIn");
171  bookSectorHistos(ibooker, wh, sect, "BXDistribPhiIn");
172  }
173 
174  TH1D* BXDistr = BXvsQual->ProjectionY();
175  TH1D* QualDistr = BXvsQual->ProjectionX();
176  std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
177 
178  int nbinsBX = BXDistr->GetNbinsX();
179  int firstBinCenter = static_cast<int>(BXDistr->GetBinCenter(1));
180  int lastBinCenter = static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
181  int iMin = firstBinCenter > -4 ? firstBinCenter : -4;
182  int iMax = lastBinCenter < 20 ? lastBinCenter : 20;
183  for (int ibin = iMin + 5; ibin <= iMax + 5; ++ibin) {
184  innerME->find(fullName("BXDistribPhiIn"))
185  ->second->setBinContent(ibin, stat, BXDistr->GetBinContent(ibin - 5 - firstBinCenter + 1));
186  }
187  for (int ibin = 1; ibin <= 7; ++ibin) {
188  innerME->find(fullName("QualDistribPhiIn"))
189  ->second->setBinContent(ibin, stat, QualDistr->GetBinContent(ibin));
190  }
191 
192  delete BXDistr;
193  delete QualDistr;
194  }
195 
196  std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
197 
198  if (whME[wh].find(fullName("CorrectBXPhiIn")) == whME[wh].end()) {
199  bookWheelHistos(ibooker, wh, "ResidualBXPhiIn");
200  bookWheelHistos(ibooker, wh, "CorrectBXPhiIn");
201  bookWheelHistos(ibooker, wh, "CorrFractionPhiIn");
202  bookWheelHistos(ibooker, wh, "2ndFractionPhiIn");
203  bookWheelHistos(ibooker, wh, "TriggerInclusivePhiIn");
204  }
205 
206  innerME = &(whME[wh]);
207  innerME->find(fullName("CorrectBXPhiIn"))->second->setBinContent(sect, stat, BX_OK + 0.00001);
208  innerME->find(fullName("ResidualBXPhiIn"))
209  ->second->setBinContent(sect, stat, round(25. * (BXMean - BX_OK)) + 0.00001);
210  innerME->find(fullName("CorrFractionPhiIn"))->second->setBinContent(sect, stat, corrFrac);
211  innerME->find(fullName("TriggerInclusivePhiIn"))->second->setBinContent(sect, stat, besttrigs);
212  innerME->find(fullName("2ndFractionPhiIn"))->second->setBinContent(sect, stat, secondFrac);
213 
214  whME[wh].find(fullName("CorrFractionSummaryIn"))->second->setBinContent(sect, stat, corrSummary);
215  whME[wh].find(fullName("2ndFractionSummaryIn"))->second->setBinContent(sect, stat, secondSummary);
216 
217  } // closes BXvsQual && Flag1stvsQual && BestQual
218 
219  if (hwSource == "TM") {
220  //Out part
221 
222  TH2F* BXvsQual = getHisto<TH2F>(igetter.get(getMEName("BXvsQual_Out", "LocalTriggerPhiOut", chId)));
223  TH1F* BestQual = getHisto<TH1F>(igetter.get(getMEName("BestQual_Out", "LocalTriggerPhiOut", chId)));
224  TH2F* Flag1stvsQual =
225  getHisto<TH2F>(igetter.get(getMEName("Flag1stvsQual_Out", "LocalTriggerPhiOut", chId)));
226  if (BXvsQual && Flag1stvsQual && BestQual) {
227  int corrSummary = 1;
228  int secondSummary = 1;
229  //default values for histograms
230  double BX_OK = 51.;
231  double BXMean = 51.;
232  double corrFrac = 0.;
233  double secondFrac = 0.;
234  double besttrigs = 0.;
235 
236  if (BestQual->GetEntries() > 1) {
237  TH1D* BXHH = BXvsQual->ProjectionY("", 6, 7, "");
238  TH1D* Flag1st = Flag1stvsQual->ProjectionY();
239  int BXOK_bin = BXHH->GetEntries() >= 1 ? BXHH->GetMaximumBin() : 51;
240  BXMean = BXHH->GetEntries() >= 1 ? BXHH->GetMean() : 51;
241  BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
242  double trigsFlag2nd = Flag1st->GetBinContent(2);
243  double trigs = Flag1st->GetEntries();
244  besttrigs = BestQual->GetEntries();
245  double besttrigsCorr = BestQual->Integral(5, 7, "");
246  delete BXHH;
247  delete Flag1st;
248 
249  corrFrac = besttrigsCorr / besttrigs;
250  secondFrac = trigsFlag2nd / trigs;
251  if (corrFrac < parameters.getUntrackedParameter<double>("corrFracError", .5)) {
252  corrSummary = 2;
253  } else if (corrFrac < parameters.getUntrackedParameter<double>("corrFracWarning", .6)) {
254  corrSummary = 3;
255  } else {
256  corrSummary = 0;
257  }
258  if (secondFrac > parameters.getUntrackedParameter<double>("secondFracError", .2)) {
259  secondSummary = 2;
260  } else if (secondFrac > parameters.getUntrackedParameter<double>("secondFracWarning", .1)) {
261  secondSummary = 3;
262  } else {
263  secondSummary = 0;
264  }
265 
266  if (secME[sector_id].find(fullName("BXDistribPhiOut")) == secME[sector_id].end()) {
267  bookSectorHistos(ibooker, wh, sect, "QualDistribPhiOut");
268  bookSectorHistos(ibooker, wh, sect, "BXDistribPhiOut");
269  }
270 
271  TH1D* BXDistr = BXvsQual->ProjectionY();
272  TH1D* QualDistr = BXvsQual->ProjectionX();
273  std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
274 
275  int nbinsBX = BXDistr->GetNbinsX();
276  int firstBinCenter = static_cast<int>(BXDistr->GetBinCenter(1));
277  int lastBinCenter = static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
278  int iMin = firstBinCenter > -4 ? firstBinCenter : -4;
279  int iMax = lastBinCenter < 20 ? lastBinCenter : 20;
280  for (int ibin = iMin + 5; ibin <= iMax + 5; ++ibin) {
281  innerME->find(fullName("BXDistribPhiOut"))
282  ->second->setBinContent(ibin, stat, BXDistr->GetBinContent(ibin - 5 - firstBinCenter + 1));
283  }
284  for (int ibin = 1; ibin <= 7; ++ibin) {
285  innerME->find(fullName("QualDistribPhiOut"))
286  ->second->setBinContent(ibin, stat, QualDistr->GetBinContent(ibin));
287  }
288 
289  delete BXDistr;
290  delete QualDistr;
291  }
292 
293  std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
294 
295  if (whME[wh].find(fullName("CorrectBXPhiOut")) == whME[wh].end()) {
296  bookWheelHistos(ibooker, wh, "ResidualBXPhiOut");
297  bookWheelHistos(ibooker, wh, "CorrectBXPhiOut");
298  bookWheelHistos(ibooker, wh, "CorrFractionPhiOut");
299  bookWheelHistos(ibooker, wh, "2ndFractionPhiOut");
300  bookWheelHistos(ibooker, wh, "TriggerInclusivePhiOut");
301  }
302 
303  innerME = &(whME[wh]);
304  innerME->find(fullName("CorrectBXPhiOut"))->second->setBinContent(sect, stat, BX_OK + 0.00001);
305  innerME->find(fullName("ResidualBXPhiOut"))
306  ->second->setBinContent(sect, stat, round(25. * (BXMean - BX_OK)) + 0.00001);
307  innerME->find(fullName("CorrFractionPhiOut"))->second->setBinContent(sect, stat, corrFrac);
308  innerME->find(fullName("TriggerInclusivePhiOut"))->second->setBinContent(sect, stat, besttrigs);
309  innerME->find(fullName("2ndFractionPhiOut"))->second->setBinContent(sect, stat, secondFrac);
310 
311  whME[wh].find(fullName("CorrFractionSummaryOut"))->second->setBinContent(sect, stat, corrSummary);
312  whME[wh].find(fullName("2ndFractionSummaryOut"))->second->setBinContent(sect, stat, secondSummary);
313 
314  } // closes BXvsQual && Flag1stvsQual && BestQual
315 
316  } // Check on TM source
317  //Theta part
318  if (hwSource == "TM") {
319  // Perform TM plot analysis (Theta ones)
320  TH2F* ThetaPosvsBX = getHisto<TH2F>(igetter.get(getMEName("PositionvsBX", "LocalTriggerTheta", chId)));
321  double BX_OK = 48;
322  // no theta triggers in stat 4!
323  if (ThetaPosvsBX && stat < 4 && ThetaPosvsBX->GetEntries() > 1) {
324  TH1D* BX = ThetaPosvsBX->ProjectionX();
325  int BXOK_bin = BX->GetEffectiveEntries() >= 1 ? BX->GetMaximumBin() : 10;
326  BX_OK = ThetaPosvsBX->GetXaxis()->GetBinCenter(BXOK_bin);
327  delete BX;
328 
329  if (whME[wh].find(fullName("CorrectBXTheta")) == whME[wh].end()) {
330  bookWheelHistos(ibooker, wh, "CorrectBXTheta");
331  }
332  std::map<std::string, MonitorElement*>* innerME = &(whME.find(wh)->second);
333  innerME->find(fullName("CorrectBXTheta"))->second->setBinContent(sect, stat, BX_OK + 0.00001);
334  }
335  // Adding trigger info to compute H fraction (11/10/2016) M.C.Fouz
336  TH2F* ThetaBXvsQual = getHisto<TH2F>(igetter.get(getMEName("ThetaBXvsQual", "LocalTriggerTheta", chId)));
337  TH1F* ThetaBestQual = getHisto<TH1F>(igetter.get(getMEName("ThetaBestQual", "LocalTriggerTheta", chId)));
338  if (ThetaBXvsQual && ThetaBestQual && stat < 4 && ThetaBestQual->GetEntries() > 1) {
339  double trigs = ThetaBestQual->GetEntries();
340  double trigsH = ThetaBestQual->GetBinContent(
341  2); // Note that for the new plots H is at bin=2 and not 4 as in DDU!!!!
342  if (whME[wh].find(fullName("HFractionTheta")) == whME[wh].end()) {
343  bookWheelHistos(ibooker, wh, "HFractionTheta");
344  }
345  std::map<std::string, MonitorElement*>* innerME = &(whME.find(wh)->second);
346  innerME->find(fullName("HFractionTheta"))->second->setBinContent(sect, stat, trigsH / trigs);
347  }
348  // END ADDING H Fraction info
349  }
350  }
351  }
352  }
353  }
354  }
355 
356  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
357  trigSource = (*iTr);
358  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
359  hwSource = (*iHw);
360  for (int wh = -2; wh <= 2; ++wh) {
361  std::map<std::string, MonitorElement*>* innerME = &(whME[wh]);
362  // In part
363  TH2F* corrWhSummaryIn = getHisto<TH2F>(innerME->find(fullName("CorrFractionSummaryIn"))->second);
364  TH2F* secondWhSummaryIn = getHisto<TH2F>(innerME->find(fullName("2ndFractionSummaryIn"))->second);
365  for (int sect = 1; sect <= 12; ++sect) {
366  int corrErr = 0;
367  int secondErr = 0;
368  int corrNoData = 0;
369  int secondNoData = 0;
370  for (int stat = 1; stat <= 4; ++stat) {
371  switch (static_cast<int>(corrWhSummaryIn->GetBinContent(sect, stat))) {
372  case 1:
373  corrNoData++;
374  [[fallthrough]];
375  case 2:
376  corrErr++;
377  }
378  switch (static_cast<int>(secondWhSummaryIn->GetBinContent(sect, stat))) {
379  case 1:
380  secondNoData++;
381  [[fallthrough]];
382  case 2:
383  secondErr++;
384  }
385  }
386  if (corrNoData == 4)
387  corrErr = 5;
388  if (secondNoData == 4)
389  secondErr = 5;
390  cmsME.find(fullName("CorrFractionSummaryIn"))->second->setBinContent(sect, wh + wheelArrayShift, corrErr);
391  cmsME.find(fullName("2ndFractionSummaryIn"))->second->setBinContent(sect, wh + wheelArrayShift, secondErr);
392  }
393  // Out part
394  TH2F* corrWhSummaryOut = getHisto<TH2F>(innerME->find(fullName("CorrFractionSummaryOut"))->second);
395  TH2F* secondWhSummaryOut = getHisto<TH2F>(innerME->find(fullName("2ndFractionSummaryOut"))->second);
396  for (int sect = 1; sect <= 12; ++sect) {
397  int corrErr = 0;
398  int secondErr = 0;
399  int corrNoData = 0;
400  int secondNoData = 0;
401  for (int stat = 1; stat <= 4; ++stat) {
402  switch (static_cast<int>(corrWhSummaryOut->GetBinContent(sect, stat))) {
403  case 1:
404  corrNoData++;
405  [[fallthrough]];
406  case 2:
407  corrErr++;
408  }
409  switch (static_cast<int>(secondWhSummaryOut->GetBinContent(sect, stat))) {
410  case 1:
411  secondNoData++;
412  [[fallthrough]];
413  case 2:
414  secondErr++;
415  }
416  }
417  if (corrNoData == 4)
418  corrErr = 5;
419  if (secondNoData == 4)
420  secondErr = 5;
421  cmsME.find(fullName("CorrFractionSummaryOut"))->second->setBinContent(sect, wh + wheelArrayShift, corrErr);
422  cmsME.find(fullName("2ndFractionSummaryOut"))->second->setBinContent(sect, wh + wheelArrayShift, secondErr);
423  }
424  }
425  }
426  }
427  fillGlobalSummary(igetter);
428 }
std::vector< std::string > trigSources
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
T getUntrackedParameter(std::string const &, T const &) const
void fillGlobalSummary(DQMStore::IGetter &)
std::map< int, std::map< std::string, MonitorElement * > > whME
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
std::string getMEName(std::string histoTag, std::string subfolder, const DTChamberId &chambid)
Get the ME name (by chamber)
void bookSectorHistos(DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
Book the new MEs (for each sector)
std::map< std::string, MonitorElement * > cmsME
std::vector< std::string > hwSources
std::map< int, std::map< std::string, MonitorElement * > > secME
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 DTLocalTriggerTest::bookingdone
private

Definition at line 39 of file DTLocalTriggerTest.h.

◆ nMinEvts

int DTLocalTriggerTest::nMinEvts
private

Definition at line 37 of file DTLocalTriggerTest.h.

◆ wheelArrayShift

const int DTLocalTriggerTest::wheelArrayShift = 3
protected

Definition at line 34 of file DTLocalTriggerTest.h.