CMS 3D CMS Logo

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

#include <IntegrityClient.h>

Inheritance diagram for ecaldqm::IntegrityClient:
ecaldqm::DQWorkerClient ecaldqm::DQWorker

Public Member Functions

void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 IntegrityClient ()
 
void producePlots (ProcessType) override
 
 ~IntegrityClient ()
 
- Public Member Functions inherited from ecaldqm::DQWorkerClient
void bookMEs (DQMStore::IBooker &) override
 
 DQWorkerClient ()
 
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

edm::ESHandle< EcalChannelStatuschStatus
 
float errFractionThreshold_
 

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 12 of file IntegrityClient.h.

Constructor & Destructor Documentation

ecaldqm::IntegrityClient::IntegrityClient ( )

Definition at line 15 of file IntegrityClient.cc.

References ecaldqm::DQWorkerClient::qualitySummaries_.

15  :
18  {
19  qualitySummaries_.insert("Quality");
20  qualitySummaries_.insert("QualitySummary");
21  }
std::set< std::string > qualitySummaries_
ecaldqm::IntegrityClient::~IntegrityClient ( )
inline

Definition at line 15 of file IntegrityClient.h.

References endLuminosityBlock(), producePlots(), and setParams().

15 {}

Member Function Documentation

void ecaldqm::IntegrityClient::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &  _es 
)
overridevirtual

Reimplemented from ecaldqm::DQWorkerClient.

Definition at line 32 of file IntegrityClient.cc.

References chStatus, and edm::EventSetup::get().

Referenced by ~IntegrityClient().

33  {
34  _es.get<EcalChannelStatusRcd>().get( chStatus );
35  }
edm::ESHandle< EcalChannelStatus > chStatus
void ecaldqm::IntegrityClient::producePlots ( ProcessType  )
overridevirtual

Implements ecaldqm::DQWorkerClient.

Definition at line 38 of file IntegrityClient.cc.

References EcalDQMStatusHelper::CH_GAIN_SWITCH_ERROR, EcalDQMStatusHelper::CH_GAIN_ZERO_ERROR, EcalDQMStatusHelper::CH_ID_ERROR, chStatus, ecaldqm::dccId(), DEFINE_ECALDQM_WORKER, EcalBarrel, errFractionThreshold_, muonCSCDigis_cfi::gain, triggerObjects_cff::id, ecaldqm::DQWorkerClient::kBad, ecaldqm::DQWorkerClient::kGood, ecaldqm::DQWorkerClient::kMBad, ecaldqm::DQWorkerClient::kMGood, ecaldqm::DQWorkerClient::kMUnknown, ecaldqm::DQWorkerClient::kUnknown, RecoTauDiscriminantConfiguration::mask, ecaldqm::DQWorker::MEs_, ecaldqm::nDCC, ecaldqm::DQWorkerClient::sources_, ecaldqm::DQWorkerClient::statusManager_, ecaldqm::MESet::iterator::toNextChannel(), EcalDQMStatusHelper::TT_ID_ERROR, and EcalDQMStatusHelper::TT_SIZE_ERROR.

Referenced by ~IntegrityClient().

