#include <EvtPHOTOS.hh>
Inheritance diagram for EvtPHOTOS:
Public Member Functions | |
void | doRadCorr (EvtParticle *p) |
Definition at line 30 of file EvtPHOTOS.hh.
void EvtPHOTOS::doRadCorr | ( | EvtParticle * | p | ) | [virtual] |
Implements EvtAbsRadCorr.
Definition at line 50 of file EvtPHOTOS.cc.
References EvtParticle::addDaug(), begevtgengetx_(), begevtgenstorex_(), EvtIdSet::contains(), first, EvtVector4R::get(), EvtParticle::getDaug(), EvtParticle::getId(), EvtPDL::getId(), EvtParticle::getNDaug(), EvtParticle::getP4(), EvtPDL::getStdHep(), genRecEmupikp::i, EvtPhotonParticle::init(), EvtParticle::mass(), mp, phoini_(), photos_(), EvtVector4R::set(), EvtParticle::setP4(), t(), and x.
00050 { 00051 00052 static int first=1; 00053 00054 //added by Lange Jan4,2000 00055 static EvtId GAMM=EvtPDL::getId("gammaFSR"); //pingrg, 2009/02/19 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 // std::cout << EvtPDL::name(p->getId()) <<" " ; 00109 for(i=0;i<p->getNDaug();i++){ 00110 00111 //No quarks to photos 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 // std::cout << EvtPDL::name(p->getDaug(i)->getId()) << " " ; 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 // std::cout << std::endl; 00141 //can't use heplst since the common block used by the BaBar 00142 //implementation of PHOTOS is renamed due to real*4 vs real*8 00143 //problems. 00144 00145 //int mlst=1; 00146 00147 //heplst_(&mlst); 00148 00149 entry=1; 00150 00151 // report(INFO,"EvtGen") << "Doing photos " << EvtPDL::name(p->getId()) << endl; 00152 photos_(&entry); 00153 // report(INFO,"EvtGen") << "done\n"; 00154 begevtgengetx_(&entry,&eventnum,&numparticlephotos,&istat,&partnum, 00155 &mother,&daugfirst,&dauglast, 00156 &px,&py,&pz,&e,&m,&x,&y,&z,&t); 00157 00158 00159 //report(INFO,"EvtGen") << "numparticlephotos:"<<numparticlephotos<<endl; 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 //this is needed to ensure that photos does not 00176 //change the masses. But it will violate energy conservation! 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 //new4mom.dump(); 00195 00196 EvtPhotonParticle* gamma; 00197 gamma=new EvtPhotonParticle; 00198 gamma->init(GAMM,new4mom); 00199 // report(INFO,"EvtGen") << gamma << " " << p << " "<< px << " " << py << " " << pz << " " << p->getNDaug() << " " << EvtPDL::name(p->getId())<<" " << entry << " " <<numparticlephotos<<endl; 00200 gamma->addDaug(p); 00201 00202 // p->getDaug(i)->set_type(EvtSpinType::PHOTON); 00203 00204 } 00205 return ; 00206 }