Added various ROOT and Shell scripts used for development of the FMD code
[u/mrichter/AliRoot.git] / FMD / scripts / MakeLego.C
CommitLineData
d389af40 1//
2// Script to make ROOT files with LEGO information histograms
3//
4TH1*
5process(TFile* file, const char* name, const char* opt)
6{
7 TH2F* h2d = static_cast<TH2F*>(file->Get(name));
8 if (!h2d) {
9 Error("process", "Couldn't get %s from %s", name, file->GetName());
10 return 0;
11 }
12 TH1D* h1d = h2d->ProjectionY();
13 h1d->SetTitle(Form("%s", h1d->GetTitle()));
14 h1d->Scale(1. / 360.);
15
16 return h1d;
17
18 return heta;
19}
20
21void
22MakeLego(const Char_t* what)
23{
24 TString config("FMD/scripts/ConfigInner.C");
25 TString opt(what);
26 if (opt == "ITS")
27 config = "FMD/scripts/ConfigItsOnly.C";
28 else if (opt == "PIPE")
29 config = "FMD/scripts/ConfigPipeOnly.C";
30 else if (opt == "FMD")
31 config = "FMD/scripts/ConfigFmdOnly.C";
32 else if (opt == "Nothing")
33 config = "FMD/scripts/ConfigNothing.C";
34 else
35 opt = "Inner";
36
37
38 cout << "Running AliRun::RunLego(" << config
39 << ",180,0,180,360,0,360,0,10000,0,10000); " << endl;
40
41 gAlice->RunLego(config.Data(), 180, 0, 180, 360, 0, 360, 0, 100000,
42 100000000, 0);
43
44 TFile* galice = TFile::Open("galice.root", "READ");
45 TFile* output = TFile::Open(Form("Lego_%s.root", opt.Data()),"RECREATE");
46 TH1F* habso_eta = process(galice, "habso", opt.Data());
47 TH1F* hradl_eta = process(galice, "hradl", opt.Data());
48 TH1F* hgcm2_eta = process(galice, "hgcm2", opt.Data());
49 hgcm2_eta->Draw();
50
51 output->Write();
52 output->Close();
53 galice->Close();
54}