]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/EvtGenBase/EvtSpinType.cpp
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtSpinType.cpp
CommitLineData
da0e9ce3 1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 1998 Caltech, UCSB
10//
11// Module: EvtGenBase/EvtSpinType.cc
12//
13// Description: Class for enumarating the different types of
14// particles and the number of states they have.
15//
16// Modification history:
17//
18// RYD Jan 26, 2006 Module created
19//
20//------------------------------------------------------------------------
21
22
23#include "EvtGenBase/EvtPatches.hh"
24#include "EvtGenBase/EvtReport.hh"
25#include "EvtGenBase/EvtSpinType.hh"
26
27
28int EvtSpinType::getSpin2(spintype stype){
29
30 switch (stype){
31 case SCALAR: case STRING:
32 return 0;
33 case DIRAC: case NEUTRINO:
34 return 1;
35 case VECTOR: case PHOTON:
36 return 2;
37 case RARITASCHWINGER:
38 return 3;
39 case TENSOR:
40 return 4;
41 case SPIN5HALF:
42 return 5;
43 case SPIN3:
44 return 6;
45 case SPIN7HALF:
46 return 7;
47 case SPIN4:
48 return 8;
49 default:
50 report(ERROR,"EvtGen")<<"Unknown spintype in EvtSpinType!"<<std::endl;
51 return 0;
52 }
53
54}
55
56
57
58int EvtSpinType::getSpinStates(spintype stype){
59
60 switch (stype){
61 case SCALAR: case STRING: case NEUTRINO:
62 return 1;
63 case DIRAC: case PHOTON:
64 return 2;
65 case VECTOR:
66 return 3;
67 case RARITASCHWINGER:
68 return 4;
69 case TENSOR:
70 return 5;
71 case SPIN5HALF:
72 return 6;
73 case SPIN3:
74 return 7;
75 case SPIN7HALF:
76 return 8;
77 case SPIN4:
78 return 9;
79 default:
80 report(ERROR,"EvtGen")<<"Unknown spintype in EvtSpinType!"<<std::endl;
81 return 0;
82 }
83
84}