CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::TrigPrimClient Class Reference

#include <TrigPrimClient.h>

Inheritance diagram for ecaldqm::TrigPrimClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Member Functions

void producePlots (ProcessType) override
 
 TrigPrimClient ()
 
 ~TrigPrimClient () override
 
- Public Member Functions inherited from ecaldqm::DQWorkerClient
void bookMEs (DQMStore::IBooker &) override
 
 DQWorkerClient ()
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void releaseMEs () override
 
void releaseSource ()
 
virtual void resetMEs ()
 
void resetPerLumi ()
 
bool retrieveSource (DQMStore::IGetter &, ProcessType)
 
bool runsOn (ProcessType _type) const
 
void setStatusManager (StatusManager const &_manager)
 
 ~DQWorkerClient () override
 
- Public Member Functions inherited from ecaldqm::DQWorker
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQWorker ()
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
std::string const & getName () const
 
bool onlineMode () const
 
void setEventNumber (edm::EventNumber_t _e)
 
void setLumiNumber (edm::LuminosityBlockNumber_t _l)
 
void setRunNumber (edm::RunNumber_t _r)
 
void setTime (time_t _t)
 
virtual ~DQWorker ()(false)
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

float errorFractionThreshold_
 
int minEntries_
 
float TTF4MaskingAlarmThreshold_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::DQWorkerClient
enum  ProcessType { kLumi, kJob, nProcessType }
 
enum  Quality {
  kBad = 0, kGood = 1, kUnknown = 2, kMBad = 3,
  kMGood = 4, kMUnknown = 5
}
 
- Static Public Member Functions inherited from ecaldqm::DQWorkerClient
static void fillDescriptions (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from ecaldqm::DQWorker
static void fillDescriptions (edm::ParameterSetDescription &_desc)
 
- Protected Types inherited from ecaldqm::DQWorker
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from ecaldqm::DQWorkerClient
void setME (edm::ParameterSet const &_ps) final
 
void setSource (edm::ParameterSet const &) override
 
void towerAverage_ (MESet &, MESet const &, float)
 
bool using_ (std::string const &_name, ProcessType _type=kJob) const
 
- Protected Member Functions inherited from ecaldqm::DQWorker
void initialize (std::string const &_name, edm::ParameterSet const &)
 
void print_ (std::string const &, int=0) const
 
void setVerbosity (int _verbosity)
 
- Protected Attributes inherited from ecaldqm::DQWorkerClient
bool hasLumiPlots_
 
std::set< std::string > qualitySummaries_
 
MESetCollection sources_
 
StatusManager const * statusManager_
 
- Protected Attributes inherited from ecaldqm::DQWorker
bool booked_
 
MESetCollection MEs_
 
std::string name_
 
bool onlineMode_
 
Timestamp timestamp_
 
int verbosity_
 
bool willConvertToEDM_
 

Detailed Description

Definition at line 7 of file TrigPrimClient.h.

Constructor & Destructor Documentation

ecaldqm::TrigPrimClient::TrigPrimClient ( )

Definition at line 13 of file TrigPrimClient.cc.

References ecaldqm::DQWorkerClient::qualitySummaries_.

15  qualitySummaries_.insert("EmulQualitySummary");
16  }
std::set< std::string > qualitySummaries_
ecaldqm::TrigPrimClient::~TrigPrimClient ( )
inlineoverride

Definition at line 10 of file TrigPrimClient.h.

References producePlots(), and setParams().

10 {}

Member Function Documentation

void ecaldqm::TrigPrimClient::producePlots ( ProcessType  )
overridevirtual

Implements ecaldqm::DQWorkerClient.

Definition at line 24 of file TrigPrimClient.cc.

