Jpp
examples
JPhysics
JGeanx.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
4
#include "TROOT.h"
5
#include "TFile.h"
6
#include "TH1D.h"
7
8
#include "
JPhysics/JGeanx.hh
"
9
10
#include "
Jeep/JParser.hh
"
11
#include "
Jeep/JMessage.hh
"
12
13
14
/**
15
* \file
16
*
17
* Example program to histogram photon emission profile from showers using JPHYSICS::JGeanx.
18
* \author mdejong
19
*/
20
int
main
(
int
argc,
char
* argv[])
21
{
22
using namespace
std
;
23
24
string
outputFile
;
25
bool
debug
;
26
27
try
{
28
29
JParser<>
zap(
"Example program to histogram photon emission profile from showers."
);
30
31
zap[
'o'
] =
make_field
(
outputFile
) =
"geanx.root"
;
32
zap[
'd'
] =
make_field
(
debug
);
33
34
zap(argc, argv);
35
}
36
catch
(
const
exception &error) {
37
FATAL
(error.what() << endl);
38
}
39
40
using namespace
JPP
;
41
42
43
TFile out(
outputFile
.c_str(),
"recreate"
);
44
45
TH1D h1(
"Probability"
, NULL, 1000, -1.0, +1.0);
46
TH1D h2(
"Integral"
, NULL, 1000, -1.0, +1.0);
47
48
for
(
int
i = 1; i <= h1.GetNbinsX(); ++i) {
49
50
const
double
x = h1.GetBinCenter(i);
51
52
h1.Fill(x,
geanx
(x));
53
h2.Fill(x,
geanx
(-1.0,x));
54
}
55
56
out.Write();
57
out.Close();
58
}
main
int main(int argc, char *argv[])
Definition:
JGeanx.cc:20
JPHYSICS::geanx
static const JGeanx geanx(0.35, -5.40)
Function object for the number of photons from EM-shower as a function of emission angle.
JMessage.hh
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JGeanx.hh
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition:
JAAnetToolkit.hh:37
debug
int debug
debug level
Definition:
JSirene.cc:59
JParser.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
std
Definition:
jaanetDictionary.h:36
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
Generated by
1.8.16