millipede C++ API Reference

template<class Base>
class I3MillipedeBase : public Base
#include <Millipede.h>

Subclassed by MillipedeDataChecker, MillipedeFisherMatrixCalculator, MillipedeLikelihood, Monopod, MuMillipede, PyMillipede, TauMillipede

Public Functions

I3MillipedeBase(const I3Context &context)
virtual ~I3MillipedeBase()
void Configure()

Protected Functions

void DatamapFromFrame(const I3Frame &frame)
inline cholmod_sparse *GetResponseMatrix(const std::vector<I3Particle> &sources, cholmod_sparse **gradients = NULL)
inline void SolveEnergyLosses(std::vector<I3Particle> &sources, cholmod_sparse *response_matrix, cholmod_sparse *gradients = NULL)

Protected Attributes

I3PhotonicsServicePtr muon_p
I3PhotonicsServicePtr cascade_p
double regularizeMuons_
double regularizeStochastics_
MillipedeDOMCacheMap domCache_
std::string pulses_name_
std::string readout_window_name_
std::vector<std::string> exclusions_name_
bool partial_exclusion_
double timeBinPhotons_
double timeBinSigma_
double minWidth_
bool useUnhit_
double relUncertainty_
cholmod_common c

Private Functions

SET_LOGGER ("MillipedeBase")
class MillipedeDataChecker : public I3MillipedeBase<I3ConditionalModule>

: Check pulses and binning thereof for crippling errors

Public Functions

inline void Physics(I3FramePtr frame)

Private Functions

SET_LOGGER ("MillipedeDataChecker")
struct MillipedeDOMCache
#include <Millipede.h>

Public Members

I3OMGeo geo
double light_scale
int nbins
double *time_bin_edges
double *charges
double *noise
boost::dynamic_bitset<uint8_t> valid
bool amplitudes_only
double noise_rate
class MillipedeDOMCacheMap : public std::map<OMKey, struct MillipedeDOMCache>
#include <Millipede.h>

Public Functions

~MillipedeDOMCacheMap()
void UpdateParams(I3GeometryConstPtr geometry, I3CalibrationConstPtr calib, I3DetectorStatusConstPtr status)
void UpdateData(const I3TimeWindow &readout_window, const I3RecoPulseSeriesMap &pulses, const I3TimeWindowSeriesMap &exclusions, double PEPerBin, double BayesianBlockSigma, double min_width, bool useUnhit)

Public Static Functions

static std::vector<std::pair<std::vector<double>, std::vector<double>>> BinPulses(const I3RecoPulseSeries &pulses, const I3TimeWindowSeries &readouts, double PEPerBin, double BayesianBlockSigma, double min_width)

Private Members

I3GeometryConstPtr geometry_
I3CalibrationConstPtr calib_
I3DetectorStatusConstPtr status_
class MillipedeFisherMatrixCalculator : public I3MillipedeBase<I3ConditionalModule>

Public Functions

inline MillipedeFisherMatrixCalculator(const I3Context &ctx)
inline void Configure()
inline void Physics(I3FramePtr frame)

Private Functions

SET_LOGGER ("MillipedeFisherMatrixCalculator")

Private Members

std::string seed_name_
std::string output_name_
class MillipedeFitParams : public I3LogLikelihoodFitParams
#include <Millipede.h>

Public Functions

MillipedeFitParams()

Public Members

double qtotal
double predicted_qtotal
double squared_residuals
double chi_squared
double chi_squared_dof
double logl_ratio

Protected Functions

template<class Archive>
void serialize(Archive &ar, unsigned version)

Friends

friend class icecube::serialization::access
class MillipedeFitParamsConverter : public I3ConverterImplementation<MillipedeFitParams>

copyright (C) 2011 The Icecube Collaboration

$Id$

Version

$Revision$

Date

$LastChangedDate$

Author

Jakob van Santen vansanten@wisc.edu $LastChangedBy$

Private Functions

I3TableRowDescriptionPtr CreateDescription(const MillipedeFitParams &params)

copyright (C) 2011 The Icecube Collaboration

$Id$

Version

$Revision$

Date

$LastChangedDate$

Author

Jakob van Santen vansanten@wisc.edu $LastChangedBy$

size_t FillRows(const MillipedeFitParams &params, I3TableRowPtr rows)
class MillipedeLikelihood : public I3MillipedeBase<I3ServiceBase>, public I3EventLogLikelihoodBase

