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 AliHLTPHOSESDMaker.cxx
18 * @author Oystein Djuvsland
20 * @brief ESD maker 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 "AliHLTPHOSESDMaker.h"
30 #include "AliHLTPHOSCaloClusterContainerStruct.h"
31 #include "AliHLTPHOSBase.h"
32 #include "AliHLTPHOSCaloClusterDataStruct.h"
33 #include "AliESDEvent.h"
34 #include "AliESDCaloCluster.h"
35 #include "TClonesArray.h"
37 ClassImp(AliHLTPHOSESDMaker);
39 AliHLTPHOSESDMaker::AliHLTPHOSESDMaker() :
44 fCaloClusterContainerPtr(0)
46 //See header file for documentation
47 fCaloClustersPtr = new TClonesArray("AliESDCaloCluster", 0);
50 AliHLTPHOSESDMaker::~AliHLTPHOSESDMaker()
52 //See header file for documentation
55 //fCaloClustersPtr->Delete();
56 //fCaloClustersPtr = 0;
61 AliHLTPHOSESDMaker::FillESDCaloClusters()
63 //See header file for documentation
65 AliESDCaloCluster *caloCluster = 0;
66 AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
68 for(UInt_t i = 0; i < fCaloClusterContainerPtr->fNCaloClusters; i++)
70 caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->At(i + fNCaloClusters);
71 caloClusterStruct = &(fCaloClusterContainerPtr->fCaloClusterArray[i]);
72 caloCluster->SetID(caloClusterStruct->fID);
73 caloCluster->SetClusterType(caloClusterStruct->fClusterType);
74 caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
75 caloCluster->SetE(caloClusterStruct->fEnergy);
76 caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
77 caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
78 caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
79 caloCluster->SetM20(caloClusterStruct->fM20);
80 caloCluster->SetM02(caloClusterStruct->fM02);
81 caloCluster->SetM11(caloClusterStruct->fM11);
82 caloCluster->SetNExMax(caloClusterStruct->fNExMax);
83 caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
84 caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
85 caloCluster->SetNCells(caloClusterStruct->fNCells);
86 caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
87 caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
95 AliHLTPHOSESDMaker::FillESDEvent()
97 //See header file for documentation
99 AliESDCaloCluster *caloCluster = 0;
100 AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
101 for(UInt_t i = 0; i < fCaloClusterContainerPtr->fNCaloClusters; i++)
103 // caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
104 caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i);
105 caloClusterStruct = &(fCaloClusterContainerPtr->fCaloClusterArray[i]);
107 caloCluster->SetID(caloClusterStruct->fID);
108 caloCluster->SetClusterType(caloClusterStruct->fClusterType);
109 caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
110 caloCluster->SetE(caloClusterStruct->fEnergy);
111 caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
112 caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
113 caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
114 caloCluster->SetM20(caloClusterStruct->fM20);
115 caloCluster->SetM02(caloClusterStruct->fM02);
116 caloCluster->SetM11(caloClusterStruct->fM11);
117 caloCluster->SetNExMax(caloClusterStruct->fNExMax);
118 caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
119 caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
120 caloCluster->SetNCells(caloClusterStruct->fNCells);
121 caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
122 caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
123 fESDEventPtr->AddCaloCluster(caloCluster);
130 AliHLTPHOSESDMaker::FillESDEvent(AliHLTPHOSCaloClusterContainerStruct* caloClusterContainerPtr)
132 //See header file for documentation
134 caloClusterContainerPtr--;
135 caloClusterContainerPtr++;
137 // AliESDCaloCluster *caloCluster = 0;
138 // AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
140 for(UInt_t i = 0; i < 1/*caloClusterContainerPtr->fNCaloClusters*/; i++)
142 // caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
143 //caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
144 /* caloClusterStruct = &(caloClusterContainerPtr->fCaloClusterArray[i]);
145 caloCluster->SetID(caloClusterStruct->fID);
146 caloCluster->SetClusterType(caloClusterStruct->fClusterType);
147 caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
148 caloCluster->SetE(caloClusterStruct->fEnergy);
149 caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
150 caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
151 caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
152 caloCluster->SetM20(caloClusterStruct->fM20);
153 caloCluster->SetM02(caloClusterStruct->fM02);
154 caloCluster->SetM11(caloClusterStruct->fM11);
155 caloCluster->SetNExMax(caloClusterStruct->fNExMax);
156 caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
157 caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
158 caloCluster->SetNCells(caloClusterStruct->fNCells);
159 caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
160 caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
161 fESDEventPtr->AddCaloCluster(caloCluster);
170 AliHLTPHOSESDMaker::ResetESD()
173 // fCaloClustersPtr->Delete();