dataio C++ API Reference

struct color_pair
#include <color.h>

$Id$

Copyright (C) 2007 Troy D. Straszheim troy@icecube.umd.edu Copyright (C) 2007 the IceCube Collaboration http://www.icecube.wisc.edu

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS’’ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-2-Clause

Public Members

int index
int pair
bool bold
bool reverse
bool dim
class DeleteUnregistered : public I3Module

Public Functions

DeleteUnregistered(const I3Context &context)
virtual ~DeleteUnregistered()
void Process()

Private Functions

DeleteUnregistered(const DeleteUnregistered&)
DeleteUnregistered &operator=(const DeleteUnregistered&)
SET_LOGGER ("DeleteUnregistered")
class filehandle : public std::string
#include <I3FileStager.h>

Public Functions

filehandle(const std::string &path)
virtual ~filehandle()

Private Functions

filehandle(const std::string &path, boost::function<void()> on_destroy)

Private Members

boost::function<void()> callback_

Friends

friend class ::I3FileStager
template<typename T>
struct form_traits
template<>
struct form_traits<std::string>

Public Static Functions

static inline void configure_field(FIELD *field)
static inline std::string convert(const char *buf)
template<>
struct form_traits<unsigned>

Public Static Functions

static inline void configure_field(FIELD *field)
static inline unsigned convert(const char *buf)
struct FrameInfo

A wrapper for information the Model likes to cache about the frames it sees.

Public Functions

inline FrameInfo()
FrameInfo(const I3Frame&)
bool operator==(const FrameInfo&) const

Public Members

I3Frame::Stream stream
std::string sub_event_stream
struct FrameInfoHash

An implementation of hashing for FrameInfos.

Public Types

using result_type = std::size_t
using argument_type = FrameInfo

Public Functions

result_type operator()(const FrameInfo&) const
class I3File
#include <I3File.h>

An IceCube file interface.

A class to easily access an IceCube (.i3) file. Provides read/write support and can open compressed files, web addresses, or raw sockets.

Public Types

enum Mode

An enum type for the file mode.

Values:

enumerator read

reading (default)

enumerator write

writing, truncating if file exists

enumerator create

writing, fail if file exists

enumerator append

writing, append to end of file if file exists

enum Type

An enum type for the file type.

Values:

enumerator closed

file is closed

enumerator empty

file is empty

enumerator singlepass

file is a stream

enumerator multipass

file can be rewinded

Public Functions

I3File(const I3File&)

Copy constructor.

explicit I3File(const std::string&)

A constructor

/param path The path to the file.

explicit I3File(const std::string&, const std::string&, size_t = 0)

A constructor

/param path The path to the file. /param mode The file mode (r, w, x, a). /param frames The number of frames to skip.

explicit I3File(const std::string&, Mode, size_t = 0, bool = true)

A special constructor for controlling mixing.

/param path The path to the file. /param mode The file mode using the Mode enum. /param frames The number of frames to skip. /param mixing Whether to use mixing mode or tracking mode.

~I3File()

Destructor. Automatically closes the file.

void close()

Close the file.

void rewind()

Go to the beginning of a MultiPass file.

bool more()

Test if there is another frame in a readable file.

void push(const I3Frame&)

Push a frame onto a writable file.

void push(I3FramePtr)

Push a frame onto a writable file.

I3FramePtr pop_frame(I3Frame::Stream = I3Frame::None)

Get a frame of a specific stream from a readable file.

inline I3FramePtr pop_daq()

Get a DAQ frame from a readable file.

inline I3FramePtr pop_physics()

Get a Physics frame from a readable file.

void seek(size_t)

Seek to a frame by number.

std::vector<I3FramePtr> get_mixed_frames()

Get the parent frames mixed into the current frame.

std::vector<I3FramePtr> get_current_frame_and_deps()

Get the inclusive list of [parent … current] frames.

