Jpp
18.0.1-rc.2
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
JGedanken.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
#include <cmath>
5
6
#include "TROOT.h"
7
#include "TFile.h"
8
9
#include "
km3net-dataformat/offline/Head.hh
"
10
#include "
km3net-dataformat/offline/MultiHead.hh
"
11
#include "
km3net-dataformat/offline/Evt.hh
"
12
#include "
km3net-dataformat/definitions/trkmembers.hh
"
13
14
#include "
JSupport/JFileRecorder.hh
"
15
#include "
JSupport/JSupport.hh
"
16
17
#include "
Jeep/JParser.hh
"
18
#include "
Jeep/JMessage.hh
"
19
20
21
/**
22
* \file
23
*
24
* Auxiliary program to generate particles.
25
* \author mdejong
26
*/
27
int
main
(
int
argc,
char
**argv)
28
{
29
using namespace
std;
30
using namespace
JPP;
31
32
Trk
trk;
33
34
JFileRecorder<JAAnetTypes_t>
outputFile
;
35
size_t
numberOfEvents;
36
int
debug
;
37
38
try
{
39
40
JParser<>
zap(
"Auxiliary program to generate particles."
);
41
42
zap[
'o'
] =
make_field
(
outputFile
) =
"gedanken.root"
;
43
zap[
'n'
] =
make_field
(numberOfEvents) = 1;
44
zap[
'P'
] =
make_field
(trk.pos,
"position"
);
45
zap[
'D'
] =
make_field
(trk.dir,
"direction"
) =
Vec
(0.0, 0.0, 1.0);
46
zap[
'E'
] =
make_field
(trk.E,
"energy [GeV]"
);
47
zap[
'T'
] =
make_field
(trk.type,
"particle type (PDG)"
);
48
zap[
'd'
] =
make_field
(
debug
) = 2;
49
50
zap(argc, argv);
51
}
52
catch
(
const
exception& error) {
53
FATAL
(error.what() << endl);
54
}
55
56
trk.dir.normalize();
57
58
trk.status =
TRK_ST_FINALSTATE
;
59
60
Head
header;
61
62
outputFile
.open();
63
64
outputFile
.put(header);
65
66
Evt
evt;
67
68
evt.
mc_trks
.push_back(trk);
69
70
for
(
size_t
counter = 0; counter != numberOfEvents; ++counter) {
71
72
STATUS
(
"event: "
<< setw(10) << counter <<
'\r'
);
DEBUG
(endl);
73
74
outputFile
.put(evt);
75
}
76
STATUS
(endl);
77
78
outputFile
.close();
79
}
JSUPPORT::JFileRecorder
Object writing to file.
Definition:
JFileRecorder.hh:42
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JSupport.hh
ROOT TTree parameter settings of various packages.
STATUS
#define STATUS(A)
Definition:
JMessage.hh:63
JFileRecorder.hh
Recording of objects on file according a format that follows from the file name extension.
trkmembers.hh
outputFile
string outputFile
Definition:
JDAQTimesliceSelector.cc:37
Vec
The Vec class is a straightforward 3-d vector, which also works in pyroot.
Definition:
Vec.hh:12
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
MultiHead.hh
JMessage.hh
General purpose messaging.
Head
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Definition:
Head.hh:65
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
TRK_ST_FINALSTATE
static const int TRK_ST_FINALSTATE
for MC: the particle must be processed by detector simulation ('track_in' tag in evt files)...
Definition:
trkmembers.hh:15
Evt.hh
JParser.hh
Utility class to parse command line options.
Head.hh
Trk
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition:
Trk.hh:14
Evt::mc_trks
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
Definition:
Evt.hh:49
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Evt
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition:
Evt.hh:20
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
Generated by
1.8.5