FairRoot/PandaRoot
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
Photospp::PhotosHepMCParticle Class Reference

#include <PhotosHepMCParticle.h>

Inheritance diagram for Photospp::PhotosHepMCParticle:
Photospp::PhotosParticle Photospp::PhotosParticle

Public Member Functions

 PhotosHepMCParticle ()
 
 PhotosHepMCParticle (HepMC::GenParticle *particle)
 
 PhotosHepMCParticle (int pdg_id, int status, double mass)
 
 ~PhotosHepMCParticle ()
 
HepMC::GenParticle * getHepMC ()
 
void setMothers (std::vector< PhotosParticle * > mothers)
 
void setDaughters (std::vector< PhotosParticle * > daughters)
 
void addDaughter (PhotosParticle *daughter)
 
std::vector< PhotosParticle * > getMothers ()
 
std::vector< PhotosParticle * > getDaughters ()
 
std::vector< PhotosParticle * > getAllDecayProducts ()
 
void setPdgID (int pdg_id)
 
void setStatus (int statu)
 
void setMass (double mass)
 
int getPdgID ()
 
int getStatus ()
 
int getBarcode ()
 
bool checkMomentumConservation ()
 
PhotosHepMCParticlecreateNewParticle (int pdg_id, int status, double mass, double px, double py, double pz, double e)
 
void createHistoryEntry ()
 
void createSelfDecayVertex (PhotosParticle *out)
 
void print ()
 
double getPx ()
 
double getPy ()
 
double getPz ()
 
double getE ()
 
double getMass ()
 
void setPx (double px)
 
void setPy (double py)
 
void setPz (double pz)
 
void setE (double e)
 
 PhotosHepMCParticle ()
 
 PhotosHepMCParticle (HepMC::GenParticle *particle)
 
 PhotosHepMCParticle (int pdg_id, int status, double mass)
 
 ~PhotosHepMCParticle ()
 
HepMC::GenParticle * getHepMC ()
 
void setMothers (std::vector< PhotosParticle * > mothers)
 
void setDaughters (std::vector< PhotosParticle * > daughters)
 
void addDaughter (PhotosParticle *daughter)
 
std::vector< PhotosParticle * > getMothers ()
 
std::vector< PhotosParticle * > getDaughters ()
 
std::vector< PhotosParticle * > getAllDecayProducts ()
 
void setPdgID (int pdg_id)
 
void setStatus (int statu)
 
void setMass (double mass)
 
int getPdgID ()
 
int getStatus ()
 
int getBarcode ()
 
bool checkMomentumConservation ()
 
PhotosHepMCParticlecreateNewParticle (int pdg_id, int status, double mass, double px, double py, double pz, double e)
 
void createHistoryEntry ()
 
void createSelfDecayVertex (PhotosParticle *out)
 
void print ()
 
double getPx ()
 
double getPy ()
 
double getPz ()
 
double getE ()
 
double getMass ()
 
void setPx (double px)
 
void setPy (double py)
 
void setPz (double pz)
 
void setE (double e)
 
bool hasDaughters ()
 
bool hasDaughters ()
 
PhotosParticlefindLastSelf ()
 
PhotosParticlefindLastSelf ()
 
std::vector< PhotosParticle * > findProductionMothers ()
 
std::vector< PhotosParticle * > findProductionMothers ()
 
std::vector< PhotosParticle * > getDecayTree ()
 
std::vector< PhotosParticle * > getDecayTree ()
 
void boostToRestFrame (PhotosParticle *boost)
 
void boostToRestFrame (PhotosParticle *boost)
 
void boostDaughtersToRestFrame (PhotosParticle *boost)
 
void boostDaughtersToRestFrame (PhotosParticle *boost)
 
void boostFromRestFrame (PhotosParticle *boost)
 
void boostFromRestFrame (PhotosParticle *boost)
 
void boostDaughtersFromRestFrame (PhotosParticle *boost)
 
void boostDaughtersFromRestFrame (PhotosParticle *boost)
 
void boostAlongZ (double pz, double e)
 
void boostAlongZ (double pz, double e)
 
void rotate (int axis, double phi, int second_axis=Z_AXIS)
 
void rotate (int axis, double phi, int second_axis=Z_AXIS)
 
void rotateDaughters (int axis, double phi, int second_axis=Z_AXIS)
 
void rotateDaughters (int axis, double phi, int second_axis=Z_AXIS)
 
double getRotationAngle (int axis, int second_axis=Z_AXIS)
 
double getRotationAngle (int axis, int second_axis=Z_AXIS)
 
double getP ()
 
double getP (int axis)
 
double getP ()
 
double getP (int axis)
 
void setP (int axis, double p_component)
 
void setP (int axis, double p_component)
 
virtual double getVirtuality ()
 
virtual double getVirtuality ()
 

Static Public Attributes

static const int STABLE =1
 
static const int DECAYED =2
 
static const int HISTORY =3
 
static const int X_AXIS =1
 
static const int Y_AXIS =2
 
static const int Z_AXIS =3
 
static const int Z0 = 23
 
static const int HIGGS = 25
 
static const int HIGGS_H = 35
 
static const int HIGGS_A = 36
 
static const int HIGGS_PLUS = 37
 
static const int HIGGS_MINUS = -37
 
static const int W_PLUS = 24
 
static const int W_MINUS = -24
 
static const int GAMMA = 22
 
static const int TAU_PLUS = -15
 
static const int TAU_MINUS = 15
 
static const int TAU_NEUTRINO = 16
 
static const int TAU_ANTINEUTRINO = -16
 
static const int MUON_PLUS = -13
 
static const int MUON_MINUS = 13
 
static const int MUON_NEUTRINO = 14
 
static const int MUON_ANTINEUTRINO = -14
 
static const int POSITRON = -11
 
static const int ELECTRON = 11
 
static const int ELECTRON_NEUTRINO = 12
 
static const int ELECTRON_ANTINEUTRINO = -12
 
static const int UP = 2
 
static const int ANTIUP = -2
 
static const int DOWN = 1
 
static const int ANTIDOWN = -1
 
static const int OTHER = 0
 

Private Member Functions

void clear (std::vector< PhotosParticle * > v)
 
void clear (std::vector< PhotosParticle * > v)
 

Private Attributes

HepMC::GenParticle * m_particle
 
std::vector< PhotosParticle * > m_mothers
 
std::vector< PhotosParticle * > m_daughters
 
std::vector< PhotosParticle * > m_decay_products
 
std::vector< PhotosParticle * > m_created_particles
 

Detailed Description

Definition at line 31 of file PhotosHepMCParticle.h.

Constructor & Destructor Documentation

PhotosHepMCParticle::PhotosHepMCParticle ( )

General constructor

Definition at line 9 of file PhotosHepMCParticle.cxx.

References m_particle.

Referenced by createNewParticle(), getDaughters(), and getMothers().

9  {
10  m_particle = new HepMC::GenParticle();
11 }
PhotosHepMCParticle::PhotosHepMCParticle ( HepMC::GenParticle *  particle)

Constructor which keeps a pointer to the HepMC::GenParticle

Definition at line 20 of file PhotosHepMCParticle.cxx.

References m_particle, and particle.

20  {
22 }
const int particle
PhotosHepMCParticle::PhotosHepMCParticle ( int  pdg_id,
int  status,
double  mass 
)

