Skip to content

Commit

Permalink
Merge pull request #8759 from emanueledimarco/ecalunpacker_fixgainswi…
Browse files Browse the repository at this point in the history
…tch_750pre2

ECAL unpacker: consider the ADC hysteresis in the gain switches
  • Loading branch information
cmsbuild committed Apr 16, 2015
2 parents f21a1e1 + aa95ff9 commit 99c984a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
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

0 comments on commit 99c984a

Please sign in to comment.