Line data Source code
1 : /**************************************************************************
2 : * This file is property of and copyright by the ALICE HLT Project *
3 : * All rights reserved. *
4 : * *
5 : * Primary Authors: Francesco Blanco *
6 : * *
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 : **************************************************************************/
15 :
16 : /**
17 : * @file AliHLTEMCALClusterMonitor.cxx
18 : * @author Francesco Blanco
19 : * @date
20 : * @brief Online Monitoring Histogram maker for EMCAL
21 : */
22 :
23 :
24 : #include "AliHLTEMCALClusterMonitor.h"
25 : #include "AliHLTCaloSharedMemoryInterfacev2.h"
26 : #include "TMath.h"
27 :
28 6 : ClassImp(AliHLTEMCALClusterMonitor);
29 :
30 0 : AliHLTEMCALClusterMonitor::AliHLTEMCALClusterMonitor():
31 0 : fClusterReaderPtr(0),
32 0 : hList(0),
33 0 : hClusterEne(0),
34 0 : hClusterEneVsTime(0),
35 0 : hClusterCells(0),
36 0 : hClusterEneVsCells(0),
37 0 : hClusterEtaVsPhi(0)
38 :
39 0 : {
40 : // See header file for documentation
41 :
42 0 : fClusterReaderPtr = new AliHLTCaloClusterReader();
43 :
44 : // Booking histograms
45 0 : hList = new TObjArray;
46 :
47 0 : hClusterEne = new TH1F("hClusterEne", "ClusterEnergy (GeV)", 200, 0, 100);
48 0 : hList->Add(hClusterEne);
49 :
50 0 : hClusterEneVsTime = new TH2F("hClusterEneVsTime", "ClusterEnergy vs Time", 200, 0, 100, 40, -0.5, 39.5);
51 0 : hList->Add(hClusterEneVsTime);
52 :
53 0 : hClusterCells = new TH1I("hClusterCells", "# of cells per cluster", 50, -0.5, 49.5);
54 0 : hList->Add(hClusterCells);
55 :
56 0 : hClusterEneVsCells = new TH2F("hClusterEneCells", "# of cells per cluster vs cluster energy", 200, 0, 100, 50, -0.5, 49.5);
57 0 : hList->Add(hClusterEneVsCells);
58 :
59 0 : hClusterEtaVsPhi = new TH2F("hClusterEtaVsPhi", "Cluster position in #eta#phi", 100, -0.7, 0.7, 100, 1.38, 3.15);
60 0 : hClusterEtaVsPhi->GetXaxis()->SetTitle("#eta");
61 0 : hClusterEtaVsPhi->GetYaxis()->SetTitle("#phi");
62 0 : hList->Add(hClusterEtaVsPhi);
63 :
64 :
65 0 : }
66 :
67 : AliHLTEMCALClusterMonitor::~AliHLTEMCALClusterMonitor()
68 0 : {
69 : //See header file for documentation
70 0 : }
71 :
72 : // Pointer to histograms objects
73 : TObjArray* AliHLTEMCALClusterMonitor::GetHistograms()
74 : {
75 0 : return hList;
76 : }
77 :
78 :
79 : Int_t AliHLTEMCALClusterMonitor::MakeHisto(AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr)
80 : {
81 :
82 : // Cluster variables
83 : // Pointer to Cluster struture
84 : AliHLTCaloClusterDataStruct* caloClusterStructPtr = 0;
85 :
86 : float clusterEne, clusterTime, clusterEta, clusterPhi, clusterX, clusterY, clusterZ;
87 : int nCells;
88 0 : if (caloClusterHeaderPtr) {
89 :
90 : // stuff to handle clusters here
91 0 : fClusterReaderPtr->SetMemory(caloClusterHeaderPtr);
92 :
93 0 : while((caloClusterStructPtr = fClusterReaderPtr->NextCluster()) != 0) {
94 0 : clusterX = caloClusterStructPtr->fGlobalPos[0];
95 0 : clusterY = caloClusterStructPtr->fGlobalPos[1];
96 0 : clusterZ = caloClusterStructPtr->fGlobalPos[2];
97 :
98 0 : nCells = caloClusterStructPtr->fNCells;
99 0 : clusterEne = caloClusterStructPtr->fEnergy;
100 0 : clusterTime = caloClusterStructPtr->fTOF;
101 0 : hClusterEne->Fill(clusterEne);
102 0 : hClusterEneVsTime->Fill(clusterEne, clusterTime);
103 0 : hClusterCells->Fill(nCells);
104 0 : hClusterEneVsCells->Fill(clusterEne, nCells);
105 0 : float r = TMath::Sqrt(clusterX*clusterX + clusterY*clusterY + clusterZ*clusterZ);
106 0 : clusterEta = 0.5*TMath::Log( (r+clusterZ)/(r-clusterZ) );
107 0 : clusterPhi = TMath::ATan2(clusterY, clusterX);
108 0 : hClusterEtaVsPhi->Fill(clusterEta, clusterPhi);
109 :
110 : }
111 :
112 : }
113 :
114 0 : return 0;
115 : }
|