Show the slice of a TH2 following the mouse position. 
 
  
void hist105_TExec_dynamic_slice()
{
   
 
   
   TH2F *
hpxpy = 
new TH2F(
"hpxpy", 
"py vs px", 40, -4, 4, 40, -4, 4);
 
   for (
Int_t i = 0; i < 50000; i++) {
 
   }
 
   
   c1->AddExec(
"dynamic", 
"DynamicExec()");
 
}
 
{
   
   
   
   
   
   
   
   
 
 
   int px = 
gPad->GetEventX();
 
   int py = 
gPad->GetEventY();
 
 
      
   }
 
      return;
 
 
   
 
 
   
      delete c2->GetPrimitive(
"Projection");
 
   else
      c2 = 
new TCanvas(
"c2", 
"Projection Canvas", 710, 10, 700, 500);
 
 
   
   hp->SetName(
"Projection");
 
   hp->GetFunction(
"gaus")->SetLineColor(
kRed);
 
   hp->GetFunction(
"gaus")->SetLineWidth(6);
 
}
int Int_t
Signed integer 4 bytes (int)
 
float Float_t
Float 4 bytes (float)
 
double Double_t
Double 8 bytes.
 
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
R__EXTERN TRandom * gRandom
 
1-D histogram with a double per channel (see TH1 documentation)
 
2-D histogram with a float per channel (see TH1 documentation)
 
Service class for 2-D histogram classes.
 
Mother of all ROOT objects.
 
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
 
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
 
TVirtualPad is an abstract base class for the Pad and Canvas classes.
 
- Date
 - November 2022 
 
- Authors
 - Rene Brun, Sergey Linev 
 
Definition in file hist105_TExec_dynamic_slice.C.