2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * All rights reserved. *
6 * Primary Authors: Albin Gaignette
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
18 * @file AliHLTPHOSPhysicsHistogramProducer
19 * @author Albin Gaignette
21 * @brief Histogram producer for PHOS HLT
24 // see header file for class documentation
26 // refer to README to build package
28 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
30 #include "AliHLTPHOSPhysicsHistogramProducer.h"
31 #include "AliESDCaloCluster.h"
33 #include "TClonesArray.h"
38 AliHLTPHOSPhysicsHistogramProducer::AliHLTPHOSPhysicsHistogramProducer() :
43 fHistTwoClusterInvMass(0),
45 fHistNcellsPercentage(0),
48 fHistNcellsSumCells(0),
51 // See header file for documentation
52 fHistArrayPtr = new TObjArray;
54 fHistNcls = new TH1F("fHistNcls", "Number of clusters per event", 20, 0, 20);
55 fHistNcls->GetXaxis()->SetTitle("Number of clusters per event");
56 fHistNcls->GetYaxis()->SetTitle("# of counts");
57 fHistArrayPtr ->AddLast(fHistNcls);
59 fHistEnergy = new TH1F("fHistEnergy", "Energy in each cluster", 200, 0, 100);
60 fHistEnergy->GetXaxis()->SetTitle("E_{T} GeV");
61 fHistEnergy->GetYaxis()->SetTitle("# of counts");
62 fHistEnergy->SetMarkerStyle(21);
63 fHistArrayPtr->AddLast(fHistEnergy);
65 fHistTotEnergy = new TH1F("fHistTotEnergy", "Total energy in each event", 200, 0, 200);
66 fHistTotEnergy->GetXaxis()->SetTitle("E_{T} GeV");
67 fHistTotEnergy->GetYaxis()->SetTitle("# of counts");
68 fHistTotEnergy->SetMarkerStyle(21);
69 fHistArrayPtr ->AddLast(fHistTotEnergy);
71 fHistTwoClusterInvMass = new TH1F("fHistTwoClusterInvMass", "Invariant mass of two clusters", 200, 0, 1);
72 fHistTwoClusterInvMass->GetXaxis()->SetTitle("m_{#gamma#gamma} GeV");
73 fHistTwoClusterInvMass->GetYaxis()->SetTitle("Number of counts");
74 fHistTwoClusterInvMass->SetMarkerStyle(21);
75 fHistArrayPtr->AddLast(fHistTwoClusterInvMass);
77 fHistNcells = new TH1F("fHistNcells", "Number of cells in each cluster", 200, 0, 100);
78 fHistNcells->GetXaxis()->SetTitle("# of cells in the cluster");
79 fHistNcells->GetYaxis()->SetTitle("# of counts");
80 fHistNcells->SetMarkerStyle(21);
81 fHistArrayPtr ->AddLast(fHistNcells);
83 fHistNcellsPercentage = new TH1F("fHistNcellsPercentage", "Percentage of cells in the cluster", 200, 0, 10);
84 fHistNcellsPercentage->GetXaxis()->SetTitle("100* #frac{Total # of cells in the cluster}{Total # of cells in PHOS}");
85 fHistNcellsPercentage->GetYaxis()->SetTitle("# of counts");
86 fHistNcellsPercentage->SetMarkerStyle(21);
87 fHistArrayPtr ->AddLast(fHistNcellsPercentage);
89 fHistCellsEnergy = new TH2F("fHistCellsEnergy","# of cells in the cluster vs cluster Energy",100,0,60,100,1,60);
90 fHistCellsEnergy->GetXaxis()->SetTitle("Cluster Energy [GeV]");
91 fHistCellsEnergy->GetYaxis()->SetTitle("# of cells in the cluster");
92 fHistArrayPtr ->AddLast(fHistCellsEnergy);
94 fHistNclusterTotE = new TH2F("fHistNclusterTotE","# of clusters vs total Energy",100,0,200,100,1,15);
95 fHistNclusterTotE->GetXaxis()->SetTitle("total Energy in the event [GeV]");
96 fHistNclusterTotE->GetYaxis()->SetTitle("# of clusters in each event");
97 fHistArrayPtr ->AddLast(fHistNclusterTotE);
99 fHistNcellsSumCells = new TH2F("fHistNcellsSumCells","# of cells in PHOS vs sum cells in the clusters",100,0,300,100,17910,17930);
100 fHistNcellsSumCells->GetXaxis()->SetTitle("# of cells in the clusters");
101 fHistNcellsSumCells->GetYaxis()->SetTitle("Total # of cells in PHOS");
102 fHistArrayPtr->AddLast(fHistNcellsSumCells);
105 AliHLTPHOSPhysicsHistogramProducer::~AliHLTPHOSPhysicsHistogramProducer()
107 // See header file for documentation
120 delete fHistTotEnergy;
123 if(fHistTwoClusterInvMass)
125 delete fHistTwoClusterInvMass;
126 fHistTwoClusterInvMass = 0;
133 if(fHistNcellsPercentage)
135 delete fHistNcellsPercentage;
136 fHistNcellsPercentage = 0;
140 delete fHistCellsEnergy;
141 fHistCellsEnergy = 0;
143 if(fHistNclusterTotE)
145 delete fHistNclusterTotE;
146 fHistNclusterTotE = 0;
148 if(fHistNcellsSumCells)
150 delete fHistNcellsSumCells;
151 fHistNcellsSumCells = 0;
155 delete fHistArrayPtr;
160 TObjArray* AliHLTPHOSPhysicsHistogramProducer::GetHistograms()
162 // See header file for documentation
163 return fHistArrayPtr;
166 Int_t AliHLTPHOSPhysicsHistogramProducer::AnalyseClusters(TClonesArray* clusters)
168 // See header file for documentation
169 Int_t nPHOSModules = 3;
170 Int_t totClustersAll=0;
171 Int_t totClustersAllwithprob=0;
172 Int_t totClustersFile=0;
173 Int_t totClustersFilewithprob=0;
176 Double_t TotalCells =0;
177 Double_t TotalCellsPHOS= NXCOLUMNSMOD*NZROWSMOD * nPHOSModules;
178 // 3584 crystals * 3 modules
179 Double_t Nclusters =0;
180 Double_t TotEnergy = 0.0;
182 Int_t ncls = clusters->GetEntriesFast();
184 fHistNcls->Fill(ncls);
185 totClustersAll+=ncls;
186 totClustersFile+=ncls;
193 Float_t** tabposition = new Float_t*[ncls];
194 Double_t* tabenergy=new Double_t[ncls];
196 for(Int_t icls = 0; icls < ncls; icls++)
198 AliESDCaloCluster* cluster = (AliESDCaloCluster*)clusters->At(icls);
200 totClustersFilewithprob+=icls;
201 totClustersAllwithprob+=icls;
202 totE += cluster->E();
203 fHistEnergy->Fill(cluster->E());
205 tabposition[icls] = new Float_t[3];
206 cluster->GetPosition(tabposition[icls]);
207 tabenergy[icls] = cluster->E();
209 TotalCells += cluster -> GetNCells();
210 fHistNcells->Fill(cluster -> GetNCells());
211 fHistCellsEnergy->Fill(cluster -> GetNCells(),cluster->E());
212 TotEnergy += cluster->E();
216 fHistNcellsPercentage->Fill(100*(TotalCells/TotalCellsPHOS));
217 fHistNclusterTotE->Fill(TotEnergy,Nclusters);
218 fHistNcellsSumCells->Fill(TotalCells,TotalCellsPHOS);
221 fHistTotEnergy->Fill(totE);
223 for(Int_t ipho = 0; ipho<(ncls-1) ; ipho++)
225 for(Int_t jpho = ipho+1 ; jpho<ncls ; jpho++)
227 // Calcul of the theta angle between two photons
228 theta =(2* asin(0.5*TMath::Sqrt((tabposition[ipho][0]-tabposition[jpho][0])*(tabposition[ipho][0]-tabposition[jpho][0]) +(tabposition[ipho][1]-tabposition[jpho][1])*(tabposition[ipho][1]-tabposition[jpho][1]))/460));
230 // Calcul of the mass m of the pion
231 m =(TMath::Sqrt(2 * tabenergy[ipho]* tabenergy[jpho]*(1-TMath::Cos(theta))));
232 fHistTwoClusterInvMass->Fill(m);
236 for(Int_t j=0 ; j<ncls;j++)
238 delete[] tabposition[j];
241 delete[] tabposition;