payload-parsing C++ API Reference

class bitbuffer
#include <delta_decode.h>

Public Functions

inline bitbuffer(const std::vector<char> &v, unsigned start, unsigned length)
inline int remainingBits()
inline delta pop(unsigned size)

Private Members

const std::vector<char> &buffer
unsigned bytePosition
unsigned bitPosition
int remainingBits_
struct DecodeConfiguration
#include <decode.h>

A class to hold the configuration of how we’re decoding.

Public Functions

inline DecodeConfiguration(uint64_t globalTimeIn, unsigned yearIn, bool triggerIn, bool waveformsIn)

Public Members

uint64_t globalTime
unsigned year
bool trigger
bool waveforms
template<uint32_t payloadType>
struct DecodeTarget
#include <decode.h>

template class which encapsulates the expected stuff to come out of each payload. The base template is not defined, so it must be specialized to be used.

template<>
struct DecodeTarget<10>
#include <decode.h>

Public Types

typedef DOMLaunches type
template<>
struct DecodeTarget<11>
#include <decode.h>

Public Types

typedef DOMLaunches type
template<>
struct DecodeTarget<13>
#include <decode.h>
template<>
struct DecodeTarget<17>
#include <decode.h>

Public Types

typedef DOMLaunches type
template<>
struct DecodeTarget<18>
#include <decode.h>

Public Types

typedef DOMLaunches type
template<>
struct DecodeTarget<19>
#include <decode.h>
template<>
struct DecodeTarget<20>
#include <decode.h>
template<>
struct DecodeTarget<21>
#include <decode.h>
template<>
struct DecodeTarget<22>
#include <decode.h>
template<>
struct DecodeTarget<25>
#include <decode.h>

Public Types

typedef NewDOMLaunches type
template<>
struct DecodeTarget<26>
#include <decode.h>

Public Types

typedef NewDOMLaunches type
template<>
struct DecodeTarget<27>
#include <decode.h>

Public Types

typedef NewDOMLaunches type
template<>
struct DecodeTarget<3>
#include <decode.h>
template<>
struct DecodeTarget<9>
#include <decode.h>
template<>
struct DecodeTarget<91>
#include <decode.h>
struct delta
#include <delta_decode.h>

Public Functions

inline delta(uint32_t value, unsigned bits)
inline bool isFlag()
inline int getValue()
inline unsigned rawValue()
inline unsigned getBits()
inline bool wastedBits()

Private Members

int value_
unsigned bits_
struct dumpwaveform

Public Functions

inline dumpwaveform(ostream &o)
inline void operator()(int i)

Private Members

ostream &ofs_
unsigned bin
class I3DAQDataTrimmer : public I3ConditionalModule
#include <I3DAQDataTrimmer.h>

Public Types

typedef std::pair<off_t, off_t> span_t
typedef std::list<boost::tuple<OMKey, I3DOMLaunch, span_t>> span_list_t

Public Functions

I3DAQDataTrimmer(const I3Context &ctx)
void Configure()
void DAQ(I3FramePtr frame)

Public Static Functions

static I3VectorCharPtr TrimPayload(const std::vector<char> &data, const I3DOMLaunchSeriesMap &launches, bool remove_triggers)
static span_list_t ParseLaunches(const std::vector<char> &data)

Private Functions

SET_LOGGER ("I3DAQDataTrimmer")

Private Members

std::string buffer_
std::string new_buffer_
std::string launches_
bool remove_triggers_
class I3PayloadParsingEventDecoder : public I3DAQEventDecoder

Public Functions

I3PayloadParsingEventDecoder(const I3OMKey2MBID&, unsigned year, const std::string &headerID, const std::string &triggerID, const std::vector<OMKey> &specialDataOMs, const std::string &specialDataID, const std::string &inIceID, const std::string &iceTopID, const std::string &speDataID, const std::string &flasherDataID, const std::string &cpuDataID, const std::string &onboardLEDID, const std::string &testDataID, const std::string &minBiasID)
virtual ~I3PayloadParsingEventDecoder()
I3Time FillEvent(I3Frame &frame, const std::vector<char> &data) const

Private Functions

inline const std::string &GetTriggerMode(I3DOMLaunch::TriggerMode mode) const
inline const std::string &GetTriggerID(I3DOMLaunch::TriggerType type) const
SET_LOGGER ("I3PayloadParsingEventDecoder")

