evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtPDL.hh
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
21 #ifndef EVTPDL_HH
22 #define EVTPDL_HH
23 
24 #include "EvtGenBase/EvtId.hh"
28 
29 #include <map>
30 #include <vector>
31 #include <string>
32 #include <iostream>
33 
34 const int SPIN_NAME_LENGTH = 100;
35 
36 class EvtPDL final {
37  public:
38  EvtPDL();
39 
40  void read( const std::string& fname );
41  void readPDT( std::istream& data );
42 
43  static double getMeanMass( EvtId i );
44  static double getMass( EvtId i );
45  static double getRandMass( EvtId i, EvtId* parId, int nDaug, EvtId* dauId,
46  EvtId* othDaugId, double maxMass,
47  double* dauMasses );
48  static double getMassProb( EvtId i, double mass, double massPar, int nDaug,
49  double* massDau );
50 
51  static double getMaxMass( EvtId i );
52  static double getMinMass( EvtId i );
53  //the number we got from PDT
54  static double getMaxRange( EvtId i );
55  static double getWidth( EvtId i );
56  static double getctau( EvtId i );
57  static int getStdHep( EvtId id );
58  static int getLundKC( EvtId id );
59 
60  // Function to retrieve EvtId from PythiaID
61  static EvtId evtIdFromLundKC( int pythiaId );
62  static EvtId evtIdFromStdHep( int stdhep );
63  static EvtId chargeConj( EvtId id );
64  static int chg3( EvtId i );
66  static EvtId getId( const std::string& name );
67  static std::string name( EvtId i );
68  static void alias( EvtId num, const std::string& newname );
69  static void aliasChgConj( EvtId a, EvtId abar );
70  static size_t entries();
71  static EvtId getEntry( int i );
72  static void reSetMass( EvtId i, double mass );
73  static void reSetWidth( EvtId i, double width );
74  static void reSetMassMin( EvtId i, double mass );
75  static void reSetMassMax( EvtId i, double mass );
76  static void reSetBlatt( EvtId i, double blatt );
77  static void reSetBlattBirth( EvtId i, double blatt );
78  static void includeBirthFactor( EvtId i, bool yesno );
79  static void includeDecayFactor( EvtId i, bool yesno );
80  static void changeLS( EvtId i, std::string& newLS );
81  static void setPWForDecay( EvtId i, int spin, EvtId d1, EvtId d2 );
82  static void setPWForBirthL( EvtId i, int spin, EvtId par, EvtId othD );
83 
84  private:
85  void setUpConstsPdt();
86 
87  static unsigned int _firstAlias;
88  static int _nentries;
89 
90  static std::vector<EvtPartProp>& partlist()
91  {
92  static std::vector<EvtPartProp> s_partlist;
93  return s_partlist;
94  }
95 
96  static std::map<std::string, int> _particleNameLookup;
97 
98 }; // EvtPDL.h
99 
100 #endif
static unsigned int _firstAlias
Definition: EvtPDL.hh:87
static void reSetMass(EvtId i, double mass)
Definition: EvtPDL.cpp:397
static int _nentries
Definition: EvtPDL.hh:88
static std::string name(EvtId i)
Definition: EvtPDL.cpp:382
static std::vector< EvtPartProp > & partlist()
Definition: EvtPDL.hh:90
static void reSetMassMin(EvtId i, double mass)
Definition: EvtPDL.cpp:407
static EvtId evtIdFromLundKC(int pythiaId)
Definition: EvtPDL.cpp:302
const int SPIN_NAME_LENGTH
Definition: EvtPDL.hh:34
static EvtId getEntry(int i)
Definition: EvtPDL.cpp:392
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.cpp:377
void setUpConstsPdt()
Definition: EvtPDL.cpp:297
void read(const std::string &fname)
Definition: EvtPDL.cpp:54
static void reSetWidth(EvtId i, double width)
Definition: EvtPDL.cpp:402
static double getMassProb(EvtId i, double mass, double massPar, int nDaug, double *massDau)
Definition: EvtPDL.cpp:331
static int getLundKC(EvtId id)
Definition: EvtPDL.cpp:367
static void setPWForDecay(EvtId i, int spin, EvtId d1, EvtId d2)
Definition: EvtPDL.cpp:442
static std::map< std::string, int > _particleNameLookup
Definition: EvtPDL.hh:96
static double getctau(EvtId i)
Definition: EvtPDL.cpp:357
static void reSetBlatt(EvtId i, double blatt)
Definition: EvtPDL.cpp:417
static void includeDecayFactor(EvtId i, bool yesno)
Definition: EvtPDL.cpp:432
static double getMeanMass(EvtId i)
Definition: EvtPDL.cpp:314
void readPDT(std::istream &data)
Definition: EvtPDL.cpp:66
static void alias(EvtId num, const std::string &newname)
Definition: EvtPDL.cpp:256
static int chg3(EvtId i)
Definition: EvtPDL.cpp:372
static void reSetBlattBirth(EvtId i, double blatt)
Definition: EvtPDL.cpp:422
Definition: EvtId.hh:27
static double getMinMass(EvtId i)
Definition: EvtPDL.cpp:342
static size_t entries()
Definition: EvtPDL.cpp:387
static EvtId evtIdFromStdHep(int stdhep)
Definition: EvtPDL.cpp:246
static void changeLS(EvtId i, std::string &newLS)
Definition: EvtPDL.cpp:437
static EvtId getId(const std::string &name)
Definition: EvtPDL.cpp:287
static double getWidth(EvtId i)
Definition: EvtPDL.cpp:352
EvtPDL()
Definition: EvtPDL.cpp:45
Definition: EvtPDL.hh:36
static void aliasChgConj(EvtId a, EvtId abar)
Definition: EvtPDL.cpp:191
static void reSetMassMax(EvtId i, double mass)
Definition: EvtPDL.cpp:412
static double getMaxRange(EvtId i)
Definition: EvtPDL.cpp:347
static void setPWForBirthL(EvtId i, int spin, EvtId par, EvtId othD)
Definition: EvtPDL.cpp:447
static double getMass(EvtId i)
Definition: EvtPDL.cpp:319
static EvtId chargeConj(EvtId id)
Definition: EvtPDL.cpp:207
static int getStdHep(EvtId id)
Definition: EvtPDL.cpp:362
static double getMaxMass(EvtId i)
Definition: EvtPDL.cpp:337
static void includeBirthFactor(EvtId i, bool yesno)
Definition: EvtPDL.cpp:427
static double getRandMass(EvtId i, EvtId *parId, int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses)
Definition: EvtPDL.cpp:324