]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/AliHLTPHOSHistogramProducer.cxx
New production macros (Yves)
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSHistogramProducer.cxx
CommitLineData
1b41ab20 1// $Id$
2
9bf87c6f 3/**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * All rights reserved. *
6 * *
7 * Primary Authors: Oystein Djuvsland *
8 * *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
17
18/**
19 * @file AliHLTPHOSHistogramProducer.cxx
20 * @author Oystein Djuvsland
21 * @date
22 * @brief Histogram producer for PHOS HLT
23 */
24
25// see header file for class documentation
26// or
27// refer to README to build package
28// or
29// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
30
31#include "AliHLTPHOSHistogramProducer.h"
32#include "AliHLTPHOSBase.h"
33#include "AliHLTPHOSCaloClusterContainerStruct.h"
34#include "AliHLTPHOSCaloClusterDataStruct.h"
35
36#include "TH1D.h"
37#include "TNtuple.h"
38
39AliHLTPHOSHistogramProducer::AliHLTPHOSHistogramProducer():
40 AliHLTPHOSBase(),
41 fClusterEnergiesHistPtr(0),
42 fMultiplicitiesHistPtr(0),
43 fClusterNtuplePtr(0),
44 fFillClusterEnergies(false),
45 fFillMultiplicities(false),
46 fFillNtuple(false),
47 fMaxNtupleEntries(1000000000)
48{
49 //comment
50}
51
52AliHLTPHOSHistogramProducer::~AliHLTPHOSHistogramProducer()
53{
54 //comment
55 if(fClusterEnergiesHistPtr)
56 {
57 delete fClusterEnergiesHistPtr;
58 fClusterEnergiesHistPtr = 0;
59 }
60 if(fMultiplicitiesHistPtr)
61 {
62 delete fMultiplicitiesHistPtr;
63 fMultiplicitiesHistPtr = 0;
64 }
65 if(fClusterNtuplePtr)
66 {
67 delete fClusterNtuplePtr;
68 fClusterNtuplePtr = 0;
69 }
70}
71
72Int_t
73AliHLTPHOSHistogramProducer::Fill(AliHLTPHOSCaloClusterContainerStruct* clusterContainerPtr)
74{
75 //comment
76 AliHLTPHOSCaloClusterDataStruct* tmpClusterPtr = 0;
77
fc7132e2 78 for(UInt_t i = 0; i < clusterContainerPtr->fNCaloClusters; i++)
9bf87c6f 79 {
80 tmpClusterPtr = &(clusterContainerPtr->fCaloClusterArray[i]);
81 if(fFillClusterEnergies)
82 {
83 fClusterEnergiesHistPtr->Fill(tmpClusterPtr->fEnergy);
84 }
85 if(fFillMultiplicities)
86 {
87 fMultiplicitiesHistPtr->Fill(tmpClusterPtr->fNCells);
88 }
89 if(fFillNtuple)
90 {
91 if(fClusterNtuplePtr->GetEntries() > fMaxNtupleEntries)
92 {
93 delete fClusterNtuplePtr;
94 fClusterNtuplePtr = new TNtuple("cluster_ntuple", "Cluster Ntuple", "energy:multiplicity:x:y:z");
95 }
96 fClusterNtuplePtr->Fill(tmpClusterPtr->fEnergy, tmpClusterPtr->fNCells, tmpClusterPtr->fGlobalPos[0], tmpClusterPtr->fGlobalPos[1], tmpClusterPtr->fGlobalPos[2]);
97 }
98 }
99 return 0;
100}
101
102Int_t
103AliHLTPHOSHistogramProducer::InitializeObjects()
104{
105 //comment
106 if(fFillClusterEnergies)
107 {
108 fClusterEnergiesHistPtr = new TH1D("energy_dist", "Energy spectrum - all clusters", 2000, 0, 99);
109 }
110 if(fFillMultiplicities)
111 {
112 fMultiplicitiesHistPtr = new TH1D("multiplicity_dist", "Multiplicities - all clusters", 100, 0, 99);
113 }
114 if(fFillNtuple)
115 {
116 fClusterNtuplePtr = new TNtuple("cluster_ntuple", "Cluster Ntuple", "energy:multiplicity:x:y:z");
117 }
118 return 0;
119}