ROOT logo
ROOT » TEST » TMVA::Event

class TMVA::Event


                       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:
~Event()
static voidClearDynamicVariables()
voidCopyVarValues(const TMVA::Event& other)
TMVA::EventEvent()
TMVA::EventEvent(const TMVA::Event&)
TMVA::EventEvent(const vector<Float_t*>*&, UInt_t nvar)
TMVA::EventEvent(const vector<Float_t>&, UInt_t theClass, Double_t weight = 1.0, Double_t boostweight = 1.0)
TMVA::EventEvent(const vector<Float_t>& values, const vector<Float_t>& targetValues, UInt_t theClass = 0, Double_t weight = 1.0, Double_t boostweight = 1.0)
TMVA::EventEvent(const vector<Float_t>& values, const vector<Float_t>& targetValues, const vector<Float_t>& spectatorValues, UInt_t theClass = 0, Double_t weight = 1.0, Double_t boostweight = 1.0)
Double_tGetBoostWeight() const
UInt_tGetClass() const
UInt_tGetNSpectators() const
UInt_tGetNTargets() const
UInt_tGetNVariables() const
Double_tGetOriginalWeight() const
Float_tGetSpectator(UInt_t ivar) const
vector<Float_t>&GetSpectators()
const vector<Float_t>&GetSpectators() const
Float_tGetTarget(UInt_t itgt) const
vector<Float_t>&GetTargets()
const vector<Float_t>&GetTargets() const
Float_tGetValue(UInt_t ivar) const
vector<Float_t>&GetValues()
const vector<Float_t>&GetValues() const
Double_tGetWeight() const
Bool_tIsDynamic() const
TMVA::Event&operator=(const TMVA::Event&)
voidPrint(ostream& o) const
voidScaleBoostWeight(Double_t s) const
voidSetBoostWeight(Double_t w) const
voidSetClass(UInt_t t)
voidSetDoNotBoost() const
static voidSetIgnoreNegWeightsInTraining(Bool_t)
static voidSetIsTraining(Bool_t)
voidSetSpectator(UInt_t ivar, Float_t value)
voidSetTarget(UInt_t itgt, Float_t value)
voidSetVal(UInt_t ivar, Float_t val)
voidSetVariableArrangement(vector<UInt_t> *const m) const
voidSetWeight(Double_t w)

Data Members

private:
Double_tfBoostWeightinternal weight to be set by boosting algorithm
UInt_tfClassclass number
Bool_tfDoNotBoostmark event as not to be boosted (used to compensate for events with negative event weights
Bool_tfDynamicis set when the dynamic values are taken
vector<Float_t>fSpectators"visisting" variables not used in MVAs ; mutable, to be able to copy the dynamic values in there
vector<Float_t>fTargetstarget values for regression
vector<Float_t>fValuesthe event values ; mutable, to be able to copy the dynamic values in there
vector<Float_t*>*fValuesDynamicthe event values
vector<Float_t>fValuesRearrangedthe event values ; mutable, to be able to copy the dynamic values in there
vector<UInt_t>*fVariableArrangementneeded for MethodCategories, where we can train on other than the main variables
Double_tfWeightevent weight (product of global and individual weights)
static Bool_tfgIgnoreNegWeightsInTraining
static Bool_tfgIsTrainingmark if we are in an actual training or "evaluation/testing" phase --> ignoreNegWeights only in actual training !

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

Event()
 Create an Event object.
 When the constructor is invoked for the first time, the class static
 variable fgTracks is 0 and the TClonesArray fgTracks is created.
~Event()
Event()
 constructors
Event(const TMVA::Event& )
explicit Event(const vector<Float_t>& values, const vector<Float_t>& targetValues, const vector<Float_t>& spectatorValues, UInt_t theClass = 0, Double_t weight = 1.0, Double_t boostweight = 1.0)
explicit Event(const vector<Float_t>& , UInt_t theClass, Double_t weight = 1.0, Double_t boostweight = 1.0)
Bool_t IsDynamic() const
 accessors
{return fDynamic; }
Double_t GetWeight() const
      Double_t GetWeight()         const { return fWeight*fBoostWeight; }
Double_t GetOriginalWeight() const
{ return fWeight; }
Double_t GetBoostWeight() const
{ return TMath::Max(Double_t(0.0001),fBoostWeight); }
UInt_t GetClass() const
{ return fClass; }
UInt_t GetNVariables() const
UInt_t GetNTargets() const
UInt_t GetNSpectators() const
Float_t GetValue(UInt_t ivar) const
std::vector<Float_t>& GetValues()
For a detailed explanation, please see the heading "Avoid Duplication in const and Non-const Member Function," on p. 23, in Item 3 "Use const whenever possible," in Effective C++, 3d ed by Scott Meyers, ISBN-13: 9780321334879.
 http://stackoverflow.com/questions/123758/how-do-i-remove-code-duplication-between-similar-const-and-non-const-member-func
const std::vector<Float_t>& GetValues() const
Float_t GetTarget(UInt_t itgt) const
{ return fTargets.at(itgt); }
std::vector<Float_t>& GetTargets()
{ return fTargets; }
const std::vector<Float_t>& GetTargets() const
{ return fTargets; }
Float_t GetSpectator(UInt_t ivar) const
std::vector<Float_t>& GetSpectators()
{ return fSpectators; }
const std::vector<Float_t>& GetSpectators() const
{ return fSpectators; }
void SetWeight(Double_t w)
{ fWeight=w; }
void SetBoostWeight(Double_t w) const
void ScaleBoostWeight(Double_t s) const
void SetClass(UInt_t t)
{ fClass=t; }
void SetVal(UInt_t ivar, Float_t val)
void SetTarget(UInt_t itgt, Float_t value)
void SetSpectator(UInt_t ivar, Float_t value)
void SetVariableArrangement(vector<UInt_t> *const m) const
void SetDoNotBoost() const
void ClearDynamicVariables()
{}
void CopyVarValues(const TMVA::Event& other)
void Print(ostream& o) const
void SetIsTraining(Bool_t )
void SetIgnoreNegWeightsInTraining(Bool_t )