Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add channel status + laser threshold #13500

Merged
merged 2 commits into from Mar 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions DQM/EcalMonitorClient/interface/IntegrityClient.h
Expand Up @@ -3,6 +3,10 @@

#include "DQWorkerClient.h"

#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"

namespace ecaldqm
{
class IntegrityClient : public DQWorkerClient {
Expand All @@ -11,9 +15,11 @@ namespace ecaldqm
~IntegrityClient() {}

void producePlots(ProcessType) override;
void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override;

private:
void setParams(edm::ParameterSet const&) override;
edm::ESHandle<EcalChannelStatus> chStatus;

float errFractionThreshold_;
};
Expand Down
3 changes: 2 additions & 1 deletion DQM/EcalMonitorClient/interface/LaserClient.h
Expand Up @@ -19,7 +19,8 @@ namespace ecaldqm

int minChannelEntries_;
std::vector<float> expectedAmplitude_;
float toleranceAmplitude_;
float toleranceAmplitudeLo_;
float toleranceAmplitudeHi_;
float toleranceAmpRMSRatio_;
std::vector<float> expectedTiming_;
float toleranceTiming_;
Expand Down
7 changes: 7 additions & 0 deletions DQM/EcalMonitorClient/python/IntegrityClient_cfi.py
Expand Up @@ -31,6 +31,13 @@
otype = cms.untracked.string('SM'),
btype = cms.untracked.string('Crystal'),
description = cms.untracked.string('Summary of the data integrity. A channel is red if more than ' + str(errFractionThreshold) + ' of its entries have integrity errors.')
),
ChStatus = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sIntegrityClient/%(prefix)sIT%(suffix)s channel status map'),
kind = cms.untracked.string('TH2F'),
otype = cms.untracked.string('Ecal3P'),
btype = cms.untracked.string('Crystal'),
description = cms.untracked.string('Map of channel status as given by the Ecal Channel Status Record. LEGEND:<br/>0: Channel ok,<br/>1: DAC settings problem, pedestal not in the design range,<br/>2: Channel with no laser, ok elsewhere,<br/>3: Noisy,<br/>4: Very noisy,<br/>5-7: Reserved for more categories of noisy channels,<br/>8: Channel at fixed gain 6 (or 6 and 1),<br/>9: Channel at fixed gain 1,<br/>10: Channel at fixed gain 0 (dead of type this),<br/>11: Non-responding isolated channel (dead of type other),<br/>12: Channel and one or more neigbors not responding (e.g.: in a dead VFE 5x1 channel),<br/>13: Channel in TT with no data link, TP data ok,<br/>14: Channel in TT with no data link and no TP data.')
)
)
)
10 changes: 6 additions & 4 deletions DQM/EcalMonitorClient/python/LaserClient_cfi.py
Expand Up @@ -7,7 +7,8 @@
forwardFactor = 0.5
minChannelEntries = 3
expectedAmplitude = [1700.0, 1300.0, 1700.0, 1700.0]
toleranceAmplitude = 0.1
toleranceAmplitudeLo = 0.1
toleranceAmplitudeHi = 2.06
toleranceAmpRMSRatio = 0.3
expectedPNAmplitude = [800.0, 800.0, 800.0, 800.0]
tolerancePNAmp = 0.1
Expand All @@ -21,7 +22,8 @@
forwardFactor = cms.untracked.double(forwardFactor),
minChannelEntries = cms.untracked.int32(minChannelEntries),
expectedAmplitude = cms.untracked.vdouble(expectedAmplitude),
toleranceAmplitude = cms.untracked.double(toleranceAmplitude),
toleranceAmplitudeLo = cms.untracked.double(toleranceAmplitudeLo),
toleranceAmplitudeHi = cms.untracked.double(toleranceAmplitudeHi),
toleranceAmpRMSRatio = cms.untracked.double(toleranceAmpRMSRatio),
expectedPNAmplitude = cms.untracked.vdouble(expectedPNAmplitude),
tolerancePNAmp = cms.untracked.double(tolerancePNAmp),
Expand Down Expand Up @@ -116,7 +118,7 @@
),
kind = cms.untracked.string('TH2F'),
btype = cms.untracked.string('SuperCrystal'),
description = cms.untracked.string('Summary of the laser data quality. A channel is red either if mean / expected < ' + str(toleranceAmplitude) + ', or if RMS / expected > ' + str(toleranceAmpRMSRatio) + ', or if mean timing is off from expected by ' + str(toleranceTiming) + '. Expected amplitudes and timings are ' + ('%.1f, %.1f, %.1f, %.1f' % tuple(expectedAmplitude)) + ' and ' + ('%.1f, %.1f, %.1f, %.1f' % tuple(expectedTiming)) + ' for lasers 1, 2, 3, and 4 respectively. Channels with less than ' + str(minChannelEntries) + ' are not considered.'),
description = cms.untracked.string('Summary of the laser data quality. A channel is red either if mean / expected < ' + str(toleranceAmplitudeLo) + ', or if mean / expected > ' + str(toleranceAmplitudeHi) + ', or if RMS / expected > ' + str(toleranceAmpRMSRatio) + ', or if mean timing is off from expected by ' + str(toleranceTiming) + '. Expected amplitudes and timings are ' + ('%.1f, %.1f, %.1f, %.1f' % tuple(expectedAmplitude)) + ' and ' + ('%.1f, %.1f, %.1f, %.1f' % tuple(expectedTiming)) + ' for lasers 1, 2, 3, and 4 respectively. Channels with less than ' + str(minChannelEntries) + ' are not considered.'),
),
Quality = cms.untracked.PSet(
path = cms.untracked.string('%(subdet)s/%(prefix)sLaserClient/%(prefix)sLT laser quality L%(wl)s %(sm)s'),
Expand All @@ -126,7 +128,7 @@
),
kind = cms.untracked.string('TH2F'),
btype = cms.untracked.string('Crystal'),
description = cms.untracked.string('Summary of the laser data quality. A channel is red either if mean / expected < ' + str(toleranceAmplitude) + ', or if RMS / expected > ' + str(toleranceAmpRMSRatio) + ', or if mean timing is off from expected by ' + str(toleranceTiming) + '. Expected amplitudes and timings are ' + ('%.1f, %.1f, %.1f, %.1f' % tuple(expectedAmplitude)) + ' and ' + ('%.1f, %.1f, %.1f, %.1f' % tuple(expectedTiming)) + ' for lasers 1, 2, 3, and 4 respectively. Channels with less than ' + str(minChannelEntries) + ' are not considered.'),
description = cms.untracked.string('Summary of the laser data quality. A channel is red either if mean / expected < ' + str(toleranceAmplitudeLo) + ', or if mean / expected > ' + str(toleranceAmplitudeHi) + ', or if RMS / expected > ' + str(toleranceAmpRMSRatio) +', or if RMS / expected > ' + str(toleranceAmpRMSRatio) + ', or if mean timing is off from expected by ' + str(toleranceTiming) + '. Expected amplitudes and timings are ' + ('%.1f, %.1f, %.1f, %.1f' % tuple(expectedAmplitude)) + ' and ' + ('%.1f, %.1f, %.1f, %.1f' % tuple(expectedTiming)) + ' for lasers 1, 2, 3, and 4 respectively. Channels with less than ' + str(minChannelEntries) + ' are not considered.'),
),
AmplitudeRMS = cms.untracked.PSet(
multi = cms.untracked.PSet(
Expand Down
43 changes: 42 additions & 1 deletion DQM/EcalMonitorClient/src/IntegrityClient.cc
Expand Up @@ -4,6 +4,10 @@

#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/EcalDetId/interface/EEDetId.h"
#include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h"

namespace ecaldqm
{
IntegrityClient::IntegrityClient() :
Expand All @@ -20,6 +24,14 @@ namespace ecaldqm
errFractionThreshold_ = _params.getUntrackedParameter<double>("errFractionThreshold");
}

// Check Channel Status Record at every endLumi
// Used to fill Channel Status Map MEs
void
IntegrityClient::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const& _es)
{
_es.get<EcalChannelStatusRcd>().get( chStatus );
}

void
IntegrityClient::producePlots(ProcessType)
{
Expand All @@ -31,6 +43,7 @@ namespace ecaldqm

MESet& meQuality(MEs_.at("Quality"));
MESet& meQualitySummary(MEs_.at("QualitySummary"));
MESet& meChStatus( MEs_.at("ChStatus") );

MESet const& sOccupancy(sources_.at("Occupancy"));
MESet const& sGain(sources_.at("Gain"));
Expand All @@ -39,6 +52,33 @@ namespace ecaldqm
MESet const& sTowerId(sources_.at("TowerId"));
MESet const& sBlockSize(sources_.at("BlockSize"));

// Fill Channel Status Map MEs
// Record is checked for updates at every endLumi and filled here
MESet::iterator chSEnd( meChStatus.end() );
for( MESet::iterator chSItr(meChStatus.beginChannel()); chSItr != chSEnd; chSItr.toNextChannel() ){

DetId id( chSItr->getId() );

EcalChannelStatusMap::const_iterator chIt(0);

// Set appropriate channel map (EB or EE)
if( id.subdetId() == EcalBarrel ){
EBDetId ebid(id);
chIt = chStatus->find( ebid );
}
else {
EEDetId eeid(id);
chIt = chStatus->find( eeid );
}

// Get status code and fill ME
if ( chIt != chStatus->end() ){
uint16_t code( chIt->getEncodedStatusCode() );
chSItr->setBinContent( code );
}

} // Channel Status Map

MESet::iterator qEnd(meQuality.end());
MESet::const_iterator occItr(sOccupancy);
for(MESet::iterator qItr(meQuality.beginChannel()); qItr != qEnd; qItr.toNextChannel()){
Expand Down Expand Up @@ -75,7 +115,8 @@ namespace ecaldqm
meQualitySummary.setBinContent(id, doMask ? kMGood : kGood);
}
}
}

} // producePlots()

