REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
Public Member Functions | Private Attributes
TRestResponse Class Reference

Detailed Description

A response matrix that might be applied to a given component inside a TRestComponent.

Documentation TOBE written


REST-for-Physics - Software for Rare Event Searches Toolkit

History of developments:

2023-December: First implementation of TRestResponse Javier Galan

Author
: Javier Galan (javie.nosp@m.r.ga.nosp@m.lan.l.nosp@m.acar.nosp@m.ra@ce.nosp@m.rn.c.nosp@m.h)

Definition at line 29 of file TRestResponse.h.

#include <TRestResponse.h>

Inheritance diagram for TRestResponse:
TRestMetadata

Public Member Functions

Bool_t ApplyInterpolation ()
 
 ClassDefOverride (TRestResponse, 1)
 
Double_t GetBinSize () const
 
TVector2 GetInputRange () const
 
std::vector< std::vector< Float_t > > GetMatrix () const
 
TVector2 GetOrigin () const
 
TVector2 GetOutputRange () const
 
std::vector< std::pair< Double_t, Double_t > > GetResponse (Double_t input)
 This method will return a vector of std::pair, each pair will contain the output energy together with the corresponding response (or efficiency), for the given input energy. More...
 
std::string GetResponseFilename () const
 
std::string GetVariable () const
 
void Initialize () override
 It will initialize the data frame with the filelist and column names (or observables) that have been defined by the user.
 
void Interpolate (Bool_t interpolate=true)
 
void LoadResponse (Bool_t transpose=true)
 It loads into the fResponseMatrix data member the response from a file. More...
 
void PrintMetadata () override
 Prints on screen the information about the metadata members of TRestAxionSolarFlux.
 
void PrintResponseMatrix (Int_t fromRow, Int_t toRow)
 Prints on screen the information about the metadata members of TRestAxionSolarFlux.
 
void SetBinSize (Double_t bSize)
 
void SetOrigin (const TVector2 &v)
 
void SetResponseFilename (std::string responseFile)
 
void SetVariable (const std::string &var)
 
 TRestResponse ()
 Default constructor.
 
 TRestResponse (const char *cfgFileName, const std::string &name="")
 Constructor loading data from a config file. More...
 
 ~TRestResponse ()
 Default destructor.
 

Private Attributes

Double_t fBinSize = 0.1
 The resolution of the response matrix (binning)
 
std::string fFilename = ""
 The filename used to import the response matrix.
 
Bool_t fInterpolation = false
 It allows to decide if the returned response should be interpolated (default:false)
 
TVector2 fOrigin = TVector2(0, 0)
 First element of the response matrix (input/incident, output/detected)
 
std::vector< std::vector< Float_t > > fResponseMatrix
 The response matrix.
 
Bool_t fTransposed = false
 Determines if the response matrix has been transposed.
 
std::string fVariable = ""
 It defines the variable name for which the response should be applied to.
 

Additional Inherited Members

Constructor & Destructor Documentation

◆ TRestResponse()

TRestResponse::TRestResponse ( const char *  cfgFileName,
const std::string &  name = "" 
)

Constructor loading data from a config file.

If no configuration path is defined using TRestMetadata::SetConfigFilePath the path to the config file must be specified using full path, absolute or relative.

The default behaviour is that the config file must be specified with full path, absolute or relative.

Parameters
cfgFileNameA const char* giving the path to an RML file.
nameThe name of the specific metadata. It will be used to find the corresponding TRestAxionMagneticField section inside the RML.

Definition at line 64 of file TRestResponse.cxx.

Member Function Documentation

◆ GetResponse()

std::vector< std::pair< Double_t, Double_t > > TRestResponse::GetResponse ( Double_t  input)

This method will return a vector of std::pair, each pair will contain the output energy together with the corresponding response (or efficiency), for the given input energy.

The output value will be mapped following the binning and the origin given on the metadata members.

Definition at line 140 of file TRestResponse.cxx.

◆ LoadResponse()

void TRestResponse::LoadResponse ( Bool_t  transpose = true)

It loads into the fResponseMatrix data member the response from a file.

For the moment only binary data files with format .N???f have been implemented.

The response file should be arranged in a way that the more internal std::vector (row) inside the std::vector <std::vector> table corresponds to a specific transformed energy (output). For example, if we have the incident particle energy (input) and the expected detected energy response (output) for that energy, then each row in the matrix corresponds to a detected energy and each element of that row defines the fraction of incident energies that contributed to that detected energy.

Thats why we may need to transpose the matrix, so that when we can extract a row (detected energy) from the matrix directly, such as fMatrix[n], and we just get the vector that should convolute with the Signal(Ei) that is a vector of signals as a function of incident energy. The resulting scalar product will give the expected signal at the detection energy.

Definition at line 102 of file TRestResponse.cxx.


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