Newer
Older
#include "Particle/ParticleTable.hh"
#include "Particle/Particle.hh"
#include "Particle/PdtParser.hh"
#include <iostream>
#include <string>
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
int main()
{
ParticleTable pTable;
PdtParser parser;
std::string theSourcePath=getenv("CMAKE_SOURCE_DIR");
std::string pdtFile(theSourcePath+"/Particle/pdt.table");
if (parser.parse(pdtFile, pTable)) {
pTable.print(std::cout);
std::string name("omega");
Particle* omega = pTable.particle(name);
if (0 != omega)
omega->print(std::cout);
else
std::cout << name << " not found" << std::endl;
name = std::string("oohps");
Particle* dummy = pTable.particle(name);
if (0 != dummy)
dummy->print(std::cout);
else
std::cout << name << " not found" << std::endl;
// try clone error handling
pTable.clone(std::string("omegaNew"), std::string("omeGa")); // syntax here is clone(new, old);
pTable.clone(std::string("omegaNew"), std::string("omega"));
pTable.particle(std::string("omegaNew"))->print(std::cout);
pTable.clone(std::string("omegaNew"), std::string("omega"));
// try to modify mass and width
pTable.modifyMass(std::string("omegaNew"), 1.42);
pTable.modifyWidth(std::string("omegaNew"), 0.13);
pTable.particle(std::string("omegaNew"))->print(std::cout);
} else {
std::cout << "Error: could not parse " << pdtFile << std::endl;
exit(1);
}
return 0;
}