Fit the LDF and the universe. More...
#include <LDFFinderKG/LDFFinder.h>
Classes | |
struct | CurvFitResult |
struct | LDFFitResult |
struct | Silents |
struct | Stage0 |
struct | Stage1 |
struct | Stage2 |
struct | Stage3 |
Public Types | |
enum | CurvatureParameter { eU = 0, eV = 1, eRCore = 2, eCTCore = 3 } |
enum | InfoLevel { eNone = 0, eFinal = 1, eIntermediate = 2, eObscure = 3, eMinuit = 4 } |
enum | LDFParameter { eShowerSize = 0, eCoreX = 1, eCoreY = 2, eShapeParameters = 3 } |
enum | ResultFlag { eSuccess, eFailure, eBreakLoop, eContinueLoop } |
Flag returned by module methods to the RunController. More... | |
enum | VersionInfoType { eFilename = 1, eRevisionNumber = 2, eDate = 3, eTime = 4, eLastEditor = 5 } |
Different types of version info that can be retrieved from GetVersionInfo. More... | |
Public Member Functions | |
fwk::VModule::ResultFlag | Finish () override |
Finish: invoked at end of the run (NOT end of the event) More... | |
utl::Stopwatch & | GetStopwatch () |
const utl::Stopwatch & | GetStopwatch () const |
std::string | GetVersionInfo (const VersionInfoType v) const |
Retrieve different sorts of module version info. More... | |
fwk::VModule::ResultFlag | Init () override |
Initialize: invoked at beginning of run (NOT beginning of event) More... | |
void | InitTiming () |
fwk::VModule::ResultFlag | Run (evt::Event &event) override |
Run: invoked once per event. More... | |
ResultFlag | RunWithTiming (evt::Event &event) |
Static Public Member Functions | |
static std::string | GetResultFlagByName (const ResultFlag flag) |
Private Member Functions | |
std::vector< int > | CleanSilentStation (const LDFFitResult &ldfres, const LDFFitConfig &config, const utl::Vector &showerAxis, std::vector< StationFitData > &stationFitData) const |
double | FitCurvature (CurvFitResult &result, const utl::Point &core, const std::vector< StationFitData > &data) const |
bool | FitGlobal (CurvFitResult &cres, LDFFitResult &lres, const LDFFitConfig &config, const std::vector< StationFitData > &data) const |
bool | FitLDF (LDFFitResult &result, LDFFitConfig &config, const utl::Vector &showerAxis, const std::vector< StationFitData > &data) const |
void | FitLDFSimplified (LDFFitResult &result, LDFFitConfig &config, const utl::Vector &showerAxis, const std::vector< StationFitData > &data) const |
Early estimate of shower size. More... | |
bool | FixBeta (const LDFFitResult &result, const utl::Vector &showerAxis, const std::vector< StationFitData > &data) const |
bool | FixCore (utl::Point &core, utl::TimeStamp &coreTime, utl::Vector &showerAxis, const evt::Event &event) const |
bool | FixGamma (const LDFFitResult &result, const utl::Vector &showerAxis, const std::vector< StationFitData > &data) const |
Criterion if gamma can be fitted analogue to beta must be checked/updated. More... | |
std::vector< StationFitData > | MakeStationFitData (const sevt::SEvent &sEvent) const |
Init station data used by LDF fit. More... | |
void | OutputResults (const evt::Event &event) const |
double | ParameterizedRc (const double cosTheta, const double showerSize) const |
REGISTER_MODULE ("LDFFinderKG", LDFFinder) | |
void | SetRecData (evt::Event &event, const LDFFitResult &lresult, const CurvFitResult &cresult) const |
Private Attributes | |
sdet::Array::Type | fArrayType = sdet::Array::e1500 |
std::vector< int > | fBadSilents |
utl::Point | fBarycenter |
utl::TimeStamp | fBaryTime |
CoreType | fCoreType |
EnergyConversion | fEnergyConversion |
bool | fFixedAxis = false |
bool | fFixedCurvature = false |
bool | fGlobalFit = false |
int | fInfoLevel = 0 |
LDFFitConfig | fLDFFitConfig |
double | fMaxBaryToCoreDistance = 0 |
double | fMaxChi2 = 0 |
double | fMaxTheta = 0 |
int | fRoptN = 0 |
struct LDFFinderKG::LDFFinder::Silents | fSilentsVars |
struct LDFFinderKG::LDFFinder::Stage0 | fStage0 |
struct LDFFinderKG::LDFFinder::Stage1 | fStage1 |
struct LDFFinderKG::LDFFinder::Stage2 | fStage2 |
struct LDFFinderKG::LDFFinder::Stage3 | fStage3 |
bool | fUseMaxLikelihood = false |
bool | fUseSilentStationsFromOtherGrids = false |
Fit the LDF and the universe.
Fit is performed in several stages:
Stage 0: (no actual minimization)
Estimate LDF slope from the shower zenith angle
.
Estimate from the station closest to 1000m distance to core (or barycenter).
Definition at line 71 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
Enumerator | |
---|---|
eU | |
eV | |
eRCore | |
eCTCore |
Definition at line 117 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
Enumerator | |
---|---|
eNone | |
eFinal | |
eIntermediate | |
eObscure | |
eMinuit |
Definition at line 77 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
Enumerator | |
---|---|
eShowerSize | |
eCoreX | |
eCoreY | |
eShapeParameters |
Definition at line 85 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
inherited |
Flag returned by module methods to the RunController.
Enumerator | |
---|---|
eSuccess |
Report success to RunController. |
eFailure |
Report failure to RunController, causing RunController to terminate execution. |
eBreakLoop |
Break current loop. It works for nested loops too! |
eContinueLoop |
Skip remaining modules in the current loop and continue with next iteration of the loop. |
|
inherited |
|
private |
Definition at line 1891 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References LDFFinderKG::LDFFitConfig::fLDF, LDFFinderKG::LDFFinder::LDFFitResult::fPar, LDFFinderKG::gBaryCS, and LDFFinderKG::RPerp().
|
inlineoverridevirtual |
Finish: invoked at end of the run (NOT end of the event)
This method is for things that should be done at the end of the run (for example, closing files or writing out histograms) {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 75 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
References fwk::VModule::eSuccess.
|
private |
Definition at line 1755 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References galactic::eV, LDFFinderKG::LDFFinder::CurvFitResult::fChi2, LDFFinderKG::LDFFinder::CurvFitResult::fCov, LDFFinderKG::LDFFinder::CurvFitResult::fNdof, LDFFinderKG::LDFFinder::CurvFitResult::fPar, LDFFinderKG::HasNaN(), INFO, jacobian(), utl::kilometer, utl::m, galactic::meter, OUT, and sqrt().
|
private |
Definition at line 1928 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References data, SdHorizontalReconstructionNS::eCoreX, SdHorizontalReconstructionNS::eCoreY, LDFFinderKG::eFitted, LDFFinderKG::eModeled, SdMonteCarloPropagatorKVI::eShowerSize, LDFFinderKG::LDFFinder::LDFFitResult::fChi2, LDFFinderKG::LDFFinder::CurvFitResult::fChi2, LDFFinderKG::LDFFinder::LDFFitResult::fCov, LDFFinderKG::LDFFinder::CurvFitResult::fCov, LDFFinderKG::LDFFitConfig::fFixCore, LDFFinderKG::LDFFitConfig::fLDF, LDFFinderKG::LDFFitConfig::fLDFShapeTreatment, LDFFinderKG::LDFFinder::LDFFitResult::fLogLikelihood, LDFFinderKG::LDFFinder::LDFFitResult::fNdof, LDFFinderKG::LDFFinder::CurvFitResult::fNdof, LDFFinderKG::LDFFinder::LDFFitResult::fPar, LDFFinderKG::LDFFinder::CurvFitResult::fPar, LDFFinderKG::LDFFitConfig::fUseSilentStations, LDFFinderKG::gBaryCS, LDFFinderKG::LDFFinder::LDFFitResult::GetCore(), LDFFinderKG::LDF::GetNShapeParameters(), LDFFinderKG::GetShapeLabel(), LDFFinderKG::GetShowerSizeLabel(), LDFFinderKG::HasNaN(), det::if(), INFO, utl::kilometer, km, utl::m, utl::String::Make(), galactic::meter, GeomAsymNS::nPar, OUT, and LDFFinderKG::LDF::ShapeModel().
|
private |
Definition at line 1508 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References SdHorizontalReconstructionNS::eCoreX, SdHorizontalReconstructionNS::eCoreY, LDFFinderKG::eFitted, LDFFinderKG::eModeled, SdMonteCarloPropagatorKVI::eShowerSize, LDFFinderKG::LDFFinder::LDFFitResult::fChi2, LDFFinderKG::LDFFinder::LDFFitResult::fCov, LDFFinderKG::LDFFitConfig::fFixCore, LDFFinderKG::LDFFitConfig::fLDF, LDFFinderKG::LDFFitConfig::fLDFShapeTreatment, LDFFinderKG::LDFFinder::LDFFitResult::fLogLikelihood, LDFFinderKG::LDFFinder::LDFFitResult::fNdof, LDFFinderKG::LDFFinder::LDFFitResult::fPar, LDFFinderKG::LDFFitConfig::fRecoveryThreshold, LDFFinderKG::LDFFitConfig::fUseSaturationRecovery, LDFFinderKG::LDFFitConfig::fUseSilentStations, LDFFinderKG::gBaryCS, LDFFinderKG::LDFFinder::LDFFitResult::GetCore(), utl::BasicVector< HepVector >::GetCosTheta(), LDFFinderKG::LDF::GetNShapeParameters(), LDFFinderKG::GetShapeLabel(), LDFFinderKG::GetShowerSizeLabel(), LDFFinderKG::HasNaN(), INFO, km, utl::m, utl::String::Make(), galactic::meter, OUT, LDFFinderKG::RPerp(), LDFFinderKG::LDF::SecondDerivative(), LDFFinderKG::LDF::ShapeModel(), and sqrt().
|
private |
Early estimate of shower size.
Definition at line 1406 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References LDFFinderKG::eModeled, SdMonteCarloPropagatorKVI::eShowerSize, LDFFinderKG::LDFFinder::LDFFitResult::fCov, LDFFinderKG::LDFFitConfig::fFixCore, LDFFinderKG::LDFFitConfig::fLDF, LDFFinderKG::LDFFitConfig::fLDFShapeTreatment, LDFFinderKG::LDFFinder::LDFFitResult::fLogLikelihood, LDFFinderKG::LDFFinder::LDFFitResult::fPar, LDFFinderKG::LDFFitConfig::fUseSaturationRecovery, LDFFinderKG::gBaryCS, LDFFinderKG::LDFFinder::LDFFitResult::GetCore(), utl::BasicVector< HepVector >::GetCosTheta(), LDFFinderKG::LDF::GetNShapeParameters(), LDFFinderKG::LDF::GetReferenceDistance(), LDFFinderKG::GetShowerSizeLabel(), max, OUT, result, LDFFinderKG::RPerp(), utl::s, LDFFinderKG::LDF::ShapeModel(), and sqrt().
|
private |
Definition at line 1000 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References LDFFinderKG::LDFFinder::LDFFitResult::GetCore(), galactic::meter, OUT, LDFFinderKG::RPerp(), and utl::s.
|
private |
Definition at line 848 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References Angle(), utl::CosAngle(), LDFFinderKG::eFit, LDFFinderKG::eHybrid, LDFFinderKG::eMC, ERROR, LDFFinderKG::gBaryCS, evt::ShowerFRecData::GetAxis(), evt::ShowerFRecData::GetCorePosition(), evt::Event::HasFEvent(), evt::Event::HasSimShower(), utl::kilometer, utl::kPi, utl::kSpeedOfLight, utl::String::Make(), galactic::meter, ns, OUT, utl::Sqr(), and sqrt().
|
private |
Criterion if gamma can be fitted analogue to beta must be checked/updated.
Definition at line 1062 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References LDFFinderKG::LDFFinder::LDFFitResult::GetCore(), galactic::meter, OUT, LDFFinderKG::RPerp(), and utl::s.
|
staticinherited |
Definition at line 8 of file VModule.cc.
References fwk::VModule::eBreakLoop, fwk::VModule::eContinueLoop, fwk::VModule::eFailure, and fwk::VModule::eSuccess.
Referenced by fwk::RunController::DoNextInSequence(), fwk::RunController::FinishBranch(), and fwk::RunController::InitBranch().
|
inlineinherited |
Definition at line 106 of file VModule.h.
References fwk::VModule::fStopwatch.
|
inlineinherited |
Definition at line 107 of file VModule.h.
References fwk::VModule::fStopwatch.
|
inherited |
Retrieve different sorts of module version info.
Definition at line 26 of file VModule.cc.
Referenced by fwk::CentralConfig::GetConfig(), ThresholdCalculatorKG::ThresholdCalculator::Init(), fdDoubleBumpFinder::FdDoubleBumpFinder::Init(), LaserGeneratorNA::LaserGenerator::Init(), LaserLightSimulatorNA::LaserLightSimulator::Init(), FdElectronicsSimulatorOG::FdElectronicsSimulator::Init(), TelescopeSimulatorKG::TelescopeSimulator::Init(), TelescopeSimulatorKG2::TelescopeSimulator::Init(), SdSimpleSimKG::SdSimpleSim::Init(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::Init(), and testRunController::testModuleVersionInfo().
|
overridevirtual |
Initialize: invoked at beginning of run (NOT beginning of event)
This method is for things that should be done once at the beginning of a run (for example, booking histograms, performing calculations that need to be done only once, initializing parameters) {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 222 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References sdet::Array::e1500, sdet::Array::e433, sdet::Array::e750, LDFFinderKG::eFit, utl::wcd::eGAP2012_012, utl::wcd::eGAP2014_035, LDFFinderKG::eHybrid, LDFFinderKG::eMC, LDFFinderKG::eModeled, ERROR, io::eSuccess, LDFFinderKG::GetShowerSizeLabel(), INFO, and G4StationSimulatorOG::p.
|
inlineinherited |
Definition at line 95 of file VModule.h.
References fwk::VModule::fStopwatch, and utl::Stopwatch::Reset().
|
private |
Init station data used by LDF fit.
Definition at line 1362 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References sdet::SDetectorConstants::eAny, cevt::StationConstants::eOffGrid, LDFFinderKG::StationFitData::fCTime, LDFFinderKG::StationFitData::fGPSTimeVariance, LDFFinderKG::StationFitData::fId, LDFFinderKG::StationFitData::fIsSaturated, LDFFinderKG::StationFitData::fPos, LDFFinderKG::StationFitData::fRecoveredSignal, LDFFinderKG::StationFitData::fRecoveredSignalErr, LDFFinderKG::StationFitData::fSignal, LDFFinderKG::StationFitData::fT50, and utl::kSpeedOfLight.
|
private |
Definition at line 177 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References degree, galactic::EeV, LDFFinderKG::gBaryCS, evt::ShowerSRecData::GetAngleChi2(), evt::ShowerSRecData::GetAngleNdof(), evt::ShowerSRecData::GetAxis(), evt::ShowerSRecData::GetBeta(), evt::ShowerSRecData::GetBetaError(), evt::ShowerSRecData::GetCoreError(), evt::ShowerSRecData::GetCorePosition(), evt::ShowerSRecData::GetCorrelationThetaPhi(), evt::ShowerSRecData::GetCorrelationXY(), evt::ShowerSRecData::GetCurvature(), evt::ShowerSRecData::GetCurvatureError(), evt::ShowerSRecData::GetEnergy(), evt::ShowerSRecData::GetEnergyError(), evt::ShowerSRecData::GetGamma(), evt::ShowerSRecData::GetGammaError(), evt::ShowerSRecData::GetLDFOptimumDistance(), evt::ShowerSRecData::GetLDFRecStage(), utl::BasicVector< HepVector >::GetPhi(), evt::ShowerSRecData::GetPhiError(), evt::ShowerSRecData::GetShowerSize(), evt::ShowerSRecData::GetShowerSizeError(), LDFFinderKG::GetShowerSizeLabel(), evt::ShowerSRecData::GetShowerSizeSystematics(), utl::BasicVector< HepVector >::GetTheta(), evt::ShowerSRecData::GetThetaError(), evt::ShowerSRecData::GetTimeResidualMean(), evt::ShowerSRecData::GetTimeResidualSpread(), km, utl::String::Make(), galactic::meter, utl::nanosecond, and OUT.
|
private |
Definition at line 1696 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References RdGeoCeLDFFitter::a, RdGeoCeLDFFitter::b, sdet::Array::e433, sdet::Array::e750, utl::kilometer, utl::s, and utl::Sqr().
|
private |
|
overridevirtual |
Run: invoked once per event.
This method is for things that should be done once per event {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 414 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References Angle(), LDFFinderKG::LDF::BetaUncertainty(), utl::Chi2Probability(), degree, SdHorizontalReconstructionNS::eCoreX, SdHorizontalReconstructionNS::eCoreY, LDFFinderKG::eFit, LDFFinderKG::eFitted, LDFFinderKG::eFixed, LDFFinderKG::eModeled, SdMonteCarloPropagatorKVI::eShowerSize, io::eSuccess, galactic::eV, LDFFinderKG::LDFFinder::CurvFitResult::fChi2, LDFFinderKG::LDFFinder::LDFFitResult::fCov, LDFFinderKG::LDFFinder::CurvFitResult::fCov, LDFFinderKG::LDFFitConfig::fLDF, LDFFinderKG::LDFFitConfig::fLDFShapeTreatment, LDFFinderKG::LDFFinder::CurvFitResult::fNdof, LDFFinderKG::LDFFinder::LDFFitResult::fPar, LDFFinderKG::LDFFinder::CurvFitResult::fPar, LDFFinderKG::LDFFinder::LDFFitResult::fRecStage, LDFFinderKG::LDFFitConfig::fUseSaturationRecovery, LDFFinderKG::LDFFitConfig::fUseSilentStations, LDFFinderKG::gBaryCS, LDFFinderKG::LDFFinder::LDFFitResult::GetCore(), LDFFinderKG::LDFFinder::LDFFitResult::GetLDFShapeParameters(), LDFFinderKG::LDF::GetNShapeParameters(), utl::BasicVector< HepVector >::GetPhi(), LDFFinderKG::GetShowerSizeLabel(), utl::BasicVector< HepVector >::GetTheta(), utl::BasicVector< HepVector >::GetX(), utl::BasicVector< HepVector >::GetY(), evt::Event::HasSEvent(), utl::InverseNormalCDF(), utl::kilometer, utl::String::Make(), galactic::meter, utl::nanosecond, utl::NormalCDF(), OUT, G4StationSimulatorOG::p, and result.
|
inlineinherited |
Definition at line 98 of file VModule.h.
References fwk::VModule::fStopwatch, fwk::VModule::Run(), utl::Stopwatch::Start(), and utl::Stopwatch::Stop().
Referenced by fwk::RunController::DoNextInSequence().
|
private |
Definition at line 1122 of file SdReconstruction/LDFFinderKG/LDFFinder.cc.
References degree, sdet::Array::e1500, sdet::Array::e433, sdet::Array::e750, sevt::StationConstants::eBadSilent, SdHorizontalReconstructionNS::eCoreX, SdHorizontalReconstructionNS::eCoreY, SdMonteCarloPropagatorKVI::eShowerSize, fwk::CoordinateSystemRegistry::eUndefined, galactic::eV, LDFFinderKG::LDFFinder::LDFFitResult::fChi2, LDFFinderKG::LDFFinder::CurvFitResult::fChi2, LDFFinderKG::LDFFinder::LDFFitResult::fCov, LDFFinderKG::LDFFinder::CurvFitResult::fCov, LDFFinderKG::LDFFinder::LDFFitResult::fLogLikelihood, LDFFinderKG::LDFFinder::LDFFitResult::fNdof, LDFFinderKG::LDFFinder::CurvFitResult::fNdof, LDFFinderKG::LDFFinder::LDFFitResult::fPar, LDFFinderKG::LDFFinder::CurvFitResult::fPar, LDFFinderKG::LDFFinder::LDFFitResult::fRecStage, LDFFinderKG::gBaryCS, LDFFinderKG::LDFFinder::LDFFitResult::GetCore(), LDFFinderKG::LDFFinder::LDFFitResult::GetLDFShapeParameters(), utl::Vector::GetMag(), LDFFinderKG::GetTimeVariance(), utl::BasicVector< HepVector >::GetZ(), utl::kilometer, utl::kSpeedOfLight, utl::m, OUT, utl::wcd::SignalUncertainty(), utl::Sqr(), and sqrt().
|
private |
Definition at line 205 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 220 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 215 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 216 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 211 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 218 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 212 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 213 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 214 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 204 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 217 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 207 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 208 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 206 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 219 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 209 of file SdReconstruction/LDFFinderKG/LDFFinder.h.
|
private |
Definition at line 210 of file SdReconstruction/LDFFinderKG/LDFFinder.h.