{ // // An example to analyze info stored in the SVAC and Merit ntuples. // // To run the macro, simply do '.x anaMeritSvac.C' in root. // // The macro will fill a histogram of planes that are hit for events with less // than 6 digis, fill a ntuple (with both SVAC and Merit ntuple variables) // containing reconstructed direction and number of digis and tracks for each // event, then store the histogram and the ntuple in a root file. // // Author: Chen, Xin (xchen@slac.stanford.edu) // Additions and comments by anders :-) // gROOT->Reset(); // // The main code is in 'anaMeritSvacNtuple.C'. // Here we load it into Root. // TExec ex; ex.Exec(".L anaMeritSvacNtuple.C"); ex.Exec(".L chainTrees.cxx"); char *svaclist[] = { "/nfs/farm/g/glast/u16/Integration/rootData/135002769/v4r060302p23/calib-v1r0/svacTuple/emRootv0r0/svacTuple-v3r1p20_135002769_svac_svac.root", "/nfs/farm/g/glast/u16/Integration/rootData/135002770/v4r060302p23/calib-v1r0/svacTuple/emRootv0r0/svacTuple-v3r1p20_135002770_svac_svac.root", "/nfs/farm/g/glast/u16/Integration/rootData/135002771/v4r060302p23/calib-v1r0/svacTuple/emRootv0r0/svacTuple-v3r1p20_135002771_svac_svac.root"}; int numSvacFiles = sizeof(svaclist)/sizeof(char*); TChain *svacChain = chainTrees(numSvacFiles, svaclist, "Output"); char *meritlist[] = {"/nfs/farm/g/glast/u16/Integration/rootData/135002769/v4r060302p23/calib-v1r0/grRoot/recon-v3r1p20_135002769_merit_merit.root", "/nfs/farm/g/glast/u16/Integration/rootData/135002770/v4r060302p23/calib-v1r0/grRoot/recon-v3r1p20_135002770_merit_merit.root", "/nfs/farm/g/glast/u16/Integration/rootData/135002771/v4r060302p23/calib-v1r0/grRoot/recon-v3r1p20_135002771_merit_merit.root" }; int numMeritFiles = sizeof(meritlist)/sizeof(char*); TChain *meritChain = chainTrees(numMeritFiles, meritlist, "MeritTuple"); // // Open the output root file to store results of running the macro: // TFile f1("temp.root", "RECREATE"); // // Open an array of histograms and an ntuple to pass to another macro: // TH1F* h[5]; TNtuple* n = new TNtuple("n1", "n1", "TkrNumDigis:TkrNumTracks:VtxXDir:VtxYDir:VtxZDir"); h[0] = new TH1F("h1", "h1", 36, -0.5, 35.5); // // Run the macro which does the real work: // anaMeritSvacNtuple(svacChain, meritChain, n,h); // Output: f1.cd(); f1.Write(0, TObject::kOverwrite); f1.Close(); }