00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "EvtGenBase/EvtPatches.hh"
00024 #include "EvtGenBase/EvtPatches.hh"
00025 #include "EvtGenBase/EvtIdSet.hh"
00026 #include "EvtGenBase/EvtParticle.hh"
00027 #include "EvtGenBase/EvtPhotonParticle.hh"
00028 #include "EvtGenBase/EvtPDL.hh"
00029 #include "EvtGenModels/EvtPHOTOS.hh"
00030
00031 extern "C" void begevtgenstorex_(int *,int *,int *,int *,
00032 int *,int *,int *,int *,
00033 double *,double *,double *,
00034 double *,double *,double *,
00035 double *,double *,double *);
00036
00037 extern "C" void begevtgengetx_(int *,int *,int *,int *,
00038 int *,int *,int *,int *,
00039 double *,double *,double *,
00040 double *,double *,double *,
00041 double *,double *,double *);
00042
00043 extern "C" void heplst_(int *);
00044
00045 extern "C" void photos_(int *);
00046
00047 extern "C" void phoini_();
00048
00049
00050 void EvtPHOTOS::doRadCorr( EvtParticle *p){
00051
00052 static int first=1;
00053
00054
00055 static EvtId GAMM=EvtPDL::getId("gammaFSR");
00056
00057 if (first) {
00058
00059 first=0;
00060 phoini_();
00061 }
00062
00063 int entry,eventnum,numparticle,istat,partnum,mother;
00064 int daugfirst,dauglast;
00065
00066 int numparticlephotos;
00067
00068 double px,py,pz,e,m,x,y,z,t;
00069
00070 static EvtId dq=EvtPDL::getId("d");
00071 static EvtId adq=EvtPDL::getId("anti-d");
00072 static EvtId uq=EvtPDL::getId("u");
00073 static EvtId auq=EvtPDL::getId("anti-u");
00074 static EvtId sq=EvtPDL::getId("s");
00075 static EvtId asq=EvtPDL::getId("anti-s");
00076 static EvtId cq=EvtPDL::getId("c");
00077 static EvtId acq=EvtPDL::getId("anti-c");
00078 static EvtId bq=EvtPDL::getId("b");
00079 static EvtId abq=EvtPDL::getId("anti-b");
00080 static EvtId tq=EvtPDL::getId("t");
00081 static EvtId atq=EvtPDL::getId("anti-t");
00082 static EvtIdSet quarks(dq,adq,uq,auq,sq,asq,cq,acq,bq,abq,tq,atq);\
00083
00084 px=0.0;
00085 py=0.0;
00086 pz=0.0;
00087 e=p->mass();
00088 m=p->mass();
00089 x=0.0;
00090 y=0.0;
00091 z=0.0;
00092 t=0.0;
00093
00094 entry=1;
00095 eventnum=1;
00096 numparticle=1;
00097 istat=2;
00098 partnum=EvtPDL::getStdHep(p->getId());
00099 mother=0;
00100 daugfirst=2;
00101 dauglast=1+p->getNDaug();
00102
00103 begevtgenstorex_(&entry,&eventnum,&numparticle,&istat,&partnum,
00104 &mother,&daugfirst,&dauglast,
00105 &px,&py,&pz,&e,&m,&x,&y,&z,&t);
00106
00107 int i;
00108
00109 for(i=0;i<p->getNDaug();i++){
00110
00111
00112 if (quarks.contains(p->getDaug(i)->getId())==1) continue;
00113
00114 px=p->getDaug(i)->getP4().get(1);
00115 py=p->getDaug(i)->getP4().get(2);
00116 pz=p->getDaug(i)->getP4().get(3);
00117 e=p->getDaug(i)->getP4().get(0);
00118 m=p->getDaug(i)->mass();
00119 x=0.0;
00120 y=0.0;
00121 z=0.0;
00122 t=0.0;
00123
00124
00125 entry+=1;
00126 eventnum=1;
00127 numparticle+=1;
00128 istat=1;
00129 partnum=EvtPDL::getStdHep(p->getDaug(i)->getId());
00130 mother=1;
00131 daugfirst=0;
00132 dauglast=0;
00133
00134 begevtgenstorex_(&entry,&eventnum,&numparticle,&istat,&partnum,
00135 &mother,&daugfirst,&dauglast,
00136 &px,&py,&pz,&e,&m,&x,&y,&z,&t);
00137
00138
00139 }
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149 entry=1;
00150
00151
00152 photos_(&entry);
00153
00154 begevtgengetx_(&entry,&eventnum,&numparticlephotos,&istat,&partnum,
00155 &mother,&daugfirst,&dauglast,
00156 &px,&py,&pz,&e,&m,&x,&y,&z,&t);
00157
00158
00159
00160
00161 if (numparticle==numparticlephotos) return;
00162
00163 EvtVector4R new4mom;
00164
00165 int np;
00166
00167 for(i=0;i<p->getNDaug();i++){
00168
00169 entry=i+2;
00170
00171 begevtgengetx_(&entry,&eventnum,&np,&istat,&partnum,
00172 &mother,&daugfirst,&dauglast,
00173 &px,&py,&pz,&e,&m,&x,&y,&z,&t);
00174
00175
00176
00177 double mp=p->getDaug(i)->mass();
00178 e=sqrt(mp*mp+px*px+py*py+pz*pz);
00179
00180 new4mom.set(e,px,py,pz);
00181
00182 p->getDaug(i)->setP4(new4mom);
00183
00184 }
00185
00186 for(entry=numparticle+1;entry<=numparticlephotos;entry++){
00187
00188 begevtgengetx_(&entry,&eventnum,&np,&istat,&partnum,
00189 &mother,&daugfirst,&dauglast,
00190 &px,&py,&pz,&e,&m,&x,&y,&z,&t);
00191
00192 new4mom.set(e,px,py,pz);
00193
00194
00195
00196 EvtPhotonParticle* gamma;
00197 gamma=new EvtPhotonParticle;
00198 gamma->init(GAMM,new4mom);
00199
00200 gamma->addDaug(p);
00201
00202
00203
00204 }
00205 return ;
00206 }
00207