std::string get_path() const
ssize_t get_frameno() const
size_t get_size() const
I3Frame::Stream get_stream() const
Mode get_mode() const
Type get_type() const

Private Functions

void open_file()

Open currently specified file. Used by constructors.

void skip_frames(size_t)

Skip frames in the current file.

Private Members

boost::iostreams::filtering_istream ifs_

input file stream

boost::iostreams::filtering_ostream ofs_

output file stream

std::string path_

file path

I3FrameMixer cache_

frame cache

I3FramePtr curr_frame_

current frame

size_t frameno_

current frame number

size_t size_

file size

Mode mode_

file mode

Type type_

file type

class I3FileStager : public boost::enable_shared_from_this<I3FileStager>
#include <I3FileStager.h>

A base class interface for staging files to local storage from remote locations.

Subclassed by I3FileStagerCollection, I3TrivialFileStager

Public Functions

virtual ~I3FileStager()
virtual std::vector<std::string> ReadSchemes() const = 0

Returns the URI scheme this stager can read. (i.e. the in a URL before the colon, e.g. “http”, “ftp”, “gsiftp”, …)

virtual bool CanStageIn(const std::string &url)
virtual std::vector<std::string> WriteSchemes() const = 0

Returns the URI scheme this stager can write.

virtual bool CanStageOut(const std::string &url)
void WillReadLater(const std::string &url)

Allows the reader to tell us what files will be read in the future (in the order this is called).

I3::dataio::shared_filehandle GetReadablePath(const std::string &url)

Read a file from a URL and copy it to a local scratch directory. Block until finished and return a full path to the local copy. When the last reference to the return value is deleted, the file will be removed.

I3::dataio::shared_filehandle GetWriteablePath(const std::string &url)

Allows a writer to tell us that it wants to write to the given URL. Return a local filename that the writer should use instead. When the last reference to the return value is deleted, the file will be uploaded to its destination and then removed.

Protected Functions

I3FileStager()
virtual std::string GenerateLocalFileName(const std::string &url, bool reading) = 0
virtual void WillReadLater(const std::string &url, const std::string &fname) = 0
virtual void CopyFileIn(const std::string &url, const std::string &fname) = 0
virtual void CopyFileOut(const std::string &fname, const std::string &url) = 0

Private Types

typedef boost::weak_ptr<I3::dataio::filehandle> weak_filehandle
typedef std::pair<std::string, weak_filehandle> handle_pair

Private Functions

void Cleanup(const std::string &fname)
void StageFileOut(const std::string &url)
I3FileStager(const I3FileStager&)
std::map<std::string, handle_pair>::iterator GetLocalFileName(const std::string &url, bool reading)

Private Members

std::map<std::string, handle_pair> url_to_handle_

Friends

friend class I3FileStagerCollection
class I3FileStagerCollection : public I3FileStager
#include <I3FileStager.h>

Public Functions

virtual ~I3FileStagerCollection()
virtual std::vector<std::string> ReadSchemes() const

Returns the URI scheme this stager can read. (i.e. the in a URL before the colon, e.g. “http”, “ftp”, “gsiftp”, …)

virtual std::vector<std::string> WriteSchemes() const

Returns the URI scheme this stager can write.

Public Static Functions

static boost::shared_ptr<I3FileStager> create(const std::vector<I3FileStagerPtr>&)

Protected Functions

virtual std::string GenerateLocalFileName(const std::string &url, bool reading)
virtual void WillReadLater(const std::string &url, const std::string &fname)
virtual void CopyFileIn(const std::string &url, const std::string &fname)
virtual void CopyFileOut(const std::string &fname, const std::string &url)

Private Types

typedef std::map<std::string, I3FileStagerPtr> protocol_map_t

Private Functions

SET_LOGGER ("I3FileStagerCollection")
I3FileStagerCollection(const std::vector<I3FileStagerPtr>&)
I3FileStagerCollection(const I3FileStagerCollection&)
const I3FileStagerPtr &GetReader(const std::string &url) const
const I3FileStagerPtr &GetWriter(const std::string &url) const

