//inspect(int runNumber) inspect() { // TList *list = new TList; TFile *inHistoFile; TFile *outHistoFile; TH1F *hist; char inFileName[256]; char outFileName[256]; char tmpHistoName[256]; int cut = 0; int mipLowCut = 15; int mipHighCut = 200; int mipEntriesLowCut = 10; int mipEntriesHighCut = 2000000; int moduleID = 2; inHistoFile = new TFile("output.root", "read"); TH1F *tmpHist = inHistoFile->Get("Edistribution_2_0_17_0"); TH1F *h = (TH1F*)tmpHist->Clone("h"); h->Reset(); for(int rcuZ =0; rcuZ < 2; rcuZ ++) { for(int rcuX =0; rcuX < 1; rcuX ++) { sprintf(outFileName, "output_good_%d_%d_%d.root",moduleID, rcuZ, rcuX); outHistoFile = new TFile(outFileName, "recreate"); for(int z =0; z < 28; z ++) { for(int x = 0; x< 32; x ++) { sprintf(tmpHistoName, "Edistribution_%d_%d_%d_%d",moduleID, x + rcuX*32, z + rcuZ*28, 1); hist = (TH1F *)inHistoFile->Get(tmpHistoName); // hist->SetMaximum(1000); // hist->SetMaximum(1000); // hist->SetLogY(); // hist->AxisChoice("G"); // TAxis *t = hist->GetYaxis(); // t->SetDrawOption("+L"); // TAxis *s = hist->GetXaxis(); // s->SetDrawOption("+L"); // TVirtualPad* p1; // p1= c-> cd(1); // p1 -> SetLogy; // hist->SetLogy(); // hist->SetDrawOption("H"); // list->Add(hist); if(hist != 0) { int tmpMax = 0; for(int i=0; i < 1024; i++) { if(hist->GetBin(i) > tmpMax) { tmpMax = hist->GetBin(i); } } if(tmpMax > cut) { int tmpEntries = 0; for(int i=mipLowCut; i <= mipHighCut; i++ ) { tmpEntries += hist->GetBinContent(i); } if( (tmpEntries >= mipEntriesLowCut) && (tmpEntries<= mipEntriesHighCut)) { for(int i =0; i< cut; i++) { hist->SetBinContent(i, 0); } cout <<"maximum bin with non zero value is " << tmpHistoName << " is " << tmpMax << ", tmpEntries = "<< tmpEntries <cd(); hist->SetAxisRange(0, mipHighCut +100); hist->Write(); inHistoFile->cd(); } } } else { } } } } } outHistoFile->Close(); }