PAASS
Software suite to Acquire and Analyze Data from Pixie16
DetectorDriver Class Reference

DetectorDriver controls event processing. More...

#include <DetectorDriver.hpp>

Collaboration diagram for DetectorDriver:

Public Member Functions

virtual void plot (int dammId, double val1, double val2=-1, double val3=-1, const char *name="h")
 Plots into histogram defined by dammId. More...
 
void ProcessEvent (RawEvent &rawev)
 Control of the event processing. More...
 
int ThreshAndCal (ChanEvent *chan, RawEvent &rawev)
 Check threshold and calibrate each channel. Check the thresholds and calibrate the energy for each channel using the calibrations contained in the calibration vector filled during ReadCal() More...
 
void Init (RawEvent &rawev)
 
int PlotRaw (const ChanEvent *chan)
 
int PlotCal (const ChanEvent *)
 
void DeclarePlots ()
 
void SanityCheck (void) const
 
void CorrelateClock (double d, time_t t)
 
time_t GetWallTime (double d) const
 
const std::vector< EventProcessor * > & GetProcessors (void) const
 
EventProcessorGetProcessor (const std::string &name) const
 
const std::set< std::string > & GetUsedDetectors (void) const
 
virtual ~DetectorDriver ()
 

Static Public Member Functions

static DetectorDriverget ()
 

Data Fields

WalkCorrector walk
 Instance of the walk correction. More...
 
Calibrator cali
 Instance of the calibrator. More...
 
Plots histo
 Instance of the histogram class. More...
 

Private Member Functions

 DetectorDriver ()
 
 DetectorDriver (const DetectorDriver &)
 Overloaded constructor. More...
 
DetectorDriveroperator= (DetectorDriver const &)
 Equality constructor. More...
 
virtual void DeclareHistogram1D (int dammId, int xSize, const char *title)
 
virtual void DeclareHistogram2D (int dammId, int xSize, int ySize, const char *title)
 Declares a 2D histogram calls the C++ wrapper for DAMM. More...
 
void LoadProcessors (Messenger &m)
 
void ReadCalXml ()
 
void ReadWalkXml ()
 

Private Attributes

std::vector< EventProcessor * > vecProcess
 
std::vector< TraceAnalyzer * > vecAnalyzer
 
std::set< std::string > knownDetectors
 
std::string cfg_
 The configuration file to read. More...
 
std::pair< double, time_t > pixieToWallClock
 

Static Private Attributes

static DetectorDriverinstance = NULL
 The only instance of DetectorDriver. More...
 

Detailed Description

DetectorDriver controls event processing.

This class controls the processing of each event and includes the calibration of all raw energies, the plotting of raw and calibrated energies, and any experiment specific processing requirements

Definition at line 59 of file DetectorDriver.hpp.

Constructor & Destructor Documentation

§ ~DetectorDriver()

DetectorDriver::~DetectorDriver ( )
virtual

Default Destructor - Not called due to singleton nature

Definition at line 102 of file DetectorDriver.cpp.

Here is the caller graph for this function:

§ DetectorDriver() [1/2]

DetectorDriver::DetectorDriver ( )
private

Constructor that initializes the various processors and analyzers.

Any exception in registering plots in Processors and possible other exceptions in creating Processors will be intercepted here

Definition at line 81 of file DetectorDriver.cpp.

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

§ DetectorDriver() [2/2]

DetectorDriver::DetectorDriver ( const DetectorDriver )
private

Overloaded constructor.

Member Function Documentation

§ CorrelateClock()

void DetectorDriver::CorrelateClock ( double  d,
time_t  t 
)
inline

Correlates the pixie clock to the wall clock

Parameters
[in]d: the pixie time to correlate
[in]t: the wall time to correlate

Definition at line 131 of file DetectorDriver.hpp.

§ DeclareHistogram1D()

virtual void DetectorDriver::DeclareHistogram1D ( int  dammId,
int  xSize,
const char *  title 
)
inlineprivatevirtual

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

