Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
WireCell Namespace Reference

Namespaces

 Array
 
 Bits
 
 Factory
 Singleton interface.
 
 FrameTools
 
 Gen
 
 Img
 
 Log
 
 Persist
 
 Pgraph
 
 RayGrid
 
 Response
 
 Ress
 
 Root
 
 SigProc
 
 Sio
 
 String
 
 tagrules
 
 Test
 
 Testing
 
 units
 
 Waveform
 
 WireSchema
 

Classes

class  Addresser
 
class  AssertionError
 Thrown when an assertion fails. More...
 
class  Binning
 
class  BoundingBox
 
class  BufferedHistogram2D
 
struct  cluster_node_t
 
struct  ComparePoints
 Return true if lhs<rhs w/in tolerance. More...
 
class  ConfigManager
 
class  D3Vector
 
class  DepoPlane
 
class  Detsim
 
struct  DfpGraph
 
class  Diffuser
 
class  Diffusion
 
class  DropSinkProc
 
class  DumpDepos
 
class  ElasticNetModel
 
struct  Exception
 The base wire cell exception. More...
 
class  ExecMon
 
struct  FactoryException
 
struct  Fanin
 
class  Fanout
 
class  FilterProc
 
class  FunctionNodeProc
 
struct  GeneratorIter
 
class  GenWire
 
class  IAnodeFace
 
class  IAnodePlane
 
class  IApplication
 
class  IBlob
 
class  IBlobSet
 
class  IBlobSetFanin
 
class  IBlobSetFanout
 
class  IBlobSetProcessor
 
class  IBlobSetSink
 
class  IChannel
 
class  IChannelFilter
 
class  IChannelNoiseDatabase
 
class  IChannelResponse
 
class  IChannelSpectrum
 
class  IChannelStatus
 
class  ICluster
 
class  IClusterFanin
 
class  IClusterFilter
 
class  IClusterFramer
 
class  IClustering
 
class  IClusterSink
 
class  IComponent
 
class  IConfigurable
 
class  IData
 
class  IDataFlowGraph
 
class  IDeconvolution
 
class  IDepo
 
class  IDepoCollector
 
struct  IDepoDriftCompare
 
class  IDepoFanout
 
class  IDepoFilter
 
class  IDepoFramer
 
class  IDepoMerger
 
class  IDepoSet
 
class  IDepoSetFanout
 
class  IDepoSink
 
class  IDepoSource
 
class  IDiffuser
 
class  IDiffusion
 
struct  IDiffusionCompareLbegin
 
class  IDrifter
 
class  IDuctor
 
class  IFactory
 
class  IFaninNode
 
class  IFaninNodeBase
 
class  IFanoutNode
 
class  IFanoutNodeBase
 
class  IFieldResponse
 
class  IFilterWaveform
 
class  IFrame
 
class  IFrameFanin
 
class  IFrameFanout
 
class  IFrameFilter
 
class  IFrameJoiner
 
class  IFrameSink
 
class  IFrameSlicer
 
class  IFrameSlices
 
class  IFrameSource
 
class  IFrameSplitter
 
class  IFunctionNode
 
class  IFunctionNodeBase
 
class  IHydraNode
 
class  IHydraNodeBase
 
class  IImpactResponse
 
class  IJoinNode
 
class  IJoinNodeBase
 
class  INamedFactory
 
class  IndexedGraph
 
class  IndexedSet
 
struct  IndexError
 Thrown when a wrong index is used. More...
 
class  INode
 
class  Interface
 
class  IOError
 Thrown when an error involving accessing input or output has occurred. More...
 
class  IPlaneImpactResponse
 
class  IPointFieldSink
 
class  IProcessor
 
class  IQueuedoutNode
 
class  IQueuedoutNodeBase
 
class  IRandom
 
class  IRecombinationModel
 
class  IScalarFieldSink
 
class  ISequence
 
class  ISinkNode
 
class  ISinkNodeBase
 
class  ISlice
 
class  ISliceFanout
 
class  ISliceFrame
 
class  ISliceFrameSink
 
class  ISliceStriper
 
class  ISourceNode
 
class  ISourceNodeBase
 
class  ISplitNode
 
class  ISplitNodeBase
 
class  IStripe
 
class  IStripeSet
 
class  IStripeSetSink
 
class  Iterator
 
class  IteratorAdapter
 
class  IteratorBase
 
class  ITiling
 
class  ITrace
 
class  IWaveform
 
class  IWire
 Interface to information about a physical wire segment. More...
 
struct  IWireCompareIdent
 
struct  IWireCompareIndex
 
struct  IWireCompareSegment
 
class  IWireGenerator
 
class  IWireParameters
 
class  IWirePlane
 
class  IWireSchema
 
class  IWireSource
 
class  IWireSummarizer
 
class  IWireSummary
 
struct  KeyError
 Thrown when a wrong key or has been encountered. More...
 
class  LassoModel
 
class  LinearModel
 
class  linterp
 
class  Main
 
class  MemUsage
 
class  NamedFactory
 
class  NamedFactoryRegistry
 
class  ObjectArray2d
 
class  Pimpos
 Pitch-Impact-Position. More...
 
class  PlaneDiffuser
 
class  Plugin
 
class  PluginManager
 
class  Proc
 
class  Quantity
 
class  QueuedNodeProc
 
struct  RandomIter
 
struct  RangeFeed
 
class  RuntimeError
 Thrown when an error occurs during the data processing. More...
 
class  SequenceAdapter
 
struct  shared_queued
 
struct  shared_queued< T< Types... > >
 
class  ShuntProc
 
class  SigSlotSinkSourceAdapter
 
class  SimpleBlob
 
class  SimpleBlobSet
 
class  SimpleChannel
 
class  SimpleCluster
 
class  SimpleDepo
 
class  SimpleDepoSet
 
class  SimpleFrame
 
class  SimpleTrace
 
class  SimpleWire
 
class  Singleton
 
class  SinkNodeProc
 
class  SinkProc
 
class  SourceNodeProc
 
class  SourceProc
 
class  TimeKeeper
 
struct  tuple_helper
 
struct  tuple_helper< T< Types... > >
 
struct  type_repeater
 
struct  type_repeater< 0, T >
 
struct  ValueError
 Thrown when a wrong value has been encountered. More...
 
class  WireGenerator
 
class  WireParams
 
class  WirePlaneId
 
struct  WirePlaneSelector
 Select wires by plane (and apa/face) More...
 
class  WireSource
 
class  WireSummarizer
 
class  WireSummary
 
class  ZSEndedTrace
 

Typedefs

typedef std::queue< boost::any > Pipe
 
typedef std::vector< Proc * > Pipeline
 
typedef std::deque< boost::any > queuedany
 
typedef std::variant< size_t, IChannel::pointer, IWire::pointer, IBlob::pointer, ISlice::pointer, IChannel::shared_vectorcluster_ptr_t
 The vertex property. More...
 
typedef boost::adjacency_list< boost::setS, boost::vecS, boost::undirectedS, cluster_node_tcluster_graph_t
 
typedef boost::graph_traits< cluster_graph_t >::vertex_descriptor cluster_vertex_t
 
typedef boost::graph_traits< cluster_graph_t >::edge_descriptor cluster_edge_t
 
typedef boost::graph_traits< cluster_graph_t >::vertex_iterator cluster_vertex_iter_t
 
typedef IndexedGraph< cluster_node_tcluster_indexed_graph_t
 
typedef std::set< IDepo::pointer, IDepoDriftCompareDepoTauSortedSet
 
typedef std::set< IDiffusion::pointer, IDiffusionCompareLbeginIDiffusionSet
 
typedef std::pair< IImpactResponse::pointer, IImpactResponse::pointerTwoImpactResponses
 
typedef std::pair< IWire::pointer, IWire::pointerIWirePair
 Some common collections. More...
 
typedef std::set< IWire::pointer, IWireCompareIdentIWireSet
 
typedef std::set< IWire::pointer, IWireCompareIndexIWireIndexSet
 
typedef std::set< IWire::pointer, IWireCompareSegmentIWireSegmentSet
 
typedef boost::function< bool(IWire::pointer)> wire_selector
 
typedef Json::Value Configuration
 
typedef boost::error_info< struct tag_errmsg, std::stringerrmsg
 
typedef D3Vector< double > Point
 A 3D Cartesian point in double precision. More...
 
typedef Point Vector
 An alias for Point. More...
 
typedef std::pair< Point, PointRay
 A line segment running from a first (tail) to a second (head) point. More...
 
