CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- 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 ()
 
bool retrieveSource (DQMStore::IGetter &, ProcessType)
 
bool runsOn (ProcessType _type) const
 
void setStatusManager (StatusManager const &_manager)
 
virtual ~DQWorkerClient ()
 
- 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 ()
 

Private Member Functions

void setParams (edm::ParameterSet const &) override
 

Private Attributes

float errorFractionThreshold_
 
int minEntries_
 

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 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 8 of file TrigPrimClient.h.

Constructor & Destructor Documentation

ecaldqm::TrigPrimClient::TrigPrimClient ( )

Definition at line 13 of file TrigPrimClient.cc.

References ecaldqm::DQWorkerClient::qualitySummaries_.

13  :
15  minEntries_(0),
17  {
18  qualitySummaries_.insert("EmulQualitySummary");
19  }
std::set< std::string > qualitySummaries_
ecaldqm::TrigPrimClient::~TrigPrimClient ( )
inline

Definition at line 11 of file TrigPrimClient.h.

11 {}

Member Function Documentation

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

Implements ecaldqm::DQWorkerClient.

Definition at line 29 of file TrigPrimClient.cc.

References funct::abs(), ecaldqm::dccId(), EcalTrigTowerDetId::detIdFromDenseIndex(), errorFractionThreshold_, 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, EcalDQMStatusHelper::PHYSICS_BAD_CHANNEL_WARNING, ecaldqm::DQWorkerClient::sources_, mathSSE::sqrt(), ecaldqm::DQWorkerClient::statusManager_, and dtDQMClient_cfg::threshold.

