3 #include "PhotosParticle.h"
19 vector<PhotosParticle*>::iterator pcl_itr = daughters.begin();
22 for(;pcl_itr != daughters.end();pcl_itr++)
24 if((*pcl_itr)->getPdgID()==this->
getPdgID())
25 return (*pcl_itr)->findLastSelf();
33 vector<PhotosParticle*> mothers =
getMothers();
34 vector<PhotosParticle*>::iterator pcl_itr = mothers.begin();
37 for(;pcl_itr != mothers.end();pcl_itr++)
39 if((*pcl_itr)->getPdgID()==this->
getPdgID())
40 return (*pcl_itr)->findProductionMothers();
47 vector<PhotosParticle *> particles;
48 particles.push_back(
this);
50 for(
int i=0;i<(int)daughters.size();i++)
55 vector<PhotosParticle *> mothers = p->
getMothers();
56 if(mothers.size()>1 && mothers.at(0)->getBarcode()!=
getBarcode())
continue;
58 particles.insert(particles.end(),tree.begin(),tree.end());
70 vector<PhotosParticle*>::iterator pcl_itr = list.begin();
72 for(;pcl_itr != list.end();pcl_itr++)
74 (*pcl_itr)->boostFromRestFrame(tau_momentum);
87 vector<PhotosParticle*>::iterator pcl_itr = list.begin();
89 for(;pcl_itr != list.end();pcl_itr++)
91 (*pcl_itr)->boostToRestFrame(tau_momentum);
143 if(
getP(second_axis)==0)
145 if(
getP(axis)>0)
return -M_PI/2.0;
146 else return M_PI/2.0;
148 if(
getP(second_axis)>0)
return -atan(
getP(axis)/
getP(second_axis));
149 else return M_PI-atan(
getP(axis)/
getP(second_axis));
158 double m_tau=sqrt(boost_e*boost_e-boost_pz*boost_pz);
163 setPz((boost_e*p + boost_pz*e)/m_tau);
164 setE((boost_pz*p + boost_e*e )/m_tau);
170 double temp_px=
getP(axis);
171 double temp_pz=
getP(second_axis);
172 setP(axis,cos(theta)*temp_px + sin(theta)*temp_pz);
173 setP(second_axis,-sin(theta)*temp_px + cos(theta)*temp_pz);
182 vector<PhotosParticle*>::iterator pcl_itr = daughters.begin();
185 for(;pcl_itr != daughters.end();pcl_itr++)
187 (*pcl_itr)->rotate(axis,theta,second_axis);
188 (*pcl_itr)->rotateDaughters(axis,theta,second_axis);
198 if(e_sq>p_sq)
return sqrt(e_sq-p_sq);
199 else return -1*sqrt(p_sq-e_sq);
virtual void setPz(double pz)=0
void boostToRestFrame(PhotosParticle *boost)
void boostDaughtersFromRestFrame(PhotosParticle *boost)
void boostAlongZ(double pz, double e)
void rotateDaughters(int axis, double phi, int second_axis=Z_AXIS)
double getRotationAngle(int axis, int second_axis=Z_AXIS)
PhotosParticle * findLastSelf()
void boostDaughtersToRestFrame(PhotosParticle *boost)
virtual void setPx(double px)=0
virtual double getVirtuality()
std::vector< PhotosParticle * > findProductionMothers()
virtual int getBarcode()=0
virtual void setPy(double py)=0
void boostFromRestFrame(PhotosParticle *boost)
std::vector< PhotosParticle * > getDecayTree()
virtual void setE(double e)=0
virtual std::vector< PhotosParticle * > getAllDecayProducts()=0
void setP(int axis, double p_component)
virtual std::vector< PhotosParticle * > getMothers()=0
virtual std::vector< PhotosParticle * > getDaughters()=0
void rotate(int axis, double phi, int second_axis=Z_AXIS)