typedef std::pair< Ray, Rayray_pair_t
 
typedef std::vector< ray_pair_tray_pair_vector_t
 
typedef std::vector< PointPointVector
 PointVector - a collection of Points. More...
 
typedef std::pair< double, VectorScalarPoint
 A scalar + vector, eg charge at a point. More...
 
typedef std::vector< ScalarPointScalarField
 
typedef std::pair< Point, float > PointValue
 PointValue - an association of a point and a value. More...
 
typedef std::vector< PointValuePointValueVector
 PointValueVector - a collection of point-value associations. More...
 
typedef std::set< Point, ComparePointsPointSet
 
typedef D3Vector< float > PointF
 

Enumerations

enum  WirePlaneLayer_t { kUnknownLayer =0, kUlayer =1, kVlayer =2, kWlayer =4 }
 Enumerate layer IDs. These are not indices! More...
 

Functions

Procjoin (Pipeline &pipeline, Proc *src, Proc *dst)
 
template<typename Type >
std::vector< Typeoftype (const cluster_indexed_graph_t &g)
 
template<typename Type >
std::vector< Typeneighbors_oftype (const cluster_indexed_graph_t &g, const cluster_node_t &n)
 
IDepo::vector depo_chain (IDepo::pointer recent)
 
bool ascending_time (const WireCell::IDepo::pointer &lhs, const WireCell::IDepo::pointer &rhs)
 Compare two IDepo::pointer by time (ascending). x is used to break tie. More...
 
bool descending_time (const WireCell::IDepo::pointer &lhs, const WireCell::IDepo::pointer &rhs)
 Compare two IDepo::pointers for by time, descending. x is used to break tie. More...
 
bool ascending_index (IWire::pointer lhs, IWire::pointer rhs)
 
std::ostream & operator<< (std::ostream &os, const WireCell::WirePlaneId &wpid)
 
std::ostream & operator<< (std::ostream &o, const WireCell::WirePlaneLayer_t &layer)
 
template<>
WireCell::WirePlaneId convert< WireCell::WirePlaneId > (const Configuration &cfg, const WireCell::WirePlaneId &def)
 
std::ostream & operator<< (std::ostream &os, const WireCell::Binning &bins)
 
template<typename T >
convert (const Configuration &cfg, const T &def=T())
 Convert a configuration value to a particular type. More...
 
template<>
bool convert< bool > (const Configuration &cfg, const bool &def)
 
template<>
int convert< int > (const Configuration &cfg, const int &def)
 
template<>
float convert< float > (const Configuration &cfg, const float &def)
 
template<>
double convert< double > (const Configuration &cfg, const double &def)
 
template<>
std::string convert< std::string > (const Configuration &cfg, const std::string &def)
 
template<>
std::vector< std::stringconvert< std::vector< std::string > > (const Configuration &cfg, const std::vector< std::string > &def)
 
template<>
std::vector< int > convert< std::vector< int > > (const Configuration &cfg, const std::vector< int > &def)
 
template<>
std::vector< double > convert< std::vector< double > > (const Configuration &cfg, const std::vector< double > &def)
 
Configuration branch (Configuration cfg, const std::string &dotpath)
 Follow a dot.separated.path and return the branch there. More...
 
Configuration update (Configuration &a, Configuration &b)
 Merge dictionary b into a, return a. More...
 
Configuration append (Configuration &a, Configuration &b)
 Return an array which is composed of the array b appended to the array a. More...
 
template<typename T >
Configuration find (Configuration &lst, const std::string &dotpath, const T &val)
 Return dictionary in given list if it value at dotpath matches. More...
 
template<typename T >
get (Configuration cfg, const std::string &dotpath, const T &def=T())
 Get value in configuration at the dotted path from or return default. More...
 
template<typename T >
void put (Configuration &cfg, const std::string &dotpath, const T &val)
 Put value in configuration at the dotted path. More...
 
template<class T >
std::ostream & operator<< (std::ostream &os, const D3Vector< T > &vec)
 
template<class T >
D3Vector< T > operator- (const D3Vector< T > a, const D3Vector< T > b)
 
template<class T >
D3Vector< T > operator+ (const D3Vector< T > a, const D3Vector< T > b)
 
template<class T >
D3Vector< T > operator* (const D3Vector< T > a, T s)
 
template<class T >
D3Vector< T > operator/ (const D3Vector< T > a, T s)
 
template<class T >
bool operator== (const D3Vector< T > &a, const D3Vector< T > &b)
 
template<class T >
bool operator!= (const D3Vector< T > &a, const D3Vector< T > &b)
 
template<class T >
D3Vector< T > operator* (T s, const D3Vector< T > a)
 
std::size_t fft_best_length (size_t nsamples, bool keep_odd_even=false)
 
int hit_square (int axis0, const Ray &bounds, const Point &point, const Vector &dir, Ray &hits)
 
int box_intersection (const Ray &bounds, const Ray &ray, Ray &hits)
 
double memusage_resident ()
 
double memusage_shared ()
 
double memusage_size ()
 
bool point_contained (const Point &point, const Ray &bounds)
 
bool point_contained (const Point &point, const Ray &bounds, int axis)
 
double point_angle (const Vector &axis, const Vector &vector)
 
Ray ray_pitch (const Ray &ray1, const Ray &ray2)
 
double ray_length (const Ray &ray)
 
Vector ray_vector (const Ray &ray)
 
Vector ray_unit (const Ray &ray)
 
double ray_dist (const Ray &ray, const Point &point)
 
double ray_volume (const Ray &ray)
 
template<>
WireCell::Point convert< WireCell::Point > (const Configuration &cfg, const WireCell::Point &def)
 
template<>
WireCell::Ray convert< WireCell::Ray > (const Configuration &cfg, const WireCell::Ray &def)
 
std::ostream & operator<< (std::ostream &os, const WireCell::Ray &ray)
 
WireCell::Ray operator/ (WireCell::Ray ray, const double &scale)
 
std::ostream & operator<< (std::ostream &os, const WireCell::Quantity &q)
 
WireCell::Quantity operator- (const WireCell::Quantity &other)
 
WireCell::Quantity operator* (const WireCell::Quantity &lhs, const WireCell::Quantity &rhs)
 
WireCell::Quantity operator/ (const WireCell::Quantity &lhs, const WireCell::Quantity &rhs)
 
WireCell::Quantity operator+ (const WireCell::Quantity &lhs, const WireCell::Quantity &rhs)
 
WireCell::Quantity operator- (const WireCell::Quantity &lhs, const WireCell::Quantity &rhs)
 
bool operator== (const WireCell::Quantity &lhs, const double &scalar)
 
bool operator!= (const WireCell::Quantity &lhs, const double &scalar)
 
bool operator< (const WireCell::Quantity &lhs, const double &scalar)
 
bool operator> (const WireCell::Quantity &lhs, const double &scalar)
 
bool operator== (const double &scalar, const WireCell::Quantity &rhs)
 
bool operator!= (const double &scalar, const WireCell::Quantity &rhs)
 
bool operator< (const double &scalar, const WireCell::Quantity &rhs)
 
bool operator> (const double &scalar, const WireCell::Quantity &rhs)
 
template<>
tagrules::tagset_t convert< tagrules::tagset_t > (const Configuration &cfg, const tagrules::tagset_t &def)
 
template<>
tagrules::ruleset_t convert< tagrules::ruleset_t > (const Configuration &cfg, const tagrules::ruleset_t &def)
 
std::string demangle (const std::string &name)
 
template<class T >
std::string type (const T &t)
 

Variables

wire_selector select_all_wires = WirePlaneSelector(kUlayer|kVlayer|kWlayer, 0, 0)
 
wire_selector select_u_wires = WirePlaneSelector(kUlayer, 0, 0)
 
wire_selector select_v_wires = WirePlaneSelector(kVlayer, 0, 0)
 
wire_selector select_w_wires = WirePlaneSelector(kWlayer, 0, 0)
 
wire_selector select_uvw_wires [3]
 
const WirePlaneLayer_t iplane2layer [3] = { kUlayer, kVlayer, kWlayer }
 

Detailed Description

This is the main entry point to the WCT. It provides a single command line method or optionally a family of fine-grained methods for setup and running.

One use of this is in the wire-cell command line program. It may also be use to embed WCT into a larger application or framework.

An AnodePlane provides wire-related and some volumetric geometrical information as well serving as the top of anode/face/plane organizational hierarchy for accessing this info. See also IAnodeFace and IWirePlane.

