Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
Trace Class Reference

Store the information for a trace. More...

#include <Trace.hpp>

Inheritance diagram for Trace:
Collaboration diagram for Trace:

Public Member Functions

 Trace ()
 
 Trace (const std::vector< int > &x)
 
void TrapezoidalFilter (Trace &filter, const TFP &parms, unsigned int lo=0) const
 
void TrapezoidalFilter (Trace &filter, const TFP &parms, unsigned int lo, unsigned int hi) const
 
void InsertValue (std::string name, double value)
 
void InsertValue (std::string name, int value)
 
void SetValue (std::string name, double value)
 
void SetValue (std::string name, int value)
 
bool HasValue (std::string name) const
 
double GetValue (std::string name) const
 
std::vector< double > GetWaveform ()
 
double DoBaseline (unsigned int lo=0, unsigned int numBins=numBinsBaseline)
 
double DoDiscrimination (unsigned int lo, unsigned int numBins)
 
double DoQDC (unsigned int lo, unsigned int numBins)
 
unsigned int FindMaxInfo (unsigned int lo=5, unsigned int hi=10, unsigned int numBins=15)
 
virtual void DeclareHistogram1D (int dammId, int xSize, const char *title)
 Declares a 1D histogram calls the C++ wrapper for DAMM. More...
 
virtual void DeclareHistogram2D (int dammId, int xSize, int ySize, const char *title)
 Declares a 2D histogram calls the C++ wrapper for DAMM. More...
 
virtual void plot (int dammId, double val1, double val2=-1, double val3=-1, const char *name="h") const
 Implementation of the plot command to interface with the DAMM routines. More...
 
void Plot (int id)
 
void Plot (int id, int row)
 
void ScalePlot (int id, double scale)
 
void ScalePlot (int id, int row, double scale)
 
void OffsetPlot (int id, double offset)
 
void OffsetPlot (int id, int row, double offset)
 

Private Attributes

unsigned int baselineLow
 low range for the baseline
 
unsigned int baselineHigh
 high range for the baseline
 
std::vector< double > waveform
 The waveform inside the trace.
 
std::map< std::string, double > doubleTraceData
 Trace data stored as doubles.
 
std::map< std::string, int > intTraceData
 Trace data stored as ints.
 

Static Private Attributes

static const unsigned int numBinsBaseline = 15
 Number of bins in the baseline.
 
static Plots histo
 

Detailed Description

Store the information for a trace.

Constructor & Destructor Documentation

Trace::Trace ( )
inline

Default constructor

Trace::Trace ( const std::vector< int > &  x)
inline

An automatic conversion for the trace

Parameters
[in]x: the trace to store in the class

Member Function Documentation

virtual void Trace::DeclareHistogram1D ( int  dammId,
int  xSize,
const char *  title 
)
inlinevirtual

Declares a 1D histogram calls the C++ wrapper for DAMM.

Parameters
[in]dammId: The histogram number to define
[in]xSize: The range of the x-axis
[in]title: The title for the histogram
virtual void Trace::DeclareHistogram2D ( int  dammId,
int  xSize,
int  ySize,
const char *  title 
)
inlinevirtual

Declares a 2D histogram calls the C++ wrapper for DAMM.

Parameters
[in]dammId: The histogram number to define
[in]xSize: The range of the x-axis
[in]ySize: The range of the y-axis
[in]title: The title of the histogram
double Trace::DoBaseline ( unsigned int  lo = 0,
unsigned int  numBins = numBinsBaseline 
)

Performs the baseline calculation

Parameters
[in]lo: the low range for the baseline calculation
[in]numBins: The number of bins for the baseline calculation
Returns
The average value of the baseline in the region
double Trace::DoDiscrimination ( unsigned int  lo,
unsigned int  numBins 
)

Performs the neutron-gamma discrimination on the traces

Parameters
[in]lo: The low range for the discrimination (referenced from max)
[in]numBins: the number of bins to calculate the baseline over
Returns
The discrimination value
double Trace::DoQDC ( unsigned int  lo,
unsigned int  numBins 
)

Calculate the waveform and QDC for the trace