Private Members

std::vector<I3FileStagerPtr> stagers_
protocol_map_t readers_
protocol_map_t writers_
class I3FrameSequence
#include <I3FrameSequence.h>

An IceCube multi-file interface.

A class to easily access multiple files as if it was one large sequence of frames. Only supports read access.

Public Functions

I3FrameSequence()

Default constructor.

I3FrameSequence(const I3FrameSequence&)

Copy constructor.

explicit I3FrameSequence(const std::vector<std::string>&, size_t = 1000)

A constructor

/param paths A vector of paths to files. /param size Size of cache

explicit I3FrameSequence(size_t)

A constructor

/param size Size of cache

~I3FrameSequence()

Destructor. Automatically closes the files.

void add_file(const std::string&)

Add a file.

void close()

Close all files.

void close_last_file()

Close the last file.

void rewind()

Go to the beginning of the files.

bool more()

Test if there is another frame.

I3FramePtr pop_frame(I3Frame::Stream = I3Frame::None)

Get a frame of a specific stream from a readable file.

inline I3FramePtr pop_daq()

Get a DAQ frame.

inline I3FramePtr pop_physics()

Get a Physics frame.

void seek(size_t)

Seek to a frame by number.

I3FramePtr operator[](size_t)

vector-like indexing

std::vector<I3FramePtr> get_mixed_frames()

Get the parent frames mixed into the current frame.

std::vector<I3FramePtr> get_current_frame_and_deps()

Get the inclusive list of [parent … current] frames.

std::vector<std::string> get_paths() const
ssize_t get_frameno() const
ssize_t get_size() const

will get size, or -1 if not known

size_t get_cur_size() const

will get current size

I3Frame::Stream get_stream() const

Private Members

std::unique_ptr<I3FrameSequenceImpl> impl_

The actual implementation.

class I3FrameSequenceImpl

Public Functions

I3FrameSequenceImpl(const I3FrameSequenceImpl&)
explicit I3FrameSequenceImpl(size_t)
explicit I3FrameSequenceImpl(const std::vector<std::string>&, size_t)
~I3FrameSequenceImpl()
void add_file(const std::string&)
void close()
void close_last_file()
void rewind()
bool more()
I3FramePtr pop_frame(I3Frame::Stream = I3Frame::None)
void seek(size_t)
std::vector<I3FramePtr> get_mixed_frames()
std::vector<I3FramePtr> get_current_frame_and_deps()
std::vector<std::string> get_paths() const
ssize_t get_frameno() const
ssize_t get_size() const
size_t get_cur_size() const
I3Frame::Stream get_stream() const

Private Members

FileGroup files_

files

FrameCache cache_

frame cache

ThreadRunner<std::vector<I3FramePtr>> tr_

thread runner

std::unordered_map<size_t, std::future<std::vector<I3FramePtr>>> tr_cache_
size_t frameno_

“next” frame number

class I3InfiniteSource : public I3Module

$Id$

Copyright (C) 2011 The IceCube Collaboration http://www.icecube.wisc.edu SPDX-License-Identifier: BSD-2-Clause

Public Functions

I3InfiniteSource(const I3Context &context)
void Configure()
void Process()

Private Functions

SET_LOGGER ("I3InfiniteSource")

Private Members

I3FileStagerPtr file_stager_
I3::dataio::shared_filehandle current_filename_
boost::iostreams::filtering_istream ifs_
I3Frame::Stream stream_
class I3MultiWriter : public I3WriterBase
#include <I3MultiWriter.h>

$Id$

Copyright (C) 2007 Troy D. Straszheim troy@icecube.umd.edu Copyright (C) 2007 the IceCube Collaboration http://www.icecube.wisc.edu

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS’’ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-2-Clause

Public Functions

