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

ECAL unpacker: consider the ADC hysteresis in the gain switches #8759

Merged
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
18 changes: 8 additions & 10 deletions EventFilter/EcalRawToDigi/src/DCCTowerBlock.cc
Expand Up @@ -221,18 +221,16 @@ int DCCTowerBlock::unpackXtalData(unsigned int expStripID, unsigned int expXtalI

// from here on, care about gain switches

short firstGainWrong=-1;
short numGainWrong=0;
short numGain=1;
bool gainSwitchError = false;

for (unsigned int i=1; i<nTSamples_; i++ ) {
if (i>0 && xtalGains_[i-1]>xtalGains_[i]) {
numGainWrong++;
if (firstGainWrong == -1) { firstGainWrong=i;}
}
if (xtalGains_[i-1] > xtalGains_[i] && numGain<5) gainSwitchError = true;
if (xtalGains_[i-1] == xtalGains_[i]) numGain++;
else numGain=1;
}


if (numGainWrong > 0) {

if (gainSwitchError) {
if (! DCCDataUnpacker::silentMode_) {
edm::LogWarning("IncorrectGain")
<< "A wrong gain transition switch was found for Tower Block in strip " << stripId << " and xtal " << xtalId
Expand Down
2 changes: 1 addition & 1 deletion EventFilter/EcalRawToDigi/test/testEcalUnpackerData_cfg.py
Expand Up @@ -7,7 +7,7 @@
process.source = cms.Source("PoolSource",
fileNames =
#cms.untracked.vstring('file:/tmp/nalmeida/1A1C4478-5866-DE11-A907-001D09F27067.root')
cms.untracked.vstring('/store/relval/CMSSW_3_8_0/RelValProdTTbar/GEN-SIM-RAW/MC_38Y_V7-v1/0004/306D1971-0C95-DF11-942B-002618943984.root')
cms.untracked.vstring('/store/relval/CMSSW_7_4_0/RelValProdTTbar/GEN-SIM-RAW/MCRUN1_74_V4-v1/00000/2C6CC5C9-D0DA-E411-ABF3-0025905B85EE.root')

)

Expand Down