{ TFile *fin = new TFile("SSD_mod_occ.root"); TCanvas *c1=new TCanvas("c1","c1: occupancy",300,300); TCanvas *c2=new TCanvas("c2","c2: strip distribution",600,400); TIter key_iter(fin->GetListOfKeys()); hOcc = new TH1F("hOcc","Hits per module",1000,0,10000); while (key = (TKey*) key_iter()) { cout << "key " << key->GetName() << endl; if (strstr(key->GetName(),"modHist")) { TH1F *h1 = (TH1F*)key->ReadObj(); hOcc->Fill(h1->GetEntries()); } } c1->cd(); hOcc->Draw(); c1->Update(); cout << "Mean Occupancy " << hOcc->GetMean() << " RMS " << hOcc->GetRMS() << endl; c2->cd(); Float_t threshold = hOcc->GetMean() + 4 * hOcc->GetRMS(); key_iter.Reset(); while (key = (TKey*) key_iter()) { if (strstr(key->GetName(),"modHist")) { TH1F *h1 = (TH1F*)key->ReadObj(); if (h1->GetEntries() > threshold) { h1->Draw(); c2->Update(); cout << "Key to continue" << endl; Char_t s[256]; gets(s); } } } }