Constructor which creates a new HepMC::GenParticle and sets the properties pdg_id, statu and mass.

Definition at line 13 of file PhotosHepMCParticle.cxx.

References m_particle.

13  {
14  m_particle = new HepMC::GenParticle();
15  m_particle->set_pdg_id(pdg_id);
16  m_particle->set_status(status);
17  m_particle->set_generated_mass(mass);
18 }
int status[10]
Definition: f_Init.h:28
PhotosHepMCParticle::~PhotosHepMCParticle ( )

Destructor

Definition at line 24 of file PhotosHepMCParticle.cxx.

References clear(), m_daughters, and m_mothers.

24  {
27  // clear(m_created_particles);
28 }
void clear(std::vector< PhotosParticle * > v)
std::vector< PhotosParticle * > m_daughters
std::vector< PhotosParticle * > m_mothers
Photospp::PhotosHepMCParticle::PhotosHepMCParticle ( )

General constructor

Photospp::PhotosHepMCParticle::PhotosHepMCParticle ( HepMC::GenParticle *  particle)

Constructor which keeps a pointer to the HepMC::GenParticle

Photospp::PhotosHepMCParticle::PhotosHepMCParticle ( int  pdg_id,
int  status,
double  mass 
)

Constructor which creates a new HepMC::GenParticle and sets the properties pdg_id, statu and mass.

Photospp::PhotosHepMCParticle::~PhotosHepMCParticle ( )

Destructor

Member Function Documentation

void PhotosHepMCParticle::addDaughter ( PhotosParticle daughter)
virtual

Add a new daughter to the end vertex of this particle

Implements Photospp::PhotosParticle.

Definition at line 88 of file PhotosHepMCParticle.cxx.

References Photospp::Log::Fatal(), m_daughters, and m_particle.

88  {
89 
90  //add to this classes internal list as well.
91  m_daughters.push_back(daughter);
92 
93  //this assumes there is already an end vertex for the particle
94 
95  if(!m_particle->end_vertex())
96  Log::Fatal("PhotosHepMCParticle::addDaughter(): This method assumes an end_vertex exists. Maybe you really want to use setDaughters.",2);
97 
98  HepMC::GenParticle * daugh = (dynamic_cast<PhotosHepMCParticle*>(daughter))->getHepMC();
99  m_particle->end_vertex()->add_particle_out(daugh);
100 
101 }
std::vector< PhotosParticle * > m_daughters
static void Fatal(string text, unsigned short int code=0)
Interface to HepMC::GenParticle objects.
void Photospp::PhotosHepMCParticle::addDaughter ( PhotosParticle daughter)
virtual

Add a new daughter to the end vertex of this particle

Implements Photospp::PhotosParticle.

void PhotosParticle::boostAlongZ ( double  boost_pz,
double  boost_e 
)
inherited

Do a Lorenz transformation along the Z axis.

Boost this vector along the Z direction. Assume no momentum components in the X or Y directions.

Definition at line 155 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::getE(), Photospp::PhotosParticle::getPz(), p, Photospp::PhotosParticle::setE(), Photospp::PhotosParticle::setPz(), and sqrt().

Referenced by Photospp::PhotosParticle::boostFromRestFrame(), and Photospp::PhotosParticle::boostToRestFrame().

156 {
157  // Boost along the Z axis
158  double m_tau=sqrt(boost_e*boost_e-boost_pz*boost_pz);
159 
160  double p=getPz();
161  double e=getE();
162 
163  setPz((boost_e*p + boost_pz*e)/m_tau);
164  setE((boost_pz*p + boost_e*e )/m_tau);
165 }
virtual void setPz(double pz)=0
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
Double_t p
Definition: anasim.C:58
virtual double getPz()=0
virtual void setE(double e)=0
virtual double getE()=0
void Photospp::PhotosParticle::boostAlongZ ( double  pz,
double  e 
)
inherited

Do a Lorenz transformation along the Z axis.

void PhotosParticle::boostDaughtersFromRestFrame ( PhotosParticle boost)
inherited

Transform this particles four momentum from the lab frame to the rest frame of the parameter PhotosParticle.

Definition at line 63 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::getAllDecayProducts(), and Photospp::PhotosParticle::hasDaughters().

Referenced by Photospp::PH_HEPEVT_Interface::get().

64 {
65  if(!hasDaughters()) //if there are no daughters
66  return;
67 
68  // get all daughters, granddaughters, etc. then rotate and boost them
69  vector<PhotosParticle*> list = getAllDecayProducts();
70  vector<PhotosParticle*>::iterator pcl_itr = list.begin();
71 
72  for(;pcl_itr != list.end();pcl_itr++)
73  {
74  (*pcl_itr)->boostFromRestFrame(tau_momentum);
75  }
76 
77  //checkMomentumConservation();
78 }
virtual std::vector< PhotosParticle * > getAllDecayProducts()=0
void Photospp::PhotosParticle::boostDaughtersFromRestFrame ( PhotosParticle boost)
inherited

Transform this particles four momentum from the lab frame to the rest frame of the parameter PhotosParticle.

void PhotosParticle::boostDaughtersToRestFrame ( PhotosParticle boost)
inherited

Transform the four momentum of all the daughters recursively into the frame of the "particle" PhotosParticle.

Definition at line 80 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::getAllDecayProducts(), and Photospp::PhotosParticle::hasDaughters().

Referenced by Photospp::PH_HEPEVT_Interface::get().

81 {
82  if(!hasDaughters()) //if there are no daughters
83  return;
84 
85  // get all daughters, granddaughters, etc. then rotate and boost them
86  vector<PhotosParticle*> list = getAllDecayProducts();
87  vector<PhotosParticle*>::iterator pcl_itr = list.begin();
88 
89  for(;pcl_itr != list.end();pcl_itr++)
90  {
91  (*pcl_itr)->boostToRestFrame(tau_momentum);
92  }
93 
94  //checkMomentumConservation();
95 }
virtual std::vector< PhotosParticle * > getAllDecayProducts()=0
void Photospp::PhotosParticle::boostDaughtersToRestFrame ( PhotosParticle boost)
inherited

Transform the four momentum of all the daughters recursively into the frame of the "particle" PhotosParticle.

void PhotosParticle::boostFromRestFrame ( PhotosParticle boost)
inherited

Transform this particles four momentum from the rest frame of the paramter PhotosParticle, back into the lab frame.

Definition at line 114 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::boostAlongZ(), Photospp::PhotosParticle::getE(), Photospp::PhotosParticle::getP(), Photospp::PhotosParticle::getRotationAngle(), phi, Photospp::PhotosParticle::rotate(), theta, Photospp::PhotosParticle::X_AXIS, and Photospp::PhotosParticle::Y_AXIS.

Referenced by Photospp::PH_HEPEVT_Interface::get().

115 {
116  //get the rotation angles
117  //and boost z
118 
119  double theta = tau_momentum->getRotationAngle(Y_AXIS);
120  tau_momentum->rotate(Y_AXIS,theta);
121 
122  double phi = tau_momentum->getRotationAngle(X_AXIS);
123  tau_momentum->rotate(Y_AXIS,-theta);
124 
125  //Now rotate coordinates to get boost in Z direction.
126  rotate(Y_AXIS,theta);
127  rotate(X_AXIS,phi);
128  boostAlongZ(tau_momentum->getP(),tau_momentum->getE());
129  rotate(X_AXIS,-phi);
130  rotate(Y_AXIS,-theta);
131 }
void boostAlongZ(double pz, double e)
static const int Y_AXIS
static const int X_AXIS
void rotate(int axis, double phi, int second_axis=Z_AXIS)
void Photospp::PhotosParticle::boostFromRestFrame ( PhotosParticle boost)
inherited

