]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/AliHLTPHOSESDMaker.cxx
Updating CMake files
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSESDMaker.cxx
CommitLineData
5f96dd31 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
7a09cd3d 16
5f96dd31 17/**
18 * @file AliHLTPHOSESDMaker.cxx
19 * @author Oystein Djuvsland
20 * @date
21 * @brief ESD maker for PHOS HLT
22 */
23
24// see header file for class documentation
25// or
26// refer to README to build package
27// or
28// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
29
30#include "AliHLTPHOSESDMaker.h"
31#include "AliHLTPHOSCaloClusterContainerStruct.h"
32#include "AliHLTPHOSBase.h"
33#include "AliHLTPHOSCaloClusterDataStruct.h"
34#include "AliESDEvent.h"
35#include "AliESDCaloCluster.h"
36#include "TClonesArray.h"
37
38ClassImp(AliHLTPHOSESDMaker);
39
40AliHLTPHOSESDMaker::AliHLTPHOSESDMaker() :
41 AliHLTPHOSBase(),
42 fNCaloClusters(0),
43 fCaloClustersPtr(0),
44 fESDEventPtr(0),
45 fCaloClusterContainerPtr(0)
46{
47 //See header file for documentation
48 fCaloClustersPtr = new TClonesArray("AliESDCaloCluster", 0);
49}
50
51AliHLTPHOSESDMaker::~AliHLTPHOSESDMaker()
52{
53 //See header file for documentation
54 if(fCaloClustersPtr)
55 {
25b7f84c 56 //fCaloClustersPtr->Delete();
57 //fCaloClustersPtr = 0;
5f96dd31 58 }
59}
60
61Int_t
62AliHLTPHOSESDMaker::FillESDCaloClusters()
63{
64 //See header file for documentation
65
66 AliESDCaloCluster *caloCluster = 0;
67 AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
68
25b7f84c 69 for(UInt_t i = 0; i < fCaloClusterContainerPtr->fNCaloClusters; i++)
5f96dd31 70 {
71 caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->At(i + fNCaloClusters);
72 caloClusterStruct = &(fCaloClusterContainerPtr->fCaloClusterArray[i]);
73 caloCluster->SetID(caloClusterStruct->fID);
74 caloCluster->SetClusterType(caloClusterStruct->fClusterType);
75 caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
76 caloCluster->SetE(caloClusterStruct->fEnergy);
77 caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
78 caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
79 caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
80 caloCluster->SetM20(caloClusterStruct->fM20);
81 caloCluster->SetM02(caloClusterStruct->fM02);
7a09cd3d 82 // PT caloCluster->SetM11(caloClusterStruct->fM11);
5f96dd31 83 caloCluster->SetNExMax(caloClusterStruct->fNExMax);
84 caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
85 caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
86 caloCluster->SetNCells(caloClusterStruct->fNCells);
87 caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
88 caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
89 fNCaloClusters++;
90 }
91
92 return 0;
93}
94
95Int_t
96AliHLTPHOSESDMaker::FillESDEvent()
97{
98 //See header file for documentation
99
100 AliESDCaloCluster *caloCluster = 0;
101 AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
25b7f84c 102 for(UInt_t i = 0; i < fCaloClusterContainerPtr->fNCaloClusters; i++)
5f96dd31 103 {
104 // caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
105 caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i);
106 caloClusterStruct = &(fCaloClusterContainerPtr->fCaloClusterArray[i]);
8efbf5fe 107
5f96dd31 108 caloCluster->SetID(caloClusterStruct->fID);
109 caloCluster->SetClusterType(caloClusterStruct->fClusterType);
110 caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
111 caloCluster->SetE(caloClusterStruct->fEnergy);
112 caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
113 caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
114 caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
115 caloCluster->SetM20(caloClusterStruct->fM20);
3fcd6b6e 116 caloCluster->SetM02(caloClusterStruct->fM02);
7a09cd3d 117 // caloCluster->SetM11(caloClusterStruct->fM11);
5f96dd31 118 caloCluster->SetNExMax(caloClusterStruct->fNExMax);
119 caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
120 caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
121 caloCluster->SetNCells(caloClusterStruct->fNCells);
122 caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
123 caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
124 fESDEventPtr->AddCaloCluster(caloCluster);
5f96dd31 125 fNCaloClusters++;
126 }
127
128 return 0;
129}
25b7f84c 130Int_t
131AliHLTPHOSESDMaker::FillESDEvent(AliHLTPHOSCaloClusterContainerStruct* caloClusterContainerPtr)
132{
133 //See header file for documentation
134
94594220 135 AliESDCaloCluster *caloCluster = 0;
136 AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
25b7f84c 137
94594220 138 //cout << "ESD: # of clusters: " << caloClusterContainerPtr->fNCaloClusters << endl;
139 for(UInt_t i = 0; i < caloClusterContainerPtr->fNCaloClusters; i++)
25b7f84c 140 {
94594220 141 caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
142 caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
143 caloClusterStruct = &(caloClusterContainerPtr->fCaloClusterArray[i]);
25b7f84c 144 caloCluster->SetID(caloClusterStruct->fID);
145 caloCluster->SetClusterType(caloClusterStruct->fClusterType);
94594220 146 // caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
147 caloCluster->SetPosition((Float_t*)caloClusterStruct->fGlobalPos);
25b7f84c 148 caloCluster->SetE(caloClusterStruct->fEnergy);
94594220 149 // cout << "\t\t ESD: Cluster energy: " << caloClusterStruct->fEnergy << endl;
150// cout << "\t\t ESD: Position: x = " << caloClusterStruct->fGlobalPos[0] << " - y = " << caloClusterStruct->fGlobalPos[1] << " - z = " << caloClusterStruct->fGlobalPos[2] << endl;
25b7f84c 151 caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
152 caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
153 caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
154 caloCluster->SetM20(caloClusterStruct->fM20);
155 caloCluster->SetM02(caloClusterStruct->fM02);
25b7f84c 156 caloCluster->SetNExMax(caloClusterStruct->fNExMax);
157 caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
158 caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
159 caloCluster->SetNCells(caloClusterStruct->fNCells);
160 caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
161 caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
162 fESDEventPtr->AddCaloCluster(caloCluster);
94594220 163
25b7f84c 164 fNCaloClusters++;
165 }
166
167 return 0;
168}
5f96dd31 169
170void
171AliHLTPHOSESDMaker::ResetESD()
172{
173 fNCaloClusters = 0;
25b7f84c 174 // fCaloClustersPtr->Delete();
5f96dd31 175}
176