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 AliHLTPHOSESDCaloClusterMaker.cxx
20 * @author Oystein Djuvsland
22 * @brief ESD Calo Cluster maker for PHOS 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 "AliHLTPHOSESDCaloClusterMaker.h"
32 #include "AliHLTPHOSCaloClusterHeaderStruct.h"
33 #include "AliHLTPHOSBase.h"
34 #include "AliHLTPHOSCaloClusterDataStruct.h"
35 #include "AliESDCaloCluster.h"
36 #include "TClonesArray.h"
37 #include "AliHLTPHOSCaloClusterReader.h"
42 ClassImp(AliHLTPHOSESDCaloClusterMaker);
46 AliHLTPHOSESDCaloClusterMaker::AliHLTPHOSESDCaloClusterMaker() :
52 //See header file for documentation
53 fClusterReaderPtr = new AliHLTPHOSCaloClusterReader();
54 fESDCaloClusterPtr = new AliESDCaloCluster();
58 AliHLTPHOSESDCaloClusterMaker::~AliHLTPHOSESDCaloClusterMaker()
60 //See header file for documentation
65 AliHLTPHOSESDCaloClusterMaker::FillESDCaloClusters(TClonesArray* esdClustersPtr, AliHLTPHOSCaloClusterHeaderStruct* caloClusterHeaderPtr)
67 //See header file for documentation
69 // AliESDCaloCluster* caloCluster = 0;
70 AliHLTPHOSCaloClusterDataStruct* caloClusterStructPtr = 0;
71 fClusterReaderPtr->SetMemory(caloClusterHeaderPtr);
73 // fESDCaloClusterPtr = new AliESDCaloCluster();
74 // fNCaloClusters = 0;
75 fNCaloClusters = esdClustersPtr->GetEntries();
77 while((caloClusterStructPtr = fClusterReaderPtr->NextCluster()) != 0)
79 new((*esdClustersPtr)[fNCaloClusters]) AliESDCaloCluster();
80 fESDCaloClusterPtr = static_cast<AliESDCaloCluster*>((*esdClustersPtr)[fNCaloClusters]);
82 fESDCaloClusterPtr->SetID(caloClusterStructPtr->fID);
83 fESDCaloClusterPtr->SetClusterType(caloClusterStructPtr->fClusterType);
84 fESDCaloClusterPtr->SetPosition((Float_t*)&caloClusterStructPtr->fGlobalPos[0]);
85 fESDCaloClusterPtr->SetE(caloClusterStructPtr->fEnergy);
86 fESDCaloClusterPtr->SetTOF(caloClusterStructPtr->fTOF);
87 fESDCaloClusterPtr->SetClusterDisp(caloClusterStructPtr->fDispersion);
88 fESDCaloClusterPtr->SetClusterChi2(caloClusterStructPtr->fFitQuality);
89 fESDCaloClusterPtr->SetPid((Float_t*)&caloClusterStructPtr->fPID[0]);
90 fESDCaloClusterPtr->SetM20(caloClusterStructPtr->fM20);
91 fESDCaloClusterPtr->SetM02(caloClusterStructPtr->fM02);
92 fESDCaloClusterPtr->SetNExMax(caloClusterStructPtr->fNExMax);
93 fESDCaloClusterPtr->SetEmcCpvDistance(caloClusterStructPtr->fEmcCpvDistance);
94 fESDCaloClusterPtr->SetDistanceToBadChannel(caloClusterStructPtr->fDistToBadChannel);
95 fESDCaloClusterPtr->SetNCells(caloClusterStructPtr->fNCells);
96 // fESDCaloClusterPtr->SetCellsAbsId(caloClusterStructPtr->fCellsAbsId);
97 // fESDCaloClusterPtr->SetCellsAmplitudeFraction(caloClusterStructPtr->fCellsAmpFraction);
101 // delete fESDCaloClusterPtr;