Transform this particles four momentum from the rest frame of the paramter PhotosParticle, back into the lab frame.

void Photospp::PhotosParticle::boostToRestFrame ( PhotosParticle boost)
inherited

Transform this particles four momentum from the lab frome into the rest frame of the paramter PhotosParticle.

void PhotosParticle::boostToRestFrame ( PhotosParticle boost)
inherited

Transform this particles four momentum from the lab frome into the rest frame of the paramter PhotosParticle.

Definition at line 98 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::boostAlongZ(), Photospp::PhotosParticle::getE(), Photospp::PhotosParticle::getP(), Photospp::PhotosParticle::getRotationAngle(), phi, Photospp::PhotosParticle::rotate(), theta, Photospp::PhotosParticle::X_AXIS, and Photospp::PhotosParticle::Y_AXIS.

Referenced by Photospp::PH_HEPEVT_Interface::get().

99 {
100  double theta = tau_momentum->getRotationAngle(Y_AXIS);
101  tau_momentum->rotate(Y_AXIS,theta);
102 
103  double phi = tau_momentum->getRotationAngle(X_AXIS);
104  tau_momentum->rotate(Y_AXIS,-theta);
105 
106  //Now rotate coordinates to get boost in Z direction.
107  rotate(Y_AXIS,theta);
108  rotate(X_AXIS,phi);
109  boostAlongZ(-1*tau_momentum->getP(),tau_momentum->getE());
110  rotate(X_AXIS,-phi);
111  rotate(Y_AXIS,-theta);
112 }
void boostAlongZ(double pz, double e)
static const int Y_AXIS
static const int X_AXIS
void rotate(int axis, double phi, int second_axis=Z_AXIS)
bool Photospp::PhotosHepMCParticle::checkMomentumConservation ( )
virtual

check that the 4 momentum in conserved at the vertices producing and ending this particle

Implements Photospp::PhotosParticle.

bool PhotosHepMCParticle::checkMomentumConservation ( )
virtual

check that the 4 momentum in conserved at the vertices producing and ending this particle

Implements Photospp::PhotosParticle.

Definition at line 223 of file PhotosHepMCParticle.cxx.

References Photospp::Photos::isStatusCodeIgnored(), m_particle, Photospp::Photos::momentum_conservation_threshold, Photospp::Log::RedirectOutput(), Photospp::Log::RevertOutput(), sqrt(), and Photospp::Log::Warning().

223  {
224 
225  if(!m_particle->end_vertex()) return true;
226 
227  // HepMC version of check_momentum_conservation
228  // Ommitting history entries (status == 3)
229 
230  double sumpx = 0, sumpy = 0, sumpz = 0, sume = 0;
231  for( HepMC::GenVertex::particles_in_const_iterator part1 = m_particle->end_vertex()->particles_in_const_begin();
232  part1 != m_particle->end_vertex()->particles_in_const_end(); part1++ ){
233 
234  if( Photos::isStatusCodeIgnored((*part1)->status()) ) continue;
235 
236  sumpx += (*part1)->momentum().px();
237  sumpy += (*part1)->momentum().py();
238  sumpz += (*part1)->momentum().pz();
239  sume += (*part1)->momentum().e();
240  }
241 
242  for( HepMC::GenVertex::particles_out_const_iterator part2 = m_particle->end_vertex()->particles_out_const_begin();
243  part2 != m_particle->end_vertex()->particles_out_const_end(); part2++ ){
244 
245  if( Photos::isStatusCodeIgnored((*part2)->status()) ) continue;
246 
247  sumpx -= (*part2)->momentum().px();
248  sumpy -= (*part2)->momentum().py();
249  sumpz -= (*part2)->momentum().pz();
250  sume -= (*part2)->momentum().e();
251  }
252 
253  if( sqrt( sumpx*sumpx + sumpy*sumpy + sumpz*sumpz + sume*sume) > Photos::momentum_conservation_threshold ) {
254  Log::Warning()<<"Momentum not conserved in the vertex:"<<endl;
256  m_particle->end_vertex()->print();
258  return false;
259  }
260 
261  return true;
262 }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
static bool isStatusCodeIgnored(int status)
Definition: Photos.cxx:333
static double momentum_conservation_threshold
Definition: Photos.h:172
static ostream & Warning(bool count=true)
Definition: Log.cxx:46
static void RevertOutput()
Definition: Log.h:90
static void RedirectOutput(void(*func)(), ostream &where=*out)
Definition: Log.cxx:90
void PhotosHepMCParticle::clear ( std::vector< PhotosParticle * >  v)
private

Internal function used to clear particles from the vector

Definition at line 32 of file PhotosHepMCParticle.cxx.

Referenced by setDaughters(), setMothers(), and ~PhotosHepMCParticle().

32  {
33  while(v.size()!=0){
34  PhotosParticle * temp = v.back();
35  v.pop_back();
36  delete temp;
37  }
38 }
__m128 v
Definition: P4_F32vec4.h:4
Abstract base class for particle in the event. This class also handles boosting.
void Photospp::PhotosHepMCParticle::clear ( std::vector< PhotosParticle * >  v)
private

Internal function used to clear particles from the vector

void PhotosHepMCParticle::createHistoryEntry ( )
virtual

Create history entry for HepMC event record. Creates copy of this particle with status = 3

Implements Photospp::PhotosParticle.

Definition at line 305 of file PhotosHepMCParticle.cxx.

References Photospp::Photos::historyEntriesStatus, m_particle, and Photospp::Log::Warning().

305  {
306 
307  if(!m_particle->production_vertex())
308  {
309  Log::Warning()<<"PhotosHepMCParticle::createHistoryEntry(): particle without production vertex."<<endl;
310  return;
311  }
312 
313  HepMC::GenParticle *part = new HepMC::GenParticle(*m_particle);
314  part->set_status(Photos::historyEntriesStatus);
315  m_particle->production_vertex()->add_particle_out(part);
316 }
static ostream & Warning(bool count=true)
Definition: Log.cxx:46
static int historyEntriesStatus
Definition: Photos.h:187
void Photospp::PhotosHepMCParticle::createHistoryEntry ( )
virtual

Create history entry for HepMC event record. Creates copy of this particle with status = 3

Implements Photospp::PhotosParticle.

PhotosHepMCParticle* Photospp::PhotosHepMCParticle::createNewParticle ( int  pdg_id,
int  status,
double  mass,
double  px,
double  py,
double  pz,
double  e 
)
virtual

Create a new particle of type PhotosHepMCParticle, with the given properties. The new particle bares no relations to this particle, but it provides a way of creating a instance of this derived class. eg. createNewParticle() is used inside filhep_() so that a PhotosHepMCParticle can be created without the method having explicit knowledge of the PhotosHepMCParticle class

Implements Photospp::PhotosParticle.

PhotosHepMCParticle * PhotosHepMCParticle::createNewParticle ( int  pdg_id,
int  status,
double  mass,
double  px,
double  py,
double  pz,
double  e 
)
virtual

