{ #include "TFile.h" #include "TTree.h" #include "TCut.h" int i=0,b=0, j=0,c=0; // TFile f("out.root"); TCanvas c1("Des","Staiao",10,10,1000,1000); // c1.Divide(6,1); // c1.SetWindowSize(1200,250); // TH1F *h1 = new TH1F("h1","StaiaoTest",192,0,191); UInt_t id = 0,chan_i=0,plane_i=0,mod_i=0; UShort_t chan = 0; UShort_t mod = 0; UShort_t plane = 0; pct.SetBranchAddress("plane",&plane); pct.SetBranchAddress("channel",&chan); pct.SetBranchAddress("module",&mod); pct.SetBranchAddress("event_id",&id); TH2I *h = new TH2I("h","h",6,0,5,48,0,47); UShort_t staiao[6][192]; pct.GetEntry(); for(i=0; id != 100 ; i++){ pct.GetEntry(i); //get to 100th event printf("finding the event. searching:"); printf("event # %d\n",id); } while(id == 100) { // if(plane == 1) {pct.GetEntry(i);i++;continue;} printf("drawing mod %d, chan %d\n",mod,chan); h.Fill(mod,chan); pct.GetEntry(i); i++; } h.Draw(); }