BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtPHOTOS.cc
Go to the documentation of this file.
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: EvtPHOTOS.cc
12//
13// Description: This routine takes the particle *p and applies
14// the PHOTOS package to generate final state radiation
15// on the produced mesons.
16//
17// Modification history:
18//
19// RYD October 1, 1997 Module created
20//
21//------------------------------------------------------------------------
22//
28#include "EvtGenBase/EvtPDL.hh"
30
31extern "C" void begevtgenstorex_(int *,int *,int *,int *,
32 int *,int *,int *,int *,
33 double *,double *,double *,
34 double *,double *,double *,
35 double *,double *,double *);
36
37extern "C" void begevtgengetx_(int *,int *,int *,int *,
38 int *,int *,int *,int *,
39 double *,double *,double *,
40 double *,double *,double *,
41 double *,double *,double *);
42
43extern "C" void heplst_(int *);
44
45extern "C" void photos_(int *);
46
47extern "C" void phoini_();
48
49
51
52 static int first=1;
53
54 //added by Lange Jan4,2000
55 static EvtId GAMM=EvtPDL::getId("gammaFSR"); //pingrg, 2009/02/19
56
57 if (first) {
58
59 first=0;
60 phoini_();
61 }
62
63 int entry,eventnum,numparticle,istat,partnum,mother;
64 int daugfirst,dauglast;
65
66 int numparticlephotos;
67
68 double px,py,pz,e,m,x,y,z,t;
69
70 static EvtId dq=EvtPDL::getId("d");
71 static EvtId adq=EvtPDL::getId("anti-d");
72 static EvtId uq=EvtPDL::getId("u");
73 static EvtId auq=EvtPDL::getId("anti-u");
74 static EvtId sq=EvtPDL::getId("s");
75 static EvtId asq=EvtPDL::getId("anti-s");
76 static EvtId cq=EvtPDL::getId("c");
77 static EvtId acq=EvtPDL::getId("anti-c");
78 static EvtId bq=EvtPDL::getId("b");
79 static EvtId abq=EvtPDL::getId("anti-b");
80 static EvtId tq=EvtPDL::getId("t");
81 static EvtId atq=EvtPDL::getId("anti-t");
82 static EvtIdSet quarks(dq,adq,uq,auq,sq,asq,cq,acq,bq,abq,tq,atq);\
83
84 px=0.0;
85 py=0.0;
86 pz=0.0;
87 e=p->mass();
88 m=p->mass();
89 x=0.0;
90 y=0.0;
91 z=0.0;
92 t=0.0;
93
94 entry=1;
95 eventnum=1;
96 numparticle=1;
97 istat=2;
98 partnum=EvtPDL::getStdHep(p->getId());
99 mother=0;
100 daugfirst=2;
101 dauglast=1+p->getNDaug();
102
103 begevtgenstorex_(&entry,&eventnum,&numparticle,&istat,&partnum,
104 &mother,&daugfirst,&dauglast,
105 &px,&py,&pz,&e,&m,&x,&y,&z,&t);
106
107 int i;
108 // std::cout << EvtPDL::name(p->getId()) <<" " ;
109 for(i=0;i<p->getNDaug();i++){
110
111 //No quarks to photos
112 if (quarks.contains(p->getDaug(i)->getId())==1) continue;
113
114 px=p->getDaug(i)->getP4().get(1);
115 py=p->getDaug(i)->getP4().get(2);
116 pz=p->getDaug(i)->getP4().get(3);
117 e=p->getDaug(i)->getP4().get(0);
118 m=p->getDaug(i)->mass();
119 x=0.0;
120 y=0.0;
121 z=0.0;
122 t=0.0;
123
124 // std::cout << EvtPDL::name(p->getDaug(i)->getId()) << " " ;
125 entry+=1;
126 eventnum=1;
127 numparticle+=1;
128 istat=1;
129 partnum=EvtPDL::getStdHep(p->getDaug(i)->getId());
130 mother=1;
131 daugfirst=0;
132 dauglast=0;
133
134 begevtgenstorex_(&entry,&eventnum,&numparticle,&istat,&partnum,
135 &mother,&daugfirst,&dauglast,
136 &px,&py,&pz,&e,&m,&x,&y,&z,&t);
137
138
139 }
140 // std::cout << std::endl;
141 //can't use heplst since the common block used by the BaBar
142 //implementation of PHOTOS is renamed due to real*4 vs real*8
143 //problems.
144
145 //int mlst=1;
146
147 //heplst_(&mlst);
148
149 entry=1;
150
151 // report(INFO,"EvtGen") << "Doing photos " << EvtPDL::name(p->getId()) << endl;
152 photos_(&entry);
153 // report(INFO,"EvtGen") << "done\n";
154 begevtgengetx_(&entry,&eventnum,&numparticlephotos,&istat,&partnum,
155 &mother,&daugfirst,&dauglast,
156 &px,&py,&pz,&e,&m,&x,&y,&z,&t);
157
158
159 //report(INFO,"EvtGen") << "numparticlephotos:"<<numparticlephotos<<endl;
160
161 if (numparticle==numparticlephotos) return;
162
163 EvtVector4R new4mom;
164
165 int np;
166
167 for(i=0;i<p->getNDaug();i++){
168
169 entry=i+2;
170
171 begevtgengetx_(&entry,&eventnum,&np,&istat,&partnum,
172 &mother,&daugfirst,&dauglast,
173 &px,&py,&pz,&e,&m,&x,&y,&z,&t);
174
175 //this is needed to ensure that photos does not
176 //change the masses. But it will violate energy conservation!
177 double mp=p->getDaug(i)->mass();
178 e=sqrt(mp*mp+px*px+py*py+pz*pz);
179
180 new4mom.set(e,px,py,pz);
181
182 p->getDaug(i)->setP4(new4mom);
183
184 }
185
186 for(entry=numparticle+1;entry<=numparticlephotos;entry++){
187
188 begevtgengetx_(&entry,&eventnum,&np,&istat,&partnum,
189 &mother,&daugfirst,&dauglast,
190 &px,&py,&pz,&e,&m,&x,&y,&z,&t);
191
192 new4mom.set(e,px,py,pz);
193
194 //new4mom.dump();
195
196 EvtPhotonParticle* gamma;
197 gamma=new EvtPhotonParticle;
198 gamma->init(GAMM,new4mom);
199 // report(INFO,"EvtGen") << gamma << " " << p << " "<< px << " " << py << " " << pz << " " << p->getNDaug() << " " << EvtPDL::name(p->getId())<<" " << entry << " " <<numparticlephotos<<endl;
200 gamma->addDaug(p);
201
202// p->getDaug(i)->set_type(EvtSpinType::PHOTON);
203
204 }
205 return ;
206}
207
Double_t x[10]
void begevtgengetx_(int *, int *, int *, int *, int *, int *, int *, int *, double *, double *, double *, double *, double *, double *, double *, double *, double *)
void begevtgenstorex_(int *, int *, int *, int *, int *, int *, int *, int *, double *, double *, double *, double *, double *, double *, double *, double *, double *)
void photos_(int *)
void heplst_(int *)
void phoini_()
TTree * t
Definition binning.cxx:23
int contains(const EvtId id)
Definition EvtIdSet.cc:507
Definition EvtId.hh:27
static int getStdHep(EvtId id)
Definition EvtPDL.hh:56
static EvtId getId(const std::string &name)
Definition EvtPDL.cc:287
void doRadCorr(EvtParticle *p)
Definition EvtPHOTOS.cc:50
EvtId getId() const
const EvtVector4R & getP4() const
void setP4(const EvtVector4R &p4)
int getNDaug() const
EvtParticle * getDaug(int i)
double mass() const
void addDaug(EvtParticle *node)
void init(EvtId part_n, double e, double px, double py, double pz)
double get(int i) const
void set(int i, double d)
double y[1000]
const double mp