MyEvent.h

Go to the documentation of this file.
00001 // Author: Bertrand Bellenot   22/08/02
00002 
00003 /*************************************************************************
00004  * Copyright (C) 1995-2002, Bertrand Bellenot.                           *
00005  * All rights reserved.                                                  *
00006  *                                                                       *
00007  * For the licensing terms see the LICENSE file.                         *
00008  *************************************************************************/
00009 
00010 //////////////////////////////////////////////////////////////////////////
00011 //                                                                      //
00012 // MyEvent                                                              //
00013 //                                                                      //
00014 // Description of event with particles, track and detector parameters   //
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;    // Event Identification
00040    Int_t       fRun;       // Run Identification
00041    TDatime     fDate;      // Date of the simulation
00042    Int_t       fPrimary;   // Type of the primary particle (PDG code)
00043    Double_t    fEnergy;    // Primary particle's energy
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)  //Event Header
00057 };
00058 
00059 class MyEvent : public TObject {
00060 
00061 private:
00062    Int_t           fId;                // Event identification (obsolete)
00063    Int_t           fTotalParticles;    // Total number of particles
00064    Int_t           fLast;              // Index of last particle
00065    Int_t           fAliveParticles;    // Number of still alive particles
00066    Int_t           fNparticles;        // Number of particles
00067    Int_t           fNseg;              // Number of track segments
00068    Int_t           fMatter;            // Material index
00069    EventHeader     fEvtHdr;            // Event header
00070    Double_t        fB;                 // Magnetic field
00071    Double_t        fEThreshold[16];    // Energy threshold for coloring tracks
00072    TClonesArray   *fParticles;         // ->array with all particles
00073    TRef            fLastParticle;      // Reference pointer to last particle
00074    MyDetector      fDetector;          // Detector
00075 
00076    static TClonesArray *fgParticles;   // Pointer on particles array
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)  //Event structure
00120 };
00121 
00122 #endif // MYEVENT_H

Generated on Tue Jul 5 15:15:11 2011 for ROOT_528-00b_version by  doxygen 1.5.1