I3MultiWriter(const I3Context &ctx)
virtual ~I3MultiWriter()
void Configure_()
void Process()
void Finish()

Private Functions

I3MultiWriter()
I3MultiWriter(const I3MultiWriter&)
void NewFile()

Private Members

uint64_t size_limit_
I3Frame::Stream sync_stream_
bool sync_seen_
unsigned file_counter_
std::vector<I3Frame::Stream> metadata_streams_
std::vector<I3FramePtr> metadata_cache_
class I3Reader : public I3Module

$Id$

Copyright (C) 2007 Troy D. Straszheim troy@icecube.umd.edu Copyright (C) 2007 the IceCube Collaboration http://www.icecube.wisc.edu

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS’’ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-2-Clause

Public Functions

I3Reader(const I3Context&)
void Configure()
void Process()
~I3Reader()
SET_LOGGER ("I3Reader")

Private Functions

void OpenNextFile()

Private Members

unsigned nframes_
bool drop_blobs_
std::vector<std::string> filenames_
std::vector<std::string> skip_
I3FileStagerPtr file_stager_
I3::dataio::shared_filehandle current_filename_
boost::iostreams::filtering_istream ifs_
I3FramePtr tmp_
std::vector<std::string>::iterator filenames_iter_
class I3TrivialFileStager : public I3FileStager
#include <I3FileStager.h>

Public Functions

virtual ~I3TrivialFileStager()
virtual std::vector<std::string> ReadSchemes() const

Returns the URI scheme this stager can read. (i.e. the in a URL before the colon, e.g. “http”, “ftp”, “gsiftp”, …)

virtual std::vector<std::string> WriteSchemes() const

Returns the URI scheme this stager can write.

Public Static Functions

static boost::shared_ptr<I3FileStager> create()

Protected Functions

virtual std::string GenerateLocalFileName(const std::string &url, bool reading)
virtual void WillReadLater(const std::string &url, const std::string &fname)
virtual void CopyFileIn(const std::string &url, const std::string &fname)
virtual void CopyFileOut(const std::string &fname, const std::string &url)

Private Functions

I3TrivialFileStager()
class I3Writer : public I3WriterBase
#include <I3Writer.h>

$Id$

Copyright (C) 2007 Troy D. Straszheim troy@icecube.umd.edu Copyright (C) 2007 the IceCube Collaboration http://www.icecube.wisc.edu

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS’’ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-2-Clause

Public Functions

I3Writer(const I3Context &ctx)
virtual ~I3Writer()
void Configure_()
void Finish()
SET_LOGGER ("I3Writer")

Private Functions

I3Writer()
I3Writer(const I3Writer&)

Private Members

std::vector<char> buf_
class I3WriterBase : public I3ConditionalModule
#include <I3WriterBase.h>

$Id$

Copyright (C) 2007 Troy D. Straszheim troy@icecube.umd.edu Copyright (C) 2007 the IceCube Collaboration http://www.icecube.wisc.edu

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS’’ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-2-Clause

Subclassed by I3MultiWriter, I3Writer

Public Functions

I3WriterBase(const I3Context &ctx)
inline virtual ~I3WriterBase()
void Configure()
void Finish()
void Process()

Protected Functions

void WriteConfig(I3FramePtr ptr)

Protected Attributes

bool configWritten_
int frameCounter_
std::vector<std::string> skip_keys_
std::vector<I3Frame::Stream> streams_
std::vector<I3Frame::Stream> dropOrphanStreams_
std::vector<I3FramePtr> orphanarium_
boost::iostreams::filtering_ostream filterstream_
std::string path_
I3FileStagerPtr file_stager_
I3::dataio::shared_filehandle current_filename_
int gzip_compression_level_
class Model
#include <Model.h>

Public Functions

Model(View &view, const std::vector<std::string> filenames, boost::optional<unsigned> nframes = boost::optional<unsigned>())
void show_xml()