DEFINE_ECALDQM_WORKER(IntegrityClient);
}
12 changes: 8 additions & 4 deletions DQM/EcalMonitorClient/src/LaserClient.cc
Expand Up @@ -18,7 +18,8 @@ namespace ecaldqm
wlToME_(),
minChannelEntries_(0),
expectedAmplitude_(0),
toleranceAmplitude_(0.),
toleranceAmplitudeLo_(0.),
toleranceAmplitudeHi_(0.),
toleranceAmpRMSRatio_(0.),
expectedTiming_(0),
toleranceTiming_(0.),
Expand All @@ -34,7 +35,8 @@ namespace ecaldqm
LaserClient::setParams(edm::ParameterSet const& _params)
{
minChannelEntries_ = _params.getUntrackedParameter<int>("minChannelEntries");
toleranceAmplitude_ = _params.getUntrackedParameter<double>("toleranceAmplitude");
toleranceAmplitudeLo_ = _params.getUntrackedParameter<double>("toleranceAmplitudeLo");
toleranceAmplitudeHi_ = _params.getUntrackedParameter<double>("toleranceAmplitudeHi");
toleranceAmpRMSRatio_ = _params.getUntrackedParameter<double>("toleranceAmpRMSRatio");
toleranceTiming_ = _params.getUntrackedParameter<double>("toleranceTiming");
toleranceTimRMS_ = _params.getUntrackedParameter<double>("toleranceTimRMS");
Expand Down Expand Up @@ -160,8 +162,10 @@ namespace ecaldqm
float intensity(aMean / expectedAmplitude_[wlItr->second]);
if(isForward(id)) intensity /= forwardFactor_;

if(intensity < toleranceAmplitude_ || aRms > aMean * toleranceAmpRMSRatio_ ||
abs(tMean - expectedTiming_[wlItr->second]) > toleranceTiming_ /*|| tRms > toleranceTimRMS_*/)
if(intensity < toleranceAmplitudeLo_
|| intensity > toleranceAmplitudeHi_
|| aRms > aMean * toleranceAmpRMSRatio_
|| abs(tMean - expectedTiming_[wlItr->second]) > toleranceTiming_ /*|| tRms > toleranceTimRMS_*/)
qItr->setBinContent(doMask ? kMBad : kBad);
else
qItr->setBinContent(doMask ? kMGood : kGood);
Expand Down