GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
ExampleTreeSelector Class Reference

Detailed Description

This selector shows how to create a tree with selected events (beta-tagged with gamma multiplicities of at least three), and selected information (suppressed addback energies, and beta-gamma timing differences).

Definition at line 33 of file ExampleTreeSelector.h.

Public Member Functions

 ExampleTreeSelector (TTree *=nullptr)
 
virtual ~ExampleTreeSelector ()=default
 
void Begin (TTree *tree) override
 
void CreateHistograms ()
 
virtual void EndOfSort ()
 
void FillHistograms ()
 
Int_t GetEntry (Long64_t entry, Int_t getall=0) override
 
TList * GetOutputList () const override
 
std::string GetOutputPrefix () const
 
void Init (TTree *tree) override
 
void InitializeBranches (TTree *tree)
 
Bool_t Notify () override
 
Bool_t Process (Long64_t entry) override
 
void SetObject (TObject *obj) override
 
void SetOption (const char *option) override
 
void SetOutputPrefix (const char *prefix)
 
void SlaveBegin (TTree *tree) override
 
void SlaveTerminate () override
 
void Terminate () override
 
virtual Int_t Version () const
 

Protected Attributes

TGRSIMap< std::string, GCube * > fCube
 
std::map< std::string, TCutG * > fCuts
 
int64_t fEntry {0}
 
TGRSIMap< std::string, TH1 * > fH1
 
TGRSIMap< std::string, TH2 * > fH2
 
TGRSIMap< std::string, TH3 * > fH3
 
TGRSIMap< std::string, THnSparseF * > fHSparse
 
TPPGfPpg {nullptr}
 
TRunInfofRunInfo {nullptr}
 
TGRSIMap< std::string, GHSym * > fSym
 
TGRSIMap< std::string, TTree * > fTree
 

Private Member Functions

void CheckSizes (const char *usage)
 
 ClassDef (ExampleTreeSelector, 2)
 

Private Attributes

TAnalysisOptionsfAnalysisOptions {nullptr}
 
std::vector< double > fBetaGammaTiming
 
TTree * fChain {nullptr}
 
Int_t fFirstRunNumber {-1}
 
Int_t fFirstSubRunNumber {-1}
 
TGriffinfGrif
 
TGriffinBgofGriffinBgo
 
std::string fOutputPrefix
 
TSceptarfScep
 
std::vector< double > fSuppressedAddback
 
TZeroDegreefZds
 

Static Private Attributes

static constexpr int fSizeLimit = 1073741822
 
+ Inheritance diagram for ExampleTreeSelector:
+ Collaboration diagram for ExampleTreeSelector:

Constructor & Destructor Documentation

◆ ExampleTreeSelector()

ExampleTreeSelector::ExampleTreeSelector ( TTree * = nullptr)
inlineexplicit

Definition at line 35 of file ExampleTreeSelector.h.

References TGRSISelector::SetOutputPrefix().

◆ ~ExampleTreeSelector()

virtual ExampleTreeSelector::~ExampleTreeSelector ( )
virtualdefault

Member Function Documentation

◆ Begin()

void TGRSISelector::Begin ( TTree * tree)
overrideinherited

The Begin() function is called at the start of the query. When running with PROOF Begin() is only called on the client. The tree argument is deprecated (on PROOF 0 is passed).

Definition at line 36 of file TGRSISelector.cxx.

◆ CheckSizes()

void TGRSISelector::CheckSizes ( const char * usage)
privateinherited

Function to check size of objects in output list.

Definition at line 303 of file TGRSISelector.cxx.

References DRED, TGRSISelector::fSizeLimit, and RESET_COLOR.

Referenced by TGRSISelector::SlaveBegin(), TGRSISelector::SlaveTerminate(), and TGRSISelector::Terminate().

◆ ClassDef()

ExampleTreeSelector::ClassDef ( ExampleTreeSelector ,
2  )
private

◆ CreateHistograms()

void ExampleTreeSelector::CreateHistograms ( )
virtual

◆ EndOfSort()

virtual void TGRSISelector::EndOfSort ( )
inlinevirtualinherited

Definition at line 60 of file TGRSISelector.h.

Referenced by TGRSISelector::SlaveTerminate().