Private Members

std::vector<I3DOMLaunch::TriggerType> allTriggerTypes_
std::vector<I3DOMLaunch::TriggerMode> allTriggerModes_
const I3OMKey2MBID &omkey2mbid
unsigned year_
std::string headerID_
std::string triggerID_
std::vector<OMKey> specialDataOMs_
std::string specialDataID_
std::string inIceID_
std::string iceTopID_
std::string speDataID_
std::string flasherDataID_
std::string cpuDataID_
std::string onboardLEDID_
std::string testDataID_
bool trigger_
std::string minBiasID_
bool waveforms_
class I3PayloadParsingEventDecoderFactory : public I3ServiceFactory

Public Functions

explicit I3PayloadParsingEventDecoderFactory(const I3Context &context)
virtual ~I3PayloadParsingEventDecoderFactory()
bool InstallService(I3Context &services)
void Configure()

Private Members

I3DAQEventDecoderPtr decoder_
unsigned year_
std::string headerID_
std::string triggerID_
std::vector<OMKey> specialDataOMs_
std::string specialDataID_
std::string inIceID_
std::string iceTopID_
std::string speDataID_
std::string flasherDataID_
std::string cpuDataID_
std::string onboardLEDID_
std::string testDataID_
std::string minBiasID_
std::string mbServiceID_
std::string installServiceAs_
struct printlaunches

Public Functions

inline printlaunches(map<uint64_t, unsigned> &count)
inline void operator()(const pair<uint64_t, I3DOMLaunch> &launch)

Public Members

map<uint64_t, unsigned> &mbidCount
struct printtrigger

Public Functions

inline void operator()(const I3Trigger &trigger)
template<>
struct type
#include <decode.h>

Public Functions

inline type(DOMLaunches &launchesIn, I3TriggerHierarchy &triggersIn, I3EventHeader &headerIn)

Public Members

DOMLaunches &launches
I3TriggerHierarchy &triggers
I3EventHeader &header
template<>
struct type
#include <decode.h>

Public Functions

inline type(I3TriggerHierarchy &triggersIn, I3TriggerHierarchy::iterator iterIn)

Public Members

I3TriggerHierarchy &triggers
I3TriggerHierarchy::iterator iter
template<>
struct type
#include <decode.h>

Public Functions

inline type(I3TriggerHierarchy &triggersIn, I3TriggerHierarchy::iterator iterIn)

Public Members

I3TriggerHierarchy &triggers
I3TriggerHierarchy::iterator iter
template<>
struct type
#include <decode.h>

Public Functions

inline type(NewDOMLaunches &launchesIn, I3TriggerHierarchy &triggersIn, I3EventHeader &headerIn)

Public Members

NewDOMLaunches &launches
I3TriggerHierarchy &triggers
I3EventHeader &header
template<>
struct type
#include <decode.h>

Public Functions

inline type(NewDOMLaunches &launchesIn, I3TriggerHierarchy &triggersIn, I3EventHeader &headerIn)

Public Members

NewDOMLaunches &launches
I3TriggerHierarchy &triggers
I3EventHeader &header
template<>
struct type
#include <decode.h>

Public Functions

inline type(DOMLaunches &launchesIn, I3TriggerHierarchy &triggersIn, I3EventHeader &headerIn)

Public Members

DOMLaunches &launches
I3TriggerHierarchy &triggers
I3EventHeader &header
template<>
struct type
#include <decode.h>

Public Members

uint64_t mbid
I3DOMLaunch launch
template<>
struct type
#include <decode.h>

Public Functions

inline type(DOMLaunches &launchesIn, I3TriggerHierarchy &triggersIn, I3EventHeader &headerIn)

Public Members

DOMLaunches &launches
I3TriggerHierarchy &triggers
I3EventHeader &header
namespace [anonymous]
namespace payload_parsing

Typedefs

typedef std::list<std::pair<uint64_t, I3DOMLaunch>> DOMLaunches
typedef std::list<std::pair<OMKey, I3DOMLaunch>> NewDOMLaunches

Enums

enum Endian

Values:

enumerator BIG
enumerator LITTLE

Functions

