]>
Commit | Line | Data |
---|---|---|
9bf87c6f | 1 | /************************************************************************** |
2 | * This file is property of and copyright by the ALICE HLT Project * | |
3 | * All rights reserved. * | |
4 | * * | |
5 | * Primary Authors: Oystein Djuvsland * | |
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 AliHLTPHOSHistogramProducer.cxx | |
18 | * @author Oystein Djuvsland | |
19 | * @date | |
20 | * @brief Histogram producer for PHOS HLT | |
21 | */ | |
22 | ||
23 | // see header file for class documentation | |
24 | // or | |
25 | // refer to README to build package | |
26 | // or | |
27 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
28 | ||
29 | #include "AliHLTPHOSHistogramProducer.h" | |
9f050726 | 30 | //#include "AliHLTPHOSBase.h" |
9bf87c6f | 31 | #include "AliHLTPHOSCaloClusterContainerStruct.h" |
7fc04b67 | 32 | #include "AliHLTCaloClusterDataStruct.h" |
9bf87c6f | 33 | |
34 | #include "TH1D.h" | |
35 | #include "TNtuple.h" | |
36 | ||
37 | AliHLTPHOSHistogramProducer::AliHLTPHOSHistogramProducer(): | |
9f050726 | 38 | // AliHLTPHOSBase(), |
9bf87c6f | 39 | fClusterEnergiesHistPtr(0), |
40 | fMultiplicitiesHistPtr(0), | |
41 | fClusterNtuplePtr(0), | |
42 | fFillClusterEnergies(false), | |
43 | fFillMultiplicities(false), | |
44 | fFillNtuple(false), | |
45 | fMaxNtupleEntries(1000000000) | |
46 | { | |
47 | //comment | |
48 | } | |
49 | ||
50 | AliHLTPHOSHistogramProducer::~AliHLTPHOSHistogramProducer() | |
51 | { | |
52 | //comment | |
53 | if(fClusterEnergiesHistPtr) | |
54 | { | |
55 | delete fClusterEnergiesHistPtr; | |
56 | fClusterEnergiesHistPtr = 0; | |
57 | } | |
58 | if(fMultiplicitiesHistPtr) | |
59 | { | |
60 | delete fMultiplicitiesHistPtr; | |
61 | fMultiplicitiesHistPtr = 0; | |
62 | } | |
63 | if(fClusterNtuplePtr) | |
64 | { | |
65 | delete fClusterNtuplePtr; | |
66 | fClusterNtuplePtr = 0; | |
67 | } | |
68 | } | |
69 | ||
70 | Int_t | |
71 | AliHLTPHOSHistogramProducer::Fill(AliHLTPHOSCaloClusterContainerStruct* clusterContainerPtr) | |
72 | { | |
73 | //comment | |
7fc04b67 | 74 | AliHLTCaloClusterDataStruct* tmpClusterPtr = 0; |
9bf87c6f | 75 | |
fc7132e2 | 76 | for(UInt_t i = 0; i < clusterContainerPtr->fNCaloClusters; i++) |
9bf87c6f | 77 | { |
78 | tmpClusterPtr = &(clusterContainerPtr->fCaloClusterArray[i]); | |
79 | if(fFillClusterEnergies) | |
80 | { | |
81 | fClusterEnergiesHistPtr->Fill(tmpClusterPtr->fEnergy); | |
82 | } | |
83 | if(fFillMultiplicities) | |
84 | { | |
85 | fMultiplicitiesHistPtr->Fill(tmpClusterPtr->fNCells); | |
86 | } | |
87 | if(fFillNtuple) | |
88 | { | |
89 | if(fClusterNtuplePtr->GetEntries() > fMaxNtupleEntries) | |
90 | { | |
91 | delete fClusterNtuplePtr; | |
92 | fClusterNtuplePtr = new TNtuple("cluster_ntuple", "Cluster Ntuple", "energy:multiplicity:x:y:z"); | |
93 | } | |
94 | fClusterNtuplePtr->Fill(tmpClusterPtr->fEnergy, tmpClusterPtr->fNCells, tmpClusterPtr->fGlobalPos[0], tmpClusterPtr->fGlobalPos[1], tmpClusterPtr->fGlobalPos[2]); | |
95 | } | |
96 | } | |
97 | return 0; | |
98 | } | |
99 | ||
100 | Int_t | |
101 | AliHLTPHOSHistogramProducer::InitializeObjects() | |
102 | { | |
103 | //comment | |
104 | if(fFillClusterEnergies) | |
105 | { | |
106 | fClusterEnergiesHistPtr = new TH1D("energy_dist", "Energy spectrum - all clusters", 2000, 0, 99); | |
107 | } | |
108 | if(fFillMultiplicities) | |
109 | { | |
110 | fMultiplicitiesHistPtr = new TH1D("multiplicity_dist", "Multiplicities - all clusters", 100, 0, 99); | |
111 | } | |
112 | if(fFillNtuple) | |
113 | { | |
114 | fClusterNtuplePtr = new TNtuple("cluster_ntuple", "Cluster Ntuple", "energy:multiplicity:x:y:z"); | |
115 | } | |
116 | return 0; | |
117 | } |