#include <MahiFit.h>
Public Types | |
typedef BXVector::Index | Index |
Public Member Functions | |
void | doFit (std::array< float, 3 > &correctedOutput, const int nbx) const |
MahiFit () | |
void | phase1Apply (const HBHEChannelInfo &channelData, float &reconstructedEnergy, float &reconstructedTime, bool &useTriple, float &chi2) const |
void | phase1Debug (const HBHEChannelInfo &channelData, MahiDebugInfo &mdi) const |
void | resetPulseShapeTemplate (const HcalPulseShapes::Shape &ps) |
void | setParameters (bool iDynamicPed, double iTS4Thresh, double chiSqSwitch, bool iApplyTimeSlew, HcalTimeSlew::BiasSetting slewFlavor, bool iCalculateArrivalTime, 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, const HcalTimeSlew *hcalTimeSlewDelay) |
~MahiFit () | |
Public Attributes | |
const HcalPulseShapes::Shape * | currentPulseShape_ = 0 |
const HcalTimeSlew * | hcalTimeSlewDelay_ = 0 |
Private Member Functions | |
float | calculateArrivalTime () const |
double | calculateChiSq () 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 |
Private Attributes | |
std::vector< int > | activeBXs_ |
bool | applyTimeSlew_ |
int | bxOffsetConf_ |
unsigned int | bxSizeConf_ |
bool | calculateArrivalTime_ |
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_ |
float | tsDelay1GeV_ =0.f |
Static Private Attributes | |
static int | pedestalBX_ = 100 |
static float | timeLimit_ = 12.5 |
typedef BXVector::Index MahiFit::Index |
MahiFit::MahiFit | ( | ) |
Definition at line 4 of file MahiFit.cc.
|
inline |
Definition at line 102 of file MahiFit.h.
References vertices_cff::chi2, and HBHEMahiParameters_cfi::chiSqSwitch.
|
private |
Definition at line 335 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::bxs, nnlsWork_, MahiNnlsWorkspace::nPulseTot, PFRecoTauDiscriminationByIsolation_cfi::offset, MahiNnlsWorkspace::pulseDerivMat, MahiNnlsWorkspace::pulseMat, lumiQTWidget::t, and timeLimit_.
Referenced by doFit().
|
private |
Definition at line 467 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, |
const int | nbx | ||
) | const |
Definition at line 127 of file MahiFit.cc.
References activeBXs_, MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::bxOffset, bxOffsetConf_, MahiNnlsWorkspace::bxs, bxSizeConf_, calculateArrivalTime(), calculateArrivalTime_, dynamicPed_, MahiNnlsWorkspace::maxoffset, minimize(), nnlsWork_, MahiNnlsWorkspace::nPulseTot, PFRecoTauDiscriminationByIsolation_cfi::offset, pedestalBX_, MahiNnlsWorkspace::pulseCovArray, MahiNnlsWorkspace::pulseDerivMat, MahiNnlsWorkspace::pulseMat, MahiNnlsWorkspace::tsOffset, MahiNnlsWorkspace::tsSize, and updatePulseShape().
Referenced by phase1Apply().
|
private |
Definition at line 214 of file MahiFit.cc.
References funct::abs(), MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, calculateChiSq(), deltaChiSqThresh_, MahiNnlsWorkspace::invcovp, nMaxItersMin_, nnls(), nnlsWork_, MahiNnlsWorkspace::nPulseTot, onePulseMinimize(), MahiNnlsWorkspace::tsSize, and updateCov().
Referenced by doFit().
|
private |
Definition at line 357 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, MahiNnlsWorkspace::covDecomp, mps_fire::i, MahiNnlsWorkspace::invcovp, SiStripPI::max, min(), nMaxItersNNLS_, nnlsConstrainParameter(), nnlsThresh_, nnlsUnconstrainParameter(), nnlsWork_, MahiNnlsWorkspace::nP, MahiNnlsWorkspace::nPulseTot, MahiNnlsWorkspace::pulseMat, particleFlowDisplacedVertex_cfi::ratio, solveSubmatrix(), electronIdCutBased_cfi::threshold, and MahiNnlsWorkspace::tsSize.
Referenced by minimize().
|
private |
Definition at line 506 of file MahiFit.cc.
References MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, MahiNnlsWorkspace::bxs, nnlsWork_, MahiNnlsWorkspace::nP, MahiNnlsWorkspace::pulseDerivMat, MahiNnlsWorkspace::pulseMat, and std::swap().
Referenced by nnls().
|
private |
Definition at line 495 of file MahiFit.cc.
References MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::aTaMat, MahiNnlsWorkspace::aTbVec, MahiNnlsWorkspace::bxs, nnlsWork_, MahiNnlsWorkspace::nP, MahiNnlsWorkspace::pulseDerivMat, MahiNnlsWorkspace::pulseMat, and std::swap().
Referenced by nnls().
|
private |
Definition at line 455 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 |
Definition at line 41 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, ALCARECOTkAlJpsiMuMu_cff::charge, chiSqSwitch_, doFit(), MahiNnlsWorkspace::dt, HBHEChannelInfo::fcByPE(), MahiNnlsWorkspace::fullTSOffset, fullTSofInterest_, HBHEChannelInfo::hasTimeInfo(), 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 phase1Debug(), and SimpleHBHEPhase1Algo::reconstruct().
void MahiFit::phase1Debug | ( | const HBHEChannelInfo & | channelData, |
MahiDebugInfo & | mdi | ||
) | const |
Definition at line 518 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::ampVec, MahiDebugInfo::arrivalTime, MahiNnlsWorkspace::bxs, ALCARECOTkAlJpsiMuMu_cff::charge, vertices_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, MahiDebugInfo::nEnergy, nnlsWork_, MahiNnlsWorkspace::noiseTerms, MahiDebugInfo::nPulse, MahiNnlsWorkspace::nPulseTot, MahiDebugInfo::nSamples, HBHEChannelInfo::nSamples(), MahiDebugInfo::pedEnergy, pedestalBX_, MahiDebugInfo::pEnergy, phase1Apply(), MahiDebugInfo::pPulse, 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.
void MahiFit::resetPulseShapeTemplate | ( | const HcalPulseShapes::Shape & | ps | ) |
Definition at line 485 of file MahiFit.cc.
References cntsetPulseShape_, and psfPtr_.
Referenced by setPulseShapeTemplate().
|
private |
Definition at line 660 of file MahiFit.cc.
References MahiNnlsWorkspace::amplitudes, MahiNnlsWorkspace::bxOffset, MahiNnlsWorkspace::dt, MahiNnlsWorkspace::fullTSOffset, MahiNnlsWorkspace::maxoffset, nnlsWork_, MahiNnlsWorkspace::noiseTerms, MahiNnlsWorkspace::nPulseTot, MahiNnlsWorkspace::pedConstraint, MahiNnlsWorkspace::tsOffset, and MahiNnlsWorkspace::tsSize.
Referenced by phase1Apply().
void MahiFit::setParameters | ( | bool | iDynamicPed, |
double | iTS4Thresh, | ||
double | chiSqSwitch, | ||
bool | iApplyTimeSlew, | ||
HcalTimeSlew::BiasSetting | slewFlavor, | ||
bool | iCalculateArrivalTime, | ||
double | iMeanTime, | ||
double | iTimeSigmaHPD, | ||
double | iTimeSigmaSiPM, | ||
const std::vector< int > & | iActiveBXs, | ||
int | iNMaxItersMin, | ||
int | iNMaxItersNNLS, | ||
double | iDeltaChiSqThresh, | ||
double | iNnlsThresh | ||
) |
Definition at line 9 of file MahiFit.cc.
References activeBXs_, applyTimeSlew_, bxOffsetConf_, bxSizeConf_, calculateArrivalTime_, HBHEMahiParameters_cfi::chiSqSwitch, chiSqSwitch_, deltaChiSqThresh_, dynamicPed_, meanTime_, nMaxItersMin_, nMaxItersNNLS_, nnlsThresh_, slewFlavor_, timeSigmaHPD_, timeSigmaSiPM_, and ts4Thresh_.
void MahiFit::setPulseShapeTemplate | ( | const HcalPulseShapes::Shape & | ps, |
const HcalTimeSlew * | hcalTimeSlewDelay | ||
) |
Definition at line 472 of file MahiFit.cc.
References currentPulseShape_, HcalTimeSlew::delay(), hcalTimeSlewDelay_, resetPulseShapeTemplate(), slewFlavor_, and tsDelay1GeV_.
|
private |
Definition at line 591 of file MahiFit.cc.
References Exception, and groupFilesInBlocks::temp.
Referenced by nnls().
|
private |
Definition at line 313 of file MahiFit.cc.
References MahiNnlsWorkspace::ampVec, MahiNnlsWorkspace::bxOffset, MahiNnlsWorkspace::bxs, MahiNnlsWorkspace::covDecomp, MahiNnlsWorkspace::maxoffset, nnlsWork_, MahiNnlsWorkspace::noiseTerms, MahiNnlsWorkspace::nPulseTot, PFRecoTauDiscriminationByIsolation_cfi::offset, MahiNnlsWorkspace::pedConstraint, pedestalBX_, MahiNnlsWorkspace::pulseCovArray, and MahiNnlsWorkspace::tsSize.
Referenced by minimize().
|
private |
Definition at line 253 of file MahiFit.cc.
References applyTimeSlew_, HcalTimeSlew::delay(), delta, MahiNnlsWorkspace::dt, hcalTimeSlewDelay_, MahiNnlsWorkspace::maxoffset, meanTime_, nnlsWork_, psfPtr_, slewFlavor_, genVertex_cff::t0, tmp, tsDelay1GeV_, MahiNnlsWorkspace::tsSize, and geometryCSVtoXML::xx.
Referenced by doFit().
|
private |
Definition at line 173 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 164 of file MahiFit.h.
Referenced by setParameters(), and updatePulseShape().
|
private |
Definition at line 182 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 181 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 168 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 162 of file MahiFit.h.
Referenced by phase1Apply(), and setParameters().
|
private |
Definition at line 185 of file MahiFit.h.
Referenced by resetPulseShapeTemplate().
const HcalPulseShapes::Shape* MahiFit::currentPulseShape_ = 0 |
Definition at line 125 of file MahiFit.h.
Referenced by setPulseShapeTemplate().
|
private |
Definition at line 178 of file MahiFit.h.
Referenced by minimize(), and setParameters().
|
private |
Definition at line 160 of file MahiFit.h.
Referenced by doFit(), and setParameters().
|
private |
Definition at line 151 of file MahiFit.h.
Referenced by phase1Apply().
const HcalTimeSlew* MahiFit::hcalTimeSlewDelay_ = 0 |
Definition at line 126 of file MahiFit.h.
Referenced by setPulseShapeTemplate(), and updatePulseShape().
|
private |
Definition at line 169 of file MahiFit.h.
Referenced by setParameters(), and updatePulseShape().
|
private |
Definition at line 175 of file MahiFit.h.
Referenced by minimize(), and setParameters().
|
private |
Definition at line 176 of file MahiFit.h.
Referenced by nnls(), and setParameters().
|
private |
Definition at line 179 of file MahiFit.h.
Referenced by nnls(), and setParameters().
|
mutableprivate |
Definition at line 147 of file MahiFit.h.
Referenced by calculateArrivalTime(), calculateChiSq(), doFit(), minimize(), nnls(), nnlsConstrainParameter(), nnlsUnconstrainParameter(), onePulseMinimize(), phase1Apply(), phase1Debug(), resetWorkspace(), updateCov(), and updatePulseShape().
|
staticprivate |
Definition at line 153 of file MahiFit.h.
Referenced by doFit(), phase1Debug(), and updateCov().
|
private |
|
private |
Definition at line 186 of file MahiFit.h.
Referenced by resetPulseShapeTemplate(), and updatePulseShape().
|
private |
Definition at line 165 of file MahiFit.h.
Referenced by setParameters(), setPulseShapeTemplate(), and updatePulseShape().
|
staticprivate |
Definition at line 157 of file MahiFit.h.
Referenced by calculateArrivalTime().
|
private |
Definition at line 170 of file MahiFit.h.
Referenced by phase1Apply(), and setParameters().
|
private |
Definition at line 171 of file MahiFit.h.
Referenced by phase1Apply(), and setParameters().
|
private |
Definition at line 161 of file MahiFit.h.
Referenced by phase1Apply(), and setParameters().
|
private |
Definition at line 166 of file MahiFit.h.
Referenced by setPulseShapeTemplate(), and updatePulseShape().