/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ // $Id$ // Macro to process the files with histograms generated by // digitsDET.C macros for all included detectors and to produce plots // with histograms. // The histogram files are aerched in the directories, // which names are specified in label[] array; // the labels will be then used at the histogram titles. // // By E. Sicking, CERN; I. Hrivnacova, IPN Orsay void plotDetDigits(string a = "ITS", string b = "") { string label[10]; string histoName[10]; string histoTitle[10]; TFile* file[10]; Int_t color[10]; TH1F* histo[10][10]; // Fill values by hand // Int_t ndirs = 3; Int_t nhistos = 2; // Histogram labels (per directory) label[0] = "g3"; label[1] = "g4_sc"; label[2] = "g4"; // Histogram names & title (per histogram) histoName[0] = "hadc"; histoName[1] = "hadclog"; histoTitle[0] = "Number of ADC in "; histoTitle[1] = "Log_{10}(Number of ADC in "; // The histogram colors (per directory) color[0] = kBlack; color[1] = kRed; color[2] = kBlue; // // end hand made definitions // generate detname string detname = a; if ( b.size() > 0 ) { detname.append("."); detname.append(b); } cout << "Processing " << detname << " ... " << endl; // generate filename string filename = "digits."; filename.append(detname); filename.append(".root"); // label for all histos string labelall; for ( Int_t i=0; iGet(histoName[j].data()); if ( ! histo[i][j] ) { histo[i][j] = (TH1F *)file[i]->Get("hadcLog"); } //histo[i][j]->SetLineWidth(3); //histo[i][j]->SetLineStyle(3+i); histo[i][j]->SetLineColor(color[i]); //histo[i][j]->Sumw2(); } } // style & legend gROOT->SetStyle("Plain"); //gStyle->SetOptStat(0); // ??? TLegend *legp; TF1 *fun1p; TF1 *fun2p; TF1 *fun3p; legp= new TLegend(0.9,0.75,0.7,0.9); fun1p= new TF1("fun1p","gaus",-5.0,5.0); fun2p= new TF1("fun2p","gaus",-5.0,5.0); fun3p= new TF1("fun3p","gaus",-5.0,5.0); fun1p->SetLineColor(kBlue); fun2p->SetLineColor(kRed); fun2p->SetLineStyle(2); fun3p->SetLineColor(kBlack); fun3p->SetLineStyle(3); legp->SetFillColor(kWhite); legp->AddEntry(fun1p,"Geant3","l"); legp->AddEntry(fun2p,"Geant4","l"); legp->AddEntry(fun3p,"Fluka","l"); //Draw TCanvas* c1 = new TCanvas (detname.data(), detname.data(), 100, 100, 1000,1560); c1->Divide(nhistos, ndirs+1 ); // All plots Int_t counter = 0; for ( Int_t j=0; jcd(++counter); for ( Int_t i=0; iSetTitle(labelall.data()); string xtitle = histoTitle[j]; xtitle.append(detname); histo[i][j]->SetXTitle(xtitle.data()); string option(""); if ( i>0 ) option = "same"; histo[i][j]->Draw(option.data()); histo[i][j]->SetMaximum(histo[i][j]->GetMaximum()*scale); //histo[i][j]->Sumw2(); gPad->SetLogy(); //legp->Draw(); } } // Plots per case for ( Int_t i=0; icd(++counter); // gPad->SetLeftMargin(0.15); // gPad->SetBottomMargin(0.15); histo[i][j]->SetTitle(label[i].data()); string xtitle = histoTitle[j]; xtitle.append(detname); histo[i][j]->SetXTitle(xtitle.data()); histo[i][j]->Draw(""); histo[i][j]->SetMaximum(histo[i][j]->GetMaximum()*scale); //histo[i][j]->Sumw2(); gPad->SetLogy(); //legp->Draw(); } } string outName = detname; outName += ".gif"; c1->SaveAs(outName.data()); } void plotDigits() { plotDetDigits("ITS","SDD"); plotDetDigits("ITS","SPD"); plotDetDigits("ITS","SSD"); plotDetDigits("TPC"); plotDetDigits("TRD"); plotDetDigits("TOF"); plotDetDigits("EMCAL"); plotDetDigits("HMPID"); plotDetDigits("PHOS"); }