ToolDAQFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
Calibrate Class Reference

#include <Calibrate.h>

Inheritance diagram for Calibrate:

Classes

struct  calibrationData
 Calibration data format for use at run time. More...
 

Public Member Functions

 Calibrate ()
 Constructor. Sets validCalibrationDataFound false. More...
 
bool Execute ()
 Applly the calibration to the contents of m_data . Calls ApplyCalibration to do the work. More...
 
bool Finalise ()
 Clean up resources. More...
 
bool Initialise (std::string configfile, DataModel &data)
 

Static Public Attributes

static bool validCalibrationDataFound =false
 Remember whether a valid calibration data file has been read in or not. More...
 

Private Types

enum  LogLevel {
  FATAL =-1, ERROR =0, WARN =1, INFO =2,
  DEBUG1 =3, DEBUG2 =4, DEBUG3 =5
}
 Log level enumerations. More...
 
typedef int PMTChannelID
 

Private Member Functions

void ApplyCalibration (std::vector< SubSample > &samples)
 
void ApplyCalibration (const int &PMTid, float &charge, TimeDelta::short_time_t &time, bool &masked)
 
void DumpHit (const int &PMTid, float &charge, TimeDelta::short_time_t &time, bool &masked)
 
void DumpHits (std::vector< SubSample > &samples)
 
void readCalibration (std::string calibrationFileName)
 
void StreamToLog (int level)
 

Private Attributes

std::map< PMTChannelID,
calibrationData
calibrationInformation
 Calibration data store. More...
 
std::string m_calibration_file_name {""}
 File name for file containg calibration information. More...
 
std::stringstream m_ss
 For easy formatting of Log messages. More...
 
util::Stopwatchm_stopwatch
 The stopwatch, if we're using one. More...
 
std::string m_stopwatch_file_name {""}
 Image filename to save the histogram to, if required. More...
 
int m_verbose {ERROR}
 Verbosity level, as defined in tool parameter file. More...
 

Detailed Description

A tool for applying calibration to data. Currently can either mark a PMT channel as no to be used, or apply a scaling factor to the charge.

Author:
A. Finch
Date:
2020/11/13 12:22

Contact: A.Fin.nosp@m.ch@l.nosp@m.ancas.nosp@m.ter..nosp@m.ac.uk

Definition at line 23 of file Calibrate.h.

Member Typedef Documentation

typedef int Calibrate::PMTChannelID
private

Definition at line 92 of file Calibrate.h.

Member Enumeration Documentation

enum Calibrate::LogLevel
private

Log level enumerations.

Enumerator
FATAL 
ERROR 
WARN 
INFO 
DEBUG1 
DEBUG2 
DEBUG3 

Definition at line 72 of file Calibrate.h.

Constructor & Destructor Documentation

Calibrate::Calibrate ( )

Constructor. Sets validCalibrationDataFound false.

Definition at line 5 of file Calibrate.cpp.

Member Function Documentation

void Calibrate::ApplyCalibration ( std::vector< SubSample > &  samples)
private

Apply calibration to data to a sample of hits

Parameters
[in]samplesa std::vector of SubSamples to calibrate

Definition at line 72 of file Calibrate.cpp.

void Calibrate::ApplyCalibration ( const int &  PMTid,
float &  charge,
TimeDelta::short_time_t time,
bool &  masked 
)
private

Calibrate an individual hit. The parameters charge, time and masked are set and returned.

Parameters
[in]PMTidAn integer identifying an individual PMT
[in,out]chargeThe charge measured by the PMT
[in,out]timeThe time measured by the PMT
[in,out]maskedA mask to turn the PMT on or off

Definition at line 59 of file Calibrate.cpp.

void Calibrate::DumpHit ( const int &  PMTid,
float &  charge,
TimeDelta::short_time_t time,
bool &  masked 
)
private

Print out contents of one hit

Parameters
[in]PMTidAn integer identifying an individual PMT
[in]chargeThe charge measured by the PMT
[in]timeThe time measured by the PMT
[in]maskedA mask to turn the PMT on or off

Definition at line 171 of file Calibrate.cpp.

void Calibrate::DumpHits ( std::vector< SubSample > &  samples)
private

Dump contents of sample of hits

Parameters
[in]samplesa std::vector of SubSample to calibrate

Definition at line 153 of file Calibrate.cpp.

bool Calibrate::Execute ( )

Applly the calibration to the contents of m_data . Calls ApplyCalibration to do the work.

Definition at line 24 of file Calibrate.cpp.

bool Calibrate::Finalise ( )

Clean up resources.

Definition at line 46 of file Calibrate.cpp.

bool Calibrate::Initialise ( std::string  configfile,
DataModel data 
)

Function for setting up Tool resources. Calls readCalibration function to read in calibration constants.

Parameters
configfile[in]The pathname of the dynamic configuration file to read in.
data[in]A reference to the transient data class used to pass information between Tools.

Definition at line 6 of file Calibrate.cpp.

void Calibrate::readCalibration ( std::string  calibrationFileName)
private

Read in the calibration data

Parameters
[in]calibrationFileNameThe name of a file containing calibration data

Definition at line 92 of file Calibrate.cpp.

void Calibrate::StreamToLog ( int  level)
inlineprivate

Print the current value of the streamer at the set log level, then clear the streamer

Definition at line 82 of file Calibrate.h.

Member Data Documentation

std::map<PMTChannelID,calibrationData> Calibrate::calibrationInformation
private

Calibration data store.

Definition at line 94 of file Calibrate.h.

std::string Calibrate::m_calibration_file_name {""}
private

File name for file containg calibration information.

Definition at line 69 of file Calibrate.h.

std::stringstream Calibrate::m_ss
private

For easy formatting of Log messages.

Definition at line 78 of file Calibrate.h.

util::Stopwatch* Calibrate::m_stopwatch
private

The stopwatch, if we're using one.

Definition at line 65 of file Calibrate.h.

std::string Calibrate::m_stopwatch_file_name {""}
private

Image filename to save the histogram to, if required.

Definition at line 67 of file Calibrate.h.

int Calibrate::m_verbose {ERROR}
private

Verbosity level, as defined in tool parameter file.

Definition at line 75 of file Calibrate.h.

bool Calibrate::validCalibrationDataFound =false
static

Remember whether a valid calibration data file has been read in or not.

Definition at line 29 of file Calibrate.h.


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