Display the XML representation of the currently selected frame object.

void pretty_print()

Display a nice representation of the currently selected frame object. Not implemented for most frame object types.

void move_first()

Make the first frame in the sequence the current selection.

void move_last()

Make the last frame in the sequence the current selection.

void move_x(int delta)

Select a different frame relative to the current selection position.

Parameters:

delta – the change to apply to the selected frame index. If this would carry the selection outside the valid range of indices it will be clipped.

void move_y(int delta)

Select a different frame object relative to the current selection position.

Parameters:

delta – the change to apply to the selected object index. If this would carry the selection outside the valid range of indices it will be clipped.

void do_goto_frame()

Prompt the user for a frame index, and the make that the selected frame.

void goto_frame(unsigned frameno)

Make the frame at the given index the current selection.

void write_frame()

Write the currently selected frame to a file, prompting the user for a file name.

void write_frame_with_dependencies()

Write the currently selected frame, preceded by all frames from which keys have been mixed into it, to a file, prompting the user for a file name.

void save_xml()

Write the XML representation of the currently selected frame object to a file.

void do_find_event()

Prompt the user for an event ID, and then search forward through the frame sequence for a Q or P frame which matches.

void notify()

Notify the associated View that it should redraw, assumedly because something has changed.

unsigned totalframes()
Returns:

the total number of frames in the frame sequence, or the number of frames which have been read so far if the end of the sequence has not yet been reached.

bool totalframes_exact()
Returns:

true if the end of the frame sequence has been reached and so the result of totalframes is accurate.

I3FramePtr current_frame()

Retrieve the currently selected frame.

std::vector<I3Frame::Stream> streams(unsigned start_index, unsigned length)

Get the streams of the frames within a range of indices. If the range extends beyond the frames which have currently been read, the Model will attempt to read as far as necessary. If the range extends beyond the end of the frames which exist it will be clipped.

Parameters:
  • start_index – the first index in the query range

  • length – the length of the query range

Returns:

the streams of the frames within the specified index range

std::vector<std::string> sub_event_streams(unsigned start_index, unsigned length)

Get the subevent streams of the frames within a range of indices. If the range extends beyond the frames which have currently been read, the Model will attempt to read as far as necessary. If the range extends beyond the end of the frames which exist it will be clipped.

Parameters:
  • start_index – the first index in the query range

  • length – the length of the query range

Returns:

the subevent streams of the frames within the specified index range

SET_LOGGER ("dataio-shovel::Model")

Private Functions

I3FramePtr get_frame(unsigned)

Fetch the frame at the given index.

bool prescan_frames(unsigned index)

Ensure that all forms up to index (exclusive) have been examined to determine their basic properties. If index is larger than the extent of files_, all frames up to the end of the sequence will be examined.

Returns:

whether the scan could read up to the requested index (the frame sequence is long enough)

Private Members

View &view_

A reference to the view object assigned to draw this Model.

dataio::I3FrameSequence files_

The sequence of I3 files the Model represents.

std::vector<I3::dataio::shared_filehandle> file_refs_

The collection of handles obtained from staging the file.

std::vector<FrameInfo> frame_infos_

Information on all frames that have been seen so far. Defined to begin at the start of files_ but at any given time may not cover its full extent.

ProgressManager pman_

The progress bar manager.

unsigned x_index_

The index of the currently selected framewithin the frame sequence.

unsigned y_index_

The index of the currently selected key within the currently selected frame (considering its keys in alphabetical order)

unsigned y_max_

The number of keys in the current frame.

unsigned cached_frame_index_

The index of the last frame fetched by get_frame (the current frame index)

I3FramePtr cached_frame_

The last frame fetched by get_frame (the current frame)

std::vector<std::string> cached_frame_keys_

The keys in the current frame, in sorted order.

std::string y_keystring_

The currently selected key.

std::unordered_map<FrameInfo, std::string, FrameInfoHash> recent_frame_keys_

