Root Example

Here is a sample Root script to open an ntuple file and histogram a few quantities. You can grab a sample (~600 events, 200 kB) file here. Copy the text below to TupleExam.C, then in Root do  .x TupleExam.C

{

       TFile* f = new TFile("DefaultGammaV3R3.root"); // open the file

        f->cd("PDR"); // navigate to the PDR directory

       TTree* t = (TTree*)gDirectory->Get("t1"); // get the tree

       TCanvas* c1 = new TCanvas();

      c1->Divide(2,2); // divide up canvas into 2x2

      c1->cd(1); // upper left
      t->Draw("MC_X0:MC_Y0"); // scatter plot MC x vs y

      TCut cut1 = "ACD_TileCount > 0"; // define a cut on ACD multiplicity

      c1->cd(2); // upper right
      t->Draw("MC_X0:MC_Y0",cut1); // draw again, applying cut

     c1->cd(3); // lower left
     t->Draw("Cal_Energy_Deposit"); // draw

    c1->cd(4); // lower right
    t->Draw("Cal_Energy_Deposit",cut1); // draw with cut

    c1->Update(); // update canvas (draw all the pads)

}