Juggler
Juggling algorithms and event processing using gaudi framework
Jug Namespace Reference

Namespaces

 Base
 
 BField
 
 detail
 
 Digi
 
 Helpers
 
 Options
 
 PlotHelpers
 
 Reco
 
 Track
 
 Utils
 

Classes

struct  GeometryIdMultisetAccessor
 
class  GroupBy
 
class  IndexSourceLink
 
class  MeasurementCalibrator
 Calibrator to convert an index source link to a measurement. More...
 
struct  ParticleHitCount
 Associate a particle to its hit count within a proto track. More...
 
class  Range
 
struct  SimMultiTrajectory
 Struct for truth track fitting/finding result with Acts::KalmanFitter/Acts::CombinatorialKalmanFilter. More...
 
class  SourceLink
 
struct  Trajectories
 

Typedefs

using VecULong = std::vector< unsigned long >
 
using VecVecULong = std::vector< std::vector< unsigned long > >
 
template<typename T >
using GeometryIdMultiset = boost::container::flat_multiset< T, detail::CompareGeometryId >
 
template<typename T >
using GeometryIdMultimap = GeometryIdMultiset< std::pair< Acts::GeometryIdentifier, T > >
 
using Index = uint32_t
 
template<typename value_t >
using IndexMultimap = boost::container::flat_multimap< Index, value_t >
 
using IndexSourceLinkContainer = GeometryIdMultiset< IndexSourceLink >
 
using IndexSourceLinkAccessor = GeometryIdMultisetAccessor< IndexSourceLink >
 Accessor for the above source link container. More...
 
using Measurement = ::Acts::BoundVariantMeasurement< IndexSourceLink >
 Variable measurement type that can contain all possible combinations. More...
 
using MeasurementContainer = std::vector< Measurement >
 
using IndexedParams = std::unordered_map< size_t, Acts::BoundTrackParameters >
 
using SourceLinkContainer = GeometryIdMultiset< SourceLink >
 Store source links ordered by geometry identifier. More...
 
using TrackParameters = ::Acts::BoundTrackParameters
 (Reconstructed) track parameters e.g. close to the vertex. More...
 
using TrackParametersContainer = std::vector< TrackParameters >
 Container of reconstructed track states for multiple tracks. More...
 
using Trajectory = Acts::MultiTrajectory< IndexSourceLink >
 MultiTrajectory definition. More...
 
using TrajectoryContainer = std::vector< SimMultiTrajectory >
 Container for the truth fitting/finding track(s) More...
 
using ProtoTrack = std::vector< size_t >
 A proto track is a collection of hits identified by their indices. More...
 
using ProtoTrackContainer = std::vector< ProtoTrack >
 Container of proto tracks. Each proto track is identified by its index. More...
 
using TrajectoriesContainer = std::vector< Trajectories >
 Container for multiple trajectories. More...
 

Functions

template<typename Container , typename KeyGetter >
auto makeGroupBy (const Container &container, KeyGetter keyGetter) -> GroupBy< decltype(std::begin(container)), KeyGetter >
 Construct the group-by proxy for a container. More...
 
std::string ensureWritableDirectory (const std::string &dir)
 
std::string joinPaths (const std::string &dir, const std::string &name)
 Join dir and name into one path with correct handling of empty dirs. More...
 
std::string perEventFilepath (const std::string &dir, const std::string &name, size_t event)
 
std::pair< size_t, size_t > determineEventFilesRange (const std::string &dir, const std::string &name)
 
template<typename Iterator >
Range< Iterator > makeRange (Iterator begin, Iterator end)
 
template<typename Iterator >
Range< Iterator > makeRange (std::pair< Iterator, Iterator > range)
 
template<typename T >
Range< typename GeometryIdMultiset< T >::const_iterator > selectVolume (const GeometryIdMultiset< T > &container, Acts::GeometryIdentifier::Value volume)
 Select all elements within the given volume. More...
 
template<typename T >
auto selectVolume (const GeometryIdMultiset< T > &container, Acts::GeometryIdentifier id)
 
template<typename T >
Range< typename GeometryIdMultiset< T >::const_iterator > selectLayer (const GeometryIdMultiset< T > &container, Acts::GeometryIdentifier::Value volume, Acts::GeometryIdentifier::Value layer)
 Select all elements within the given layer. More...
 
template<typename T >
auto selectLayer (const GeometryIdMultiset< T > &container, Acts::GeometryIdentifier id)
 
template<typename T >
Range< typename GeometryIdMultiset< T >::const_iterator > selectModule (const GeometryIdMultiset< T > &container, Acts::GeometryIdentifier geoId)
 Select all elements for the given module / sensitive surface. More...
 
