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.
EvtSpinType.cpp
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 
22 
23 #include "EvtGenBase/EvtPatches.hh"
24 #include "EvtGenBase/EvtReport.hh"
25 
27 {
28  switch ( stype ) {
29  case SCALAR:
30  case STRING:
31  return 0;
32  case DIRAC:
33  case NEUTRINO:
34  return 1;
35  case VECTOR:
36  case PHOTON:
37  return 2;
38  case RARITASCHWINGER:
39  return 3;
40  case TENSOR:
41  return 4;
42  case SPIN5HALF:
43  return 5;
44  case SPIN3:
45  return 6;
46  case SPIN7HALF:
47  return 7;
48  case SPIN4:
49  return 8;
50  default:
51  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
52  << "Unknown spintype in EvtSpinType!" << std::endl;
53  return 0;
54  }
55 }
56 
58 {
59  switch ( stype ) {
60  case SCALAR:
61  case STRING:
62  case NEUTRINO:
63  return 1;
64  case DIRAC:
65  case PHOTON:
66  return 2;
67  case VECTOR:
68  return 3;
69  case RARITASCHWINGER:
70  return 4;
71  case TENSOR:
72  return 5;
73  case SPIN5HALF:
74  return 6;
75  case SPIN3:
76  return 7;
77  case SPIN7HALF:
78  return 8;
79  case SPIN4:
80  return 9;
81  default:
82  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
83  << "Unknown spintype in EvtSpinType!" << std::endl;
84  return 0;
85  }
86 }
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
static int getSpinStates(spintype stype)
Definition: EvtSpinType.cpp:57
static int getSpin2(spintype stype)
Definition: EvtSpinType.cpp:26