]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSESDMaker.cxx
New production macros (Yves)
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSESDMaker.cxx
1 // $Id$
2
3 /**************************************************************************
4  * This file is property of and copyright by the ALICE HLT Project        * 
5  * All rights reserved.                                                   *
6  *                                                                        *
7  * Primary Authors: Oystein Djuvsland                                     *
8  *                                                                        *
9  * Permission to use, copy, modify and distribute this software and its   *
10  * documentation strictly for non-commercial purposes is hereby granted   *
11  * without fee, provided that the above copyright notice appears in all   *
12  * copies and that both the copyright notice and this permission notice   *
13  * appear in the supporting documentation. The authors make no claims     *
14  * about the suitability of this software for any purpose. It is          * 
15  * provided "as is" without express or implied warranty.                  *
16  **************************************************************************/
17
18
19 /** 
20  * @file   AliHLTPHOSESDMaker.cxx
21  * @author Oystein Djuvsland
22  * @date 
23  * @brief  ESD maker for PHOS HLT 
24  */
25
26 // see header file for class documentation
27 // or
28 // refer to README to build package
29 // or 
30 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
31
32 #include "AliHLTPHOSESDMaker.h"
33 #include "AliHLTPHOSCaloClusterContainerStruct.h"
34 #include "AliHLTPHOSBase.h"
35 #include "AliHLTPHOSCaloClusterDataStruct.h"
36 #include "AliESDEvent.h"
37 #include "AliESDCaloCluster.h"
38 #include "TClonesArray.h"
39
40 ClassImp(AliHLTPHOSESDMaker);
41
42 AliHLTPHOSESDMaker::AliHLTPHOSESDMaker() : 
43   AliHLTPHOSBase(),
44   fNCaloClusters(0),
45   fCaloClustersPtr(0),
46   fESDEventPtr(0),
47   fCaloClusterContainerPtr(0)
48 {
49   //See header file for documentation
50   fCaloClustersPtr = new TClonesArray("AliESDCaloCluster", 0);
51 }
52
53 AliHLTPHOSESDMaker::~AliHLTPHOSESDMaker()
54 {
55   //See header file for documentation
56   if(fCaloClustersPtr)
57     {
58       //fCaloClustersPtr->Delete();
59       //fCaloClustersPtr = 0;
60     }
61 }
62
63 Int_t
64 AliHLTPHOSESDMaker::FillESDCaloClusters()
65 {
66   //See header file for documentation
67
68 //   AliESDCaloCluster *caloCluster = 0;
69 //   AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
70
71   for(UInt_t i = 0; i < fCaloClusterContainerPtr->fNCaloClusters; i++)
72     {
73
74 //       caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->At(i + fNCaloClusters);
75 //       caloClusterStruct = &(fCaloClusterContainerPtr->fCaloClusterArray[i]);
76 //       caloCluster->SetID(caloClusterStruct->fID);
77 //       caloCluster->SetClusterType(caloClusterStruct->fClusterType);
78 //       caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
79 //       caloCluster->SetE(caloClusterStruct->fEnergy);
80 //       caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
81 //       caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
82 //       caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
83 //       caloCluster->SetM20(caloClusterStruct->fM20);
84 //       caloCluster->SetM02(caloClusterStruct->fM02);
85 //       // PT   caloCluster->SetM11(caloClusterStruct->fM11);
86 //       caloCluster->SetNExMax(caloClusterStruct->fNExMax);
87 //       caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
88 //       caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
89 //       caloCluster->SetNCells(caloClusterStruct->fNCells);
90 //       caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
91 //       caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
92 //       fNCaloClusters++;
93     }
94
95   return 0;
96 }
97
98 Int_t
99 AliHLTPHOSESDMaker::FillESDEvent()
100 {
101   //See header file for documentation
102   
103 //   AliESDCaloCluster *caloCluster = 0;
104 //   AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
105   for(UInt_t i = 0; i < fCaloClusterContainerPtr->fNCaloClusters; i++)
106     {
107 //       //      caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
108 //       caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i);
109 //       caloClusterStruct = &(fCaloClusterContainerPtr->fCaloClusterArray[i]);
110
111 //       caloCluster->SetID(caloClusterStruct->fID);
112 //       caloCluster->SetClusterType(caloClusterStruct->fClusterType);
113 //       caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
114 //       caloCluster->SetE(caloClusterStruct->fEnergy);
115 //       caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
116 //       caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
117 //       caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
118 //       caloCluster->SetM20(caloClusterStruct->fM20);
119 //       caloCluster->SetM02(caloClusterStruct->fM02);
120 //       //     caloCluster->SetM11(caloClusterStruct->fM11);
121 //       caloCluster->SetNExMax(caloClusterStruct->fNExMax);
122 //       caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
123 //       caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
124 //       caloCluster->SetNCells(caloClusterStruct->fNCells);
125 //       caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
126 //       caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
127 //       fESDEventPtr->AddCaloCluster(caloCluster);
128 //       fNCaloClusters++;  
129     }
130   
131   return 0;
132 }
133 Int_t
134 AliHLTPHOSESDMaker::FillESDEvent(AliHLTPHOSCaloClusterContainerStruct* caloClusterContainerPtr)
135 {
136   //See header file for documentation
137   
138 //   AliESDCaloCluster *caloCluster = 0;
139 //   AliHLTPHOSCaloClusterDataStruct* caloClusterStruct = 0;
140   
141   //cout << "ESD: # of clusters: " << caloClusterContainerPtr->fNCaloClusters << endl; 
142   for(UInt_t i = 0; i < caloClusterContainerPtr->fNCaloClusters; i++)
143     {
144       // caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
145 //       caloCluster = (AliESDCaloCluster*)fCaloClustersPtr->New(i + fNCaloClusters);
146 //       caloClusterStruct = &(caloClusterContainerPtr->fCaloClusterArray[i]);
147 //       caloCluster->SetID(caloClusterStruct->fID);
148 //       caloCluster->SetClusterType(caloClusterStruct->fClusterType);
149 //       //      caloCluster->SetPosition((Float_t*)&caloClusterStruct->fGlobalPos[0]);
150 //       caloCluster->SetPosition((Float_t*)caloClusterStruct->fGlobalPos);
151 //       caloCluster->SetE(caloClusterStruct->fEnergy);
152 //       // cout << "\t\t ESD: Cluster energy: " << caloClusterStruct->fEnergy << endl;
153 // //       cout << "\t\t ESD: Position: x = " << caloClusterStruct->fGlobalPos[0] << " - y = " << caloClusterStruct->fGlobalPos[1] << " - z = " << caloClusterStruct->fGlobalPos[2] << endl;
154 //       caloCluster->SetClusterDisp(caloClusterStruct->fDispersion);
155 //       caloCluster->SetClusterChi2(caloClusterStruct->fFitQuality);
156 //       caloCluster->SetPid((Float_t*)&caloClusterStruct->fPID[0]);
157 //       caloCluster->SetM20(caloClusterStruct->fM20);
158 //       caloCluster->SetM02(caloClusterStruct->fM02);
159 //       caloCluster->SetNExMax(caloClusterStruct->fNExMax);
160 //       caloCluster->SetEmcCpvDistance(caloClusterStruct->fEmcCpvDistance);
161 //       caloCluster->SetDistanceToBadChannel(caloClusterStruct->fDistToBadChannel);
162 //       caloCluster->SetNCells(caloClusterStruct->fNCells);
163 //       caloCluster->SetCellsAbsId(caloClusterStruct->fCellsAbsId);
164 //       caloCluster->SetCellsAmplitudeFraction(caloClusterStruct->fCellsAmpFraction);
165 //       fESDEventPtr->AddCaloCluster(caloCluster);
166       
167 //       fNCaloClusters++;  
168     }
169   
170   return 0;
171 }
172
173 void 
174 AliHLTPHOSESDMaker::ResetESD()
175 {
176   fNCaloClusters = 0;
177   // fCaloClustersPtr->Delete();
178 }
179