gulliver-bootstrap C++ API Reference

class BootstrapParams : public I3FrameObject
#include <BootstrapParams.h>

Public Types

enum ResultStatus

Values:

enumerator OK

The estimate was computed as expected.

enumerator Underflow

The requested containment level was inside all successful fits. The resulting estimate will be an overestimate.

enumerator Overflow

The requested containment level was outside all successful fits. The resulting estimate will be an underestimate.

enumerator NoValidFits

No fits were successful so no estimate could be produced.

Public Functions

BootstrapParams()
BootstrapParams(ResultStatus status, uint32_t successfulFits, uint32_t totalFits)
~BootstrapParams()

Public Members

ResultStatus status
uint32_t successfulFits

The number of input fits which succeeded.

uint32_t totalFits

The total number of input fits which were run.

Protected Functions

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

Friends

friend class icecube::serialization::access
class BootstrapParamsConverter : public I3ConverterImplementation<BootstrapParams>

Private Functions

I3TableRowDescriptionPtr CreateDescription(const BootstrapParams &p)
size_t FillRows(const BootstrapParams &p, I3TableRowPtr rows)
class BootstrappingLikelihoodService : public I3EventLogLikelihoodBase, public I3ServiceBase

A likelihood service which supports bootstrapping.

This likelihood service wraps another likelihood service which is used for all actual likelihood calculations. Its contribution is to create resampled collections of pulses, which are then passed to the underlying likelihood. In order to do this it should be used together with a BootstrappingSeedService which will cause the fitter to sequentially fit all of the resampled realizations.

Public Types

enum BootstrapOption

Values:

enumerator POISSON

Resample pulses by drawing a number of copies of each pulse according to a poisson distribution with mean equal to that pulse’s charge.

enumerator MULTINOMIAL

Resample pulses by drawing copies of each pulse proportionally to the ratio of that pulse’s charge to the total charge of the event, until the total resampled charge is approximately the original total charge.

Public Functions

BootstrappingLikelihoodService(const I3Context &c)
virtual void Configure()
virtual void SetGeometry(const I3Geometry &geo)
virtual void SetEvent(const I3Frame &f)
inline virtual double GetLogLikelihood(const I3EventHypothesis &ehypo)
inline virtual double GetLogLikelihoodWithGradient(const I3EventHypothesis &ehypo, I3EventHypothesis &gradient, double weight = 1)
inline virtual bool HasGradient()
inline virtual unsigned int GetMultiplicity()
inline virtual I3FrameObjectPtr GetDiagnostics(const I3EventHypothesis &fitresult)
inline virtual const std::string GetName() const
inline unsigned int GetNIterations() const
boost::shared_ptr<I3Map<OMKey, std::vector<I3RecoPulse>>> resampleEvent(unsigned int index)

Private Members

std::string pulsesName

The name of the input pulses, which will be resampled.

BootstrapOption bootstrapType

The type of resampling to perform.

unsigned int iterations

The number of resamplings to perform.

std::string randomName

The name of the random service to use.

std::string likelihoodName

The name of the wrapped likelihood service.

boost::shared_ptr<I3RandomService> randomService

The random service used for resampling.

boost::shared_ptr<I3EventLogLikelihoodBase> wrappedLikelihood

The actual likelihood.

boost::shared_ptr<I3Frame> sandbox

Dummy frame used to present the resampled pulses to the wrapped likelihood.

boost::shared_ptr<const I3Map<OMKey, std::vector<I3RecoPulse>>> originalPulses

The current base set of pulses.

std::map<unsigned int, boost::shared_ptr<I3Map<OMKey, std::vector<I3RecoPulse>>>> resampleCache

The collection of resampled pulse realizations. Calculating these once and storing them makes the calculation robust against a fitter which requests seeds out of order or multiple times.

std::vector<std::pair<unsigned int, OMKey>> omIndex

Index structure for sampling pulses multinomially.

discrete_distribution multinomialDist

Probability distribution for multinomial pulse sampling.

double qtot

The total charge of the current event.

class BootStrappingSeedService : public I3ServiceBase, public I3SeedServiceBase

A seed service which supports bootstrapping.

This seed service can either wrap another existing seed service, or can generate trivial ‘LineFit’ (least-squares) seeds based on the resampled pulses. If another seed service is wrapped, the total number of seeds this service will provide is the product of the number of seeds provided by the wrapped service with the number of resamplings to be performed.

Public Functions

