![]() |
![]() |
#include <MahiFit.h>
Public Types | |
typedef BXVector::Index | Index |
Public Member Functions | |
void | doFit (std::array< float, 3 > &correctedOutput, int nbx, const HcalTimeSlew *hcalTimeSlew_delay) const |
MahiFit () | |
void | phase1Apply (const HBHEChannelInfo &channelData, float &reconstructedEnergy, float &reconstructedTime, bool &useTriple, float &chi2, const HcalTimeSlew *hcalTimeSlew_delay) const |
void | resetPulseShapeTemplate (const HcalPulseShapes::Shape &ps) |
void | setParameters (bool iDynamicPed, double iTS4Thresh, double chiSqSwitch, bool iApplyTimeSlew, HcalTimeSlew::BiasSetting slewFlavor, double iMeanTime, double iTimeSigmaHPD, double iTimeSigmaSiPM, const std::vector< int > &iActiveBXs, int iNMaxItersMin, int iNMaxItersNNLS, double iDeltaChiSqThresh, double iNnlsThresh) |
void | setPulseShapeTemplate (const HcalPulseShapes::Shape &ps) |
~MahiFit () | |
Public Attributes | |
const HcalPulseShapes::Shape * | currentPulseShape_ =nullptr |
Private Member Functions | |
double | calculateArrivalTime () const |
double | calculateChiSq () const |
double | getSiPMDarkCurrent (double darkCurrent, double fcByPE, double lambda) const |
double | minimize () const |
void | nnls () const |
void | nnlsConstrainParameter (Index minratioidx) const |
void | nnlsUnconstrainParameter (Index idxp) const |
void | onePulseMinimize () const |
void | resetWorkspace () const |
void | solveSubmatrix (PulseMatrix &mat, PulseVector &invec, PulseVector &outvec, unsigned nP) const |
void | updateCov () const |
void | updatePulseShape (double itQ, FullSampleVector &pulseShape, FullSampleVector &pulseDeriv, FullSampleMatrix &pulseCov, const HcalTimeSlew *hcalTimeSlew_delay) const |
Private Attributes | |
std::vector< int > | activeBXs_ |
bool | applyTimeSlew_ |
int | bxOffsetConf_ |
unsigned int | bxSizeConf_ |
float | chiSqSwitch_ |
int | cntsetPulseShape_ |
float | deltaChiSqThresh_ |
bool | dynamicPed_ |
const unsigned int | fullTSofInterest_ |
const unsigned int | fullTSSize_ |
float | meanTime_ |
int | nMaxItersMin_ |
int | nMaxItersNNLS_ |
float | nnlsThresh_ |
MahiNnlsWorkspace | nnlsWork_ |
std::unique_ptr< ROOT::Math::Functor > | pfunctor_ |
std::unique_ptr< FitterFuncs::PulseShapeFunctor > | psfPtr_ |
HcalTimeSlew::BiasSetting | slewFlavor_ |
float | timeSigmaHPD_ |
float | timeSigmaSiPM_ |
float | ts4Thresh_ |
Static Private Attributes | |
static constexpr int | pedestalBX_ = 100 |
typedef BXVector::Index MahiFit::Index |
MahiFit::MahiFit | ( | ) |
Definition at line 4 of file MahiFit.cc.
|
inline |
Definition at line 88 of file MahiFit.h.
References vertices_cff::chi2, and HBHEMahiParameters_cfi::chiSqSwitch.
|
private |
Definition at line 346 of file MahiFit.cc.
References MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::bxOffset, MahiNnlsWorkspace::bxs, MahiNnlsWorkspace::fullTSOffset, nnlsWork_, MahiNnlsWorkspace::nPulseTot, PFRecoTauDiscriminationByIsolation_cfi::offset, pedestalBX_, MahiNnlsWorkspace::pulseDerivArray, MahiNnlsWorkspace::pulseDerivMat, MahiNnlsWorkspace::residuals, and MahiNnlsWorkspace::tsSize.
Referenced by doFit().
|
private |
Definition at line 482 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::covDecomp, nnlsWork_, and MahiNnlsWorkspace::pulseMat.
Referenced by minimize().
void MahiFit::doFit | ( | std::array< float, 3 > & | correctedOutput, |
int | nbx, | ||
const HcalTimeSlew * | hcalTimeSlew_delay | ||
) | const |
Definition at line 144 of file MahiFit.cc.
References activeBXs_, MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, MahiNnlsWorkspace::bxOffset, bxOffsetConf_, MahiNnlsWorkspace::bxs, bxSizeConf_, calculateArrivalTime(), dynamicPed_, MahiNnlsWorkspace::errVec, MahiNnlsWorkspace::fullTSOffset, MaxFSVSize, minimize(), nnlsWork_, MahiNnlsWorkspace::nPulseTot, PFRecoTauDiscriminationByIsolation_cfi::offset, pedestalBX_, MahiNnlsWorkspace::pulseCovArray, MahiNnlsWorkspace::pulseDerivArray, MahiNnlsWorkspace::pulseMat, MahiNnlsWorkspace::pulseShapeArray, MahiNnlsWorkspace::residuals, BXVector< T >::resize(), MahiNnlsWorkspace::tsOffset, MahiNnlsWorkspace::tsSize, and updatePulseShape().
Referenced by phase1Apply().
|
private |
Definition at line 9 of file MahiFit.cc.
References RPCpg::mu, funct::pow(), and mathSSE::sqrt().
Referenced by phase1Apply().
|
private |
Definition at line 234 of file MahiFit.cc.
References funct::abs(), calculateChiSq(), deltaChiSqThresh_, nMaxItersMin_, nnls(), nnlsWork_, MahiNnlsWorkspace::nPulseTot, onePulseMinimize(), and updateCov().
Referenced by doFit().
|
private |
Definition at line 370 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::ampvecpermtest, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, MahiNnlsWorkspace::bxOffset, MahiNnlsWorkspace::bxs, MahiNnlsWorkspace::covDecomp, MahiNnlsWorkspace::fullTSOffset, mps_fire::i, MahiNnlsWorkspace::invcovp, SiStripPI::max, min(), nMaxItersNNLS_, nnlsConstrainParameter(), nnlsThresh_, nnlsUnconstrainParameter(), nnlsWork_, MahiNnlsWorkspace::nP, MahiNnlsWorkspace::nPulseTot, PFRecoTauDiscriminationByIsolation_cfi::offset, pedestalBX_, MahiNnlsWorkspace::pulseMat, MahiNnlsWorkspace::pulseShapeArray, particleFlowDisplacedVertex_cfi::ratio, solveSubmatrix(), electronIdCutBased_cfi::threshold, MahiNnlsWorkspace::tsSize, and MahiNnlsWorkspace::updateWork.
Referenced by minimize().
|
private |
Definition at line 517 of file MahiFit.cc.
References MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, MahiNnlsWorkspace::bxs, nnlsWork_, MahiNnlsWorkspace::nP, MahiNnlsWorkspace::pulseMat, and std::swap().
Referenced by nnls().
|
private |
Definition at line 507 of file MahiFit.cc.
References MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, MahiNnlsWorkspace::bxs, nnlsWork_, MahiNnlsWorkspace::nP, MahiNnlsWorkspace::pulseMat, and std::swap().
Referenced by nnls().
|
private |
Definition at line 470 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::covDecomp, MahiNnlsWorkspace::invcovp, SiStripPI::max, nnlsWork_, and MahiNnlsWorkspace::pulseMat.
Referenced by minimize().
void MahiFit::phase1Apply | ( | const HBHEChannelInfo & | channelData, |
float & | reconstructedEnergy, | ||
float & | reconstructedTime, | ||
bool & | useTriple, | ||
float & | chi2, | ||
const HcalTimeSlew * | hcalTimeSlew_delay | ||
) | const |
Definition at line 45 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, ALCARECOTkAlJpsiMuMu_cff::charge, chiSqSwitch_, HBHEChannelInfo::darkCurrent(), doFit(), MahiNnlsWorkspace::dt, HBHEChannelInfo::fcByPE(), MahiNnlsWorkspace::fullTSOffset, fullTSofInterest_, getSiPMDarkCurrent(), HBHEChannelInfo::hasEffectivePedestals(), HBHEChannelInfo::hasTimeInfo(), HBHEChannelInfo::lambda(), nnlsWork_, MahiNnlsWorkspace::noiseTerms, HBHEChannelInfo::nSamples(), MahiNnlsWorkspace::pedConstraint, resetWorkspace(), HBHEChannelInfo::soi(), mathSSE::sqrt(), timeSigmaHPD_, timeSigmaSiPM_, ts4Thresh_, HBHEChannelInfo::tsDFcPerADC(), HBHEChannelInfo::tsGain(), MahiNnlsWorkspace::tsOffset, HBHEChannelInfo::tsPedestal(), HBHEChannelInfo::tsPedestalWidth(), HBHEChannelInfo::tsRawCharge(), and MahiNnlsWorkspace::tsSize.
Referenced by SimpleHBHEPhase1Algo::reconstruct().
void MahiFit::resetPulseShapeTemplate | ( | const HcalPulseShapes::Shape & | ps | ) |
Definition at line 496 of file MahiFit.cc.
References cntsetPulseShape_, pfunctor_, psfPtr_, and FitterFuncs::PulseShapeFunctor::singlePulseShapeFunc().
Referenced by setPulseShapeTemplate().
|
private |
Definition at line 597 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::ampvecpermtest, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, begin, MahiNnlsWorkspace::bxOffset, MahiNnlsWorkspace::bxs, MahiNnlsWorkspace::covDecompLinv, MahiNnlsWorkspace::dt, end, MahiNnlsWorkspace::errVec, lumiContext::fill, MahiNnlsWorkspace::fullTSOffset, MahiNnlsWorkspace::invCovMat, MahiNnlsWorkspace::invcovp, nnlsWork_, MahiNnlsWorkspace::noiseTerms, MahiNnlsWorkspace::nPulseTot, MahiNnlsWorkspace::pedConstraint, MahiNnlsWorkspace::pulseCovArray, MahiNnlsWorkspace::pulseDerivArray, MahiNnlsWorkspace::pulseDerivMat, MahiNnlsWorkspace::pulseM, MahiNnlsWorkspace::pulseMat, MahiNnlsWorkspace::pulseN, MahiNnlsWorkspace::pulseP, MahiNnlsWorkspace::pulseShapeArray, MahiNnlsWorkspace::residuals, MahiNnlsWorkspace::topleft_work, MahiNnlsWorkspace::tsOffset, MahiNnlsWorkspace::tsSize, and MahiNnlsWorkspace::updateWork.
Referenced by phase1Apply().
void MahiFit::setParameters | ( | bool | iDynamicPed, |
double | iTS4Thresh, | ||
double | chiSqSwitch, | ||
bool | iApplyTimeSlew, | ||
HcalTimeSlew::BiasSetting | slewFlavor, | ||
double | iMeanTime, | ||
double | iTimeSigmaHPD, | ||
double | iTimeSigmaSiPM, | ||
const std::vector< int > & | iActiveBXs, | ||
int | iNMaxItersMin, | ||
int | iNMaxItersNNLS, | ||
double | iDeltaChiSqThresh, | ||
double | iNnlsThresh | ||
) |
Definition at line 14 of file MahiFit.cc.
References activeBXs_, applyTimeSlew_, bxOffsetConf_, bxSizeConf_, HBHEMahiParameters_cfi::chiSqSwitch, chiSqSwitch_, deltaChiSqThresh_, dynamicPed_, meanTime_, nMaxItersMin_, nMaxItersNNLS_, nnlsThresh_, slewFlavor_, timeSigmaHPD_, timeSigmaSiPM_, and ts4Thresh_.
void MahiFit::setPulseShapeTemplate | ( | const HcalPulseShapes::Shape & | ps | ) |
Definition at line 487 of file MahiFit.cc.
References currentPulseShape_, and resetPulseShapeTemplate().
|
private |
Definition at line 528 of file MahiFit.cc.
References Exception, and groupFilesInBlocks::temp.
Referenced by nnls().
|
private |
Definition at line 324 of file MahiFit.cc.
References MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::bxOffset, MahiNnlsWorkspace::bxs, MahiNnlsWorkspace::covDecomp, MahiNnlsWorkspace::fullTSOffset, MahiNnlsWorkspace::invCovMat, nnlsWork_, MahiNnlsWorkspace::noiseTerms, MahiNnlsWorkspace::nPulseTot, PFRecoTauDiscriminationByIsolation_cfi::offset, MahiNnlsWorkspace::pedConstraint, pedestalBX_, MahiNnlsWorkspace::pulseCovArray, and MahiNnlsWorkspace::tsSize.
Referenced by minimize().
|
private |
Definition at line 273 of file MahiFit.cc.
References applyTimeSlew_, HcalTimeSlew::delay(), delta, MahiNnlsWorkspace::dt, MahiNnlsWorkspace::fullTSOffset, SiStripPI::max, meanTime_, nnlsWork_, psfPtr_, MahiNnlsWorkspace::pulseM, MahiNnlsWorkspace::pulseN, MahiNnlsWorkspace::pulseP, slewFlavor_, cscNeutronWriter_cfi::t0, tmp, MahiNnlsWorkspace::tsSize, and geometryCSVtoXML::xx.
Referenced by doFit().
|
private |
Definition at line 152 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 145 of file MahiFit.h.
Referenced by setParameters(), and updatePulseShape().
|
private |
Definition at line 161 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 160 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 143 of file MahiFit.h.
Referenced by phase1Apply(), and setParameters().
|
private |
Definition at line 164 of file MahiFit.h.
Referenced by resetPulseShapeTemplate().
const HcalPulseShapes::Shape* MahiFit::currentPulseShape_ =nullptr |
Definition at line 109 of file MahiFit.h.
Referenced by setPulseShapeTemplate().
|
private |
Definition at line 157 of file MahiFit.h.
Referenced by minimize(), and setParameters().
|
private |
Definition at line 141 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 136 of file MahiFit.h.
Referenced by phase1Apply().
|
private |
Definition at line 148 of file MahiFit.h.
Referenced by setParameters(), and updatePulseShape().
|
private |
Definition at line 154 of file MahiFit.h.
Referenced by minimize(), and setParameters().
|
private |
Definition at line 155 of file MahiFit.h.
Referenced by nnls(), and setParameters().
|
private |
Definition at line 158 of file MahiFit.h.
Referenced by nnls(), and setParameters().
|
mutableprivate |
Definition at line 132 of file MahiFit.h.
Referenced by calculateArrivalTime(), calculateChiSq(), doFit(), minimize(), nnls(), nnlsConstrainParameter(), nnlsUnconstrainParameter(), onePulseMinimize(), phase1Apply(), resetWorkspace(), updateCov(), and updatePulseShape().
|
staticprivate |
Definition at line 138 of file MahiFit.h.
Referenced by calculateArrivalTime(), doFit(), nnls(), and updateCov().
|
private |
Definition at line 166 of file MahiFit.h.
Referenced by resetPulseShapeTemplate().
|
private |
Definition at line 165 of file MahiFit.h.
Referenced by resetPulseShapeTemplate(), and updatePulseShape().
|
private |
Definition at line 146 of file MahiFit.h.
Referenced by setParameters(), and updatePulseShape().
|
private |
Definition at line 149 of file MahiFit.h.
Referenced by phase1Apply(), and setParameters().
|
private |
Definition at line 150 of file MahiFit.h.
Referenced by phase1Apply(), and setParameters().
|
private |
Definition at line 142 of file MahiFit.h.
Referenced by phase1Apply(), and setParameters().