Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:09:56

0001 #ifndef ATOOLS_Phys_Particle_H
0002 #define ATOOLS_Phys_Particle_H
0003 
0004 #include "ATOOLS/Math/Vector.H"
0005 #include "ATOOLS/Phys/Flavour.H"
0006 #include "ATOOLS/Phys/Flow.H"
0007 
0008 #include <iostream>
0009 #include <list>
0010 
0011 namespace ATOOLS {
0012   class Blob;
0013    
0014   struct part_status {
0015     enum code {
0016       undefined     = 0,
0017       active        = 1,
0018       decayed       = 2,
0019       documentation = 3,
0020       fragmented    = 4,
0021       internal      = 5
0022     };
0023   };
0024 
0025   class Particle {
0026   private : 
0027     static long unsigned int s_currentnumber;
0028     int               m_number, m_beam; 
0029     size_t            m_meid; 
0030     part_status::code m_status;         
0031     char              m_info;   
0032     Flavour           m_fl;         
0033     Vec4D             m_momentum, m_position; 
0034     Flow              m_flow;
0035     Blob            * p_startblob, * p_endblob;
0036     Particle        * p_originalpart;
0037     double            m_dec_time, m_finalmass;
0038     bool              m_ownpos;
0039     bool              m_fromdec;
0040     static int        s_totalnumber;
0041   public:
0042     Particle();
0043     Particle(const Particle & );
0044     Particle& operator=(const Particle &);
0045     Particle(int, Flavour=Flavour(kf_none), Vec4D=Vec4D(0.,0.,0.,0.),
0046          char='a');
0047     ~Particle();
0048     friend std::ostream& operator<<(std::ostream &,const Particle &);
0049 
0050     void              Copy(Particle * );
0051     double            ProperTime();
0052     double            LifeTime();
0053     Vec3D             Distance(double = -1.);
0054     const Vec4D&      Momentum() const;
0055     double            E() const;
0056     double            FinalMass() const;
0057     part_status::code Status() const;
0058     char              Info() const;
0059     Vec4D             XProd() const;
0060     Blob            * ProductionBlob() const;
0061     Vec4D             XDec() const;
0062     Blob            * DecayBlob() const;
0063     double            Time() const ;
0064     Flavour           Flav() const ;
0065     const Flavour   & RefFlav() const;
0066     unsigned int      GetFlow( unsigned int ) const ;
0067     int               Number() const;
0068     int               Beam() const;
0069     Particle        * OriginalPart() const;
0070     void   SetMomentum(const Vec4D &);
0071     void   SetPosition(const Vec4D &);
0072     void   SetFinalMass(const double=-1,const double=-1);
0073     void   SetStatus(part_status::code=part_status::undefined);
0074     void   SetInfo(char);
0075     void   SetProductionBlob(Blob *);
0076     void   SetDecayBlob(Blob *);
0077     void   SetTime(const double);
0078     void   SetTime();
0079     void   SetFlav(const Flavour &);
0080     void   SetFlow(int code_index,int code=0);
0081     void   SetNumber(const int number=0);
0082     void   SetBeam(const int);
0083     void   SetOriginalPart(Particle*);
0084     bool operator==(Particle part);
0085     inline void   SetFromDec(const bool &val){m_fromdec=val;}
0086     inline bool   FromDec() const {return m_fromdec;}
0087     static void   ResetCounter(const int number=0)  { s_totalnumber = number; }
0088     static int    Counter()                         { return s_totalnumber; }
0089     inline static void Reset(const int number=0)    { s_currentnumber = number; }
0090     inline static long unsigned int CurrentNumber() { return s_currentnumber; }
0091     inline size_t MEId() const { return m_meid; }
0092     inline void   SetMEId(const size_t &id) { m_meid=id; }
0093   };
0094 
0095   typedef std::vector<Particle *>   Particle_Vector;
0096   typedef std::map<Particle *,int>  Particle_Int_Map;
0097   typedef std::map<int,Particle *>  Int_Particle_Map;
0098 
0099   typedef std::list<Particle*>      Part_List;
0100   typedef Part_List::iterator       Part_Iterator;
0101   typedef Part_List::const_iterator Part_Const_Iterator;
0102   typedef Particle_Vector::iterator PVIt;
0103 
0104   std::ostream & operator<<(std::ostream &,const Particle &);
0105   std::ostream & operator<<(std::ostream & s, const Part_List & pl);
0106 
0107   typedef std::map<int,std::pair<Particle *,bool> > Translation_Map;
0108 
0109   class PMMSort {
0110   public:
0111     bool operator()(const Particle * a,const Particle * b) const {
0112       return (a->Number()>b->Number());
0113     }
0114     
0115   };// end of class String_Sort
0116 
0117   typedef std::map<ATOOLS::Particle *,ATOOLS::Vec4D,PMMSort> ParticleMomMap;
0118   typedef std::set<Particle *,PMMSort>       ParticleSet;
0119 
0120 
0121 
0122   /*! 
0123     \class Particle
0124     \brief Characterising individual particles occuring in event generation.
0125     
0126     This class contains all information needed for an Event Record based 
0127     on particles and methods to manipulate this information. 
0128     The particles defined here are close to the particles of the HepMC format
0129     by Matt Dobbs. ( http://cern.ch/HepMC/ )
0130   */
0131 
0132   /*! 
0133     \var   int Particle::m_number     
0134     \brief The particle's number (integer >0)
0135   */
0136 
0137   /*!
0138     \var   bool Particle::m_fromdec
0139     \brief True, if this particle is emerged from a hard decay. This property is set in the Hard Decay Handler and propagated through the CSS Shower.
0140   */
0141 
0142   /*! 
0143     \var   char Particle::m_info
0144     \brief What the particle really does and where it stems from.
0145     
0146     info flag, marks production step: 
0147     \verbatim
0148     G - IS for hard interaction, H - FS from hard interaction, 
0149     M - internal in ME, 
0150     I - initial particle, F - final particle, 
0151     i - particle from ISR, f - particle from FSR, decayed
0152     D - particle from hadron decays,
0153     P - primary hadrons
0154     S - soft photons, s - soft photons splitting products
0155     \endverbatim
0156   */ 
0157 
0158   /*!
0159     \var   int Particle::m_status;
0160     \brief The particle status (HepMC 1.01).
0161     
0162     The status flag can take the following values:
0163     \verbatim
0164     0       null entry
0165     1       existing entry (not decayed or fragmented), i.e. final state
0166     2       decayed or fragmented particle
0167     3       documentation line
0168     4-10    reserved
0169     11-200  at disposal of each model builder
0170     201-... user status
0171     \endverbatim
0172   */  
0173   
0174   /*!
0175     \var     Flavour Particle::m_fl
0176     \brief The particle's flavour. 
0177     
0178     The particle's flavour. 
0179     
0180     Additional information can be obtained using methods 
0181     related to the class Flavour.
0182   */
0183 
0184   /*!
0185     \var   Vec4D   Particle::m_momentum
0186     \brief The particle's momentum.
0187   */
0188   
0189   /*!
0190     \var  Blob * Particle::p_startblob
0191     \brief Pointers to the particle's production vertex.
0192     \see Particle::m_endblob
0193   */
0194 
0195   /*!
0196     \var  Blob * Particle::p_endblob
0197     \brief Pointers to the particle's decay vertex.
0198     \see Particle::m_startblob
0199   */
0200 
0201   /*!
0202     \var   double Particle::m_dec_time
0203     \brief The proper decay time of the particle.
0204   */
0205 
0206   /*!  
0207     \fn    double Particle::ProperTime()
0208     \brief Calculate m_dec_time.
0209     
0210     Calculate proper decay time \f$\tau^*\f$ of particle in its rest frame via
0211     \f[
0212     \tau^* = hbar \sqrt{q^2/((q^2-M^2)^2 + (\Gamma/M q^2)^2)}
0213     \f]
0214     Result is given in seconds.
0215   */
0216 
0217   /*!
0218     \fn    double Particle::LifeTime()
0219     \brief Calculate lifetime.
0220     
0221     Calculate lifetime of the particle according to an exponential
0222     decay law (like radioactive decays). Lifetime is given in cm-system of
0223     the hard process (where the particle list is filled), boost taken care of
0224     by factor gamma.
0225   */
0226   
0227   /*!
0228     \fn    Vec3D Particle::Distance()
0229     \brief Calculate decay length.
0230     
0231     Calculate the distance travelled by the particle during its lifetime.
0232     Result is given as a 3-vector in mm
0233   */ 
0234 }
0235 #endif