CbmRoot
Loading...
Searching...
No Matches
CbmMCInput.h
Go to the documentation of this file.
1
/* Copyright (C) 2018-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2
SPDX-License-Identifier: GPL-3.0-only
3
Authors: Volker Friese [committer] */
4
10
#ifndef CBMMCINPUT_H
11
#define CBMMCINPUT_H 1
12
13
#include "
CbmDefs.h
"
14
15
#include "TChain.h"
16
#include "TF1.h"
17
#include "TObject.h"
18
19
#include <set>
20
21
33
class
CbmMCInput
:
public
TObject {
34
35
public
:
37
CbmMCInput
();
38
39
44
CbmMCInput
(TChain* chain,
ECbmTreeAccess
mode =
ECbmTreeAccess::kRegular
);
45
46
48
virtual
~CbmMCInput
();
49
50
54
std::set<TString>&
GetBranchList
();
55
56
60
TChain*
GetChain
()
const
{
return
fChain
; }
61
62
68
Int_t
GetNextEntry
();
69
70
74
Int_t
GetMaxNofEvents
()
const
{
return
(
fMode
==
ECbmTreeAccess::kRegular
?
fChain
->GetEntries() : -1); }
75
76
80
ECbmTreeAccess
GetMode
()
const
{
return
fMode
; }
81
82
86
Long64_t
GetNofEntries
()
const
{
return
fChain
->GetEntries(); }
87
88
92
UInt_t
GetNofUsedEntries
()
const
{
return
fNofUsedEntries
; }
93
94
95
private
:
96
TChain*
fChain
;
97
ECbmTreeAccess
fMode
;
// Access mode to tree
98
std::set<TString>
fBranches
;
// List of branch names
99
UInt_t
fLastUsedEntry
;
// Index of last used entry
100
UInt_t
fNofUsedEntries
;
// Number of used entries
101
102
108
UInt_t
ReadBranches
();
109
110
111
ClassDef
(
CbmMCInput
, 1);
112
};
113
114
#endif
/* CBMMCINPUT_H */
CbmDefs.h
ECbmTreeAccess
ECbmTreeAccess
Mode to read entries from a ROOT TTree.
Definition
CbmDefs.h:152
ECbmTreeAccess::kRegular
@ kRegular
CbmMCInput
An MC (transport) input to digitisation in CBM.
Definition
CbmMCInput.h:33
CbmMCInput::fNofUsedEntries
UInt_t fNofUsedEntries
Definition
CbmMCInput.h:100
CbmMCInput::GetMode
ECbmTreeAccess GetMode() const
Tree access mode @value Access mode.
Definition
CbmMCInput.h:80
CbmMCInput::fMode
ECbmTreeAccess fMode
Input chain.
Definition
CbmMCInput.h:97
CbmMCInput::GetMaxNofEvents
Int_t GetMaxNofEvents() const
Maximal number of events to be read from the input. @value Number of entries in the tree for kRegular...
Definition
CbmMCInput.h:74
CbmMCInput::fChain
TChain * fChain
Definition
CbmMCInput.h:96
CbmMCInput::fLastUsedEntry
UInt_t fLastUsedEntry
Definition
CbmMCInput.h:99
CbmMCInput::GetNofUsedEntries
UInt_t GetNofUsedEntries() const
Number of used entries @value Number of successful calls to GetNextEvent()
Definition
CbmMCInput.h:92
CbmMCInput::ClassDef
ClassDef(CbmMCInput, 1)
CbmMCInput::fBranches
std::set< TString > fBranches
Definition
CbmMCInput.h:98
CbmMCInput::GetBranchList
std::set< TString > & GetBranchList()
List of branches @value Reference to branch list.
Definition
CbmMCInput.cxx:47
CbmMCInput::GetChain
TChain * GetChain() const
Pointer to chain @value Pointer to TChain object.
Definition
CbmMCInput.h:60
CbmMCInput::GetNextEntry
Int_t GetNextEntry()
Get the next unused entry from the chain @value Id of tree entry.
Definition
CbmMCInput.cxx:59
CbmMCInput::CbmMCInput
CbmMCInput()
Default constructor.
Definition
CbmMCInput.cxx:24
CbmMCInput::~CbmMCInput
virtual ~CbmMCInput()
Destructor.
Definition
CbmMCInput.cxx:42
CbmMCInput::GetNofEntries
Long64_t GetNofEntries() const
Number of entries @value Number of entries in this input chain.
Definition
CbmMCInput.h:86
CbmMCInput::ReadBranches
UInt_t ReadBranches()
Read list of branches from file @value Number of branches.
Definition
CbmMCInput.cxx:89
sim
response
base
CbmMCInput.h
Generated on Sun Dec 22 2024 23:04:19 for CbmRoot by
1.12.0