BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
EventDisplay/BesVisLib/BesVisLib-00-04-04/src/MdcROOTGeo.cxx
Go to the documentation of this file.
1//$id$
2/*
3 * 2004/11/29 Zhengyun You Peking University
4 * Tof Geometry General for EventDisplay
5 *
6 * 2004/12/10 Zhengyun You Peking University
7 * named from MdcGeo to MdcROOTGeo
8 * inherit from class SubDetectorROOTGeo
9 */
10
11using namespace std;
12
13#include <string>
14#include <fstream>
15#include <iostream>
16#include <sstream>
17#include <vector>
18#include <iomanip>
19
20#include <TGeoManager.h>
21#include <TGeoTube.h>
22#include <TGeoArb8.h>
23#include <TMath.h>
24
25#include "BesVisLib/MdcROOTGeo.h"
26#include "Identifier/MdcID.h"
27#include "BesVisLib/BesEvent.h"
28#include "BesVisLib/BesView.h"
29#include "RawEvent/RawDataUtil.h"
30
31const int
32MdcROOTGeo::m_kReplica[m_kLayer] = { 40, 44, 48, 56, 64, 72, 80, 80,
33 76, 76, 88, 88, 100, 100, 112, 112, 128, 128, 140, 140,
34 160, 160, 160, 160, 176, 176, 176, 176, 208, 208, 208, 208, 240, 240, 240, 240,
35 256, 256, 256, 256, 256, 256, 256, 256,
36 288, 288, 288, 288, 288, 288
37 };
38
39const int
40MdcROOTGeo::m_kStereoDir[m_kTrueLayer] = { 1, 1, 1, 1, -1, -1, -1, -1,
41 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
42 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1,
43 0, 0, 0, 0, 0, 0, 0
44 };
45const int
46MdcROOTGeo::m_kiCorrectLayer[m_kCorrectLayer] = {9, 11, 13, 15, 17, 19, 36, 38, 40, 42};
47const int
48//MdcROOTGeo::m_kiCorrectReplica[m_kCorrectLayer] = {38, 44, 50, 56, 65, 71, 127, 127, 144, 143};
49MdcROOTGeo::m_kiCorrectReplica[m_kCorrectLayer] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
50
53{
54 m_MdcColor = 3;
55 m_segmentColor = 0;
56 m_hypeColor = 3;
57 m_tubeColor = 4;
58 //m_twistedTubsColor = kBlue;
59 m_twistedTubsColor = 8;
60 //m_replicaColor = kCyan;
61 m_replicaColor = 16;
62 k_TFire = kTRUE;
63 k_QFire = kTRUE;
64 k_QNotOverflow = kFALSE;
65
66 // Default constructor.
67 for (int layer = 0; layer < m_kLayer; layer++) {
68 m_NodeLayer[layer] = 0;
69 for (int replica = 0; replica < m_kReplicaMax; replica++) {
70 m_NodeReplica[layer][replica] = 0;
71 m_PhysicalReplica[layer][replica] = 0;
72 }
73 }
74
75 for (int i = 0; i < m_kCorrectLayer; i++) {
76 m_CorrectMap[m_kiCorrectLayer[i]] = m_kiCorrectReplica[i];
77 }
78
79 for (int layer = 0; layer < m_kTrueLayer; layer++) {
80 for (int replica = 0; replica < m_kReplicaMax; replica++) {
81 m_Mdc2DWire[layer][replica] = 0;
82 }
83 }
84}
85
87{ }
88
89void
90MdcROOTGeo::InitFromGDML( const char *gdmlFile, const char *setupName )
91{
92 m_ROOTGeoInit = 2;
93 ReadGdml(gdmlFile, setupName);
94 SetNode();
95}
96
97void
98MdcROOTGeo::InitFromROOT( TGeoVolume *vol )
99{
100 m_ROOTGeoInit = 1;
101
102 SetVolumeMdc(vol);
103 SetNode();
104}
105
106void
108{
109 if (m_ROOTGeoInit != 1 && m_ROOTGeoInit != 2) {
110 cout << "MdcROOTGeo::Init2DGeometry, ROOT Geometry not Initialized yet!" << endl;
111 return;
112 }
113 m_2DGeoInit = 1;
114
115 Int_t mdcColor = 11; //1002; // 41, 29
116 Int_t mdcLineColor = 15;
117 Int_t mdcXYStyle = 1001;//3001;
118 Int_t mdcZRStyle = 1001;//3007;
119
120 Int_t mdcStereoSuperColor = 38;
121 Int_t mdcAxialSuperColor = 4;
122
123 Double_t local[3] = {0.0, 0.0, 0.0};
124 Double_t master[3] = {0.0, 0.0, 0.0};
125 //Int_t nPoints = 4;
126 Double_t P[300] = {0.0};
127 Double_t center[3] = {0.0, 0.0, 0.0};
128 TString name;
129
130 //----------XY-----------
131 // Mdc
132 TGeoTube *mdcShape = (TGeoTube*)GetVolumeMdc()->GetShape();
133 m_MdcXY = new BesCircle2D("Mdc", "Mdc", mdcShape->GetRmin(), mdcShape->GetRmax(), &center[0]);
134 m_MdcXY->SetNSegment(360);
135 m_MdcXY->SetFillColor(mdcColor);
136 m_MdcXY->SetFillStyle(mdcXYStyle);
137 m_MdcXY->SetLineColor(mdcLineColor);
138
139 // Mdc Supers
140 Int_t layerIn[4] = {0,
141 m_kStereoLayerIn,
142 m_kStereoLayerIn+m_kAxialLayerIn,
143 m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut
144 };
145 Int_t layerOut[4] = {m_kStereoLayerIn-1,
146 m_kStereoLayerIn+m_kAxialLayerIn-1,
147 m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut-1,
148 m_kLayer-1
149 };
150 for (Int_t i = 0; i < 4; i++) {
151 TGeoTube *mdcSuperShapeIn = (TGeoTube*)(GetLayer(layerIn[i])->GetVolume())->GetShape();
152 TGeoTube *mdcSuperShapeOut = (TGeoTube*)(GetLayer(layerOut[i])->GetVolume())->GetShape();
153 name = TString("MdcSuper" + i);
154 m_MdcXYSuper[i] = new BesCircle2D(name, name, mdcSuperShapeIn->GetRmin(), mdcSuperShapeOut->GetRmax(), &center[0]);
155 if (i%2 == 0) m_MdcXYSuper[i]->SetFillColor(mdcStereoSuperColor);
156 else m_MdcXYSuper[i]->SetFillColor(mdcAxialSuperColor);
157 }
158
159 // Mdc Wires
160 for (Int_t layer = 0; layer < m_kTrueLayer; layer++) {
161 Int_t simuLayer = GetSimuLayer(layer);
162 for (int replica = 0; replica < m_kReplica[simuLayer]; replica++) {
163 //cout << "layer " << layer << " replica " << replica << endl;
164 TGeoPhysicalNode *wirePhyNode = GetPhysicalReplica(simuLayer, replica);
165 name = TString("Mdc Layer ");
166 name += layer;
167 name += " Wire ";
168 name += replica;
169
170 if (m_kStereoDir[layer] != 0) { // stereo Layer
171 TGeoArb8 *wireShape = (TGeoArb8*)wirePhyNode->GetShape();
172 Double_t *localArb8Point, masterArb8Point[24];
173 localArb8Point = wireShape->GetVertices();
174 for (Int_t i = 0; i < 8; i++) {
175 local[0] = localArb8Point[2*i];
176 local[1] = localArb8Point[2*i+1];
177 if (i < 4) local[2] = wireShape->GetDz() * (-1.0);
178 else local[2] = wireShape->GetDz();
179
180 wirePhyNode->GetMatrix(-1*wirePhyNode->GetLevel())
181 ->LocalToMaster(local, &master[0]); // transform to top
182 for (Int_t j = 0; j < 3; j++) {
183 masterArb8Point[3*i+j] = master[j];
184 }
185 }
186
187 m_Mdc2DWire[layer][replica] = new Mdc2DWire(name, name, 8, &masterArb8Point[0]);
188
189 }
190 else { // axial Layer
191
192 TGeoTubeSeg *wireShape = (TGeoTubeSeg*)wirePhyNode->GetShape();
193
194 Double_t centerR = 0.5*(wireShape->GetRmin() + wireShape->GetRmax());
195 if (layer >= m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut)
196 centerR = wireShape->GetRmax();
197 Double_t centerPhi =
198 0.5*(wireShape->GetPhi1() + wireShape->GetPhi2()) * TMath::DegToRad();
199 local[0] = centerR * cos(centerPhi);
200 local[1] = centerR * sin(centerPhi);
201 local[2] = 0.0;
202 wirePhyNode->GetMatrix(-1*wirePhyNode->GetLevel())
203 ->LocalToMaster(local, &master[0]); // transform to top
204
205 Double_t rmin = wireShape->GetRmin();
206 Double_t rmax = wireShape->GetRmax();
207 if (layer >= m_kStereoLayerIn+m_kAxialLayerIn+m_kStereoLayerOut)
208 rmax = rmin + 2*(rmax-rmin);
209 m_Mdc2DWire[layer][replica] =
210 new Mdc2DWire( name, name, rmin, rmax, wireShape->GetDz(),centerPhi, &master[0] );
211 }
212 }
213 }
214
215 //----------ZR-----------
216 // Mdc
217 Int_t iPoint = 0;
218 TGeoTube *aMdcLayer = 0;
219
220 for (Int_t layer = 0; layer < m_kLayer; layer++) {
221 aMdcLayer = (TGeoTube*)GetLayer(layer)->GetVolume()->GetShape();
222 P[3*iPoint] = 0.0;
223 P[3*iPoint+1] = aMdcLayer->GetRmin();
224 P[3*iPoint+2] = aMdcLayer->GetDz();
225 iPoint++;
226 }
227
228 P[3*iPoint] = 0.0;
229 P[3*iPoint+1] = aMdcLayer->GetRmax();
230 P[3*iPoint+2] = aMdcLayer->GetDz();
231 iPoint++;
232 P[3*iPoint] = 0.0;
233 P[3*iPoint+1] = aMdcLayer->GetRmax();
234 P[3*iPoint+2] = aMdcLayer->GetDz() * (-1.0);
235 iPoint++;
236
237 for (Int_t layer = m_kLayer-1; layer >= 0; layer--) {
238 aMdcLayer = (TGeoTube*)GetLayer(layer)->GetVolume()->GetShape();
239 P[3*iPoint] = 0.0;
240 P[3*iPoint+1] = aMdcLayer->GetRmin();
241 P[3*iPoint+2] = aMdcLayer->GetDz() * (-1.0);
242 iPoint++;
243 }
244
245
246 m_MdcZR[0] = new BesPolygon2D("MdcZRUp", "MdcZRUp", iPoint, &P[0]);
247
248 for (Int_t i = 0; i < iPoint; i++)
249 P[3*i+1] *= -1.0;
250
251 m_MdcZR[1] = new BesPolygon2D("MdcZRDown", "MdcZRDown", iPoint, &P[0]);
252
253 for (Int_t i = 0; i < 2; i++) {
254 m_MdcZR[i]->SetFillColor(mdcColor);
255 m_MdcZR[i]->SetFillStyle(mdcZRStyle);
256 m_MdcZR[i]->SetLineColor(mdcLineColor);
257 }
258}
259
260void
262{
263 if (gDebug) {
264 Int_t nDaughters = m_Mdc->GetNodes()->GetEntries();
265 cout << "logicalMdc contains " << nDaughters << " nodes : " << endl;
266 for (Int_t i = 0; i < nDaughters; i++) {
267 cout << i << " : " << m_Mdc->GetNode(i)->GetName() << endl;
268 }
269 }
270
271 if (m_ROOTGeoInit == 2) { // from GDML
272 m_Mdc = GetTopVolume();
273 if (!m_Mdc) std::cout << "m_Mdc = 0" << std::endl;
274
275 for (int layer = 0; layer < m_kLayer; layer++) { // is simuLayer
276 // m_NodeReplica[layer][replica] = m_Mdc->GetNode(layer); // you could take it by id;
277 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
278 std::stringstream osname;
279 int rep = replica;
280 if (layer >= 0 && layer < m_kStereoLayerIn) {
281 //osname << "pv_" << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "TwistedTubs" << "_" << rep;
282 osname << "pv_" << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "Cell" << "_" << rep;
283 }
284 else if (layer >= m_kStereoLayerIn && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
285 rep = CorrectReplica(layer, rep);
286 //osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << layer << "Replica" << "_" << rep;
287 osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << layer << "Cell" << "_" << rep;
288 }
289 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
290 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
291 //osname << "pv_" << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "TwistedTubs" << "_" << rep;
292 osname << "pv_" << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "Cell" << "_" << rep;
293 }
294 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut && layer < m_kLayer) {
295 rep = CorrectReplica(layer, rep);
296 Int_t nBeforeAxialLayerOut = m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut;
297 Int_t iTrueLayer = nBeforeAxialLayerOut + (layer - nBeforeAxialLayerOut)/2;
298 if (layer%2 == 0) {
299 //osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << iTrueLayer << "_0" << "Replica" << "_" << rep;
300 osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << iTrueLayer << "_0" << "Cell" << "_" << rep;
301 }
302 else {
303 //osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << iTrueLayer << "_1" << "Replica" << "_" << rep;
304 osname << "pv_" << "logical" << "Mdc" << "Axial" << "Layer" << iTrueLayer << "_1" << "Cell" << "_" << rep;
305 }
306 }
307
308 m_NodeReplica[layer][replica] = GetNode( osname.str() );
309 //cout << osname.str() << endl;
310 }
311 }
312 }
313 else if (m_ROOTGeoInit == 1) { // from ROOT object
314 for (int layer = 0; layer < m_kLayer; layer++) {
315 // 0 : logicalMdcStereoLayer0_0 35 : logicalMdcStereoLayer35_35
316 // 36 : logicalMdcAxialLayer36_0_36 37 : logicalMdcAxialLayer36_1_37
317 // 49 : logicalMdcAxialLayer42_1_49 50 : logicalMdcSegment1_50
318 TGeoNode *nodeLayer = m_Mdc->GetNode(layer);
319 m_NodeLayer[layer] = nodeLayer;
320 //cout << layer << " " << m_NodeLayer[layer]->GetName() << endl;
321
322 Int_t nDaughters = nodeLayer->GetVolume()->GetNodes()->GetEntries();
323 if (0) {
324 cout << m_NodeLayer[layer] << " contains " << nDaughters << " nodes : " << endl;
325 for (Int_t i = 0; i < nDaughters; i++) {
326 cout << i << " : " << nodeLayer->GetVolume()->GetNode(i)->GetName() << endl;
327 }
328 }
329
330 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
331 m_NodeReplica[layer][replica] = nodeLayer->GetVolume()->GetNode(replica);
332 //cout << layer << " " << replica << " " << m_NodeReplica[layer][replica]->GetName() << endl;
333 }
334 }
335 }
336
337 //std::cout << "MdcROOTGeo::SetNode, end of set node" << std::endl;
338}
339
340int
341MdcROOTGeo::CorrectReplica(int layer, int replica)
342{
343 int rep = replica;
344 for (intMap::iterator iter = m_CorrectMap.begin(); iter != m_CorrectMap.end(); iter++) {
345 if (layer == (*iter).first ||
346 (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut &&
347 layer - m_kAxialLayerOut == (*iter).first)) {
348 rep -= (*iter).second;
349 if (rep < 0) rep += m_kReplica[layer];
350 }
351 }
352
353 //std::cout << "layer" << layer << " " << replica << "->" << rep << std::endl;
354 return rep;
355}
356
357void
359{
360 //std::cout << "begin of set defaultvis" << std::endl;
361 m_Mdc->SetLineColor(m_MdcColor);
362 m_Mdc->SetVisibility(0);
363
364 for (int segment = 1; segment <= m_kSegment; segment++) {
365 GetVolumeSegment(segment)->SetLineColor(m_segmentColor);
366 //if (segment > 3) GetVolumeSegment(segment)->SetVisibility(0);
367 GetVolumeSegment(segment)->SetVisibility(1);
368 }
369
370 for (int layer =0; layer < m_kLayer; layer++) {
371 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
372 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
373 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
374 GetVolumeLayer(layer)->SetLineColor(m_hypeColor);
375 GetVolumeReplica(layer)->SetLineColor(m_twistedTubsColor);
376 }
377 else {
378 GetVolumeLayer(layer)->SetLineColor(m_tubeColor);
379 GetVolumeReplica(layer)->SetLineColor(m_replicaColor);
380 }
381 GetVolumeLayer(layer)->SetVisibility(0);
382 GetVolumeReplica(layer)->SetVisibility(1);
383 }
384
385 for (int segment = 1; segment <= m_kSegment; segment++) {
386 for (int no = 0; no < 2; no++) {
387 GetSegment(segment, no)->SetVisibility(0);
388 }
389 }
390
391 for (int layer = 0; layer < m_kLayer; layer++) {
392 GetLayer(layer)->SetVisibility(0);
393 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
394 GetReplica(layer, replica)->SetVisibility(0);
395 }
396 }
397
398 //std::cout << "end of set defaultvis" << std::endl;
399}
400
401void
403{
404 //std::cout << "begin of set defaultvis" << std::endl;
405 m_Mdc->SetLineColor(m_MdcColor);
406 m_Mdc->SetVisibility(0);
407
408 for (int segment = 1; segment <= m_kSegment; segment++) {
409 GetVolumeSegment(segment)->SetLineColor(m_segmentColor);
410 //if (segment > 3) GetVolumeSegment(segment)->SetVisibility(0);
411 GetVolumeSegment(segment)->SetVisibility(1);
412 }
413
414 for (int layer =0; layer < m_kLayer; layer++) {
415 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
416 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
417 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
418 GetVolumeLayer(layer)->SetLineColor(m_hypeColor);
419 GetVolumeReplica(layer)->SetLineColor(m_twistedTubsColor);
420 }
421 else {
422 GetVolumeLayer(layer)->SetLineColor(m_tubeColor);
423 GetVolumeReplica(layer)->SetLineColor(m_replicaColor);
424 }
425 GetVolumeLayer(layer)->SetVisibility(1);
426 GetVolumeReplica(layer)->SetVisibility(1);
427 }
428
429 for (int segment = 1; segment <= m_kSegment; segment++) {
430 for (int no = 0; no < 2; no++) {
431 GetSegment(segment, no)->SetVisibility(1);
432 }
433 }
434
435 for (int layer = 0; layer < m_kLayer; layer++) {
436 GetLayer(layer)->SetVisibility(1);
437 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
438 GetReplica(layer, replica)->SetVisibility(1);
439 }
440 }
441
442
443
444}
445
446void
448{
449 for (int segment = 1; segment <= m_kSegment; segment++) {
450 GetVolumeSegment(segment)->SetVisibility(0);
451 }
452
453 for (int layer = 0; layer < m_kLayer; layer++) {
454 GetVolumeLayer(layer)->SetVisibility(0);
455 GetVolumeReplica(layer)->SetVisibility(1);
456 }
457
458 for (int segment = 1; segment <= m_kSegment; segment++) {
459 for (int no = 0; no < 2; no++) {
460 GetSegment(segment, no)->SetVisibility(0);
461 }
462 }
463
464 for (int layer = 0; layer < m_kLayer; layer++) {
465 GetLayer(layer)->SetVisibility(0);
466 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
467 if (replica < m_kReplica[layer]/4) GetReplica(layer, replica)->SetVisibility(0);
468 else GetReplica(layer, replica)->SetVisibility(1);
469 }
470 }
471}
472
473void
475{
476 for (int segment = 1; segment <= m_kSegment; segment++) {
477 GetVolumeSegment(segment)->SetVisibility(0);
478 }
479
480 for (int layer = 0; layer < m_kLayer; layer++) {
481 GetVolumeLayer(layer)->SetVisibility(0);
482 GetVolumeReplica(layer)->SetVisibility(1);
483 }
484
485 for (int segment = 1; segment <= m_kSegment; segment++) {
486 for (int no = 0; no < 2; no++) {
487 GetSegment(segment, no)->SetVisibility(0);
488 }
489 }
490
491 for (int layer = 0; layer < m_kLayer; layer++) {
492 GetLayer(layer)->SetVisibility(0);
493 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
494 if (replica < m_kReplica[layer]/4 ||
495 replica > m_kReplica[layer]*3/4 ) GetReplica(layer, replica)->SetVisibility(1);
496 else GetReplica(layer, replica)->SetVisibility(0);
497 }
498 }
499}
500
501void
503{
504 if (gGeoManager == 0) std::cout << "Create gGeoManager first" << std::endl;
505 TGeoNode *bes = gGeoManager->GetTopNode();
506 TGeoNode *nodeMdc = bes->GetVolume()->GetNode(m_childNo);
507 //std::cout << "Mdc m_childNo " << m_childNo << std::endl;
508
509 if (!m_Mdc) std::cout << "m_Mdc = 0" << std::endl;
510
511 for (int segment = 0; segment < 2*m_kSegment-2; segment++) {
512 m_PhysicalSegment[segment] = gGeoManager->MakePhysicalNode( TString("/") + bes->GetName() +
513 TString("/") + nodeMdc->GetName() +
514 TString("/") + m_Mdc->GetNode((m_kLayer + 2*m_kSegment - 2 - 1) - segment)->GetName() );
515 m_PhysicalSegment[segment]->SetVisibility(0);
516 m_PhysicalSegment[segment]->SetIsVolAtt(kFALSE);
517 m_PhysicalSegment[segment]->SetLineColor(m_segmentColor);
518 //cout << m_PhysicalSegment[segment]->GetName() << endl;
519 }
520
521 for (int layer = 0; layer < m_kLayer; layer++) {
522 TGeoNode *nodeLayer = GetLayer(layer);
523 //std::cout << "Layer " << layer << std::endl;
524 for (int replica = 0; replica < m_kReplica[layer]; replica++) {
525 TGeoNode *nodeReplica = GetReplica(layer, replica);
526
527 m_PhysicalReplica[layer][replica] = gGeoManager->MakePhysicalNode( TString("/") + bes->GetName() +
528 TString("/") + nodeMdc->GetName() +
529 TString("/") + nodeLayer->GetName() +
530 TString("/") + nodeReplica->GetName() );
531 m_PhysicalReplica[layer][replica]->SetVisibility(0);
532 m_PhysicalReplica[layer][replica]->SetIsVolAtt(kFALSE);
533 if ( (layer >= 0 && layer < m_kStereoLayerIn) ||
534 (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
535 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) ) {
536 m_PhysicalReplica[layer][replica]->SetLineColor(m_twistedTubsColor);
537 }
538 else {
539 m_PhysicalReplica[layer][replica]->SetLineColor(m_replicaColor);
540 }
541 //if (m_PhysicalReplica[layer][replica]->IsVolAttributes()) std::cout << "yes " << std::endl;
542 }
543 }
544
545 SetDetector();
546}
547
548/*
549void
550MdcROOTGeo::SetPhysicalDefaultVis()
551{
552for (int part = 0; part < m_kPart; part++) {
553 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
554 for (int phi = 0; phi < nPhi; phi++) {
555 int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
556 for (int theta = 0; theta < nTheta; theta++) {
557 m_PhysicalCrystal[part][phi][theta]->SetIsVolAtt(kFALSE);
558 if (part == 1) m_PhysicalCrystal[part][phi][theta]->SetLineColor(m_brCrystalColor);
559 else m_PhysicalCrystal[part][phi][theta]->SetLineColor(m_ecCrystalColor);
560 }
561 }
562 }
563 //std::cout << "end of set defaultvis" << std::endl;
564}
565*/
566
567void
569{
570 BesView *view = 0;
571 if (gPad) view = (BesView*)gPad->GetView();
572 //if (view) cout << "viewVisFull3DMdc " << view->GetVisFull3DMdc() << endl;
573
574 m_DetectorsArray->Clear();
575 for (int segment = 0; segment < 2*m_kSegment-2; segment++) {
576 TGeoPhysicalNode *phyNode = 0;
577 phyNode = m_PhysicalSegment[segment];
578 //cout << m_PhysicalSegment[segment]->GetName() << endl;
579 if (phyNode) {
580 phyNode->SetVisibility(0); // set all invisible before set any visible
581 if ( (segment >= 2 && segment <= 3) || segment > 59) {
582 m_DetectorsArray->Add( phyNode );
583 }
584 else if (view && view->GetVisFull3DMdc()) {
585 m_DetectorsArray->Add( phyNode );
586 }
587 }
588 }
589 /*
590 for (int part = 0; part < m_kPart; part++) {
591 int nPhi = (part == 1 ? m_kPhiBr : m_kPhiEc);
592 for (int phi = 0; phi < nPhi; phi++) {
593 int nTheta = (part == 1 ? m_kThetaBr : m_kThetaEc);
594 for (int theta = 0; theta < nTheta; theta++) {
595 // This is you detector, set it on
596 if ( (part == 1 && theta != 0 && theta != 43 && ((phi != 0 && phi != 60) || theta%2 == 0)) ||
597 (part != 1 && theta != 0) ) {
598 m_PhysicalCrystal[part][phi][theta]->SetVisibility(0);
599 }
600
601 // This is you hit
602 // when you are to set fired hits to another color, say red,
603 // SetIsVolAtt(kFALSE) and to then SetLineColor(kRed);
604 if (phi == 12 && theta == 5) {
605 m_PhysicalCrystal[part][phi][theta]->SetVisibility(1);
606 m_PhysicalCrystal[part][phi][theta]->SetLineColor(2);
607 }
608 }
609 }
610 }
611 std::cout << "end of set detector on" << std::endl;
612 */
613}
614
615void
617{
618 // set previous event hits to default vis
619 cout << "m_HitsArray size(): " << m_HitsArray->GetEntries() << endl;
620 cout << "m_2DHitsArray size(): " << m_2DHitsArray->GetEntries() << endl;
621 for (int i = 0; i < m_HitsArray->GetEntries(); i++) {
622 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
623 phyNode->SetVisibility(0);
624 }
625 m_HitsArray->Clear("C");
626
627 // set previous event 2D hits info to default
628 for (int i = 0; i < m_2DHitsArray->GetEntries(); i++) {
629 Mdc2DWire *aWire = (Mdc2DWire*)m_2DHitsArray->At(i);
630 aWire->ClearInfo();
631 aWire->AddInfo(aWire->GetTitle());
632 aWire->CloseInfo();
633 }
634 m_2DHitsArray->Clear("C");
635
636 // set new hits
637 if (gEvent) m_MdcDigiCol = gEvent->GetMdcDigiCol();
638
639 for (int i = 0; i < m_MdcDigiCol->GetEntries(); i++) {
640 TMdcDigi *aMdcDigi = (TMdcDigi*)m_MdcDigiCol->At(i);
641 Identifier aMdcID( aMdcDigi->getIntId() );
642 int layer = MdcID::layer( aMdcID );
643 int wire = MdcID::wire( aMdcID );
644
645 Double_t time = RawDataUtil::MdcTime(aMdcDigi->getTimeChannel());
646 Int_t charge = RawDataUtil::MdcCharge(aMdcDigi->getChargeChannel());
647
648 TGeoPhysicalNode *phyNode = 0;
649 if (layer < 36) { // number of layers in the three inner
650 phyNode = GetPhysicalReplica(layer, wire);
651 if (phyNode) m_HitsArray->Add( phyNode );
652 }
653 else {
654 phyNode = GetPhysicalReplica( GetSimuLayer(layer), wire );
655 if (phyNode) m_HitsArray->Add( phyNode );
656 phyNode = GetPhysicalReplica( GetSimuLayer(layer)+1, wire);
657 if (phyNode) m_HitsArray->Add( phyNode );
658 }
659
660 Mdc2DWire *aWire = 0;
661 aWire = m_Mdc2DWire[layer][wire];
662 if (aWire) {
663 aWire->ClearInfo();
664 aWire->AddInfo(aWire->GetTitle());
665 double evTime = gEvent->GetHeader().GetEvTime();
666
667 char data[100];
668 if(time>1000000) {
669 sprintf(data, "NO time");
670 }else{
671 sprintf(data, "time=%-.1f ns", time);
672 if(fabs(evTime)>0.0001){
673 sprintf(data, "%s, Tdrift(Raw)=%-.1f ns", data, time - evTime +230);
674 }
675 }
676 if(charge>1000000) {
677 sprintf(data, "%s, NO charge", data);
678 }else{
679 sprintf(data, "%s, charge=%d", data,charge);
680 }
681 aWire->AddInfo( TString(data) );
682 sprintf(data, "Fired");
683 aWire->AddInfo( TString(data) );
684
685 aWire->SetTime(time);//yzhang
686 aWire->SetCharge(charge);//yzhang
687 unsigned int overflow = aMdcDigi->getOverflow();
688 aWire->SetQOverflow(overflow&2);//yzhang
689 aWire->SetEvTime(evTime);
690
691 aWire->CloseInfo();
692
693 m_2DHitsArray->Add(aWire);
694 }
695
696 }
697}
698
699void
701{
702 BesView *view = 0;
703 if (gPad) view = (BesView*)gPad->GetView();
704
705 for (int i = 0; i < m_DetectorsArray->GetEntries(); i++) {
706 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
707 if (view && view->GetVisMdcGlobal()) {
708 phyNode->SetVisibility(1);
709 continue;
710 }
711 phyNode->SetVisibility(0);
712 }
713}
714
715void
717{
718 BesView *view = 0;
719 if (gPad) view = (BesView*)gPad->GetView();
720
721 for (int i = 0; i < m_HitsArray->GetEntries(); i++) {
722 TGeoPhysicalNode *phyNode = (TGeoPhysicalNode*)m_HitsArray->At(i);
723 if (view && view->GetVisMdcHitsGlobal()) {
724 phyNode->SetVisibility(1);
725 }
726 else {
727 phyNode->SetVisibility(0);
728 }
729 }
730}
731
732void
734 k_TFire= input;
735 //cout << "Mdc ROOT Geometry TDC Match: " << k_TMatch << endl;
736}
737
738//void
739//MdcROOTGeo::SetTOverflow(Bool_t input){
740// k_TOverflow = input;
741// //cout << "Mdc ROOT Geometry TDC Match: " << k_TMatch << endl;
742//}
743
744void
746 k_QNotOverflow = input;
747 //cout << "Mdc ROOT Geometry TDC Match: " << k_TMatch << endl;
748}
749
750void
752 k_QFire = input;
753 //cout << "Mdc ROOT Geometry ADC Match: " << k_QMatch << endl;
754}
755
756void
758 k_ColorfulWire = input;
759}
760
761void
763 k_MdcTimeSubEvTime = input;
764}
765
766TGeoVolume*
767MdcROOTGeo::GetVolumeSegment( int segment )
768{
769 std::stringstream osname;
770 osname << "logical" << "Mdc" << "Segment" << segment;
771 return GetLogicalVolume( osname.str() );
772}
773
774TGeoVolume*
776{
777 std::stringstream osname;
778 if (layer >= 0 && layer < m_kStereoLayerIn) {
779 osname << "logical" << "Mdc" << "Stereo" << "Layer" << layer;
780 }
781 else if (layer >= m_kStereoLayerIn && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
782 osname << "logical" << "Mdc" << "Axial" << "Layer" << layer;
783 }
784 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
785 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
786 osname << "logical" << "Mdc" << "Stereo" << "Layer" << layer;
787 }
788 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut &&
789 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut) {
790 osname << "logical" << "Mdc" << "Axial" << "Layer" << layer << "_0";
791 }
792 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut &&
793 layer < m_kLayer) {
794 osname << "logical" << "Mdc" << "Axial" << "Layer" << layer - m_kAxialLayerOut << "_1";
795 }
796
797 return GetLogicalVolume( osname.str() );
798}
799
800TGeoVolume*
802{
803 std::stringstream osname;
804 if (layer >= 0 && layer < m_kStereoLayerIn) {
805 osname << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "Cell";
806 }
807 else if (layer >= m_kStereoLayerIn
808 && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
809 osname << "logical" << "Mdc" << "Axial" << "Layer" << layer << "Cell";
810 }
811 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
812 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
813 osname << "logical" << "Mdc" << "Stereo" << "Layer" << layer << "Cell";
814 }
815 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut &&
816 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut) {
817 osname << "logical" << "Mdc"
818 << "Axial" << "Layer" << layer << "_0" << "Cell";
819 }
820 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut + m_kAxialLayerOut
821 && layer < m_kLayer) {
822 osname << "logical" << "Mdc"
823 << "Axial" << "Layer" << layer - m_kAxialLayerOut
824 << "_1" << "Cell";
825 }
826
827 return GetLogicalVolume( osname.str() );
828}
829
830TGeoNode*
831MdcROOTGeo::GetSegment( int segment, int no )
832{
833 std::stringstream osname;
834 if (segment == 1 || segment == 2) {
835 osname << "pv_" << "logical" << "Mdc"
836 << "Segment" << segment << "_"
837 << (m_kLayer + (2*m_kSegment -2) -1) - (segment - 1);
838 }
839 else {
840 osname << "pv_" << "logical" << "Mdc"
841 << "Segment" << segment << "_"
842 << (m_kLayer + (2*m_kSegment -2) -1) - 2 - (segment - 3)*2 - no;
843 }
844
845 return GetNode( osname.str() );
846}
847
848TGeoNode*
849MdcROOTGeo::GetLayer( int layer )
850{
851 // if m_NodeLayer[] set in SetNode(), could also return m_NodeLayer[layer]
852 if (m_ROOTGeoInit == 2) { // from GDML
853 std::stringstream osname;
854 if (layer >= 0 && layer < m_kStereoLayerIn) {
855 osname << "pv_" << "logical" << "Mdc"
856 << "Stereo" << "Layer" << layer << "_" << layer;
857 }
858 else if (layer >= m_kStereoLayerIn
859 && layer < m_kStereoLayerIn + m_kAxialLayerIn) {
860 osname << "pv_" << "logical" << "Mdc"
861 << "Axial" << "Layer" << layer << "_" << layer;
862 }
863 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn &&
864 layer < m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut) {
865 osname << "pv_" << "logical" << "Mdc"
866 << "Stereo" << "Layer" << layer << "_" << layer;
867 }
868 else if (layer >= m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut
869 && layer < m_kLayer) {
870 Int_t nBeforeAxialLayerOut =
871 m_kStereoLayerIn + m_kAxialLayerIn + m_kStereoLayerOut;
872 Int_t iTrueLayer =
873 nBeforeAxialLayerOut + (layer - nBeforeAxialLayerOut)/2;
874 if (layer%2 == 0) {
875 osname << "pv_" << "logical" << "Mdc"
876 << "Axial" << "Layer" << iTrueLayer << "_0" << "_" << layer;
877 }
878 else {
879 osname << "pv_" << "logical" << "Mdc"
880 << "Axial" << "Layer" << iTrueLayer << "_1" << "_" << layer;
881 }
882 }
883
884 //std::cout << osname.str() << std::endl;
885 return GetNode( osname.str() );
886 }
887 else if (m_ROOTGeoInit == 1) { // from ROOT object
888 if (m_NodeLayer[layer] != 0) {
889 return m_NodeLayer[layer];
890 }
891 else {
892 //std::cout << "Node: " << "Layer" << layer << " not found" << std::endl;
893 return 0;
894 }
895 }
896
897 return 0;
898}
899
900TGeoNode*
901MdcROOTGeo::GetReplica( int layer, int replica )
902{
903 if (m_NodeReplica[layer][replica] != 0) {
904 //std::cout << " replica " << layer << " " << replica << " found " << std::endl;
905 return m_NodeReplica[layer][replica];
906 }
907 else {
908 //std::cout << "Node: " << "Layer" << layer << "Replica" << replica << " not found" << std::endl;
909 return 0;
910 }
911}
912
913TGeoPhysicalNode*
915{
916 if (m_PhysicalSegment[segment] != 0) {
917 return m_PhysicalSegment[segment];
918 }
919 else {
920 //std::cout << "PhysicalNode: " << "Segment" << segment << " not found" << std::endl;
921 return 0;
922 }
923}
924
925TGeoPhysicalNode*
926MdcROOTGeo::GetPhysicalReplica( Int_t layer, Int_t replica )
927{
928 if (m_PhysicalReplica[layer][replica] != 0) {
929 return m_PhysicalReplica[layer][replica];
930 }
931 else {
932 //std::cout << "PhysicalNode: " << "Layer" << layer << "Replica" << replica << " not found" << std::endl;
933 return 0;
934 }
935}
936
938MdcROOTGeo::Get2DWire( Int_t layer, Int_t wire)
939{
940 if (m_Mdc2DWire[layer][wire]) return m_Mdc2DWire[layer][wire];
941 else return 0;
942}
943
944Int_t
946{
947 if (trueLayer < 36 || trueLayer >= m_kTrueLayer) return trueLayer;
948 if (trueLayer >= 36) return (36 + 2*(trueLayer-36));
949 return trueLayer;
950}
951
952Bool_t
953MdcROOTGeo::IsHit(Int_t layer, Int_t wire)
954{
955 if (m_MdcDigiCol) {
956 for (int i = 0; i < m_MdcDigiCol->GetEntries(); i++) {
957 Identifier mdcID( ((TMdcDigi*)m_MdcDigiCol->At(i))->getIntId() );
958 if (layer == MdcID::layer( mdcID ) && wire == MdcID::wire( mdcID )) {
959 return kTRUE;
960 }
961 }
962 }
963
964 return kFALSE;
965}
966
967void
968MdcROOTGeo::Draw(Option_t *option)
969{
970 TString opt = option;
971 opt.ToUpper();
972
973 if (!m_2DGeoInit) cout << "MdcROOTGeo::Draw2D(), 2D Geometry not initialized!" << endl;
974 BesView *view = (BesView*)gPad->GetView();
975 if (!view) cout << "MdcROOTGeo::Draw(), BesView not found" << endl;
976
977 if (view->GetVisMdcGlobal()) { // MdcVisGlobal
978 if (opt.Contains("XY")) {
979 m_MdcXY->Draw("");
980 for (Int_t i = 0; i < 4; i++) {
981 //m_MdcXYSuper[i]->Draw("");
982 }
983 }
984
985 if (opt.Contains("ZR")) {
986 for (Int_t i = 0; i < 2; i++) {
987 m_MdcZR[i]->SetRotatable(true);
988 m_MdcZR[i]->Draw("");
989 }
990 }
991
992 TString wireOpt;
993 if (view->GetVisMdcTubes()) wireOpt += "TUBE";
994 if (view->GetVisMdcWires()) wireOpt += ",WIRE";
995
996 Int_t replicaDraw = 0; // change draw sequence in a circle, (-1: 0->Max; 1: Max->0)
997 for (Int_t layer = 0; layer < m_kTrueLayer; layer++) {
998 Int_t simuLayer = GetSimuLayer(layer);
999 for (int replica = 0; replica < m_kReplica[simuLayer]; replica++) {
1000 if (m_kStereoDir[layer] == -1) replicaDraw = replica;
1001 else if (m_kStereoDir[layer] == 1) replicaDraw = m_kReplica[simuLayer]-1 - replica;
1002 else replicaDraw = replica;
1003
1004 if (m_Mdc2DWire[layer][replicaDraw]) {
1005 //cout << layer << " " << replicaDraw << endl;
1006 //m_Mdc2DWire[layer][replicaDraw]->SetHighlighted(false);
1007 m_Mdc2DWire[layer][replicaDraw]->SetFired(false);
1008 m_Mdc2DWire[layer][replicaDraw]->Draw(wireOpt);
1009 }
1010 }
1011 }
1012 }
1013}
1014
1015void
1016MdcROOTGeo::DrawHits(Option_t *option)
1017{
1018 // cout << "Draw Hits" << endl;
1019 BesView *view = (BesView*)gPad->GetView();
1020 if (!view) cout << "MdcROOTGeo::DrawHits(), BesView not found" << endl;
1021
1022 //cout << "VisMdcHitsGlobal " << view->GetVisMdcHitsGlobal() << endl;
1023 //cout << "VisMdcHits " << view->GetVisMdcHits() << endl;
1024
1025
1026 if (view->GetVisMdcHitsGlobal()) {
1027 TString wireOpt("");
1028 if (view->GetVisMdcTubes()) wireOpt += ",TUBE";
1029 if (view->GetVisMdcHits()) wireOpt += ",WIRE";
1030
1031 if (m_MdcDigiCol) {
1032 for (int i = 0; i < m_MdcDigiCol->GetEntries(); i++) {
1033 TMdcDigi *aMdcDigi = (TMdcDigi*)m_MdcDigiCol->At(i);
1034
1035 Identifier aMdcID( aMdcDigi->getIntId() );
1036 int layer = MdcID::layer( aMdcID );
1037 int wire = MdcID::wire( aMdcID );
1038 unsigned int overflow = aMdcDigi->getOverflow();
1039
1040 Mdc2DWire *aWire = 0;
1041 aWire = m_Mdc2DWire[layer][wire];
1042 if (aWire){
1043 if ((k_TFire) && (aMdcDigi->getTimeChannel() == 0x7FFFFFFF)){
1044 continue;
1045 }
1046 if ((k_QFire) && (aMdcDigi->getChargeChannel() == 0x7FFFFFFF)){
1047 continue;
1048 }
1049 //if ((!k_TOverflow) && ((overflow&1)>0) ){
1050 // continue;
1051 //}
1052 if ((k_QNotOverflow) && ((overflow&2)>0) ){
1053 continue;
1054 }
1055 aWire->SetFired(true);
1056 aWire->SetColorfulWire(k_ColorfulWire,k_MdcTimeSubEvTime);
1057 aWire->Draw(wireOpt);
1058 }
1059 }
1060 }
1061 }
1062}
double P(RecMdcKalTrack *trk)
TTree * data
Double_t time
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
double sin(const BesAngle a)
double cos(const BesAngle a)
virtual void Draw(Option_t *option="")
virtual void Draw(Option_t *option="")
virtual void ClearInfo()
Definition: Mdc2DWire.cxx:184
void SetQOverflow(Bool_t qOvfl)
Definition: Mdc2DWire.cxx:499
virtual void CloseInfo()
Definition: Mdc2DWire.cxx:190
void SetTime(Double_t time)
Definition: Mdc2DWire.cxx:485
void SetColorfulWire(Bool_t colorfulWire, Bool_t subEvTime)
Definition: Mdc2DWire.cxx:513
void SetEvTime(Double_t time)
Definition: Mdc2DWire.cxx:506
virtual void Draw(Option_t *option="")
Definition: Mdc2DWire.cxx:272
void SetCharge(Double_t charge)
Definition: Mdc2DWire.cxx:492
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
Definition: MdcID.cxx:49
static int wire(const Identifier &id)
Definition: MdcID.cxx:54
TGeoNode * GetSegment(int segment, int no)
Get segment node;.
int CorrectReplica(int layer, int replica)
Correct some axial layer id to copyNo;.
void SetVolumeDefaultVis()
Set default visual attributes;.
TGeoVolume * GetVolumeLayer(int layer)
Get layer volume;
TGeoPhysicalNode * GetPhysicalSegment(int segment)
Get segment physical node;.
void SetNode()
Set the pointers to theirs nodes;.
void InitFromROOT(TGeoVolume *vol)
Initialize ROOTGeo from TGeoVolume logicalMdc.
TGeoNode * GetReplica(int layer, int replica)
Get replica node;.
TGeoVolume * GetVolumeReplica(int layer)
Get replica volume;.
TGeoVolume * GetVolumeSegment(int segment)
Get segment volume;.
void SetVisMdcDetector()
Set Mdc default detector visibility;.
Int_t GetSimuLayer(Int_t trueLayer)
Trans trueLayer to simuLayer (0~42)->(0~49)
Mdc2DWire * Get2DWire(Int_t layer, Int_t replica)
Get Mdc2DWire;.
void SetVolumeMdc(TGeoVolume *vol)
Set Mdc volume, while initializing from ROOT;.
TGeoPhysicalNode * GetPhysicalReplica(int layer, int replica)
Get replica physical node;.
void SetPhysicalNode()
Set the pointers to the physical nodes;.
Bool_t IsHit(Int_t layer, Int_t wire)
Judge whether the digiCol contains (layer, wire)
void SetDetector()
Set default physical node attributes;.
void InitFromGDML(const char *gdmlFile, const char *setupName)
Initialize ROOTGeo from GDML.
void SetHits()
Set all physicalNodes corresponding to digiCol;.
static double MdcCharge(int chargeChannel)
TGeoNode * GetNode(const std::string &nn)
Get a node(physical volume) by name;.
TGeoVolume * GetLogicalVolume(const std::string &vn)
Get a logical volume by name;.
void ReadGdml(const char *gdmlFile, const char *setupName)
Initialize the instance of ROOTGeo.
UInt_t getOverflow() const
Definition: TMdcDigi.cxx:42
UInt_t getIntId() const
Definition: TRawData.cxx:50
UInt_t getChargeChannel() const
Definition: TRawData.cxx:60
UInt_t getTimeChannel() const
Definition: TRawData.cxx:55