Create a new particle of type PhotosHepMCParticle, with the given properties. The new particle bares no relations to this particle, but it provides a way of creating a instance of this derived class. eg. createNewParticle() is used inside filhep_() so that a PhotosHepMCParticle can be created without the method having explicit knowledge of the PhotosHepMCParticle class

Implements Photospp::PhotosParticle.

Definition at line 289 of file PhotosHepMCParticle.cxx.

References getHepMC(), m_created_particles, and PhotosHepMCParticle().

291  {
292 
293  PhotosHepMCParticle * new_particle = new PhotosHepMCParticle();
294  new_particle->getHepMC()->set_pdg_id(pdg_id);
295  new_particle->getHepMC()->set_status(status);
296  new_particle->getHepMC()->set_generated_mass(mass);
297 
298  HepMC::FourVector momentum(px,py,pz,e);
299  new_particle->getHepMC()->set_momentum(momentum);
300 
301  m_created_particles.push_back(new_particle);
302  return new_particle;
303 }
std::vector< PhotosParticle * > m_created_particles
Interface to HepMC::GenParticle objects.
double pz[39]
Definition: pipisigmas.h:14
int status[10]
Definition: f_Init.h:28
void PhotosHepMCParticle::createSelfDecayVertex ( PhotosParticle out)
virtual

Create a self-decay vertex for this particle with 'out' being the outgoing particle in new vertex

Implements Photospp::PhotosParticle.

Definition at line 318 of file PhotosHepMCParticle.cxx.

References Photospp::Log::Error(), getHepMC(), getStatus(), m_particle, setStatus(), and v.

319 {
320  if(m_particle->end_vertex())
321  {
322  Log::Error()<<"PhotosHepMCParticle::createSelfDecayVertex: particle already has end vertex!"<<endl;
323  return;
324  }
325 
326  if(getHepMC()->parent_event()==NULL)
327  {
328  Log::Error()<<"PhotosHepMCParticle::createSelfDecayVertex: particle not in the HepMC event!"<<endl;
329  return;
330  }
331 
332  // Add new vertex and new particle to HepMC
333  HepMC::GenParticle *outgoing = new HepMC::GenParticle( *(dynamic_cast<PhotosHepMCParticle*>(out)->m_particle) );
334  HepMC::GenVertex *v = new HepMC::GenVertex();
335 
336  // Copy vertex position from parent vertex
337  v->set_position( m_particle->production_vertex()->position() );
338 
339  v->add_particle_in (m_particle);
340  v->add_particle_out(outgoing);
341 
342  getHepMC()->parent_event()->add_vertex(v);
343 
344  // If this particle was stable, set its status to 2
345  if(getStatus()==1) setStatus(2);
346 }
__m128 v
Definition: P4_F32vec4.h:4
static ostream & Error(bool count=true)
Definition: Log.cxx:64
void Photospp::PhotosHepMCParticle::createSelfDecayVertex ( PhotosParticle out)
virtual

Create a self-decay vertex for this particle with 'out' being the outgoing particle in new vertex

Implements Photospp::PhotosParticle.

PhotosParticle * PhotosParticle::findLastSelf ( )
inherited

Traverse the event structure and find the final version of this particle which does not have a particle of it's own type as it's daughter. eg. Generally the final stable copy

Definition at line 16 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::getDaughters(), and Photospp::PhotosParticle::getPdgID().

17 {
18  vector<PhotosParticle*> daughters = getDaughters();
19  vector<PhotosParticle*>::iterator pcl_itr = daughters.begin();
20 
21  //get all daughters and look for stable with same pgd id
22  for(;pcl_itr != daughters.end();pcl_itr++)
23  {
24  if((*pcl_itr)->getPdgID()==this->getPdgID())
25  return (*pcl_itr)->findLastSelf();
26  }
27 
28  return this;
29 }
virtual int getPdgID()=0
virtual std::vector< PhotosParticle * > getDaughters()=0
PhotosParticle* Photospp::PhotosParticle::findLastSelf ( )
inherited

Traverse the event structure and find the final version of this particle which does not have a particle of it's own type as it's daughter. eg. Generally the final stable copy

vector< PhotosParticle * > PhotosParticle::findProductionMothers ( )
inherited

Traverse the event structure and find the first set of mothers which are not of the same type as this particle.

Definition at line 31 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::getMothers(), and Photospp::PhotosParticle::getPdgID().

Referenced by Photospp::PhotosBranch::PhotosBranch().

32 {
33  vector<PhotosParticle*> mothers = getMothers();
34  vector<PhotosParticle*>::iterator pcl_itr = mothers.begin();
35 
36  //get all mothers and check none have pdg id of this one
37  for(;pcl_itr != mothers.end();pcl_itr++)
38  {
39  if((*pcl_itr)->getPdgID()==this->getPdgID())
40  return (*pcl_itr)->findProductionMothers();
41  }
42  return mothers;
43 }
virtual int getPdgID()=0
virtual std::vector< PhotosParticle * > getMothers()=0
std::vector<PhotosParticle *> Photospp::PhotosParticle::findProductionMothers ( )
inherited

Traverse the event structure and find the first set of mothers which are not of the same type as this particle.

std::vector<PhotosParticle*> Photospp::PhotosHepMCParticle::getAllDecayProducts ( )
virtual

Returns all particles in the decay tree of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

std::vector< PhotosParticle * > PhotosHepMCParticle::getAllDecayProducts ( )
virtual

Returns all particles in the decay tree of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

Definition at line 183 of file PhotosHepMCParticle.cxx.

References getBarcode(), getDaughters(), Photospp::PhotosParticle::hasDaughters(), i, and m_decay_products.

183  {
184 
185  m_decay_products.clear();
186 
187  if(!hasDaughters()) // if this particle has no daughters
188  return m_decay_products;
189 
190  std::vector<PhotosParticle*> daughters = getDaughters();
191 
192  // copy daughters to list of all decay products
193  m_decay_products.insert(m_decay_products.end(),daughters.begin(),daughters.end());
194 
195  // Now, get all daughters recursively, without duplicates.
196  // That is, for each daughter:
197  // 1) get list of her daughters
198  // 2) for each particle on this list:
199  // a) check if it is already on the list
200  // b) if it's not, add her to the end of the list
201  for(unsigned int i=0;i<m_decay_products.size();i++)
202  {
203  std::vector<PhotosParticle*> daughters2 = m_decay_products[i]->getDaughters();
204 
205  if(!m_decay_products[i]->hasDaughters()) continue;
206  for(unsigned int j=0;j<daughters2.size();j++)
207  {
208  bool add=true;
209  for(unsigned int k=0;k<m_decay_products.size();k++)
210  if( daughters2[j]->getBarcode() == m_decay_products[k]->getBarcode() )
211  {
212  add=false;
213  break;
214  }
215 
216  if(add) m_decay_products.push_back(daughters2[j]);
217  }
218  }
219 
220  return m_decay_products;
221 }
Int_t i
Definition: run_full.C:25
std::vector< PhotosParticle * > getDaughters()
std::vector< PhotosParticle * > m_decay_products
int Photospp::PhotosHepMCParticle::getBarcode ( )
virtual

Get the barcode of this particle

Implements Photospp::PhotosParticle.

