PhotosParticle.h

00001 #ifndef _PhotosParticle_h_included_
00002 #define _PhotosParticle_h_included_
00003 
00004 /**
00005  * @class PhotosParticle
00006  *
00007  * @brief Abstract base class for particle in the event. This class also
00008  * handles boosting.
00009  *
00010  * PhotosParticle is a Photos representation of a particle. It has virtual
00011  * getter and setter methods that need to be implemented by a derived class.
00012  * An example of this is PhotosHepMCParticle. In this way it provides an
00013  * interface to the information in the Event Record.
00014  * 
00015  * @author Nadia Davidson
00016  * @date 16 June 2008
00017  */
00018 
00019 #include <vector>
00020 #include "Photos.h"
00021 
00022 namespace Photospp
00023 {
00024 
00025 class PhotosParticle
00026 {
00027 public:
00028         /** Stable particle status */
00029         static const int STABLE=1;
00030 
00031         /** Decayed particle status */
00032         static const int DECAYED=2;
00033 
00034         /** History particle status */
00035         static const int HISTORY=3;
00036 
00037         /** X Axis */
00038         static const int X_AXIS=1;
00039 
00040         /** Y Axis */
00041         static const int Y_AXIS=2;
00042 
00043         /** Z Axis */
00044         static const int Z_AXIS=3;
00045 
00046         /** Z0 particle */
00047         static const int Z0 = 23;
00048 
00049         /** H particle */
00050         static const int HIGGS = 25;
00051 
00052         /** H0 particle */
00053         static const int HIGGS_H = 35;
00054 
00055         /** A0 particle */
00056         static const int HIGGS_A = 36;
00057 
00058         /** H+ particle */
00059         static const int HIGGS_PLUS = 37;
00060 
00061         /** H- particle */
00062         static const int HIGGS_MINUS = -37;
00063 
00064         /** W+ particle */
00065         static const int W_PLUS = 24;
00066 
00067         /** W- particle */
00068         static const int W_MINUS = -24;
00069 
00070         /** photon */
00071         static const int GAMMA = 22;
00072 
00073         /** tau+ particle */
00074         static const int TAU_PLUS = -15;
00075 
00076         /** tau- particle */
00077         static const int TAU_MINUS = 15;
00078 
00079         /** tau neutrino particle */
00080         static const int TAU_NEUTRINO = 16;
00081 
00082         /** tau antineutrino particle */
00083         static const int TAU_ANTINEUTRINO = -16;
00084 
00085         /** muon+ particle */
00086         static const int MUON_PLUS = -13;
00087 
00088         /** muon- particle */
00089         static const int MUON_MINUS = 13;
00090 
00091         /** muon neutrino particle */
00092         static const int MUON_NEUTRINO = 14;
00093 
00094         /** muon antineutrino particle */
00095         static const int MUON_ANTINEUTRINO = -14;
00096 
00097         /** e+ particle */
00098         static const int POSITRON = -11;
00099 
00100         /** e- particle */
00101         static const int ELECTRON = 11;
00102 
00103         /** e neutrino particle */
00104         static const int ELECTRON_NEUTRINO = 12;
00105 
00106         /** e antineutrino particle */
00107         static const int ELECTRON_ANTINEUTRINO = -12;
00108 
00109         /** up quark */
00110         static const int UP = 2;
00111 
00112         /** anti-up quark */
00113         static const int ANTIUP = -2;
00114 
00115         /** down quark */
00116         static const int DOWN = 1;
00117 
00118         /** anti-down quark */
00119         static const int ANTIDOWN = -1;
00120 
00121         /** All other particle types*/
00122         static const int OTHER = 0;
00123 
00124 public:
00125         virtual ~PhotosParticle(){};
00126 
00127         /** Return whether the particle has any chidren */
00128         bool hasDaughters();
00129 
00130         /** Traverse the event structure and find the final version
00131             of this particle which does not have a particle of it's own type
00132             as it's daughter. eg. Generally the final stable copy */
00133         PhotosParticle * findLastSelf();
00134 
00135         /** Traverse the event structure and find the first set of mothers
00136             which are not of the same type as this particle. */
00137         std::vector<PhotosParticle *> findProductionMothers();
00138 
00139         /** Return whole decay tree starting from this particle */
00140         std::vector<PhotosParticle *> getDecayTree();
00141 
00142         /** Transform this particles four momentum from the lab frome
00143             into the rest frame of the paramter PhotosParticle. */
00144         void boostToRestFrame(PhotosParticle * boost);
00145 
00146         /** Transform the four momentum of all the daughters recursively
00147             into the frame of the "particle" PhotosParticle. */
00148         void boostDaughtersToRestFrame(PhotosParticle * boost);
00149 
00150         /** Transform this particles four momentum from the rest frame of
00151             the paramter PhotosParticle, back into the lab frame. */
00152         void boostFromRestFrame(PhotosParticle * boost);
00153 
00154         /** Transform this particles four momentum from the lab frame to
00155             the rest frame of the parameter PhotosParticle. */
00156         void boostDaughtersFromRestFrame(PhotosParticle * boost);
00157 
00158         /** Do a Lorenz transformation along the Z axis. */
00159         void boostAlongZ(double pz, double e);
00160 
00161         /** rotate this particles 4-momentum by an angle phi from
00162             the axisis "axis" towards the axis "second_axis". */
00163         void rotate(int axis, double phi, int second_axis=Z_AXIS);
00164 
00165         /** rotate 4-momentum of daughters of this particle by an angle phi from
00166             the axisis "axis" towards the axis "second_axis". */
00167         void rotateDaughters(int axis, double phi, int second_axis=Z_AXIS);
00168 
00169         /** Returns the angle around the axis "axis" needed to rotate
00170             the four momenum is such a way that the non-Z component
00171             disappears and Z>0. This is used to in rotating the coordinate
00172             system into a frame with only a Z component before calling
00173             boostAlongZ(). */
00174         double getRotationAngle(int axis, int second_axis=Z_AXIS);
00175 
00176         /** Get scalar momentum */
00177         double getP();
00178 
00179         /** Get momentum component in the direction of "axis" (x,y,z) */
00180         double getP(int axis);
00181 
00182         /** Set momentum component in the direction of "axis" (x,y,z) */
00183         void  setP(int axis, double p_component);
00184 
00185         /** Get sqrt(e^2-p^2) */
00186         virtual double getVirtuality();
00187 
00188 public:
00189         /** check that the 4 momentum in conserved at the vertices producing
00190             and ending this particle */
00191         virtual bool checkMomentumConservation()=0;
00192 
00193         /** Returns the px component of the four vector */
00194         virtual double getPx()=0;
00195 
00196         /** Returns the py component of the four vector */
00197         virtual double getPy()=0;
00198 
00199         /** Returns the pz component of the four vector */
00200         virtual double getPz()=0;
00201 
00202         /** Returns the energy component of the four vector */
00203         virtual double getE()=0;
00204         
00205         /** Get the invariant mass from the event record*/
00206         virtual double getMass() = 0;
00207 
00208         /** Set the px component of the four vector */
00209         virtual void setPx( double px )=0;
00210 
00211         /** Set the px component of the four vector */
00212         virtual void setPy( double py )=0;
00213 
00214         /** Set the pz component of the four vector */
00215         virtual void setPz( double pz )=0;
00216 
00217         /** Set the energy component of the four vector */
00218         virtual void setE( double e )=0;
00219 
00220         /** Set the mothers of this particle via a vector of PhotosParticle */
00221         virtual void setMothers(std::vector<PhotosParticle*> mothers)=0;
00222 
00223         /** Set the daughters of this particle via a vector of PhotosParticle */
00224         virtual void setDaughters(std::vector<PhotosParticle*> daughters)=0;
00225 
00226         /** Add a new daughter to this particle */
00227         virtual void addDaughter(PhotosParticle* daughter)=0;
00228 
00229         /** Returns the mothers of this particle via a vector of PhotosParticle */
00230         virtual std::vector<PhotosParticle*> getMothers()=0;
00231 
00232         /** Returns the daughters of this particle via a vector of PhotosParticle */
00233         virtual std::vector<PhotosParticle*> getDaughters()=0;
00234 
00235         /** Returns all particles in the decay tree of this particle
00236             via a vector of PhotosParticle */
00237         virtual std::vector<PhotosParticle*> getAllDecayProducts()=0;
00238 
00239         /** Set the PDG ID code of this particle */
00240         virtual void setPdgID(int pdg_id)=0;
00241 
00242         /** Set the mass of this particle */
00243         virtual void setMass(double mass)=0;
00244 
00245         /** Set the status of this particle */
00246         virtual void setStatus(int status)=0;
00247 
00248         /** Get the PDG ID code of this particle */
00249         virtual int getPdgID()=0;
00250 
00251         /** Get the status of this particle */
00252         virtual int getStatus()=0;
00253 
00254         /** Get the barcode of this particle */
00255         virtual int getBarcode()=0;
00256 
00257         /** Create a new particle of the same type, with the given
00258             properties. The new particle bares no relations to this
00259             particle, but it provides a way of creating a intance of
00260             the derived class. eg. createNewParticle() is used inside
00261             filhep_() so that an eg. PhotosHepMCParticle is created without
00262             the method having explicit knowledge of the PhotosHepMCParticle
00263             class */
00264         virtual PhotosParticle * createNewParticle(int pdg_id, int status,
00265                                                    double mass, double px,
00266                                                    double py, double pz,
00267                                                    double e)=0;
00268 
00269   /** Create history entry of this particle before modifications
00270       of PHOTOS. Implementation of this method depends strongly
00271       on the event record. */
00272   virtual void createHistoryEntry()=0;
00273   
00274         /** Create a self-decay vertex for this particle
00275             with 'out' being the outgoing particle in new vertex */
00276         virtual void createSelfDecayVertex(PhotosParticle *out)=0;
00277 
00278         /** Print some information about this particle to standard output */
00279         virtual void print()=0;
00280 };
00281 
00282 } // namespace Photospp
00283 #endif
Generated on Sun Oct 20 20:23:56 2013 for C++InterfacetoPHOTOS by  doxygen 1.6.3