The most recently selected key for each distinct FrameInfo which has been seen.

struct ProgressManager

An object which handles deciding when to display the progress bar for slow operations. Contains its own worker thread in order to do this only when enough time has elapsed for the user to probably prefer seeing a progress bar than an otherwise apparently frozen interface.

Public Functions

explicit ProgressManager(View &view)

$Id$

Copyright (C) 2007 Troy D. Straszheim troy@icecube.umd.edu Copyright (C) 2007 the IceCube Collaboration http://www.icecube.wisc.edu

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS’’ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-2-Clause

~ProgressManager()
void MaybeStartShowingProgress(std::string message)
void SetProgress(float value)
Parameters:

value – a fraction in [0,1]

void StopShowingProgress()

Private Members

View &view_
bool stop_
std::atomic<bool> showingProgress_
std::atomic<bool> actuallyShowingProgress_
unsigned int nestingLevel
float progress_
std::mutex mut_
std::condition_variable cond_
std::thread thread_
std::chrono::system_clock::time_point progressStart_
std::priority_queue<WorkItem> work_
class QConverter : public I3Module

$Id$

Copyright (C) 2011 Nathan Whitehorn nwhitehorn@icecube.wisc.edu Copyright (C) 2011 the IceCube Collaboration http://www.icecube.wisc.edu SPDX-License-Identifier: BSD-2-Clause

Public Functions

QConverter(const I3Context &context)
void Configure()
void Physics(I3FramePtr frame)
void DAQ(I3FramePtr frame)

Private Functions

SET_LOGGER ("QConverter")

Private Members

std::string subevent_stream
std::vector<std::string> keys_to_q
std::vector<std::string> types_to_q
bool output_p_frame
struct UnregisteredTrack : public I3Particle

Public Functions

template<typename Archive>
inline void serialize(Archive &ar, unsigned version)
class View
#include <View.h>

Public Functions

~View()
inline void model(Model *themodel)
void notify()
void start()
void update()
void page(const std::string &what)
void toggle_colors()
inline void totalframes(unsigned total)
void display_frame(I3FramePtr frame, unsigned index, unsigned y_selected)
void do_help()
void do_about()
void start_scan_progress(const std::string &message)
void scan_progress(double d)
void end_scan_progress()
template<typename T>
boost::optional<T> dialog(const std::string &prompt)
void usage()

Public Static Functions

static View &Instance()

Private Functions

void drawtape(unsigned line, unsigned col, I3Frame::Stream stream, std::string sub_event_stream, unsigned frameno, int attr = A_NORMAL)
void draw_border()
View()

Private Members

unsigned totalframes_
unsigned y_top_offset_
CDKSCREEN *cdkscreen
CDKHISTOGRAM *progresshist_
Model *model_
std::map<I3Frame::Stream, color_pair> colors_
std::map<std::string, color_pair> subeventstream_colors_
std::vector<color_pair> new_subeventstream_colors_
std::unordered_map<std::string, std::string> clean_typenames_
unsigned maxtypelen_
bool scanning_
struct WorkItem

Public Functions

inline WorkItem()
WorkItem(std::chrono::system_clock::time_point t, std::function<void()> w)
bool operator<(const WorkItem&) const

Public Members

std::chrono::system_clock::time_point time_
std::function<void()> work_
namespace [anonymous]
namespace dataio
namespace I3
namespace dataio

Typedefs

using I3FilePtr = boost::shared_ptr<I3File>
using I3FileConstPtr = boost::shared_ptr<const I3File>
typedef boost::shared_ptr<filehandle> shared_filehandle
using I3FrameSequencePtr = boost::shared_ptr<I3FrameSequence>
using I3FrameSequenceConstPtr = boost::shared_ptr<const I3FrameSequence>
namespace std

STL namespace.

file color.cxx
#include <ncurses.h>
#include <shovel/color.h>

Functions

