WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
WireCell::FrameTools Namespace Reference

Typedefs

typedef std::vector< int > channel_list
 

Functions

ITrace::vector untagged_traces (IFrame::pointer frame)
 
ITrace::vector tagged_traces (IFrame::pointer frame, IFrame::tag_t tag)
 
channel_list channels (const ITrace::vector &traces)
 
std::pair< int, int > tbin_range (const ITrace::vector &traces)
 
void fill (Array::array_xxf &array, const ITrace::vector &traces, channel_list::iterator ch_begin, channel_list::iterator ch_end, int tbin=0)
 
int frmtcmp (IFrame::pointer frame, double time)
 
std::pair< IFrame::pointer, IFrame::pointersplit (IFrame::pointer frame, double time)
 

Typedef Documentation

◆ channel_list

typedef std::vector<int> WireCell::FrameTools::channel_list

Return a one-to-one vector of channels from a vector of traces.

Note, you probably want to get a sorted/unique version of this vector for later use. Do so something like:

auto ch = channels(traces); std::sort(ch.begin(), ch.end()); auto end = std::unique(ch.begin(), ch.end()); ch.resize(std::distance(ch.begin(), end));

Definition at line 41 of file FrameTools.h.

Function Documentation

◆ channels()

FrameTools::channel_list WireCell::FrameTools::channels ( const ITrace::vector traces)

Definition at line 132 of file FrameTools.cxx.

Here is the caller graph for this function:

◆ fill()

void WireCell::FrameTools::fill ( Array::array_xxf array,
const ITrace::vector traces,
channel_list::iterator  ch_begin,
channel_list::iterator  ch_end,
int  tbin = 0 
)

Fill a 2D [nchannels/nrows X nticks/ncolumns] array by adding the charge information in the given traces. The channel_list range is an ordered sequence of channels used to associate traces to rows in the array. Ie, any trace with the same channel number as pointed to ch_begin will be in row 0 of the array. The "tbin" gives the time bin of column 0 of the array and is compared to the tbin value of the individual traces. Note, traces which are not refered to in the channel list or which are outside the array are ignored and not all channels need to have associated traces.

Definition at line 158 of file FrameTools.cxx.

Here is the caller graph for this function:

◆ frmtcmp()

int WireCell::FrameTools::frmtcmp ( IFrame::pointer  frame,
double  time 
)

Compare the time span of a frame to a time.

Return 0 if the frame time span covers the target time. Return -1 if the frame is wholly before the target time. Return +1 if the frame is wholly after the target time.

Note, the frame pointer must be valid and the frame must have traces.

Note, if the low-edge of the minimum tick or the high-edge of the maximum tick is exactly at the target time then the frame span is not considered to cover the target time.

Definition at line 14 of file FrameTools.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ split()

std::pair< IFrame::pointer, IFrame::pointer > WireCell::FrameTools::split ( IFrame::pointer  frame,
double  time 
)

Split one frame into two. A new .first frame will contain traces with all samples taken before the given time and a new .second frame with traces containing samples all taken on or after the given time. If the original frame time span does not cover the target time then the original frame is returned in the associated half of the pair and the other half will hold the nullptr.

Note, the frame pointer must be valid and the frame must have traces.

Definition at line 32 of file FrameTools.cxx.

Here is the call graph for this function:

◆ tagged_traces()

ITrace::vector WireCell::FrameTools::tagged_traces ( IFrame::pointer  frame,
IFrame::tag_t  tag 
)

Return a vector of traces for the matching tag. First, if there is a matching trace tag, all its traces are returned. Else, if the frame as a whole is tagged, the entire frame of traces is returned. Else, the returned vector is empty. If the tag consisting of the empty string then untagged_traces() is called. Returned vector of traces has undefined order.

Definition at line 111 of file FrameTools.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tbin_range()

std::pair< int, int > WireCell::FrameTools::tbin_range ( const ITrace::vector traces)

Return the tbin range of the traces. The first value is minimum of all tbins and the second is maximum of all tbin+size where size is number of elements in the charge array.

Definition at line 143 of file FrameTools.cxx.

Here is the caller graph for this function:

◆ untagged_traces()

ITrace::vector WireCell::FrameTools::untagged_traces ( IFrame::pointer  frame)

Return a vector of traces which have no trace tags. Here, any frame tags are ignored. Returned vector of traces has undefined order.

Definition at line 90 of file FrameTools.cxx.

Here is the caller graph for this function: