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

#include <PhotosHEPEVTParticle.h>

Inheritance diagram for Photospp::PhotosHEPEVTParticle:
Photospp::PhotosParticle Photospp::PhotosParticle

Public Member Functions

 ~PhotosHEPEVTParticle ()
 
 PhotosHEPEVTParticle (int pdgid, int status, double px, double py, double pz, double e, double m, int ms, int me, int ds, int de)
 
void addDaughter (PhotosParticle *daughter)
 
void setMothers (std::vector< PhotosParticle * > mothers)
 
void setDaughters (std::vector< PhotosParticle * > daughters)
 
std::vector< PhotosParticle * > getMothers ()
 
std::vector< PhotosParticle * > getDaughters ()
 
std::vector< PhotosParticle * > getAllDecayProducts ()
 
bool checkMomentumConservation ()
 
PhotosHEPEVTParticlecreateNewParticle (int pdg_id, int status, double mass, double px, double py, double pz, double e)
 
void createHistoryEntry ()
 
void createSelfDecayVertex (PhotosParticle *out)
 
bool isDaughterOf (PhotosHEPEVTParticle *p)
 
bool isMotherOf (PhotosHEPEVTParticle *p)
 
void print ()
 
void setPdgID (int pdg_id)
 
void setStatus (int statu)
 
void setMass (double mass)
 
int getPdgID ()
 
int getStatus ()
 
double getMass ()
 
double getPx ()
 
double getPy ()
 
double getPz ()
 
double getE ()
 
void setPx (double px)
 
void setPy (double py)
 
void setPz (double pz)
 
void setE (double e)
 
int getBarcode ()
 
void setBarcode (int barcode)
 
void setEvent (PhotosHEPEVTEvent *event)
 
int getFirstMotherIndex ()
 
int getSecondMotherIndex ()
 
int getDaughterRangeStart ()
 
int getDaughterRangeEnd ()
 
 ~PhotosHEPEVTParticle ()
 
 PhotosHEPEVTParticle (int pdgid, int status, double px, double py, double pz, double e, double m, int ms, int me, int ds, int de)
 
void addDaughter (PhotosParticle *daughter)
 
void setMothers (std::vector< PhotosParticle * > mothers)
 
void setDaughters (std::vector< PhotosParticle * > daughters)
 
std::vector< PhotosParticle * > getMothers ()
 
std::vector< PhotosParticle * > getDaughters ()
 
std::vector< PhotosParticle * > getAllDecayProducts ()
 
bool checkMomentumConservation ()
 
PhotosHEPEVTParticlecreateNewParticle (int pdg_id, int status, double mass, double px, double py, double pz, double e)
 
void createHistoryEntry ()
 
void createSelfDecayVertex (PhotosParticle *out)
 
bool isDaughterOf (PhotosHEPEVTParticle *p)
 
bool isMotherOf (PhotosHEPEVTParticle *p)
 
void print ()
 
void setPdgID (int pdg_id)
 
void setStatus (int statu)
 
void setMass (double mass)
 
int getPdgID ()
 
int getStatus ()
 
double getMass ()
 
double getPx ()
 
double getPy ()
 
double getPz ()
 
double getE ()
 
void setPx (double px)
 
void setPy (double py)
 
void setPz (double pz)
 
void setE (double e)
 
int getBarcode ()
 
void setBarcode (int barcode)
 
void setEvent (PhotosHEPEVTEvent *event)
 
int getFirstMotherIndex ()
 
int getSecondMotherIndex ()
 
int getDaughterRangeStart ()
 
int getDaughterRangeEnd ()
 
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 setDaughterRangeStart (int i)
 
void setDaughterRangeEnd (int i)
 
void setDaughterRangeStart (int i)
 
void setDaughterRangeEnd (int i)
 

Private Attributes

PhotosHEPEVTEventm_event
 
int m_barcode
 
int m_first_mother
 
int m_second_mother
 
int m_daughter_start
 
int m_daughter_end
 
int m_pdgid
 
int m_status
 
double m_px
 
double m_py
 
double m_pz
 
double m_e
 
double m_generated_mass
 
vector< PhotosHEPEVTParticle * > cache
 

Detailed Description

Definition at line 32 of file PhotosHEPEVTParticle.h.

Constructor & Destructor Documentation

PhotosHEPEVTParticle::~PhotosHEPEVTParticle ( )

Default destructor

Definition at line 7 of file PhotosHEPEVTParticle.cxx.

References cache, i, and m_barcode.

8 {
9  // Cleanup particles that do not belong to event
10  for(unsigned int i=0;i<cache.size();i++)
11  if(cache[i]->m_barcode<0)
12  delete cache[i];
13 }
Int_t i
Definition: run_full.C:25
vector< PhotosHEPEVTParticle * > cache
PhotosHEPEVTParticle::PhotosHEPEVTParticle ( int  pdgid,
int  status,
double  px,
double  py,
double  pz,
double  e,
double  m,
int  ms,
int  me,
int  ds,
int  de 
)

Default constructor

Definition at line 15 of file PhotosHEPEVTParticle.cxx.

References de, m, m_barcode, m_daughter_end, m_daughter_start, m_e, m_event, m_first_mother, m_generated_mass, m_pdgid, m_px, m_py, m_pz, m_second_mother, m_status, me, pz, and status.

Referenced by createNewParticle().

15  {
16  m_px = px;
17  m_py = py;
18  m_pz = pz;
19  m_e = e;
21 
22  m_pdgid = pdgid;
23  m_status = status;
24 
25  m_first_mother = ms;
27  m_daughter_start = ds;
29 
30  m_barcode = -1;
31  m_event = NULL;
32 }
__m128 m
Definition: P4_F32vec4.h:28
static const double me
Definition: mzparameters.h:12
double de
Definition: anaLmdDigi.C:68
double pz[39]
Definition: pipisigmas.h:14
int status[10]
Definition: f_Init.h:28
Photospp::PhotosHEPEVTParticle::~PhotosHEPEVTParticle ( )

Default destructor

Photospp::PhotosHEPEVTParticle::PhotosHEPEVTParticle ( int  pdgid,
int  status,
double  px,
double  py,
double  pz,
double  e,
double  m,
int  ms,
int  me,
int  ds,
int  de 
)

Default constructor

Member Function Documentation

void PhotosHEPEVTParticle::addDaughter ( PhotosParticle daughter)
virtual

Add a new daughter to this particle

Implements Photospp::PhotosParticle.

Definition at line 35 of file PhotosHEPEVTParticle.cxx.

References Photospp::Log::Fatal(), Photospp::PhotosParticle::getBarcode(), getDaughterRangeEnd(), getDaughterRangeStart(), Photospp::PhotosParticle::getMothers(), Photospp::PhotosHEPEVTEvent::getParticle(), i, m, m_daughter_end, m_daughter_start, m_event, move, setBarcode(), setDaughterRangeEnd(), setDaughterRangeStart(), Photospp::PhotosParticle::setMothers(), and Photospp::PhotosHEPEVTEvent::setParticle().

36 {
37  if(!m_event) Log::Fatal("PhotosHEPEVTParticle::addDaughter - particle not in event record");
38 
39  std::vector<PhotosParticle*> mothers = daughter->getMothers();
40 
41  mothers.push_back( (PhotosParticle*)this );
42 
43  daughter->setMothers(mothers);
44 
45  int bc = daughter->getBarcode();
46 
47  if(m_daughter_end < 0)
48  {
49  m_daughter_start = bc;
50  m_daughter_end = bc;
51  }
52  // if it's in the middle of the event record
53  else if(m_daughter_end != bc-1)
54  {
56 
57  // Move all particles one spot down the list, to make place for new particle
58  for(int i=bc-1;i>m_daughter_end;i--)
59  {
61  move->setBarcode(i+1);
62  m_event->setParticle(i+1,move);
63  }
64 
65  m_daughter_end++;
66  newPart->setBarcode(m_daughter_end);
67  m_event->setParticle(m_daughter_end,newPart);
68 
69  // Now: correct all pointers before new particle
70  for(int i=0;i<m_daughter_end;i++)
71  {
73  int m = check->getDaughterRangeEnd();
74  if(m!=-1 && m>m_daughter_end)
75  {
76  check->setDaughterRangeEnd(m+1);
77  check->setDaughterRangeStart(check->getDaughterRangeStart()+1);
78  }
79  }
80  }
81  else m_daughter_end = bc;
82 }
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
PhotosHEPEVTParticle * getParticle(int i)
std::string move
Abstract base class for particle in the event. This class also handles boosting.
static void Fatal(string text, unsigned short int code=0)
void setParticle(int i, PhotosHEPEVTParticle *p)
Single particle of HEPEVT event record.
void Photospp::PhotosHEPEVTParticle::addDaughter ( PhotosParticle daughter)
virtual

Add a new daughter to 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::PhotosHEPEVTParticle::checkMomentumConservation ( )
virtual

Check that the 4 momentum in conserved in the decay of this particle

Implements Photospp::PhotosParticle.

bool PhotosHEPEVTParticle::checkMomentumConservation ( )
virtual

Check that the 4 momentum in conserved in the decay of this particle

Implements Photospp::PhotosParticle.

Definition at line 225 of file PhotosHEPEVTParticle.cxx.

References buf, fabs(), getE(), getFirstMotherIndex(), Photospp::PhotosHEPEVTEvent::getParticle(), getPx(), getPy(), getPz(), getSecondMotherIndex(), i, m2(), m_daughter_end, m_daughter_start, m_event, print(), pz, Photospp::Log::RedirectOutput(), Photospp::Log::RevertOutput(), sqrt(), and Photospp::Log::Warning().

225  {
226 
227  if(!m_event) return true;
228  if(m_daughter_end < 0) return true;
229 
231 
232  int first_mother_idx = buf->getFirstMotherIndex();
233  int second_mother_idx = buf->getSecondMotherIndex();
234 
235  double px =0.0, py =0.0, pz =0.0, e =0.0;
236  double px2=0.0, py2=0.0, pz2=0.0, e2=0.0;
237 
238  for(int i=m_daughter_start;i<=m_daughter_end;i++)
239  {
240  buf = m_event->getParticle(i);
241  px += buf->getPx();
242  py += buf->getPy();
243  pz += buf->getPz();
244  e += buf->getE ();
245  }
246 
247  if(first_mother_idx>=0)
248  {
249  buf = m_event->getParticle(first_mother_idx);
250  px2 += buf->getPx();
251  py2 += buf->getPy();
252  pz2 += buf->getPz();
253  e2 += buf->getE();
254  }
255 
256  if(second_mother_idx>=0)
257  {
258  buf = m_event->getParticle(second_mother_idx);
259  px2 += buf->getPx();
260  py2 += buf->getPy();
261  pz2 += buf->getPz();
262  e2 += buf->getE();
263  }
264  // 3-momentum // test HepMC style
265  double dp = sqrt( (px-px2)*(px-px2) + (py-py2)*(py-py2) + (pz-pz2)*(pz-pz2) );
266  // virtuality test as well.
267  double m1 = sqrt( fabs( e*e - px*px - py*py - pz*pz ) );
268  double m2 = sqrt( fabs( e2*e2 - px2*px2 - py2*py2 - pz2*pz2 ) );
269 
270  if( fabs(m1-m2) > 0.0001 || dp > 0.0001*(e+e2))
271  {
272  Log::RedirectOutput( Log::Warning()<<"Momentum not conserved in vertex: " );
273  if(first_mother_idx >=0) m_event->getParticle(first_mother_idx) ->print();
274  if(second_mother_idx>=0) m_event->getParticle(second_mother_idx)->print();
277  return false;
278  }
279 
280  return true;
281 }
Int_t i
Definition: run_full.C:25
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
PhotosHEPEVTParticle * getParticle(int i)
TString m2(TString pts, TString exts="e px py pz")
Definition: invexp.C:117
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
static ostream & Warning(bool count=true)
Definition: Log.cxx:46
return buf
static void RevertOutput()
Definition: Log.h:90
static void RedirectOutput(void(*func)(), ostream &where=*out)
Definition: Log.cxx:90
double pz[39]
Definition: pipisigmas.h:14
Single particle of HEPEVT event record.
void PhotosHEPEVTParticle::createHistoryEntry ( )
virtual

Creating history entries not implemented in HEPEVT

Implements Photospp::PhotosParticle.

Definition at line 294 of file PhotosHEPEVTParticle.cxx.

References Photospp::Log::Warning().

295 {
296  Log::Warning()<<"PhotosParticle::createHistoryEntry() not implemented for HEPEVT."<<endl;
297 }
static ostream & Warning(bool count=true)
Definition: Log.cxx:46
void Photospp::PhotosHEPEVTParticle::createHistoryEntry ( )
virtual

Creating history entries not implemented in HEPEVT

Implements Photospp::PhotosParticle.

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

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

Implements Photospp::PhotosParticle.

Definition at line 283 of file PhotosHEPEVTParticle.cxx.

References cache, and PhotosHEPEVTParticle().

285  {
286 
287  // New particles created using this method are added to cache
288  // They will be deleted when this particle will be deleted
289 
290  cache.push_back(new PhotosHEPEVTParticle(pdg_id,status,px,py,pz,e,mass,-1,-1,-1,-1));
291  return cache.back();
292 }
PhotosHEPEVTParticle(int pdgid, int status, double px, double py, double pz, double e, double m, int ms, int me, int ds, int de)
vector< PhotosHEPEVTParticle * > cache
double pz[39]
Definition: pipisigmas.h:14
int status[10]
Definition: f_Init.h:28
PhotosHEPEVTParticle* Photospp::PhotosHEPEVTParticle::createNewParticle ( int  pdg_id,
int  status,
double  mass,
double  px,
double  py,
double  pz,
double  e 
)
virtual

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

Implements Photospp::PhotosParticle.

void PhotosHEPEVTParticle::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 299 of file PhotosHEPEVTParticle.cxx.

References Photospp::Log::Warning().

300 {
301  Log::Warning()<<"PhotosHEPEVTParticle::createSelfDecayVertex() not implemented for HEPEVT."<<endl;
302 }
static ostream & Warning(bool count=true)
Definition: Log.cxx:46
void Photospp::PhotosHEPEVTParticle::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::PhotosHEPEVTParticle::getAllDecayProducts ( )
virtual

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

Implements Photospp::PhotosParticle.

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

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

Implements Photospp::PhotosParticle.

Definition at line 185 of file PhotosHEPEVTParticle.cxx.

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

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

Get the barcode (position in list) of this particle

Implements Photospp::PhotosParticle.

int PhotosHEPEVTParticle::getBarcode ( )
virtual

Get the barcode (position in list) of this particle

Implements Photospp::PhotosParticle.

Definition at line 388 of file PhotosHEPEVTParticle.cxx.

References m_barcode.

Referenced by getAllDecayProducts(), isDaughterOf(), isMotherOf(), and setMothers().

388  {
389  return m_barcode;
390 }
int PhotosHEPEVTParticle::getDaughterRangeEnd ( )

Get index of last daughter

Definition at line 412 of file PhotosHEPEVTParticle.cxx.

References m_daughter_end.

Referenced by addDaughter().

412  {
413  return m_daughter_end;
414 }
int Photospp::PhotosHEPEVTParticle::getDaughterRangeEnd ( )

Get index of last daughter

int Photospp::PhotosHEPEVTParticle::getDaughterRangeStart ( )

Get index of first daughter

int PhotosHEPEVTParticle::getDaughterRangeStart ( )

Get index of first daughter

Definition at line 408 of file PhotosHEPEVTParticle.cxx.

References m_daughter_start.

Referenced by addDaughter().

408  {
409  return m_daughter_start;
410 }
std::vector< PhotosParticle * > PhotosHEPEVTParticle::getDaughters ( )
virtual

Returns the daughters of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

Definition at line 138 of file PhotosHEPEVTParticle.cxx.

References Photospp::PhotosHEPEVTEvent::getParticle(), Photospp::PhotosHEPEVTEvent::getParticleCount(), i, isDaughterOf(), m_daughter_end, m_daughter_start, m_event, m_status, p, and Photospp::Log::Warning().

Referenced by getAllDecayProducts().

138  {
139 
140  std::vector<PhotosParticle*> daughters;
141 
142  if(!m_event) return daughters;
143 
144  // Check if m_daughter_start and m_daughter_end are set
145  // If not - try to get list of daughters from event
146  if(m_daughter_end<0)
147  {
148  int min_d=65535, max_d=-1;
149  for(int i=0;i<m_event->getParticleCount();i++)
150  {
151  if(m_event->getParticle(i)->isDaughterOf(this))
152  {
153  if(i<min_d) min_d = i;
154  if(i>max_d) max_d = i;
155  }
156  }
157  if(max_d>=0)
158  {
159  m_daughter_start = min_d;
160  m_daughter_end = max_d;
161  m_status = 2;
162  }
163  }
164 
165  // If m_daughter_end is still not set - there are no daughters
166  // Otherwsie - get daughters
167  if(m_daughter_end>=0)
168  {
169  for(int i=m_daughter_start;i<=m_daughter_end;i++)
170  {
172  if(p==NULL)
173  {
174  Log::Warning()<<"PhotosHEPEVTParticle::getDaughters(): No particle with index "<<i<<endl;
175  return daughters;
176  }
177 
178  daughters.push_back(p);
179  }
180  }
181 
182  return daughters;
183 }
Int_t i
Definition: run_full.C:25
PhotosHEPEVTParticle * getParticle(int i)
Double_t p
Definition: anasim.C:58
Abstract base class for particle in the event. This class also handles boosting.
static ostream & Warning(bool count=true)
Definition: Log.cxx:46
bool isDaughterOf(PhotosHEPEVTParticle *p)
std::vector<PhotosParticle*> Photospp::PhotosHEPEVTParticle::getDaughters ( )
virtual

Returns the daughters of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

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
std::vector<PhotosParticle *> Photospp::PhotosParticle::getDecayTree ( )
inherited

Return whole decay tree starting from this particle

double PhotosHEPEVTParticle::getE ( )
virtual

Returns the energy component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 367 of file PhotosHEPEVTParticle.cxx.

References m_e.

Referenced by checkMomentumConservation(), and checkMomentumConservationInEvent().

367  {
368  return m_e;
369 }
double Photospp::PhotosHEPEVTParticle::getE ( )
virtual

Returns the energy component of the four vector

Implements Photospp::PhotosParticle.

int Photospp::PhotosHEPEVTParticle::getFirstMotherIndex ( )

Get index of first mother

int PhotosHEPEVTParticle::getFirstMotherIndex ( )

Get index of first mother

Definition at line 400 of file PhotosHEPEVTParticle.cxx.

References m_first_mother.

Referenced by checkMomentumConservation().

400  {
401  return m_first_mother;
402 }
double PhotosHEPEVTParticle::getMass ( )
virtual

Get the mass stored (i.e. not calculated from four vector) at generation step

Implements Photospp::PhotosParticle.

Definition at line 351 of file PhotosHEPEVTParticle.cxx.

References m_generated_mass.

351  {
352  return m_generated_mass;
353 }
double Photospp::PhotosHEPEVTParticle::getMass ( )
virtual

Get the mass stored (i.e. not calculated from four vector) at generation step

Implements Photospp::PhotosParticle.

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

Returns the mothers of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

Definition at line 120 of file PhotosHEPEVTParticle.cxx.

References Photospp::PhotosHEPEVTEvent::getParticle(), m_event, m_first_mother, m_second_mother, p1, and p2.

120  {
121 
122  std::vector<PhotosParticle*> mothers;
123 
124  PhotosParticle *p1 = NULL;
125  PhotosParticle *p2 = NULL;
126 
129 
130  if(p1) mothers.push_back(p1);
131  if(p2) mothers.push_back(p2);
132 
133  return mothers;
134 }
PhotosHEPEVTParticle * getParticle(int i)
Abstract base class for particle in the event. This class also handles boosting.
TPad * p2
Definition: hist-t7.C:117
TPad * p1
Definition: hist-t7.C:116
std::vector<PhotosParticle*> Photospp::PhotosHEPEVTParticle::getMothers ( )
virtual

Returns the mothers of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

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 PhotosHEPEVTParticle::getPdgID ( )
virtual

Get the PDG ID code of this particle

Implements Photospp::PhotosParticle.

Definition at line 343 of file PhotosHEPEVTParticle.cxx.

References m_pdgid.

343  {
344  return m_pdgid;
345 }
int Photospp::PhotosHEPEVTParticle::getPdgID ( )
virtual

Get the PDG ID code of this particle

Implements Photospp::PhotosParticle.

double PhotosHEPEVTParticle::getPx ( )
inlinevirtual

Returns the px component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 355 of file PhotosHEPEVTParticle.cxx.

References m_px.

Referenced by checkMomentumConservation(), and checkMomentumConservationInEvent().

355  {
356  return m_px;
357 }
double Photospp::PhotosHEPEVTParticle::getPx ( )
virtual

Returns the px component of the four vector

Implements Photospp::PhotosParticle.

double PhotosHEPEVTParticle::getPy ( )
inlinevirtual

Returns the py component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 359 of file PhotosHEPEVTParticle.cxx.

References m_py.

Referenced by checkMomentumConservation(), and checkMomentumConservationInEvent().

359  {
360  return m_py;
361 }
double Photospp::PhotosHEPEVTParticle::getPy ( )
virtual

Returns the py component of the four vector

Implements Photospp::PhotosParticle.

double PhotosHEPEVTParticle::getPz ( )
virtual

Returns the pz component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 363 of file PhotosHEPEVTParticle.cxx.

References m_pz.

Referenced by checkMomentumConservation(), and checkMomentumConservationInEvent().

363  {
364  return m_pz;
365 }
double Photospp::PhotosHEPEVTParticle::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 PhotosHEPEVTParticle::getSecondMotherIndex ( )

Get index of second mother

Definition at line 404 of file PhotosHEPEVTParticle.cxx.

References m_second_mother.

Referenced by checkMomentumConservation().

404  {
405  return m_second_mother;
406 }
int Photospp::PhotosHEPEVTParticle::getSecondMotherIndex ( )

Get index of second mother

int PhotosHEPEVTParticle::getStatus ( )
virtual

Get the status of this particle

Implements Photospp::PhotosParticle.

Definition at line 347 of file PhotosHEPEVTParticle.cxx.

References m_status.

Referenced by checkMomentumConservationInEvent().

347  {
348  return m_status;
349 }
int Photospp::PhotosHEPEVTParticle::getStatus ( )
virtual

Get the status of this particle

Implements Photospp::PhotosParticle.

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
virtual double Photospp::PhotosParticle::getVirtuality ( )
virtualinherited

Get sqrt(e^2-p^2)

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(), getAllDecayProducts(), Photospp::PhotosHepMCParticle::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

bool Photospp::PhotosHEPEVTParticle::isDaughterOf ( PhotosHEPEVTParticle p)

Check if particle 'p' is daughter of this particle

bool PhotosHEPEVTParticle::isDaughterOf ( PhotosHEPEVTParticle p)

Check if particle 'p' is daughter of this particle

Definition at line 304 of file PhotosHEPEVTParticle.cxx.

References getBarcode(), m_first_mother, and m_second_mother.

Referenced by getDaughters().

305 {
306  int bc = p->getBarcode();
307  if(bc==m_first_mother || bc==m_second_mother) return true;
308 
309  return false;
310 }
bool Photospp::PhotosHEPEVTParticle::isMotherOf ( PhotosHEPEVTParticle p)

Check if particle 'p' is mother of this particle

bool PhotosHEPEVTParticle::isMotherOf ( PhotosHEPEVTParticle p)

Check if particle 'p' is mother of this particle

Definition at line 312 of file PhotosHEPEVTParticle.cxx.

References getBarcode(), m_daughter_end, and m_daughter_start.

313 {
314  int bc = p->getBarcode();
315  if(bc>=m_daughter_start && bc<=m_daughter_end) return true;
316 
317  return false;
318 }
void Photospp::PhotosHEPEVTParticle::print ( )
virtual

Print information on this particle into standard output

Implements Photospp::PhotosParticle.

void PhotosHEPEVTParticle::print ( )
virtual

Print information on this particle into standard output

Implements Photospp::PhotosParticle.

Definition at line 320 of file PhotosHEPEVTParticle.cxx.

References buf, m_barcode, m_daughter_end, m_daughter_start, m_e, m_first_mother, m_generated_mass, m_pdgid, m_px, m_py, m_pz, m_second_mother, and m_status.

Referenced by checkMomentumConservation().

320  {
321  char buf[256];
322  sprintf(buf,"P: (%2i) %6i %2i | %11.4e %11.4e %11.4e %11.4e | %11.4e | M: %2i %2i | D: %2i %2i\n",
325 
326  cout<<buf;
327 }
return buf
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 Photospp::PhotosHEPEVTParticle::setBarcode ( int  barcode)

Set barcode (position in list) of this particle

void PhotosHEPEVTParticle::setBarcode ( int  barcode)

Set barcode (position in list) of this particle

Definition at line 392 of file PhotosHEPEVTParticle.cxx.

References m_barcode.

Referenced by addDaughter(), and Photospp::PhotosHEPEVTEvent::addParticle().

392  {
393  m_barcode = barcode;
394 }
void Photospp::PhotosHEPEVTParticle::setDaughterRangeEnd ( int  i)
inlineprivate

Set index of last daughter

Definition at line 159 of file 3.52/src/eventRecordInterfaces/PhotosHEPEVTParticle.h.

References i, and m_daughter_end.

void Photospp::PhotosHEPEVTParticle::setDaughterRangeEnd ( int  i)
inlineprivate

Set index of last daughter

Definition at line 159 of file PhotosHEPEVTParticle.h.

References i, and m_daughter_end.

Referenced by addDaughter().

void Photospp::PhotosHEPEVTParticle::setDaughterRangeStart ( int  i)
inlineprivate

Set index of first daughter

Definition at line 156 of file PhotosHEPEVTParticle.h.

References i, and m_daughter_start.

Referenced by addDaughter().

void Photospp::PhotosHEPEVTParticle::setDaughterRangeStart ( int  i)
inlineprivate

Set index of first daughter

Definition at line 156 of file 3.52/src/eventRecordInterfaces/PhotosHEPEVTParticle.h.

References i, and m_daughter_start.

void PhotosHEPEVTParticle::setDaughters ( std::vector< PhotosParticle * >  daughters)
virtual

Set the daughters of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

Definition at line 100 of file PhotosHEPEVTParticle.cxx.

References Photospp::Log::Fatal(), i, m_daughter_end, m_daughter_start, and m_event.

100  {
101 
102  // This particle must be inside some event record to be able to add daughters
103  if(m_event==NULL) Log::Fatal("PhotosHEPEVTParticle::setDaughters: particle not inside event record.");
104 
105  int beg = 65535, end = -1;
106 
107  for(unsigned int i=0;i<daughters.size();i++)
108  {
109  int bc = daughters[i]->getBarcode();
110  if(bc<0) Log::Fatal("PhotosHEPEVTParticle::setDaughters: all daughters has to be in event record first");
111  if(bc<beg) beg = bc;
112  if(bc>end) end = bc;
113  }
114  if(end == -1) beg = -1;
115 
116  m_daughter_start = beg;
117  m_daughter_end = end;
118 }
Int_t i
Definition: run_full.C:25
static void Fatal(string text, unsigned short int code=0)
void Photospp::PhotosHEPEVTParticle::setDaughters ( std::vector< PhotosParticle * >  daughters)
virtual

Set the daughters of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

void PhotosHEPEVTParticle::setE ( double  e)
virtual

Set the energy component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 384 of file PhotosHEPEVTParticle.cxx.

References m_e.

384  {
385  m_e = e;
386 }
void Photospp::PhotosHEPEVTParticle::setE ( double  e)
virtual

Set the energy component of the four vector

Implements Photospp::PhotosParticle.

void PhotosHEPEVTParticle::setEvent ( PhotosHEPEVTEvent event)

Set event of this particle

Definition at line 396 of file PhotosHEPEVTParticle.cxx.

References m_event.

Referenced by Photospp::PhotosHEPEVTEvent::addParticle().

396  {
397  m_event = event;
398 }
void Photospp::PhotosHEPEVTParticle::setEvent ( PhotosHEPEVTEvent event)

Set event of this particle

void Photospp::PhotosHEPEVTParticle::setMass ( double  mass)
virtual

Set the mass of this particle

Implements Photospp::PhotosParticle.

void PhotosHEPEVTParticle::setMass ( double  mass)
virtual

Set the mass of this particle

Implements Photospp::PhotosParticle.

Definition at line 339 of file PhotosHEPEVTParticle.cxx.

References m_generated_mass.

339  {
340  m_generated_mass = mass;
341 }
void Photospp::PhotosHEPEVTParticle::setMothers ( std::vector< PhotosParticle * >  mothers)
virtual

Set the mothers of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

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

Set the mothers of this particle via a vector of PhotosParticle

Implements Photospp::PhotosParticle.

Definition at line 84 of file PhotosHEPEVTParticle.cxx.

References Photospp::PhotosHEPEVTEvent::addParticle(), evt, Photospp::Log::Fatal(), getBarcode(), m_barcode, m_first_mother, and m_second_mother.

84  {
85 
86  // If this particle has not yet been added to the event record
87  // then add it to the mothers' event record
88  if(m_barcode<0 && mothers.size()>0)
89  {
90  PhotosHEPEVTEvent *evt = ((PhotosHEPEVTParticle*)mothers[0])->m_event;
91  evt->addParticle(this);
92  }
93 
94  if(mothers.size()>2) Log::Fatal("PhotosHEPEVTParticle::setMothers: HEPEVT does not allow more than two mothers!");
95 
96  if(mothers.size()>0) m_first_mother = mothers[0]->getBarcode();
97  if(mothers.size()>1) m_second_mother = mothers[1]->getBarcode();
98 }
int evt
Definition: checkhelixhit.C:36
static void Fatal(string text, unsigned short int code=0)
Single particle of HEPEVT event record.
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 Photospp::PhotosParticle::setP ( int  axis,
double  p_component 
)
inherited

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

void PhotosHEPEVTParticle::setPdgID ( int  pdg_id)
virtual

Set the PDG ID code of this particle

Implements Photospp::PhotosParticle.

Definition at line 331 of file PhotosHEPEVTParticle.cxx.

References m_pdgid.

331  {
332  m_pdgid = pdg_id;
333 }
void Photospp::PhotosHEPEVTParticle::setPdgID ( int  pdg_id)
virtual

Set the PDG ID code of this particle

Implements Photospp::PhotosParticle.

void PhotosHEPEVTParticle::setPx ( double  px)
virtual

Set the px component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 371 of file PhotosHEPEVTParticle.cxx.

References m_px.

371  {
372  m_px = px;
373 }
void Photospp::PhotosHEPEVTParticle::setPx ( double  px)
virtual

Set the px component of the four vector

Implements Photospp::PhotosParticle.

void PhotosHEPEVTParticle::setPy ( double  py)
virtual

Set the px component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 375 of file PhotosHEPEVTParticle.cxx.

References m_py.

375  {
376  m_py = py;
377 }
void Photospp::PhotosHEPEVTParticle::setPy ( double  py)
virtual

Set the px component of the four vector

Implements Photospp::PhotosParticle.

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

Set the pz component of the four vector

Implements Photospp::PhotosParticle.

void PhotosHEPEVTParticle::setPz ( double  pz)
virtual

Set the pz component of the four vector

Implements Photospp::PhotosParticle.

Definition at line 380 of file PhotosHEPEVTParticle.cxx.

References m_pz, and pz.

380  {
381  m_pz = pz;
382 }
double pz[39]
Definition: pipisigmas.h:14
void Photospp::PhotosHEPEVTParticle::setStatus ( int  statu)
virtual

Set the status of this particle

Implements Photospp::PhotosParticle.

void PhotosHEPEVTParticle::setStatus ( int  statu)
virtual

Set the status of this particle

Implements Photospp::PhotosParticle.

Definition at line 335 of file PhotosHEPEVTParticle.cxx.

References m_status, and status.

335  {
336  m_status = status;
337 }
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.

vector< PhotosHEPEVTParticle * > PhotosHEPEVTParticle::cache
private

List of created particles - if they are not in the event, they will be deleted when no longer needed

Definition at line 187 of file PhotosHEPEVTParticle.h.

Referenced by createNewParticle(), and ~PhotosHEPEVTParticle().

static const int PhotosParticle::DECAYED =2
staticinherited

Decayed particle status

Definition at line 32 of file PhotosParticle.h.

Referenced by Photospp::PhotosHepMCParticle::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.

int PhotosHEPEVTParticle::m_barcode
private

Position in the event record

Definition at line 165 of file PhotosHEPEVTParticle.h.

Referenced by getBarcode(), PhotosHEPEVTParticle(), print(), setBarcode(), setMothers(), and ~PhotosHEPEVTParticle().

int PhotosHEPEVTParticle::m_daughter_end
private
int PhotosHEPEVTParticle::m_daughter_start
private

Range of indexes of daughters (-1 if do not have daughters)

Definition at line 171 of file PhotosHEPEVTParticle.h.

Referenced by addDaughter(), checkMomentumConservation(), getDaughterRangeStart(), getDaughters(), isMotherOf(), PhotosHEPEVTParticle(), print(), setDaughterRangeStart(), and setDaughters().

double PhotosHEPEVTParticle::m_e
private

Definition at line 180 of file PhotosHEPEVTParticle.h.

Referenced by getE(), PhotosHEPEVTParticle(), print(), and setE().

PhotosHEPEVTEvent * PhotosHEPEVTParticle::m_event
private

Event from which this particle is taken

Definition at line 162 of file PhotosHEPEVTParticle.h.

Referenced by addDaughter(), checkMomentumConservation(), getDaughters(), getMothers(), PhotosHEPEVTParticle(), setDaughters(), and setEvent().

int PhotosHEPEVTParticle::m_first_mother
private

Indexes of mothers (-1 if do not have mothers)

Definition at line 168 of file PhotosHEPEVTParticle.h.

Referenced by getFirstMotherIndex(), getMothers(), isDaughterOf(), PhotosHEPEVTParticle(), print(), and setMothers().

double PhotosHEPEVTParticle::m_generated_mass
private

Mass saved at generation step

Definition at line 183 of file PhotosHEPEVTParticle.h.

Referenced by getMass(), PhotosHEPEVTParticle(), print(), and setMass().

int PhotosHEPEVTParticle::m_pdgid
private

PDG ID

Definition at line 174 of file PhotosHEPEVTParticle.h.

Referenced by getPdgID(), PhotosHEPEVTParticle(), print(), and setPdgID().

double PhotosHEPEVTParticle::m_px
private

Momentum

Definition at line 180 of file PhotosHEPEVTParticle.h.

Referenced by getPx(), PhotosHEPEVTParticle(), print(), and setPx().

double PhotosHEPEVTParticle::m_py
private

Definition at line 180 of file PhotosHEPEVTParticle.h.

Referenced by getPy(), PhotosHEPEVTParticle(), print(), and setPy().

double PhotosHEPEVTParticle::m_pz
private

Definition at line 180 of file PhotosHEPEVTParticle.h.

Referenced by getPz(), PhotosHEPEVTParticle(), print(), and setPz().

int PhotosHEPEVTParticle::m_second_mother
private
int PhotosHEPEVTParticle::m_status
private

Status (stable, decayed)

Definition at line 177 of file PhotosHEPEVTParticle.h.

Referenced by getDaughters(), getStatus(), PhotosHEPEVTParticle(), print(), and setStatus().

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 Photospp::PhotosHepMCParticle::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: