Jpp
17.2.1-pre0
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
software
JAAnet
JPrintPDB.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "
JAAnet/JPDB.hh
"
7
#include "
JLang/JComparator.hh
"
8
9
#include "
Jeep/JParser.hh
"
10
#include "
Jeep/JMessage.hh
"
11
12
13
/**
14
* \file
15
*
16
* Auxiliary program to print particle codes and masses.
17
* \author mdejong
18
*/
19
int
main
(
int
argc,
char
**argv)
20
{
21
using namespace
std;
22
23
string
key;
24
int
debug
;
25
26
try
{
27
28
JParser<>
zap(
"Auxiliary program to print particle codes and masses."
);
29
30
zap[
'k'
] =
make_field
(key) =
"name"
,
"geant"
,
"pdg"
,
"mass"
;
31
zap[
'd'
] =
make_field
(
debug
) = 2;
32
33
zap(argc, argv);
34
}
35
catch
(
const
exception& error) {
36
FATAL
(error.what() << endl);
37
}
38
39
using namespace
JPP;
40
41
JPDB pdb =
JPDB::getInstance
();
42
43
if
(key ==
"name"
)
44
sort(pdb.begin(), pdb.end(),
make_comparator
(&
JParticle::name
));
45
else
if
(key ==
"pdg"
)
46
sort(pdb.begin(), pdb.end(),
make_comparator
(&JParticle::pdg));
47
else
if
(key ==
"geant"
)
48
sort(pdb.begin(), pdb.end(),
make_comparator
(&
JParticle::geant
));
49
else
if
(key ==
"mass"
)
50
sort(pdb.begin(), pdb.end(),
make_comparator
(&JParticle::mass));
51
52
cout << pdb << endl;
53
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1517
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JLANG::make_comparator
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
Definition:
JComparator.hh:185
name
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition:
JCookie.sh:42
JPHYSICS::geant
static const JGeant geant(geanx, 0.0001)
Function object for the number of photons from EM-shower as a function of emission angle...
JLANG::getInstance
T & getInstance(const T &object)
Get static instance from temporary object.
Definition:
JObject.hh:75
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1993
JMessage.hh
General purpose messaging.
JPDB.hh
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JComparator.hh
JParser.hh
Utility class to parse command line options.
debug
int debug
debug level
Definition:
archive-put-Detectors.sh:95
Generated by
1.8.5