14 c1 =
new TCanvas(
"c1",
"Dynamic Slice Example",10,10,700,500);
19 TH2F *hpxpy =
new TH2F(
"hpxpy",
"py vs px",40,-4,4,40,-4,4);
22 for (
Int_t i = 0; i < 50000; i++) {
50 int pyold =
gPad->GetUniqueID();
51 int px =
gPad->GetEventX();
52 int py =
gPad->GetEventY();
53 float uxmin =
gPad->GetUxmin();
54 float uxmax =
gPad->GetUxmax();
55 int pxmin =
gPad->XtoAbsPixel(uxmin);
56 int pxmax =
gPad->XtoAbsPixel(uxmax);
57 if(pyold)
gVirtualX->DrawLine(pxmin,pyold,pxmax,pyold);
59 gPad->SetUniqueID(py);
67 else c2 =
new TCanvas(
"c2",
"Projection Canvas",710,10,700,500);
76 sprintf(title,
"Projection of biny=%d",biny);
virtual void SetLineWidth(Width_t lwidth)
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
virtual TObject * GetPrimitive(const char *name) const
Get primitive.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
virtual void SetGrid(Int_t valuex=1, Int_t valuey=1)
TH1D * ProjectionX(const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const
Project a 2-D histogram into a 1-D histogram along X.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual void AddExec(const char *name, const char *command)
Add a new TExec object to the list of Execs.
virtual void SetLineColor(Color_t lcolor)
Service class for 2-Dim histogram classes.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
virtual void SetFillColor(Color_t fcolor)
2-D histogram with a float per channel (see TH1 documentation)}
R__EXTERN TRandom * gRandom
1-D histogram with a double per channel (see TH1 documentation)}
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual void SetName(const char *name)
Change the name of this histogram.
Mother of all ROOT objects.
void SetFrameFillColor(Color_t color=1)
virtual void SetTitle(const char *title)
Change (i.e.
virtual void Update()
Update canvas pad buffers.
Int_t Fill(Double_t)
Invalid Fill method.
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
Fit histogram with function fname.
virtual TF1 * GetFunction(const char *name) const
Return pointer to function with name.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.