Public Functions

MillipedeLikelihood(const I3Context &context)
void SetEvent(const I3Frame&)
inline void SetGeometry(const I3Geometry &geo)
inline bool HasGradient()
double GetLogLikelihood(const I3EventHypothesis&)
double GetLogLikelihoodWithGradient(const I3EventHypothesis&, I3EventHypothesis &gradient, double weight)
unsigned int GetMultiplicity()
double GetLogLikelihood(const I3EventHypothesis&, I3EventHypothesis*, bool solve_for_energies, double weight)
I3FrameObjectPtr GetDiagnostics(const I3EventHypothesis&)
inline virtual const std::string GetName() const

Private Functions

SET_LOGGER ("MillipedeLikelihood")
I3VectorI3ParticlePtr ExtractHypothesis(const I3EventHypothesis&)
class Monopod : public I3MillipedeBase<I3ConditionalModule>

Public Functions

Monopod(const I3Context&)
void Physics(I3FramePtr)
void Configure()

Private Functions

SET_LOGGER ("Monopod")

Private Members

std::string seed_name_
std::string solution_name_
class MuMillipede : public I3MillipedeBase<I3ConditionalModule>

Public Functions

MuMillipede(const I3Context&)
void Configure()
void Hypothesis(I3FramePtr frame, std::vector<I3Particle> &hypothesis)
void Physics(I3FramePtr frame)

Private Functions

SET_LOGGER ("MuMillipede")

Private Members

std::string seed_
double boundary_
double muonspacing_
double showerspacing_
std::string output_name
double slantstart_
double slantstop_
class MuMillipedeParametrization : public I3SimpleParametrization

Public Functions

MuMillipedeParametrization(const I3Context&)
void Configure() override
void UpdatePhysicsVariables() override
void UpdateParameters() override
bool InitChainRule(bool grad, bool hess) override
void ApplyChainRule() override

Public Members

double boundary_
double muonspacing_
double showerspacing_
std::string name_
double starting_cascade_dirstep_
double slantstart_
double slantstop_

Private Functions

SET_LOGGER ("MuMillipedeParametrization")
struct photo_source

Public Members

PhotonicsSource source
I3PhotonicsServicePtr service
const I3Particle *particle
class PyMillipede : public I3MillipedeBase<I3ConditionalModule>

Public Functions

PyMillipede(const I3Context&)
void Configure()
void Physics(I3FramePtr frame)

Private Functions

SET_LOGGER ("PyMillipede")
void CallDebug(cholmod_sparse *response_matrix, const I3Vector<I3Particle> &solutions, I3FramePtr frame)

Private Members

boost::python::object hypothesis_
boost::python::object callback_
std::string output_name
class TauMillipede : public I3MillipedeBase<I3ConditionalModule>

Public Functions

TauMillipede(const I3Context&)
void Configure()
void Hypothesis(I3FramePtr frame, std::vector<I3Particle> &hypothesis)
void Physics(I3FramePtr frame)

Private Functions

SET_LOGGER ("TauMillipede")

Private Members

std::string tau_
std::string output_name
class TauMillipedeParametrization : public I3SimpleParametrization

Public Functions

TauMillipedeParametrization(const I3Context &context)

constructor for use with icetray

void UpdatePhysicsVariables()
void ApplyChainRule()

Protected Functions

SET_LOGGER ("TauMillipedeParametrization")
namespace Millipede

Functions

cholmod_sparse *GetResponseMatrix(const MillipedeDOMCacheMap &datamap, const std::vector<I3Particle> &sources, I3PhotonicsServicePtr muon_p, I3PhotonicsServicePtr cascade_p, cholmod_sparse **gradients, cholmod_common *c)
void SolveEnergyLosses(MillipedeDOMCacheMap &datamap, std::vector<I3Particle> &sources, cholmod_sparse *response_matrix, cholmod_sparse *gradients, double muonRegularization, double stochasticRegularization, cholmod_common *c, double relUncertainty)
double FitStatistics(const MillipedeDOMCacheMap &datamap, const std::vector<I3Particle> &sources, double energy_epsilon, cholmod_sparse *response_matrix, MillipedeFitParams *params, cholmod_common *c, double relUncertainty)
I3MatrixPtr FisherMatrix(const MillipedeDOMCacheMap &datamap, const std::vector<I3Particle> &sources, cholmod_sparse *response_matrix, cholmod_common *c, double relUncertainty)
void LLHGradient(const MillipedeDOMCacheMap &datamap, const std::vector<I3Particle> &sources, std::vector<I3Particle> &gradsources, double energy_epsilon, double weight, cholmod_sparse *response_matrix, cholmod_sparse *gradients, cholmod_common *c, double relUncertainty)
namespace std

