cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
hist_utils.h
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2022 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 CepGenAddOns_ROOTWrapper_utils_hist_utils_h
20
#define CepGenAddOns_ROOTWrapper_utils_hist_utils_h
21
22
#include "
CepGen/Event/Event.h
"
23
#include "
CepGenAddOns/ROOTWrapper/ROOTCanvas.h
"
24
#include "
CepGenAddOns/ROOTWrapper/ROOTTreeInfo.h
"
25
26
typedef
vector<TH1D*>
hists_t
;
27
28
hists_t
fill_histograms
(
const
string
& filename) {
29
hists_t
out = {
new
TH1D(
"invm"
,
";m_{central} (GeV);d#sigma/dm"
, 200, 150., 550.),
30
new
TH1D(
"ptpair"
,
";p_{T}^{central} (GeV);d#sigma/dp_{T}"
, 100, 0., 5.),
31
new
TH1D(
"acop"
,
";1-|#Delta#phi/#pi|;d#sigma/d#Delta#phi)"
, 50, 0., 1.e-2)};
32
auto
file = TFile::Open(filename.c_str(),
"r"
);
33
ROOT::CepGenRun
run;
34
run.
attach
(file);
35
cout <<
">>> "
<< run.
process_name
<<
": "
<< run.
process_parameters
<< endl;
36
37
ROOT::CepGenEvent
evt_tree;
38
evt_tree.
attach
(file);
39
cepgen::Event
evt;
40
while
(evt_tree.
next
(evt)) {
41
out[0]->Fill(evt(4).mass());
42
out[1]->Fill(evt(4).momentum().pt());
43
//out[2]->Fill(
44
}
45
return
out;
46
}
47
48
#endif
Event.h
ROOTCanvas.h
ROOTTreeInfo.h
ROOT::CepGenEvent
All useful information about a generated event.
Definition
ROOTTreeInfo.h:60
ROOT::CepGenEvent::next
bool next(cepgen::Event &)
Read the next event in the file.
Definition
ROOTTreeInfo.cpp:203
ROOT::CepGenEvent::attach
void attach()
Attach the event tree reader to a tree.
Definition
ROOTTreeInfo.cpp:135
ROOT::CepGenRun
All useful information about a generation run.
Definition
ROOTTreeInfo.h:29
ROOT::CepGenRun::process_name
std::string process_name
Unique name of the process generated in this run.
Definition
ROOTTreeInfo.h:41
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.
Definition
ROOTTreeInfo.cpp:64
ROOT::CepGenRun::process_parameters
std::string process_parameters
Serialised process parameters.
Definition
ROOTTreeInfo.h:42
cepgen::Event
Container for the information on the in- and outgoing particles' kinematics.
Definition
Event.h:28
fill_histograms
hists_t fill_histograms(const string &filename)
Definition
hist_utils.h:28
hists_t
vector< TH1D * > hists_t
Definition
hist_utils.h:26
CepGenAddOns
ROOTWrapper
utils
hist_utils.h
Generated on Mon Jul 29 2024 for CepGen by
1.9.7