30  {
31  MESet& meTimingSummary(MEs_.at("TimingSummary"));
32  MESet& meNonSingleSummary(MEs_.at("NonSingleSummary"));
33  MESet& meEmulQualitySummary(MEs_.at("EmulQualitySummary"));
34 
35  MESet const& sEtEmulError(sources_.at("EtEmulError"));
36  MESet const& sMatchedIndex(sources_.at("MatchedIndex"));
37  MESet const& sTPDigiThrAll(sources_.at("TPDigiThrAll"));
38 
40 
41  // Store # of entries for Occupancy analysis
42  std::vector<float> Nentries(nDCC,0.);
43 
44  for(unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++){
46 
47  bool doMask(meEmulQualitySummary.maskMatches(ttid, mask, statusManager_));
48 
49  float towerEntries(0.);
50  float tMax(0.5);
51  float nMax(0.);
52  for(int iBin(0); iBin < 6; iBin++){
53  float entries(sMatchedIndex.getBinContent(ttid, iBin + 1));
54  towerEntries += entries;
55 
56  if(entries > nMax){
57  nMax = entries;
58  tMax = iBin == 0 ? -0.5 : iBin + 0.5; // historical reasons.. much clearer to say "no entry = -0.5"
59  }
60  }
61 
62  meTimingSummary.setBinContent(ttid, tMax);
63 
64  if(towerEntries < minEntries_){
65  meEmulQualitySummary.setBinContent(ttid, doMask ? kMUnknown : kUnknown);
66  continue;
67  }
68 
69  float nonsingleFraction(1. - nMax / towerEntries);
70 
71  if(nonsingleFraction > 0.)
72  meNonSingleSummary.setBinContent(ttid, nonsingleFraction);
73 
74  if(sEtEmulError.getBinContent(ttid) / towerEntries > errorFractionThreshold_)
75  meEmulQualitySummary.setBinContent(ttid, doMask ? kMBad : kBad);
76  else
77  meEmulQualitySummary.setBinContent(ttid, doMask ? kMGood : kGood);
78 
79  // Keep count for Occupancy analysis
80  unsigned iDCC( dccId(ttid)-1 );
81  Nentries[iDCC] += sTPDigiThrAll.getBinContent(ttid);
82  }
83 
84  // Fill TTF4 v Masking ME
85  // NOT an occupancy plot: only tells you if non-zero TTF4 occupancy was seen
86  // without giving info about how many were seen
87  MESet& meTTF4vMask(MEs_.at("TTF4vMask"));
88  MESet const& sTTFlags4(sources_.at("TTFlags4"));
89  MESet const& sTTMaskMapAll(sources_.at("TTMaskMapAll"));
90 
91  // Loop over all TTs
92  for(unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++) {
94  bool isMasked( sTTMaskMapAll.getBinContent(ttid) > 0. );
95  bool hasTTF4( sTTFlags4.getBinContent(ttid) > 0. );
96  if ( isMasked ) {
97  if ( hasTTF4 )
98  meTTF4vMask.setBinContent( ttid,12 ); // Masked, has TTF4
99  else
100  meTTF4vMask.setBinContent( ttid,11 ); // Masked, no TTF4
101  } else {
102  if ( hasTTF4 )
103  meTTF4vMask.setBinContent( ttid,13 ); // not Masked, has TTF4
104  }
105  } // TT loop
106 
107  // Quality check: set an entire FED to BAD if an "entire" FED shows any DCC-SRP flag mismatch errors
108  // Fill flag mismatch statistics
109  std::vector<float> nTTs(nDCC,0.);
110  std::vector<float> nTTFMismath(nDCC,0.);
111  MESet const& sTTFMismatch(sources_.at("TTFMismatch"));
112  for ( unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++ ) {
114  unsigned iDCC( dccId(ttid)-1 );
115  if ( sTTFMismatch.getBinContent(ttid) > 0. )
116  nTTFMismath[iDCC]++;
117  nTTs[iDCC]++;
118  }
119  // Analyze flag mismatch statistics
120  for ( unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++ ) {
122  unsigned iDCC( dccId(ttid)-1 );
123  if ( nTTFMismath[iDCC] > 0.8*nTTs[iDCC] ) // "entire" => 80%
124  meEmulQualitySummary.setBinContent( ttid, meEmulQualitySummary.maskMatches(ttid, mask, statusManager_) ? kMBad : kBad );
125  }
126 
127  // Quality check: set entire FED to BAD if its occupancy begins to vanish
128  // Fill FED statistics from TP digi occupancy
129  float meanFEDEB(0.), meanFEDEE(0.), rmsFEDEB(0.), rmsFEDEE(0.);
130  unsigned int nFEDEB(0), nFEDEE(0);
131  for ( unsigned iDCC(0); iDCC < nDCC; iDCC++ ) {
132  if ( iDCC >=kEBmLow && iDCC <= kEBpHigh) {
133  meanFEDEB += Nentries[iDCC];
134  rmsFEDEB += Nentries[iDCC]*Nentries[iDCC];
135  nFEDEB++;
136  }
137  else {
138  meanFEDEE += Nentries[iDCC];
139  rmsFEDEE += Nentries[iDCC]*Nentries[iDCC];
140  nFEDEE++;
141  }
142  }
143  meanFEDEB /= float( nFEDEB ); rmsFEDEB /= float( nFEDEB );
144  meanFEDEE /= float( nFEDEE ); rmsFEDEE /= float( nFEDEE );
145  rmsFEDEB = sqrt( abs(rmsFEDEB - meanFEDEB*meanFEDEB) );
146  rmsFEDEE = sqrt( abs(rmsFEDEE - meanFEDEE*meanFEDEE) );
147  // Analyze FED statistics
148  float meanFED(0.), rmsFED(0.), nRMS(5.);
149  for(unsigned iTT(0); iTT < EcalTrigTowerDetId::kSizeForDenseIndexing; iTT++){
151  unsigned iDCC( dccId(ttid)-1 );
152  if ( iDCC >= kEBmLow && iDCC <= kEBpHigh ) {
153  meanFED = meanFEDEB;
154  rmsFED = rmsFEDEB;
155  }
156  else {
157  meanFED = meanFEDEE;
158  rmsFED = rmsFEDEE;
159  }
160  float threshold( meanFED < nRMS*rmsFED ? minEntries_ : meanFED - nRMS*rmsFED );
161  if ( meanFED > 100. && Nentries[iDCC] < threshold )
162  meEmulQualitySummary.setBinContent( ttid, meEmulQualitySummary.maskMatches(ttid, mask, statusManager_) ? kMBad : kBad );
163  }
164 
165  } // producePlots()
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
static const int PHYSICS_BAD_CHANNEL_WARNING
T sqrt(T t)
Definition: SSEVec.h:18
StatusManager const * statusManager_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MESetCollection sources_
MESetCollection MEs_
Definition: DQWorker.h:75
unsigned dccId(DetId const &)
void ecaldqm::TrigPrimClient::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 22 of file TrigPrimClient.cc.

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

23  {
24  minEntries_ = _params.getUntrackedParameter<int>("minEntries");
25  errorFractionThreshold_ = _params.getUntrackedParameter<double>("errorFractionThreshold");
26  }

Member Data Documentation

float ecaldqm::TrigPrimClient::errorFractionThreshold_
private

Definition at line 19 of file TrigPrimClient.h.

Referenced by producePlots(), and setParams().

int ecaldqm::TrigPrimClient::minEntries_
private

Definition at line 18 of file TrigPrimClient.h.

Referenced by producePlots(), and setParams().