STL namespace.

file linalg_solver.h
#include <cholmod.h>

Functions

cholmod_dense *nnls_lawson_hanson_millipede(cholmod_sparse *A, cholmod_dense *y, double tolerance, int min_iterations, int max_iterations, int npos, int normaleq, cholmod_common *c)
cholmod_dense *nmml_poisson(cholmod_sparse *B, cholmod_sparse *extra_terms, cholmod_dense *data, cholmod_dense *noise, double tolerance, int min_iterations, int max_iterations, cholmod_common *c)
cholmod_dense *pcg_poisson(cholmod_sparse *B, cholmod_sparse *extra_terms, cholmod_dense *data, cholmod_dense *noise, double tolerance, int min_iterations, int max_iterations, cholmod_common *c, double rel_err)
file Millipede.h
#include <icetray/I3ConditionalModule.h>
#include <icetray/I3ServiceBase.h>
#include <dataclasses/calibration/I3Calibration.h>
#include <dataclasses/status/I3DetectorStatus.h>
#include <dataclasses/geometry/I3Geometry.h>
#include <dataclasses/physics/I3Particle.h>
#include <dataclasses/physics/I3RecoPulse.h>
#include <dataclasses/I3TimeWindow.h>
#include <dataclasses/I3Matrix.h>
#include <gulliver/I3LogLikelihoodFitParams.h>
#include <photonics-service/I3PhotonicsService.h>
#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/python.hpp>
#include <boost/dynamic_bitset.hpp>
#include <cholmod.h>

Typedefs

typedef I3MillipedeBase<I3Module> I3MillipedeModule
typedef I3MillipedeBase<I3ConditionalModule> I3MillipedeConditionalModule
typedef I3MillipedeBase<I3ServiceBase> I3MillipedeService

Functions

std::ostream &operator<<(std::ostream &oss, const MillipedeFitParams &d)
I3_POINTER_TYPEDEFS(MillipedeFitParams)
I3_CLASS_VERSION (MillipedeFitParams, 2)
file MillipedeBase.cxx
#include <icetray/I3Frame.h>
#include <icetray/I3Units.h>
#include <photonics-service/I3PhotonicsService.h>
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
file MillipedeDataChecker.cxx
#include <numeric>

Functions

I3_MODULE(MillipedeDataChecker)
file MillipedeDOMCacheMap.cxx
#include <icetray/I3Units.h>
#include <dataclasses/calibration/I3Calibration.h>
#include <dataclasses/status/I3DetectorStatus.h>
#include <dataclasses/geometry/I3Geometry.h>
#include <dataclasses/physics/I3Particle.h>
#include <dataclasses/physics/I3RecoPulse.h>
#include <dataclasses/I3TimeWindow.h>
#include <dataclasses/I3DOMFunctions.h>
#include <photonics-service/I3PhotonicsService.h>
#include <boost/shared_ptr.hpp>
#include <boost/foreach.hpp>
#include <string>
#include <vector>
#include <stack>
#include <cmath>
#include <numeric>
#include <dataclasses/external/CompareFloatingPoint.h>
#include <cholmod.h>

Functions

static int rebin_min_entries(int raw_bins, const double *raw_bin_edges, const double *raw_charges, double *bin_edges, double *charges, double PEPerBin, double min_width)
static int rebin_bayesian_blocks(int raw_bins, const double *raw_bin_edges, const double *raw_charges, double *bin_edges, double *charges, double ncp_prior, double min_width)
static std::pair<std::vector<double>, std::vector<double>> bin_pulses(I3RecoPulseSeries::const_iterator begin, I3RecoPulseSeries::const_iterator end, const I3TimeWindow &readout_window)
static int MillipedeAddOMSourcePairToMatrix(MillipedeDOMCacheMap::const_iterator om, std::vector<photo_source>::const_iterator src, cholmod_triplet *basis_trip, cholmod_triplet *gradient_triplet, int i, int j)
std::ostream &operator<<(std::ostream &oss, const MillipedeFitParams &p)
I3_SERIALIZABLE(MillipedeFitParams)
file MillipedeFisherMatrixCalculator.cxx
#include <boost/make_shared.hpp>