template<typename T >
auto selectModule (const GeometryIdMultiset< T > &container, Acts::GeometryIdentifier::Value volume, Acts::GeometryIdentifier::Value layer, Acts::GeometryIdentifier::Value module)
 
template<typename T >
GroupBy< typename GeometryIdMultiset< T >::const_iterator, detail::GeometryIdGettergroupByModule (const GeometryIdMultiset< T > &container)
 Iterate over groups of elements belonging to each module/ sensitive surface. More...
 
template<typename value_t >
boost::container::flat_multimap< value_t, IndexinvertIndexMultimap (const IndexMultimap< value_t > &multimap)
 
template<typename Container , typename KeyGetter >
GroupBy< typename Container::const_iterator, KeyGetter > makeGroupBy (const Container &container, KeyGetter keyGetter)
 Construct the group-by proxy for a container. More...
 

Typedef Documentation

◆ GeometryIdMultimap

template<typename T >
using Jug::GeometryIdMultimap = typedef GeometryIdMultiset<std::pair<Acts::GeometryIdentifier, T> >

Store elements indexed by an geometry id.

Template Parameters
Ttype to be stored

The behaviour is the same as for the GeometryIdMultiset except that the stored elements do not know their geometry id themself. When iterating the iterator elements behave as for the std::map, i.e.

for (const auto& entry: elements) {
    auto id = entry.first; // geometry id
    const auto& el = entry.second; // stored element
}

◆ GeometryIdMultiset

template<typename T >
using Jug::GeometryIdMultiset = typedef boost::container::flat_multiset<T, detail::CompareGeometryId>

Store elements that know their detector geometry id, e.g. simulation hits.

Template Parameters
Ttype to be stored, must be compatible with CompareGeometryId

The container stores an arbitrary number of elements for any geometry id. Elements can be retrieved via the geometry id; elements can be selected for a specific geometry id or for a larger range, e.g. a volume or a layer within the geometry hierachy using the helper functions below. Elements can also be accessed by index that uniquely identifies each element regardless of geometry id.

◆ Index

typedef uint32_t Jug::Index

Index type to reference elements in a container.

We do not expect to have more than 2^32 elements in any given container so a fixed sized integer type is sufficient.

◆ IndexedParams

using Jug::IndexedParams = typedef std::unordered_map<size_t, Acts::BoundTrackParameters>

◆ IndexMultimap

template<typename value_t >
using Jug::IndexMultimap = typedef boost::container::flat_multimap<Index, value_t>

Store elements that are identified by an index, e.g. in another container.

Each index can have zero or more associated elements. A typical case could be to store all generating particles for a hit where the hit is identified by its index in the hit container.

◆ IndexSourceLinkAccessor

typedef GeometryIdMultisetAccessor< std::reference_wrapper< const IndexSourceLink > > Jug::IndexSourceLinkAccessor

Accessor for the above source link container.

It wraps up a few lookup methods to be used in the Combinatorial Kalman Filter

Accessor for the above source link container

It wraps up a few lookup methods to be used in the Combinatorial Kalman Filter

◆ IndexSourceLinkContainer

typedef GeometryIdMultiset< std::reference_wrapper< const IndexSourceLink > > Jug::IndexSourceLinkContainer

Container of index source links.

Since the source links provide a .geometryId() accessor, they can be stored in an ordered geometry container.

◆ Measurement

typedef::Acts::BoundVariantMeasurement Jug::Measurement

Variable measurement type that can contain all possible combinations.

◆ MeasurementContainer

typedef std::vector< Measurement > Jug::MeasurementContainer

Container of measurements.

In contrast to the source links, the measurements themself must not be orderable. The source links stored in the measurements are treated as opaque here and no ordering is enforced on the stored measurements.

◆ ProtoTrack

using Jug::ProtoTrack = typedef std::vector<size_t>

A proto track is a collection of hits identified by their indices.

◆ ProtoTrackContainer

using Jug::ProtoTrackContainer = typedef std::vector<ProtoTrack>

Container of proto tracks. Each proto track is identified by its index.

◆ SourceLinkContainer

Store source links ordered by geometry identifier.

◆ TrackParameters

typedef::Acts::BoundTrackParameters Jug::TrackParameters

(Reconstructed) track parameters e.g. close to the vertex.

◆ TrackParametersContainer

Container of reconstructed track states for multiple tracks.

◆ TrajectoriesContainer

using Jug::TrajectoriesContainer = typedef std::vector<Trajectories>

Container for multiple trajectories.

◆ Trajectory

using Jug::Trajectory = typedef Acts::MultiTrajectory<IndexSourceLink>

MultiTrajectory definition.