References funct::abs(), ecaldqm::dccId(), DEFINE_ECALDQM_WORKER, EcalTrigTowerDetId::detIdFromDenseIndex(), EcalBarrel, EcalEndcap, errorFractionThreshold_, dqmMemoryStats::float, ecaldqm::DQWorker::Timestamp::iLumi, ecaldqm::DQWorkerClient::kBad, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::DQWorkerClient::kGood, ecaldqm::DQWorkerClient::kMBad, ecaldqm::DQWorkerClient::kMGood, ecaldqm::DQWorkerClient::kMUnknown, EcalTrigTowerDetId::kSizeForDenseIndexing, ecaldqm::DQWorkerClient::kUnknown, ecaldqm::DQWorker::MEs_, minEntries_, ecaldqm::nDCC, metDiagnosticParameterSet_cfi::nMax, EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING, ecaldqm::DQWorkerClient::sources_, mathSSE::sqrt(), ecaldqm::DQWorkerClient::statusManager_, EcalTrigTowerDetId::subDet(), MessageLogger_cff::threshold, ecaldqm::DQWorker::timestamp_, and TTF4MaskingAlarmThreshold_.

Referenced by ~TrigPrimClient().

24  {
25  MESet& meTimingSummary(MEs_.at("TimingSummary"));
26  MESet& meNonSingleSummary(MEs_.at("NonSingleSummary"));
27  MESet& meEmulQualitySummary(MEs_.at("EmulQualitySummary"));
28  MESet& meTrendTTF4Flags(MEs_.at("TrendTTF4Flags"));
29 
30  MESet const& sEtEmulError(sources_.at("EtEmulError"));
31  MESet const& sMatchedIndex(sources_.at("MatchedIndex"));
32  MESet const& sTPDigiThrAll(sources_.at("TPDigiThrAll"));
33  MESetNonObject const& sLHCStatusByLumi(static_cast<MESetNonObject&>(sources_.at("LHCStatusByLumi")));
34 
36 
37  // Store # of entries for Occupancy analysis
38  std::vector<float> Nentries(nDCC, 0.);
39 
40  double currentLHCStatus = sLHCStatusByLumi.getFloatValue();
41  bool statsCheckEnabled =
42  ((currentLHCStatus > 10.5 && currentLHCStatus < 11.5) ||
43  currentLHCStatus < 0); // currentLHCStatus = -1 is the default when no beam info is available
44 
45  for (unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++) {
47 
48  bool doMask(meEmulQualitySummary.maskMatches(ttid, mask, statusManager_));
49 
50  float towerEntries(0.);
51  float tMax(0.5);
52  float nMax(0.);
53  for (int iBin(0); iBin < 6; iBin++) {
54  float entries(sMatchedIndex.getBinContent(ttid, iBin + 1));
55  towerEntries += entries;
56 
57  if (entries > nMax) {
58  nMax = entries;
59  tMax = iBin == 0 ? -0.5 : iBin + 0.5; // historical reasons.. much clearer to say "no entry = -0.5"
60  }
61  }
62 
63  meTimingSummary.setBinContent(ttid, tMax);
64 
65  if (towerEntries < minEntries_) {
66  meEmulQualitySummary.setBinContent(ttid, doMask ? kMUnknown : kUnknown);
67  continue;
68  }
69 
70  float nonsingleFraction(1. - nMax / towerEntries);
71 
72  if (nonsingleFraction > 0.)
73  meNonSingleSummary.setBinContent(ttid, nonsingleFraction);
74 
75  if (sEtEmulError.getBinContent(ttid) / towerEntries > errorFractionThreshold_)
76  meEmulQualitySummary.setBinContent(ttid, doMask ? kMBad : kBad);
77  else
78  meEmulQualitySummary.setBinContent(ttid, doMask ? kMGood : kGood);
79 
80  // Keep count for Occupancy analysis
81  unsigned iDCC(dccId(ttid) - 1);
82  Nentries[iDCC] += sTPDigiThrAll.getBinContent(ttid);
83  }
84 
85  // Fill TTF4 v Masking ME
86  // NOT an occupancy plot: only tells you if non-zero TTF4 occupancy was seen
87  // without giving info about how many were seen
88  MESet& meTTF4vMask(MEs_.at("TTF4vMask"));
89  MESet& meTTF4vMaskByLumi(MEs_.at("TTF4vMaskByLumi"));
90  MESet const& sTTFlags4(sources_.at("TTFlags4"));
91  MESet const& sTTFlags4ByLumi(sources_.at("TTFlags4ByLumi"));
92  MESet const& sTTMaskMapAll(sources_.at("TTMaskMapAll"));
93 
94  std::vector<float> nWithTTF4(nDCC,
95  0.); // counters to keep track of number of towers in a DCC that have TTF4 flag set
96  int nWithTTF4_EE = 0; // total number of towers in EE with TTF4
97  int nWithTTF4_EB = 0; // total number of towers in EB with TTF4
98  // Loop over all TTs
99  for (unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++) {
101  unsigned iDCC(dccId(ttid) - 1);
102  bool isMasked(sTTMaskMapAll.getBinContent(ttid) > 0.);
103  bool hasTTF4(sTTFlags4.getBinContent(ttid) > 0.);
104  bool hasTTF4InThisLumiSection(sTTFlags4ByLumi.getBinContent(ttid) > 0.);
105  if (hasTTF4InThisLumiSection) {
106  nWithTTF4[iDCC]++;
107  if (ttid.subDet() == EcalBarrel)
108  nWithTTF4_EB++;
109  else if (ttid.subDet() == EcalEndcap)
110  nWithTTF4_EE++;
111  }
112  if (isMasked) {
113  if (hasTTF4) {
114  meTTF4vMask.setBinContent(ttid, 12); // Masked, has TTF4
115  } else {
116  meTTF4vMask.setBinContent(ttid, 11); // Masked, no TTF4
117  }
118  if (hasTTF4InThisLumiSection) {
119  meTTF4vMaskByLumi.setBinContent(ttid, 12); // Masked, has TTF4
120  } else {
121  meTTF4vMaskByLumi.setBinContent(ttid, 11); // Masked, no TTF4
122  }
123  } else {
124  if (hasTTF4)
125  meTTF4vMask.setBinContent(ttid, 13); // not Masked, has TTF4
126  if (hasTTF4InThisLumiSection)
127  meTTF4vMaskByLumi.setBinContent(ttid, 13); // not Masked, has TTF4
128  }
129  } // TT loop
130 
131  // Fill trend plots for number of TTs with TTF4 flag set
132  meTrendTTF4Flags.fill(EcalBarrel, double(timestamp_.iLumi), nWithTTF4_EB);
133  meTrendTTF4Flags.fill(EcalEndcap, double(timestamp_.iLumi), nWithTTF4_EE);
134 
135  // Quality check: set an entire FED to BAD if a more than 80% of the TTs in that FED show any DCC-SRP flag mismatch errors
136  // Fill flag mismatch statistics
137  std::vector<float> nTTs(nDCC, 0.);
138  std::vector<float> nTTFMismath(nDCC, 0.);
139  MESet const& sTTFMismatch(sources_.at("TTFMismatch"));
140  for (unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++) {
142  unsigned iDCC(dccId(ttid) - 1);
143  if (sTTFMismatch.getBinContent(ttid) > 0.)
144  nTTFMismath[iDCC]++;
145  nTTs[iDCC]++;
146  }
147  // Analyze flag mismatch statistics and TTF4 fraction statistics
148  for (unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++) {
150  unsigned iDCC(dccId(ttid) - 1);
151  if (nTTFMismath[iDCC] > 0.8 * nTTs[iDCC] || nWithTTF4[iDCC] > TTF4MaskingAlarmThreshold_ * nTTs[iDCC]) {
152  meEmulQualitySummary.setBinContent(ttid,
153  meEmulQualitySummary.maskMatches(ttid, mask, statusManager_) ? kMBad : kBad);
154  }
155  }
156 
157  // Quality check: set entire FED to BAD if its occupancy begins to vanish
158  // Fill FED statistics from TP digi occupancy
159  float meanFEDEB(0.), meanFEDEE(0.), rmsFEDEB(0.), rmsFEDEE(0.);
160  unsigned int nFEDEB(0), nFEDEE(0);
161  for (unsigned iDCC(0); iDCC < nDCC; iDCC++) {
162  if (iDCC >= kEBmLow && iDCC <= kEBpHigh) {
163  meanFEDEB += Nentries[iDCC];
164  rmsFEDEB += Nentries[iDCC] * Nentries[iDCC];
165  nFEDEB++;
166  } else {
167  meanFEDEE += Nentries[iDCC];
168  rmsFEDEE += Nentries[iDCC] * Nentries[iDCC];
169  nFEDEE++;
170  }
171  }
172  meanFEDEB /= float(nFEDEB);
173  rmsFEDEB /= float(nFEDEB);
174  meanFEDEE /= float(nFEDEE);
175  rmsFEDEE /= float(nFEDEE);
176  rmsFEDEB = sqrt(std::abs(rmsFEDEB - meanFEDEB * meanFEDEB));
177  rmsFEDEE = sqrt(std::abs(rmsFEDEE - meanFEDEE * meanFEDEE));
178  // Analyze FED statistics
179  float meanFED(0.), rmsFED(0.), nRMS(5.);
180  for (unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++) {
182  unsigned iDCC(dccId(ttid) - 1);
183  if (iDCC >= kEBmLow && iDCC <= kEBpHigh) {
184  meanFED = meanFEDEB;
185  rmsFED = rmsFEDEB;
186  } else {
187  meanFED = meanFEDEE;
188  rmsFED = rmsFEDEE;
189  }
190  float threshold(meanFED < nRMS * rmsFED ? minEntries_ : meanFED - nRMS * rmsFED);
191  if ((meanFED > 100. && Nentries[iDCC] < threshold) && statsCheckEnabled)
192  meEmulQualitySummary.setBinContent(ttid,
193  meEmulQualitySummary.maskMatches(ttid, mask, statusManager_) ? kMBad : kBad);
194  }
195 
196  } // producePlots()
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
edm::LuminosityBlockNumber_t iLumi
Definition: DQWorker.h:35
static const int PHYSICS_BAD_CHANNEL_WARNING
T sqrt(T t)
Definition: SSEVec.h:19
StatusManager const * statusManager_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MESetCollection sources_
Timestamp timestamp_
Definition: DQWorker.h:81
MESetCollection MEs_
Definition: DQWorker.h:78
unsigned dccId(DetId const &)
void ecaldqm::TrigPrimClient::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 18 of file TrigPrimClient.cc.

References errorFractionThreshold_, edm::ParameterSet::getUntrackedParameter(), minEntries_, and TTF4MaskingAlarmThreshold_.

Referenced by ~TrigPrimClient().

18  {
19  minEntries_ = _params.getUntrackedParameter<int>("minEntries");
20  errorFractionThreshold_ = _params.getUntrackedParameter<double>("errorFractionThreshold");
21  TTF4MaskingAlarmThreshold_ = _params.getUntrackedParameter<double>("TTF4MaskingAlarmThreshold");
22  }

Member Data Documentation

float ecaldqm::TrigPrimClient::errorFractionThreshold_
private

Definition at line 18 of file TrigPrimClient.h.

Referenced by producePlots(), and setParams().

int ecaldqm::TrigPrimClient::minEntries_
private

Definition at line 17 of file TrigPrimClient.h.

Referenced by producePlots(), and setParams().

float ecaldqm::TrigPrimClient::TTF4MaskingAlarmThreshold_
private

Definition at line 19 of file TrigPrimClient.h.

Referenced by producePlots(), and setParams().