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