3 #include "PhotosParticle.h"
18 vector<PhotosParticle*>::iterator pcl_itr = daughters.begin();
21 for (; pcl_itr != daughters.end(); pcl_itr++) {
22 if ((*pcl_itr)->getPdgID() == this->getPdgID())
23 return (*pcl_itr)->findLastSelf();
31 vector<PhotosParticle*> mothers =
getMothers();
32 vector<PhotosParticle*>::iterator pcl_itr = mothers.begin();
35 for (; pcl_itr != mothers.end(); pcl_itr++) {
36 if ((*pcl_itr)->getPdgID() == this->getPdgID())
37 return (*pcl_itr)->findProductionMothers();
44 vector<PhotosParticle*> particles;
45 particles.push_back(
this);
47 for (
int i = 0; i < (int)daughters.size(); i++) {
51 vector<PhotosParticle*> mothers = p->getMothers();
52 if (mothers.size() > 1 && mothers.at(0)->getBarcode() !=
getBarcode())
continue;
53 vector<PhotosParticle*> tree = p->getDecayTree();
54 particles.insert(particles.end(), tree.begin(), tree.end());
66 vector<PhotosParticle*>::iterator pcl_itr = list.begin();
68 for (; pcl_itr != list.end(); pcl_itr++) {
69 (*pcl_itr)->boostFromRestFrame(tau_momentum);
82 vector<PhotosParticle*>::iterator pcl_itr = list.begin();
84 for (; pcl_itr != list.end(); pcl_itr++) {
85 (*pcl_itr)->boostToRestFrame(tau_momentum);
137 if (
getP(second_axis) == 0) {
138 if (
getP(axis) > 0)
return -M_PI / 2.0;
139 else return M_PI / 2.0;
141 if (
getP(second_axis) > 0)
return -atan(
getP(axis) /
getP(second_axis));
142 else return M_PI - atan(
getP(axis) /
getP(second_axis));
151 double m_tau = sqrt(boost_e * boost_e - boost_pz * boost_pz);
156 setPz((boost_e * p + boost_pz * e) / m_tau);
157 setE((boost_pz * p + boost_e * e) / m_tau);
163 double temp_px =
getP(axis);
164 double temp_pz =
getP(second_axis);
165 setP(axis, cos(theta)*temp_px + sin(theta)*temp_pz);
166 setP(second_axis, -sin(theta)*temp_px + cos(theta)*temp_pz);
175 vector<PhotosParticle*>::iterator pcl_itr = daughters.begin();
178 for (; pcl_itr != daughters.end(); pcl_itr++) {
179 (*pcl_itr)->rotate(axis, theta, second_axis);
180 (*pcl_itr)->rotateDaughters(axis, theta, second_axis);
190 if (e_sq > p_sq)
return sqrt(e_sq - p_sq);
191 else return -1 * sqrt(p_sq - e_sq);
virtual void setE(double e)=0
Set the energy component of the four vector.
void rotate(int axis, double phi, int second_axis=Z_AXIS)
rotate this particles 4-momentum by an angle phi from the axisis "axis" towards the axis "second_axis...
static const int Y_AXIS
Y Axis.
PhotosParticle * findLastSelf()
Traverse the event structure and find the final version of this particle which does not have a partic...
void boostToRestFrame(PhotosParticle *boost)
Transform this particles four momentum from the lab frome into the rest frame of the paramter PhotosP...
virtual int getBarcode()=0
Get the barcode of this particle.
virtual void setPy(double py)=0
Set the px component of the four vector.
void rotateDaughters(int axis, double phi, int second_axis=Z_AXIS)
rotate 4-momentum of daughters of this particle by an angle phi from the axisis "axis" towards the ax...
virtual double getPz()=0
Returns the pz component of the four vector.
virtual double getE()=0
Returns the energy component of the four vector.
virtual double getPy()=0
Returns the py component of the four vector.
virtual double getPx()=0
Returns the px component of the four vector.
void setP(int axis, double p_component)
Set momentum component in the direction of "axis" (x,y,z)
std::vector< PhotosParticle * > getDecayTree()
Return whole decay tree starting from this particle.
virtual std::vector< PhotosParticle * > getDaughters()=0
Returns the daughters of this particle via a vector of PhotosParticle.
virtual std::vector< PhotosParticle * > getMothers()=0
Returns the mothers of this particle via a vector of PhotosParticle.
virtual double getVirtuality()
Get sqrt(e^2-p^2)
std::vector< PhotosParticle * > findProductionMothers()
Traverse the event structure and find the first set of mothers which are not of the same type as this...
virtual void setPx(double px)=0
Set the px component of the four vector.
static const int Z_AXIS
Z Axis.
bool hasDaughters()
Return whether the particle has any chidren.
virtual std::vector< PhotosParticle * > getAllDecayProducts()=0
Returns all particles in the decay tree of this particle via a vector of PhotosParticle.
void boostAlongZ(double pz, double e)
Do a Lorenz transformation along the Z axis.
double getP()
Get scalar momentum.
virtual void setPz(double pz)=0
Set the pz component of the four vector.
double getRotationAngle(int axis, int second_axis=Z_AXIS)
Returns the angle around the axis "axis" needed to rotate the four momenum is such a way that the non...
static const int X_AXIS
X Axis.
void boostDaughtersFromRestFrame(PhotosParticle *boost)
Transform this particles four momentum from the lab frame to the rest frame of the parameter PhotosPa...
void boostFromRestFrame(PhotosParticle *boost)
Transform this particles four momentum from the rest frame of the paramter PhotosParticle,...
void boostDaughtersToRestFrame(PhotosParticle *boost)
Transform the four momentum of all the daughters recursively into the frame of the "particle" PhotosP...