Skip to content

Commit

Permalink
Merge pull request #42579 from perrotta/ecalRecProducersParameterUpda…
Browse files Browse the repository at this point in the history
…teAndCleaning

Updated ParameterDescription in EcalUncalibRecHitWorkerMultiFit.cc, and clean up some other configs
  • Loading branch information
cmsbuild authored Aug 17, 2023
2 parents 6d51683 + e6a03b2 commit 9f9210b
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 211 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class EcalUncalibRecHitTimingCCAlgo {
const EcalPedestals::Item* aped,
const EcalMGPAGainRatio* aGain,
const FullSampleVector& fullpulse,
EcalUncalibratedRecHit& uncalibRecHit,
float& errOnTime,
const float targetTimePrecision,
const bool correctForOOT = true) const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ double EcalUncalibRecHitTimingCCAlgo::computeTimeCC(const EcalDataFrame& dataFra
const EcalPedestals::Item* aped,
const EcalMGPAGainRatio* aGain,
const FullSampleVector& fullpulse,
EcalUncalibratedRecHit& uncalibRecHit,
float& errOnTime,
const float targetTimePrecision,
const bool correctForOOT) const {
constexpr unsigned int nsample = EcalDataFrame::MAXSAMPLES;
Expand Down Expand Up @@ -100,12 +98,8 @@ double EcalUncalibRecHitTimingCCAlgo::computeTimeCC(const EcalDataFrame& dataFra
}

float tM = (t3 + t0) / 2 - GLOBAL_TIME_SHIFT;
errOnTime = std::abs(t3 - t0) / ecalPh1::Samp_Period;

if (counter < MIN_NUM_OF_ITERATIONS || counter > MAX_NUM_OF_ITERATIONS - 1) {
tM = TIME_WHEN_NOT_CONVERGING * ecalPh1::Samp_Period;
//Negative error means that there was a problem with the CC
errOnTime = -targetTimePrecision / ecalPh1::Samp_Period;
}
return -tM / ecalPh1::Samp_Period;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void EcalUncalibRecHitProducer::fillDescriptions(edm::ConfigurationDescriptions&
desc.add<edm::ParameterSetDescription>("algoPSet", fdWorker->getAlgoDescription());

std::string algoName = itInfos->name_.substr(itInfos->name_.find("Worker") + 6, itInfos->name_.length());
descriptions.add("ecal" + algoName + "UncalibRecHit", desc);
descriptions.add("ecal" + algoName + "UncalibRecHitProducer", desc);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,21 +637,13 @@ void EcalUncalibRecHitWorkerMultiFit::run(const edm::Event& evt,
for (unsigned int ibx = 0; ibx < activeBX.size(); ++ibx)
amplitudes[ibx] = uncalibRecHit.outOfTimeAmplitude(ibx);

float jitterError = 0.;
float jitter =
computeCC_->computeTimeCC(*itdg, amplitudes, aped, aGain, fullpulse, CCtargetTimePrecision_, true) +
CCTimeShiftWrtRations_ / ecalcctiming::clockToNS;
float noCorrectedJitter =
computeCC_->computeTimeCC(
*itdg, amplitudes, aped, aGain, fullpulse, uncalibRecHit, jitterError, CCtargetTimePrecision_, true) +
*itdg, amplitudes, aped, aGain, fullpulse, CCtargetTimePrecisionForDelayedPulses_, false) +
CCTimeShiftWrtRations_ / ecalcctiming::clockToNS;
float noCorrectedJitter = computeCC_->computeTimeCC(*itdg,
amplitudes,
aped,
aGain,
fullpulse,
uncalibRecHit,
jitterError,
CCtargetTimePrecisionForDelayedPulses_,
false) +
CCTimeShiftWrtRations_ / ecalcctiming::clockToNS;

uncalibRecHit.setJitter(jitter);
uncalibRecHit.setNonCorrectedTime(jitter, noCorrectedJitter);
Expand Down Expand Up @@ -738,14 +730,14 @@ edm::ParameterSetDescription EcalUncalibRecHitWorkerMultiFit::getAlgoDescription
edm::ParameterDescription<bool>("dynamicPedestalsEE", false, true) and
edm::ParameterDescription<bool>("mitigateBadSamplesEB", false, true) and
edm::ParameterDescription<bool>("mitigateBadSamplesEE", false, true) and
edm::ParameterDescription<bool>("gainSwitchUseMaxSampleEB", false, true) and
edm::ParameterDescription<bool>("gainSwitchUseMaxSampleEB", true, true) and
edm::ParameterDescription<bool>("gainSwitchUseMaxSampleEE", false, true) and
edm::ParameterDescription<bool>("selectiveBadSampleCriteriaEB", false, true) and
edm::ParameterDescription<bool>("selectiveBadSampleCriteriaEE", false, true) and
edm::ParameterDescription<double>("addPedestalUncertaintyEB", 0., true) and
edm::ParameterDescription<double>("addPedestalUncertaintyEE", 0., true) and
edm::ParameterDescription<bool>("simplifiedNoiseModelForGainSwitch", true, true) and
edm::ParameterDescription<std::string>("timealgo", "RatioMethod", true) and
edm::ParameterDescription<std::string>("timealgo", "crossCorrelationMethod", true) and
edm::ParameterDescription<std::vector<double>>("EBtimeFitParameters",
{-2.015452e+00,
3.130702e+00,
Expand Down Expand Up @@ -776,21 +768,21 @@ edm::ParameterSetDescription EcalUncalibRecHitWorkerMultiFit::getAlgoDescription
edm::ParameterDescription<double>("EEtimeConstantTerm", 1.0, true) and
edm::ParameterDescription<double>("EBtimeNconst", 28.5, true) and
edm::ParameterDescription<double>("EEtimeNconst", 31.8, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain12pEB", 5, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain12mEB", 5, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain61pEB", 5, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain61mEB", 5, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain12pEB", 2.5, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain12mEB", 2.5, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain61pEB", 2.5, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain61mEB", 2.5, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain12pEE", 1000, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain12mEE", 1000, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain61pEE", 1000, true) and
edm::ParameterDescription<double>("outOfTimeThresholdGain61mEE", 1000, true) and
edm::ParameterDescription<double>("amplitudeThresholdEB", 10, true) and
edm::ParameterDescription<double>("amplitudeThresholdEE", 10, true) and
edm::ParameterDescription<double>("crossCorrelationStartTime", -15.0, true) and
edm::ParameterDescription<double>("crossCorrelationStartTime", -25.0, true) and
edm::ParameterDescription<double>("crossCorrelationStopTime", 25.0, true) and
edm::ParameterDescription<double>("crossCorrelationTargetTimePrecision", 0.01, true) and
edm::ParameterDescription<double>("crossCorrelationTargetTimePrecisionForDelayedPulses", 0.05, true) and
edm::ParameterDescription<double>("crossCorrelationTimeShiftWrtRations", 1., true) and
edm::ParameterDescription<double>("crossCorrelationTimeShiftWrtRations", 0., true) and
edm::ParameterDescription<double>("crossCorrelationMinTimeToBeLateMin", 2., true) and
edm::ParameterDescription<double>("crossCorrelationMinTimeToBeLateMax", 5., true));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import FWCore.ParameterSet.Config as cms
import RecoLocalCalo.EcalRecProducers.ecalAnalFitUncalibRecHitProducer_cfi as _mod

# producer of rechits starting from digis
ecalAnalFitUncalibRecHit = cms.EDProducer("EcalUncalibRecHitProducer",
EBdigiCollection = cms.InputTag("ecalDigis","ebDigis"),
EEhitCollection = cms.string('EcalUncalibRecHitsEE'),
EEdigiCollection = cms.InputTag("ecalDigis","eeDigis"),
EBhitCollection = cms.string("EcalUncalibRecHitsEB"),
algo = cms.string("EcalUncalibRecHitWorkerAnalFit"),
algoPSet = cms.PSet()
)
ecalAnalFitUncalibRecHit = _mod.ecalAnalFitUncalibRecHitProducer.clone()
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
import FWCore.ParameterSet.Config as cms
import RecoLocalCalo.EcalRecProducers.ecalFixedAlphaBetaFitUncalibRecHitProducer_cfi as _mod

# producer of rechits starting from digis
ecalFixedAlphaBetaFitUncalibRecHit = cms.EDProducer("EcalUncalibRecHitProducer",
EEdigiCollection = cms.InputTag("ecalDigis","eeDigis"),
EBdigiCollection = cms.InputTag("ecalDigis","ebDigis"),
EEhitCollection = cms.string("EcalUncalibRecHitsEE"),
EBhitCollection = cms.string("EcalUncalibRecHitsEB"),
algo = cms.string("EcalUncalibRecHitWorkerFixedAlphaBetaFit"),
algoPSet = cms.PSet(
betaEB = cms.double(1.655),
betaEE = cms.double(1.400),
AlphaBetaFilename = cms.untracked.string("NOFILE"),
MinAmplEndcap = cms.double(14.0),
MinAmplBarrel = cms.double(8.0),
UseDynamicPedestal = cms.bool(True),
alphaEB = cms.double(1.138),
alphaEE = cms.double(1.890)
)
)
ecalFixedAlphaBetaFitUncalibRecHit = _mod.ecalFixedAlphaBetaFitUncalibRecHitProducer.clone()

Original file line number Diff line number Diff line change
@@ -1,47 +1,4 @@
import FWCore.ParameterSet.Config as cms
import RecoLocalCalo.EcalRecProducers.ecalGlobalUncalibRecHitProducer_cfi as _mod

ecalGlobalUncalibRecHit = cms.EDProducer("EcalUncalibRecHitProducer",
EBdigiCollection = cms.InputTag("ecalDigis","ebDigis"),
EEdigiCollection = cms.InputTag("ecalDigis","eeDigis"),
EBhitCollection = cms.string("EcalUncalibRecHitsEB"),
EEhitCollection = cms.string('EcalUncalibRecHitsEE'),
algo = cms.string("EcalUncalibRecHitWorkerGlobal"),
algoPSet = cms.PSet(
# for ratio method
EBtimeFitParameters = cms.vdouble(-2.015452e+00, 3.130702e+00, -1.234730e+01, 4.188921e+01, -8.283944e+01, 9.101147e+01, -5.035761e+01, 1.105621e+01),
EEtimeFitParameters = cms.vdouble(-2.390548e+00, 3.553628e+00, -1.762341e+01, 6.767538e+01, -1.332130e+02, 1.407432e+02, -7.541106e+01, 1.620277e+01),
EBamplitudeFitParameters = cms.vdouble(1.138,1.652),
EEamplitudeFitParameters = cms.vdouble(1.890,1.400),
EBtimeFitLimits_Lower = cms.double(0.2),
EBtimeFitLimits_Upper = cms.double(1.4),
EEtimeFitLimits_Lower = cms.double(0.2),
EEtimeFitLimits_Upper = cms.double(1.4),
# for kOutOfTime flag
EBtimeConstantTerm= cms.double(.6),
EBtimeNconst = cms.double(28.5),
EEtimeConstantTerm= cms.double(1.0),
EEtimeNconst = cms.double(31.8),
outOfTimeThresholdGain12pEB = cms.double(5), # times estimated precision
outOfTimeThresholdGain12mEB = cms.double(5), # times estimated precision
outOfTimeThresholdGain61pEB = cms.double(5), # times estimated precision
outOfTimeThresholdGain61mEB = cms.double(5), # times estimated precision
outOfTimeThresholdGain12pEE = cms.double(1000), # times estimated precision
outOfTimeThresholdGain12mEE = cms.double(1000), # times estimated precision
outOfTimeThresholdGain61pEE = cms.double(1000), # times estimated precision
outOfTimeThresholdGain61mEE = cms.double(1000), # times estimated precision
amplitudeThresholdEB = cms.double(10),
amplitudeThresholdEE = cms.double(10),

ebSpikeThreshold = cms.double(1.042),

ebPulseShape = cms.vdouble( 5.2e-05,-5.26e-05 , 6.66e-05, 0.1168, 0.7575, 1., 0.8876, 0.6732, 0.4741, 0.3194 ),
eePulseShape = cms.vdouble( 5.2e-05,-5.26e-05 , 6.66e-05, 0.1168, 0.7575, 1., 0.8876, 0.6732, 0.4741, 0.3194 ),

kPoorRecoFlagEB = cms.bool(True),
kPoorRecoFlagEE = cms.bool(False),
chi2ThreshEB_ = cms.double(36.0),
chi2ThreshEE_ = cms.double(95.0),
EBchi2Parameters = cms.vdouble(2.122, 0.022, 2.122, 0.022),
EEchi2Parameters = cms.vdouble(2.122, 0.022, 2.122, 0.022),
)
)
# producer of rechits starting from digis
ecalGlobalUncalibRecHit = _mod.ecalGlobalUncalibRecHitProducer.clone()
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import FWCore.ParameterSet.Config as cms
import RecoLocalCalo.EcalRecProducers.ecalMaxSampleUncalibRecHitProducer_cfi as _mod

ecalMaxSampleUncalibRecHit = cms.EDProducer("EcalUncalibRecHitProducer",
EBdigiCollection = cms.InputTag("ecalEBunpacker","ebDigis"),
EEhitCollection = cms.string("EcalUncalibRecHitsEE"),
EEdigiCollection = cms.InputTag("ecalEBunpacker","eeDigis"),
EBhitCollection = cms.string("EcalUncalibRecHitsEB"),
algo = cms.string("EcalUncalibRecHitWorkerMaxSample"),
algoPSet = cms.PSet()
)
# producer of rechits starting from digis
ecalMaxSampleUncalibRecHit = _mod.ecalMaxSampleUncalibRecHitProducer.clone()
Original file line number Diff line number Diff line change
@@ -1,73 +1,5 @@
import FWCore.ParameterSet.Config as cms
import RecoLocalCalo.EcalRecProducers.ecalMultiFitUncalibRecHitProducer_cfi as _mod

from RecoLocalCalo.EcalRecProducers.ecalPulseShapeParameters_cff import *
# producer of rechits starting from digis
ecalMultiFitUncalibRecHit = _mod.ecalMultiFitUncalibRecHitProducer.clone()

ecalMultiFitUncalibRecHit = cms.EDProducer("EcalUncalibRecHitProducer",
EBdigiCollection = cms.InputTag("ecalDigis","ebDigis"),
EEdigiCollection = cms.InputTag("ecalDigis","eeDigis"),
EBhitCollection = cms.string("EcalUncalibRecHitsEB"),
EEhitCollection = cms.string('EcalUncalibRecHitsEE'),
algo = cms.string("EcalUncalibRecHitWorkerMultiFit"),
algoPSet = cms.PSet(
# for multifit method
activeBXs = cms.vint32(-5,-4,-3,-2,-1,0,1,2,3,4),
ampErrorCalculation = cms.bool(True),
useLumiInfoRunHeader = cms.bool(True),

doPrefitEB = cms.bool(False),
doPrefitEE = cms.bool(False),
prefitMaxChiSqEB = cms.double(25.),
prefitMaxChiSqEE = cms.double(10.),

dynamicPedestalsEB = cms.bool(False),
dynamicPedestalsEE = cms.bool(False),
mitigateBadSamplesEB = cms.bool(False),
mitigateBadSamplesEE = cms.bool(False),
gainSwitchUseMaxSampleEB = cms.bool(True),
gainSwitchUseMaxSampleEE = cms.bool(False),
selectiveBadSampleCriteriaEB = cms.bool(False),
selectiveBadSampleCriteriaEE = cms.bool(False),
simplifiedNoiseModelForGainSwitch = cms.bool(True),
addPedestalUncertaintyEB = cms.double(0.),
addPedestalUncertaintyEE = cms.double(0.),

# decide which algorithm to be use to calculate the jitter
timealgo = cms.string("crossCorrelationMethod"),

# for ratio method
EBtimeFitParameters = cms.vdouble(-2.015452e+00, 3.130702e+00, -1.234730e+01, 4.188921e+01, -8.283944e+01, 9.101147e+01, -5.035761e+01, 1.105621e+01),
EEtimeFitParameters = cms.vdouble(-2.390548e+00, 3.553628e+00, -1.762341e+01, 6.767538e+01, -1.332130e+02, 1.407432e+02, -7.541106e+01, 1.620277e+01),
EBamplitudeFitParameters = cms.vdouble(1.138,1.652),
EEamplitudeFitParameters = cms.vdouble(1.890,1.400),
EBtimeFitLimits_Lower = cms.double(0.2),
EBtimeFitLimits_Upper = cms.double(1.4),
EEtimeFitLimits_Lower = cms.double(0.2),
EEtimeFitLimits_Upper = cms.double(1.4),
# for time error
EBtimeConstantTerm= cms.double(.6),
EEtimeConstantTerm= cms.double(1.0),

# for kOutOfTime flag
EBtimeNconst = cms.double(28.5),
EEtimeNconst = cms.double(31.8),
outOfTimeThresholdGain12pEB = cms.double(2.5), # times estimated precision
outOfTimeThresholdGain12mEB = cms.double(2.5), # times estimated precision
outOfTimeThresholdGain61pEB = cms.double(2.5), # times estimated precision
outOfTimeThresholdGain61mEB = cms.double(2.5), # times estimated precision
outOfTimeThresholdGain12pEE = cms.double(1000), # times estimated precision
outOfTimeThresholdGain12mEE = cms.double(1000), # times estimated precision
outOfTimeThresholdGain61pEE = cms.double(1000), # times estimated precision
outOfTimeThresholdGain61mEE = cms.double(1000), # times estimated precision
amplitudeThresholdEB = cms.double(10),
amplitudeThresholdEE = cms.double(10),

# for crossCorrelationMethod
crossCorrelationStartTime = cms.double(-25),
crossCorrelationStopTime = cms.double(25),
crossCorrelationTargetTimePrecision = cms.double(0.01),
crossCorrelationTargetTimePrecisionForDelayedPulses = cms.double(0.05),
crossCorrelationTimeShiftWrtRations = cms.double(0.0),
crossCorrelationMinTimeToBeLateMin = cms.double(2),
crossCorrelationMinTimeToBeLateMax = cms.double(5)
)
)
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
import FWCore.ParameterSet.Config as cms
import RecoLocalCalo.EcalRecProducers.ecalRatioUncalibRecHitProducer_cfi as _mod

ecalRatioUncalibRecHit = cms.EDProducer("EcalUncalibRecHitProducer",
EBdigiCollection = cms.InputTag("ecalDigis","ebDigis"),
EEdigiCollection = cms.InputTag("ecalDigis","eeDigis"),
EBhitCollection = cms.string("EcalUncalibRecHitsEB"),
EEhitCollection = cms.string('EcalUncalibRecHitsEE'),
algo = cms.string("EcalUncalibRecHitWorkerRatio"),
algoPSet = cms.PSet(
EBtimeFitParameters = cms.vdouble(-2.015452e+00, 3.130702e+00, -1.234730e+01, 4.188921e+01, -8.283944e+01, 9.101147e+01, -5.035761e+01, 1.105621e+01),
EEtimeFitParameters = cms.vdouble(-2.390548e+00, 3.553628e+00, -1.762341e+01, 6.767538e+01, -1.332130e+02, 1.407432e+02, -7.541106e+01, 1.620277e+01),
EBamplitudeFitParameters = cms.vdouble(1.138,1.652),
EEamplitudeFitParameters = cms.vdouble(1.890,1.400),
EBtimeFitLimits_Lower = cms.double(0.2),
EBtimeFitLimits_Upper = cms.double(1.4),
EEtimeFitLimits_Lower = cms.double(0.2),
EEtimeFitLimits_Upper = cms.double(1.4),
EBtimeConstantTerm = cms.double(.26),
EEtimeConstantTerm = cms.double(.18),
)
)
# producer of rechits starting from digis
ecalRatioUncalibRecHit = _mod.ecalRatioUncalibRecHitProducer.clone()
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import FWCore.ParameterSet.Config as cms
import RecoLocalCalo.EcalRecProducers.ecalWeightsUncalibRecHitProducer_cfi as _mod

# producer of rechits starting from digis
ecalWeightUncalibRecHit = cms.EDProducer("EcalUncalibRecHitProducer",
EBdigiCollection = cms.InputTag("ecalDigis","ebDigis"),
EEhitCollection = cms.string('EcalUncalibRecHitsEE'),
EEdigiCollection = cms.InputTag("ecalDigis","eeDigis"),
EBhitCollection = cms.string('EcalUncalibRecHitsEB'),
algo = cms.string("EcalUncalibRecHitWorkerWeights"),
algoPSet = cms.PSet()
)
ecalWeightUncalibRecHit = _mod.ecalWeightsUncalibRecHitProducer.clone()

0 comments on commit 9f9210b

Please sign in to comment.