Skip to content

Commit

Permalink
Merge pull request #14126 from tanmaymudholkar/new_chi2_plots_8_0_X
Browse files Browse the repository at this point in the history
Added chi-squared plots to Timing Task
  • Loading branch information
cmsbuild committed Apr 26, 2016
2 parents 5c282f7 + c85ffc5 commit 85bfc56
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions DQM/EcalMonitorTasks/python/TimingTask_cfi.py
Expand Up @@ -140,6 +140,18 @@
),
btype = cms.untracked.string('User'),
description = cms.untracked.string('Distribution of the mean rec hit timing. Only hits with GOOD or OUT_OF_TIME reconstruction flags and energy above threshold are used. The energy thresholds are ' + ('%f and %f' % (energyThresholdEB, energyThresholdEE)) + ' for EB and EE respectively.')
),
Chi2 = cms.untracked.PSet(
path = cms.untracked.string("%(subdet)s/%(prefix)sTimingTask/%(prefix)sTMT %(subdetshortsig)s Chi2"),
kind = cms.untracked.string('TH1F'),
otype = cms.untracked.string('Ecal3P'),
btype = cms.untracked.string('User'),
xaxis = cms.untracked.PSet(
high = cms.untracked.double(100.),
low = cms.untracked.double(0.),
nbins = cms.untracked.int32(100)
),
description = cms.untracked.string('Chi2 of the pulse reconstruction.')
)
)
)
19 changes: 19 additions & 0 deletions DQM/EcalMonitorTasks/src/TimingTask.cc
Expand Up @@ -50,9 +50,11 @@ namespace ecaldqm
MESet& meTimeAllMap(MEs_.at("TimeAllMap"));
MESet& meTimeMap(MEs_.at("TimeMap"));
MESet& meTime1D(MEs_.at("Time1D"));
MESet& meChi2(MEs_.at("Chi2"));

uint32_t mask(~((0x1 << EcalRecHit::kGood) | (0x1 << EcalRecHit::kOutOfTime)));
float threshold(_collection == kEBRecHit ? energyThresholdEB_ : energyThresholdEE_);
int signedSubdet;

std::for_each(_hits.begin(), _hits.end(), [&](EcalRecHitCollection::value_type const& hit){
if(hit.checkFlagMask(mask)) return;
Expand All @@ -63,6 +65,23 @@ namespace ecaldqm
float energy(hit.energy());

float chi2Threshold = ( id.subdetId() == EcalBarrel ) ? chi2ThresholdEB_ : chi2ThresholdEE_;
if (id.subdetId() == EcalBarrel) {
signedSubdet=EcalBarrel;
}
else {
EEDetId eeId(hit.id());
if(eeId.zside() < 0){
signedSubdet = -EcalEndcap;
}
else{
signedSubdet = EcalEndcap;
}
}

if(energy > threshold){
meChi2.fill(signedSubdet, hit.chi2());
}

if( hit.chi2() > chi2Threshold ) return;

meTimeAmp.fill(id, energy, time);
Expand Down

0 comments on commit 85bfc56

Please sign in to comment.