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);
PhotosParticle * findLastSelf()
virtual void setPz(double pz)=0
std::vector< PhotosParticle * > getDecayTree()
virtual std::vector< PhotosParticle * > getDaughters()=0
virtual void setE(double e)=0
virtual double getVirtuality()
virtual int getBarcode()=0
std::vector< PhotosParticle * > findProductionMothers()
double getRotationAngle(int axis, int second_axis=Z_AXIS)
void boostDaughtersToRestFrame(PhotosParticle *boost)
void boostDaughtersFromRestFrame(PhotosParticle *boost)
void boostToRestFrame(PhotosParticle *boost)
void rotate(int axis, double phi, int second_axis=Z_AXIS)
void setP(int axis, double p_component)
virtual void setPx(double px)=0
virtual void setPy(double py)=0
void boostFromRestFrame(PhotosParticle *boost)
virtual std::vector< PhotosParticle * > getAllDecayProducts()=0
void rotateDaughters(int axis, double phi, int second_axis=Z_AXIS)
virtual std::vector< PhotosParticle * > getMothers()=0
void boostAlongZ(double pz, double e)