1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
5 * Primary Authors: Oystein Djuvsland *
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 AliHLTPHOSHistogramProducer.cxx
18 * @author Oystein Djuvsland
20 * @brief Histogram producer for PHOS HLT
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 "AliHLTPHOSHistogramProducer.h"
30 //#include "AliHLTPHOSBase.h"
31 #include "AliHLTPHOSCaloClusterContainerStruct.h"
32 #include "AliHLTCaloClusterDataStruct.h"
37 AliHLTPHOSHistogramProducer::AliHLTPHOSHistogramProducer():
39 fClusterEnergiesHistPtr(0),
40 fMultiplicitiesHistPtr(0),
42 fFillClusterEnergies(false),
43 fFillMultiplicities(false),
45 fMaxNtupleEntries(1000000000)
50 AliHLTPHOSHistogramProducer::~AliHLTPHOSHistogramProducer()
53 if(fClusterEnergiesHistPtr)
55 delete fClusterEnergiesHistPtr;
56 fClusterEnergiesHistPtr = 0;
58 if(fMultiplicitiesHistPtr)
60 delete fMultiplicitiesHistPtr;
61 fMultiplicitiesHistPtr = 0;
65 delete fClusterNtuplePtr;
66 fClusterNtuplePtr = 0;
71 AliHLTPHOSHistogramProducer::Fill(AliHLTPHOSCaloClusterContainerStruct* clusterContainerPtr)
74 AliHLTCaloClusterDataStruct* tmpClusterPtr = 0;
76 for(UInt_t i = 0; i < clusterContainerPtr->fNCaloClusters; i++)
78 tmpClusterPtr = &(clusterContainerPtr->fCaloClusterArray[i]);
79 if(fFillClusterEnergies)
81 fClusterEnergiesHistPtr->Fill(tmpClusterPtr->fEnergy);
83 if(fFillMultiplicities)
85 fMultiplicitiesHistPtr->Fill(tmpClusterPtr->fNCells);
89 if(fClusterNtuplePtr->GetEntries() > fMaxNtupleEntries)
91 delete fClusterNtuplePtr;
92 fClusterNtuplePtr = new TNtuple("cluster_ntuple", "Cluster Ntuple", "energy:multiplicity:x:y:z");
94 fClusterNtuplePtr->Fill(tmpClusterPtr->fEnergy, tmpClusterPtr->fNCells, tmpClusterPtr->fGlobalPos[0], tmpClusterPtr->fGlobalPos[1], tmpClusterPtr->fGlobalPos[2]);
101 AliHLTPHOSHistogramProducer::InitializeObjects()
104 if(fFillClusterEnergies)
106 fClusterEnergiesHistPtr = new TH1D("energy_dist", "Energy spectrum - all clusters", 2000, 0, 99);
108 if(fFillMultiplicities)
110 fMultiplicitiesHistPtr = new TH1D("multiplicity_dist", "Multiplicities - all clusters", 100, 0, 99);
114 fClusterNtuplePtr = new TNtuple("cluster_ntuple", "Cluster Ntuple", "energy:multiplicity:x:y:z");