A blip source produces individual energy depositions in various ways.

This class "splats" depos directly into a frame without regards to much reality. It's only useful for gross, but fast debugging jobs. The frame it produces is the moral equivalent of post-SP.

Make a frame from depos using an ImpactTransform.

Make a frame from depos using an ImpactZipper.

See also the very similar DepoTransform which is newer and faster.

Convert ionization electrons into ADC.

This class assumes fine-grained field responses calculated at impact positions along lines across the wire pitch for each plane.

Digitizer converts voltage waveforms to integer ADC ones.

Resulting waveforms are still in floating-point form and should be round()'ed and truncated to whatever integer representation is wanted by some subsequent node.

An ElecResponse waveform is that due to sending a unit charge pulse into an amplifier with gain and shaping and a particular response function of the BNL cold electronics.

A noise model based on empirically measured noise spectra.

It requires configuration file holding a list of dictionary which provide association between wire length and the noise spectrum.

TBD: document JSON file format for providing spectra and any other parameters.

Define a pipeline facade over WCT nodes.

FIXME: this needs to move into the mithical "interface utilities" library along with much other stuff.

ImpactData represents the true charge distribution in time at the point in space where a field response function begins.

This component will output a "misconfigured" trace for each input trace.

It does this by filtering out an assumed electronics response function and applying a new one.

Note, traces are "misconfigured" independently even if multiple traces exist on the same channel.

By default the output traces will be sized larger than input by nsamples-1. If the "truncated" option is true then the output trace will be truncated to match the input size. this may cut off signal for traces smaller than the time where the electronics response functions are finite.

This component does not honor frame/trace tags. No tags will be considered on input and none are placed on output.

MultiDuctor - apply one of many possible ductors based on outcome of rules applied to input depos.

A list of independent "chains" are given. Each chain is applied to an input depo. A chain is a sequence of rules. Each rule is applied in turn to a depo until one matches. On a match, the ductor associated with the rule is given the depo and subsequent iteration of the chain is abandoned.

This frame source provides frames filled with noise.

Each time it is called it produces a fixed readout length of voltage-level noise which spans all channels.

This component will output a "ch-by-ch variation" trace for each input trace. Reference to "Misconfigure"

It does this by filtering out an assumed electronics response function and applying a new one from ch-by-ch electronics calibration.

By default the output traces will be sized larger than input by nsamples-1. If the "truncated" option is true then the output trace will be truncated to match the input size. this may cut off signal for traces smaller than the time where the electronics response functions are finite.

This component does not honor frame/trace tags. No tags will be considered on input and none are placed on output.

A PlaneDiffuser will return a queue of diffusions once enough depositions have been collected such that the queue represents all diffusions "close enough" to each wire. It implements a window across the wire pitch.

Gen::Random is an IRandom which is implemented with standard C++ <random>.

An RCResponse waveform is simple resistor-capacitor response.

A reframer takes makes a "rectangular" frame filled with samples from the tagged traces of its input. This new frame has exactly one trace for each channel and each trace is padded to span a uniform duration. These configuration paramters control how the new frame is shaped:

Vary field response to study systematics.

The static channel status component provides a simple way to set channel status via configuration. It does not provide for dynamic changes.

An IWirePlane.

A wire schema store based on loading data from files.

Some tools that operate on frame-related interfaces.

fixme: this should probably go into some WireCellItools package.

Provides information about an "anode face" which consists of a number of parallel wire planes, each consisting of a number of parallel wires.

Information includes:

Provides information about an "anode plane" which consists of a number of parallel wire planes as IWirePlane objects.

fixme: this has become kind of a kitchen sink.

A blob is a region in the 2D plane transverse to the drift direction. It is made up of a number of logically coplanar "layers". Each layer is bound by a pair of parallel rays. Rays may correspond to wires or to overall bounds of senitivity of the anode plane face. See manual for details.

A blob is assumed to exist in some context which provides its location along a drift direction aka time and a logical assocation with a particular anode face. See IBlobSet for example.

A blob set holds a collection of blobs.

See also ICluster which allows more rich associations.

IBlobSetProcessor consumes blob sets and sometimes produces them.

IChannel embodies static information about a single front end electronics channel to which some number of wire segments in an conductor feeds.

A channel response gives access to a per-channel response function. This is typically used to return the electronics response for a channel. Depending on implementation this may be an ideal response shared by all or it could be some measured or calibration response that differs for each channel.

A Channel Spectrum provides a discrete Fourier amplitude as a function of frequency.

An example implementation is a model of the noise on a given channel.

IChannelStatus provides information about each channel which potentially could change during the run.

A "cluster" (as defined here) is a graph connecting shared points to instances of a specific set of types of WCT data classes related to WC imaging. See node_t below for the supported types.

A clustering consumes blob sets and sometimes emits cluster objects.

A depo framer takes in a collection of depositions and produces a single frame that contains their associated signal waveforms. Excess depos may be dropped.

A field response provides access to a FieldResponse data structure. Use this interface instead of directly loading a response schema so that multiple components may share the same data without causing multiple loads.

This interface provides access to some "filter waveform" which is some discreetly sampled function.

A hydra has N input queues and M output queues each of a specified type. Not all queues may have elements. The implementation callable may leave elements in input queues for subsequent calls when new data exists.

A plane impact response provides information about a collection of impact responses for a plane. An impact response is a complex Fourier spectrum of some response (eg, field and possibly also electronics) to a point charge on a drift path that starts at the given impact position. Impact positions provide a regular subdivision along the pitch direction for a wire plane. Typically ten impact positions per wire region are used and with one impact position exactly aligned to a wire position.

A slice associates an IChannel with a value representing activity over some time span.

The time span of the slice is given in the WCT system of units. Typically it is some multiple of sampling ticks, but need not be.

The slice also caries an "ident" which definition is application-dependent.

A tiling consumes a time slice of channel samples and produces a set of blobs from it.

This is an interface to data about a waveform. It is a contiguous floating point sampling over a regular period and relative to some start (eg, start time).

Provides geometrical information about one wire plane in terms of its wire direction, pitch, bounding box and individual wires from which channel information can be derived.

A wire schema provides information on the detector/anode/face/plane/wire geometry hiearchy.

This information should be accessed through this interface instead of directly loading via the WireSchema code so that different components may share the information without leading to multiple loads of the data.

Some wire selectors.

Fixme: this isn't really appropriate for an interface package.

SimpleBlob

Cluster blobs.

This takes a stream of IBlobSets and mints a new ICluster on EOS or earlier if a gap in time slice is found.

It assumes each blob set represents all blobs found in one time slice (including none) and that blob sets are delivered in time order. Blobs in the set may span both faces of an anode plane. Gaps in time between blob sets will be determined by the set's slice.

Clusters will not span a gap. Likewise, when an EOS is encountered, all clusters are flushed to the output queue. If the "spans" config param is 0 then no gap testing is done.

The produced ICluster has b, w, c and s nodes.

Note, that input blob sets and thus their blobs may be held between calls (via their shared pointers).

BlobGrouping takes in a channel-level cluster and produces another with channels merged ('m' nodes)

The input cluster must have (b,w), (c,w) and (s,b) edges and may have (b,b) edges.

The output cluster will have (m, b) and (s,b) edges and if the input has (b,b) edges, they are preserved.

Grouping is done in the "coarse grained" strategy.

See manual for more info.

This simply collects input blob sets into an output vector based on them having the same slice.

BlobSolving takes in a cluster graph and produces another.

It is assumed that the graph is composed of s-nodes, b-nodes and m-nodes.

A solution is performed on sets of b-nodes attached to an s-node with weighting based on existence of (b-b) edges.

This tiling algorithm makes use of RayGrid for the heavy lifting.

It must be configured with a face on which to focus. Only wires (segments) in that face which are connected to channels with data in a slice will be considered when tiling.

It does not "know" about dead channels. If your detector has them you may place a component upstream which artifically inserts non-zero signal on dead channels in slice input here.

The resulting IBlobs have ident numbers which increment starting from zero. The ident is reset when EOS is received.

Some implementation of data interfaces used by INode components from wire-cell-img.

Note: this header should NOT typically be #include'ed in other Wire Cell components which are not defined in wire-cell-img/src/. It's exported as public to facilitiate writing unit tests.

This component "taps" into a stream of clusters to save them as JSON files.

The JSON can can then be converted for use with various viewers (paraview, bee).

The schema of JSON file is one that reflects the graph nature of an ICluster. It has two top level attributes:

A vertex is represented as a JSON object with the following attributes

An edge is a pair of vertex ident numbers.

Make stripes based on channel index.

This component is "naive" because it does not consider dead channels or other real world detector pathology.

A simple DFP engine meant for single-threaded execution.

A node is constructed with zero or more ports.

A port mediates between a node and an edge.

A port is either of type input or output.

In the context of a node, a port has a name and an index into an ordered list of other ports of a given type.

An edge is a queue passing data objects in one direction from its tail (input) end to its head (output) end.

Each end of an edge is exclusively "plugged" into one node through one port.

A valid graph consists of nodes with all ports plugged to edges.

A Pgrapher is an application that runs components via a user-configured directect acyclic graph following wire-cell data flow processing paradigm.

The individual components must be configured on their own as usual.

The graph is specified as a list of edges. Each edge has a tail (source) and a head (destination) endpoint. An endpoint is specified by a "typename" and an optional "port". As usual, the typename is in the form "type:name" or just "type" and as typically constructed by the Jsonnet function wc.tn() from a previously defined configuration object. The port is an index an integer default to 0.

A configuration might look like:

local cosmics = { type:"TrackDepos", name:"cosmics", ...}; [ // main configuration sequence which includes config for TrackDepos:cosmics, TrackDepos:beam, DepoJoiner (which may not yet exist) but not DumpDepos as it is not a configurable...., cosmics, beam, ..., { type:"Pgrapher", data:{ edges:[ { tail:{node:wc.tn(cosmics)}, head:{node:wc.tn(joiner), port:0} }, { tail:{node:wc.tn(beam)}, head:{node:"DepoJoiner", port:1} }, { tail:{node:"DepoJoiner"}, head:{node:"DumpDepos"} }, ], }}]

Note the port number need really only be specified in the second edge in order to send the data to port #1. port #0 is default.

As when configuraing a component itself, the name need only be specified in an edge pair if not using the default (empty string).

This is a frame sink that saves frames as celltree (TTree).

It is configured with a filename. If it contains a "%" character the filename will be formatted against the current frame ID.

This is a frame sink that saves frames as TH2D histograms.

It is configured with a filename. If it contains a "%" character the filename will be formatted against the current frame ID.

A "Magnify" file is one used for viewing in the Magnify display.

The file can only hold one frame so this source may be called at most twice before it starts returning false. First time will give a frame, second time will give an EOS.

Ar39 spectrum for C++ testing. For real app these arrays should go into a Jsonnet file.

Make a new output frame with a set of traces selected from the input based on being in a set of channels and possibly tags.

Database Channel Selector: select channels from database

This component provides field response data as read in from a "WCT field response" JSON file

This component applies "compressed sensing" influenced signal processing based on an L1 norm minimzation which fits both a unipolar collection and a bipolar induction response to regions channels in shorted regions known to have a mix.

Inherently MicroBooNE-specific functions and classes

This component provides identical channel responses for all channels and which use the nominal electronics response parameterized by gain and shaping time.

This is Omnibus, a WCT app object that ties together signal processing components. It takes any number of frame filters and pushes one frame from source, through the pipeline to sink.

Remove all possible noise from a microboone-like detector.

This filter is a kitchen sink class and is a candidate for factoring.

This component provides per-channel responses based on a configuration data file.

Inherently protoDUNE-specific functions and classes Modified from Microboone.h

Save depos to a Numpy file.

Some frames to a Numpy file

Wire Cell uses Eigen3 arrays for holding large block data like the waveforms from one plane of one readout frame. This header provides a shim between Eigen3 and the rest of Wire Cell.

There are a few important rules:

Usage examples are given below.

Vector a 3-vector of double.

See also WireCell::Point.

Interpolationn helpers.

See test_interpolate.cxx.

This class provides a 2D array-like structure which holds things of templated type. It's not fancy.

Persist structured information.

Any and all structured information that needs to be loaded or saved uses the methods in WireCell::Persist to do so. The transient data model is that of JsonCPP's Json::Value. The persistent format is either JSON or if the toolkit has support compiled in, Jsonnet.

Note, "external" data which may be voluminous, complex or otherwise inconvenient to convert to JSON would not use WireCell::Persist but rather be brought between files and an IData model using an ISink/ISource.

See also WireCellUtil/Configuration.h for how the configuration layer uses Json::Value objects. Large configuration items like wire geometry and field response are also loaded as JSON.

A ray grid is defined by pair-wise layers of parallel, ordered pairs of rays.

This file includes the implemenation for a ray grid as well as classes and functions that operate with it.

See section in the WCT manual for details.

Solving attempts to invert the matrix equation m = G*b where m is a vector of measurements on channels, b is a vector of blobs and G is a matrix that relates the two.

Define a tiling of overlapping sets rays.

This is part of Ray Grid.

See the WCT manual for details.

Ress is an interface to wire-cell-ress

A system of units compatible with (taken from) CLHEP.

Code here helps read in data which follows the Wire Cell Toolkit wire data schema. See python module wirecell.util.wires.schema and sister submodules.

Typedef Documentation

typedef boost::graph_traits<cluster_graph_t>::edge_descriptor WireCell::cluster_edge_t

Definition at line 89 of file ICluster.h.

typedef boost::adjacency_list<boost::setS, boost::vecS, boost::undirectedS, cluster_node_t> WireCell::cluster_graph_t

Definition at line 87 of file ICluster.h.

Definition at line 105 of file ICluster.h.

The vertex property.

Definition at line 33 of file ICluster.h.

typedef boost::graph_traits<cluster_graph_t>::vertex_iterator WireCell::cluster_vertex_iter_t

Definition at line 90 of file ICluster.h.

typedef boost::graph_traits<cluster_graph_t>::vertex_descriptor WireCell::cluster_vertex_t

Definition at line 88 of file ICluster.h.

The Wire Cell Toolkit configuration layer uses Json::Value objects for its transient data model.

The Configuration type is a recursive in that one Configuration object may contain others.

The WCT assumes an Object Configuration Protocol is implemented by the "client" code that uses the toolkit. See for example the reference implementation in the wire-cell command line program. This protocol consists of:

1) Creation of the list of Configuration objects, typically via WireCell::Persist::load().

2) Iterating this list and for each suitable Configuration object instantiating the appropriately matching IConfigurable via the WireCell::NamedFactory facility.

3) Obtaining the default Configuration object from the IConfigurable and merging the user-supplied on top of it.

4) Passing the resulting Configuration object to the IConfigurable::configure() method.

A suitable Configuration object must have two top level keys and may have a third optional key:

  • type :: must match the "component class name" (as given as first argument to the WIRECELL_FACTORY() macro in the implementation file)
  • data :: an object which follows a schema which is specific to each IConfigurable implementation.
  • name :: an optional Instance Name. If not given, the default instance of the type will be used.

Definition at line 50 of file Configuration.h.

Definition at line 77 of file IDepo.h.

typedef boost::error_info<struct tag_errmsg, std::string> WireCell::errmsg

Definition at line 54 of file Exceptions.h.

Definition at line 66 of file IDiffusion.h.

Definition at line 78 of file IWire.h.

Some common collections.

Definition at line 55 of file IWire.h.

Definition at line 89 of file IWire.h.

Definition at line 66 of file IWire.h.

typedef std::queue<boost::any> WireCell::Pipe

Definition at line 22 of file GenPipeline.h.

Definition at line 32 of file GenPipeline.h.

typedef D3Vector<double> WireCell::Point

A 3D Cartesian point in double precision.

Definition at line 15 of file Point.h.

typedef D3Vector<float> WireCell::PointF

PointF - a 3D Cartesian point in single precision for when memory is constrained and double precision is not required.

Definition at line 50 of file Point.h.

Definition at line 46 of file Point.h.

typedef std::pair<Point, float> WireCell::PointValue

PointValue - an association of a point and a value.

Definition at line 37 of file Point.h.

PointValueVector - a collection of point-value associations.

Definition at line 40 of file Point.h.

PointVector - a collection of Points.

Definition at line 30 of file Point.h.

typedef std::deque<boost::any> WireCell::queuedany

Definition at line 181 of file GenPipeline.h.

typedef std::pair<Point, Point> WireCell::Ray

A line segment running from a first (tail) to a second (head) point.

Definition at line 21 of file Point.h.

typedef std::pair<Ray,Ray> WireCell::ray_pair_t

Definition at line 24 of file Point.h.

Definition at line 27 of file Point.h.

Definition at line 34 of file Point.h.