int PhotosHepMCParticle::getBarcode ( )
virtual

Get the barcode of this particle

Implements Photospp::PhotosParticle.

Definition at line 284 of file PhotosHepMCParticle.cxx.

References m_particle.

Referenced by getAllDecayProducts().

284  {
285  return m_particle->barcode();
286 }
std::vector<PhotosParticle*> Photospp::PhotosHepMCParticle::getDaughters ( )
virtual

Returns the daughters of this particle via a vector of PhotosParticle IMPORTANT: this method will remeber list from the first call. Particles (e.g. photons) added later will be ignored

Implements Photospp::PhotosParticle.

std::vector< PhotosParticle * > PhotosHepMCParticle::getDaughters ( )
virtual

Returns the daughters of this particle via a vector of PhotosParticle IMPORTANT: this method will remeber list from the first call. Particles (e.g. photons) added later will be ignored

Implements Photospp::PhotosParticle.

Definition at line 162 of file PhotosHepMCParticle.cxx.

References Photospp::Photos::isStatusCodeIgnored(), m_daughters, m_particle, and PhotosHepMCParticle().

Referenced by getAllDecayProducts().

162  {
163 
164  if(m_daughters.size()==0&&m_particle->end_vertex()){
165  HepMC::GenVertex::particles_out_const_iterator pcle_itr;
166  pcle_itr=m_particle->end_vertex()->particles_out_const_begin();
167 
168  HepMC::GenVertex::particles_out_const_iterator pcle_itr_end;
169  pcle_itr_end=m_particle->end_vertex()->particles_out_const_end();
170 
171  for(;pcle_itr != pcle_itr_end; pcle_itr++){
172 
173  // ommit particles if their status code is ignored by Photos
174  if( Photos::isStatusCodeIgnored( (*pcle_itr)->status() ) ) continue;
175 
176  m_daughters.push_back(new PhotosHepMCParticle(*pcle_itr));
177  }
178  }
179  return m_daughters;
180 
181 }
static bool isStatusCodeIgnored(int status)
Definition: Photos.cxx:333
std::vector< PhotosParticle * > m_daughters
std::vector<PhotosParticle *> Photospp::PhotosParticle::getDecayTree ( )
inherited

Return whole decay tree starting from this particle

vector< PhotosParticle * > PhotosParticle::getDecayTree ( )
inherited

Return whole decay tree starting from this particle

Definition at line 45 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::getBarcode(), Photospp::PhotosParticle::getDaughters(), Photospp::PhotosParticle::getDecayTree(), Photospp::PhotosParticle::getMothers(), i, p, and tree.

Referenced by Photospp::PhotosBranch::createBranches(), Photospp::PhotosParticle::getDecayTree(), and Photospp::Photos::processBranch().

46 {
47  vector<PhotosParticle *> particles;
48  particles.push_back(this);
49  vector<PhotosParticle *> daughters = getDaughters();
50  for(int i=0;i<(int)daughters.size();i++)
51  {
52  // Check if we are the first mother of each daughters
53  // If not - skip this daughter
54  PhotosParticle *p = daughters.at(i);
55  vector<PhotosParticle *> mothers = p->getMothers();
56  if(mothers.size()>1 && mothers.at(0)->getBarcode()!=getBarcode()) continue;
57  vector<PhotosParticle *> tree = p->getDecayTree();
58  particles.insert(particles.end(),tree.begin(),tree.end());
59  }
60  return particles;
61 }
Int_t i
Definition: run_full.C:25
TTree * tree
Definition: plot_dirc.C:12
Double_t p
Definition: anasim.C:58
virtual int getBarcode()=0
Abstract base class for particle in the event. This class also handles boosting.
virtual std::vector< PhotosParticle * > getDaughters()=0
double PhotosHepMCParticle::getE ( )
virtual

Returns the energy component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 367 of file PhotosHepMCParticle.cxx.

References m_particle.

367  {
368  return m_particle->momentum().e();
369 }
double Photospp::PhotosHepMCParticle::getE ( )
virtual

Returns the energy component of the four vector

Implements Photospp::PhotosParticle.

HepMC::GenParticle * PhotosHepMCParticle::getHepMC ( )

return the HepMC::GenParticle

Definition at line 40 of file PhotosHepMCParticle.cxx.

References m_particle.

Referenced by createNewParticle(), createSelfDecayVertex(), setDaughters(), and setMothers().

40  {
41  return m_particle;
42 }
HepMC::GenParticle* Photospp::PhotosHepMCParticle::getHepMC ( )

return the HepMC::GenParticle

double PhotosHepMCParticle::getMass ( )
virtual

Returns the mass taken from event record

Implements Photospp::PhotosParticle.

Definition at line 399 of file PhotosHepMCParticle.cxx.

References m_particle.

400 {
401  return m_particle->generated_mass();
402 }
double Photospp::PhotosHepMCParticle::getMass ( )
virtual

Returns the mass taken from event record

Implements Photospp::PhotosParticle.

std::vector<PhotosParticle*> Photospp::PhotosHepMCParticle::getMothers ( )
virtual

Returns the mothers of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

std::vector< PhotosParticle * > PhotosHepMCParticle::getMothers ( )
virtual

Returns the mothers of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

Definition at line 145 of file PhotosHepMCParticle.cxx.

References m_mothers, m_particle, and PhotosHepMCParticle().

145  {
146 
147  if(m_mothers.size()==0&&m_particle->production_vertex()){
148 
149  HepMC::GenVertex::particles_in_const_iterator pcle_itr;
150  pcle_itr=m_particle->production_vertex()->particles_in_const_begin();
151 
152  HepMC::GenVertex::particles_in_const_iterator pcle_itr_end;
153  pcle_itr_end=m_particle->production_vertex()->particles_in_const_end();
154 
155  for(;pcle_itr != pcle_itr_end; pcle_itr++){
156  m_mothers.push_back(new PhotosHepMCParticle(*pcle_itr));
157  }
158  }
159  return m_mothers;
160 }
std::vector< PhotosParticle * > m_mothers
double PhotosParticle::getP ( )
inherited
double Photospp::PhotosParticle::getP ( )
inherited

Get scalar momentum

double PhotosParticle::getP ( int  axis)
inherited

Get momentum component in the direction of "axis" (x,y,z)

Definition at line 207 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::getPx(), Photospp::PhotosParticle::getPy(), Photospp::PhotosParticle::getPz(), Photospp::PhotosParticle::X_AXIS, Photospp::PhotosParticle::Y_AXIS, and Photospp::PhotosParticle::Z_AXIS.

208 {
209  if(axis==X_AXIS) return getPx();
210  if(axis==Y_AXIS) return getPy();
211  if(axis==Z_AXIS) return getPz();
212  return 0;
213 }
static const int Z_AXIS
virtual double getPy()=0
virtual double getPx()=0
virtual double getPz()=0
axis
Definition: PndRadMapPlane.h:9
static const int Y_AXIS
static const int X_AXIS
double Photospp::PhotosParticle::getP ( int  axis)
inherited

Get momentum component in the direction of "axis" (x,y,z)

int Photospp::PhotosHepMCParticle::getPdgID ( )
virtual

Get the PDG ID code of this particle

Implements Photospp::PhotosParticle.

int PhotosHepMCParticle::getPdgID ( )
virtual