◆ FillHistograms()

◆ GetEntry()

Int_t TGRSISelector::GetEntry ( Long64_t entry,
Int_t getall = 0 )
inlineoverrideinherited

Definition at line 46 of file TGRSISelector.h.

References TGRSISelector::fChain.

◆ GetOutputList()

◆ GetOutputPrefix()

std::string TGRSISelector::GetOutputPrefix ( ) const
inlineinherited

Definition at line 62 of file TGRSISelector.h.

References TGRSISelector::fOutputPrefix.

Referenced by TGRSISelector::SlaveTerminate().

◆ Init()

void TGRSISelector::Init ( TTree * tree)
overrideinherited

The Init() function is called when the selector needs to initialize a new tree or chain. Typically here the branch addresses and branch pointers of the tree will be set. It is normally not necessary to make changes to the generated code, but the routine can be extended by the user if needed. Init() will be called many times when running on PROOF (once per file to be processed). Set branch addresses and branch pointers

Definition at line 275 of file TGRSISelector.cxx.

References TGRSISelector::fChain, and TGRSISelector::InitializeBranches().

◆ InitializeBranches()

void ExampleTreeSelector::InitializeBranches ( TTree * tree)
virtual

Implements TGRSISelector.

◆ Notify()

Bool_t TGRSISelector::Notify ( )
overrideinherited

The Notify() function is called when a new file is opened. This can be either for a new TTree in a TChain or when when a new TTree is started when using PROOF. It is normally not necessary to make changes to the generated code, but the routine can be extended by the user if needed. The return value is currently not used.

Definition at line 292 of file TGRSISelector.cxx.

◆ Process()

Bool_t TGRSISelector::Process ( Long64_t entry)
overrideinherited

The Process() function is called for each entry in the tree (or possibly keyed object in the case of PROOF) to be processed. The entry argument specifies which entry in the currently loaded tree is to be processed. It can be passed to either TGRSISelector::GetEntry() or TBranch::GetEntry() to read either all or the required parts of the data. When processing keyed objects with PROOF, the object is already loaded and is available via the fObject pointer.

This function should contain the "body" of the analysis. It can contain simple or elaborate selection criteria, run algorithms on the data of the event and typically fill histograms.

The processing can be stopped by calling Abort().

Use fStatus to set the return value of TTree::Process().

The return value is currently not used

Definition at line 166 of file TGRSISelector.cxx.

References TGRSIOptions::AnalysisOptions(), TGRSIMapException< key_type >::detail(), DRED, TGRSISelector::fChain, TGRSISelector::fEntry, TGRSISelector::FillHistograms(), TChannel::ReadCalFromFile(), TAnalysisOptions::ReadFromFile(), and RESET_COLOR.

◆ SetObject()

void TGRSISelector::SetObject ( TObject * obj)
inlineoverrideinherited

Definition at line 51 of file TGRSISelector.h.

◆ SetOption()

void TGRSISelector::SetOption ( const char * option)
inlineoverrideinherited

Definition at line 50 of file TGRSISelector.h.

◆ SetOutputPrefix()

◆ SlaveBegin()

void TGRSISelector::SlaveBegin ( TTree * tree)
overrideinherited

◆ SlaveTerminate()

void TGRSISelector::SlaveTerminate ( )
overrideinherited

The SlaveTerminate() function is called after all entries or objects have been processed. When running with PROOF SlaveTerminate() is called on each slave server.

Definition at line 206 of file TGRSISelector.cxx.

References TGRSISelector::CheckSizes(), TGRSISelector::EndOfSort(), TChannel::GetChannelMap(), and TGRSISelector::GetOutputPrefix().

◆ Terminate()

◆ Version()

virtual Int_t ExampleTreeSelector::Version ( ) const
inlinevirtual

Definition at line 41 of file ExampleTreeSelector.h.

Member Data Documentation

◆ fAnalysisOptions

TAnalysisOptions* TGRSISelector::fAnalysisOptions {nullptr}
privateinherited

! pointer to analysis options

Definition at line 84 of file TGRSISelector.h.

Referenced by TGRSISelector::SlaveBegin().

◆ fBetaGammaTiming

