1 #include "TauolaParticle.h"
35 double x2 = other_particle->
getPx();
36 double y2 = other_particle->
getPy();
37 double z2 = other_particle->
getPz();
39 return acos( (x1*x2+y1*y2+z1*z2) / sqrt((x1*x1+y1*y1+z1*z1)*(x2*x2+y2*y2+z2*z2)) );
80 vector<TauolaParticle*>::iterator pcl_itr = daughters.begin();
83 for(;pcl_itr != daughters.end();pcl_itr++){
84 if((*pcl_itr)->getPdgID()==this->
getPdgID())
85 return (*pcl_itr)->findLastSelf();
92 vector<TauolaParticle*> mothers =
getMothers();
93 vector<TauolaParticle*>::iterator pcl_itr = mothers.begin();
96 for(;pcl_itr != mothers.end();pcl_itr++){
97 if((*pcl_itr)->getPdgID()==this->
getPdgID())
98 return (*pcl_itr)->findProductionMothers();
123 catch(std::out_of_range d) {
break;}
133 pp[3]=x_copy->
getE();
134 pp[0]=x_copy->
getPx();
135 pp[1]=x_copy->
getPy();
136 pp[2]=x_copy->
getPz();
146 catch(std::out_of_range d) {
break;}
156 pp[3]=x_copy->
getE();
157 pp[0]=x_copy->
getPx();
158 pp[1]=x_copy->
getPy();
159 pp[2]=x_copy->
getPz();
169 catch(std::out_of_range d) {
break;}
179 pp[3]=x_copy->
getE();
180 pp[0]=x_copy->
getPx();
181 pp[1]=x_copy->
getPy();
182 pp[2]=x_copy->
getPz();
189 Log::Fatal(
"TAUOLA failed. No decay was created",5);
198 void TauolaParticle::boostDaughtersFromRestFrame(
TauolaParticle * tau_momentum){
204 vector<TauolaParticle*>::iterator pcl_itr = daughters.begin();
207 for(;pcl_itr != daughters.end();pcl_itr++){
209 (*pcl_itr)->boostFromRestFrame(tau_momentum);
210 (*pcl_itr)->boostDaughtersFromRestFrame(tau_momentum);
222 vector<TauolaParticle*>::iterator pcl_itr = daughters.begin();
225 for(;pcl_itr != daughters.end();pcl_itr++){
227 (*pcl_itr)->boostToRestFrame(tau_momentum);
228 (*pcl_itr)->boostDaughtersToRestFrame(tau_momentum);
277 if(
getP(second_axis)==0){
283 if(
getP(second_axis)>0)
284 return -atan(
getP(axis)/
getP(second_axis));
286 return M_PI-atan(
getP(axis)/
getP(second_axis));
295 double m=sqrt(boost_e*boost_e-boost_pz*boost_pz);
300 setPz((boost_e*p + boost_pz*e)/m);
301 setE((boost_pz*p + boost_e*e )/m);
307 double temp_px=
getP(axis);
308 double temp_pz=
getP(second_axis);
309 setP(axis,cos(theta)*temp_px + sin(theta)*temp_pz);
310 setP(second_axis,-sin(theta)*temp_px + cos(theta)*temp_pz);
313 void TauolaParticle::rotateDaughters(
int axis,
double theta,
int second_axis){
318 vector<TauolaParticle*>::iterator pcl_itr = daughters.begin();
321 for(;pcl_itr != daughters.end();pcl_itr++){
323 (*pcl_itr)->rotate(axis,theta,second_axis);
324 (*pcl_itr)->rotateDaughters(axis,theta,second_axis);
334 return sqrt(e_sq-p_sq);
336 return -1*sqrt(p_sq-e_sq);
void setP(int axis, double p_component)
void boostFromRestFrame(TauolaParticle *boost)
static const int OPPOSITE_SIGN
static const int SAME_SIGN
void boostDaughtersToRestFrame(TauolaParticle *boost)
static TauolaParticle * getParticle(int index)
TauolaParticle * findLastSelf()
virtual std::vector< TauolaParticle * > getMothers()=0
void subtract(TauolaParticle *)
virtual void setPz(double pz)=0
void addDecayToEventRecord()
virtual void setPx(double px)=0
void rotate(int axis, double phi, int second_axis=Z_AXIS)
void TauolaWriteDecayToEventRecord(int sign_type)
void TauolaDecay(int sign_type, double *polx, double *poly, double *polz, double *poln)
virtual void setMass(double mass)=0
void boostAlongZ(double pz, double e)
virtual TauolaParticle * createNewParticle(int pdg_id, int status, double mass, double px, double py, double pz, double e)=0
static void Fatal(string text, unsigned short int code=0)
virtual void setE(double e)=0
double getAngle(TauolaParticle *)
static int getDecayingParticle()
double getPolarimetricX()
virtual void setPy(double py)=0
double getRotationAngle(int axis, int second_axis=Z_AXIS)
virtual int getStatus()=0
void boostToRestFrame(TauolaParticle *boost)
static void addToEnd(TauolaParticle *new_particle)
std::vector< TauolaParticle * > findProductionMothers()
double getPolarimetricY()
virtual std::vector< TauolaParticle * > getDaughters()=0
double getPolarimetricZ()
void add(TauolaParticle *)