]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/EvtGenBase/EvtStringParticle.cxx
Adding CMakeLists.txt
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtStringParticle.cxx
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: EvtStringParticle.cc
12 //
13 // Description: Class to describe the partons that are produced in JetSet.
14 //
15 // Modification history:
16 //
17 //    RYD       Febuary 27,1998       Module created
18 //
19 //------------------------------------------------------------------------
20 // 
21 #include "EvtGenBase/EvtPatches.hh"
22 #include <iostream>
23 #include <math.h>
24 #include <stdlib.h>
25 #include "EvtGenBase/EvtStringParticle.hh"
26 #include "EvtGenBase/EvtVector4R.hh"
27 #include "EvtGenBase/EvtReport.hh"
28
29
30 EvtStringParticle::~EvtStringParticle(){
31
32   if (_npartons!=0){
33     
34     delete [] _p4partons;
35     delete [] _idpartons;
36     
37   }
38
39 }
40
41
42 EvtStringParticle::EvtStringParticle(){
43
44   _p4partons=0;
45   _idpartons=0;
46   _npartons=0;
47
48   return;
49   
50 }
51
52 void EvtStringParticle::init(EvtId id, const EvtVector4R& p4){
53
54   _validP4=true;
55   setp(p4);
56   setpart_num(id);
57
58 }
59
60
61 void EvtStringParticle::initPartons(int npartons,
62                               EvtVector4R* p4partons,EvtId* idpartons){
63
64   _p4partons = new EvtVector4R[npartons];
65   _idpartons = new EvtId[npartons];
66
67   int i;
68
69   _npartons=npartons;
70
71   for(i=0;i<npartons;i++){
72
73     _p4partons[i]=p4partons[i];
74     _idpartons[i]=idpartons[i];
75
76   }
77
78 }
79
80 int EvtStringParticle::getNPartons(){
81
82   return _npartons;
83
84 }
85
86 EvtId EvtStringParticle::getIdParton(int i){
87
88   return _idpartons[i];
89
90 }
91
92 EvtVector4R EvtStringParticle::getP4Parton(int i){
93
94   return _p4partons[i];
95
96 }
97   
98 EvtSpinDensity EvtStringParticle::rotateToHelicityBasis() const{
99
100   report(ERROR,"EvtGen") << "rotateToHelicityBasis not implemented for strin particle."; 
101   report(ERROR,"EvtGen") << "Will terminate execution."; 
102
103   ::abort();
104
105   EvtSpinDensity rho;
106   return rho;
107
108 }
109
110 EvtSpinDensity EvtStringParticle::rotateToHelicityBasis(double,
111                                                         double,
112                                                         double) const{
113
114   report(ERROR,"EvtGen") << "rotateToHelicityBasis(alpha,beta,gamma) not implemented for string particle."; 
115   report(ERROR,"EvtGen") << "Will terminate execution."; 
116
117   ::abort();
118
119   EvtSpinDensity rho;
120   return rho;
121
122 }
123
124