template<>
void do_payload_decode<10>(DecodeTarget<10>::type &target, const DecodeConfiguration &config, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<11>(DecodeTarget<11>::type &target, const DecodeConfiguration &config, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<13>(DecodeTarget<13>::type &target, const DecodeConfiguration &configuration, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<17>(DecodeTarget<17>::type &target, const DecodeConfiguration &config, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<18>(DecodeTarget<18>::type &target, const DecodeConfiguration &config, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<19>(DecodeTarget<19>::type &target, const DecodeConfiguration &configuration, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<20>(DecodeTarget<20>::type &target, const DecodeConfiguration &configuration, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<21>(DecodeTarget<21>::type &target, const DecodeConfiguration &configuration, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<22>(DecodeTarget<22>::type &target, const DecodeConfiguration &configuration, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<25>(DecodeTarget<25>::type &target, const DecodeConfiguration &config, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<26>(DecodeTarget<26>::type &target, const DecodeConfiguration &config, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<27>(DecodeTarget<27>::type &target, const DecodeConfiguration &config, const vector<char> &zlibWaveforms, unsigned start)
template<>
void do_payload_decode<3>(DecodeTarget<3>::type &target, const DecodeConfiguration &config, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<9>(DecodeTarget<9>::type &target, const DecodeConfiguration &config, const vector<char> &eventData, unsigned start)
template<>
void do_payload_decode<91>(DecodeTarget<91>::type &target, const DecodeConfiguration &config, const vector<char> &eventData, unsigned start)
I3DOMLaunch::TriggerType eventTrigTypeToDOMLaunchDelta(int trigword)
void delta_decode(unsigned start, const std::vector<char> &buffer, I3DOMLaunch &launch, unsigned WhichChargeStamp)
int ShiftUp(int BitsPerWord_)
int ShiftDown(int BitsPerWord_)
int GetBits(const vector<char> &buffer)
int DeltaCodec(const vector<char> &buffer, vector<int> &out, int size_of_vector, unsigned start)
void dump_delta_compressed(unsigned start, const std::vector<char> &buffer, I3DOMLaunch &launch)
I3DOMLaunch::TriggerType eventTrigTypeToDOMLaunch(int v)
template<uint32_t payloadType>
void do_payload_decode(typename DecodeTarget<payloadType>::type &target, const DecodeConfiguration &config, const std::vector<char> &eventData, unsigned start)

decodes a payload of type payloadType into the given target with the given configuration, from the eventData. The extraction should start at ‘start’. This function must be specialized.

template<unsigned payloadType>
void decode_payload(typename DecodeTarget<payloadType>::type &target, const DecodeConfiguration &config, const std::vector<char> eventData, unsigned start)

This template is what you should call in your code to decode a payload. It calls do_payload_decode after some error checking.

inline OMKey decode_OMKey(uint16_t channelID)

A helper to decode an OM key from a DAQ channel ID.

template<class T>
bool getbit(unsigned bit, T value)
inline int dumpbits(delta todump)
int DeltaCodec(const std::vector<char> &buffer, std::vector<int> &out, int size_of_vector)
void dump_raw_engineering(unsigned start, const std::vector<char> &buffer, I3DOMLaunch &launch)
template<class T>
T endian_swap(T t)

a little function to swap the endianness of a particular type

template<class T>
inline T decode(Endian e, size_t start, const std::vector<char> &eventData)

A small function which reads a type T out of a byte buffer with a given starting position.

Variables

int BitsPerWord_
int BitBoundary_
namespace std

STL namespace.

file decode.h
#include <list>
#include <vector>
#include <utility>
#include <icetray/I3Logging.h>
#include <icetray/OMKey.h>
#include <interfaces/I3OMKey2MBID.h>
#include <dataclasses/physics/I3DOMLaunch.h>
#include <dataclasses/physics/I3TriggerHierarchy.h>
#include <dataclasses/physics/I3Trigger.h>
#include <dataclasses/physics/I3EventHeader.h>
file decode_10.cxx
file decode_11.cxx
file decode_13.cxx
file decode_17.cxx
file decode_18.cxx
file decode_19.cxx
file decode_20.cxx
file decode_21.cxx
#include <daq-decode/I3DAQDecoderUtil.h>
file decode_22.cxx
#include <daq-decode/I3DAQDecoderUtil.h>
#include <assert.h>
#include “zlib.h”
file decode_25.cxx
#include <string>
#include <phys-services/I3FileOMKey2MBID.h>
file decode_26.cxx
#include <phys-services/I3FileOMKey2MBID.h>
file decode_27.cxx
#include <phys-services/I3FileOMKey2MBID.h>
file decode_3.cxx
#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
file decode_9.cxx
#include <daq-decode/I3DAQDecoderUtil.h>
file decode_91.cxx
#include <daq-decode/I3DAQDecoderUtil.h>
file delta_decode.cxx
#include <vector>
#include <dataclasses/physics/I3DOMLaunch.h>
#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
file delta_decode.h
#include <vector>
file dump-raw-deltacompressed.cxx
#include <vector>
#include <getopt.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <dataclasses/physics/I3DOMLaunch.h>

Defines

MAXHITBLOCK
file dump-raw-deltacompressed.h
#include <vector>
file dump-raw-engineering.cxx
#include <dataclasses/physics/I3DOMLaunch.h>
file dump-raw-engineering.h
#include <vector>
file I3DAQDataTrimmer.cxx
#include <boost/make_shared.hpp>
#include <boost/foreach.hpp>
#include <boost/tuple/tuple.hpp>

Remove hit records from a raw DAQ payload.

(c) 2011 Jakob van Santen and the IceCube Collaboration

$Id$

Version

$Revision$

Date

$Date$

Author

Jakob van Santen vansanten@wisc.edu

Functions

I3_MODULE(I3DAQDataTrimmer)
file I3DAQDataTrimmer.h
#include <dataclasses/I3Vector.h>
#include <dataclasses/physics/I3DOMLaunch.h>
#include <icetray/I3ConditionalModule.h>
#include <boost/tuple/tuple.hpp>

Remove hit records from a raw DAQ payload.

(c) 2011 Jakob van Santen and the IceCube Collaboration

$Id$

Version

$Revision$

Date

$Date$

Author

Jakob van Santen vansanten@wisc.edu

file I3PayloadParsingEventDecoder.cxx
#include <map>
#include <dataclasses/physics/I3EventHeader.h>
#include <icetray/I3Frame.h>
#include <interfaces/I3OMKey2MBID.h>
#include <daq-decode/I3DAQDecoderUtil.h>
file I3PayloadParsingEventDecoder.h
#include <string>
#include <vector>
#include <icetray/I3Logging.h>
#include <icetray/OMKey.h>
#include <icetray/I3PointerTypedefs.h>
#include <dataclasses/I3Time.h>
#include <dataclasses/physics/I3DOMLaunch.h>
#include <daq-decode/I3DAQEventDecoder.h>

Typedefs

typedef boost::shared_ptr<I3PayloadParsingEventDecoder> I3PayloadParsingEventDecoderPtr
file I3PayloadParsingEventDecoderFactory.cxx
#include <icetray/I3DefaultName.h>
#include <interfaces/I3OMKey2MBID.h>
#include <dataclasses/physics/I3EventHeader.h>
#include <dataclasses/physics/I3TriggerHierarchy.h>

Functions

I3_SERVICE_FACTORY(I3PayloadParsingEventDecoderFactory)
file I3PayloadParsingEventDecoderFactory.h
#include <string>
#include <vector>
#include <icetray/I3Logging.h>
#include <icetray/I3ServiceFactory.h>
#include <daq-decode/I3DAQEventDecoder.h>
file decode3/main.cxx
#include <fstream>
#include <iostream>
#include <string>
#include <netinet/in.h>
#include “boost/algorithm/string.hpp”
#include “payload-parsing/decode.h
#include “phys-services/I3XMLOMKey2MBID.h”
#include “phys-services/I3FileOMKey2MBID.h”

Functions

int main(int argc, char **argv)
file standalone/main.cxx
#include <icetray/serialization.h>
#include <fstream>
#include <archive/xml_oarchive.hpp>
#include <netinet/in.h>
#include <dataclasses/physics/I3EventHeader.h>
#include <dataclasses/physics/I3DOMLaunch.h>
#include <dataclasses/physics/I3TriggerHierarchy.h>
#include <phys-services/I3FileOMKey2MBID.h>
#include <dataclasses/I3Vector.h>

Functions

void dump(const I3Vector<int> &in, string tag, unsigned num)
void dump(const std::vector<int> &in, string tag, unsigned num)
int main(int argc, char **argv)
file utility.h
#include <vector>
#include <boost/utility.hpp>
#include <icetray/I3Logging.h>
dir decode3
dir icetray
dir payload-parsing
dir payload-parsing
dir payload-parsing
dir private
dir public
dir standalone