]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TTherminator/Therminator/ParticleDB.cxx
Fix Coverity
[u/mrichter/AliRoot.git] / TTherminator / Therminator / ParticleDB.cxx
CommitLineData
2e967919 1/******************************************************************************
2 * T H E R M I N A T O R *
3 * THERMal heavy-IoN generATOR *
4 * version 1.0 *
5 * *
6 * Authors of the model: Wojciech Broniowski, Wojciech.Broniowski@ifj.edu.pl, *
7 * Wojciech Florkowski, Wojciech.Florkowski@ifj.edu.pl *
8 * Authors of the code: Adam Kisiel, kisiel@if.pw.edu.pl *
9 * Tomasz Taluc, ttaluc@if.pw.edu.pl *
10 * Code designers: Adam Kisiel, Tomasz Taluc, Wojciech Broniowski, *
11 * Wojciech Florkowski *
12 * *
13 * For the detailed description of the program and furhter references *
14 * to the description of the model plesase refer to: nucl-th/0011222, *
15 * accessibile at: http://www.arxiv.org/nucl-th/0011222 *
16 * *
17 * Homepage: http://hirg.if.pw.edu.pl/en/therminator/ *
18 * *
19 * This code can be freely used and redistributed. However if you decide to *
20 * make modifications to the code, please contact the authors, especially *
21 * if you plan to publish the results obtained with such modified code. *
22 * Any publication of results obtained using this code must include the *
23 * reference to nucl-ex/0011222 and the published version of it, when *
24 * available. *
25 * *
26 *****************************************************************************/
27#include "ParticleDB.h"
28
29ParticleDB::ParticleDB()
30{
31 mParticleTable.clear();
32 mParticleNames.clear();
33}
34
35ParticleDB::~ParticleDB()
36{
37}
38
39int
40ParticleDB::AddParticleType(ParticleType *aPartType)
41{
42 mParticleTable.push_back(*aPartType);
43 mParticleNames[aPartType->GetName()] = mParticleTable.size()-1;
44 return mParticleTable.size()-1;
45}
46
47ParticleType*
48ParticleDB::GetParticleType(int aIndex)
49{
50 return &(mParticleTable[aIndex]);
51}
52
53ParticleType*
54ParticleDB::GetParticleType(std::string aName)
55{
56 return &(mParticleTable[mParticleNames[aName]]);
57}
58
59int
60ParticleDB::GetParticleTypeIndex(std::string aName)
61{
62 return mParticleNames[aName];
63}
64
65int
66ParticleDB::GetParticleTypeCount()
67{
68 return mParticleTable.size();
69}
70
71int
72ParticleDB::ExistsParticleType(std::string aName)
73{
74 return mParticleNames.count(aName);
75}