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

Detailed Description

A class to help on cuts definitions. To be used with TRestAnalysisTree.

TRestCut is a Collection of TCut objects initialized from rml and stored with the output file, e.g:

<TRestCut> <cut name="cc1" value="XX>10 AND XX<90"> <cut name="cc2" value="sAna_ThresholdIntegral<100e3"> <cut name="cc3" variable="sAna_ThresholdIntegral" condition=">0"> </TRestCut>

Note that the notations " AND " and " OR " will be replaced by " && " and " || " When saved to ROOT file, this class will save together all its TCut objects Then we can easily draw from analysis tree with these cuts:

AnalysisTree->Draw("xxx",*cc1) AnalysisTree->Draw("xxx",*cc1 && *cc2 )


RESTsoft - Software for Rare Event Searches with TPCs

History of developments:

2021-dec: First concept. Ni Kaixiang

2023-March: Updating metadata structures JuanAn GarcĂ­a


Definition at line 31 of file TRestCut.h.

#include <TRestCut.h>

Inheritance diagram for TRestCut:
TRestMetadata

Public Member Functions

void AddCut (const TCut &cut)
 
void AddCut (TRestCut *cut)
 
 ClassDefOverride (TRestCut, 2)
 
TCut GetCut (std::string name)
 
auto GetCuts () const
 
auto GetCutStrings () const
 
auto GetParamCut () const
 
TRestCutoperator= (TRestCut &cut)
 
void PrintMetadata () override
 Implemented it in the derived metadata class to print out specific metadata information. More...
 
Int_t Write (const char *name, Int_t option, Int_t bufsize) override
 overwriting the write() method with fStore considered More...
 

Protected Member Functions

void InitFromConfigFile () override
 To make settings from rml file. This method must be implemented in the derived class. More...
 
void Initialize () override
 Making default settings. More...
 

Private Attributes

std::vector< TCut > fCuts
 Vector of TCuts. More...
 
std::vector< std::string > fCutStrings
 Vector of cut strings e.g. when you use a complex cut. More...
 
std::vector< std::pair< std::string, std::string > > fParamCut
 Vector of parameter cuts, first item is parameter and second is the condition. More...
 

Additional Inherited Members

Constructor & Destructor Documentation

◆ TRestCut()

TRestCut::TRestCut ( )

Definition at line 67 of file TRestCut.cxx.

◆ ~TRestCut()

TRestCut::~TRestCut ( )
inline

Definition at line 65 of file TRestCut.h.

Member Function Documentation

◆ AddCut() [1/2]

void TRestCut::AddCut ( const TCut &  cut)

Definition at line 113 of file TRestCut.cxx.

◆ AddCut() [2/2]

void TRestCut::AddCut ( TRestCut cut)

Definition at line 141 of file TRestCut.cxx.

◆ GetCut()

TCut TRestCut::GetCut ( std::string  name)

Definition at line 132 of file TRestCut.cxx.

◆ GetCuts()

auto TRestCut::GetCuts ( ) const
inline

Definition at line 54 of file TRestCut.h.

◆ GetCutStrings()

auto TRestCut::GetCutStrings ( ) const
inline

Definition at line 52 of file TRestCut.h.

◆ GetParamCut()

auto TRestCut::GetParamCut ( ) const
inline

Definition at line 53 of file TRestCut.h.

◆ InitFromConfigFile()

void TRestCut::InitFromConfigFile ( )
overrideprotectedvirtual

To make settings from rml file. This method must be implemented in the derived class.

Reimplemented from TRestMetadata.

Definition at line 71 of file TRestCut.cxx.

◆ Initialize()

void TRestCut::Initialize ( )
overrideprotectedvirtual

Making default settings.

Reimplemented from TRestMetadata.

Definition at line 69 of file TRestCut.cxx.

◆ operator=()

TRestCut & TRestCut::operator= ( TRestCut cut)

Definition at line 104 of file TRestCut.cxx.

◆ PrintMetadata()

void TRestCut::PrintMetadata ( )
overridevirtual

Implemented it in the derived metadata class to print out specific metadata information.

Prints metadata content on screen. Usually overloaded by the derived metadata class.

Reimplemented from TRestMetadata.

Definition at line 157 of file TRestCut.cxx.

◆ Write()

Int_t TRestCut::Write ( const char *  name,
Int_t  option,
Int_t  bufsize 
)
overridevirtual

overwriting the write() method with fStore considered

Reimplemented from TRestMetadata.

Definition at line 167 of file TRestCut.cxx.

Field Documentation

◆ fCuts

std::vector<TCut> TRestCut::fCuts
private

Vector of TCuts.

Definition at line 34 of file TRestCut.h.

◆ fCutStrings

std::vector<std::string> TRestCut::fCutStrings
private

Vector of cut strings e.g. when you use a complex cut.

Definition at line 37 of file TRestCut.h.

◆ fParamCut

std::vector<std::pair<std::string, std::string> > TRestCut::fParamCut
private

Vector of parameter cuts, first item is parameter and second is the condition.

Definition at line 40 of file TRestCut.h.


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