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]);
106 //cout << caloCluster << endl;
107 //cout << "Cells = " << caloClusterStruct->fNCells << endl;
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);
116 caloCluster->SetM02(caloClusterStruct->fM02);
117 caloCluster->SetM11(caloClusterStruct->fM11);
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);
125 //cout << caloCluster->E() << endl;
132 AliHLTPHOSESDMaker::FillESDEvent(AliHLTPHOSCaloClusterContainerStruct* caloClusterContainerPtr)
134 //See header file for documentation
136 AliESDCaloCluster *caloCluster = 0;
137 AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
139 for(UInt_t i = 0; i < 1/*caloClusterContainerPtr->fNCaloClusters*/; i++)
141 // caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
142 //caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
143 /* caloClusterStruct = &(caloClusterContainerPtr->fCaloClusterArray[i]);
144 caloCluster->SetID(caloClusterStruct->fID);
145 caloCluster->SetClusterType(caloClusterStruct->fClusterType);
146 caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
147 caloCluster->SetE(caloClusterStruct->fEnergy);
148 caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
149 caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
150 caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
151 caloCluster->SetM20(caloClusterStruct->fM20);
152 caloCluster->SetM02(caloClusterStruct->fM02);
153 caloCluster->SetM11(caloClusterStruct->fM11);
154 caloCluster->SetNExMax(caloClusterStruct->fNExMax);
155 caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
156 caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
157 caloCluster->SetNCells(caloClusterStruct->fNCells);
158 caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
159 caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
160 fESDEventPtr->AddCaloCluster(caloCluster);
161 //cout << caloCluster->E() << endl;*/
169 AliHLTPHOSESDMaker::ResetESD()
172 // fCaloClustersPtr->Delete();