typedef std::pair<double, Vector> WireCell::ScalarPoint

A scalar + vector, eg charge at a point.

Definition at line 33 of file Point.h.

Definition at line 46 of file IPlaneImpactResponse.h.

An alias for Point.

Definition at line 18 of file Point.h.

Definition at line 16 of file IWireSelectors.h.

Enumeration Type Documentation

Enumerate layer IDs. These are not indices!

Enumerator
kUnknownLayer 
kUlayer 
kVlayer 
kWlayer 

Definition at line 13 of file WirePlaneId.h.

Function Documentation

WireCell::Configuration WireCell::append ( Configuration a,
Configuration b 
)

Return an array which is composed of the array b appended to the array a.

Append array b onto end of a and return a.

Definition at line 42 of file Configuration.cxx.

43 {
44  Configuration ret(Json::arrayValue);
45  for (auto x : a) {
46  ret.append(x);
47  }
48  for (auto x : b) {
49  ret.append(x);
50  }
51  return ret;
52 }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
Json::Value Configuration
Definition: Configuration.h:50
static bool * b
Definition: config.cpp:1043
list x
Definition: train.py:276
bool WireCell::ascending_index ( IWire::pointer  lhs,
IWire::pointer  rhs 
)

Definition at line 16 of file IWire.cxx.

17 {
18  if (lhs->planeid() == rhs->planeid()) {
19  return lhs->index() < rhs->index();
20  }
21  return lhs->planeid() < lhs->planeid();
22 }
bool WireCell::ascending_time ( const WireCell::IDepo::pointer lhs,
const WireCell::IDepo::pointer rhs 
)

Compare two IDepo::pointer by time (ascending). x is used to break tie.

Definition at line 17 of file IDepo.cxx.

18 {
19  if (lhs->time() == rhs->time()) {
20  if (lhs->pos().x() == lhs->pos().x()) {
21  return lhs.get() < rhs.get(); // break tie by pointer
22  }
23  return lhs->pos().x() < lhs->pos().x();
24  }
25  return lhs->time() < rhs->time();
26 }
int WireCell::box_intersection ( const Ray bounds,
const Ray ray,
Ray hits 
)

Determine if a ray hits a rectangular box aligned with the Cartesian axes.

See WireCelll::hit_square for definition of arguments and return value.

Definition at line 61 of file Intersection.cxx.

62 {
63  PointSet results;
64  const Point& point = ray.first;
65  const Point dir = (ray.second - ray.first).norm();
66 
67  // check each projection
68  for (int axis=0; axis<3; ++axis) {
69  Ray res;
70  int got = hit_square(axis, bounds, point, dir, res);
71 
72  if (got&1) {
73  //pair<PointSet::iterator, bool> what =
74  results.insert(res.first);
75  }
76  if (got&2) {
77  //pair<PointSet::iterator, bool> what =
78  results.insert(res.second);
79  }
80  }
81 
82  if (results.size() > 2) {
83  return -1;
84  }
85 
86  int hitmask = 0;
87  for (auto hitit = results.begin(); hitit != results.end(); ++hitit) {
88  const Point& hit = *hitit;
89  Vector hitdir = hit - point;
90  double dot = hitdir.norm().dot(dir);
91 
92  if (dot > 0) { // actually should be closer to +/-1 w/in tolerance
93  hits.first = hit;
94  hitmask |= 1;
95  }
96  else {
97  hits.second = hit;
98  hitmask |= 2;
99  }
100  }
101 
102  return hitmask;
103 }
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
Definition: Point.h:21
string dir
int hit_square(int axis0, const Ray &bounds, const Point &point, const Vector &dir, Ray &hits)
Definition: Intersection.cxx:8
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:34
std::set< Point, ComparePoints > PointSet
Definition: Point.h:46
BoundingBox bounds(int x, int y, int w, int h)
Definition: main.cpp:37
auto norm(Vector const &v)
Return norm of the specified vector.
Detector simulation of raw signals on wires.
std::vector< float > Vector
WireCell::Configuration WireCell::branch ( WireCell::Configuration  cfg,
const std::string dotpath 
)

Follow a dot.separated.path and return the branch there.

Definition at line 7 of file Configuration.cxx.

9 {
10  std::vector<std::string> path;
11  boost::algorithm::split(path, dotpath, boost::algorithm::is_any_of("."));
12  for (auto name : path) {
13  cfg = cfg[name];
14  }
15  return cfg;
16 }
static QCString name
Definition: declinfo.cpp:673
cfg
Definition: dbjson.py:29
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
template<typename T >
T WireCell::convert ( const Configuration cfg,
const T &  def = T() 
)

Convert a configuration value to a particular type.

For persistence use WireCell::Persist::load() and WireCell::Persist::dump(). The following functions provide some access methods which add some value beyond what Json::Value provides including some support for basic WCT types.

Definition at line 63 of file Configuration.h.

63  {
64  return def;
65  }
template<>
bool WireCell::convert< bool > ( const Configuration cfg,
const bool def 
)
inline

Definition at line 68 of file Configuration.h.

68  {
69  if (cfg.isNull()) return def;
70  return cfg.asBool();
71  }
cfg
Definition: dbjson.py:29
template<>
double WireCell::convert< double > ( const Configuration cfg,
const double &  def 
)
inline

Definition at line 86 of file Configuration.h.

86  {
87  if (cfg.isNull()) return def;
88  return cfg.asDouble();
89  }
cfg
Definition: dbjson.py:29
template<>
float WireCell::convert< float > ( const Configuration cfg,
const float &  def 
)
inline

Definition at line 80 of file Configuration.h.

80  {
81  if (cfg.isNull()) return def;
82  return cfg.asDouble();
83  }
cfg
Definition: dbjson.py:29
template<>
int WireCell::convert< int > ( const Configuration cfg,
const int &  def 
)
inline

Definition at line 74 of file Configuration.h.

74  {
75  if (cfg.isNull()) return def;
76  return cfg.asInt();
77  }
cfg
Definition: dbjson.py:29
template<>
std::string WireCell::convert< std::string > ( const Configuration cfg,
const std::string def 
)
inline

Definition at line 92 of file Configuration.h.

92  {
93  if (cfg.isNull()) return def;
94  return cfg.asString();
95  }
cfg
Definition: dbjson.py:29
template<>
std::vector<double> WireCell::convert< std::vector< double > > ( const Configuration cfg,
const std::vector< double > &  def 
)
inline

Definition at line 116 of file Configuration.h.

116  {
117  std::vector<double> ret;
118  for (auto v : cfg) {
119  ret.push_back(convert<double>(v));
120  }
121  return ret;
122  }
cfg
Definition: dbjson.py:29
double convert< double >(const Configuration &cfg, const double &def)
Definition: Configuration.h:86
template<>
std::vector<int> WireCell::convert< std::vector< int > > ( const Configuration cfg,
const std::vector< int > &  def 
)
inline

Definition at line 107 of file Configuration.h.

107  {
108  std::vector<int> ret;
109  for (auto v : cfg) {
110  ret.push_back(convert<int>(v));
111  }
112  return ret;
113  }
cfg
Definition: dbjson.py:29
int convert< int >(const Configuration &cfg, const int &def)
Definition: Configuration.h:74
template<>
std::vector<std::string> WireCell::convert< std::vector< std::string > > ( const Configuration cfg,
const std::vector< std::string > &  def 
)
inline

Definition at line 98 of file Configuration.h.

98  {
99  std::vector<std::string> ret;
100  for (auto v : cfg) {
101  ret.push_back(convert<std::string>(v));
102  }
103  return ret;
104  }
cfg
Definition: dbjson.py:29
template<>
tagrules::ruleset_t WireCell::convert< tagrules::ruleset_t > ( const Configuration cfg,
const tagrules::ruleset_t def 
)
inline

Definition at line 118 of file TagRules.h.

118  {
120  for (auto key : cfg.getMemberNames()) {
121  auto ts = convert<tagrules::tagset_t>(cfg[key]);
122  if (ts.empty()) {
123  continue;
124  }
125  ret.push_back(make_pair(std::regex(key), ts));
126  }
127  if (ret.empty()) {
128  return def;
129  }
130  return ret;
131  }
cfg
Definition: dbjson.py:29
std::vector< rule_t > ruleset_t
Definition: TagRules.h:50
def key(type, name=None)
Definition: graph.py:13
template<>
tagrules::tagset_t WireCell::convert< tagrules::tagset_t > ( const Configuration cfg,
const tagrules::tagset_t def 
)
inline

