CbmRoot
CbmMCInput Class Reference

An MC (transport) input to digitisation in CBM. More...

#include <CbmMCInput.h>

Inheritance diagram for CbmMCInput:
[legend]
Collaboration diagram for CbmMCInput:
[legend]

Public Member Functions

 CbmMCInput ()
 Default constructor. More...
 
 CbmMCInput (TChain *chain, ECbmTreeAccess mode=ECbmTreeAccess::kRegular)
 Constructor. More...
 
virtual ~CbmMCInput ()
 Destructor. More...
 
std::set< TString > & GetBranchList ()
 List of branches @value Reference to branch list. More...
 
TChain * GetChain () const
 Pointer to chain @value Pointer to TChain object. More...
 
Int_t GetNextEntry ()
 Get the next unused entry from the chain @value Id of tree entry. More...
 
Int_t GetMaxNofEvents () const
 Maximal number of events to be read from the input. @value Number of entries in the tree for kRegular. -1 else. More...
 
ECbmTreeAccess GetMode () const
 Tree access mode @value Access mode. More...
 
Long64_t GetNofEntries () const
 Number of entries @value Number of entries in this input chain. More...
 
UInt_t GetNofUsedEntries () const
 Number of used entries @value Number of successful calls to GetNextEvent() More...
 

Private Member Functions

UInt_t ReadBranches ()
 Read list of branches from file @value Number of branches. More...
 
 ClassDef (CbmMCInput, 1)
 

Private Attributes

TChain * fChain
 
ECbmTreeAccess fMode
 Input chain. More...
 
std::set< TString > fBranches
 
UInt_t fLastUsedEntry
 
UInt_t fNofUsedEntries
 

Detailed Description

An MC (transport) input to digitisation in CBM.

Author
Volker Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e
Date
9 November 2018 CbmMCInput gives access to the entries of a TChain according to the specified access mode through the method GetNextEntry(). The access to the tree entries can be sequential with stopping at the end (mode = kRegular), sequential round-the-corner (mode kRepeat) or random (mode = kRandom).

Definition at line 27 of file CbmMCInput.h.

Constructor & Destructor Documentation

◆ CbmMCInput() [1/2]

CbmMCInput::CbmMCInput ( )

Default constructor.

Definition at line 18 of file CbmMCInput.cxx.

References kRegular.

◆ CbmMCInput() [2/2]

CbmMCInput::CbmMCInput ( TChain *  chain,
ECbmTreeAccess  mode = ECbmTreeAccess::kRegular 
)

Constructor.

Parameters
chainPointer to input file chain
modeAccess mode (see EAccessMode)

Definition at line 23 of file CbmMCInput.cxx.

◆ ~CbmMCInput()

CbmMCInput::~CbmMCInput ( )
virtual

Destructor.

Definition at line 34 of file CbmMCInput.cxx.

Member Function Documentation

◆ ClassDef()

CbmMCInput::ClassDef ( CbmMCInput  ,
 
)
private

◆ GetBranchList()

std::set< TString > & CbmMCInput::GetBranchList ( )

List of branches @value Reference to branch list.

Definition at line 39 of file CbmMCInput.cxx.

References fBranches, and ReadBranches().

Referenced by CbmMCInputSet::AddInput(), and CbmMCInputSet::CheckBranchList().

◆ GetChain()

TChain* CbmMCInput::GetChain ( ) const
inline

◆ GetMaxNofEvents()

Int_t CbmMCInput::GetMaxNofEvents ( ) const
inline

Maximal number of events to be read from the input. @value Number of entries in the tree for kRegular. -1 else.

Definition at line 68 of file CbmMCInput.h.

References fChain, fMode, and kRegular.

◆ GetMode()

ECbmTreeAccess CbmMCInput::GetMode ( ) const
inline

Tree access mode @value Access mode.

Definition at line 76 of file CbmMCInput.h.

References fMode.

Referenced by CbmDigitizationSource::ReadEventByEvent().

◆ GetNextEntry()

Int_t CbmMCInput::GetNextEntry ( )

Get the next unused entry from the chain @value Id of tree entry.

The method returns -1 if the maximum number of entries is exceeded.

Definition at line 50 of file CbmMCInput.cxx.

References fChain, fLastUsedEntry, fMode, fNofUsedEntries, GetNofEntries(), kRandom, and kRepeat.

Referenced by CbmDigitizationSource::ReadEventByEvent().

◆ GetNofEntries()

Long64_t CbmMCInput::GetNofEntries ( ) const
inline

Number of entries @value Number of entries in this input chain.

Definition at line 82 of file CbmMCInput.h.

References fChain.

Referenced by GetNextEntry(), and CbmDigitizationSource::ReadEventByEvent().

◆ GetNofUsedEntries()

UInt_t CbmMCInput::GetNofUsedEntries ( ) const
inline

Number of used entries @value Number of successful calls to GetNextEvent()

Definition at line 88 of file CbmMCInput.h.

References fNofUsedEntries.

◆ ReadBranches()

UInt_t CbmMCInput::ReadBranches ( )
private

Read list of branches from file @value Number of branches.

The list of branches is stored as TList in each file.

Definition at line 83 of file CbmMCInput.cxx.

References fBranches, and fChain.

Referenced by GetBranchList().

Member Data Documentation

◆ fBranches

std::set<TString> CbmMCInput::fBranches
private

Definition at line 94 of file CbmMCInput.h.

Referenced by GetBranchList(), and ReadBranches().

◆ fChain

TChain* CbmMCInput::fChain
private

Definition at line 92 of file CbmMCInput.h.

Referenced by GetChain(), GetMaxNofEvents(), GetNextEntry(), GetNofEntries(), and ReadBranches().

◆ fLastUsedEntry

UInt_t CbmMCInput::fLastUsedEntry
private

Definition at line 95 of file CbmMCInput.h.

Referenced by GetNextEntry().

◆ fMode

ECbmTreeAccess CbmMCInput::fMode
private

Input chain.

Definition at line 93 of file CbmMCInput.h.

Referenced by GetMaxNofEvents(), GetMode(), and GetNextEntry().

◆ fNofUsedEntries

UInt_t CbmMCInput::fNofUsedEntries
private

Definition at line 96 of file CbmMCInput.h.

Referenced by GetNextEntry(), and GetNofUsedEntries().


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