Functions

I3_MODULE(MillipedeFisherMatrixCalculator)
file MillipedeFitParamsConverter.cxx
file MillipedeFitParamsConverter.h
#include <tableio/I3Converter.h>
file MillipedeLikelihood.cxx
#include <gulliver/I3EventLogLikelihoodBase.h>
#include <gulliver/I3EventHypothesis.h>
#include <icetray/I3SingleServiceFactory.h>
#include <boost/make_shared.hpp>

Typedefs

typedef I3Vector<I3Particle> I3VectorI3Particle
typedef boost::shared_ptr<I3VectorI3Particle> I3VectorI3ParticlePtr
typedef I3SingleServiceFactory<MillipedeLikelihood, I3EventLogLikelihoodBase> MillipedeLikelihoodFactory

Functions

I3_POINTER_TYPEDEFS(MillipedeLikelihood)
I3_SERVICE_FACTORY(MillipedeLikelihoodFactory)
file MillipedeSolver.cxx
#include <dataclasses/physics/I3Particle.h>
#include <dataclasses/I3Matrix.h>
#include <vector>
#include <cmath>
#include <cholmod.h>
#include <SuiteSparseQR_C.h>
#include “linalg_solver.h

Functions

static cholmod_dense *FillMillipedeDataVector(const MillipedeDOMCacheMap &datamap, cholmod_common *c)
static cholmod_dense *FillMillipedeNoiseVector(const MillipedeDOMCacheMap &datamap, cholmod_common *c)
static cholmod_sparse *GetMillipedeStochasticPenaltyMatrix(const std::vector<I3Particle> &sources, cholmod_common *c)
static cholmod_sparse *GetMillipedeContinuousPenaltyMatrix(const std::vector<I3Particle> &sources, cholmod_common *c)
static cholmod_sparse *ElementwiseTensorContract(cholmod_sparse *grad, cholmod_dense *vec, bool from_left, cholmod_common *c)
file Monopod.cxx
#include <phys-services/geo-selector/I3GeoTrimmers.h>
#include <boost/python.hpp>
#include <boost/make_shared.hpp>

Functions

I3_MODULE(Monopod)
file MuMillipede.cxx
#include <phys-services/I3Calculator.h>
#include <lilliput/parametrization/I3SimpleParametrization.h>
#include <gulliver/I3ParametrizationBase.h>
#include <gulliver/I3EventHypothesis.h>
#include <icetray/I3ServiceFactory.h>
#include <icetray/I3SingleServiceFactory.h>

Typedefs

typedef I3SingleServiceFactory<MuMillipedeParametrization, I3ParametrizationBase> MuMillipedeParametrizationFactory

Functions

static void MuMillipedeHypothesis(I3ParticleConstPtr track, std::vector<I3Particle> &hypothesis, double boundary, double muonspacing, double showerspacing, double slantstart, double slantstop)
I3_SERVICE_FACTORY(MuMillipedeParametrizationFactory)
I3_MODULE(MuMillipede)
file PyMillipede.cxx
#include <boost/python.hpp>
#include <boost/foreach.hpp>

Functions

I3_MODULE(PyMillipede)
file TauMillipede.cxx
#include <phys-services/I3Calculator.h>
#include <lilliput/parametrization/I3SimpleParametrization.h>
#include <gulliver/I3ParametrizationBase.h>
#include <gulliver/I3EventHypothesis.h>
#include <icetray/I3ServiceFactory.h>
#include <icetray/I3SingleServiceFactory.h>
#include <string>

Typedefs

typedef I3SingleServiceFactory<TauMillipedeParametrization, I3ParametrizationBase> TauMillipedeParametrizationFactory

Functions

static void TauMillipedeHypothesis(I3ParticleConstPtr tau, std::vector<I3Particle> &hypothesis)
I3_SERVICE_FACTORY(TauMillipedeParametrizationFactory)
I3_MODULE(TauMillipede)
dir converter
dir icetray
dir millipede
dir millipede
dir millipede
dir private
dir public