Geant4  10.01
G4ScoringBox.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4ScoringBox.cc 83518 2014-08-27 12:57:10Z gcosmo $
28 //
29 
30 #include "G4ScoringBox.hh"
31 
32 #include "G4SystemOfUnits.hh"
33 #include "G4Box.hh"
34 #include "G4LogicalVolume.hh"
35 #include "G4VPhysicalVolume.hh"
36 #include "G4PVPlacement.hh"
37 #include "G4PVReplica.hh"
38 #include "G4PVDivision.hh"
39 #include "G4VisAttributes.hh"
40 #include "G4VVisManager.hh"
41 #include "G4VScoreColorMap.hh"
42 
44 #include "G4SDParticleFilter.hh"
45 #include "G4VPrimitiveScorer.hh"
46 
47 #include "G4ScoringManager.hh"
48 
49 #include <map>
50 #include <fstream>
51 
53  :G4VScoringMesh(wName), fSegmentDirection(-1)
54 {
55  fShape = boxMesh;
56  fDivisionAxisNames[0] = "X";
57  fDivisionAxisNames[1] = "Y";
58  fDivisionAxisNames[2] = "Z";
59 }
60 
62 {
63 }
64 
66 
67  if(verboseLevel > 9) G4cout << "G4ScoringBox::SetupGeometry() ..." << G4endl;
68 
69  // World
70  G4VPhysicalVolume * scoringWorld = fWorldPhys;
71  G4LogicalVolume * worldLogical = scoringWorld->GetLogicalVolume();
72 
73  // Scoring Mesh
74  if(verboseLevel > 9) G4cout << fWorldName << G4endl;
75  G4String boxName = fWorldName;
76 
77  if(verboseLevel > 9)
78  G4cout << fSize[0] << ", " << fSize[1] << ", " << fSize[2] << G4endl;
79  G4VSolid * boxSolid = new G4Box(boxName+"0", fSize[0], fSize[1], fSize[2]);
80  G4LogicalVolume * boxLogical = new G4LogicalVolume(boxSolid, 0, boxName+"_0");
82  boxLogical, boxName+"0", worldLogical, false, 0);
83 
84  //G4double fsegment[3][3];
85  //G4int segOrder[3];
86  //GetSegmentOrder(fSegmentDirection, fNSegment, segOrder, fsegment);
87  //EAxis axis[3] = {kXAxis, kYAxis, kZAxis};
88 
89  G4String layerName[2] = {boxName + "_1", boxName + "_2"};
90  G4VSolid * layerSolid[2];
91  G4LogicalVolume * layerLogical[2];
92 
93  //-- fisrt nested layer (replicated to x direction)
94  if(verboseLevel > 9) G4cout << "layer 1 :" << G4endl;
95  layerSolid[0] = new G4Box(layerName[0],
96  fSize[0]/fNSegment[0],
97  fSize[1],
98  fSize[2]);
99  layerLogical[0] = new G4LogicalVolume(layerSolid[0], 0, layerName[0]);
100  if(fNSegment[0] > 1) {
101  if(verboseLevel > 9)
102  G4cout << "G4ScoringBox::Construct() : Replicate to x direction" << G4endl;
104  {
105  new G4PVReplica(layerName[0], layerLogical[0], boxLogical, kXAxis,
106  fNSegment[0], fSize[0]/fNSegment[0]*2.);
107  }
108  else
109  {
110  new G4PVDivision(layerName[0], layerLogical[0], boxLogical, kXAxis,
111  fNSegment[0], 0.);
112  }
113  } else if(fNSegment[0] == 1) {
114  if(verboseLevel > 9)
115  G4cout << "G4ScoringBox::Construct() : Placement" << G4endl;
116  new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), layerLogical[0], layerName[0],
117  boxLogical, false, 0);
118  } else
119  G4cerr << "ERROR : G4ScoringBox::SetupGeometry() : invalid parameter ("
120  << fNSegment[0] << ") "
121  << "in placement of the first nested layer." << G4endl;
122 
123  if(verboseLevel > 9) {
124  G4cout << fSize[0]/fNSegment[0] << ", "
125  << fSize[1] << ", "
126  << fSize[2] << G4endl;
127  G4cout << layerName[0] << ": kXAxis, "
128  << fNSegment[0] << ", "
129  << 2.*fSize[0]/fNSegment[0] << G4endl;
130  }
131 
132  // second nested layer (replicated to y direction)
133  if(verboseLevel > 9) G4cout << "layer 2 :" << G4endl;
134  layerSolid[1] = new G4Box(layerName[1],
135  fSize[0]/fNSegment[0],
136  fSize[1]/fNSegment[1],
137  fSize[2]);
138  layerLogical[1] = new G4LogicalVolume(layerSolid[1], 0, layerName[1]);
139  if(fNSegment[1] > 1) {
140  if(verboseLevel > 9)
141  G4cout << "G4ScoringBox::Construct() : Replicate to y direction" << G4endl;
143  {
144  new G4PVReplica(layerName[1], layerLogical[1], layerLogical[0], kYAxis,
145  fNSegment[1], fSize[1]/fNSegment[1]*2.);
146  }
147  else
148  {
149  new G4PVDivision(layerName[1], layerLogical[1], layerLogical[0], kYAxis,
150  fNSegment[1], 0.);
151  }
152  } else if(fNSegment[1] == 1) {
153  if(verboseLevel > 9)
154  G4cout << "G4ScoringBox::Construct() : Placement" << G4endl;
155  new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), layerLogical[1], layerName[1],
156  layerLogical[0], false, 0);
157  } else
158  G4cerr << "ERROR : G4ScoringBox::SetupGeometry() : invalid parameter ("
159  << fNSegment[1] << ") "
160  << "in placement of the second nested layer." << G4endl;
161 
162  if(verboseLevel > 9) {
163  G4cout << fSize[0]/fNSegment[0] << ", "
164  << fSize[1]/fNSegment[1] << ", "
165  << fSize[2] << G4endl;
166  G4cout << layerName[1] << ": kYAxis, "
167  << fNSegment[1] << ", "
168  << 2.*fSize[1]/fNSegment[1] << G4endl;
169  }
170 
171  // mesh elements (replicated to z direction)
172  if(verboseLevel > 9) G4cout << "mesh elements :" << G4endl;
173  G4String elementName = boxName +"_3";
174  G4VSolid * elementSolid = new G4Box(elementName,
175  fSize[0]/fNSegment[0],
176  fSize[1]/fNSegment[1],
177  fSize[2]/fNSegment[2]);
178  fMeshElementLogical = new G4LogicalVolume(elementSolid, 0, elementName);
179  if(fNSegment[2] > 1) {
180  if(verboseLevel > 9)
181  G4cout << "G4ScoringBox::Construct() : Replicate to z direction" << G4endl;
182 
184  {
185  new G4PVReplica(elementName, fMeshElementLogical, layerLogical[1], kZAxis,
186  fNSegment[2], 2.*fSize[2]/fNSegment[2]);
187  }
188  else
189  {
190  new G4PVDivision(elementName, fMeshElementLogical, layerLogical[1], kZAxis,
191  fNSegment[2], 0.);
192  }
193  } else if(fNSegment[2] == 1) {
194  if(verboseLevel > 9)
195  G4cout << "G4ScoringBox::Construct() : Placement" << G4endl;
197  elementName, layerLogical[1], false, 0);
198  } else
199  G4cerr << "ERROR : G4ScoringBox::SetupGeometry() : "
200  << "invalid parameter (" << fNSegment[2] << ") "
201  << "in mesh element placement." << G4endl;
202 
203  if(verboseLevel > 9) {
204  G4cout << fSize[0]/fNSegment[0] << ", "
205  << fSize[1]/fNSegment[1] << ", "
206  << fSize[2]/fNSegment[2] << G4endl;
207  G4cout << elementName << ": kZAxis, "
208  << fNSegment[2] << ", "
209  << 2.*fSize[2]/fNSegment[2] << G4endl;
210  }
211 
212 
213  // set the sensitive detector
215 
216 
217  // vis. attributes
218  G4VisAttributes * visatt = new G4VisAttributes(G4Colour(.5,.5,.5));
219  visatt->SetVisibility(false);
220  layerLogical[0]->SetVisAttributes(visatt);
221  layerLogical[1]->SetVisAttributes(visatt);
222  visatt->SetVisibility(true);
224 }
225 
226 
227 void G4ScoringBox::List() const {
228  G4cout << "G4ScoringBox : " << fWorldName << " --- Shape: Box mesh" << G4endl;
229  G4cout << " Size (x, y, z): ("
230  << fSize[0]/cm << ", "
231  << fSize[1]/cm << ", "
232  << fSize[2]/cm << ") [cm]"
233  << G4endl;
234 
236 }
237 
238 void G4ScoringBox::Draw(std::map<G4int, G4double*> * map,
239  G4VScoreColorMap* colorMap, G4int axflg) {
240 
242  if(pVisManager) {
243 
244  // cell vectors
245  std::vector<std::vector<std::vector<double> > > cell; // cell[X][Y][Z]
246  std::vector<double> ez;
247  for(int z = 0; z < fNSegment[2]; z++) ez.push_back(0.);
248  std::vector<std::vector<double> > eyz;
249  for(int y = 0; y < fNSegment[1]; y++) eyz.push_back(ez);
250  for(int x = 0; x < fNSegment[0]; x++) cell.push_back(eyz);
251 
252  std::vector<std::vector<double> > xycell; // xycell[X][Y]
253  std::vector<double> ey;
254  for(int y = 0; y < fNSegment[1]; y++) ey.push_back(0.);
255  for(int x = 0; x < fNSegment[0]; x++) xycell.push_back(ey);
256 
257  std::vector<std::vector<double> > yzcell; // yzcell[Y][Z]
258  for(int y = 0; y < fNSegment[1]; y++) yzcell.push_back(ez);
259 
260  std::vector<std::vector<double> > xzcell; // xzcell[X][Z]
261  for(int x = 0; x < fNSegment[0]; x++) xzcell.push_back(ez);
262 
263  // projections
264  G4int q[3];
265  std::map<G4int, G4double*>::iterator itr = map->begin();
266  for(; itr != map->end(); itr++) {
267  GetXYZ(itr->first, q);
268 
269  xycell[q[0]][q[1]] += *(itr->second)/fDrawUnitValue;
270  yzcell[q[1]][q[2]] += *(itr->second)/fDrawUnitValue;
271  xzcell[q[0]][q[2]] += *(itr->second)/fDrawUnitValue;
272  }
273 
274  // search max. & min. values in each slice
275  G4double xymin = DBL_MAX, yzmin = DBL_MAX, xzmin = DBL_MAX;
276  G4double xymax = 0., yzmax = 0., xzmax = 0.;
277  for(int x = 0; x < fNSegment[0]; x++) {
278  for(int y = 0; y < fNSegment[1]; y++) {
279  if(xymin > xycell[x][y]) xymin = xycell[x][y];
280  if(xymax < xycell[x][y]) xymax = xycell[x][y];
281  }
282  for(int z = 0; z < fNSegment[2]; z++) {
283  if(xzmin > xzcell[x][z]) xzmin = xzcell[x][z];
284  if(xzmax < xzcell[x][z]) xzmax = xzcell[x][z];
285  }
286  }
287  for(int y = 0; y < fNSegment[1]; y++) {
288  for(int z = 0; z < fNSegment[2]; z++) {
289  if(yzmin > yzcell[y][z]) yzmin = yzcell[y][z];
290  if(yzmax < yzcell[y][z]) yzmax = yzcell[y][z];
291  }
292  }
293 
294 
295  G4VisAttributes att;
296  att.SetForceSolid(true);
297  att.SetForceAuxEdgeVisible(true);
298 
299  G4Scale3D scale;
300  if(axflg/100==1) {
301  // xy plane
302  if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(xymin ,xymax); }
303  G4ThreeVector zhalf(0., 0., fSize[2]/fNSegment[2]*0.98);
304  G4Box xyplate("xy", fSize[0]/fNSegment[0], fSize[1]/fNSegment[1],
305  fSize[2]/fNSegment[2]*0.01);
306  for(int x = 0; x < fNSegment[0]; x++) {
307  for(int y = 0; y < fNSegment[1]; y++) {
308  G4ThreeVector pos(GetReplicaPosition(x, y, 0) - zhalf);
309  G4ThreeVector pos2(GetReplicaPosition(x, y, fNSegment[2]-1) + zhalf);
310  G4Transform3D trans, trans2;
311  if(fRotationMatrix) {
312  trans = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(pos);
313  trans = G4Translate3D(fCenterPosition)*trans;
314  trans2 = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(pos2);
315  trans2 = G4Translate3D(fCenterPosition)*trans2;
316  } else {
319  }
320  G4double c[4];
321  colorMap->GetMapColor(xycell[x][y], c);
322  att.SetColour(c[0], c[1], c[2]);//, c[3]);
323  pVisManager->Draw(xyplate, att, trans);
324  pVisManager->Draw(xyplate, att, trans2);
325 
326  }
327  }
328  }
329  axflg = axflg%100;
330  if(axflg/10==1) {
331  // yz plane
332  if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(yzmin, yzmax); }
333  G4ThreeVector xhalf(fSize[0]/fNSegment[0]*0.98, 0., 0.);
334  G4Box yzplate("yz", fSize[0]/fNSegment[0]*0.01, fSize[1]/fNSegment[1],
335  fSize[2]/fNSegment[2]);
336  for(int y = 0; y < fNSegment[1]; y++) {
337  for(int z = 0; z < fNSegment[2]; z++) {
338  G4ThreeVector pos(GetReplicaPosition(0, y, z) - xhalf);
339  G4ThreeVector pos2(GetReplicaPosition(fNSegment[0]-1, y, z) + xhalf);
340  G4Transform3D trans, trans2;
341  if(fRotationMatrix) {
342  trans = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(pos);
343  trans = G4Translate3D(fCenterPosition)*trans;
344  trans2 = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(pos2);
345  trans2 = G4Translate3D(fCenterPosition)*trans2;
346  } else {
349  }
350  G4double c[4];
351  colorMap->GetMapColor(yzcell[y][z], c);
352  att.SetColour(c[0], c[1], c[2]);//, c[3]);
353  pVisManager->Draw(yzplate, att, trans);
354  pVisManager->Draw(yzplate, att, trans2);
355 
356  }
357  }
358  }
359  axflg = axflg%10;
360  if(axflg==1) {
361  // xz plane
362  if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(xzmin,xzmax); }
363  G4ThreeVector yhalf(0., fSize[1]/fNSegment[1]*0.98, 0.);
364  G4Box xzplate("xz", fSize[0]/fNSegment[0], fSize[1]/fNSegment[1]*0.01,
365  fSize[2]/fNSegment[2]);
366  for(int x = 0; x < fNSegment[0]; x++) {
367  for(int z = 0; z < fNSegment[2]; z++) {
368  G4ThreeVector pos(GetReplicaPosition(x, 0, z) - yhalf);
369  G4ThreeVector pos2(GetReplicaPosition(x, fNSegment[1]-1, z) + yhalf);
370  G4Transform3D trans, trans2;
371  if(fRotationMatrix) {
372  trans = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(pos);
373  trans = G4Translate3D(fCenterPosition)*trans;
374  trans2 = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(pos2);
375  trans2 = G4Translate3D(fCenterPosition)*trans2;
376  } else {
379  }
380  G4double c[4];
381  colorMap->GetMapColor(xzcell[x][z], c);
382  att.SetColour(c[0], c[1], c[2]);//, c[3]);
383  pVisManager->Draw(xzplate, att, trans);
384  pVisManager->Draw(xzplate, att, trans2);
385 
386  }
387  }
388  }
389  }
390  colorMap->SetPSUnit(fDrawUnit);
391  colorMap->SetPSName(fDrawPSName);
392  colorMap->DrawColorChart();
393 }
394 
396 
398  fSize[2]/fNSegment[2]);
399  G4ThreeVector pos(-fSize[0] + 2*(x+0.5)*width.x(),
400  -fSize[1] + 2*(y+0.5)*width.y(),
401  -fSize[2] + 2*(z+0.5)*width.z());
402 
403  return pos;
404 }
405 
406 void G4ScoringBox::GetXYZ(G4int index, G4int q[3]) const {
407 
408  q[0] = index/(fNSegment[2]*fNSegment[1]);
409  q[1] = (index - q[0]*fNSegment[2]*fNSegment[1])/fNSegment[2];
410  q[2] = index - q[1]*fNSegment[2] - q[0]*fNSegment[2]*fNSegment[1];
411 
412 }
413 
415  return x + y*fNSegment[0] + z*fNSegment[0]*fNSegment[1];
416 }
417 
418 void G4ScoringBox::DrawColumn(std::map<G4int, G4double*> * map,
419  G4VScoreColorMap* colorMap,
420  G4int idxProj, G4int idxColumn)
421 {
422  G4int iColumn[3] = {2, 0, 1};
423  if(idxColumn<0 || idxColumn>=fNSegment[iColumn[idxProj]])
424  {
425  G4cerr << "ERROR : Column number " << idxColumn
426  << " is out of scoring mesh [0," << fNSegment[iColumn[idxProj]]-1
427  << "]. Method ignored." << G4endl;
428  return;
429  }
431  if(pVisManager) {
432 
433  // cell vectors
434  std::vector<std::vector<std::vector<double> > > cell; // cell[X][Y][Z]
435  std::vector<double> ez;
436  for(int z = 0; z < fNSegment[2]; z++) ez.push_back(0.);
437  std::vector<std::vector<double> > eyz;
438  for(int y = 0; y < fNSegment[1]; y++) eyz.push_back(ez);
439  for(int x = 0; x < fNSegment[0]; x++) cell.push_back(eyz);
440 
441  std::vector<std::vector<double> > xycell; // xycell[X][Y]
442  std::vector<double> ey;
443  for(int y = 0; y < fNSegment[1]; y++) ey.push_back(0.);
444  for(int x = 0; x < fNSegment[0]; x++) xycell.push_back(ey);
445 
446  std::vector<std::vector<double> > yzcell; // yzcell[Y][Z]
447  for(int y = 0; y < fNSegment[1]; y++) yzcell.push_back(ez);
448 
449  std::vector<std::vector<double> > xzcell; // xzcell[X][Z]
450  for(int x = 0; x < fNSegment[0]; x++) xzcell.push_back(ez);
451 
452  // projections
453  G4int q[3];
454  std::map<G4int, G4double*>::iterator itr = map->begin();
455  for(; itr != map->end(); itr++) {
456  GetXYZ(itr->first, q);
457 
458  if(idxProj == 0 && q[2] == idxColumn) { // xy plane
459  xycell[q[0]][q[1]] += *(itr->second)/fDrawUnitValue;
460  }
461  if(idxProj == 1 && q[0] == idxColumn) { // yz plane
462  yzcell[q[1]][q[2]] += *(itr->second)/fDrawUnitValue;
463  }
464  if(idxProj == 2 && q[1] == idxColumn) { // zx plane
465  xzcell[q[0]][q[2]] += *(itr->second)/fDrawUnitValue;
466  }
467  }
468 
469  // search max. & min. values in each slice
470  G4double xymin = DBL_MAX, yzmin = DBL_MAX, xzmin = DBL_MAX;
471  G4double xymax = 0., yzmax = 0., xzmax = 0.;
472  for(int x = 0; x < fNSegment[0]; x++) {
473  for(int y = 0; y < fNSegment[1]; y++) {
474  if(xymin > xycell[x][y]) xymin = xycell[x][y];
475  if(xymax < xycell[x][y]) xymax = xycell[x][y];
476  }
477  for(int z = 0; z < fNSegment[2]; z++) {
478  if(xzmin > xzcell[x][z]) xzmin = xzcell[x][z];
479  if(xzmax < xzcell[x][z]) xzmax = xzcell[x][z];
480  }
481  }
482  for(int y = 0; y < fNSegment[1]; y++) {
483  for(int z = 0; z < fNSegment[2]; z++) {
484  if(yzmin > yzcell[y][z]) yzmin = yzcell[y][z];
485  if(yzmax < yzcell[y][z]) yzmax = yzcell[y][z];
486  }
487  }
488 
489 
490  G4VisAttributes att;
491  att.SetForceSolid(true);
492  att.SetForceAuxEdgeVisible(true);
493 
494 
495  G4Scale3D scale;
496  // xy plane
497  if(idxProj == 0) {
498  if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(xymin,xymax); }
499  G4Box xyplate("xy", fSize[0]/fNSegment[0], fSize[1]/fNSegment[1],
500  fSize[2]/fNSegment[2]);
501  for(int x = 0; x < fNSegment[0]; x++) {
502  for(int y = 0; y < fNSegment[1]; y++) {
503  G4ThreeVector pos(GetReplicaPosition(x, y, idxColumn));
504  G4Transform3D trans;
505  if(fRotationMatrix) {
506  trans = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(pos);
507  trans = G4Translate3D(fCenterPosition)*trans;
508  } else {
510  }
511  G4double c[4];
512  colorMap->GetMapColor(xycell[x][y], c);
513  att.SetColour(c[0], c[1], c[2]);//, c[3]);
514  pVisManager->Draw(xyplate, att, trans);
515 
516  }
517  }
518  } else
519  // yz plane
520  if(idxProj == 1) {
521  if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(yzmin,yzmax); }
522  G4Box yzplate("yz", fSize[0]/fNSegment[0], fSize[1]/fNSegment[1],
523  fSize[2]/fNSegment[2]);
524  for(int y = 0; y < fNSegment[1]; y++) {
525  for(int z = 0; z < fNSegment[2]; z++) {
526  G4ThreeVector pos(GetReplicaPosition(idxColumn, y, z));
527  G4Transform3D trans;
528  if(fRotationMatrix) {
529  trans = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(pos);
530  trans = G4Translate3D(fCenterPosition)*trans;
531  } else {
533  }
534  G4double c[4];
535  colorMap->GetMapColor(yzcell[y][z], c);
536  att.SetColour(c[0], c[1], c[2]);//, c[3]);
537  pVisManager->Draw(yzplate, att, trans);
538  }
539  }
540  } else
541  // xz plane
542  if(idxProj == 2) {
543  if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(xzmin,xzmax);}
544  G4Box xzplate("xz", fSize[0]/fNSegment[0], fSize[1]/fNSegment[1],
545  fSize[2]/fNSegment[2]);
546  for(int x = 0; x < fNSegment[0]; x++) {
547  for(int z = 0; z < fNSegment[2]; z++) {
548  G4ThreeVector pos(GetReplicaPosition(x, idxColumn, z));
549  G4Transform3D trans;
550  if(fRotationMatrix) {
551  trans = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(pos);
552  trans = G4Translate3D(fCenterPosition)*trans;
553  } else {
555  }
556  G4double c[4];
557  colorMap->GetMapColor(xzcell[x][z], c);
558  att.SetColour(c[0], c[1], c[2]);//, c[3]);
559  pVisManager->Draw(xzplate, att, trans);
560  }
561  }
562  }
563  }
564 
565  colorMap->SetPSUnit(fDrawUnit);
566  colorMap->SetPSName(fDrawPSName);
567  colorMap->DrawColorChart();
568 }
569 
570 
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
static const double cm
Definition: G4SIunits.hh:106
G4ScoringBox(G4String wName)
Definition: G4ScoringBox.cc:52
void SetColour(const G4Colour &)
void SetPSName(G4String &psName)
G4ThreeVector fCenterPosition
CLHEP::Hep3Vector G4ThreeVector
G4ThreeVector GetReplicaPosition(G4int x, G4int y, G4int z)
static G4VVisManager * GetConcreteInstance()
G4double z
Definition: TRTMaterials.hh:39
Definition: G4Box.hh:64
G4MultiFunctionalDetector * fMFD
void SetVisibility(G4bool)
void SetPSUnit(G4String &unit)
void List() const
virtual void GetMapColor(G4double val, G4double color[4])=0
#define width
G4double fSize[3]
void DrawColumn(std::map< G4int, G4double * > *map, G4VScoreColorMap *colorMap, G4int idxProj, G4int idxColumn)
void SetForceSolid(G4bool)
int G4int
Definition: G4Types.hh:78
void GetXYZ(G4int index, G4int q[3]) const
void SetMinMax(G4double minVal, G4double maxVal)
G4double fDrawUnitValue
G4GLOB_DLL std::ostream G4cout
static G4int GetReplicaLevel()
virtual void List() const
G4RotationMatrix * fRotationMatrix
virtual void SetupGeometry(G4VPhysicalVolume *fWorldPhys)
Definition: G4ScoringBox.cc:65
HepGeom::Transform3D G4Transform3D
HepGeom::Scale3D G4Scale3D
void SetForceAuxEdgeVisible(G4bool)
G4LogicalVolume * fMeshElementLogical
G4int GetIndex(G4int x, G4int y, G4int z) const
HepGeom::Rotate3D G4Rotate3D
void Draw(std::map< G4int, G4double * > *map, G4VScoreColorMap *colorMap, G4int axflg=111)
G4LogicalVolume * GetLogicalVolume() const
HepGeom::Translate3D G4Translate3D
G4bool IfFloatMinMax() const
#define G4endl
Definition: G4ios.hh:61
G4String fDivisionAxisNames[3]
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
static const G4double pos
G4String fDrawPSName
G4GLOB_DLL std::ostream G4cerr
virtual void DrawColorChart(G4int nPoint=5)