Definition at line 178 of file DetectorDriver.hpp.

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

§ DeclareHistogram2D()

virtual void DetectorDriver::DeclareHistogram2D ( int  dammId,
int  xSize,
int  ySize,
const char *  title 
)
inlineprivatevirtual

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

Definition at line 187 of file DetectorDriver.hpp.

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

§ DeclarePlots()

void DetectorDriver::DeclarePlots ( void  )

Declares the raw plots that are used, and loops over all the declare plots methods in all of the analyzers and processors.

Declare some of the raw and basic plots that are going to be used in the analysis of the data. These include raw and calibrated energy spectra, information about the run time, and count rates on the detectors. This also calls the DeclarePlots method that is present in all of the Analyzers and Processors.

Definition at line 396 of file DetectorDriver.cpp.

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

§ get()

DetectorDriver * DetectorDriver::get ( )
static
Returns
Instance is created upon first call

Definition at line 75 of file DetectorDriver.cpp.

Here is the caller graph for this function:

§ GetProcessor()

EventProcessor * DetectorDriver::GetProcessor ( const std::string &  name) const
Returns
The requested event processor
Parameters
[in]name: the name of the processor to return

Definition at line 569 of file DetectorDriver.cpp.

Here is the caller graph for this function:

§ GetProcessors()

const std::vector<EventProcessor *>& DetectorDriver::GetProcessors ( void  ) const
inline
Returns
the list of the Event Processors in the analysis

Definition at line 144 of file DetectorDriver.hpp.

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

§ GetUsedDetectors()

const std::set<std::string>& DetectorDriver::GetUsedDetectors ( void  ) const
Returns
the set of detectors used in the analysis
Here is the caller graph for this function:

§ GetWallTime()

time_t DetectorDriver::GetWallTime ( double  d) const
inline
Returns
The wall time
Parameters
[in]d: the pixie time to convert to wall time

Definition at line 137 of file DetectorDriver.hpp.

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

§ Init()

void DetectorDriver::Init ( RawEvent rawev)

Called from PixieStd.cpp during initialization. The calibration file Config.xml is read using the function ReadCal() and checked to make sure that all channels have a calibration.

Parameters
[in]rawev: the raw event to initialize with

Any exception in reading calibration and walk correction will be intercepted here

Definition at line 304 of file DetectorDriver.cpp.

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

§ LoadProcessors()

void DetectorDriver::LoadProcessors ( Messenger m)
private

Load the processors from the XML file

Parameters
[in]m: the messenger to pass the loading messages through

Definition at line 115 of file DetectorDriver.cpp.

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

§ operator=()

DetectorDriver& DetectorDriver::operator= ( DetectorDriver const &  )
private

Equality constructor.

Here is the caller graph for this function:

§ plot()

virtual void DetectorDriver::plot ( int  dammId,
double  val1,
double  val2 = -1,
double  val3 = -1,
const char *  name = "h" 
)
inlinevirtual

Plots into histogram defined by dammId.

Parameters
[in]dammId: The histogram number to define
[in]val1: the x value
[in]val2: the y value
[in]val3: the z value
[in]name: the name of the histogram

Definition at line 74 of file DetectorDriver.hpp.

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

§ PlotCal()

int DetectorDriver::PlotCal ( const ChanEvent chan)

Plot the calibrated energies of each channel into the damm spectrum number assigned to it in the map file with an offset as defined in DammPlotIds.hpp

Returns
an unused integer maybe use void

Definition at line 564 of file DetectorDriver.cpp.

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

§ PlotRaw()

int DetectorDriver::PlotRaw ( const ChanEvent chan)

Plot the raw energies of each channel into the damm spectrum number assigned to it in the map file with an offset as defined in DammPlotIds.hpp

Parameters
[in]chan: the channel to plot
Returns
an unused integer maybe use void

Definition at line 559 of file DetectorDriver.cpp.

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

§ ProcessEvent()

