1 #if !defined(__CINT__) || defined(__MAKECINT__) 2 #include <AliEMCALGeometry.h> 4 #include <TClonesArray.h> 7 #include <TGraphErrors.h> 15 #include <TProfile2D.h> 20 void anaTree(
const char *ifile=
"treefile.root",
const char *ofile=
"outhist.root")
22 AliEMCALGeometry *g=AliEMCALGeometry::GetInstance(
"EMCAL_COMPLETE12SMV1_DCAL_8SM");
23 const Int_t kSM=g->GetNumberOfSuperModules();
24 const Int_t kNcells=g->GetNCells();
28 TFile *in = TFile::Open(ifile,
"read");
30 tt->SetBranchAddress(
"event",&info);
31 tt->Branch(
"event", &info, 32000, 99);
33 TProfile *gLedVsT[20];
34 TProfile *gRatVsT[20];
35 for (
Int_t i=0;i<20;++i) {
36 gLedVsT[i] =
new TProfile(
"",
"Led info;T;",1000,10,50);
37 gLedVsT[i]->SetMarkerStyle(20);
38 gLedVsT[i]->SetMarkerSize(1.2);
39 gLedVsT[i]->SetMarkerColor(1);
40 gLedVsT[i]->SetLineColor(1);
41 gLedVsT[i]->SetLineWidth(3);
42 gLedVsT[i]->SetName(Form(
"ledsm%d",i));
43 gRatVsT[i] =
new TProfile(
"",
"Led/LedMon;T",1000,10,50);
44 gRatVsT[i]->SetMarkerStyle(20);
45 gRatVsT[i]->SetMarkerSize(1.2);
46 gRatVsT[i]->SetMarkerColor(1);
47 gRatVsT[i]->SetLineColor(1);
48 gRatVsT[i]->SetLineWidth(3);
49 gRatVsT[i]->SetName(Form(
"ledovermonsm%d",i));
52 TProfile *gLedCellVsT[kNcells+1];
53 TProfile *gRatCellVsT[kNcells+1];
55 for (
Int_t j=0;j<kNcells+1;++j) {
56 gLedCellVsT[j] =
new TProfile(
"",Form(
"Led info cell ID%i ;T;",j),1000,10,50);
57 gLedCellVsT[j]->SetMarkerStyle(20);
58 gLedCellVsT[j]->SetMarkerSize(1.2);
59 gLedCellVsT[j]->SetMarkerColor(1);
60 gLedCellVsT[j]->SetLineColor(1);
61 gLedCellVsT[j]->SetLineWidth(3);
62 gLedCellVsT[j]->SetName(Form(
"ledCell%d",j));
63 gRatCellVsT[j] =
new TProfile(
"",Form(
"Led/LedMon cell ID%i ;T;",j),1000,10,50);
64 gRatCellVsT[j]->SetMarkerStyle(20);
65 gRatCellVsT[j]->SetMarkerSize(1.2);
66 gRatCellVsT[j]->SetMarkerColor(1);
67 gRatCellVsT[j]->SetLineColor(1);
68 gRatCellVsT[j]->SetLineWidth(3);
69 gRatCellVsT[j]->SetName(Form(
"ledovermonCell%d",j));
73 Int_t Nev=tt->GetEntries();
74 for (
Int_t i=0;i<Nev;++i) {
76 cout << info->
fRunNo << endl;
77 TClonesArray &cells = info->
fCells;
78 for (
Int_t j=0;j<cells.GetEntries();++j) {
92 if ((ledM<=0)||(ledR<=0))
95 TProfile *h = gLedVsT[sm];
97 gLedCellVsT[cellID]->Fill(locT,ledM,w);
98 if ((monM<=0)||(monR<=0))
100 Double_t w2=TMath::Sqrt(ledR*ledR+monM*monM);
101 TProfile *h2 = gRatVsT[sm];
102 h2->Fill(T,ledM/monM,w2);
103 gRatCellVsT[cellID]->Fill(locT,ledM/monM,w2);
107 TFile *out = TFile::Open(ofile,
"recreate");
109 out = TFile::Open(
"dummyfile.root",
"update");
110 for (
Int_t i=0;i<20;++i) {
114 for (
Int_t j=0;j<kNcells+1;++j) {
115 if (gLedCellVsT[j]->GetEntries() > 0)
116 gLedCellVsT[j]->Write();
117 if (gRatCellVsT[j]->GetEntries() > 0)
118 gRatCellVsT[j]->Write();
void anaTree(const char *ifile="treefile.root", const char *ofile="outhist.root")
UShort_t T(UShort_t m, UShort_t t)