Fixing bug of previous commit of the alignment object
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTESDCaloClusterMaker.cxx
CommitLineData
7fc04b67 1
2/**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * All rights reserved. *
5 * *
6 * Primary Authors: Oystein Djuvsland *
7 * *
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 **************************************************************************/
16
17
18/**
19 * @file AliHLTESDCaloClusterMaker.cxx
20 * @author Oystein Djuvsland
21 * @date
22 * @brief ESD Calo Cluster maker for HLT
23 */
24
25// see header file for class documentation
26// or
27// refer to README to build package
28// or
29// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
30
31#include "AliESDEvent.h"
32#include "AliHLTESDCaloClusterMaker.h"
33#include "AliHLTCaloClusterDataStruct.h"
34#include "AliHLTCaloClusterReader.h"
35#include "AliESDCaloCluster.h"
36#include <iostream>
37
38ClassImp(AliHLTESDCaloClusterMaker);
39
40AliHLTESDCaloClusterMaker::AliHLTESDCaloClusterMaker() :
41 fClusterReaderPtr(0)
42{
43 //See header file for documentation
44 fClusterReaderPtr = new AliHLTCaloClusterReader();
45
46}
47
48AliHLTESDCaloClusterMaker::~AliHLTESDCaloClusterMaker()
49{
50 //See header file for documentation
51
52}
53
54Int_t
55AliHLTESDCaloClusterMaker::FillESD(AliESDEvent *esdPtr, const AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr)
56{
57 // See header file for documentation
58
59 AliHLTCaloClusterDataStruct* caloClusterStructPtr = 0;
60
61 fClusterReaderPtr->SetMemory(caloClusterHeaderPtr);
62
63 Int_t nClusters = 0;
64
65 while((caloClusterStructPtr = fClusterReaderPtr->NextCluster()) != 0)
66 {
67 AliESDCaloCluster esdCluster;
68
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);
ba340030 76 const Float_t *pid = caloClusterStructPtr->fPID;
77 esdCluster.SetPid(pid);
7fc04b67 78 esdCluster.SetM20(caloClusterStructPtr->fM20);
79 esdCluster.SetM02(caloClusterStructPtr->fM02);
80 esdCluster.SetNExMax(caloClusterStructPtr->fNExMax);
81 esdCluster.SetEmcCpvDistance(caloClusterStructPtr->fEmcCpvDistance);
82 esdCluster.SetDistanceToBadChannel(caloClusterStructPtr->fDistToBadChannel);
83 esdCluster.SetNCells(caloClusterStructPtr->fNCells);
b210e538 84 // UShort_t *idArrayPtr = new UShort_t[caloClusterStructPtr->fNCells];
85 // Double32_t *ampFracArrayPtr = new Double32_t[caloClusterStructPtr->fNCells];
7fc04b67 86 for(UInt_t index = 0; index < caloClusterStructPtr->fNCells; index++)
87 {
88 // fClusterReaderPtr->GetCell(caloClusterStructPtr, idArrayPtr[index], ampFracArrayPtr[index], index);
89 }
90 // esdCluster.SetCellsAbsId(idArrayPtr);
91 // esdCluster.SetCellsAmplitudeFraction(ampFracArrayPtr);
92
93 esdPtr->AddCaloCluster(&esdCluster);
94 nClusters++;
95 }
96 return nClusters;
97}