]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/EveDet/AliEveEMCALSModuleData.cxx
Coverity
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveEMCALSModuleData.cxx
CommitLineData
345a46b0 1//
c3e34498 2// EMCAL event display
3// Store the data related to each Super Module (SM)
4// Possible storage of hits, digits and clusters per SM
5//
6// Author: Magali Estienne (magali.estienne@cern.ch)
7// June 30 2008
345a46b0 8//
c3e34498 9
10#include "AliEveEMCALSModuleData.h"
11
c3e34498 12#include <TGeoBBox.h>
c3e34498 13
345a46b0 14class Riostream;
15class TClonesArray;
16class TGeoNode;
17class TGeoMatrix;
18class AliEMCALGeometry;
19class TVector2;
20class AliEveEventManager;
c3e34498 21
c3e34498 22ClassImp(AliEveEMCALSModuleData)
23
cc9486d4 24Float_t AliEveEMCALSModuleData::fgSModuleBigBox0 = 0.;
25Float_t AliEveEMCALSModuleData::fgSModuleBigBox1 = 0.;
26Float_t AliEveEMCALSModuleData::fgSModuleBigBox2 = 0.;
27Float_t AliEveEMCALSModuleData::fgSModuleSmallBox0 = 0.;
28Float_t AliEveEMCALSModuleData::fgSModuleSmallBox1 = 0.;
29Float_t AliEveEMCALSModuleData::fgSModuleSmallBox2 = 0.;
30Float_t AliEveEMCALSModuleData::fgSModuleCenter0 = 0.;
31Float_t AliEveEMCALSModuleData::fgSModuleCenter1 = 0.;
32Float_t AliEveEMCALSModuleData::fgSModuleCenter2 = 0.;
c3e34498 33
34//______________________________________________________________________________
35AliEveEMCALSModuleData::AliEveEMCALSModuleData(Int_t sm,AliEMCALGeometry* geom, TGeoNode* node, TGeoHMatrix* m) :
36 TObject(),
37 fGeom(geom),
38 fNode(node),
39 fSmId(sm),
40 fNsm(0),
41 fNsmfull(0),
42 fNsmhalf(0),
43 fNDigits(0),
44 fNClusters(0),
45 fNHits(0),
3607f2fb 46 fPhiTileSize(0), fEtaTileSize(0),
c3e34498 47 fHitArray(0),
48 fDigitArray(0),
49 fClusterArray(0),
50 fMatrix(0),
51 fHMatrix(m)
52{
53 //
a312477b 54 // Constructor
c3e34498 55 //
56
57 Init(sm);
58
59}
60
61//______________________________________________________________________________
62 AliEveEMCALSModuleData::AliEveEMCALSModuleData(const AliEveEMCALSModuleData &esmdata) :
63 TObject(),
64 fGeom(esmdata.fGeom),
65 fNode(esmdata.fNode),
66 fSmId(esmdata.fSmId),
67 fNsm(esmdata.fNsm),
68 fNsmfull(esmdata.fNsmfull),
69 fNsmhalf(esmdata.fNsmhalf),
70 fNDigits(esmdata.fNDigits),
71 fNClusters(esmdata.fNClusters),
72 fNHits(esmdata.fNHits),
3607f2fb 73 fPhiTileSize(esmdata.fPhiTileSize), fEtaTileSize(esmdata.fEtaTileSize),
c3e34498 74 fHitArray(esmdata.fHitArray),
75 fDigitArray(esmdata.fDigitArray),
76 fClusterArray(esmdata.fClusterArray),
77 fMatrix(esmdata.fMatrix),
78 fHMatrix(esmdata.fHMatrix)
79{
80 //
a312477b 81 // Copy constructor
c3e34498 82 //
83
84 Init(esmdata.fNsm);
85
86}
87
88//______________________________________________________________________________
89AliEveEMCALSModuleData::~AliEveEMCALSModuleData()
90{
91 //
a312477b 92 // Destructor
c3e34498 93 //
94
95 if(!fHitArray.empty()){
96 fHitArray.clear();
97 }
98 if(!fDigitArray.empty()){
99 fDigitArray.clear();
100 }
101 if(!fClusterArray.empty()){
102 fClusterArray.clear();
103 }
104
105}
106
107//______________________________________________________________________________
108void AliEveEMCALSModuleData::DropData()
109{
110 //
a312477b 111 // Release the SM data
c3e34498 112 //
113
114 fNDigits = 0;
115 fNClusters = 0;
116 fNHits = 0;
117
118 if(!fHitArray.empty())
119 fHitArray.clear();
120
121 if(!fDigitArray.empty())
122 fDigitArray.clear();
123
124 if(!fClusterArray.empty())
125 fClusterArray.clear();
126
127 return;
128
129}
130
131// ______________________________________________________________________________
132void AliEveEMCALSModuleData::Init(Int_t sm)
133{
a312477b 134
135 //
136 // Initialize parameters
137 //
138
c3e34498 139 fNsm = 12;
140 fNsmfull = 10;
141 fNsmhalf = 2;
142
143 fPhiTileSize = fGeom->GetPhiTileSize();
144 fEtaTileSize = fGeom->GetPhiTileSize();
145
146 TGeoBBox* bbbox = (TGeoBBox*) fNode->GetDaughter(0) ->GetVolume()->GetShape();
c3e34498 147 TGeoBBox* sbbox = (TGeoBBox*) fNode->GetDaughter(10)->GetVolume()->GetShape();
c3e34498 148
149 fMatrix = (TGeoMatrix*) fNode->GetDaughter(sm)->GetMatrix();
150
151 if(sm<fNsmfull)
152 {
cc9486d4 153 fgSModuleBigBox0 = bbbox->GetDX();
154 fgSModuleBigBox1 = bbbox->GetDY();
155 fgSModuleBigBox2 = bbbox->GetDZ();
c3e34498 156 }
157 else
158 {
cc9486d4 159 fgSModuleSmallBox0 = sbbox->GetDX();
160 fgSModuleSmallBox1 = sbbox->GetDY();
161 fgSModuleSmallBox2 = sbbox->GetDZ();
c3e34498 162 }
163}
164
165
166// ______________________________________________________________________________
a312477b 167void AliEveEMCALSModuleData::RegisterDigit(Int_t AbsId, Int_t isupMod, Double_t iamp, Double_t ix, Double_t iy, Double_t iz)
c3e34498 168{
169 //
a312477b 170 // Add a digit to this SM
c3e34498 171 //
172
97425cab 173 std::vector<Double_t> bufDig(6);
c3e34498 174 bufDig[0] = AbsId;
175 bufDig[1] = isupMod;
176 bufDig[2] = iamp;
177 bufDig[3] = ix;
178 bufDig[4] = iy;
179 bufDig[5] = iz;
180
c3e34498 181 fDigitArray.push_back(bufDig);
182
183 fNDigits++;
184
185}
186
187// ______________________________________________________________________________
a312477b 188void AliEveEMCALSModuleData::RegisterHit(Int_t AbsId, Int_t isupMod, Double_t iamp, Double_t ix, Double_t iy, Double_t iz)
c3e34498 189{
190 //
a312477b 191 // Add a hit to this SM
c3e34498 192 //
193
97425cab 194 std::vector<Float_t> bufHit(6);
c3e34498 195 bufHit[0] = AbsId;
196 bufHit[1] = isupMod;
197 bufHit[2] = iamp;
198 bufHit[3] = ix;
199 bufHit[4] = iy;
200 bufHit[5] = iz;
201
202 fHitArray.push_back(bufHit);
203
204 fNHits++;
205
206}
207
208// ______________________________________________________________________________
a312477b 209void AliEveEMCALSModuleData::RegisterCluster(Int_t isupMod, Double_t iamp, Double_t ix, Double_t iy, Double_t iz)
c3e34498 210{
211 //
a312477b 212 // Add a cluster to this SM
c3e34498 213 //
214
97425cab 215 std::vector<Double_t> bufClu(5);
c3e34498 216 bufClu[0] = isupMod;
217 bufClu[1] = iamp;
218 bufClu[2] = ix;
219 bufClu[3] = iy;
220 bufClu[4] = iz;
221
222 fClusterArray.push_back(bufClu);
223
224 fNClusters++;
225
226}