Jpp
17.3.0-rc.1
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JSirene
JPythia.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "TROOT.h"
7
#include "TFile.h"
8
#include "TH1D.h"
9
10
#include "
JSirene/JPythia.hh
"
11
#include "
JROOT/JManager.hh
"
12
13
#include "
Jeep/JParser.hh
"
14
#include "
Jeep/JMessage.hh
"
15
16
17
/**
18
* \file
19
* Auxiliary program histogram plot EM-equivalent energy for hadrons.
20
* \author mdejong
21
*/
22
int
main
(
int
argc,
char
**argv)
23
{
24
using namespace
std;
25
using namespace
JPP;
26
27
string
outputFile
;
28
double
epsilon
;
29
int
debug
;
30
31
try
{
32
33
JParser<>
zap(
"Auxiliary program histogram plot EM-equivalent energy for hadrons."
\
34
"\nNote that the results have a small offset to effectively be visualised."
);
35
36
zap[
'o'
] =
make_field
(
outputFile
) =
"pythia.root"
;
37
zap[
'e'
] =
make_field
(
epsilon
) = 0.004;
38
zap[
'd'
] =
make_field
(
debug
) = 2;
39
40
zap(argc, argv);
41
}
42
catch
(
const
exception &error) {
43
FATAL
(error.what() << endl);
44
}
45
46
47
JManager<int, TH1D> zmap(
new
TH1D(
"E[%]"
, NULL, 500, -0.8, 9.0));
48
49
const
int
buffer[] = {
50
TRACK_TYPE_PHOTON
,
51
TRACK_TYPE_NEUTRAL_PION
,
52
//TRACK_TYPE_NEUTRAL_ANTIPION,
53
TRACK_TYPE_ELECTRON
,
54
TRACK_TYPE_ANTIELECTRON
,
55
TRACK_TYPE_CHARGED_PION_PLUS
,
56
TRACK_TYPE_CHARGED_PION_MINUS
,
57
-1 };
58
59
map<int, double>
Y
;
// offsets for graphics
60
61
for
(
const
int
*type = buffer; *type != -1; ++type) {
62
Y
[*type] =
epsilon
* (type - buffer);
63
}
64
65
for
(
int
i = 1; i <= zmap->GetNbinsX(); ++i) {
66
67
const
double
x
= zmap->GetBinCenter(i);
68
const
double
E
=
pow
(10.0, x);
69
70
for
(
const
int
*type = buffer; *type != -1; ++type) {
71
zmap[*type]->SetBinContent(i,
pythia
(*type, E)/E +
Y
[*type]);
72
}
73
}
74
75
zmap.Write(
outputFile
.c_str());
76
}
JAANET::TRACK_TYPE_CHARGED_PION_MINUS
Definition:
JParticleTypes.hh:141
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1517
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JPythia.hh
E
then usage E
Definition:
JMuonPostfit.sh:35
std::map
Definition:
JSTDTypes.hh:16
JAANET::TRACK_TYPE_CHARGED_PION_PLUS
Definition:
JParticleTypes.hh:104
JAANET::TRACK_TYPE_PHOTON
Definition:
JParticleTypes.hh:102
JManager.hh
Dynamic ROOT object management.
Y
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
Definition:
detector-XY:fit1d.sh:33
JSIRENE::pythia
static const JPythia pythia
Function object for relative light yield as a function of GEANT particle code.
Definition:
JPythia.hh:96
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
x
then chmod x
Definition:
JEvtReweightMupageParameterScan.sh:413
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1993
JAANET::TRACK_TYPE_NEUTRAL_PION
Definition:
JParticleTypes.hh:103
JMATH::pow
T pow(const T &x, const double y)
Power .
Definition:
JMath.hh:97
JAANET::TRACK_TYPE_ANTIELECTRON
Definition:
JParticleTypes.hh:134
JMessage.hh
General purpose messaging.
JAANET::TRACK_TYPE_ELECTRON
Definition:
JParticleTypes.hh:96
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
GAUSS_LEGENDRE::epsilon
const double epsilon
Definition:
JQuadrature.cc:21
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5