scripts/MakeLego.C

Go to the documentation of this file.
00001 //____________________________________________________________________
00002 //
00003 // $Id: MakeLego.C,v 1.3 2006/03/17 11:42:24 cholm Exp $
00004 //
00005 // Script to make ROOT files with LEGO information histograms
00006 //
00007 TH1*
00008 process(TFile* file, const char* name, const char* opt) 
00009 {
00010   TH2F*  h2d = static_cast<TH2F*>(file->Get(name));
00011   if (!h2d) {
00012     Error("process", "Couldn't get %s from %s", name, file->GetName());
00013     return 0;
00014   }
00015   TH1D*  h1d = h2d->ProjectionY();
00016   h1d->SetTitle(Form("%s", h1d->GetTitle()));
00017   h1d->Scale(1. / 360.);
00018 
00019   return h1d;
00020   
00021   return heta;
00022 }
00023 
00024 //____________________________________________________________________
00025 void
00026 MakeLego(const Char_t* what) 
00027 {
00028   TString config("FMD/scripts/ConfigInner.C");
00029   TString opt(what);
00030   if      (opt == "ITS") 
00031     config = "FMD/scripts/ConfigItsOnly.C";
00032   else if (opt == "PIPE") 
00033     config = "FMD/scripts/ConfigPipeOnly.C";
00034   else if (opt == "FMD") 
00035     config = "FMD/scripts/ConfigFmdOnly.C";
00036   else if (opt == "Nothing") 
00037     config = "FMD/scripts/ConfigNothing.C";
00038   else 
00039     opt = "Inner";
00040   
00041       
00042   cout << "Running AliRun::RunLego(" << config
00043        << ",180,0,180,360,0,360,0,10000,0,10000); " << endl;
00044   
00045   gAlice->RunLego(config.Data(), 180, 0, 180, 360, 0, 360, 0, 100000,
00046                   100000000, 0);
00047   
00048   TFile* galice   = TFile::Open("galice.root", "READ");
00049   TFile* output   = TFile::Open(Form("Lego_%s.root", opt.Data()),"RECREATE");
00050   TH1F* habso_eta = process(galice, "habso", opt.Data());
00051   TH1F* hradl_eta = process(galice, "hradl", opt.Data());
00052   TH1F* hgcm2_eta = process(galice, "hgcm2", opt.Data());
00053   hgcm2_eta->Draw();
00054   
00055   output->Write();
00056   output->Close();
00057   galice->Close();  
00058 }
00059 //____________________________________________________________________
00060 //
00061 // EOF
00062 //

Generated on Fri Mar 24 17:11:21 2006 for ALICE FMD Off-line by  doxygen 1.4.6