2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * All rights reserved. *
6 * Primary Authors: Oystein Djuvsland *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
19 * @file AliHLTESDCaloClusterMaker.cxx
20 * @author Oystein Djuvsland
22 * @brief ESD Calo Cluster maker for HLT
25 // see header file for class documentation
27 // refer to README to build package
29 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
31 #include "AliESDEvent.h"
32 #include "AliHLTESDCaloClusterMaker.h"
33 #include "AliHLTCaloClusterDataStruct.h"
34 #include "AliHLTCaloClusterReader.h"
35 #include "AliESDCaloCluster.h"
38 ClassImp(AliHLTESDCaloClusterMaker);
40 AliHLTESDCaloClusterMaker::AliHLTESDCaloClusterMaker() :
43 //See header file for documentation
44 fClusterReaderPtr = new AliHLTCaloClusterReader();
48 AliHLTESDCaloClusterMaker::~AliHLTESDCaloClusterMaker()
50 //See header file for documentation
55 AliHLTESDCaloClusterMaker::FillESD(AliESDEvent *esdPtr, const AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr)
57 // See header file for documentation
59 AliHLTCaloClusterDataStruct* caloClusterStructPtr = 0;
61 fClusterReaderPtr->SetMemory(caloClusterHeaderPtr);
65 while((caloClusterStructPtr = fClusterReaderPtr->NextCluster()) != 0)
67 AliESDCaloCluster esdCluster;
69 esdCluster.SetID(caloClusterStructPtr->fID);
70 esdCluster.SetClusterType(caloClusterStructPtr->fClusterType);
71 esdCluster.SetPosition((Float_t*)(caloClusterStructPtr->fGlobalPos));
72 esdCluster.SetE(caloClusterStructPtr->fEnergy);
73 esdCluster.SetTOF(caloClusterStructPtr->fTOF);
74 esdCluster.SetClusterDisp(caloClusterStructPtr->fDispersion);
75 esdCluster.SetClusterChi2(caloClusterStructPtr->fFitQuality);
76 // esdCluster.SetPid((Float_t*)(caloClusterStructPtr->fPID));
77 esdCluster.SetM20(caloClusterStructPtr->fM20);
78 esdCluster.SetM02(caloClusterStructPtr->fM02);
79 esdCluster.SetNExMax(caloClusterStructPtr->fNExMax);
80 esdCluster.SetEmcCpvDistance(caloClusterStructPtr->fEmcCpvDistance);
81 esdCluster.SetDistanceToBadChannel(caloClusterStructPtr->fDistToBadChannel);
82 esdCluster.SetNCells(caloClusterStructPtr->fNCells);
83 // UShort_t *idArrayPtr = new UShort_t[caloClusterStructPtr->fNCells];
84 // Double32_t *ampFracArrayPtr = new Double32_t[caloClusterStructPtr->fNCells];
85 for(UInt_t index = 0; index < caloClusterStructPtr->fNCells; index++)
87 // fClusterReaderPtr->GetCell(caloClusterStructPtr, idArrayPtr[index], ampFracArrayPtr[index], index);
89 // esdCluster.SetCellsAbsId(idArrayPtr);
90 // esdCluster.SetCellsAmplitudeFraction(ampFracArrayPtr);
92 printf("Cluster energy: %f\n", esdCluster.E());
94 esdPtr->AddCaloCluster(&esdCluster);