00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef MYEVENT_H
00019 #define MYEVENT_H
00020
00021 #include "constants.h"
00022
00023 #include "TObject.h"
00024 #include "TClonesArray.h"
00025 #include "TRefArray.h"
00026 #include "TRef.h"
00027 #include "TPolyLine3D.h"
00028 #include "TVector3.h"
00029 #include "MyParticle.h"
00030 #include "MyDetector.h"
00031 #include "TGListTree.h"
00032 #include "TDatime.h"
00033
00034 class TGeoMaterial;
00035
00036 class EventHeader {
00037
00038 private:
00039 Int_t fEvtNum;
00040 Int_t fRun;
00041 TDatime fDate;
00042 Int_t fPrimary;
00043 Double_t fEnergy;
00044
00045 public:
00046 EventHeader() : fEvtNum(0), fRun(0), fPrimary(0), fEnergy(0.0) { }
00047 virtual ~EventHeader() { }
00048 void Set(Int_t i, Int_t r, TDatime d, Int_t p, Double_t e)
00049 { fEvtNum = i; fRun = r; fDate = d; fPrimary = p; fEnergy = e; }
00050 Int_t GetEvtNum() const { return fEvtNum; }
00051 Int_t GetRun() const { return fRun; }
00052 TDatime GetDate() const { return fDate; }
00053 Int_t GetPrimary() const { return fPrimary; }
00054 Double_t GetEnergy() const { return fEnergy; }
00055
00056 ClassDef(EventHeader,1)
00057 };
00058
00059 class MyEvent : public TObject {
00060
00061 private:
00062 Int_t fId;
00063 Int_t fTotalParticles;
00064 Int_t fLast;
00065 Int_t fAliveParticles;
00066 Int_t fNparticles;
00067 Int_t fNseg;
00068 Int_t fMatter;
00069 EventHeader fEvtHdr;
00070 Double_t fB;
00071 Double_t fEThreshold[16];
00072 TClonesArray *fParticles;
00073 TRef fLastParticle;
00074 MyDetector fDetector;
00075
00076 static TClonesArray *fgParticles;
00077
00078 public :
00079 MyEvent();
00080 virtual ~MyEvent();
00081 void Clear(Option_t *option ="");
00082 void Reset(Option_t *option ="");
00083 void Init(Int_t id, Int_t first_particle, Double_t E_0, Double_t B_0);
00084 void SetB(Double_t newB) { fB = newB; }
00085 void SetNseg(Int_t n) { fNseg = n; }
00086 void SetHeader(Int_t, Int_t, TDatime, Int_t, Double_t);
00087 MyParticle *AddParticle(Int_t, Int_t, const TVector3 &, const TVector3 &);
00088
00089 Int_t Id() { return fId; }
00090 Int_t GetNparticles() const { return fNparticles; }
00091 Int_t GetNseg() const { return fNseg; }
00092 Int_t GetNAlives() { return fAliveParticles; }
00093 Int_t GetTotal() { return fTotalParticles; }
00094 Int_t GetLast() { return fLast; }
00095 Double_t GetB() { return fB; }
00096 MyDetector *GetDetector() { return &fDetector; }
00097 EventHeader *GetHeader() { return &fEvtHdr; }
00098 TClonesArray *GetParticles() { return fParticles; }
00099 MyParticle *GetLastParticle() const {return (MyParticle*)fLastParticle.GetObject();}
00100 MyParticle *GetParticle(Int_t at) const {return (MyParticle*)fParticles->At(at);}
00101
00102 Int_t Action(Int_t);
00103 Double_t BremsProb(Int_t);
00104 Int_t Bremsstrahlung(Int_t);
00105 Int_t CheckDecayTime(Int_t id);
00106 void CheckMatter(Int_t id);
00107 Int_t Decay(Int_t id);
00108 void DefineDecay(Int_t);
00109 void DeleteParticle(Int_t);
00110 Int_t DEDX(Int_t);
00111 Int_t FindFreeId(Int_t *);
00112 void MagneticField(Int_t);
00113 Int_t Move(Int_t, TVector3 &);
00114 Double_t PairProb(Int_t);
00115 Int_t PairCreation(Int_t id);
00116 Int_t ParticleColor(Int_t);
00117 void ScatterAngle(Int_t);
00118
00119 ClassDef(MyEvent,1)
00120 };
00121
00122 #endif // MYEVENT_H