Olivier,
Thank you for the response.
I know TCutG is a derived class of TGraph. Which is good.
I’ve taken the liberty to add the root.exe commands that creates a canvas, a 2d Double histogram, fills the histogram, and then a TCutG region. See below:
{
// Creates a Canvas to perform operations on with an X/y dimention of
// 500 x 500.
TCanvas *c2 = new TCanvas(“c2”, “my 2d plot”, 500, 500);
// Creates a 2D Histogram object with a 100 bin x and 100 bin y.
// the range will be x [-5, 5], y [-5, 5]
//
TH2D *htwoD = new TH2D(“htwoD”, “A 2D histogram”, 100, -5, 5, 100, -5, 5)
// A for loop to randomly poplulate the histogram.
// Here you have 2 histograms.
// the loop is 10,000 because of the 100x100 x/y bins set above.
for (int i = 0; i< 100000; i++) {htwoD->Fill(gRandom->Gaus(-0.5, 0.1), gRandom->Gaus(-0.5, 0.1));htwoD->Fill(gRandom->Gaus(0.2, 0.2), gRandom->Gaus(1.4, 0.2)); }
// Draw histogram data points in colors (colz)
htwoD->Draw(“colz”);
// Specify the X/Y tuplets for the TCutG
// rectangle
double x1[] = {0.5, 1.25, -1, -1.25, .5};
double y[] = {-1, 1, 1.75, 0, -1};
// Crete a 5 point TCutG region.
TCutG *cutg = new TCutG(“mycut”,5, x1, y);
cutg->SetVarX(“x”);
cutg->SetVarY(“y”);
cutg->Draw()
}
The output looks like:
Now here is my rephrased question.
My TCutG1 region shown has data points from both random data points. I can pass this to my fpga and it knows what to do.
My problem… How can I crate another TCutG2 region that encapsulates everything except what my TCutG1 region encapsulates?
Thank you,
Angel