Get the PDG ID code of this particle

Implements Photospp::PhotosParticle.

Definition at line 276 of file PhotosHepMCParticle.cxx.

References m_particle.

276  {
277  return m_particle->pdg_id();
278 }
double PhotosHepMCParticle::getPx ( )
inlinevirtual

Returns the px component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 355 of file PhotosHepMCParticle.cxx.

References m_particle.

355  {
356  return m_particle->momentum().px();
357 }
double Photospp::PhotosHepMCParticle::getPx ( )
virtual

Returns the px component of the four vector

Implements Photospp::PhotosParticle.

double PhotosHepMCParticle::getPy ( )
inlinevirtual

Returns the py component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 359 of file PhotosHepMCParticle.cxx.

References m_particle.

359  {
360  return m_particle->momentum().py();
361 }
double Photospp::PhotosHepMCParticle::getPy ( )
virtual

Returns the py component of the four vector

Implements Photospp::PhotosParticle.

double PhotosHepMCParticle::getPz ( )
virtual

Returns the pz component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 363 of file PhotosHepMCParticle.cxx.

References m_particle.

363  {
364  return m_particle->momentum().pz();
365 }
double Photospp::PhotosHepMCParticle::getPz ( )
virtual

Returns the pz component of the four vector

Implements Photospp::PhotosParticle.

double Photospp::PhotosParticle::getRotationAngle ( int  axis,
int  second_axis = Z_AXIS 
)
inherited

Returns the angle around the axis "axis" needed to rotate the four momenum is such a way that the non-Z component disappears and Z>0. This is used to in rotating the coordinate system into a frame with only a Z component before calling boostAlongZ().

double PhotosParticle::getRotationAngle ( int  axis,
int  second_axis = Z_AXIS 
)
inherited

Returns the angle around the axis "axis" needed to rotate the four momenum is such a way that the non-Z component disappears and Z>0. This is used to in rotating the coordinate system into a frame with only a Z component before calling boostAlongZ().

Get the angle needed to rotate the 4 momentum vector so that the x (y) component disapears. (and the Z component is > 0)

if(getP(axis)==0){ if(getPz()>0) return 0; //no rotaion required else return M_PI; }

Definition at line 135 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::getP().

Referenced by Photospp::PhotosParticle::boostFromRestFrame(), and Photospp::PhotosParticle::boostToRestFrame().

136 {
143  if(getP(second_axis)==0)
144  {
145  if(getP(axis)>0) return -M_PI/2.0;
146  else return M_PI/2.0;
147  }
148  if(getP(second_axis)>0) return -atan(getP(axis)/getP(second_axis));
149  else return M_PI-atan(getP(axis)/getP(second_axis));
150 
151 }
axis
Definition: PndRadMapPlane.h:9
int PhotosHepMCParticle::getStatus ( )
virtual

Get the status of this particle

Implements Photospp::PhotosParticle.

Definition at line 280 of file PhotosHepMCParticle.cxx.

References m_particle.

Referenced by createSelfDecayVertex().

280  {
281  return m_particle->status();
282 }
int Photospp::PhotosHepMCParticle::getStatus ( )
virtual

Get the status of this particle

Implements Photospp::PhotosParticle.

virtual double Photospp::PhotosParticle::getVirtuality ( )
virtualinherited

Get sqrt(e^2-p^2)

double PhotosParticle::getVirtuality ( )
virtualinherited

Get sqrt(e^2-p^2)

Definition at line 193 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::getE(), Photospp::PhotosParticle::getP(), and sqrt().

Referenced by Photospp::PH_HEPEVT_Interface::add_particle().

194 {
195  double e_sq=getE()*getE();
196  double p_sq=getP()*getP();
197 
198  if(e_sq>p_sq) return sqrt(e_sq-p_sq);
199  else return -1*sqrt(p_sq-e_sq); //if it's negative
200 }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
virtual double getE()=0
bool PhotosParticle::hasDaughters ( )
inherited

Return whether the particle has any chidren

Definition at line 10 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::getDaughters().

Referenced by Photospp::PhotosParticle::boostDaughtersFromRestFrame(), Photospp::PhotosParticle::boostDaughtersToRestFrame(), Photospp::PhotosHEPEVTParticle::getAllDecayProducts(), getAllDecayProducts(), and Photospp::PhotosParticle::rotateDaughters().

11 {
12  if(getDaughters().size()==0) return false;
13  else return true;
14 }
virtual std::vector< PhotosParticle * > getDaughters()=0
bool Photospp::PhotosParticle::hasDaughters ( )
inherited

Return whether the particle has any chidren

void PhotosHepMCParticle::print ( )
virtual

Print some information about this particle to standard output

Implements Photospp::PhotosParticle.

Definition at line 348 of file PhotosHepMCParticle.cxx.

References m_particle.

348  {
349  m_particle->print();
350 }
void Photospp::PhotosHepMCParticle::print ( )
virtual

Print some information about this particle to standard output

Implements Photospp::PhotosParticle.

void PhotosParticle::rotate ( int  axis,
double  theta,
int  second_axis = Z_AXIS 
)
inherited

rotate this particles 4-momentum by an angle phi from the axisis "axis" towards the axis "second_axis".

Rotation around an axis X or Y

Definition at line 168 of file PhotosParticle.cxx.

References cos(), Photospp::PhotosParticle::getP(), Photospp::PhotosParticle::setP(), and sin().

Referenced by Photospp::PhotosParticle::boostFromRestFrame(), and Photospp::PhotosParticle::boostToRestFrame().

169 {
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);
174 }
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
void setP(int axis, double p_component)
axis
Definition: PndRadMapPlane.h:9
void Photospp::PhotosParticle::rotate ( int  axis,
double  phi,
int  second_axis = Z_AXIS 
)
inherited

rotate this particles 4-momentum by an angle phi from the axisis "axis" towards the axis "second_axis".

void Photospp::PhotosParticle::rotateDaughters ( int  axis,
double  phi,
int  second_axis = Z_AXIS 
)
inherited

rotate 4-momentum of daughters of this particle by an angle phi from the axisis "axis" towards the axis "second_axis".

void PhotosParticle::rotateDaughters ( int  axis,
double  phi,
int  second_axis = Z_AXIS 
)
inherited

rotate 4-momentum of daughters of this particle by an angle phi from the axisis "axis" towards the axis "second_axis".

Definition at line 176 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::getDaughters(), and Photospp::PhotosParticle::hasDaughters().

177 {
178  if(!hasDaughters()) //if there are no daughters
179  return;
180 
181  vector<PhotosParticle*> daughters = getDaughters();
182  vector<PhotosParticle*>::iterator pcl_itr = daughters.begin();
183 
184  //get all daughters then rotate and boost them.
185  for(;pcl_itr != daughters.end();pcl_itr++)
186  {
187  (*pcl_itr)->rotate(axis,theta,second_axis);
188  (*pcl_itr)->rotateDaughters(axis,theta,second_axis);
189  }
190  //checkMomentumConservation();
191 }
axis
Definition: PndRadMapPlane.h:9
virtual std::vector< PhotosParticle * > getDaughters()=0
void PhotosHepMCParticle::setDaughters ( std::vector< PhotosParticle * >  daughters)
virtual

Set the daughters of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

Definition at line 103 of file PhotosHepMCParticle.cxx.

