3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * All rights reserved. *
7 * Primary Authors: Oystein Djuvsland *
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 **************************************************************************/
20 * @file AliHLTPHOSESDMaker.cxx
21 * @author Oystein Djuvsland
23 * @brief ESD maker for PHOS HLT
26 // see header file for class documentation
28 // refer to README to build package
30 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
32 #include "AliHLTPHOSESDMaker.h"
33 #include "AliHLTPHOSCaloClusterContainerStruct.h"
34 #include "AliHLTPHOSBase.h"
35 #include "AliHLTPHOSCaloClusterDataStruct.h"
36 #include "AliESDEvent.h"
37 #include "AliESDCaloCluster.h"
38 #include "TClonesArray.h"
40 ClassImp(AliHLTPHOSESDMaker);
42 AliHLTPHOSESDMaker::AliHLTPHOSESDMaker() :
47 fCaloClusterContainerPtr(0)
49 //See header file for documentation
50 fCaloClustersPtr = new TClonesArray("AliESDCaloCluster", 0);
53 AliHLTPHOSESDMaker::~AliHLTPHOSESDMaker()
55 //See header file for documentation
58 //fCaloClustersPtr->Delete();
59 //fCaloClustersPtr = 0;
64 AliHLTPHOSESDMaker::FillESDCaloClusters()
66 //See header file for documentation
68 // AliESDCaloCluster *caloCluster = 0;
69 // AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
71 for(UInt_t i = 0; i < fCaloClusterContainerPtr->fNCaloClusters; i++)
74 // caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->At(i + fNCaloClusters);
75 // caloClusterStruct = &(fCaloClusterContainerPtr->fCaloClusterArray[i]);
76 // caloCluster->SetID(caloClusterStruct->fID);
77 // caloCluster->SetClusterType(caloClusterStruct->fClusterType);
78 // caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
79 // caloCluster->SetE(caloClusterStruct->fEnergy);
80 // caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
81 // caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
82 // caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
83 // caloCluster->SetM20(caloClusterStruct->fM20);
84 // caloCluster->SetM02(caloClusterStruct->fM02);
85 // // PT caloCluster->SetM11(caloClusterStruct->fM11);
86 // caloCluster->SetNExMax(caloClusterStruct->fNExMax);
87 // caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
88 // caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
89 // caloCluster->SetNCells(caloClusterStruct->fNCells);
90 // caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
91 // caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
99 AliHLTPHOSESDMaker::FillESDEvent()
101 //See header file for documentation
103 // AliESDCaloCluster *caloCluster = 0;
104 // AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
105 for(UInt_t i = 0; i < fCaloClusterContainerPtr->fNCaloClusters; i++)
107 // // caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
108 // caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i);
109 // caloClusterStruct = &(fCaloClusterContainerPtr->fCaloClusterArray[i]);
111 // caloCluster->SetID(caloClusterStruct->fID);
112 // caloCluster->SetClusterType(caloClusterStruct->fClusterType);
113 // caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
114 // caloCluster->SetE(caloClusterStruct->fEnergy);
115 // caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
116 // caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
117 // caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
118 // caloCluster->SetM20(caloClusterStruct->fM20);
119 // caloCluster->SetM02(caloClusterStruct->fM02);
120 // // caloCluster->SetM11(caloClusterStruct->fM11);
121 // caloCluster->SetNExMax(caloClusterStruct->fNExMax);
122 // caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
123 // caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
124 // caloCluster->SetNCells(caloClusterStruct->fNCells);
125 // caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
126 // caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
127 // fESDEventPtr->AddCaloCluster(caloCluster);
134 AliHLTPHOSESDMaker::FillESDEvent(AliHLTPHOSCaloClusterContainerStruct* caloClusterContainerPtr)
136 //See header file for documentation
138 // AliESDCaloCluster *caloCluster = 0;
139 // AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
141 //cout << "ESD: # of clusters: " << caloClusterContainerPtr->fNCaloClusters << endl;
142 for(UInt_t i = 0; i < caloClusterContainerPtr->fNCaloClusters; i++)
144 // caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
145 // caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
146 // caloClusterStruct = &(caloClusterContainerPtr->fCaloClusterArray[i]);
147 // caloCluster->SetID(caloClusterStruct->fID);
148 // caloCluster->SetClusterType(caloClusterStruct->fClusterType);
149 // // caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
150 // caloCluster->SetPosition((Float_t*)caloClusterStruct->fGlobalPos);
151 // caloCluster->SetE(caloClusterStruct->fEnergy);
152 // // cout << "\t\t ESD: Cluster energy: " << caloClusterStruct->fEnergy << endl;
153 // // cout << "\t\t ESD: Position: x = " << caloClusterStruct->fGlobalPos[0] << " - y = " << caloClusterStruct->fGlobalPos[1] << " - z = " << caloClusterStruct->fGlobalPos[2] << endl;
154 // caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
155 // caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
156 // caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
157 // caloCluster->SetM20(caloClusterStruct->fM20);
158 // caloCluster->SetM02(caloClusterStruct->fM02);
159 // caloCluster->SetNExMax(caloClusterStruct->fNExMax);
160 // caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
161 // caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
162 // caloCluster->SetNCells(caloClusterStruct->fNCells);
163 // caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
164 // caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
165 // fESDEventPtr->AddCaloCluster(caloCluster);
174 AliHLTPHOSESDMaker::ResetESD()
177 // fCaloClustersPtr->Delete();