39  {
45 
46  MESet& meQuality(MEs_.at("Quality"));
47  MESet& meQualitySummary(MEs_.at("QualitySummary"));
48  MESet& meChStatus( MEs_.at("ChStatus") );
49 
50  MESet const& sOccupancy(sources_.at("Occupancy"));
51  MESet const& sGain(sources_.at("Gain"));
52  MESet const& sChId(sources_.at("ChId"));
53  MESet const& sGainSwitch(sources_.at("GainSwitch"));
54  MESet const& sTowerId(sources_.at("TowerId"));
55  MESet const& sBlockSize(sources_.at("BlockSize"));
56 
57  // Fill Channel Status Map MEs
58  // Record is checked for updates at every endLumi and filled here
59  MESet::iterator chSEnd( meChStatus.end() );
60  for( MESet::iterator chSItr(meChStatus.beginChannel()); chSItr != chSEnd; chSItr.toNextChannel() ){
61 
62  DetId id( chSItr->getId() );
63 
65 
66  // Set appropriate channel map (EB or EE)
67  if( id.subdetId() == EcalBarrel ){
68  EBDetId ebid(id);
69  chIt = chStatus->find( ebid );
70  }
71  else {
72  EEDetId eeid(id);
73  chIt = chStatus->find( eeid );
74  }
75 
76  // Get status code and fill ME
77  if ( chIt != chStatus->end() ){
78  uint16_t code( chIt->getEncodedStatusCode() );
79  chSItr->setBinContent( code );
80  }
81 
82  } // Channel Status Map
83 
84  MESet::iterator qEnd(meQuality.end());
85  MESet::const_iterator occItr(sOccupancy);
86  for(MESet::iterator qItr(meQuality.beginChannel()); qItr != qEnd; qItr.toNextChannel()){
87 
88  occItr = qItr;
89 
90  DetId id(qItr->getId());
91 
92  bool doMask(meQuality.maskMatches(id, mask, statusManager_));
93 
94  float entries(occItr->getBinContent());
95 
96  float gain(sGain.getBinContent(id));
97  float chid(sChId.getBinContent(id));
98  float gainswitch(sGainSwitch.getBinContent(id));
99 
100  float towerid(sTowerId.getBinContent(id));
101  float blocksize(sBlockSize.getBinContent(id));
102 
103  if(entries + gain + chid + gainswitch + towerid + blocksize < 1.){
104  qItr->setBinContent(doMask ? kMUnknown : kUnknown);
105  meQualitySummary.setBinContent(id, doMask ? kMUnknown : kUnknown);
106  continue;
107  }
108 
109  float chErr((gain + chid + gainswitch + towerid + blocksize) / (entries + gain + chid + gainswitch + towerid + blocksize));
110 
111  if(chErr > errFractionThreshold_){
112  qItr->setBinContent(doMask ? kMBad : kBad);
113  meQualitySummary.setBinContent(id, doMask ? kMBad : kBad);
114  }
115  else{
116  qItr->setBinContent(doMask ? kMGood : kGood);
117  meQualitySummary.setBinContent(id, doMask ? kMGood : kGood);
118  }
119  }
120 
121  // Quality check: set an entire FED to BAD if "any" DCC-SRP or DCC-TCC mismatch errors are detected
122  // Fill mismatch statistics
123  MESet const& sBXSRP(sources_.at("BXSRP"));
124  MESet const& sBXTCC(sources_.at("BXTCC"));
125  std::vector<bool> hasMismatchDCC(nDCC,false);
126  for ( unsigned iDCC(0); iDCC < nDCC; ++iDCC ) {
127  if ( sBXSRP.getBinContent(iDCC + 1) > 50. || sBXTCC.getBinContent(iDCC + 1) > 50. ) // "any" => 50
128  hasMismatchDCC[iDCC] = true;
129  }
130  // Analyze mismatch statistics
131  for ( MESet::iterator qsItr(meQualitySummary.beginChannel()); qsItr != meQualitySummary.end(); qsItr.toNextChannel() ) {
132  DetId id( qsItr->getId() );
133  unsigned iDCC( dccId(id)-1 );
134  if ( hasMismatchDCC[iDCC] )
135  meQualitySummary.setBinContent( id, meQualitySummary.maskMatches(id, mask, statusManager_) ? kMBad : kBad );
136  }
137 
138  } // producePlots()
edm::ESHandle< EcalChannelStatus > chStatus
static const int TT_SIZE_ERROR
static const int CH_GAIN_SWITCH_ERROR
StatusManager const * statusManager_
MESetCollection sources_
Definition: DetId.h:18
static const int CH_GAIN_ZERO_ERROR
std::vector< Item >::const_iterator const_iterator
MESetCollection MEs_
Definition: DQWorker.h:75
static const int TT_ID_ERROR
static const int CH_ID_ERROR
unsigned dccId(DetId const &)
void ecaldqm::IntegrityClient::setParams ( edm::ParameterSet const &  _params)
overrideprivatevirtual

Reimplemented from ecaldqm::DQWorker.

Definition at line 24 of file IntegrityClient.cc.

References errFractionThreshold_, and edm::ParameterSet::getUntrackedParameter().

Referenced by ~IntegrityClient().

25  {
26  errFractionThreshold_ = _params.getUntrackedParameter<double>("errFractionThreshold");
27  }

Member Data Documentation

edm::ESHandle<EcalChannelStatus> ecaldqm::IntegrityClient::chStatus
private

Definition at line 22 of file IntegrityClient.h.

Referenced by endLuminosityBlock(), and producePlots().

float ecaldqm::IntegrityClient::errFractionThreshold_
private

Definition at line 24 of file IntegrityClient.h.

Referenced by producePlots(), and setParams().