Make a contour plot and get the first contour in a TPolyMarker.
This macro generates a color contour plot by selecting entries from an ntuple file. The TGraph object corresponding to the first contour line is accessed and displayed into a separate canvas.
void FirstContour()
{
ntuple->
Draw(
"py:px",
"px*px+py*py < 20",
"contz,list");
if (!contours) return;
if (!lcontour1) return;
if (!gc1) return;
if (gc1->
GetN() < 10)
return;
const Int_t npmax = 50000;
while(1) {
np++;
if (np == npmax) break;
}
}
}
R__EXTERN TRandom * gRandom
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
A TGraph is an object made of two arrays X and Y with npoints each.
virtual Int_t IsInside(Double_t x, Double_t y) const
Return 1 if the point (x,y) is inside the polygon defined by the graph vertices 0 otherwise.
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
TObject * At(Int_t idx) const
A PolyMarker is defined by an array on N points in a 2-D space.
virtual void Draw(Option_t *option="")
Draw.
virtual void SetPoint(Int_t point, Double_t x, Double_t y)
Set point number n.
virtual Double_t Rndm()
Machine independent random number generator.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TString & Append(const char *cs)
A TTree represents a columnar dataset.
virtual void Draw(Option_t *opt)
Default Draw method for all objects.
- Author
- Rene Brun
Definition in file FirstContour.C.