Definition at line 101 of file TagRules.h.

101  {
102  tagrules::tagset_t ret;
103  if (cfg.isString()) {
104  ret.insert(cfg.asString());
105  return ret;
106  }
107  if (cfg.isArray()) {
108  for (auto one : cfg) {
109  ret.insert(one.asString());
110  }
111  return ret;
112  }
113  return def;
114  }
std::unordered_set< tag_t > tagset_t
Definition: TagRules.h:48
cfg
Definition: dbjson.py:29
template<>
WireCell::Point WireCell::convert< WireCell::Point > ( const Configuration cfg,
const WireCell::Point def 
)
inline

Definition at line 91 of file Point.h.

91  {
92  return Point(get<double>(cfg,"x"), get<double>(cfg,"y"), get<double>(cfg,"z"));
93  }
D3Vector< double > Point
A 3D Cartesian point in double precision.
Definition: Point.h:15
cfg
Definition: dbjson.py:29
template<>
WireCell::Ray WireCell::convert< WireCell::Ray > ( const Configuration cfg,
const WireCell::Ray def 
)
inline

Definition at line 96 of file Point.h.

96  {
97  return Ray(get<WireCell::Point>(cfg,"tail"), get<WireCell::Point>(cfg,"head"));
98  }
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
Definition: Point.h:21
cfg
Definition: dbjson.py:29
template<>
WireCell::WirePlaneId WireCell::convert< WireCell::WirePlaneId > ( const Configuration cfg,
const WireCell::WirePlaneId def 
)
inline

Definition at line 60 of file WirePlaneId.h.

60  {
62  convert<int>(cfg[1],0), convert<int>(cfg[2], 0));
63  }
cfg
Definition: dbjson.py:29
const WirePlaneLayer_t iplane2layer[3]
Definition: WirePlaneId.h:14
int convert< int >(const Configuration &cfg, const int &def)
Definition: Configuration.h:74
std::string WireCell::demangle ( const std::string name)

Definition at line 6 of file Type.cxx.

6  {
7 
9  return ret;
10 }
static QCString name
Definition: declinfo.cpp:673
std::string demangle(T const *=nullptr)
Outputs a demangled name for type T.
Definition: DebugUtils.h:348
std::string string
Definition: nybbler.cc:12
IDepo::vector WireCell::depo_chain ( IDepo::pointer  recent)

Simple utility to return a vector of depositions formed by walking the prior() chain. The vector begins with the most recent.

Definition at line 4 of file IDepo.cxx.

5 {
6  IDepo::vector ret;
7  while (true) {
8  ret.push_back(last);
9  last = last->prior();
10  if (!last) { break; }
11  }
12  return ret;
13 }
struct vector vector
bool WireCell::descending_time ( const WireCell::IDepo::pointer lhs,
const WireCell::IDepo::pointer rhs 
)

Compare two IDepo::pointers for by time, descending. x is used to break tie.

Definition at line 29 of file IDepo.cxx.

30 {
31  if (lhs->time() == rhs->time()) {
32  if (lhs->pos().x() == lhs->pos().x()) {
33  return lhs.get() > rhs.get(); // break tie by pointer
34  }
35  return lhs->pos().x() > lhs->pos().x();
36  }
37  return lhs->time() > rhs->time();
38 }
std::size_t WireCell::fft_best_length ( size_t  nsamples,
bool  keep_odd_even = false 
)
template<typename T >
Configuration WireCell::find ( Configuration lst,
const std::string dotpath,
const T &  val 
)

Return dictionary in given list if it value at dotpath matches.

Definition at line 138 of file Configuration.h.

138  {
139  for (auto ent : lst) {
140  auto maybe = branch(ent, dotpath);
141  if (maybe.isNull()) { continue; }
142  if (convert<T>(maybe) == val) { return maybe; }
143  }
144  return Configuration();
145  }
Configuration branch(Configuration cfg, const std::string &dotpath)
Follow a dot.separated.path and return the branch there.
Json::Value Configuration
Definition: Configuration.h:50
template<typename T >
T WireCell::get ( Configuration  cfg,
const std::string dotpath,
const T &  def = T() 
)

Get value in configuration at the dotted path from or return default.

Definition at line 149 of file Configuration.h.

149  {
150  return convert(branch(cfg, dotpath), def);
151  }
T convert(const Configuration &cfg, const T &def=T())
Convert a configuration value to a particular type.
Definition: Configuration.h:63
cfg
Definition: dbjson.py:29
Configuration branch(Configuration cfg, const std::string &dotpath)
Follow a dot.separated.path and return the branch there.
int WireCell::hit_square ( int  axis0,
const Ray bounds,
const Point point,
const Vector dir,
Ray hits 
)

Determine a 2D square is intersected by a 3D ray projected to its plane.

Parameters
axis0is the axis number (0,1,2) to which the projected plane is perpendicular.
boundsis a raw from opposite corners of the bounding box.
pointis a WireCell::Point from which a ray emanates.
diris a WireCell::Vector in the direction of the ray.
hitsis the returned intersection(s).
Returns
a "hit mask" with 0 indicating the ray did not intersect, 1 or 2 meaning the first or second point in the ray is valid and 3 meaning both are.

Definition at line 8 of file Intersection.cxx.

11 {
12  const Point& bmin = bounds.first;
13  const Point& bmax = bounds.second;
14 
15  double hit1[3] = {0}, hit2[3] = {0};
16 
17  int hitmask = 0;
18  if (0 == dir[axis0]) {
19  return hitmask;
20  }
21 
22  int axis1 = (axis0 + 1)%3;
23  int axis2 = (axis1 + 1)%3;
24 
25  { // toward the min intercept
26  double intercept = bmin[axis0];
27  double scale = (intercept - point[axis0])/dir[axis0];
28 
29  double one = point[axis1] + scale*dir[axis1];
30  double two = point[axis2] + scale*dir[axis2];
31 
32  if (bmin[axis1] <= one && one <= bmax[axis1] &&
33  bmin[axis2] <= two && two <= bmax[axis2]) {
34  hitmask |= 1;
35  hit1[axis0] = intercept;
36  hit1[axis1] = one;
37  hit1[axis2] = two;
38  }
39  }
40 
41  { // toward the max intercept
42  double intercept = bmax[axis0];
43  double scale = (intercept - point[axis0])/dir[axis0];
44 
45  double one = point[axis1] + scale*dir[axis1];
46  double two = point[axis2] + scale*dir[axis2];
47 
48  if (bmin[axis1] <= one && one <= bmax[axis1] &&
49  bmin[axis2] <= two && two <= bmax[axis2]) {
50  hitmask |= 2;
51  hit2[axis0] = intercept;
52  hit2[axis1] = one;
53  hit2[axis2] = two;
54  }
55  }
56 
57  hits = Ray(Point(hit1), Point(hit2));
58  return hitmask;
59 }
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
Definition: Point.h:21
string dir
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:34
BoundingBox bounds(int x, int y, int w, int h)
Definition: main.cpp:37
void scale(Sequence< Val > &seq, Val scalar)
Scale (multiply) sequence values by scalar.
Definition: Waveform.h:146
Proc* WireCell::join ( Pipeline pipeline,
Proc src,
Proc dst 
)

Definition at line 218 of file GenPipeline.h.

219 {
220  pipeline.push_back(src);
221  auto link = new ShuntProc(dynamic_cast<SourceProc*>(src)->output_pipe(),
222  dynamic_cast<SinkProc*>(dst)->input_pipe());
223  pipeline.push_back(link);
224 
225  // do not push dst. return just for syntactic sugar
226  return dst;
227 }
double WireCell::memusage_resident ( )

Definition at line 43 of file MemUsage.cxx.

43  {
44 #ifdef __linux__
45  return memusage_linux_resident();
46 #endif
47  return -1;
48 }
static double memusage_linux_resident()
Definition: MemUsage.cxx:9
double WireCell::memusage_shared ( )

Definition at line 50 of file MemUsage.cxx.

51 {
52 #ifdef __linux__
53  return memusage_linux_shared();
54 #endif
55  return -1;
56 }
static double memusage_linux_shared()
Definition: MemUsage.cxx:20
double WireCell::memusage_size ( )

Definition at line 57 of file MemUsage.cxx.

58 {
59 #ifdef __linux__
60  return memusage_linux_size();
61 #endif
62  return -1;
63 }
static double memusage_linux_size()
Definition: MemUsage.cxx:31
template<typename Type >
std::vector<Type> WireCell::neighbors_oftype ( const cluster_indexed_graph_t g,
const cluster_node_t n 
)

