cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
N/A
Central exclusive processes event generator
Toggle main menu visibility
Main Page
Related Pages
Packages
Package List
Package Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
x
y
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
x
y
Variables
Typedefs
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
b
c
d
e
g
h
i
l
m
n
p
r
t
u
w
x
y
z
Related Symbols
d
g
h
o
u
v
Files
File List
File Members
All
_
a
b
c
d
e
h
o
p
r
s
Functions
Variables
Macros
_
b
c
d
e
p
r
s
▼
CepGen
Reference manual
Bibliography
►
Packages
►
Classes
▼
Files
▼
File List
▼
include
►
CepGen
►
CepGenBoost
►
CepGenHepMC2
►
CepGenHepMC3
►
CepGenHerwig6
►
CepGenMadGraph
►
CepGenPythia6
►
CepGenPythia8
►
CepGenPython
▼
CepGenRoot
►
ROOTCanvas.h
►
ROOTTreeInfo.h
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
ROOTTreeInfo.h
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2019-2025 Laurent Forthomme
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#ifndef CepGenRoot_ROOTTreeInfo_h
20
#define CepGenRoot_ROOTTreeInfo_h
21
22
#include <TFile.h>
23
#include <TTree.h>
24
25
#include "
CepGen/Event/Event.h
"
26
27
namespace
ROOT
{
29
class
CepGenRun
{
30
public
:
31
static
constexpr
const
char
*
TREE_NAME
=
"run"
;
32
33
static
CepGenRun
load
(TFile*,
const
std::string& run_tree =
TREE_NAME
);
34
static
CepGenRun
load
(
const
std::string&,
const
std::string& run_tree =
TREE_NAME
);
35
36
double
sqrt_s
{-1.};
37
double
xsect
{-1.};
38
double
errxsect
{-1.};
39
unsigned
int
num_events
{0};
40
unsigned
int
litigious_events
{0};
41
std::string
process_name
;
42
std::string
process_parameters
;
43
44
explicit
CepGenRun
();
45
void
clear
();
46
void
create
();
47
inline
TTree*
tree
()
const
{
return
tree_.get(); }
48
void
fill
()
const
;
49
void
attach
(TFile* file,
const
std::string& run_tree =
TREE_NAME
);
51
void
attach
(
const
std::string& filename,
const
std::string& run_tree =
TREE_NAME
) {
52
attach
(TFile::Open(filename.data()), run_tree);
53
}
51
void
attach
(
const
std::string& filename,
const
std::string& run_tree =
TREE_NAME
) {
…
}
54
55
private
:
56
std::shared_ptr<TTree> tree_;
57
};
58
60
class
CepGenEvent
{
61
public
:
62
CepGenEvent
() {
clear
(); }
63
64
// book a large enough number to allow the large multiplicity of excited proton fragmentation products
65
static
constexpr
size_t
MAX_PART
= 5000;
66
static
constexpr
const
char
*
TREE_NAME
=
"events"
;
67
68
static
CepGenEvent
load
(TFile*,
const
std::string& events_tree =
TREE_NAME
);
69
static
CepGenEvent
load
(
const
std::string&,
const
std::string& events_tree =
TREE_NAME
);
70
71
cepgen::Event::EventMetadata
metadata
;
72
float
gen_time
{-1.};
73
float
tot_time
{-1.};
74
float
weight
{-1.};
75
int
np
{0};
76
double
pt
[
MAX_PART
];
77
double
eta
[
MAX_PART
];
78
double
phi
[
MAX_PART
];
79
double
rapidity
[
MAX_PART
];
80
double
E
[
MAX_PART
];
81
double
m
[
MAX_PART
];
82
double
charge
[
MAX_PART
];
83
int
pdg_id
[
MAX_PART
];
84
int
parent1
[
MAX_PART
];
85
int
parent2
[
MAX_PART
];
86
int
stable
[
MAX_PART
];
87
int
role
[
MAX_PART
];
88
int
status
[
MAX_PART
];
89
90
void
clear
();
91
TTree*
tree
()
const
{
return
tree_.get(); }
92
void
create
();
93
94
void
attach
();
95
void
attach
(TFile* f,
const
std::string& events_tree =
TREE_NAME
);
97
void
attach
(
const
std::string& filename,
const
std::string& events_tree =
TREE_NAME
);
98
99
// direct cepgen::Event I/O helpers
100
101
void
fill
(
const
cepgen::Event
&,
bool
compress =
false
);
102
bool
next
(
cepgen::Event
&);
103
104
private
:
105
std::shared_ptr<TTree> tree_;
106
std::unique_ptr<TFile> file_;
107
bool
tree_attached_{
false
};
108
unsigned
long
long
num_read_events_{0ull};
109
};
110
}
// namespace ROOT
111
112
#endif
92
void
create
(); {
…
}
60
class
CepGenEvent
{
…
};
48
void
fill
()
const
; {
…
}
29
class
CepGenRun
{
…
};
27
namespace
ROOT
{
…
}
Event.h
ROOT::CepGenEvent
All useful information about a generated event.
Definition
ROOTTreeInfo.h:60
ROOT::CepGenEvent::m
double m[MAX_PART]
Particles mass, in GeV/c .
Definition
ROOTTreeInfo.h:81
ROOT::CepGenEvent::rapidity
double rapidity[MAX_PART]
Particles rapidity.
Definition
ROOTTreeInfo.h:79
ROOT::CepGenEvent::tree
TTree * tree() const
Retrieve the ROOT tree.
Definition
ROOTTreeInfo.h:91
ROOT::CepGenEvent::charge
double charge[MAX_PART]
Particles charges, in e.
Definition
ROOTTreeInfo.h:82
ROOT::CepGenEvent::next
bool next(cepgen::Event &)
Read the next event in the file.
ROOT::CepGenEvent::eta
double eta[MAX_PART]
Particles pseudo-rapidity.
Definition
ROOTTreeInfo.h:77
ROOT::CepGenEvent::parent1
int parent1[MAX_PART]
First particles mother.
Definition
ROOTTreeInfo.h:84
ROOT::CepGenEvent::CepGenEvent
CepGenEvent()
Definition
ROOTTreeInfo.h:62
ROOT::CepGenEvent::fill
void fill(const cepgen::Event &, bool compress=false)
Fill the tree with a new event.
ROOT::CepGenEvent::metadata
cepgen::Event::EventMetadata metadata
Definition
ROOTTreeInfo.h:71
ROOT::CepGenEvent::attach
void attach(TFile *f, const std::string &events_tree=TREE_NAME)
Attach the event tree reader to a file Attach the event tree reader to a file.
ROOT::CepGenEvent::attach
void attach(const std::string &filename, const std::string &events_tree=TREE_NAME)
ROOT::CepGenEvent::load
static CepGenEvent load(TFile *, const std::string &events_tree=TREE_NAME)
ROOT::CepGenEvent::status
int status[MAX_PART]
Integer status code.
Definition
ROOTTreeInfo.h:88
ROOT::CepGenEvent::phi
double phi[MAX_PART]
Particles azimuthal angle.
Definition
ROOTTreeInfo.h:78
ROOT::CepGenEvent::weight
float weight
Event weight.
Definition
ROOTTreeInfo.h:74
ROOT::CepGenEvent::E
double E[MAX_PART]
Particles energy, in GeV.
Definition
ROOTTreeInfo.h:80
ROOT::CepGenEvent::np
int np
Particles multiplicity in the event.
Definition
ROOTTreeInfo.h:75
ROOT::CepGenEvent::gen_time
float gen_time
Event generation time.
Definition
ROOTTreeInfo.h:72
ROOT::CepGenEvent::tot_time
float tot_time
Total event generation time.
Definition
ROOTTreeInfo.h:73
ROOT::CepGenEvent::parent2
int parent2[MAX_PART]
Last particles mother.
Definition
ROOTTreeInfo.h:85
ROOT::CepGenEvent::role
int role[MAX_PART]
Particles role in the event.
Definition
ROOTTreeInfo.h:87
ROOT::CepGenEvent::MAX_PART
static constexpr size_t MAX_PART
Maximal particles multiplicity in event.
Definition
ROOTTreeInfo.h:65
ROOT::CepGenEvent::attach
void attach()
Attach the event tree reader to a tree.
ROOT::CepGenEvent::pdg_id
int pdg_id[MAX_PART]
Integer particles PDG id.
Definition
ROOTTreeInfo.h:83
ROOT::CepGenEvent::clear
void clear()
Reinitialise the event content.
ROOT::CepGenEvent::create
void create()
Populate the tree and all associated branches.
ROOT::CepGenEvent::TREE_NAME
static constexpr const char * TREE_NAME
Output tree name.
Definition
ROOTTreeInfo.h:66
ROOT::CepGenEvent::stable
int stable[MAX_PART]
Whether the particle must decay or not.
Definition
ROOTTreeInfo.h:86
ROOT::CepGenEvent::load
static CepGenEvent load(const std::string &, const std::string &events_tree=TREE_NAME)
ROOT::CepGenEvent::pt
double pt[MAX_PART]
Particles transverse momentum.
Definition
ROOTTreeInfo.h:76
ROOT::CepGenRun
All useful information about a generation run.
Definition
ROOTTreeInfo.h:29
ROOT::CepGenRun::fill
void fill() const
Fill the run tree.
ROOT::CepGenRun::tree
TTree * tree() const
Retrieve the ROOT tree.
Definition
ROOTTreeInfo.h:47
ROOT::CepGenRun::CepGenRun
CepGenRun()
ROOT::CepGenRun::process_name
std::string process_name
Unique name of the process generated in this run.
Definition
ROOTTreeInfo.h:41
ROOT::CepGenRun::load
static CepGenRun load(const std::string &, const std::string &run_tree=TREE_NAME)
ROOT::CepGenRun::litigious_events
unsigned int litigious_events
Litigious events multiplicity in run.
Definition
ROOTTreeInfo.h:40
ROOT::CepGenRun::load
static CepGenRun load(TFile *, const std::string &run_tree=TREE_NAME)
ROOT::CepGenRun::xsect
double xsect
Process cross-section, in pb.
Definition
ROOTTreeInfo.h:37
ROOT::CepGenRun::errxsect
double errxsect
Uncertainty on process cross-section, in pb.
Definition
ROOTTreeInfo.h:38
ROOT::CepGenRun::attach
void attach(TFile *file, const std::string &run_tree=TREE_NAME)
Attach the run tree reader to a given tree Attach the run tree reader to a given file.
ROOT::CepGenRun::clear
void clear()
Reinitialise the run tree.
ROOT::CepGenRun::process_parameters
std::string process_parameters
Serialised process parameters.
Definition
ROOTTreeInfo.h:42
ROOT::CepGenRun::num_events
unsigned int num_events
Events multiplicity generated in run.
Definition
ROOTTreeInfo.h:39
ROOT::CepGenRun::create
void create()
Populate the run tree.
ROOT::CepGenRun::TREE_NAME
static constexpr const char * TREE_NAME
Output tree name.
Definition
ROOTTreeInfo.h:31
ROOT::CepGenRun::attach
void attach(const std::string &filename, const std::string &run_tree=TREE_NAME)
Definition
ROOTTreeInfo.h:51
ROOT::CepGenRun::sqrt_s
double sqrt_s
Centre of mass energy for beam particles.
Definition
ROOTTreeInfo.h:36
cepgen::Event
Container for the information on the in- and outgoing particles' kinematics.
Definition
Event.h:26
ROOT
Definition
ROOTTreeInfo.h:27
cepgen::Event::EventMetadata
Collection of key -> value pairs storing event metadata.
Definition
Event.h:128
include
CepGenRoot
ROOTTreeInfo.h
Generated on Tue Apr 22 2025 for CepGen by
1.10.0