Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFParticleDatabase.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KFParticleDatabase.h
1 /*
2  * This file is part of KFParticle package
3  * Copyright (C) 2007-2019 FIAS Frankfurt Institute for Advanced Studies
4  * 2007-2019 Goethe University of Frankfurt
5  * 2007-2019 Ivan Kisel <I.Kisel@compeng.uni-frankfurt.de>
6  * 2007-2019 Maksym Zyzak
7  *
8  * KFParticle is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * KFParticle is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 
23 #ifndef KFParticleDatabase_H
24 #define KFParticleDatabase_H
25 
26 #include "Vc/Vc"
27 
41 {
42  public:
44 
46 
47  float GetMass(const int pdg) const
48  {
53  int pdgIndex = 2;
54  switch ( abs(pdg) )
55  {
56  case 11: pdgIndex = 0; break;
57  case 13: pdgIndex = 1; break;
58  case 19: pdgIndex = 1; break;
59  case 211: pdgIndex = 2; break;
60  case 321: pdgIndex = 3; break;
61  case 2212: pdgIndex = 4; break;
62  case 1000010020: pdgIndex = 5; break;
63  case 1000010030: pdgIndex = 6; break;
64  case 1000020030: pdgIndex = 7; break;
65  case 1000020040: pdgIndex = 8; break;
66  case 3112: pdgIndex = 9; break;
67  case 3222: pdgIndex = 10; break;
68  case 3312: pdgIndex = 11; break;
69  case 3334: pdgIndex = 12; break;
70  default: pdgIndex = 2; break;
71  }
72 
73  return fMass[pdgIndex];
74  }
75 
76  Vc::float_v GetMass(const Vc::int_v& pdg) const
77  {
82  Vc::int_v pdgIndex(2);
83  pdgIndex(Vc::abs(pdg) == 11) = 0;
84  pdgIndex(Vc::abs(pdg) == 13) = 1;
85  pdgIndex(Vc::abs(pdg) == 19) = 1;
86  pdgIndex(Vc::abs(pdg) == 211) = 2;
87  pdgIndex(Vc::abs(pdg) == 321) = 3;
88  pdgIndex(Vc::abs(pdg) == 2212) = 4;
89  pdgIndex(Vc::abs(pdg) == 1000010020) = 5;
90  pdgIndex(Vc::abs(pdg) == 1000010030) = 6;
91  pdgIndex(Vc::abs(pdg) == 1000020030) = 7;
92  pdgIndex(Vc::abs(pdg) == 1000020040) = 8;
93  pdgIndex(Vc::abs(pdg) == 3112) = 9;
94  pdgIndex(Vc::abs(pdg) == 3222) = 10;
95  pdgIndex(Vc::abs(pdg) == 3312) = 11;
96  pdgIndex(Vc::abs(pdg) == 3334) = 12;
97  Vc::float_v mass(fMass, pdgIndex);
98  return mass;
99  }
100 
101  void GetMotherMass(const Vc::int_v& pdg, Vc::float_v& massMotherPDG, Vc::float_v& massMotherPDGSigma) const
102  {
111  Vc::int_v pdgIndex(0);
112  pdgIndex(pdg == 310) = 0;
113  pdgIndex(Vc::abs(pdg) == 3122) = 1;
114  pdgIndex(Vc::abs(pdg) == 3312) = 2;
115  pdgIndex(pdg == 22) = 3;
116  pdgIndex(Vc::abs(pdg) == 3334) = 4;
117  pdgIndex(Vc::abs(pdg) == 3004) = 5;
118  pdgIndex(Vc::abs(pdg) == 3006) = 6;
119  pdgIndex(Vc::abs(pdg) == 3007) = 7;
120 
121  massMotherPDG.gather(fMassSecPDG, pdgIndex);
122  massMotherPDGSigma.gather(fMassSecPDGSigma, pdgIndex);
123  }
124 
125  void GetMotherMass(const int pdg, float& massMotherPDG, float& massMotherPDGSigma) const
126  {
135  int pdgIndex = 2;
136  switch ( abs(pdg) )
137  {
138  case 310: pdgIndex = 0; break;
139  case 3122: pdgIndex = 1; break;
140  case 3312: pdgIndex = 2; break;
141  case 22: pdgIndex = 3; break;
142  case 3334: pdgIndex = 4; break;
143  case 3004: pdgIndex = 5; break;
144  case 3006: pdgIndex = 6; break;
145  case 3007: pdgIndex = 7; break;
146  default: pdgIndex = 0; break;
147  }
148 
149  massMotherPDG = fMassSecPDG[pdgIndex];
150  massMotherPDGSigma = fMassSecPDGSigma[pdgIndex];
151  }
152 
153  const float& GetPi0Mass() const { return fMassPi0PDG; }
154  const float& GetPi0MassSigma() const { return fMassPi0PDGSigma; }
155  const float& GetD0Mass() const { return fMassD0PDG; }
156  const float& GetD0MassSigma() const { return fMassD0PDGSigma; }
157  const float& GetDPlusMass() const { return fMassDPlusPDG; }
158  const float& GetDPlusMassSigma() const { return fMassDPlusPDGSigma; }
159 
160  static const KFParticleDatabase* Instance() { return fDatabase; }
161 
162  private:
166  float fMass[13];
167 
170  float fMassSecPDG[8];
174 
175  float fMassPi0PDG;
177 
178  float fMassD0PDG;
182 
184 };
185 
186 #endif