Definition at line 120 of file ICluster.h.

120  {
121  std::vector<Type> ret;
122  for (const auto& vp : g.neighbors(n)) {
123  if (std::holds_alternative<Type>(vp.ptr)) {
124  ret.push_back(std::get<Type>(vp.ptr));
125  }
126  }
127  return ret;
128  }
static const double g
Definition: Units.h:145
std::size_t n
Definition: format.h:3399
template<typename Type >
std::vector<Type> WireCell::oftype ( const cluster_indexed_graph_t g)

Definition at line 108 of file ICluster.h.

108  {
109  std::vector<Type> ret;
110  for (const auto& v : boost::make_iterator_range(boost::vertices(g.graph()))) {
111  const auto& vp = g.graph()[v];
112  if (std::holds_alternative<Type>(vp.ptr)) {
113  ret.push_back(std::get<Type>(vp.ptr));
114  }
115  }
116  return ret;
117  }
static const double g
Definition: Units.h:145
template<class T >
bool WireCell::operator!= ( const D3Vector< T > &  a,
const D3Vector< T > &  b 
)

Definition at line 175 of file D3Vector.h.

175  {
176  return ! (a == b);
177  }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
static bool * b
Definition: config.cpp:1043
bool WireCell::operator!= ( const WireCell::Quantity lhs,
const double &  scalar 
)
inline

Definition at line 177 of file Quantity.h.

178 { return lhs.mean() != scalar; }
double mean() const
Definition: Quantity.h:47
bool WireCell::operator!= ( const double &  scalar,
const WireCell::Quantity rhs 
)
inline

Definition at line 190 of file Quantity.h.

191 { return scalar != rhs.mean(); }
double mean() const
Definition: Quantity.h:47
WireCell::Quantity WireCell::operator* ( const WireCell::Quantity lhs,
const WireCell::Quantity rhs 
)
inline

Definition at line 142 of file Quantity.h.

144 {
145  WireCell::Quantity res = lhs;
146  res *= rhs;
147  return res;
148 }
template<class T >
D3Vector<T> WireCell::operator* ( const D3Vector< T >  a,
s 
)

Definition at line 160 of file D3Vector.h.

160  {
161  return D3Vector<T>(a.x()*s, a.y()*s, a.z()*s);
162  }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
static QCString * s
Definition: config.cpp:1042
template<class T >
D3Vector<T> WireCell::operator* ( s,
const D3Vector< T >  a 
)

Definition at line 180 of file D3Vector.h.

180  {
181  return a*s;
182  }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
static QCString * s
Definition: config.cpp:1042
template<class T >
D3Vector<T> WireCell::operator+ ( const D3Vector< T >  a,
const D3Vector< T >  b 
)

Definition at line 155 of file D3Vector.h.

155  {
156  return D3Vector<T>(a.x()+b.x(), a.y()+b.y(), a.z()+b.z());
157  }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
static bool * b
Definition: config.cpp:1043
WireCell::Quantity WireCell::operator+ ( const WireCell::Quantity lhs,
const WireCell::Quantity rhs 
)
inline

Definition at line 156 of file Quantity.h.

158 {
159  WireCell::Quantity res = lhs;
160  res += rhs;
161  return res;
162 }
WireCell::Quantity WireCell::operator- ( const WireCell::Quantity other)
inline

Definition at line 137 of file Quantity.h.

138 {
139  return WireCell::Quantity(-1*other.mean(), other.sigma());
140 }
double mean() const
Definition: Quantity.h:47
double sigma() const
Definition: Quantity.h:48
template<class T >
D3Vector<T> WireCell::operator- ( const D3Vector< T >  a,
const D3Vector< T >  b 
)

Definition at line 150 of file D3Vector.h.

150  {
151  return D3Vector<T>(a.x()-b.x(), a.y()-b.y(), a.z()-b.z());
152  }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
static bool * b
Definition: config.cpp:1043
WireCell::Quantity WireCell::operator- ( const WireCell::Quantity lhs,
const WireCell::Quantity rhs 
)
inline

Definition at line 163 of file Quantity.h.

165 {
166  WireCell::Quantity res = lhs;
167  res -= rhs;
168  return res;
169 }
WireCell::Ray WireCell::operator/ ( WireCell::Ray  ray,
const double &  scale 
)
inline

Definition at line 110 of file Point.h.

110  {
111  return WireCell::Ray(ray.first/scale, ray.second/scale);
112  }
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
Definition: Point.h:21
void scale(Sequence< Val > &seq, Val scalar)
Scale (multiply) sequence values by scalar.
Definition: Waveform.h:146
WireCell::Quantity WireCell::operator/ ( const WireCell::Quantity lhs,
const WireCell::Quantity rhs 
)
inline

Definition at line 149 of file Quantity.h.

151 {
152  WireCell::Quantity res = lhs;
153  res /= rhs;
154  return res;
155 }
template<class T >
D3Vector<T> WireCell::operator/ ( const D3Vector< T >  a,
s 
)

Definition at line 165 of file D3Vector.h.

165  {
166  return D3Vector<T>(a.x()/s, a.y()/s, a.z()/s);
167  }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
static QCString * s
Definition: config.cpp:1042
bool WireCell::operator< ( const WireCell::Quantity lhs,
const double &  scalar 
)
inline

Definition at line 180 of file Quantity.h.

181 { return lhs.mean() < scalar; }
double mean() const
Definition: Quantity.h:47
bool WireCell::operator< ( const double &  scalar,
const WireCell::Quantity rhs 
)
inline

Definition at line 193 of file Quantity.h.

194 { return scalar < rhs.mean(); }
double mean() const
Definition: Quantity.h:47
std::ostream & WireCell::operator<< ( std::ostream &  os,
const WireCell::WirePlaneId wpid 
)

Definition at line 83 of file WirePlaneId.cxx.

84 {
85  o << "[WirePlaneId "<< wpid.ident() << " ind:" << wpid.index() << " layer:" << wpid.layer() << " apa:" << wpid.apa() << " face:" << wpid.face();
86  if (!wpid.valid()) { o << " bogus"; }
87  o << "]";
88  return o;
89 }
WirePlaneLayer_t layer() const
Layer as enum.
Definition: WirePlaneId.cxx:25
int ident() const
Unit ID as integer.
Definition: WirePlaneId.cxx:21
bool valid() const
return true if valid
Definition: WirePlaneId.cxx:53
int apa() const
APA number.
Definition: WirePlaneId.cxx:48
int index() const
Layer as index number (0,1 or 2). -1 if unknown.
Definition: WirePlaneId.cxx:34
int face() const
APA face number.
Definition: WirePlaneId.cxx:44
std::ostream & WireCell::operator<< ( std::ostream &  o,
const WireCell::WirePlaneLayer_t layer 
)

Definition at line 91 of file WirePlaneId.cxx.

92 {
93  switch (layer) {
94  case WireCell::kUlayer : o << "<U>"; break;
95  case WireCell::kVlayer : o << "<V>"; break;
96  case WireCell::kWlayer : o << "<W>"; break;
97  default: o << "<?>"; break;
98  }
99  return o;
100 }
std::ostream& WireCell::operator<< ( std::ostream &  os,
const WireCell::Ray ray 
)
inline

Definition at line 103 of file Point.h.

104  {
105  os << "[" << ray.first << " --> " << ray.second << "]";
106  return os;
107  }
std::ostream& WireCell::operator<< ( std::ostream &  os,
const WireCell::Binning bins 
)
inline

Definition at line 124 of file Binning.h.

125  {
126  os << bins.nbins() << "@[" << bins.min() << "," << bins.max() << "]";
127  return os;
128  }
double max() const
Definition: Binning.h:52
double min() const
Definition: Binning.h:47
int nbins() const
Definition: Binning.h:42
std::ostream& WireCell::operator<< ( std::ostream &  os,
const WireCell::Quantity q 
)
inline

Definition at line 131 of file Quantity.h.

132 {
133  os << "(" << q.mean() << " +/- " << q.sigma() << ")";
134  return os;
135 }
double mean() const
Definition: Quantity.h:47
double sigma() const
Definition: Quantity.h:48
template<class T >
std::ostream& WireCell::operator<< ( std::ostream &  os,
const D3Vector< T > &  vec 
)

Definition at line 144 of file D3Vector.h.