inline BootStrappingSeedService(const I3Context &c)
inline void Configure()
inline virtual unsigned int SetEvent(const I3Frame &f)
inline virtual I3EventHypothesis GetSeed(unsigned int iseed) const
inline virtual I3EventHypothesis GetDummy() const
inline virtual I3EventHypothesis GetCopy(const I3EventHypothesis &eh) const
inline virtual void Tweak(I3EventHypothesis &eh) const
inline virtual void FillInTheBlanks(I3EventHypothesis &eh) const
inline I3EventHypothesis reLineFit(boost::shared_ptr<I3Map<OMKey, std::vector<I3RecoPulse>>> pulses) const

Private Members

std::string seedName

The name of the wrapped seed service, or empty if no base seed should be used.

std::string likelihoodName

The name of the corresponding BootstrappingLikelihoodService.

boost::shared_ptr<I3SeedServiceBase> wrappedSeed

The wrapped seed service, if any.

boost::shared_ptr<BootstrappingLikelihoodService> likelihood

The associated likelihood.

unsigned int nSeeds

The number of actual seeds, no counting resamplings.

boost::shared_ptr<const I3Geometry> geometry

The current geometry.

class BootstrapSeedTweak : public I3ConditionalModule

Computes the average of the various bootstrapped fits, the angular difference between each fit and the average, and the angular difference from the average within which a given fraction of the bootstrapped reconstructions fall. This latter value is intended as an estimate of the angular uncertainty for the reconstruction of the event. FInally, the averaged bootstrapped reconstruction is appended to the collection of bootstrapped reconstructions.

Public Functions

inline BootstrapSeedTweak(const I3Context &context)
inline void Configure()
inline void Physics(boost::shared_ptr<I3Frame> frame)

Private Members

std::string bootstrappedRecosName
double containmentLevel
std::string angularEstimateName
class workaround_discrete_distribution

A really dumb implementation of a discrete distribution with given probabilities which takes time linear in the number of entries, rather than constant like the boost implementation.

Public Functions

template<class Iterator>
inline workaround_discrete_distribution(Iterator first, Iterator last)
inline unsigned int operator()(random_adapter rand)

Private Types

typedef std::vector<std::pair<double, unsigned int>> tableType

Private Members

tableType table

The mapping of cumulative probabilities to result values.

Private Static Functions

static inline bool compProb(double x, const std::pair<double, unsigned int> &p)
namespace [anonymous]
namespace [anonymous]
namespace std

STL namespace.

file BootstrapParams.cxx

Functions

I3_SERIALIZABLE(BootstrapParams)
file BootstrapParams.h
#include <icetray/I3FrameObject.h>
#include <icetray/serialization.h>
file BootstrapParamsConverter.cxx
file BootstrapParamsConverter.h
#include <tableio/I3Converter.h>
file BootstrappingLikelihoodService.cxx
#include <icetray/I3SingleServiceFactory.h>

Typedefs

typedef I3SingleServiceFactory<BootstrappingLikelihoodService, I3EventLogLikelihoodBase> BootstrappingLikelihoodServiceFactory

Functions

I3_SERVICE_FACTORY(BootstrappingLikelihoodServiceFactory)
file BootstrappingLikelihoodService.h
#include <icetray/I3ServiceBase.h>
#include <gulliver/I3EventLogLikelihoodBase.h>
#include <dataclasses/physics/I3RecoPulse.h>
#include <phys-services/I3RandomService.h>
#include “discreteDistribution.h
file BootstrappingSeedService.cxx
#include <icetray/I3ServiceBase.h>
#include <icetray/I3SingleServiceFactory.h>
#include <dataclasses/geometry/I3Geometry.h>
#include <gulliver/I3SeedServiceBase.h>
#include <boost/make_shared.hpp>

Typedefs

typedef I3SingleServiceFactory<BootStrappingSeedService, I3SeedServiceBase> BootStrappingSeedServiceFactory

Functions

I3_SERVICE_FACTORY(BootStrappingSeedServiceFactory)
file BootstrapSeedTweak.cxx
#include <icetray/I3ConditionalModule.h>
#include <algorithm>
#include <limits>
#include <boost/make_shared.hpp>
#include <boost/math/constants/constants.hpp>
#include <dataclasses/physics/I3Particle.h>
#include <dataclasses/I3Double.h>

Functions

I3_MODULE(BootstrapSeedTweak)
file discreteDistribution.h
#include <numeric>
#include <algorithm>
#include <boost/version.hpp>

Defines

USE_BOOST_DISCRETE_RANDOM

Typedefs

typedef I3RandomService *random_adapter
typedef workaround_discrete_distribution discrete_distribution

Functions

template<typename PairType>
bool compareFirst(PairType p1, PairType p2)
dir gulliver-bootstrap
dir gulliver-bootstrap
dir gulliver-bootstrap
dir icetray
dir private
dir public