Line data Source code
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 :
28 : int EvtSpinType::getSpin2(spintype stype){
29 :
30 0 : switch (stype){
31 : case SCALAR: case STRING:
32 0 : return 0;
33 : case DIRAC: case NEUTRINO:
34 0 : return 1;
35 : case VECTOR: case PHOTON:
36 0 : return 2;
37 : case RARITASCHWINGER:
38 0 : return 3;
39 : case TENSOR:
40 0 : return 4;
41 : case SPIN5HALF:
42 0 : return 5;
43 : case SPIN3:
44 0 : return 6;
45 : case SPIN7HALF:
46 0 : return 7;
47 : case SPIN4:
48 0 : return 8;
49 : default:
50 0 : report(Severity::Error,"EvtGen")<<"Unknown spintype in EvtSpinType!"<<std::endl;
51 0 : return 0;
52 : }
53 :
54 0 : }
55 :
56 :
57 :
58 : int EvtSpinType::getSpinStates(spintype stype){
59 :
60 0 : switch (stype){
61 : case SCALAR: case STRING: case NEUTRINO:
62 0 : return 1;
63 : case DIRAC: case PHOTON:
64 0 : return 2;
65 : case VECTOR:
66 0 : return 3;
67 : case RARITASCHWINGER:
68 0 : return 4;
69 : case TENSOR:
70 0 : return 5;
71 : case SPIN5HALF:
72 0 : return 6;
73 : case SPIN3:
74 0 : return 7;
75 : case SPIN7HALF:
76 0 : return 8;
77 : case SPIN4:
78 0 : return 9;
79 : default:
80 0 : report(Severity::Error,"EvtGen")<<"Unknown spintype in EvtSpinType!"<<std::endl;
81 0 : return 0;
82 : }
83 :
84 0 : }
|