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

Detailed Description

It combines a number of experimental conditions allowing to calculate a combined experimental sensitivity.

Documentation TOBE written


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

History of developments:

2022-December: First implementation of TRestSensitivity 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 TRestSensitivity.h.

#include <TRestSensitivity.h>

Inheritance diagram for TRestSensitivity:
TRestMetadata

Public Member Functions

void AddCurve (const std::vector< Double_t > &curve)
 
 ClassDefOverride (TRestSensitivity, 2)
 
TCanvas * DrawCurves ()
 
TCanvas * DrawLevelCurves ()
 
void ExportAveragedCurve (std::string fname, Double_t factor=1.e-10, Double_t power=0.25)
 
void ExportCurve (std::string fname, Double_t factor=1.e-10, Double_t power=0.25, int n=0)
 
void ExtractExperimentParameterizationNodes (Bool_t rescan=false)
 It scans all the experiment signals parametric nodes to build a complete list of nodes used to build a complete sensitivity curve. Some experiments may be sensitivy to a particular node, while others may be sensitivy to another. If more than one experiment is sensitivy to a given node, the sensitivity will be combined later on. More...
 
void Freeze ()
 
void GenerateCurve ()
 
void GenerateCurves (Int_t N)
 
std::vector< Double_t > GetAveragedCurve ()
 
Double_t GetCoupling (Double_t node, Double_t sigma=2, Double_t precision=0.01)
 It will return the coupling value for which Chi=sigma. More...
 
std::vector< Double_t > GetCurve (size_t n=0)
 
TRestExperimentGetExperiment (const size_t &n)
 
std::vector< TRestExperiment * > GetExperiments ()
 
std::vector< std::vector< Double_t > > GetLevelCurves (const std::vector< Double_t > &levels)
 This method is used to obtain the list of curves that satisfy that each value inside the curve is placed at a specified level. E.g. if we provide a level 0.5, then the corresponding curve will be constructed with the central value extracted at each parameter point. More...
 
size_t GetNumberOfCurves ()
 
size_t GetNumberOfExperiments ()
 
size_t GetNumberOfNodes ()
 
std::vector< Double_t > GetParameterizationNodes ()
 
void ImportCurve (const std::vector< Double_t > &curve)
 
void Initialize () override
 It will initialize the data frame with the filelist and column names (or observables) that have been defined by the user. More...
 
void PrintMetadata () override
 Prints on screen the information about the metadata members of TRestAxionSolarFlux. More...
 
void PrintParameterizationNodes ()
 
TH1D * SignalStatisticalTest (Double_t node, Int_t N)
 
 TRestSensitivity ()
 Default constructor. More...
 
 TRestSensitivity (const char *cfgFileName, const std::string &name="")
 Constructor loading data from a config file. More...
 
 ~TRestSensitivity ()
 Default destructor. More...
 

Protected Member Functions

Double_t ApproachByFactor (Double_t node, Double_t g4, Double_t chi0, Double_t target, Double_t factor)
 It will return a value of the coupling, g4, such that (chi-chi0) gets closer to the target value given by argument. The factor will be used to increase or decrease the coupling, and evaluate the likelihood. More...
 
void InitFromConfigFile () override
 It customizes the retrieval of XML data values of this class. More...
 
Double_t UnbinnedLogLikelihood (const TRestExperiment *experiment, Double_t node, Double_t g4=0)
 It returns the Log(L) for the experiment and coupling given by argument. More...
 

Private Attributes

TCanvas * fCanvas = nullptr
 A canvas to draw. More...
 
std::vector< std::vector< Double_t > > fCurves
 A vector of calculated sensitivity curves defined as a funtion of the parametric node. More...
 
std::vector< TRestExperiment * > fExperiments
 A list of experimental conditions included to get a final sensitivity plot. More...
 
Bool_t fFrozen = false
 A flag that will frozen adding more experiments in the future. More...
 
std::vector< Double_t > fParameterizationNodes
 The fusioned list of parameterization nodes found at each experiment signal. More...
 
TH1D * fSignalTest = nullptr
 It is used to generate a histogram with the signal distribution produced with different signal samples. More...
 

Additional Inherited Members

Constructor & Destructor Documentation

◆ TRestSensitivity() [1/2]

