1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
5 * Primary Authors: Francesco Blanco *
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 AliHLTEMCALClusterMonitor.cxx
18 * @author Francesco Blanco
20 * @brief Online Monitoring Histogram maker for EMCAL
24 #include "AliHLTEMCALClusterMonitor.h"
25 #include "AliHLTCaloSharedMemoryInterfacev2.h"
28 ClassImp(AliHLTEMCALClusterMonitor);
30 AliHLTEMCALClusterMonitor::AliHLTEMCALClusterMonitor():
36 hClusterEneVsCells(0),
40 // See header file for documentation
42 fClusterReaderPtr = new AliHLTCaloClusterReader();
45 hList = new TObjArray;
47 hClusterEne = new TH1F("hClusterEne", "ClusterEnergy (GeV)", 200, 0, 100);
48 hList->Add(hClusterEne);
50 hClusterEneVsTime = new TH2F("hClusterEneVsTime", "ClusterEnergy vs Time", 200, 0, 100, 40, -0.5, 39.5);
51 hList->Add(hClusterEneVsTime);
53 hClusterCells = new TH1I("hClusterCells", "# of cells per cluster", 50, -0.5, 49.5);
54 hList->Add(hClusterCells);
56 hClusterEneVsCells = new TH2F("hClusterEneCells", "# of cells per cluster vs cluster energy", 200, 0, 100, 50, -0.5, 49.5);
57 hList->Add(hClusterEneVsCells);
59 hClusterEtaVsPhi = new TH2F("hClusterEtaVsPhi", "Cluster position in #eta#phi", 100, -0.7, 0.7, 100, 1.38, 3.15);
60 hClusterEtaVsPhi->GetXaxis()->SetTitle("#eta");
61 hClusterEtaVsPhi->GetYaxis()->SetTitle("#phi");
62 hList->Add(hClusterEtaVsPhi);
67 AliHLTEMCALClusterMonitor::~AliHLTEMCALClusterMonitor()
69 //See header file for documentation
72 // Pointer to histograms objects
73 TObjArray* AliHLTEMCALClusterMonitor::GetHistograms()
79 Int_t AliHLTEMCALClusterMonitor::MakeHisto(AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr)
83 // Pointer to Cluster struture
84 AliHLTCaloClusterDataStruct* caloClusterStructPtr = 0;
86 float clusterEne, clusterTime, clusterEta, clusterPhi, clusterX, clusterY, clusterZ;
88 if (caloClusterHeaderPtr) {
90 // stuff to handle clusters here
91 fClusterReaderPtr->SetMemory(caloClusterHeaderPtr);
93 while((caloClusterStructPtr = fClusterReaderPtr->NextCluster()) != 0) {
94 clusterX = caloClusterStructPtr->fGlobalPos[0];
95 clusterY = caloClusterStructPtr->fGlobalPos[1];
96 clusterZ = caloClusterStructPtr->fGlobalPos[2];
98 nCells = caloClusterStructPtr->fNCells;
99 clusterEne = caloClusterStructPtr->fEnergy;
100 clusterTime = caloClusterStructPtr->fTOF;
101 hClusterEne->Fill(clusterEne);
102 hClusterEneVsTime->Fill(clusterEne, clusterTime);
103 hClusterCells->Fill(nCells);
104 hClusterEneVsCells->Fill(clusterEne, nCells);
105 float r = TMath::Sqrt(clusterX*clusterX + clusterY*clusterY + clusterZ*clusterZ);
106 clusterEta = 0.5*TMath::Log( (r+clusterZ)/(r-clusterZ) );
107 clusterPhi = TMath::ATan2(clusterY, clusterX);
108 hClusterEtaVsPhi->Fill(clusterEta, clusterPhi);