MyParticle.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 // MyParticle                                                           //
00013 //                                                                      //
00014 // Defines single particle class, with its status and decay parameters  //
00015 //                                                                      //
00016 //////////////////////////////////////////////////////////////////////////
00017 
00018 #ifndef MYPARTICLE_H
00019 #define MYPARTICLE_H
00020 
00021 #include "TGListTree.h"
00022 #include "TVector3.h"
00023 #include "TClonesArray.h"
00024 #include "TRefArray.h"
00025 #include "TRef.h"
00026 #include "TPolyLine3D.h"
00027 #include "TParticle.h"
00028 #include "TParticlePDG.h"
00029 
00030 class MyParticle : public TParticle {
00031 
00032 private:
00033    Int_t       fId;            // Index of particle in array
00034    Int_t       fStatus;        // Particle's status (CREATED,ALIVE,DEAD)
00035    Int_t       fDecayType;     // Particle's decay type (bremstrahlung,pair production,decay)
00036    Int_t       fNChildren;     // Number of children
00037    TVector3   *fLocation;     // Particle's current location
00038    Double_t    fPassed;        // Distance actually covered
00039    Double_t    fEloss;         // Total Energy loss into the detector
00040    Double_t    fDecayLength;   // Calculated interaction length
00041    Double_t    fTimeOfDecay;   // Generated decay time
00042    Int_t       fChild[6];      // Array of children indexes
00043 
00044    Int_t       fNtrack;    
00045    TObjArray  *fTracks;       // ->array with all tracks
00046 
00047 public :
00048    MyParticle();
00049    ~MyParticle();
00050    MyParticle(Int_t, Int_t, Int_t, Int_t, const TVector3 &, const TVector3 &, Double_t, Double_t, Double_t);
00051    MyParticle(Int_t, Int_t, Int_t, Int_t, const TVector3 &, const TVector3 &);
00052    TPolyLine3D  *AddTrack(const TVector3 &, Int_t);
00053    TPolyLine3D  *AddTrack(Double_t, Double_t, Double_t, Int_t);
00054    Int_t         GetId() { return fId; }
00055    Int_t         GetStatus() { return fStatus; }
00056    Int_t         GetDecayType() { return fDecayType; }
00057    TVector3     *GetpLocation() { return fLocation; }
00058    TVector3      GetvLocation() { return *fLocation; }
00059    TVector3      GetvMoment() { return TVector3(Px(),Py(),Pz()); }
00060    Double_t      GetPassed() { return fPassed; }
00061    Double_t      GetELoss() { return fEloss; }
00062    Double_t      GetDecayLength() { return fDecayLength; }
00063    Int_t         GetChildId(Int_t id) { return fChild[id]; }
00064    Double_t      GetTimeOfDecay() { return fTimeOfDecay; }
00065    Int_t         GetNChildren() { return fNChildren; }
00066    Int_t         GetNTracks() { return fNtrack+1; }
00067    Char_t       *GetObjectInfo(Int_t px, Int_t py) const;
00068    TPolyLine3D  *GetTrack(Int_t at) const {return (TPolyLine3D*)fTracks->At(at);}
00069    const Char_t *GetName() const;
00070 
00071    void          SetId(Int_t id) { fId = id; }
00072    void          SetNChildren(Int_t nb) { fNChildren = nb; }
00073    void          SetStatus(Int_t stat) { fStatus = stat; }
00074    void          SetDecayType(Int_t decay) { fDecayType = decay; }
00075    void          SetTimeOfDecay(Double_t time) { fTimeOfDecay = time; }
00076    void          SetLocation(const TVector3 &loc) { fLocation->SetX(loc.x());
00077                              fLocation->SetY(loc.y()); fLocation->SetZ(loc.z()); }
00078    void          SetLocation(Double_t lx, Double_t ly, Double_t lz) {
00079                              fLocation->SetX(lx); fLocation->SetY(ly); fLocation->SetZ(lz); }
00080    void          SetMoment(const TVector3 &mom);
00081    void          SetMoment(const TVector3 &mom, Double_t energy) {
00082                            SetMomentum(mom.x(), mom.y(), mom.z(), energy); }
00083    void          SetNextPoint(Int_t color);
00084    void          SetPassed(Double_t pass) { fPassed = pass; }
00085    void          AddELoss(Double_t eloss) { fEloss += eloss; }
00086    void          SetDecayLength(Double_t len) { fDecayLength = len; }
00087    void          SetChild(Int_t id, Int_t child_id) { fChild[id] = child_id; }
00088    void          GenerateTimeOfDecay();
00089 
00090    void          HighLight(); // *MENU*
00091 
00092    virtual void  Delete(Option_t *) { }
00093    virtual void  SetLineAttributes() { }
00094    virtual void  SetDrawOption(Option_t *) { }
00095 
00096    ClassDef(MyParticle,1)  //Event structure
00097 };
00098 
00099 #endif // MYPARTICLE_H

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