Sadiq ROOTSYS Data Analysis Memo

From New IAC Wiki
Revision as of 01:01, 10 December 2011 by Setisadi (talk | contribs) (→‎Creating Class and Using it)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

PEPPo

We want to multiply Aug spectrum to calibration constant, and then overlay Na22 spectrum with Co60 spectrum.

Creating Class and Using it

We created program called T.C by:

root [1] T->MakeClass();

We edited T.C to add the calibration and calculation we want. Then Load T.C:

root [2] .L T.C

root [3] T t;

root [4] t.Loop();

In T.h, we can edit which root file we want to work on.

For example, in T.h, we can work on test1052.root file if we put


// if parameter tree is not specified (or zero), connect the file
// used to generate this class and read the Tree.
  if (tree == 0) {
     TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("test1052.root");
     if (!f) {
        f = new TFile("test1052.root");
     }
     tree = (TTree*)gDirectory->Get("T");