-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Ecalpedestal pcl improved #18512
Merged
Merged
Ecalpedestal pcl improved #18512
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 5 additions & 10 deletions
15
Calibration/EcalCalibAlgos/python/ecalPedestalPCLHarvester_cfi.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,9 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
ECALpedestalPCLHarvester = cms.EDAnalyzer('ECALpedestalPCLHarvester', | ||
MinEntries = cms.int32(100), #skip channel if stat is low | ||
ChannelStatusToExclude = cms.vstring('kDAC', | ||
'kNoisy', | ||
'kNNoisy', | ||
'kFixedG6', | ||
'kFixedG1', | ||
'kFixedG0', | ||
'kNonRespondingIsolated', | ||
'kDeadVFE', | ||
'kDeadFE', | ||
'kNoDataNoTP',) | ||
ChannelStatusToExclude = cms.vstring(), # db statuses to exclude | ||
checkAnomalies = cms.bool(False), # whether or not to avoid creating sqlite file in case of many changed pedestals | ||
nSigma = cms.double(5.0), # threshold in sigmas to define a pedestal as anomally changed | ||
thresholdAnomalies = cms.double(0.1),# threshold (fraction of changed pedestals) to avoid creation of sqlite file | ||
dqmDir = cms.string('AlCaReco/EcalPedestalsPCL') | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,23 +22,26 @@ ECALpedestalPCLHarvester::ECALpedestalPCLHarvester(const edm::ParameterSet& ps): | |
|
||
chStatusToExclude_= StringToEnumValue<EcalChannelStatusCode::Code>(ps.getParameter<std::vector<std::string> >("ChannelStatusToExclude")); | ||
minEntries_=ps.getParameter<int>("MinEntries"); | ||
|
||
checkAnomalies_ = ps.getParameter<bool>("checkAnomalies"); | ||
nSigma_ = ps.getParameter<double>("nSigma"); | ||
thresholdAnomalies_ = ps.getParameter<double>("thresholdAnomalies"); | ||
dqmDir_ = ps.getParameter<std::string>("dqmDir"); | ||
} | ||
|
||
void ECALpedestalPCLHarvester::dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore::IGetter& igetter_) { | ||
|
||
|
||
// calculate pedestals and fill db record | ||
EcalPedestals pedestals; | ||
std::string hname; | ||
|
||
|
||
for (uint16_t i =0; i< EBDetId::kSizeForDenseIndexing; ++i) { | ||
hname = "AlCaReco/EcalPedestalsPCL/eb_" + std::to_string(i); | ||
std::string hname = dqmDir_+"/eb_" + std::to_string(i); | ||
MonitorElement* ch= igetter_.get(hname); | ||
double mean = ch->getMean(); | ||
double rms = ch->getRMS(); | ||
|
||
DetId id = EBDetId::detIdFromDenseIndex(i); | ||
DetId id = EBDetId::detIdFromDenseIndex(i); | ||
EcalPedestal ped; | ||
EcalPedestal oldped=* currentPedestals_->find(id.rawId()); | ||
|
||
|
@@ -63,8 +66,9 @@ void ECALpedestalPCLHarvester::dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore:: | |
|
||
|
||
for (uint16_t i =0; i< EEDetId::kSizeForDenseIndexing; ++i) { | ||
hname = "AlCaReco/EcalPedestalsPCL/ee_" + std::to_string(i); | ||
|
||
std::string hname = dqmDir_+"/ee_" + std::to_string(i); | ||
|
||
MonitorElement* ch= igetter_.get(hname); | ||
double mean = ch->getMean(); | ||
double rms = ch->getRMS(); | ||
|
@@ -91,7 +95,14 @@ void ECALpedestalPCLHarvester::dqmEndJob(DQMStore::IBooker& ibooker_, DQMStore:: | |
} | ||
|
||
|
||
// check if there are large variations wrt exisiting pedstals | ||
|
||
if (checkAnomalies_){ | ||
if (checkVariation(*currentPedestals_, pedestals)) { | ||
edm::LogError("Large Variations found wrt to old pedestals, no file created"); | ||
return; | ||
} | ||
} | ||
|
||
// write out pedestal record | ||
edm::Service<cond::service::PoolDBOutputService> poolDbService; | ||
|
@@ -141,3 +152,39 @@ bool ECALpedestalPCLHarvester::checkStatusCode(const DetId& id){ | |
|
||
return true; | ||
} | ||
|
||
|
||
bool ECALpedestalPCLHarvester::checkVariation(const EcalPedestalsMap& oldPedestals, | ||
const EcalPedestalsMap& newPedestals) { | ||
|
||
uint32_t nAnomaliesEB =0; | ||
uint32_t nAnomaliesEE =0; | ||
|
||
for (uint16_t i =0; i< EBDetId::kSizeForDenseIndexing; ++i) { | ||
|
||
DetId id = EBDetId::detIdFromDenseIndex(i); | ||
const EcalPedestal& newped=* newPedestals.find(id.rawId()); | ||
const EcalPedestal& oldped=* oldPedestals.find(id.rawId()); | ||
|
||
if (abs(newped.mean_x12 -oldped.mean_x12) > nSigma_ * oldped.rms_x12) nAnomaliesEB++; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hi @argiro - please use std:abs. |
||
|
||
} | ||
|
||
for (uint16_t i =0; i< EEDetId::kSizeForDenseIndexing; ++i) { | ||
|
||
DetId id = EEDetId::detIdFromDenseIndex(i); | ||
const EcalPedestal& newped=* newPedestals.find(id.rawId()); | ||
const EcalPedestal& oldped=* oldPedestals.find(id.rawId()); | ||
|
||
if (abs(newped.mean_x12 -oldped.mean_x12) > nSigma_ * oldped.rms_x12) nAnomaliesEE++; | ||
|
||
} | ||
|
||
if (nAnomaliesEB > thresholdAnomalies_ * EBDetId::kSizeForDenseIndexing || | ||
nAnomaliesEE > thresholdAnomalies_ * EEDetId::kSizeForDenseIndexing) | ||
return true; | ||
|
||
return false; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello @argiro
With the noise being significantly different between EB and EE (factor 2-3),
and somewhat |eta| dependent in EE
the significance to have "signal" in EB and EE dataframes
could be set here in relative terms in units of of sigma's of the noise
and the check carried out against Numsigna's x sigma_in_db