TCutG
class description - source file - inheritance tree
public:
TCutG TCutG()
TCutG TCutG(const Text_t* name, Int_t n, Float_t* x = 0, Float_t* y = 0)
TCutG TCutG(TCutG&)
virtual void ~TCutG()
TClass* Class()
TObject* GetObjectX()
TObject* GetObjectY()
const Text_t* GetVarX() const
const Text_t* GetVarY() const
virtual TClass* IsA() const
virtual Int_t IsInside(Float_t x, Float_t y)
virtual void SavePrimitive(ofstream& out, Option_t* option)
virtual void SetObjectX(TObject* obj)
virtual void SetObjectY(TObject* obj)
virtual void SetVarX(const Text_t* varx)
virtual void SetVarY(const Text_t* vary)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
protected:
TString fVarX X variable
TString fVarY Y variable
TObject* fObjectX pointer to an object corresponding to X
TObject* fObjectY pointer to an object corresponding to Y
TCutG
A Graphical cut.
A TCutG object defines a closed polygon in a x,y plot.
It can be created via the graphics editor option "CutG"
or directly by invoking its constructor.
When it is created via the graphics editor, the TCutG object
is named "CUTG". It is recommended to immediatly change the name
by using the context menu item "SetName". //
When the graphics editor is used, the names of the variables X,Y
are automatically taken from the current pad title.
Example:
Assume a TTree object T and:
Root > T.Draw("abs(fMomemtum)%fEtot")
the TCutG members fVarX, fVary will be set to:
fVarx = fEtot
fVary = abs(fMomemtum)
A graphical cut can be used in a TTree selection expression:
Root > T.Draw("fEtot","cutg1")
where "cutg1" is the name of an existing graphical cut.
Note that, as shown in the example above, a graphical cut may be
used in a selection expression when drawing TTrees expressions
of 1-d, 2-d or 3-dimensions.
The TTree expressions may or may not reference the same variables
than in the fVarX, fVarY of the graphical cut.
When the TCutG object is created via the graphics editor, it is
added to the list of primitives in the pointed pad. To retrieve
a pointer to this object from the code or command line, do:
TCutG *mycutg = (TCutG*)gPad->GetPrimitive("CUTG");
mycutg->SetName("mycutg");
A Graphical cut may be drawn via TGraph::Draw.
It can be edited like a normal TGraph.
A Graphical cut may be saved to a file via TCutG::Write. //
A TCutG object is added in the gROOT->GetListOfSpecials
TCutG() : TGraph()
TCutG(const Text_t *name, Int_t n, Float_t *x, Float_t *y)
:TGraph(n,x,y)
~TCutG()
Int_t IsInside(Float_t x, Float_t y)
*. Function which returns 1 if point x,y lies inside the
*. polygon defined by the graph points
*. 0 otherwise
*.
*. The loop is executed with the end-point coordinates of a
*. line segment (X1,Y1)-(X2,Y2) and the Y-coordinate of a
*. horizontal line.
*. The counter inter is incremented if the line (X1,Y1)-(X2,Y2)
*. intersects the horizontal line.
*. In this case XINT is set to the X-coordinate of the
*. intersection point.
*. If inter is an odd number, then the point x,y is not within
*. the polygon.
*.
*. This routine is based on an original algorithm
*. developed by R.Nierhaus.
*.
void SavePrimitive(ofstream &out, Option_t *option)
Save primitive as a C++ statement(s) on output stream out
void SetVarX(const Text_t *varx)
void SetVarY(const Text_t *vary)
Inline Functions
TObject* GetObjectX()
TObject* GetObjectY()
const Text_t* GetVarX() const
const Text_t* GetVarY() const
void SetObjectX(TObject* obj)
void SetObjectY(TObject* obj)
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void Streamer(TBuffer& b)
TCutG TCutG(TCutG&)
Author: Rene Brun 16/05/97
Last update: 2.23/03 09/09/99 16.05.45 by Rene Brun
Copyright (c) 1995-1999, The ROOT System, All rights reserved. *
ROOT page - Class index - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.