144  {
145  os << "(" << vec.x() << " " << vec.y() << " " << vec.z() << ")" ;
146  return os ;
147  }
template<class T >
bool WireCell::operator== ( const D3Vector< T > &  a,
const D3Vector< T > &  b 
)

Definition at line 170 of file D3Vector.h.

170  {
171  return a.x() == b.x() && a.y() == b.y() && a.z() == b.z();
172  }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
static bool * b
Definition: config.cpp:1043
bool WireCell::operator== ( const WireCell::Quantity lhs,
const double &  scalar 
)
inline

Definition at line 174 of file Quantity.h.

175 { return lhs.mean() == scalar; }
double mean() const
Definition: Quantity.h:47
bool WireCell::operator== ( const double &  scalar,
const WireCell::Quantity rhs 
)
inline

Definition at line 187 of file Quantity.h.

188 { return scalar == rhs.mean(); }
double mean() const
Definition: Quantity.h:47
bool WireCell::operator> ( const WireCell::Quantity lhs,
const double &  scalar 
)
inline

Definition at line 183 of file Quantity.h.

184 { return lhs.mean() > scalar; }
double mean() const
Definition: Quantity.h:47
bool WireCell::operator> ( const double &  scalar,
const WireCell::Quantity rhs 
)
inline

Definition at line 196 of file Quantity.h.

197 { return scalar > rhs.mean(); }
double mean() const
Definition: Quantity.h:47
double WireCell::point_angle ( const Vector axis,
const Vector vector 
)

Return the angle from axis vector to vector. This is just acos(dot).

Definition at line 57 of file Point.cxx.

58 {
59  return acos(axis.dot(vector));
60 }
bool WireCell::point_contained ( const Point point,
const Ray bounds 
)

Return true if point is contained in a rectangular solid described by the ray bounds running between diagonally opposed corners.

Definition at line 40 of file Point.cxx.

41 {
42  for (int axis = 0; axis<3; ++axis) {
43  if (!point_contained(point, bounds, axis)) {
44  return false;
45  }
46  }
47  return true;
48 }
BoundingBox bounds(int x, int y, int w, int h)
Definition: main.cpp:37
bool point_contained(const Point &point, const Ray &bounds)
Definition: Point.cxx:40
bool WireCell::point_contained ( const Point point,
const Ray bounds,
int  axis 
)

Return true if point is contained by the bounding box along the given axis (x=0, y=1, z=2) of the bounding box.

Definition at line 50 of file Point.cxx.

51 {
52  std::pair<double, double> mm = std::minmax(bounds.first[axis], bounds.second[axis]);
53  return mm.first <= point[axis] && point[axis] <= mm.second;
54 }
std::pair< float, float > minmax(const float a, const float b)
minmax
BoundingBox bounds(int x, int y, int w, int h)
Definition: main.cpp:37
static const double mm
Definition: Units.h:73
template<typename T >
void WireCell::put ( Configuration cfg,
const std::string dotpath,
const T &  val 
)

Put value in configuration at the dotted path.

Definition at line 155 of file Configuration.h.

155  {
156  Configuration* ptr = &cfg;
157  std::vector<std::string> path;
158  boost::algorithm::split(path, dotpath, boost::algorithm::is_any_of("."));
159  for (auto name : path) {
160  ptr = &(*ptr)[name];
161  }
162  *ptr = val;
163  }
static QCString name
Definition: declinfo.cpp:673
cfg
Definition: dbjson.py:29
const void * ptr(const T *p)
Definition: format.h:3138
Json::Value Configuration
Definition: Configuration.h:50
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
double WireCell::ray_dist ( const Ray ray,
const Point point 
)

Return the distance from the tail of the ray to the point projected onto the ray's direction.

Definition at line 95 of file Point.cxx.

96 {
97  return ray_unit(ray).dot(point - ray.first);
98 }
Vector ray_unit(const Ray &ray)
Definition: Point.cxx:71
T dot(const D3Vector &rhs) const
Return the dot product of this vector and the other.
Definition: D3Vector.h:80
double WireCell::ray_length ( const Ray ray)

Return the distance from the tail to the head of the ray.

Definition at line 62 of file Point.cxx.

63 {
64  return (ray.second - ray.first).magnitude();
65 }
WireCell::Ray WireCell::ray_pitch ( const Ray ray1,
const Ray ray2 
)

Return a ray representing the points of closest approach between the two lines colinear with the two rays.

Definition at line 76 of file Point.cxx.

77 {
78  // http://geomalgorithms.com/a07-_distance.html
79  const WireCell::Vector w0 = pu.first - qv.first;
80  const WireCell::Vector u = ray_unit(pu);
81  const WireCell::Vector v = ray_unit(qv);
82  const double a = u.dot(u), b = u.dot(v), c = v.dot(v);
83  const double d = u.dot(w0), e = v.dot(w0);
84 
85  const double denom = a*c - b*b;
86  if (denom < 1e-6) { // parallel
87  double t = e/c;
88  return Ray(pu.first, qv.first + t*v);
89  }
90  const double s = (b*e - c*d) / denom;
91  const double t = (a*e - b*d) / denom;
92  return Ray(pu.first + s*u, qv.first + t*v);
93 }
std::pair< Point, Point > Ray
A line segment running from a first (tail) to a second (head) point.
Definition: Point.h:21
const double e
Vector ray_unit(const Ray &ray)
Definition: Point.cxx:71
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
T dot(const D3Vector &rhs) const
Return the dot product of this vector and the other.
Definition: D3Vector.h:80
static bool * b
Definition: config.cpp:1043
static QCString * s
Definition: config.cpp:1042
WireCell::Vector WireCell::ray_unit ( const Ray ray)

Return a unit vector pointing in the direction from the tail to the head of the ray.

Definition at line 71 of file Point.cxx.

72 {
73  return ray_vector(ray).norm();
74 }
D3Vector norm() const
Return a normalized vector in the direction of this vector.
Definition: D3Vector.h:91
Vector ray_vector(const Ray &ray)
Definition: Point.cxx:67
WireCell::Vector WireCell::ray_vector ( const Ray ray)

Return a vector going from ray's tail to ray's head.

Definition at line 67 of file Point.cxx.

68 {
69  return ray.second - ray.first;
70 }
double WireCell::ray_volume ( const Ray ray)

Return the volume of a box aligned with axes and with the ray at opposite corners.

Definition at line 101 of file Point.cxx.

102 {
103  auto diff = ray_vector(ray);
104  return diff.x() * diff.y() * diff.z();
105 }
Vector ray_vector(const Ray &ray)
Definition: Point.cxx:67
template<class T >
std::string WireCell::type ( const T &  t)

Definition at line 20 of file Type.h.

20  {
21  return demangle(typeid(t).name());
22  }
static QCString name
Definition: declinfo.cpp:673
std::string demangle(const std::string &name)
Definition: Type.cxx:6

Merge dictionary b into a, return a.

Definition at line 19 of file Configuration.cxx.

21 {
22  if (a.isNull()) {
23  a = b;
24  return b;
25  }
26  if (!a.isObject() || !b.isObject()) {
27  return a;
28  }
29 
30  for (const auto& key : b.getMemberNames()) {
31  if (a[key].isObject()) {
32  update(a[key], b[key]);
33  }
34  else {
35  a[key] = b[key];
36  }
37  }
38  return a;
39 }
Configuration update(Configuration &a, Configuration &b)
Merge dictionary b into a, return a.
def key(type, name=None)
Definition: graph.py:13
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
static bool * b
Definition: config.cpp:1043

Variable Documentation

const WirePlaneLayer_t WireCell::iplane2layer[3] = { kUlayer, kVlayer, kWlayer }

Definition at line 14 of file WirePlaneId.h.

wire_selector WireCell::select_all_wires = WirePlaneSelector(kUlayer|kVlayer|kWlayer, 0, 0)

Definition at line 15 of file IWireSelectors.cxx.

wire_selector WireCell::select_u_wires = WirePlaneSelector(kUlayer, 0, 0)

Definition at line 7 of file IWireSelectors.cxx.

wire_selector WireCell::select_uvw_wires
Initial value:
= {
}
wire_selector select_u_wires
wire_selector select_w_wires
wire_selector select_v_wires

Definition at line 10 of file IWireSelectors.cxx.

wire_selector WireCell::select_v_wires = WirePlaneSelector(kVlayer, 0, 0)

Definition at line 8 of file IWireSelectors.cxx.

wire_selector WireCell::select_w_wires = WirePlaneSelector(kWlayer, 0, 0)

Definition at line 9 of file IWireSelectors.cxx.