TRestSensitivity::TRestSensitivity ( 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 70 of file TRestSensitivity.cxx.

◆ TRestSensitivity() [2/2]

TRestSensitivity::TRestSensitivity ( )

Default constructor.

Definition at line 49 of file TRestSensitivity.cxx.

◆ ~TRestSensitivity()

TRestSensitivity::~TRestSensitivity ( )

Default destructor.

Definition at line 54 of file TRestSensitivity.cxx.

Member Function Documentation

◆ AddCurve()

void TRestSensitivity::AddCurve ( const std::vector< Double_t > &  curve)
inline

Definition at line 63 of file TRestSensitivity.h.

◆ ApproachByFactor()

Double_t TRestSensitivity::ApproachByFactor ( Double_t  node,
Double_t  g4,
Double_t  chi0,
Double_t  target,
Double_t  factor 
)
protected

It will return a value of the coupling, g4, such that (chi-chi0) gets closer to the target value given by argument. The factor will be used to increase or decrease the coupling, and evaluate the likelihood.

Coarse movement to get to Chi2 above target

Coarse movement to get to Chi2 below target (/2)

Definition at line 86 of file TRestSensitivity.cxx.

◆ DrawCurves()

TCanvas * TRestSensitivity::DrawCurves ( )

Definition at line 413 of file TRestSensitivity.cxx.

◆ DrawLevelCurves()

TCanvas * TRestSensitivity::DrawLevelCurves ( )

Definition at line 494 of file TRestSensitivity.cxx.

◆ ExportAveragedCurve()

void TRestSensitivity::ExportAveragedCurve ( std::string  fname,
Double_t  factor = 1.e-10,
Double_t  power = 0.25 
)

Definition at line 171 of file TRestSensitivity.cxx.

◆ ExportCurve()

void TRestSensitivity::ExportCurve ( std::string  fname,
Double_t  factor = 1.e-10,
Double_t  power = 0.25,
int  n = 0 
)

Definition at line 203 of file TRestSensitivity.cxx.

◆ ExtractExperimentParameterizationNodes()

void TRestSensitivity::ExtractExperimentParameterizationNodes ( Bool_t  rescan = false)

It scans all the experiment signals parametric nodes to build a complete list of nodes used to build a complete sensitivity curve. Some experiments may be sensitivy to a particular node, while others may be sensitivy to another. If more than one experiment is sensitivy to a given node, the sensitivity will be combined later on.

Definition at line 587 of file TRestSensitivity.cxx.

◆ Freeze()

void TRestSensitivity::Freeze ( )
inline

Definition at line 77 of file TRestSensitivity.h.

◆ GenerateCurve()

void TRestSensitivity::GenerateCurve ( )

Definition at line 113 of file TRestSensitivity.cxx.

◆ GenerateCurves()

void TRestSensitivity::GenerateCurves ( Int_t  N)

Definition at line 133 of file TRestSensitivity.cxx.

◆ GetAveragedCurve()

std::vector< Double_t > TRestSensitivity::GetAveragedCurve ( )

Definition at line 153 of file TRestSensitivity.cxx.

◆ GetCoupling()

Double_t TRestSensitivity::GetCoupling ( Double_t  node,
Double_t  sigma = 2,
Double_t  precision = 0.01 
)

It will return the coupling value for which Chi=sigma.

Definition at line 236 of file TRestSensitivity.cxx.

◆ GetCurve()

std::vector< Double_t > TRestSensitivity::GetCurve ( size_t  n = 0)

Definition at line 144 of file TRestSensitivity.cxx.

◆ GetExperiment()

TRestExperiment * TRestSensitivity::GetExperiment ( const size_t &  n)
inline

Definition at line 80 of file TRestSensitivity.h.

◆ GetExperiments()

std::vector< TRestExperiment * > TRestSensitivity::GetExperiments ( )
inline

Definition at line 79 of file TRestSensitivity.h.

◆ GetLevelCurves()

std::vector< std::vector< Double_t > > TRestSensitivity::GetLevelCurves ( const std::vector< Double_t > &  levels)

This method is used to obtain the list of curves that satisfy that each value inside the curve is placed at a specified level. E.g. if we provide a level 0.5, then the corresponding curve will be constructed with the central value extracted at each parameter point.

We may then construct the profile of the sensitivity curves at 98%, 95% and 68% C.L. as follows:

TRestSensitivity::GetLevelCurves( {0.01, 0.025, 0.16, 0.84, 0.975, 0.99} );
std::vector< std::vector< Double_t > > GetLevelCurves(const std::vector< Double_t > &levels)
This method is used to obtain the list of curves that satisfy that each value inside the curve is pla...

Definition at line 382 of file TRestSensitivity.cxx.

◆ GetNumberOfCurves()

size_t TRestSensitivity::GetNumberOfCurves ( )
inline

Definition at line 88 of file TRestSensitivity.h.

◆ GetNumberOfExperiments()

size_t TRestSensitivity::GetNumberOfExperiments ( )
inline

Definition at line 87 of file TRestSensitivity.h.

◆ GetNumberOfNodes()

size_t TRestSensitivity::GetNumberOfNodes ( )
inline

Definition at line 89 of file TRestSensitivity.h.

◆ GetParameterizationNodes()

std::vector< Double_t > TRestSensitivity::GetParameterizationNodes ( )
inline

Definition at line 59 of file TRestSensitivity.h.

◆ ImportCurve()

void TRestSensitivity::ImportCurve ( const std::vector< Double_t > &  curve)
inline

Definition at line 64 of file TRestSensitivity.h.

◆ InitFromConfigFile()

void TRestSensitivity::InitFromConfigFile ( )
overrideprotectedvirtual

It customizes the retrieval of XML data values of this class.

Reimplemented from TRestMetadata.

Definition at line 350 of file TRestSensitivity.cxx.

◆ Initialize()

void TRestSensitivity::Initialize ( )
overridevirtual

It will initialize the data frame with the filelist and column names (or observables) that have been defined by the user.

Reimplemented from TRestMetadata.

Definition at line 79 of file TRestSensitivity.cxx.

◆ PrintMetadata()

void TRestSensitivity::PrintMetadata ( )
overridevirtual

Prints on screen the information about the metadata members of TRestAxionSolarFlux.

Reimplemented from TRestMetadata.

Definition at line 611 of file TRestSensitivity.cxx.

◆ PrintParameterizationNodes()

void TRestSensitivity::PrintParameterizationNodes ( )

Definition at line 602 of file TRestSensitivity.cxx.

◆ SignalStatisticalTest()

TH1D * TRestSensitivity::SignalStatisticalTest ( Double_t  node,
Int_t  N 
)

Definition at line 327 of file TRestSensitivity.cxx.

◆ UnbinnedLogLikelihood()

Double_t TRestSensitivity::UnbinnedLogLikelihood ( const TRestExperiment experiment,
Double_t  node,
Double_t  g4 = 0 
)
protected

It returns the Log(L) for the experiment and coupling given by argument.

We check if the signal component is sensitive to that particular node If not, this experiment will not contribute to that node

We could check if background has also components, but for the moment we do not have a background for each node, although it could be the case, if for example the background depends on the detector conditions. For example, higher pressure inside the detector gains in signal sensitivity but it will produce also higher background.

Definition at line 257 of file TRestSensitivity.cxx.

Field Documentation

◆ fCanvas

TCanvas* TRestSensitivity::fCanvas = nullptr
private

A canvas to draw.

Definition at line 47 of file TRestSensitivity.h.

◆ fCurves

std::vector<std::vector<Double_t> > TRestSensitivity::fCurves
private

A vector of calculated sensitivity curves defined as a funtion of the parametric node.

Definition at line 38 of file TRestSensitivity.h.

◆ fExperiments

std::vector<TRestExperiment*> TRestSensitivity::fExperiments
private

A list of experimental conditions included to get a final sensitivity plot.

Definition at line 32 of file TRestSensitivity.h.

◆ fFrozen

Bool_t TRestSensitivity::fFrozen = false
private

A flag that will frozen adding more experiments in the future.

Definition at line 41 of file TRestSensitivity.h.

◆ fParameterizationNodes

std::vector<Double_t> TRestSensitivity::fParameterizationNodes
private

The fusioned list of parameterization nodes found at each experiment signal.

Definition at line 35 of file TRestSensitivity.h.

◆ fSignalTest

TH1D* TRestSensitivity::fSignalTest = nullptr
private

It is used to generate a histogram with the signal distribution produced with different signal samples.

Definition at line 44 of file TRestSensitivity.h.


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