]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSESDCaloClusterMaker.cxx
- fixes due to new PHOS mapping
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSESDCaloClusterMaker.cxx
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   AliHLTPHOSESDCaloClusterMaker.cxx
20  * @author Oystein Djuvsland
21  * @date 
22  * @brief  ESD Calo Cluster maker for PHOS 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 "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"
38 #include "TH1F.h"
39 #include "TFile.h"
40 #include "TNtuple.h"
41
42 ClassImp(AliHLTPHOSESDCaloClusterMaker);
43
44
45
46 AliHLTPHOSESDCaloClusterMaker::AliHLTPHOSESDCaloClusterMaker() : 
47   AliHLTPHOSBase(),
48   fNCaloClusters(0),
49   fClusterReaderPtr(0),
50   fESDCaloClusterPtr(0)
51 {
52   //See header file for documentation
53   fClusterReaderPtr = new AliHLTPHOSCaloClusterReader();
54   fESDCaloClusterPtr = new AliESDCaloCluster();
55
56 }
57
58 AliHLTPHOSESDCaloClusterMaker::~AliHLTPHOSESDCaloClusterMaker()
59 {
60   //See header file for documentation
61
62 }
63
64 Int_t
65 AliHLTPHOSESDCaloClusterMaker::FillESDCaloClusters(TClonesArray* esdClustersPtr, AliHLTPHOSCaloClusterHeaderStruct* caloClusterHeaderPtr)
66 {
67   //See header file for documentation
68
69   //  AliESDCaloCluster* caloCluster = 0;
70   AliHLTPHOSCaloClusterDataStruct* caloClusterStructPtr = 0;
71   fClusterReaderPtr->SetMemory(caloClusterHeaderPtr);
72
73   //  fESDCaloClusterPtr = new AliESDCaloCluster();
74   //  fNCaloClusters = 0;
75   fNCaloClusters = esdClustersPtr->GetEntries();
76   int count = 0;
77   while((caloClusterStructPtr = fClusterReaderPtr->NextCluster()) != 0)
78     {
79       new((*esdClustersPtr)[fNCaloClusters]) AliESDCaloCluster();
80       fESDCaloClusterPtr = static_cast<AliESDCaloCluster*>((*esdClustersPtr)[fNCaloClusters]);
81
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);
98       fNCaloClusters++;
99       count++;
100     }
101   //  delete fESDCaloClusterPtr;
102   return count;
103
104 }