Parameters
[in]lo: the lo value to for the QDC
[in]numBins: the number of bins to calculate the QDC over
Returns
The QDC for the waveform
unsigned int Trace::FindMaxInfo ( unsigned int  lo = 5,
unsigned int  hi = 10,
unsigned int  numBins = 15 
)

Calculate information for the maximum value of the trace

Parameters
[in]lo: the low side of the waveform
[in]hi: the high side of the waveform
[in]numBins: the number of bins to look for the max in
Returns
The position of the maximum value in the trace
double Trace::GetValue ( std::string  name) const
inline

Returns the value of the requested parameter

Parameters
[in]name: the name of the parameter to get for
Returns
the requested value
std::vector<double> Trace::GetWaveform ( )
inline
Returns
Returns the waveform found inside the trace
bool Trace::HasValue ( std::string  name) const
inline

Checks to see if a parameter has a value

Parameters
[in]name: the name of the parameter to check for
Returns
true if the value exists in the trace
void Trace::InsertValue ( std::string  name,
double  value 
)
inline

Insert a value into the trace map

Parameters
[in]name: the name of the parameter to insert
[in]value: the value to insert into the map
void Trace::InsertValue ( std::string  name,
int  value 
)
inline

Insert an int value into the trace

Parameters
[in]name: the name of the variable to insert
[in]value: The integer value to insert into the map
void Trace::OffsetPlot ( int  id,
double  offset 
)

plot trace with a vertical offset in a 1D histogram

Parameters
[in]id: histogram ID to plot into
[in]offset: the offset for the trace
void Trace::OffsetPlot ( int  id,
int  row,
double  offset 
)

plot trace with a vertical offset in a 2D histogram

Parameters
[in]id: histogram ID to plot into
[in]row: the row to plot the trace into
[in]offset: the offset for the trace
virtual void Trace::plot ( int  dammId,
double  val1,
double  val2 = -1,
double  val3 = -1,
const char *  name = "h" 
) const
inlinevirtual

Implementation of the plot command to interface with the DAMM routines.

This is also done in the EventProcessor class, redundant?

Parameters
[in]dammId: The histogram number to plot into
[in]val1: The x value to plot
[in]val2: The y value to plot (if 2D histogram)
[in]val3: The z value to plot (if 2D histogram)
[in]name: The name of the histogram
void Trace::Plot ( int  id)

plot trace into a 1D histogram

Parameters
[in]id: histogram ID to plot into
void Trace::Plot ( int  id,
int  row 
)

plot trace into row of a 2D histogram

Parameters
[in]id: histogram ID to plot into
[in]row: the row to plot into
void Trace::ScalePlot ( int  id,
double  scale 
)

plot trace absolute value and scaled into a 1D histogram

Parameters
[in]id: histogram ID to plot into
[in]scale: the scaling for the trace
void Trace::ScalePlot ( int  id,
int  row,
double  scale 
)

plot trace absolute value and scaled into a 2D histogram

Parameters
[in]id: histogram ID to plot into
[in]row: the row to plot the histogram into
[in]scale: the scaling for the trace
void Trace::SetValue ( std::string  name,
double  value 
)
inline

Set the double value of a parameter in the trace

Parameters
[in]name: the name of the parameter to set
[in]value: the double value to set the parameter to
void Trace::SetValue ( std::string  name,
int  value 
)
inline

Set the integer value of a parameter in the trace

Parameters
[in]name: the name of the parameter to set
[in]value: the int value to set the parameter to
void Trace::TrapezoidalFilter ( Trace filter,
const TFP &  parms,
unsigned int  lo = 0 
) const
inline

calculation of the trapezoidal filter

Parameters
[in]filter: the filter for the trace
[in]parms: the parameters for the filter
[in]lo: the low range for the filter
void Trace::TrapezoidalFilter ( Trace filter,
const TFP &  parms,
unsigned int  lo,
unsigned int  hi 
) const

Defines how to implement a trapezoidal filter characterized by two moving sum windows of width risetime separated by a length gaptime. Filter is calculated from channels lo to hi.

Parameters
[in]filter: the filter for the trace
[in]parms: the parameters for the filter
[in]lo: the low range for the filter
[in]hi: the high range for the filter

Field Documentation

Plots Trace::histo
staticprivate

This field is static so all instances of Trace class have access to the same plots and plots range.


The documentation for this class was generated from the following file: