]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/AliHLTPHOSHistoProdClusterEnergy.cxx
Fixing comments
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSHistoProdClusterEnergy.cxx
CommitLineData
844d7fdd 1
2/**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * All rights reserved. *
5 * *
6 * Primary Authors: Albin Gaignette
7 * *
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 **************************************************************************/
16
17/**
87b87810 18 * @file AliHLTPHOSHistoProdClusterEnergy
19 * @author Albin Gaignette & Svein Lindal
844d7fdd 20 * @date
87b87810 21 * @brief Produces histograms of cluster energy distributions
844d7fdd 22 */
23
24// see header file for class documentation
25// or
26// refer to README to build package
27// or
28// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
29
87b87810 30#include "AliHLTPHOSHistoProdClusterEnergy.h"
844d7fdd 31//#include "AliESDCaloCluster.h"
32#include "TMath.h"
33
34#include "AliHLTCaloClusterDataStruct.h"
35#include "AliHLTCaloClusterReader.h"
36#include "TObjArray.h"
37//#include "TClonesArray.h"
38//#include <iostream>
39#include "TH1F.h"
87b87810 40#include "TH2F.h"
844d7fdd 41
87b87810 42AliHLTPHOSHistoProdClusterEnergy::AliHLTPHOSHistoProdClusterEnergy() :
844d7fdd 43 fClusterReader(NULL),
87b87810 44 fHistClusterEnergy(NULL),
45 fHistClusterEnergyVsNCells(NULL),
46 fHistArrayPtr(NULL)
844d7fdd 47{
48 // See header file for documentation
49 fHistArrayPtr = new TObjArray;
50 fClusterReader = new AliHLTCaloClusterReader();
51
87b87810 52 fHistClusterEnergy = new TH1F("fHistClusterEnergy", "Distribution of total energy in clusters", 200, 0, 1);
53 fHistClusterEnergy->GetXaxis()->SetTitle("E GeV");
54 fHistClusterEnergy->GetYaxis()->SetTitle("Number of counts");
55 fHistClusterEnergy->SetMarkerStyle(21);
56 fHistArrayPtr->AddLast(fHistClusterEnergy);
57
58 fHistClusterEnergyVsNCells = new TH2F("fHistClusterEnergyVsNCells", "Distribution of Energy vs Number of Cells in cluster", 200, 0, 200, 50, 0 , 50);
59 fHistClusterEnergyVsNCells->GetXaxis()->SetTitle("Energy in cluster (GeV)");
60 fHistClusterEnergyVsNCells->GetYaxis()->SetTitle("Number of Cells in cluster");
61 fHistClusterEnergyVsNCells->SetMarkerStyle(21);
62 fHistArrayPtr->AddLast(fHistClusterEnergyVsNCells);
63
64
844d7fdd 65}
66
87b87810 67AliHLTPHOSHistoProdClusterEnergy::~AliHLTPHOSHistoProdClusterEnergy()
844d7fdd 68{
87b87810 69 if(fHistClusterEnergy){
70 delete fHistClusterEnergy;
71 fHistClusterEnergy = 0;
844d7fdd 72 }
73}
74
87b87810 75TObjArray* AliHLTPHOSHistoProdClusterEnergy::GetHistograms()
844d7fdd 76{
77 // See header file for documentation
78
79 return fHistArrayPtr;
80}
81
87b87810 82Int_t AliHLTPHOSHistoProdClusterEnergy::DoEvent(AliHLTCaloClusterHeaderStruct* cHeader) {
844d7fdd 83
84 fClusterReader->SetMemory(cHeader);
85
86 int ncls = cHeader->fNClusters;
87 Float_t* cPos[ncls];
88 Float_t cEnergy[ncls];
89
90 AliHLTCaloClusterDataStruct* cluster;
91 Int_t icls = 0;
92 while ( ( cluster = fClusterReader->NextCluster() ) ) {
93
94 cPos[icls] = cluster->fGlobalPos;
95 cEnergy[icls] = cluster->fEnergy;
96
97 icls++;
98 }
99
100 for(Int_t ipho = 0; ipho<(ncls-1); ipho++) {
101 for(Int_t jpho = ipho+1 ; jpho<ncls ; jpho++) {
102 // Calcul of the theta angle between two photons
103 Double_t theta = (2* asin(0.5*TMath::Sqrt((cPos[ipho][0]-cPos[jpho][0])*(cPos[ipho][0]-cPos[jpho][0]) +(cPos[ipho][1]-cPos[jpho][1])*(cPos[ipho][1]-cPos[jpho][1]))/460));
104
105 // Calcul of the mass m of the pion
106 Double_t m =(TMath::Sqrt(2 * cEnergy[ipho]* cEnergy[jpho]*(1-TMath::Cos(theta))));
107
87b87810 108 fHistClusterEnergy->Fill(m);
844d7fdd 109 }
110 }
111
112 return 0;
113}
114
115
116
117