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 };
0116
0117 typedef std::map<ATOOLS::Particle *,ATOOLS::Vec4D,PMMSort> ParticleMomMap;
0118 typedef std::set<Particle *,PMMSort> ParticleSet;
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234 }
0235 #endif