References clear(), Photospp::Log::Fatal(), getHepMC(), m_daughters, and m_particle.

103  {
104 
105  if(!m_particle->parent_event())
106  Log::Fatal("PhotosHepMCParticle::setDaughters(): New particle needs the event set before it's daughters can be added",3);
107 
109 
110  //If there are daughters
111  if(daughters.size()>0){
112 
113  //Use production vertex of first daughter as end vertex for particle
114  HepMC::GenParticle * first_daughter;
115  first_daughter = (dynamic_cast<PhotosHepMCParticle*>(daughters.at(0)))->getHepMC();
116 
117  HepMC::GenVertex * end_vertex;
118  end_vertex=first_daughter->production_vertex();
119  HepMC::GenVertex * orig_end_vertex = end_vertex;
120 
121  if(!end_vertex){ //if it does not exist create it
122  end_vertex = new HepMC::GenVertex();
123  m_particle->parent_event()->add_vertex(end_vertex);
124  }
125 
126  //Loop over all daughters to check that the end points to the right place
127  vector<PhotosParticle*>::iterator daughter_itr;
128  for(daughter_itr = daughters.begin(); daughter_itr != daughters.end();
129  daughter_itr++){
130 
131  HepMC::GenParticle * daug;
132  daug = dynamic_cast<PhotosHepMCParticle*>(*daughter_itr)->getHepMC();
133 
134 
135  if(daug->production_vertex()!=orig_end_vertex)
136  Log::Fatal("PhotosHepMCParticle::setDaughters(): Daughter production_vertices point to difference places. Can not override. Please delete vertices first.",4);
137  else
138  end_vertex->add_particle_out(daug);
139  }
140  end_vertex->add_particle_in(m_particle);
141  }
142 
143 }
void clear(std::vector< PhotosParticle * > v)
std::vector< PhotosParticle * > m_daughters
static void Fatal(string text, unsigned short int code=0)
Interface to HepMC::GenParticle objects.
void Photospp::PhotosHepMCParticle::setDaughters ( std::vector< PhotosParticle * >  daughters)
virtual

Set the daughters of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

void Photospp::PhotosHepMCParticle::setE ( double  e)
virtual

Set the energy component of the four vector

Implements Photospp::PhotosParticle.

void PhotosHepMCParticle::setE ( double  e)
virtual

Set the energy component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 393 of file PhotosHepMCParticle.cxx.

References m_particle.

393  {
394  HepMC::FourVector momentum(m_particle->momentum());
395  momentum.setE(e);
396  m_particle->set_momentum(momentum);
397 }
void Photospp::PhotosHepMCParticle::setMass ( double  mass)
virtual

Set the mass of this particle

Implements Photospp::PhotosParticle.

void PhotosHepMCParticle::setMass ( double  mass)
virtual

Set the mass of this particle

Implements Photospp::PhotosParticle.

Definition at line 268 of file PhotosHepMCParticle.cxx.

References m_particle.

268  {
269  m_particle->set_generated_mass(mass);
270 }
void Photospp::PhotosHepMCParticle::setMothers ( std::vector< PhotosParticle * >  mothers)
virtual

Set the mothers of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

void PhotosHepMCParticle::setMothers ( std::vector< PhotosParticle * >  mothers)
virtual

Set the mothers of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

Definition at line 44 of file PhotosHepMCParticle.cxx.

References clear(), Photospp::PhotosParticle::DECAYED, Photospp::Log::Fatal(), getHepMC(), m_mothers, m_particle, and Photospp::PhotosParticle::STABLE.

44  {
45 
46  /******** Deal with mothers ***********/
47 
49 
50  //If there are mothers
51  if(mothers.size()>0){
52 
53  HepMC::GenParticle * part;
54  part=dynamic_cast<PhotosHepMCParticle*>(mothers.at(0))->getHepMC();
55 
56  //Use end vertex of first mother as production vertex for particle
57  HepMC::GenVertex * production_vertex = part->end_vertex();
58  HepMC::GenVertex * orig_production_vertex = production_vertex;
59 
60  if(!production_vertex){ //if it does not exist create it
61  production_vertex = new HepMC::GenVertex();
62  part->parent_event()->add_vertex(production_vertex);
63  }
64 
65  //Loop over all mothers to check that the end points to the right place
66  vector<PhotosParticle*>::iterator mother_itr;
67  for(mother_itr = mothers.begin(); mother_itr != mothers.end();
68  mother_itr++){
69 
70  HepMC::GenParticle * moth;
71  moth = dynamic_cast<PhotosHepMCParticle*>(*mother_itr)->getHepMC();
72 
73  if(moth->end_vertex()!=orig_production_vertex)
74  Log::Fatal("PhotosHepMCParticle::setMothers(): Mother production_vertices point to difference places. Can not override. Please delete vertices first.",1);
75  else
76  production_vertex->add_particle_in(moth);
77 
78  //update status info
79  if(moth->status()==PhotosParticle::STABLE)
80  moth->set_status(PhotosParticle::DECAYED);
81  }
82  production_vertex->add_particle_out(m_particle);
83  }
84 }
void clear(std::vector< PhotosParticle * > v)
static const int DECAYED
static const int STABLE
static void Fatal(string text, unsigned short int code=0)
std::vector< PhotosParticle * > m_mothers
Interface to HepMC::GenParticle objects.
void Photospp::PhotosParticle::setP ( int  axis,
double  p_component 
)
inherited

Set momentum component in the direction of "axis" (x,y,z)

void PhotosParticle::setP ( int  axis,
double  p_component 
)
inherited

Set momentum component in the direction of "axis" (x,y,z)

Definition at line 215 of file PhotosParticle.cxx.

References Photospp::PhotosParticle::setPx(), Photospp::PhotosParticle::setPy(), Photospp::PhotosParticle::setPz(), Photospp::PhotosParticle::X_AXIS, Photospp::PhotosParticle::Y_AXIS, and Photospp::PhotosParticle::Z_AXIS.

Referenced by Photospp::PhotosParticle::rotate().

216 {
217  if(axis==X_AXIS) setPx(p_component);
218  if(axis==Y_AXIS) setPy(p_component);
219  if(axis==Z_AXIS) setPz(p_component);
220 }
virtual void setPz(double pz)=0
static const int Z_AXIS
virtual void setPx(double px)=0
virtual void setPy(double py)=0
axis
Definition: PndRadMapPlane.h:9
static const int Y_AXIS
static const int X_AXIS
void PhotosHepMCParticle::setPdgID ( int  pdg_id)
virtual

Set the PDG ID code of this particle

Implements Photospp::PhotosParticle.

Definition at line 264 of file PhotosHepMCParticle.cxx.

References m_particle.

264  {
265  m_particle->set_pdg_id(pdg_id);
266 }
void Photospp::PhotosHepMCParticle::setPdgID ( int  pdg_id)
virtual

Set the PDG ID code of this particle

Implements Photospp::PhotosParticle.

void Photospp::PhotosHepMCParticle::setPx ( double  px)
virtual

Set the px component of the four vector

Implements Photospp::PhotosParticle.

void PhotosHepMCParticle::setPx ( double  px)
virtual

Set the px component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 371 of file PhotosHepMCParticle.cxx.

References m_particle.

371  {
372  //make new momentum as something is wrong with
373  //the HepMC momentum setters
374 
375  HepMC::FourVector momentum(m_particle->momentum());
376  momentum.setPx(px);
377  m_particle->set_momentum(momentum);
378 }
void PhotosHepMCParticle::setPy ( double  py)
virtual

Set the px component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 380 of file PhotosHepMCParticle.cxx.

References m_particle.

380  {
381  HepMC::FourVector momentum(m_particle->momentum());
382  momentum.setPy(py);
383  m_particle->set_momentum(momentum);
384 }
void Photospp::PhotosHepMCParticle::setPy ( double  py)
virtual

Set the px component of the four vector

Implements Photospp::PhotosParticle.

void Photospp::PhotosHepMCParticle::setPz ( double  pz)
virtual

Set the pz component of the four vector

Implements Photospp::PhotosParticle.

void PhotosHepMCParticle::setPz ( double  pz)
virtual

Set the pz component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 387 of file PhotosHepMCParticle.cxx.

References m_particle.

387  {
388  HepMC::FourVector momentum(m_particle->momentum());
389  momentum.setPz(pz);
390  m_particle->set_momentum(momentum);
391 }
double pz[39]
Definition: pipisigmas.h:14
void Photospp::PhotosHepMCParticle::setStatus ( int  statu)
virtual

Set the status of this particle

Implements Photospp::PhotosParticle.

void PhotosHepMCParticle::setStatus ( int  statu)
virtual

Set the status of this particle

Implements Photospp::PhotosParticle.

Definition at line 272 of file PhotosHepMCParticle.cxx.

References m_particle.

Referenced by createSelfDecayVertex().

272  {
273  m_particle->set_status(status);
274 }
int status[10]
Definition: f_Init.h:28

Member Data Documentation

static const int PhotosParticle::ANTIDOWN = -1
staticinherited

anti-down quark

Definition at line 119 of file PhotosParticle.h.

static const int PhotosParticle::ANTIUP = -2
staticinherited

anti-up quark

Definition at line 113 of file PhotosParticle.h.

static const int PhotosParticle::DECAYED =2
staticinherited

Decayed particle status

Definition at line 32 of file PhotosParticle.h.

Referenced by setMothers().

static const int PhotosParticle::DOWN = 1
staticinherited

down quark

Definition at line 116 of file PhotosParticle.h.

static const int PhotosParticle::ELECTRON = 11
staticinherited

e- particle

Definition at line 101 of file PhotosParticle.h.

static const int PhotosParticle::ELECTRON_ANTINEUTRINO = -12
staticinherited

e antineutrino particle

Definition at line 107 of file PhotosParticle.h.

static const int PhotosParticle::ELECTRON_NEUTRINO = 12
staticinherited

e neutrino particle

Definition at line 104 of file PhotosParticle.h.

static const int PhotosParticle::GAMMA = 22
staticinherited

photon

Definition at line 71 of file PhotosParticle.h.

static const int PhotosParticle::HIGGS = 25
staticinherited

H particle

Definition at line 50 of file PhotosParticle.h.

static const int PhotosParticle::HIGGS_A = 36
staticinherited

A0 particle

Definition at line 56 of file PhotosParticle.h.

static const int PhotosParticle::HIGGS_H = 35
staticinherited

H0 particle

Definition at line 53 of file PhotosParticle.h.

static const int PhotosParticle::HIGGS_MINUS = -37
staticinherited

H- particle

Definition at line 62 of file PhotosParticle.h.

static const int PhotosParticle::HIGGS_PLUS = 37
staticinherited

H+ particle

Definition at line 59 of file PhotosParticle.h.

static const int PhotosParticle::HISTORY =3
staticinherited

History particle status

Definition at line 35 of file PhotosParticle.h.

std::vector< PhotosParticle * > PhotosHepMCParticle::m_created_particles
private

list to keep track of new particles which have been created from this one, so we can call their destructor later

Definition at line 160 of file PhotosHepMCParticle.h.

Referenced by createNewParticle().

std::vector< PhotosParticle * > PhotosHepMCParticle::m_daughters
private

A vector of this particles daughters

Definition at line 153 of file PhotosHepMCParticle.h.

Referenced by addDaughter(), getDaughters(), setDaughters(), and ~PhotosHepMCParticle().

std::vector< PhotosParticle * > PhotosHepMCParticle::m_decay_products
private

A vector of all decay products of this particle

Definition at line 156 of file PhotosHepMCParticle.h.

Referenced by getAllDecayProducts().

std::vector< PhotosParticle * > PhotosHepMCParticle::m_mothers
private

A vector of this particles mothers

Definition at line 150 of file PhotosHepMCParticle.h.

Referenced by getMothers(), setMothers(), and ~PhotosHepMCParticle().

HepMC::GenParticle * PhotosHepMCParticle::m_particle
private
static const int PhotosParticle::MUON_ANTINEUTRINO = -14
staticinherited

muon antineutrino particle

Definition at line 95 of file PhotosParticle.h.

static const int PhotosParticle::MUON_MINUS = 13
staticinherited

muon- particle

Definition at line 89 of file PhotosParticle.h.

static const int PhotosParticle::MUON_NEUTRINO = 14
staticinherited

muon neutrino particle

Definition at line 92 of file PhotosParticle.h.

static const int PhotosParticle::MUON_PLUS = -13
staticinherited

muon+ particle

Definition at line 86 of file PhotosParticle.h.

static const int PhotosParticle::OTHER = 0
staticinherited

All other particle types

Definition at line 122 of file PhotosParticle.h.

static const int PhotosParticle::POSITRON = -11
staticinherited

e+ particle

Definition at line 98 of file PhotosParticle.h.

static const int PhotosParticle::STABLE =1
staticinherited

Stable particle status

Definition at line 29 of file PhotosParticle.h.

Referenced by Photospp::PhotosEvent::filterParticles(), and setMothers().

static const int PhotosParticle::TAU_ANTINEUTRINO = -16
staticinherited

tau antineutrino particle

Definition at line 83 of file PhotosParticle.h.

static const int PhotosParticle::TAU_MINUS = 15
staticinherited

tau- particle

Definition at line 77 of file PhotosParticle.h.

static const int PhotosParticle::TAU_NEUTRINO = 16
staticinherited

tau neutrino particle

Definition at line 80 of file PhotosParticle.h.

static const int PhotosParticle::TAU_PLUS = -15
staticinherited

tau+ particle

Definition at line 74 of file PhotosParticle.h.

static const int PhotosParticle::UP = 2
staticinherited

up quark

Definition at line 110 of file PhotosParticle.h.

static const int PhotosParticle::W_MINUS = -24
staticinherited

W- particle

Definition at line 68 of file PhotosParticle.h.

static const int PhotosParticle::W_PLUS = 24
staticinherited

W+ particle

Definition at line 65 of file PhotosParticle.h.

static const int PhotosParticle::X_AXIS =1
staticinherited
static const int PhotosParticle::Y_AXIS =2
staticinherited
static const int PhotosParticle::Z0 = 23
staticinherited

Z0 particle

Definition at line 47 of file PhotosParticle.h.

static const int PhotosParticle::Z_AXIS =3
staticinherited

Z Axis

Definition at line 44 of file PhotosParticle.h.

Referenced by Photospp::PhotosParticle::getP(), and Photospp::PhotosParticle::setP().


The documentation for this class was generated from the following files: