NAIA  1.1.1
Public Member Functions | Public Attributes | Private Member Functions | List of all members
NAIA::TSNAIAChain Class Reference

TS NAIA Chain true TChain. More...

#include <TSNaiaChain.h>

Inheritance diagram for NAIA::TSNAIAChain:

Public Member Functions

 TSNAIAChain ()
 standard constructor More...
 
 ~TSNAIAChain () override
 standard destructor More...
 
Int_t Add (const char *name, Long64_t nentries=kBigNumber) override
 Add files to the chain (standard TChain syntax) More...
 
bool IsMC ()
 checks if the current files are MC or data More...
 
Int_t GetEntry (Long64_t entry=0, Int_t getall=0) override
 load the requested entry in the chain and the corresponding (in time) RTIInfo More...
 
EventGetEvent (Long64_t entry)
 load the requested entry in the chain and the corresponding (in time) RTIInfo More...
 
EventGetEventWithRunEvent (int run, int event)
 load the requested entry in the chain and the corresponding (in time) RTIInfo More...
 
Int_t GetNextEntry (bool reset=false)
 Loads the next event in the chain. More...
 

Public Attributes

TChain rti_chain
 pointer to the chain of the RTI objects More...
 
TChain file_chain
 pointer to the chain of th FileInfo objects More...
 
Eventev
 pointer to the current event in memory More...
 
RTIInforti
 pointer to the current RTI info in memory More...
 
FileInfofinfo
 pointer to the current FileInfo in memory More...
 
MCFileInfomcfinfo
 pointer to the current MCFileInfo in memory More...
 

Private Member Functions

RTIInfoUpdateEventRTIInfo (unsigned int UT)
 load the RTIInfo object closer to chosen time More...
 
 ClassDefOverride (TSNAIAChain, 1)
 

Detailed Description

TS NAIA Chain true TChain.

This class is derived from TChain and then has all the typical chain properties included the use of the of a TSelector class with the TChain::Process method. This class is intended to be used as alternative and in parallel with the NAIAChain class.

This class takes care of opening also the helper chains for the RTI and FILEinfo TTrees contained in a typical NAIA file. When using the GetEntry, GetEntryWithIndex, GetEvent and GetNextEvent this class takes care of automatically update the RTIInfo branch.

Definition at line 38 of file TSNaiaChain.h.

Constructor & Destructor Documentation

◆ TSNAIAChain()

TSNAIAChain::TSNAIAChain ( )

standard constructor

Definition at line 15 of file TSNaiaChain.cpp.

References file_chain, and rti_chain.

◆ ~TSNAIAChain()

TSNAIAChain::~TSNAIAChain ( )
override

standard destructor

Definition at line 20 of file TSNaiaChain.cpp.

References ev, finfo, mcfinfo, and rti.

Member Function Documentation

◆ Add()

Int_t TSNAIAChain::Add ( const char *  name,
Long64_t  nentries = kBigNumber 
)
override

Add files to the chain (standard TChain syntax)

Returns
the number of files that have been added

Definition at line 31 of file TSNaiaChain.cpp.

References ev, file_chain, finfo, GetEntry(), NAIA::getLogger(), IsMC(), mcfinfo, rti, rti_chain, NAIA::Event::SetAllBranchAddress(), and NAIA::Event::SetMC().

◆ ClassDefOverride()

NAIA::TSNAIAChain::ClassDefOverride ( TSNAIAChain  ,
 
)
private

◆ GetEntry()

Int_t TSNAIAChain::GetEntry ( Long64_t  entry = 0,
Int_t  getall = 0 
)
override

load the requested entry in the chain and the corresponding (in time) RTIInfo

Returns
the size of the read event in bytes

Definition at line 94 of file TSNaiaChain.cpp.

Referenced by Add(), GetEvent(), GetEventWithRunEvent(), and GetNextEntry().

◆ GetEvent()

Event* NAIA::TSNAIAChain::GetEvent ( Long64_t  entry)
inline

load the requested entry in the chain and the corresponding (in time) RTIInfo

Returns
a pointer to the read event (if any)

Definition at line 81 of file TSNaiaChain.h.

References ev, and GetEntry().

◆ GetEventWithRunEvent()

Event * TSNAIAChain::GetEventWithRunEvent ( int  run,
int  event 
)

load the requested entry in the chain and the corresponding (in time) RTIInfo

Returns
a pointer to the read event (if any)

Definition at line 107 of file TSNaiaChain.cpp.

References ev, and GetEntry().

◆ GetNextEntry()

Int_t TSNAIAChain::GetNextEntry ( bool  reset = false)

Loads the next event in the chain.

Parameters
resetrestart from the first event in the chain
Returns
the size of the readevent

Definition at line 100 of file TSNaiaChain.cpp.

References GetEntry().

◆ IsMC()

bool TSNAIAChain::IsMC ( )

checks if the current files are MC or data

Definition at line 80 of file TSNaiaChain.cpp.

References NAIA::MCTruthBase::BranchName.

Referenced by Add(), and UpdateEventRTIInfo().

◆ UpdateEventRTIInfo()

RTIInfo * TSNAIAChain::UpdateEventRTIInfo ( unsigned int  UT)
private

load the RTIInfo object closer to chosen time

Parameters
UTthe requeste UTC time

Definition at line 82 of file TSNaiaChain.cpp.

References IsMC(), rti, rti_chain, and NAIA::RTIInfo::UTCTime.

Member Data Documentation

◆ ev

Event* NAIA::TSNAIAChain::ev

pointer to the current event in memory

Definition at line 47 of file TSNaiaChain.h.

Referenced by Add(), GetEvent(), GetEventWithRunEvent(), and ~TSNAIAChain().

◆ file_chain

TChain NAIA::TSNAIAChain::file_chain

pointer to the chain of th FileInfo objects

Definition at line 43 of file TSNaiaChain.h.

Referenced by Add(), and TSNAIAChain().

◆ finfo

FileInfo* NAIA::TSNAIAChain::finfo

pointer to the current FileInfo in memory

Definition at line 51 of file TSNaiaChain.h.

Referenced by Add(), and ~TSNAIAChain().

◆ mcfinfo

MCFileInfo* NAIA::TSNAIAChain::mcfinfo

pointer to the current MCFileInfo in memory

Definition at line 53 of file TSNaiaChain.h.

Referenced by Add(), and ~TSNAIAChain().

◆ rti

RTIInfo* NAIA::TSNAIAChain::rti

pointer to the current RTI info in memory

Definition at line 49 of file TSNaiaChain.h.

Referenced by Add(), UpdateEventRTIInfo(), and ~TSNAIAChain().

◆ rti_chain

TChain NAIA::TSNAIAChain::rti_chain

pointer to the chain of the RTI objects

Definition at line 41 of file TSNaiaChain.h.

Referenced by Add(), TSNAIAChain(), and UpdateEventRTIInfo().


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