#include <MahiFit.h>
Public Types | |
typedef BXVector::Index | Index |
Public Member Functions | |
void | doFit (std::array< float, 4 > &correctedOutput, const int nbx) const |
MahiFit () | |
void | phase1Apply (const HBHEChannelInfo &channelData, float &reconstructedEnergy, float &soiPlusOneEnergy, float &reconstructedTime, bool &useTriple, float &chi2) const |
void | phase1Debug (const HBHEChannelInfo &channelData, MahiDebugInfo &mdi) const |
void | setParameters (bool iDynamicPed, double iTS4Thresh, double chiSqSwitch, bool iApplyTimeSlew, HcalTimeSlew::BiasSetting slewFlavor, bool iCalculateArrivalTime, int iTimeAlgo, double iThEnergeticPulses, double iMeanTime, double iTimeSigmaHPD, double iTimeSigmaSiPM, const std::vector< int > &iActiveBXs, int iNMaxItersMin, int iNMaxItersNNLS, double iDeltaChiSqThresh, double iNnlsThresh) |
void | setPulseShapeTemplate (int pulseShapeId, const HcalPulseShapes &ps, bool hasTimeInfo, const HcalTimeSlew *hcalTimeSlewDelay, unsigned int nSamples, const float gain) |
~MahiFit () | |
Public Attributes | |
const HcalTimeSlew * | hcalTimeSlewDelay_ = nullptr |
float | thEnergeticPulses_ |
float | thEnergeticPulsesFC_ |
Private Types | |
typedef std::pair< int, std::shared_ptr< FitterFuncs::PulseShapeFunctor > > | ShapeWithId |
Private Member Functions | |
float | calculateArrivalTime (const unsigned int iBX) const |
float | calculateChiSq () const |
float | ccTime (const float itQ) const |
const float | minimize () const |
void | nnls () const |
void | nnlsConstrainParameter (Index minratioidx) const |
void | nnlsUnconstrainParameter (Index idxp) const |
void | onePulseMinimize () const |
void | resetPulseShapeTemplate (int pulseShapeId, const HcalPulseShapes &ps, unsigned int nSamples) |
void | resetWorkspace () const |
void | solveSubmatrix (PulseMatrix &mat, PulseVector &invec, PulseVector &outvec, unsigned nP) const |
void | updateCov (const SampleMatrix &invCovMat) const |
void | updatePulseShape (const float itQ, FullSampleVector &pulseShape, FullSampleVector &pulseDeriv, FullSampleMatrix &pulseCov) const |
Private Attributes | |
std::vector< int > | activeBXs_ |
bool | applyTimeSlew_ |
int | bxOffsetConf_ |
unsigned int | bxSizeConf_ |
bool | calculateArrivalTime_ |
float | chiSqSwitch_ |
int | cntsetPulseShape_ = 0 |
int | currentPulseShapeId_ = INT_MIN |
float | deltaChiSqThresh_ |
bool | dynamicPed_ |
std::vector< ShapeWithId > | knownPulseShapes_ |
float | meanTime_ |
int | nMaxItersMin_ |
int | nMaxItersNNLS_ |
float | nnlsThresh_ |
MahiNnlsWorkspace | nnlsWork_ |
float | norm_ = (1.f / std::sqrt(12)) |
FitterFuncs::PulseShapeFunctor * | psfPtr_ = nullptr |
HcalTimeSlew::BiasSetting | slewFlavor_ |
int | timeAlgo_ |
float | timeSigmaHPD_ |
float | timeSigmaSiPM_ |
float | ts4Thresh_ |
float | tsDelay1GeV_ = 0.f |
Static Private Attributes | |
static constexpr int | pedestalBX_ = 100 |
static constexpr float | timeLimit_ = 12.5f |
typedef BXVector::Index MahiFit::Index |
|
private |
MahiFit::MahiFit | ( | ) |
Definition at line 5 of file MahiFit.cc.
|
private |
Definition at line 419 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::bxOffset, MahiNnlsWorkspace::bxs, nnlsWork_, MahiNnlsWorkspace::nPulseTot, MahiNnlsWorkspace::pulseDerivMat, MahiNnlsWorkspace::pulseMat, submitPVValidationJobs::t, and timeLimit_.
Referenced by doFit().
|
private |
Definition at line 543 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::covDecomp, nnlsWork_, and MahiNnlsWorkspace::pulseMat.
Referenced by minimize().
|
private |
Definition at line 354 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, applyTimeSlew_, HcalSpecialTimes::DEFAULT_ccTIME, HcalTimeSlew::delay(), dumpMFGeometry_cfg::delta, HLT_2024v10_cff::distance, f, FitterFuncs::PulseShapeFunctor::getPulseShape(), hcalTimeSlewDelay_, meanTime_, nnlsWork_, bTagMiniDQMDeepCSV::numerator, psfPtr_, FitterFuncs::PulseShapeFunctor::singlePulseShapeFuncMahi(), slewFlavor_, mathSSE::sqrt(), FrontierCondition_GT_autoExpress_cfi::t0, thEnergeticPulsesFC_, tsDelay1GeV_, MahiNnlsWorkspace::tsOffset, MahiNnlsWorkspace::tsSize, and geometryCSVtoXML::xx.
Referenced by doFit().
void MahiFit::doFit | ( | std::array< float, 4 > & | correctedOutput, |
const int | nbx | ||
) | const |
Definition at line 135 of file MahiFit.cc.
References activeBXs_, MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::bxOffset, bxOffsetConf_, MahiNnlsWorkspace::bxs, bxSizeConf_, calculateArrivalTime(), calculateArrivalTime_, ccTime(), dynamicPed_, MahiNnlsWorkspace::maxoffset, minimize(), nnlsWork_, MahiNnlsWorkspace::nPulseTot, hltrates_dqm_sourceclient-live_cfg::offset, pedestalBX_, MahiNnlsWorkspace::pulseCovArray, MahiNnlsWorkspace::pulseDerivMat, MahiNnlsWorkspace::pulseMat, timeAlgo_, MahiNnlsWorkspace::tsOffset, MahiNnlsWorkspace::tsSize, mitigatedMETSequence_cff::U, and updatePulseShape().
Referenced by phase1Apply().
|
private |
Definition at line 229 of file MahiFit.cc.
References funct::abs(), MahiNnlsWorkspace::ampVec, calculateChiSq(), deltaChiSqThresh_, mps_fire::i, MahiNnlsWorkspace::invcovp, nMaxItersMin_, nnls(), nnlsWork_, MahiNnlsWorkspace::noisecorr, MahiNnlsWorkspace::noiseTerms, MahiNnlsWorkspace::nPulseTot, onePulseMinimize(), MahiNnlsWorkspace::pedVal, MahiNnlsWorkspace::pedVals, MahiNnlsWorkspace::tsSize, and updateCov().
Referenced by doFit().
|
private |
Definition at line 439 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, MahiNnlsWorkspace::covDecomp, MahiNnlsWorkspace::invcovp, SiStripPI::max, SiStripPI::min, nMaxItersNNLS_, nnlsConstrainParameter(), nnlsThresh_, nnlsUnconstrainParameter(), nnlsWork_, MahiNnlsWorkspace::nP, MahiNnlsWorkspace::nPulseTot, MahiNnlsWorkspace::pulseMat, particleFlowDisplacedVertex_cfi::ratio, solveSubmatrix(), DiMuonV_cfg::threshold, MahiNnlsWorkspace::tsSize, and cms::cuda::wmax.
Referenced by minimize().
|
private |
Definition at line 615 of file MahiFit.cc.
References MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, MahiNnlsWorkspace::bxs, nnlsWork_, MahiNnlsWorkspace::nP, MahiNnlsWorkspace::pulseMat, and edm::swap().
Referenced by nnls().
|
private |
Definition at line 603 of file MahiFit.cc.
References MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, MahiNnlsWorkspace::bxs, nnlsWork_, MahiNnlsWorkspace::nP, MahiNnlsWorkspace::pulseMat, and edm::swap().
Referenced by nnls().
|
private |
Definition at line 533 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::covDecomp, f, MahiNnlsWorkspace::invcovp, SiStripPI::max, nnlsWork_, and MahiNnlsWorkspace::pulseMat.
Referenced by minimize().
void MahiFit::phase1Apply | ( | const HBHEChannelInfo & | channelData, |
float & | reconstructedEnergy, | ||
float & | soiPlusOneEnergy, | ||
float & | reconstructedTime, | ||
bool & | useTriple, | ||
float & | chi2 | ||
) | const |
Definition at line 50 of file MahiFit.cc.
References CustomPhysics_cfi::amplitude, MahiNnlsWorkspace::amplitudes, cms::cuda::assert(), nano_mu_local_reco_cff::chi2, chiSqSwitch_, doFit(), f, HBHEChannelInfo::fcByPE(), nnlsWork_, MahiNnlsWorkspace::noisecorr, HBHEChannelInfo::noisecorr(), MahiNnlsWorkspace::noiseTerms, norm_, PresampleTask_cfi::nSamples, HBHEChannelInfo::nSamples(), MahiNnlsWorkspace::pedVal, MahiNnlsWorkspace::pedVals, resetWorkspace(), HBHEChannelInfo::soi(), ts4Thresh_, HBHEChannelInfo::tsDFcPerADC(), HBHEChannelInfo::tsGain(), MahiNnlsWorkspace::tsOffset, HBHEChannelInfo::tsPedestal(), HBHEChannelInfo::tsPedestalWidth(), HBHEChannelInfo::tsRawCharge(), MahiNnlsWorkspace::tsSize, and mitigatedMETSequence_cff::U.
Referenced by phase1Debug(), and SimpleHBHEPhase1Algo::reconstruct().
void MahiFit::phase1Debug | ( | const HBHEChannelInfo & | channelData, |
MahiDebugInfo & | mdi | ||
) | const |
Definition at line 627 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiDebugInfo::arrivalTime, MahiNnlsWorkspace::bxs, ALCARECOTkAlJpsiMuMu_cff::charge, nano_mu_local_reco_cff::chi2, MahiDebugInfo::chiSq, MahiDebugInfo::count, MahiNnlsWorkspace::dt, HBHEChannelInfo::fcByPE(), HBHEChannelInfo::hasTimeInfo(), MahiDebugInfo::inGain, MahiDebugInfo::inNoiseADC, MahiDebugInfo::inNoisePhoto, MahiDebugInfo::inPedAvg, MahiDebugInfo::inPedestal, MahiDebugInfo::inputTDC, MahiDebugInfo::inputTS, MahiDebugInfo::inTimeConst, MahiDebugInfo::itPulse, MahiDebugInfo::mahiEnergy, nnlsWork_, MahiNnlsWorkspace::noiseTerms, norm_, MahiNnlsWorkspace::nPulseTot, MahiDebugInfo::nSamples, HBHEChannelInfo::nSamples(), MahiDebugInfo::ootEnergy, MahiDebugInfo::ootPulse, QIE10Task_cfi::ped, MahiDebugInfo::pedEnergy, pedestalBX_, phase1Apply(), MahiNnlsWorkspace::pulseMat, MahiDebugInfo::soi, HBHEChannelInfo::soi(), mathSSE::sqrt(), MahiDebugInfo::totalUCNoise, HBHEChannelInfo::tsDFcPerADC(), HBHEChannelInfo::tsGain(), HBHEChannelInfo::tsPedestal(), HBHEChannelInfo::tsPedestalWidth(), HBHEChannelInfo::tsRawCharge(), HBHEChannelInfo::tsRiseTime(), MahiNnlsWorkspace::tsSize, and MahiDebugInfo::use3.
|
private |
Definition at line 578 of file MahiFit.cc.
References cntsetPulseShape_, currentPulseShapeId_, HcalPulseShapes::getShape(), knownPulseShapes_, hcal::constants::maxSamples, AlCaHLTBitMon_ParallelJobs::p, and psfPtr_.
Referenced by setPulseShapeTemplate().
|
private |
Definition at line 742 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::bxOffset, MahiNnlsWorkspace::maxoffset, nnlsWork_, MahiNnlsWorkspace::noiseTerms, MahiNnlsWorkspace::nP, MahiNnlsWorkspace::nPulseTot, MahiNnlsWorkspace::pedVals, and MahiNnlsWorkspace::tsOffset.
Referenced by phase1Apply().
void MahiFit::setParameters | ( | bool | iDynamicPed, |
double | iTS4Thresh, | ||
double | chiSqSwitch, | ||
bool | iApplyTimeSlew, | ||
HcalTimeSlew::BiasSetting | slewFlavor, | ||
bool | iCalculateArrivalTime, | ||
int | iTimeAlgo, | ||
double | iThEnergeticPulses, | ||
double | iMeanTime, | ||
double | iTimeSigmaHPD, | ||
double | iTimeSigmaSiPM, | ||
const std::vector< int > & | iActiveBXs, | ||
int | iNMaxItersMin, | ||
int | iNMaxItersNNLS, | ||
double | iDeltaChiSqThresh, | ||
double | iNnlsThresh | ||
) |
Definition at line 7 of file MahiFit.cc.
References activeBXs_, applyTimeSlew_, bxOffsetConf_, bxSizeConf_, calculateArrivalTime_, HLT_2024v10_cff::chiSqSwitch, chiSqSwitch_, deltaChiSqThresh_, dynamicPed_, meanTime_, nMaxItersMin_, nMaxItersNNLS_, nnlsThresh_, slewFlavor_, thEnergeticPulses_, HBHEMahiParameters_cfi::timeAlgo, timeAlgo_, timeSigmaHPD_, timeSigmaSiPM_, and ts4Thresh_.
void MahiFit::setPulseShapeTemplate | ( | int | pulseShapeId, |
const HcalPulseShapes & | ps, | ||
bool | hasTimeInfo, | ||
const HcalTimeSlew * | hcalTimeSlewDelay, | ||
unsigned int | nSamples, | ||
const float | gain | ||
) |
Definition at line 548 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, cms::cuda::assert(), currentPulseShapeId_, HcalTimeSlew::delay(), MahiNnlsWorkspace::dt, hcalTimeSlewDelay_, nnlsWork_, MahiNnlsWorkspace::noiseTerms, PresampleTask_cfi::nSamples, MahiNnlsWorkspace::pedVals, resetPulseShapeTemplate(), slewFlavor_, thEnergeticPulses_, thEnergeticPulsesFC_, timeSigmaHPD_, timeSigmaSiPM_, tsDelay1GeV_, and MahiNnlsWorkspace::tsSize.
|
private |
Definition at line 693 of file MahiFit.cc.
References Exception, and groupFilesInBlocks::temp.
Referenced by nnls().
|
private |
Definition at line 334 of file MahiFit.cc.
References MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::bxOffset, MahiNnlsWorkspace::bxs, MahiNnlsWorkspace::covDecomp, nnlsWork_, MahiNnlsWorkspace::nPulseTot, hltrates_dqm_sourceclient-live_cfg::offset, pedestalBX_, and MahiNnlsWorkspace::pulseCovArray.
Referenced by minimize().
|
private |
Definition at line 274 of file MahiFit.cc.
References applyTimeSlew_, calculateArrivalTime_, HcalTimeSlew::delay(), dumpMFGeometry_cfg::delta, MahiNnlsWorkspace::dt, f, FitterFuncs::PulseShapeFunctor::getPulseShape(), hcalTimeSlewDelay_, MahiNnlsWorkspace::maxoffset, meanTime_, nnlsWork_, psfPtr_, FitterFuncs::PulseShapeFunctor::singlePulseShapeFuncMahi(), slewFlavor_, FrontierCondition_GT_autoExpress_cfi::t0, createJobs::tmp, tsDelay1GeV_, MahiNnlsWorkspace::tsOffset, MahiNnlsWorkspace::tsSize, and geometryCSVtoXML::xx.
Referenced by doFit().
|
private |
Definition at line 192 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 182 of file MahiFit.h.
Referenced by ccTime(), setParameters(), and updatePulseShape().
|
private |
Definition at line 201 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 200 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 187 of file MahiFit.h.
Referenced by doFit(), setParameters(), and updatePulseShape().
|
private |
Definition at line 180 of file MahiFit.h.
Referenced by phase1Apply(), and setParameters().
|
private |
Definition at line 205 of file MahiFit.h.
Referenced by resetPulseShapeTemplate().
|
private |
Definition at line 204 of file MahiFit.h.
Referenced by resetPulseShapeTemplate(), and setPulseShapeTemplate().
|
private |
Definition at line 197 of file MahiFit.h.
Referenced by minimize(), and setParameters().
|
private |
Definition at line 178 of file MahiFit.h.
Referenced by doFit(), and setParameters().
const HcalTimeSlew* MahiFit::hcalTimeSlewDelay_ = nullptr |
Definition at line 137 of file MahiFit.h.
Referenced by ccTime(), setPulseShapeTemplate(), and updatePulseShape().
|
private |
Definition at line 207 of file MahiFit.h.
Referenced by resetPulseShapeTemplate().
|
private |
Definition at line 188 of file MahiFit.h.
Referenced by ccTime(), setParameters(), and updatePulseShape().
|
private |
Definition at line 194 of file MahiFit.h.
Referenced by minimize(), and setParameters().
|
private |
Definition at line 195 of file MahiFit.h.
Referenced by nnls(), and setParameters().
|
private |
Definition at line 198 of file MahiFit.h.
Referenced by nnls(), and setParameters().
|
mutableprivate |
Definition at line 166 of file MahiFit.h.
Referenced by calculateArrivalTime(), calculateChiSq(), ccTime(), doFit(), minimize(), nnls(), nnlsConstrainParameter(), nnlsUnconstrainParameter(), onePulseMinimize(), phase1Apply(), phase1Debug(), resetWorkspace(), setPulseShapeTemplate(), updateCov(), and updatePulseShape().
|
private |
Definition at line 185 of file MahiFit.h.
Referenced by phase1Apply(), and phase1Debug().
|
staticprivate |
Definition at line 169 of file MahiFit.h.
Referenced by doFit(), phase1Debug(), and updateCov().
|
private |
Definition at line 206 of file MahiFit.h.
Referenced by ccTime(), resetPulseShapeTemplate(), and updatePulseShape().
|
private |
Definition at line 183 of file MahiFit.h.
Referenced by ccTime(), setParameters(), setPulseShapeTemplate(), and updatePulseShape().
float MahiFit::thEnergeticPulses_ |
Definition at line 139 of file MahiFit.h.
Referenced by setParameters(), and setPulseShapeTemplate().
float MahiFit::thEnergeticPulsesFC_ |
Definition at line 140 of file MahiFit.h.
Referenced by ccTime(), and setPulseShapeTemplate().
|
private |
Definition at line 176 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
staticprivate |
Definition at line 173 of file MahiFit.h.
Referenced by calculateArrivalTime().
|
private |
Definition at line 189 of file MahiFit.h.
Referenced by setParameters(), and setPulseShapeTemplate().
|
private |
Definition at line 190 of file MahiFit.h.
Referenced by setParameters(), and setPulseShapeTemplate().
|
private |
Definition at line 179 of file MahiFit.h.
Referenced by phase1Apply(), and setParameters().
|
private |
Definition at line 184 of file MahiFit.h.
Referenced by ccTime(), setPulseShapeTemplate(), and updatePulseShape().