ROOT logo
ROOT » TEST » Track

class Track: public TObject


                       Event and Track classes


  The Event class is a naive/simple example of an event structure.
     public:
        char           fType[20];
        char          *fEventName;         //run+event number in character format
        Int_t          fNtrack;
        Int_t          fNseg;
        Int_t          fNvertex;
        UInt_t         fFlag;
        Double32_t     fTemperature;
        Int_t          fMeasures[10];
        Double32_t     fMatrix[4][4];
        Double32_t    *fClosestDistance; //[fNvertex] indexed array!
        EventHeader    fEvtHdr;
        TClonesArray  *fTracks;
        TRefArray     *fHighPt;            //array of High Pt tracks only
        TRefArray     *fMuons;             //array of Muon tracks only
        TRef           fLastTrack;         //pointer to last track
        TRef           fHistoWeb;          //EXEC:GetHistoWeb reference to an histogram in a TWebFile
        TH1F          *fH;
        TBits          fTriggerBits;       //Bits triggered by this event.

   The EventHeader class has 3 data members (integers):
     public:
        Int_t          fEvtNum;
        Int_t          fRun;
        Int_t          fDate;


   The Event data member fTracks is a pointer to a TClonesArray.
   It is an array of a variable number of tracks per event.
   Each element of the array is an object of class Track with the members:
     private:
        Float_t      fPx;           //X component of the momentum
        Float_t      fPy;           //Y component of the momentum
        Float_t      fPz;           //Z component of the momentum
        Float_t      fRandom;       //A random track quantity
        Float_t      fMass2;        //The mass square of this particle
        Float_t      fBx;           //X intercept at the vertex
        Float_t      fBy;           //Y intercept at the vertex
        Float_t      fMeanCharge;   //Mean charge deposition of all hits of this track
        Float_t      fXfirst;       //X coordinate of the first point
        Float_t      fXlast;        //X coordinate of the last point
        Float_t      fYfirst;       //Y coordinate of the first point
        Float_t      fYlast;        //Y coordinate of the last point
        Float_t      fZfirst;       //Z coordinate of the first point
        Float_t      fZlast;        //Z coordinate of the last point
        Double32_t   fCharge;       //Charge of this track
        Double32_t   fVertex[3];    //Track vertex position
        Int_t        fNpoint;       //Number of points for this track
        Short_t      fValid;        //Validity criterion
        Int_t        fNsp;          //Number of points for this track with a special value
        Double32_t  *fPointValue;   //[fNsp] a special quantity for some point.
        TBits        fTriggerBits;  //Bits triggered by this track.

   An example of a batch program to use the Event/Track classes is given
   in this directory: MainEvent.
   Look also in the same directory at the following macros:
     - eventa.C  an example how to read the tree
     - eventb.C  how to read events conditionally

   During the processing of the event (optionally) also a large number
   of histograms can be filled. The creation and handling of the
   histograms is taken care of by the HistogramManager class.

   Note:  This version of the class Event (see EventMT.h and EventMT.cxx
   for an alternative) uses static variables to improve performance (by
   reducing the number of memory allocations).  Consequently, only one
   instance of the class Event should be in use at a time (a 2nd instance
   would share the array of Tracks with the first instance).


Function Members (Methods)

public:
Track()
Track(const Track& orig)
Track(Float_t random)
virtual~Track()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t* option = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Float_tGetBx() const
Float_tGetBy() const
Double32_tGetCharge() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
Float_tGetMass2() const
Float_tGetMeanCharge() const
Int_tGetN() const
virtual const char*TObject::GetName() const
Int_tGetNpoint() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Double32_tGetPointValue(Int_t i = 0) const
Float_tGetPt() const
Float_tGetPx() const
Float_tGetPy() const
Float_tGetPz() const
Float_tGetRandom() const
virtual const char*TObject::GetTitle() const
TBits&GetTriggerBits()
virtual UInt_tTObject::GetUniqueID() const
Short_tGetValid() const
Double32_tGetVertex(Int_t i = 0)
Float_tGetXfirst() const
Float_tGetXlast() const
Float_tGetYfirst() const
Float_tGetYlast() const
Float_tGetZfirst() const
Float_tGetZlast() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
Track&operator=(const Track&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidSetValid(Int_t valid = 1)
virtual voidShowMembers(TMemberInspector& insp)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

private:
Float16_tfBx[0,0,10] X intercept at the vertex
Float16_tfBy[0,0,10] Y intercept at the vertex
Double32_tfCharge[-1,1,2] Charge of this track
Float16_tfMass2[0,0,8] The mass square of this particle
Float_tfMeanChargeMean charge deposition of all hits of this track
Int_tfNpointNumber of points for this track
Int_tfNspNumber of points for this track with a special value
Double32_t*fPointValue[fNsp][0,3] a special quantity for some point.
Float_tfPxX component of the momentum
Float_tfPyY component of the momentum
Float_tfPzZ component of the momentum
Float_tfRandomA random track quantity
TBitsfTriggerBitsBits triggered by this track.
Short_tfValidValidity criterion
Double32_tfVertex[3][-30,30,16] Track vertex position
Float16_tfXfirstX coordinate of the first point
Float16_tfXlastX coordinate of the last point
Float16_tfYfirstY coordinate of the first point
Float16_tfYlastY coordinate of the last point
Float16_tfZfirstZ coordinate of the first point
Float16_tfZlastZ coordinate of the last point

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

Track(const Track& orig)
 Copy a track object
Track(Float_t random)
 Create a track object.
 Note that in this example, data members do not have any physical meaning.
void Clear(Option_t* option = "")
Track()
{ fPointValue = 0; }
virtual ~Track()
{Clear();}
Float_t GetPx() const
{ return fPx; }
Float_t GetPy() const
{ return fPy; }
Float_t GetPz() const
{ return fPz; }
Float_t GetPt() const
{ return TMath::Sqrt(fPx*fPx + fPy*fPy); }
Float_t GetRandom() const
{ return fRandom; }
Float_t GetBx() const
{ return fBx; }
Float_t GetBy() const
{ return fBy; }
Float_t GetMass2() const
{ return fMass2; }
Float_t GetMeanCharge() const
{ return fMeanCharge; }
Float_t GetXfirst() const
{ return fXfirst; }
Float_t GetXlast() const
{ return fXlast; }
Float_t GetYfirst() const
{ return fYfirst; }
Float_t GetYlast() const
{ return fYlast; }
Float_t GetZfirst() const
{ return fZfirst; }
Float_t GetZlast() const
{ return fZlast; }
Double32_t GetCharge() const
{ return fCharge; }
Double32_t GetVertex(Int_t i = 0)
{return (i<3)?fVertex[i]:0;}
Int_t GetNpoint() const
{ return fNpoint; }
TBits& GetTriggerBits()
{ return fTriggerBits; }
Short_t GetValid() const
{ return fValid; }
void SetValid(Int_t valid = 1)
{ fValid = valid; }
Int_t GetN() const
{ return fNsp; }
Double32_t GetPointValue(Int_t i = 0) const
{ return (i<fNsp)?fPointValue[i]:0; }