1 /**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //_________________________________________________________________________
19 // Top EMCAL folder which will keep all information about EMCAL itself,
20 // super Modules (SM), modules, towers, set of hists and so on.
22 //*-- Author: Aleksei Pavlinov (WSU, Detroit, USA)
24 #include "AliEMCALSuperModule.h"
25 #include "AliEMCALFolder.h"
26 #include "AliEMCALCell.h"
27 #include "AliEMCALHistoUtilities.h"
36 #include <TLegendEntry.h>
38 typedef AliEMCALHistoUtilities u;
40 ClassImp(AliEMCALSuperModule)
42 AliEMCALSuperModule::AliEMCALSuperModule() : TObjectSet(),
47 AliEMCALSuperModule::AliEMCALSuperModule(const Int_t m, const char* title) :
48 TObjectSet(Form("SM%2.2i",m)),
54 AliEMCALSuperModule::~AliEMCALSuperModule()
59 void AliEMCALSuperModule::Init()
61 if(GetHists()==0) this->AddObject(BookHists(), kTRUE);
64 void AliEMCALSuperModule::AddCellToEtaRow(AliEMCALCell *cell, const Int_t etaRow)
67 set = FindByName(Form("ETA%2.2i",etaRow));
69 set = new TDataSet(Form("ETA%2.2i",etaRow));
75 void AliEMCALSuperModule::FitForAllCells()
78 for(int eta=0; eta<48; eta++) { // eta row
79 TDataSet *setEta = FindByName(Form("ETA%2.2i",eta));
81 printf(" eta %i : %s : cells %i \n", eta, setEta->GetName(), setEta->GetListSize());
82 for(int phi=0; phi<setEta->GetListSize(); phi++) { // cycle on cells (phi directions)
83 AliEMCALCell* cell = (AliEMCALCell*)setEta->At(phi);
84 cell->FitEffMassHist();
86 u::FillH1(GetHists(), 1, cell->GetCcIn()*1.e+3);
87 u::FillH1(GetHists(), 2, cell->GetCcOut()*1.e+3);
89 TF1 *f = cell->GetFunction();
90 u::FillH1(GetHists(), 3, f->GetParameter(1));
91 u::FillH1(GetHists(), 4, f->GetParameter(2));
92 u::FillH1(GetHists(), 5, f->GetChisquare()/f->GetNDF());
93 u::FillH1(GetHists(), 6, f->GetParameter(0));
99 printf(" <I> AliEMCALSuperModule::FitForAllCells() : ncells %i with fit \n", ncells);
102 void AliEMCALSuperModule::FitEffMassHist()
104 TH1* h = (TH1*)GetHists()->At(0);
105 AliEMCALCell::FitHist(h, GetName());
109 void AliEMCALSuperModule::PrintInfo()
111 printf(" Super Module : %s : %i \n", GetName(), fSMNumber);
112 printf(" # of active cells %i \n", GetNumberOfCells());
113 TH1* h = (TH1*)GetHists()->At(0);
114 printf(" # h->Integral() of eff.mass hist %i \n", int(h->Integral()));
117 void AliEMCALSuperModule::DrawCC(int iopt)
120 if(iopt==1) c = new TCanvas("ccInOut","ccInOut");
122 gStyle->SetOptStat(0);
124 TH1 *hCCIn = (TH1*)GetHists()->At(1);
125 TH1 *hCCOut = (TH1*)GetHists()->At(2);
127 hCCIn->SetStats(kFALSE);
128 hCCOut->SetStats(kFALSE);
129 hCCOut->SetTitle("CC in and out");
130 hCCOut->SetXTitle("cc in MeV");
131 hCCOut->SetYTitle(" N ");
133 u::DrawHist(hCCOut,2);
134 hCCOut->SetAxisRange(10., 24.);
135 u::DrawHist(hCCIn,2, kRed, "same");
137 TLegend *leg = new TLegend(0.5,0.36, 0.97,0.80);
138 TLegendEntry *leIn = leg->AddEntry(hCCIn, Form("input cc : %6.2f #pm %6.2f", hCCIn->GetMean(),hCCIn->GetRMS()), "L");
139 leIn->SetTextColor(hCCIn->GetLineColor());
140 leg->AddEntry(hCCOut, Form("output cc : %6.2f #pm %6.2f", hCCOut->GetMean(),hCCOut->GetRMS()), "L");
146 Int_t AliEMCALSuperModule::GetNumberOfCells()
149 for(int eta=0; eta<GetListSize(); eta++) { // cycle on eta row
150 TDataSet *set = At(eta);
151 ncells += set->GetListSize();
156 TList* AliEMCALSuperModule::BookHists()
159 TH1::AddDirectory(1);
161 AliEMCALFolder* EMCAL = (AliEMCALFolder*)GetParent();
162 Int_t it = EMCAL->GetIterationNumber();
164 new TH1F("00_EffMass", "effective mass of #gamma,#gamma(m_{#pi^{0}}=134.98 MeV) ", 250,0.0,0.5);
165 new TH1F("01_CCInput", "input CC dist.(MEV) ", 200, 5., 25.);
166 new TH1F("02_CCOutput", "output CC dist.(MEV) ", 200, 5., 25.);
167 new TH1F("03_MPI0", "mass of #pi_{0} dist. ", 170, 0.05, 0.22);
168 new TH1F("04_RESPI0", "resolution at #pi_{0} dist. ", 50, 0.0, 0.05);
169 new TH1F("05_XI2/NDF", "#chi^{2} / ndf", 50, 0.0, 5.0);
170 new TH1F("06_NPI0", "number of #pi_{0}", 150, 0.0, 1500.);
172 TList *l = AliEMCALHistoUtilities::MoveHistsToList(Form("HistsOfSM_%2.2i",fSMNumber), kFALSE);
173 AliEMCALHistoUtilities::AddToNameAndTitleToList(l, Form("_%2.2i_It%i",fSMNumber, it),
174 Form(" SM %2.2i, Iter %i",fSMNumber, it));
176 TH1::AddDirectory(0);