void settext(color_pair cp)
void settext(WINDOW *win, color_pair cp)
color_pair ColorParse(string in_color)

Variables

map<string, color_pair> color_map
file color.h
#include <boost/preprocessor.hpp>
#include <ncurses.h>
#include <map>
#include <string>

Defines

ALL_COLORS
MAKE_COLOR(r, data, color)

Functions

color_pair ColorParse(std::string in_color)
void settext(color_pair cp)
void settext(WINDOW *win, color_pair cp)

Variables

std::map<std::string, color_pair> color_map
file Controller.cxx
#include <cstdlib>
#include <ncurses.h>
#include <signal.h>
#include <unistd.h>
#include <icetray/I3Tray.h>
#include <icetray/I3TrayInfo.h>
#include <icetray/load_project.h>
#include <icetray/I3SimpleLoggers.h>
#include <algorithm>
#include <map>
#include <string>
#include <fstream>
#include <boost/program_options.hpp>
#include <boost/python.hpp>
#include <shovel/color.h>
#include <shovel/View.h>
#include <shovel/Model.h>
#include <dlfcn.h>

Functions

void shovel_usage(const std::string &progname)

$Id$

Copyright (C) 2007 Troy D. Straszheim troy@icecube.umd.edu Copyright (C) 2007 the IceCube Collaboration http://www.icecube.wisc.edu

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS’’ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-2-Clause

void do_pyshell(char *argv[], Model &model, View &view)
bool try_load_project(const std::string &proj)

Attempt to load a project which may not be available.

Parameters:

proj – the name of the project to load

Returns:

whether the project was loaded

int main(int argc, char *argv[])
file DeleteUnregistered.cxx
#include <icetray/I3Context.h>
#include <icetray/I3DefaultName.h>
#include <icetray/I3Frame.h>
#include <icetray/I3Logging.h>
#include <icetray/I3Module.h>
#include <archive/archive_exception.hpp>

Functions

I3_MODULE(DeleteUnregistered)
file I3File.cxx
#include <iostream>
#include <istream>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <stdexcept>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
#include <icetray/I3Logging.h>
#include <icetray/open.h>
#include <icetray/I3DefaultName.h>
#include <dataio/I3File.h>
#include <dataclasses/physics/I3EventHeader.h>
file I3File.h
#include <string>
#include <vector>
#include <boost/iostreams/filtering_stream.hpp>
#include <icetray/I3Frame.h>
#include <icetray/I3FrameMixing.h>
file I3FileStager.cxx
#include “dataio/I3FileStager.h
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
#include <boost/filesystem.hpp>
#include <boost/bind.hpp>
file I3FileStager.h
#include <string>
#include <vector>
#include <map>
#include <boost/function.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <icetray/I3PointerTypedefs.h>
#include <icetray/I3Logging.h>
#include <icetray/I3DefaultName.h>

Functions

I3_POINTER_TYPEDEFS(I3FileStager)
I3_DEFAULT_NAME(I3FileStager)
file I3FrameSequence.cxx
#include <iostream>
#include <istream>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <unordered_map>
#include <stdexcept>
#include <thread>
#include <future>
#include <mutex>
#include <atomic>
#include <icetray/I3Logging.h>
#include <icetray/open.h>
#include <icetray/I3DefaultName.h>
#include <icetray/I3FrameMixing.h>
#include <dataio/I3File.h>
#include <dataclasses/physics/I3EventHeader.h>
file I3FrameSequence.h
#include <string>
#include <vector>
#include <memory>
#include <icetray/I3Frame.h>
file I3InfiniteSource.cxx
#include <icetray/open.h>
#include <icetray/I3Frame.h>
#include <icetray/I3Module.h>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/scoped_ptr.hpp>
#include “dataio/I3FileStager.h

Functions

I3_MODULE(I3InfiniteSource)
file I3MultiWriter.cxx
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/device/back_inserter.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/format.hpp>
#include <boost/foreach.hpp>
#include <icetray/counter64.hpp>
#include <icetray/open.h>