void DetectorDriver::ProcessEvent ( RawEvent rawev)

Control of the event processing.

The ProcessEvent() function is called from ScanList() in PixieStd.cpp after an event has been constructed. This function is passed the mode the analysis is currently in (the options are either "scan" or "standaloneroot"). The function checks the thresholds for the individual channels in the event and calibrates their energies. The raw and calibrated energies are plotted if the appropriate DAMM spectra have been created. Then experiment specific processing is performed. Currently, both RMS and MTC processing is available. After all processing has occured, appropriate plotting routines are called.

Parameters
[in]rawev: the raw event to process

First round is preprocessing, where process result must be guaranteed to not to be dependent on results of other Processors.

In the second round the Process is called, which may depend on other Processors.

Any exception in activation of basic places, PreProcess and Process will be intercepted here

Definition at line 334 of file DetectorDriver.cpp.

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

§ ReadCalXml()

void DetectorDriver::ReadCalXml ( )
private

Read in the Calibration parameters from the Config.xml

Note that before this reading in of the xml file, it was already processed for the purpose of creating the channels map. Some sanity checks (module and channel number) were done there so they are not repeated here/

Definition at line 578 of file DetectorDriver.cpp.

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

§ ReadWalkXml()

void DetectorDriver::ReadWalkXml ( )
private

Read in the Walk correction parameters from the Config.xml

See comment in the similiar place at ReadCalXml()

Definition at line 650 of file DetectorDriver.cpp.

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

§ SanityCheck()

void DetectorDriver::SanityCheck ( void  ) const
inline

Use Exceptions to throw an exception here if sanity check was not succesful

Definition at line 126 of file DetectorDriver.hpp.

Here is the caller graph for this function:

§ ThreshAndCal()

int DetectorDriver::ThreshAndCal ( ChanEvent chan,
RawEvent rawev 
)

Check threshold and calibrate each channel. Check the thresholds and calibrate the energy for each channel using the calibrations contained in the calibration vector filled during ReadCal()

Parameters
[in]chan: the channel to do the calibration on
[in]rawev: the raw event to write the information into
Returns
an unused integer (maybe change to void)

Calibrate pulses numbered 2 and forth, add filterEnergyXCal to the trace

otherwise, use the Pixie on-board calculated energy add a random number to convert an integer value to a uniformly distributed floating point

Calibrate energy and apply the walk correction.

Definition at line 460 of file DetectorDriver.cpp.

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

Field Documentation

§ cali

Calibrator DetectorDriver::cali

Instance of the calibrator.

Definition at line 65 of file DetectorDriver.hpp.

§ cfg_

std::string DetectorDriver::cfg_
private

The configuration file to read.

Definition at line 170 of file DetectorDriver.hpp.

§ histo

Plots DetectorDriver::histo

Instance of the histogram class.

Definition at line 66 of file DetectorDriver.hpp.

§ instance

DetectorDriver * DetectorDriver::instance = NULL
staticprivate

The only instance of DetectorDriver.

Definition at line 162 of file DetectorDriver.hpp.

§ knownDetectors

std::set<std::string> DetectorDriver::knownDetectors
private

list of valid detectors that can be used as detector types

Definition at line 168 of file DetectorDriver.hpp.

§ pixieToWallClock

std::pair<double, time_t> DetectorDriver::pixieToWallClock
private

rough estimate of pixie to wall clock

Definition at line 171 of file DetectorDriver.hpp.

§ vecAnalyzer

std::vector<TraceAnalyzer*> DetectorDriver::vecAnalyzer
private

object which analyzes traces of channels to extract energy and time information

Definition at line 166 of file DetectorDriver.hpp.

§ vecProcess

std::vector<EventProcessor*> DetectorDriver::vecProcess
private

vector of processors to handle each event

Definition at line 164 of file DetectorDriver.hpp.

§ walk

WalkCorrector DetectorDriver::walk

Instance of the walk correction.

Definition at line 64 of file DetectorDriver.hpp.


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