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 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 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 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
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 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(), and DummyCfis::c.

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 437 of file DTLocalTriggerTest.cc.

References validateAlignments::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.

437  {
438  float glbPerc[5] = {1., 0.9, 0.6, 0.3, 0.01};
439  trigSource = "";
440  hwSource = "TM";
441 
442  int nSecReadout = 0;
443 
444  for (int wh = -2; wh <= 2; ++wh) {
445  for (int sect = 1; sect <= 12; ++sect) {
446  float maxErr = 8.;
447  int corr = cmsME.find(fullName("CorrFractionSummaryIn"))->second->getBinContent(sect, wh + wheelArrayShift);
448  int second = cmsME.find(fullName("2ndFractionSummaryIn"))->second->getBinContent(sect, wh + wheelArrayShift);
449  int lut = 0;
450  MonitorElement* lutsME = igetter.get(topFolder() + "Summaries/TrigLutSummary");
451  if (lutsME) {
452  lut = lutsME->getBinContent(sect, wh + wheelArrayShift);
453  maxErr += 4;
454  } else {
455  LogTrace(category()) << "[" << testName << "Test]: TM Lut test Summary histo not found." << endl;
456  }
457  (corr < 5 || second < 5) && nSecReadout++;
458  int errcode = ((corr < 5 ? corr : 4) + (second < 5 ? second : 4) + (lut < 5 ? lut : 4));
459  errcode = min(int((errcode / maxErr + 0.01) * 4), 4);
460  cmsME.find("TrigGlbSummary")->second->setBinContent(sect, wh + wheelArrayShift, glbPerc[errcode]);
461  }
462  }
463 
464  if (!nSecReadout)
465  cmsME.find("TrigGlbSummary")->second->Reset(); // white histo id TM is not RO
466 
467  string nEvtsName = "DT/EventInfo/Counters/nProcessedEventsTrigger";
468  MonitorElement* meProcEvts = igetter.get(nEvtsName);
469 
470  if (meProcEvts) {
471  int nProcEvts = meProcEvts->getFloatValue();
472  cmsME.find("TrigGlbSummary")->second->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
473  } else {
474  cmsME.find("TrigGlbSummary")->second->setEntries(nMinEvts + 1);
475  LogVerbatim(category()) << "[" << testName << "Test]: ME: " << nEvtsName << " not found!" << endl;
476  }
477 }
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:712
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, 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  if (besttrigs != 0)
153  corrFrac = besttrigsCorr / besttrigs;
154  else
155  corrFrac = 1;
156  if (trigs != 0)
157  secondFrac = trigsFlag2nd / trigs;
158  else
159  secondFrac = 0;
160 
161  if (corrFrac < parameters.getUntrackedParameter<double>("corrFracError", .5)) {
162  corrSummary = 2;
163  } else if (corrFrac < parameters.getUntrackedParameter<double>("corrFracWarning", .6)) {
164  corrSummary = 3;
165  } else {
166  corrSummary = 0;
167  }
168  if (secondFrac > parameters.getUntrackedParameter<double>("secondFracError", .2)) {
169  secondSummary = 2;
170  } else if (secondFrac > parameters.getUntrackedParameter<double>("secondFracWarning", .1)) {
171  secondSummary = 3;
172  } else {
173  secondSummary = 0;
174  }
175 
176  if (secME[sector_id].find(fullName("BXDistribPhiIn")) == secME[sector_id].end()) {
177  bookSectorHistos(ibooker, wh, sect, "QualDistribPhiIn");
178  bookSectorHistos(ibooker, wh, sect, "BXDistribPhiIn");
179  }
180 
181  TH1D* BXDistr = BXvsQual->ProjectionY();
182  TH1D* QualDistr = BXvsQual->ProjectionX();
183  std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
184 
185  int nbinsBX = BXDistr->GetNbinsX();
186  int firstBinCenter = static_cast<int>(BXDistr->GetBinCenter(1));
187  int lastBinCenter = static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
188  int iMin = firstBinCenter > -4 ? firstBinCenter : -4;
189  int iMax = lastBinCenter < 20 ? lastBinCenter : 20;
190  for (int ibin = iMin + 5; ibin <= iMax + 5; ++ibin) {
191  innerME->find(fullName("BXDistribPhiIn"))
192  ->second->setBinContent(ibin, stat, BXDistr->GetBinContent(ibin - 5 - firstBinCenter + 1));
193  }
194  for (int ibin = 1; ibin <= 7; ++ibin) {
195  innerME->find(fullName("QualDistribPhiIn"))
196  ->second->setBinContent(ibin, stat, QualDistr->GetBinContent(ibin));
197  }
198 
199  delete BXDistr;
200  delete QualDistr;
201  }
202 
203  std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
204 
205  if (whME[wh].find(fullName("CorrectBXPhiIn")) == whME[wh].end()) {
206  bookWheelHistos(ibooker, wh, "ResidualBXPhiIn");
207  bookWheelHistos(ibooker, wh, "CorrectBXPhiIn");
208  bookWheelHistos(ibooker, wh, "CorrFractionPhiIn");
209  bookWheelHistos(ibooker, wh, "2ndFractionPhiIn");
210  bookWheelHistos(ibooker, wh, "TriggerInclusivePhiIn");
211  }
212 
213  innerME = &(whME[wh]);
214  innerME->find(fullName("CorrectBXPhiIn"))->second->setBinContent(sect, stat, BX_OK + 0.00001);
215  innerME->find(fullName("ResidualBXPhiIn"))
216  ->second->setBinContent(sect, stat, round(25. * (BXMean - BX_OK)) + 0.00001);
217  innerME->find(fullName("CorrFractionPhiIn"))->second->setBinContent(sect, stat, corrFrac);
218  innerME->find(fullName("TriggerInclusivePhiIn"))->second->setBinContent(sect, stat, besttrigs);
219  innerME->find(fullName("2ndFractionPhiIn"))->second->setBinContent(sect, stat, secondFrac);
220 
221  whME[wh].find(fullName("CorrFractionSummaryIn"))->second->setBinContent(sect, stat, corrSummary);
222  whME[wh].find(fullName("2ndFractionSummaryIn"))->second->setBinContent(sect, stat, secondSummary);
223 
224  } // closes BXvsQual && Flag1stvsQual && BestQual
225 
226  if (hwSource == "TM") {
227  //Out part
228 
229  TH2F* BXvsQual = getHisto<TH2F>(igetter.get(getMEName("BXvsQual_Out", "LocalTriggerPhiOut", chId)));
230  TH1F* BestQual = getHisto<TH1F>(igetter.get(getMEName("BestQual_Out", "LocalTriggerPhiOut", chId)));
231  TH2F* Flag1stvsQual =
232  getHisto<TH2F>(igetter.get(getMEName("Flag1stvsQual_Out", "LocalTriggerPhiOut", chId)));
233  if (BXvsQual && Flag1stvsQual && BestQual) {
234  int corrSummary = 1;
235  int secondSummary = 1;
236  //default values for histograms
237  double BX_OK = 51.;
238  double BXMean = 51.;
239  double corrFrac = 0.;
240  double secondFrac = 0.;
241  double besttrigs = 0.;
242 
243  if (BestQual->GetEntries() > 1) {
244  TH1D* BXHH = BXvsQual->ProjectionY("", 6, 7, "");
245  TH1D* Flag1st = Flag1stvsQual->ProjectionY();
246  int BXOK_bin = BXHH->GetEntries() >= 1 ? BXHH->GetMaximumBin() : 51;
247  BXMean = BXHH->GetEntries() >= 1 ? BXHH->GetMean() : 51;
248  BX_OK = BXvsQual->GetYaxis()->GetBinCenter(BXOK_bin);
249  double trigsFlag2nd = Flag1st->GetBinContent(2);
250  double trigs = Flag1st->GetEntries();
251  besttrigs = BestQual->GetEntries();
252  double besttrigsCorr = BestQual->Integral(5, 7, "");
253  delete BXHH;
254  delete Flag1st;
255 
256  corrFrac = besttrigsCorr / besttrigs;
257  secondFrac = trigsFlag2nd / trigs;
258  if (corrFrac < parameters.getUntrackedParameter<double>("corrFracError", .5)) {
259  corrSummary = 2;
260  } else if (corrFrac < parameters.getUntrackedParameter<double>("corrFracWarning", .6)) {
261  corrSummary = 3;
262  } else {
263  corrSummary = 0;
264  }
265  if (secondFrac > parameters.getUntrackedParameter<double>("secondFracError", .2)) {
266  secondSummary = 2;
267  } else if (secondFrac > parameters.getUntrackedParameter<double>("secondFracWarning", .1)) {
268  secondSummary = 3;
269  } else {
270  secondSummary = 0;
271  }
272 
273  if (secME[sector_id].find(fullName("BXDistribPhiOut")) == secME[sector_id].end()) {
274  bookSectorHistos(ibooker, wh, sect, "QualDistribPhiOut");
275  bookSectorHistos(ibooker, wh, sect, "BXDistribPhiOut");
276  }
277 
278  TH1D* BXDistr = BXvsQual->ProjectionY();
279  TH1D* QualDistr = BXvsQual->ProjectionX();
280  std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
281 
282  int nbinsBX = BXDistr->GetNbinsX();
283  int firstBinCenter = static_cast<int>(BXDistr->GetBinCenter(1));
284  int lastBinCenter = static_cast<int>(BXDistr->GetBinCenter(nbinsBX));
285  int iMin = firstBinCenter > -4 ? firstBinCenter : -4;
286  int iMax = lastBinCenter < 20 ? lastBinCenter : 20;
287  for (int ibin = iMin + 5; ibin <= iMax + 5; ++ibin) {
288  innerME->find(fullName("BXDistribPhiOut"))
289  ->second->setBinContent(ibin, stat, BXDistr->GetBinContent(ibin - 5 - firstBinCenter + 1));
290  }
291  for (int ibin = 1; ibin <= 7; ++ibin) {
292  innerME->find(fullName("QualDistribPhiOut"))
293  ->second->setBinContent(ibin, stat, QualDistr->GetBinContent(ibin));
294  }
295 
296  delete BXDistr;
297  delete QualDistr;
298  }
299 
300  std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
301 
302  if (whME[wh].find(fullName("CorrectBXPhiOut")) == whME[wh].end()) {
303  bookWheelHistos(ibooker, wh, "ResidualBXPhiOut");
304  bookWheelHistos(ibooker, wh, "CorrectBXPhiOut");
305  bookWheelHistos(ibooker, wh, "CorrFractionPhiOut");
306  bookWheelHistos(ibooker, wh, "2ndFractionPhiOut");
307  bookWheelHistos(ibooker, wh, "TriggerInclusivePhiOut");
308  }
309 
310  innerME = &(whME[wh]);
311  innerME->find(fullName("CorrectBXPhiOut"))->second->setBinContent(sect, stat, BX_OK + 0.00001);
312  innerME->find(fullName("ResidualBXPhiOut"))
313  ->second->setBinContent(sect, stat, round(25. * (BXMean - BX_OK)) + 0.00001);
314  innerME->find(fullName("CorrFractionPhiOut"))->second->setBinContent(sect, stat, corrFrac);
315  innerME->find(fullName("TriggerInclusivePhiOut"))->second->setBinContent(sect, stat, besttrigs);
316  innerME->find(fullName("2ndFractionPhiOut"))->second->setBinContent(sect, stat, secondFrac);
317 
318  whME[wh].find(fullName("CorrFractionSummaryOut"))->second->setBinContent(sect, stat, corrSummary);
319  whME[wh].find(fullName("2ndFractionSummaryOut"))->second->setBinContent(sect, stat, secondSummary);
320 
321  } // closes BXvsQual && Flag1stvsQual && BestQual
322 
323  } // Check on TM source
324  //Theta part
325  if (hwSource == "TM") {
326  // Perform TM plot analysis (Theta ones)
327  TH2F* ThetaPosvsBX = getHisto<TH2F>(igetter.get(getMEName("PositionvsBX", "LocalTriggerTheta", chId)));
328  double BX_OK = 48;
329  // no theta triggers in stat 4!
330  if (ThetaPosvsBX && stat < 4 && ThetaPosvsBX->GetEntries() > 1) {
331  TH1D* BX = ThetaPosvsBX->ProjectionX();
332  int BXOK_bin = BX->GetEffectiveEntries() >= 1 ? BX->GetMaximumBin() : 10;
333  BX_OK = ThetaPosvsBX->GetXaxis()->GetBinCenter(BXOK_bin);
334  delete BX;
335 
336  if (whME[wh].find(fullName("CorrectBXTheta")) == whME[wh].end()) {
337  bookWheelHistos(ibooker, wh, "CorrectBXTheta");
338  }
339  std::map<std::string, MonitorElement*>* innerME = &(whME.find(wh)->second);
340  innerME->find(fullName("CorrectBXTheta"))->second->setBinContent(sect, stat, BX_OK + 0.00001);
341  }
342  // Adding trigger info to compute H fraction (11/10/2016) M.C.Fouz
343  TH2F* ThetaBXvsQual = getHisto<TH2F>(igetter.get(getMEName("ThetaBXvsQual", "LocalTriggerTheta", chId)));
344  TH1F* ThetaBestQual = getHisto<TH1F>(igetter.get(getMEName("ThetaBestQual", "LocalTriggerTheta", chId)));
345  if (ThetaBXvsQual && ThetaBestQual && stat < 4 && ThetaBestQual->GetEntries() > 1) {
346  double trigs = ThetaBestQual->GetEntries();
347  double trigsH = ThetaBestQual->GetBinContent(
348  2); // Note that for the new plots H is at bin=2 and not 4 as in DDU!!!!
349  if (whME[wh].find(fullName("HFractionTheta")) == whME[wh].end()) {
350  bookWheelHistos(ibooker, wh, "HFractionTheta");
351  }
352  std::map<std::string, MonitorElement*>* innerME = &(whME.find(wh)->second);
353  innerME->find(fullName("HFractionTheta"))->second->setBinContent(sect, stat, trigsH / trigs);
354  }
355  // END ADDING H Fraction info
356  }
357  }
358  }
359  }
360  }
361  }
362 
363  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
364  trigSource = (*iTr);
365  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
366  hwSource = (*iHw);
367  for (int wh = -2; wh <= 2; ++wh) {
368  std::map<std::string, MonitorElement*>* innerME = &(whME[wh]);
369  // In part
370  TH2F* corrWhSummaryIn = getHisto<TH2F>(innerME->find(fullName("CorrFractionSummaryIn"))->second);
371  TH2F* secondWhSummaryIn = getHisto<TH2F>(innerME->find(fullName("2ndFractionSummaryIn"))->second);
372  for (int sect = 1; sect <= 12; ++sect) {
373  int corrErr = 0;
374  int secondErr = 0;
375  int corrNoData = 0;
376  int secondNoData = 0;
377  for (int stat = 1; stat <= 4; ++stat) {
378  switch (static_cast<int>(corrWhSummaryIn->GetBinContent(sect, stat))) {
379  case 1:
380  corrNoData++;
381  [[fallthrough]];
382  case 2:
383  corrErr++;
384  }
385  switch (static_cast<int>(secondWhSummaryIn->GetBinContent(sect, stat))) {
386  case 1:
387  secondNoData++;
388  [[fallthrough]];
389  case 2:
390  secondErr++;
391  }
392  }
393  if (corrNoData == 4)
394  corrErr = 5;
395  if (secondNoData == 4)
396  secondErr = 5;
397  cmsME.find(fullName("CorrFractionSummaryIn"))->second->setBinContent(sect, wh + wheelArrayShift, corrErr);
398  cmsME.find(fullName("2ndFractionSummaryIn"))->second->setBinContent(sect, wh + wheelArrayShift, secondErr);
399  }
400  // Out part
401  TH2F* corrWhSummaryOut = getHisto<TH2F>(innerME->find(fullName("CorrFractionSummaryOut"))->second);
402  TH2F* secondWhSummaryOut = getHisto<TH2F>(innerME->find(fullName("2ndFractionSummaryOut"))->second);
403  for (int sect = 1; sect <= 12; ++sect) {
404  int corrErr = 0;
405  int secondErr = 0;
406  int corrNoData = 0;
407  int secondNoData = 0;
408  for (int stat = 1; stat <= 4; ++stat) {
409  switch (static_cast<int>(corrWhSummaryOut->GetBinContent(sect, stat))) {
410  case 1:
411  corrNoData++;
412  [[fallthrough]];
413  case 2:
414  corrErr++;
415  }
416  switch (static_cast<int>(secondWhSummaryOut->GetBinContent(sect, stat))) {
417  case 1:
418  secondNoData++;
419  [[fallthrough]];
420  case 2:
421  secondErr++;
422  }
423  }
424  if (corrNoData == 4)
425  corrErr = 5;
426  if (secondNoData == 4)
427  secondErr = 5;
428  cmsME.find(fullName("CorrFractionSummaryOut"))->second->setBinContent(sect, wh + wheelArrayShift, corrErr);
429  cmsME.find(fullName("2ndFractionSummaryOut"))->second->setBinContent(sect, wh + wheelArrayShift, secondErr);
430  }
431  }
432  }
433  }
434  fillGlobalSummary(igetter);
435 }
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:712
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.