Functions

I3_MODULE(I3MultiWriter)
file I3MultiWriter.h
#include <sstream>
file I3Reader.cxx
#include <icetray/IcetrayFwd.h>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
#include <fstream>
#include <set>
#include <icetray/open.h>
#include <icetray/I3Frame.h>
#include <icetray/I3TrayInfo.h>
#include <icetray/I3Module.h>
#include “dataio/I3FileStager.h

Functions

I3_MODULE(I3Reader)
file I3Writer.cxx
#include <dataio/I3Writer.h>
#include <icetray/open.h>

Functions

I3_MODULE(I3Writer)

$Id$

Copyright (C) 2007 Troy D. Straszheim troy@icecube.umd.edu Copyright (C) 2007 the IceCube Collaboration http://www.icecube.wisc.edu

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS’’ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SPDX-License-Identifier: BSD-2-Clause

file I3Writer.h
file I3WriterBase.cxx
#include <ostream>
#include <set>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/iostreams/device/back_inserter.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/ref.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/format.hpp>
#include <boost/foreach.hpp>
#include <boost/make_shared.hpp>
#include “icetray/I3Module.h”
#include “icetray/I3Frame.h”
#include “icetray/I3TrayInfo.h”
#include “icetray/I3TrayInfoService.h”
#include “icetray/Utility.h”
#include “dataio/I3WriterBase.h
file I3WriterBase.h
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <boost/iostreams/filtering_stream.hpp>
#include “icetray/I3ConditionalModule.h”
#include “dataio/I3FileStager.h
file Model.cxx
#include <regex>
#include “shovel/Model.h
#include <sys/types.h>
#include <boost/optional.hpp>
#include <boost/python.hpp>
#include “icetray/serialization.h”
#include “icetray/Utility.h”
#include “icetray/open.h”
#include <dataclasses/physics/I3EventHeader.h>
#include <dataclasses/physics/I3RecoPulse.h>
#include “shovel/View.h

Functions

work_(w)
file Model.h
#include <string>
#include <iostream>
#include <vector>
#include <fstream>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <chrono>
#include <queue>
#include <atomic>
#include <boost/optional.hpp>
#include <icetray/I3TrayInfo.h>
#include <icetray/I3Frame.h>
file QConverter.cxx
#include <icetray/I3Frame.h>
#include <icetray/I3Context.h>
#include <icetray/I3Configuration.h>
#include <icetray/I3Module.h>
#include <dataclasses/physics/I3EventHeader.h>

Functions

I3_MODULE(QConverter)
file unregistered_track.cxx
#include <boost/python.hpp>
#include <boost/python/module.hpp>
#include <boost/python/class.hpp>
#include <dataclasses/physics/I3Particle.h>
#include <icetray/serialization.h>

Functions

I3_SERIALIZABLE(UnregisteredTrack)
file View.cxx
#include <dataclasses/physics/I3EventHeader.h>
#include <dataclasses/I3Time.h>
#include <limits>
#include <iostream>
#include <iomanip>
#include <form.h>
#include <fstream>
#include <signal.h>
#include <sys/ioctl.h>
#include “color.h
#include “View.h
#include “Model.h
#include <boost/assign/std/vector.hpp>
#include <boost/assign/list_inserter.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/optional.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/format.hpp>
#include <icetray/Utility.h>
#include <ncurses.h>
#include <cdk.h>

Functions

static void finish(int sig)
static void resize(int sig)
template boost::optional< std::string > View::dialog< std::string > (const std::string &)
file View.h
#include <unordered_map>
#include <ncurses.h>
#include “color.h
#include <boost/optional.hpp>
#include <icetray/I3Frame.h>
#include <cdk.h>
dir dataio
dir dataio
dir dataio
dir icetray
dir private
dir public
dir shovel
dir test_unregistered