{ ////////////////////////////////////////////////// // getInfo.C : Root Macro // // Example of the Hall D Root macro // //*-- Author : Paul Eugenio 31-May-2004 // ////////////////////////////////////////////////// gROOT->Reset(); gSystem->Load("$HALLD_HOME/src/mcroot/libTMCFast.so"); // point this to $HALLD_HOME/src/mcroot/libTMCFast.so char fname[50]; // This file was generated by HDFast gSystem->Exec("ls *.rdt"); cerr<<"Enter name of rdt file: "; cin >> fname; cerr<GetBranch("hepevt"); TBranch *b2 = tree->GetBranch("offtrk"); //TBranch *b3 = tree->GetBranch("bcal"); //TBranch *b4 = tree->GetBranch("lgdSmears"); TBranch *b5 = tree->GetBranch("traces"); TMCFastHepEvt *hepevt; TMCFastTraceEvent *trace; TMCFastOfflineTrack *offtrk; hepevt = new TMCFastHepEvt(); trace = new TMCFastTraceEvent(); offtrk = new TMCFastOfflineTrack(); b1->SetAddress(&hepevt); b2->SetAddress(&offtrk); b5->SetAddress(&trace); // create some histograms and some place to put them TH1F *h1 = new TH1F("h1", "number of trace particles",100,0,10); TH1F *h2 = new TH1F("h2", "number of trace points",100,0,600); TH1F *h3 = new TH1F("h3", "Max trace radius",100,20,150); TH1F *h4 = new TH1F("h4", "Max trace z position",100,500,600); TH2F *h5 = new TH2F("h5", "Z VS R",600,0,600,150,0,150); TH2F *h6 = new TH2F("h6", "X VS Y",200,-100,100,200,-100,100); // now create some pads to put the histo's c1 = new TCanvas("c1","Halld Time-of-Flight",100,10,700,900); c1->SetFillColor(18); pad1 = new TPad("pad1","The pad with the function",0.01,0.50,0.49,0.99,21); pad2 = new TPad("pad2","The pad with the histogram",0.51,0.50,0.99,0.99,21); pad3 = new TPad("pad3","The pad with the histogram",0.01,0.01,0.49,0.49,21); pad4 = new TPad("pad4","The pad with the function",0.51,0.01,0.99,0.49,21); //pad5 = new TPad("pad5","The pad with the histogram",0.55,0.34,0.95,0.64,21); //pad6 = new TPad("pad6","The pad with the histogram",0.55,0.02,0.95,0.32,21); pad1->Draw(); pad2->Draw(); pad3->Draw(); pad4->Draw(); //pad5->Draw(); //pad6->Draw(); Int_t nentries = (Int_t)tree->GetEntries(); for (Int_t ev = 0; ev < nentries; ev++) { tree->GetEvent(ev); //read event into memory h1->Fill(trace->GetNTraceParticles()); h2->Fill(trace->GetNTracePoints()); //cerr<<"Ntracepoints is "<GetNTracePoints()<GetFTOF(0,565) // <<" CTOF(0): "<GetCTOF(0,65) // <Clear(); trace->Clear(); offtrk->Clear(); } //cerr<<" Now draw the histograms\n"; pad1->cd(); h1->Draw(); pad2->cd(); h2->Draw(); pad3->cd(); h3->Draw(); pad4->cd(); h5->Draw(); return 0; }