1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
5 * Primary Authors: Albin Gaignette, Svein Lindal slindal@fys.uio.no *
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 **************************************************************************/
17 * @file AliHLTCaloHistoCellEnergy.cxx
18 * @author Svein Lindal
20 * @brief Produces histograms of cluster energy distributions
23 // see header file for class documentation
25 // refer to README to build package
27 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
29 #include "AliHLTCaloHistoCellEnergy.h"
30 #include "TObjArray.h"
33 #include "TRefArray.h"
35 #include "AliESDCaloCluster.h"
37 ClassImp(AliHLTCaloHistoCellEnergy);
39 AliHLTCaloHistoCellEnergy::AliHLTCaloHistoCellEnergy(TString det) :
40 fHistCellEnergy(NULL),
41 fHistCellEnergyVsNCells(NULL),
44 // See header file for documentation
45 fHistArrayPtr = new TObjArray;
47 fHistCellEnergy = new TH1F(Form("%s fHistCellEnergy", det.Data()), Form("%s Distribution of total energy in clusters", det.Data()), 200, 0, 1);
48 fHistCellEnergy->GetXaxis()->SetTitle("E GeV");
49 fHistCellEnergy->GetYaxis()->SetTitle("Number of counts");
50 fHistCellEnergy->SetMarkerStyle(21);
51 fHistArrayPtr->AddLast(fHistCellEnergy);
53 fHistCellEnergyVsNCells = new TH2F(Form("%s fHistCellEnergyVsNCells", det.Data()), Form("%s Distribution of Energy vs Number of Cells in cluster", det.Data()), 200, 0, 200, 50, 0 , 50);
54 fHistCellEnergyVsNCells->GetXaxis()->SetTitle("Energy in cluster (GeV)");
55 fHistCellEnergyVsNCells->GetYaxis()->SetTitle("Number of Cells in cluster");
56 fHistCellEnergyVsNCells->SetMarkerStyle(21);
57 fHistArrayPtr->AddLast(fHistCellEnergyVsNCells);
61 AliHLTCaloHistoCellEnergy::~AliHLTCaloHistoCellEnergy()
63 //See header file for documentation
66 delete fHistCellEnergy;
67 fHistCellEnergy = NULL;
69 if(fHistCellEnergyVsNCells)
70 delete fHistCellEnergyVsNCells;
71 fHistCellEnergyVsNCells = NULL;
79 TObjArray* AliHLTCaloHistoCellEnergy::GetHistograms()
81 // See header file for documentation
86 Int_t AliHLTCaloHistoCellEnergy::FillHistograms(Int_t nc, TRefArray * clustersArray) {
88 for(int ic = 0; ic < nc; ic++) {
89 AliESDCaloCluster * cluster = static_cast<AliESDCaloCluster*>(clustersArray->At(ic));
90 for(int i = 0; i < cluster->GetNCells(); i++) {
91 fHistCellEnergyVsNCells->Fill(cluster->GetNCells(), cluster->GetCellAmplitudeFraction(i));
92 fHistCellEnergy->Fill(cluster->GetCellAmplitudeFraction(i));