std::vector<double> ExampleTreeSelector::fBetaGammaTiming
private

vector of beta-gamma timing

Definition at line 55 of file ExampleTreeSelector.h.

Referenced by CreateHistograms(), and FillHistograms().

◆ fChain

TTree* TGRSISelector::fChain {nullptr}
privateinherited

! pointer to the analyzed TTree or TChain

Definition at line 80 of file TGRSISelector.h.

Referenced by TGRSISelector::GetEntry(), TGRSISelector::Init(), and TGRSISelector::Process().

◆ fCube

TGRSIMap<std::string, GCube*> TGRSISelector::fCube
protectedinherited

Definition at line 69 of file TGRSISelector.h.

◆ fCuts

std::map<std::string, TCutG*> TGRSISelector::fCuts
protectedinherited

Definition at line 72 of file TGRSISelector.h.

Referenced by TGRSISelector::SlaveBegin().

◆ fEntry

int64_t TGRSISelector::fEntry {0}
protectedinherited

Definition at line 75 of file TGRSISelector.h.

Referenced by CreateHistograms(), and TGRSISelector::Process().

◆ fFirstRunNumber

Int_t TGRSISelector::fFirstRunNumber {-1}
privateinherited

! run number of first file

Definition at line 85 of file TGRSISelector.h.

◆ fFirstSubRunNumber

Int_t TGRSISelector::fFirstSubRunNumber {-1}
privateinherited

! sub-run number of first file

Definition at line 86 of file TGRSISelector.h.

◆ fGrif

TGriffin* ExampleTreeSelector::fGrif
private

pointer for griffin branch

Definition at line 48 of file ExampleTreeSelector.h.

Referenced by FillHistograms().

◆ fGriffinBgo

TGriffinBgo* ExampleTreeSelector::fGriffinBgo
private

pointer for griffin BGO branch

Definition at line 50 of file ExampleTreeSelector.h.

Referenced by FillHistograms().

◆ fH1

◆ fH2

◆ fH3

TGRSIMap<std::string, TH3*> TGRSISelector::fH3
protectedinherited

◆ fHSparse

◆ fOutputPrefix

std::string TGRSISelector::fOutputPrefix
privateinherited

! pre-fix for output files

Definition at line 83 of file TGRSISelector.h.

Referenced by TGRSISelector::GetOutputPrefix(), TGRSISelector::SetOutputPrefix(), and TGRSISelector::Terminate().

◆ fPpg

TPPG* TGRSISelector::fPpg {nullptr}
protectedinherited

Definition at line 73 of file TGRSISelector.h.

Referenced by TGRSISelector::SlaveBegin(), and TGRSISelector::Terminate().

◆ fRunInfo

TRunInfo* TGRSISelector::fRunInfo {nullptr}
protectedinherited

Definition at line 74 of file TGRSISelector.h.

Referenced by TGRSISelector::SlaveBegin(), and TGRSISelector::Terminate().

◆ fScep

TSceptar* ExampleTreeSelector::fScep
private

pointer for sceptar branch

Definition at line 49 of file ExampleTreeSelector.h.

Referenced by FillHistograms().

◆ fSizeLimit

int TGRSISelector::fSizeLimit = 1073741822
staticconstexprprivateinherited

! 1 GB size limit for objects in ROOT

Definition at line 78 of file TGRSISelector.h.

Referenced by TGRSISelector::CheckSizes().

◆ fSuppressedAddback

std::vector<double> ExampleTreeSelector::fSuppressedAddback
private

vector of suppressed addback energies

Definition at line 54 of file ExampleTreeSelector.h.

Referenced by CreateHistograms(), and FillHistograms().

◆ fSym

TGRSIMap<std::string, GHSym*> TGRSISelector::fSym
protectedinherited

Definition at line 68 of file TGRSISelector.h.

◆ fTree

TGRSIMap<std::string, TTree*> TGRSISelector::fTree
protectedinherited

Definition at line 71 of file TGRSISelector.h.

Referenced by CreateHistograms(), and FillHistograms().

◆ fZds

TZeroDegree* ExampleTreeSelector::fZds
private

pointer for ZDS branch

Definition at line 51 of file ExampleTreeSelector.h.

Referenced by FillHistograms().