◆ TrajectoryContainer

using Jug::TrajectoryContainer = typedef std::vector<SimMultiTrajectory>

Container for the truth fitting/finding track(s)

◆ VecULong

using Jug::VecULong = typedef std::vector<unsigned long>

◆ VecVecULong

using Jug::VecVecULong = typedef std::vector<std::vector<unsigned long> >

Function Documentation

◆ determineEventFilesRange()

std::pair< size_t, size_t > Jug::determineEventFilesRange ( const std::string &  dir,
const std::string &  name 
)

Determine the range of available events in a directory of per-event files.

@params dir input directory, current directory if empty @params name base filename

Returns
first and last+1 event number
{0, 0} when no matching files could be found

Event files must be named [<dir>/]event<XXXXXXXXX>-<name> to be considered

◆ ensureWritableDirectory()

std::string Jug::ensureWritableDirectory ( const std::string &  dir)

Ensure that the given directory exists and is writable.

Returns
Canonical path to the directory.

Will create missing directories and throw on any error.

◆ groupByModule()

template<typename T >
GroupBy< typename GeometryIdMultiset< T >::const_iterator, detail::GeometryIdGetter > Jug::groupByModule ( const GeometryIdMultiset< T > &  container)
inline

Iterate over groups of elements belonging to each module/ sensitive surface.

◆ invertIndexMultimap()

template<typename value_t >
boost::container::flat_multimap< value_t, Index > Jug::invertIndexMultimap ( const IndexMultimap< value_t > &  multimap)
inline

Invert the multimap, i.e. from a -> {b...} to b -> {a...}.

Note
This assumes that the value in the initial multimap is itself a sortable index-like object, as would be the case when mapping e.g. hit ids to particle ids/ barcodes.

◆ joinPaths()

std::string Jug::joinPaths ( const std::string &  dir,
const std::string &  name 
)

Join dir and name into one path with correct handling of empty dirs.

◆ makeGroupBy() [1/2]

template<typename Container , typename KeyGetter >
GroupBy< typename Container::const_iterator, KeyGetter > Jug::makeGroupBy ( const Container &  container,
KeyGetter  keyGetter 
)

Construct the group-by proxy for a container.

◆ makeGroupBy() [2/2]

template<typename Container , typename KeyGetter >
auto Jug::makeGroupBy ( const Container &  container,
KeyGetter  keyGetter 
) -> GroupBy<decltype(std::begin(container)), KeyGetter>

Construct the group-by proxy for a container.

◆ makeRange() [1/2]

template<typename Iterator >
Range< Iterator > Jug::makeRange ( Iterator  begin,
Iterator  end 
)

◆ makeRange() [2/2]

template<typename Iterator >
Range< Iterator > Jug::makeRange ( std::pair< Iterator, Iterator >  range)

◆ perEventFilepath()

std::string Jug::perEventFilepath ( const std::string &  dir,
const std::string &  name,
size_t  event 
)

Construct a file path of the form [<dir>/]event<XXXXXXXXX>-<name>.

@params dir output directory, current directory if empty @params name basic filename @params event event number

◆ selectLayer() [1/2]

template<typename T >
auto Jug::selectLayer ( const GeometryIdMultiset< T > &  container,
Acts::GeometryIdentifier  id 
)
inline

◆ selectLayer() [2/2]

template<typename T >
Range< typename GeometryIdMultiset< T >::const_iterator > Jug::selectLayer ( const GeometryIdMultiset< T > &  container,
Acts::GeometryIdentifier::Value  volume,
Acts::GeometryIdentifier::Value  layer 
)
inline

Select all elements within the given layer.

◆ selectModule() [1/2]

template<typename T >
Range< typename GeometryIdMultiset< T >::const_iterator > Jug::selectModule ( const GeometryIdMultiset< T > &  container,
Acts::GeometryIdentifier  geoId 
)
inline

Select all elements for the given module / sensitive surface.

◆ selectModule() [2/2]

template<typename T >
auto Jug::selectModule ( const GeometryIdMultiset< T > &  container,
Acts::GeometryIdentifier::Value  volume,
Acts::GeometryIdentifier::Value  layer,
Acts::GeometryIdentifier::Value  module 
)
inline

◆ selectVolume() [1/2]

template<typename T >
auto Jug::selectVolume ( const GeometryIdMultiset< T > &  container,
Acts::GeometryIdentifier  id 
)
inline

◆ selectVolume() [2/2]

template<typename T >
Range< typename GeometryIdMultiset< T >::const_iterator > Jug::selectVolume ( const GeometryIdMultiset< T > &  container,
Acts::GeometryIdentifier::Value  volume 
)
inline

Select all elements within the given volume.