Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ScoringCylinder.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: G4ScoringCylinder.cc 68735 2013-04-05 09:49:13Z gcosmo $
28 //
29 
30 #include "G4ScoringCylinder.hh"
31 
32 #include "G4PhysicalConstants.hh"
33 #include "G4SystemOfUnits.hh"
34 #include "G4VPhysicalVolume.hh"
35 #include "G4Tubs.hh"
36 #include "G4LogicalVolume.hh"
37 #include "G4VPhysicalVolume.hh"
38 #include "G4PVPlacement.hh"
39 #include "G4PVReplica.hh"
40 #include "G4PVDivision.hh"
41 #include "G4VisAttributes.hh"
42 #include "G4VVisManager.hh"
43 #include "G4VScoreColorMap.hh"
44 
45 #include "G4SDManager.hh"
47 #include "G4SDParticleFilter.hh"
48 #include "G4VPrimitiveScorer.hh"
49 #include "G4PSEnergyDeposit.hh"
50 #include "G4PSTrackLength.hh"
51 #include "G4PSNofStep.hh"
52 #include "G4ScoringManager.hh"
53 
54 
56  :G4VScoringMesh(wName)
57 {
59 
60  fDivisionAxisNames[0] = "Z";
61  fDivisionAxisNames[1] = "PHI";
62  fDivisionAxisNames[2] = "R";
63 }
64 
66 {;}
67 
69 {
70  if(fConstructed) {
71 
72  if(verboseLevel > 0)
73  G4cout << fWorldPhys->GetName() << " --- All quantities are reset." << G4endl;
74  ResetScore();
75 
76  } else {
77  fConstructed = true;
78  SetupGeometry(fWorldPhys);
79  }
80 }
81 
82 void G4ScoringCylinder::SetupGeometry(G4VPhysicalVolume * fWorldPhys) {
83 
84  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::SetupGeometry() ..." << G4endl;
85 
86  // World
87  G4VPhysicalVolume * scoringWorld = fWorldPhys;
88  G4LogicalVolume * worldLogical = scoringWorld->GetLogicalVolume();
89 
90  // Scoring Mesh
91  if(verboseLevel > 9) G4cout << fWorldName << G4endl;
92  G4String tubsName = fWorldName+"_mesh";
93 
94  if(verboseLevel > 9) G4cout << "R max., Dz =: " << fSize[0] << ", " << fSize[1] << G4endl;
95  G4VSolid * tubsSolid = new G4Tubs(tubsName+"0", // name
96  0., // R min
97  fSize[0], // R max
98  fSize[1], // Dz
99  0., // starting phi
100  twopi*rad); // segment phi
101  G4LogicalVolume * tubsLogical = new G4LogicalVolume(tubsSolid, 0, tubsName);
103  tubsLogical, tubsName+"0", worldLogical, false, 0);
104 
105  if(verboseLevel > 9) G4cout << " # of segments : r, phi, z =: "
106  << fNSegment[IR] << ", " << fNSegment[IPHI] << ", " << fNSegment[IZ] << G4endl;
107 
108  G4String layerName[2] = {tubsName + "1", tubsName + "2"};
109  G4VSolid * layerSolid[2];
110  G4LogicalVolume * layerLogical[2];
111 
112  //-- fisrt nested layer (replicated along z direction)
113  if(verboseLevel > 9) G4cout << "layer 1 :" << G4endl;
114  layerSolid[0] = new G4Tubs(layerName[0], // name
115  0., // inner radius
116  fSize[0], // outer radius
117  fSize[1]/fNSegment[IZ], // half len. in z
118  0., // starting phi angle
119  twopi*rad); // delta angle of the segment
120  layerLogical[0] = new G4LogicalVolume(layerSolid[0], 0, layerName[0]);
121  if(fNSegment[IZ] > 1) {
122  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replicate along z direction" << G4endl;
124  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replica" << G4endl;
125  new G4PVReplica(layerName[0], layerLogical[0], tubsLogical, kZAxis, fNSegment[IZ], 2.*fSize[1]/fNSegment[IZ]);
126  } else {
127  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Division" << G4endl;
128  new G4PVDivision(layerName[0], layerLogical[0], tubsLogical, kZAxis, fNSegment[IZ], 0.);
129  }
130  } else if(fNSegment[IZ] == 1) {
131  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Placement" << G4endl;
132  new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), layerLogical[0], layerName[0], tubsLogical, false, 0);
133  } else {
134  G4cerr << "G4ScoringCylinder::SetupGeometry() : invalid parameter ("
135  << fNSegment[IZ] << ") "
136  << "in placement of the first nested layer." << G4endl;
137  }
138 
139  // second nested layer (replicated along phi direction)
140  if(verboseLevel > 9) G4cout << "layer 2 :" << G4endl;
141  layerSolid[1] = new G4Tubs(layerName[1],
142  0.,
143  fSize[0],
144  fSize[1]/fNSegment[IZ],
145  0.,
147  layerLogical[1] = new G4LogicalVolume(layerSolid[1], 0, layerName[1]);
148  if(fNSegment[IPHI] > 1) {
149  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replicate along phi direction" << G4endl;
151  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replica" << G4endl;
152  new G4PVReplica(layerName[1], layerLogical[1], layerLogical[0], kPhi,
153  fNSegment[IPHI], twopi*rad/fNSegment[IPHI]);
154  } else {
155  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Division" << G4endl;
156  new G4PVDivision(layerName[1], layerLogical[1], layerLogical[0], kPhi, fNSegment[IPHI], 0.);
157  }
158  } else if(fNSegment[IPHI] == 1) {
159  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Placement" << G4endl;
160  new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), layerLogical[1], layerName[1], layerLogical[0], false, 0);
161  } else
162  G4cerr << "ERROR : G4ScoringCylinder::SetupGeometry() : invalid parameter ("
163  << fNSegment[IPHI] << ") "
164  << "in placement of the second nested layer." << G4endl;
165 
166  // mesh elements
167  if(verboseLevel > 9) G4cout << "mesh elements :" << G4endl;
168  G4String elementName = tubsName +"3";
169  G4VSolid * elementSolid = new G4Tubs(elementName,
170  0.,
171  fSize[0]/fNSegment[IR],
172  fSize[1]/fNSegment[IZ],
173  0.,
175  fMeshElementLogical = new G4LogicalVolume(elementSolid, 0, elementName);
176  if(fNSegment[IR] > 1) {
177 
178  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replicate along r direction" << G4endl;
179 
181  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replica" << G4endl;
182  new G4PVReplica(elementName, fMeshElementLogical, layerLogical[1], kRho,
183  fNSegment[IR], fSize[0]/fNSegment[IR]);
184  } else {
185  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Division" << G4endl;
186  new G4PVDivision(elementName, fMeshElementLogical, layerLogical[1], kRho, fNSegment[IR], 0.);
187  }
188  } else if(fNSegment[IR] == 1) {
189  if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Placement" << G4endl;
190  new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), fMeshElementLogical, elementName, layerLogical[1], false, 0);
191  } else {
192  G4cerr << "G4ScoringCylinder::SetupGeometry() : "
193  << "invalid parameter (" << fNSegment[IR] << ") "
194  << "in mesh element placement." << G4endl;
195  }
196 
197  // set the sensitive detector
199 
200 
201  // vis. attributes
202  G4VisAttributes * visatt = new G4VisAttributes(G4Colour(.5,.5,.5));
203  visatt->SetVisibility(true);
204  layerLogical[0]->SetVisAttributes(visatt);
205  layerLogical[1]->SetVisAttributes(visatt);
206  visatt = new G4VisAttributes(G4Colour(.5,.5,.5,0.01));
207  //visatt->SetForceSolid(true);
209 }
210 
212  G4cout << "G4ScoringCylinder : " << fWorldName << " --- Shape: Cylindrical mesh" << G4endl;
213 
214  G4cout << " Size (R, Dz): ("
215  << fSize[0]/cm << ", "
216  << fSize[1]/cm << ") [cm]"
217  << G4endl;
218 
220 }
221 
222 
223 void G4ScoringCylinder::Draw(std::map<G4int, G4double*> * map, G4VScoreColorMap* colorMap, G4int axflg) {
224 
226  if(pVisManager) {
227 
228  // cell vectors
229  std::vector<double> ephi;
230  for(int phi = 0; phi < fNSegment[IPHI]; phi++) ephi.push_back(0.);
231  //-
232  std::vector<std::vector<double> > zphicell; // zphicell[Z][PHI]
233  for(int z = 0; z < fNSegment[IZ]; z++) zphicell.push_back(ephi);
234  //-
235  std::vector<std::vector<double> > rphicell; // rphicell[R][PHI]
236  for(int r = 0; r < fNSegment[IR]; r++) rphicell.push_back(ephi);
237 
238  // projections
239  G4int q[3];
240  std::map<G4int, G4double*>::iterator itr = map->begin();
241  for(; itr != map->end(); itr++) {
242  if(itr->first < 0) {
243  G4cout << itr->first << G4endl;
244  continue;
245  }
246  GetRZPhi(itr->first, q);
247 
248  zphicell[q[IZ]][q[IPHI]] += *(itr->second)/fDrawUnitValue;
249  rphicell[q[IR]][q[IPHI]] += *(itr->second)/fDrawUnitValue;
250  }
251 
252  // search min./max. values
253  G4double zphimin = DBL_MAX, rphimin = DBL_MAX;
254  G4double zphimax = 0., rphimax = 0.;
255  for(int iphi = 0; iphi < fNSegment[IPHI]; iphi++) {
256  for(int iz = 0; iz < fNSegment[IZ]; iz++) {
257  if(zphimin > zphicell[iz][iphi]) zphimin = zphicell[iz][iphi];
258  if(zphimax < zphicell[iz][iphi]) zphimax = zphicell[iz][iphi];
259  }
260  for(int ir = 0; ir < fNSegment[IR]; ir++) {
261  if(rphimin > rphicell[ir][iphi]) rphimin = rphicell[ir][iphi];
262  if(rphimax < rphicell[ir][iphi]) rphimax = rphicell[ir][iphi];
263  }
264  }
265 
266  G4VisAttributes att;
267  att.SetForceSolid(true);
268  att.SetForceAuxEdgeVisible(true);
269 
270 
271  G4Scale3D scale;
272  if(axflg/100==1) {
273  // rz plane
274  }
275  axflg = axflg%100;
276  if(axflg/10==1) {
277  // z-phi plane
278  if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(zphimin, zphimax); }
279 
280  G4double zhalf = fSize[1]/fNSegment[IZ];
281  for(int phi = 0; phi < fNSegment[IPHI]; phi++) {
282  for(int z = 0; z < fNSegment[IZ]; z++) {
283  //-
284  G4double angle = twopi/fNSegment[IPHI]*phi;
285  G4double dphi = twopi/fNSegment[IPHI];
286  G4Tubs cylinder("z-phi", // name
287  fSize[0]*0.99, fSize[0], // inner radius, outer radius
288  zhalf, // half length in z
289  angle, dphi*0.99999); // starting phi angle, delta angle
290  //-
291  G4ThreeVector zpos(0., 0., -fSize[1] + fSize[1]/fNSegment[IZ]*(1 + 2.*z));
292  G4Transform3D trans;
293  if(fRotationMatrix) {
294  trans = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(zpos);
295  trans = G4Translate3D(fCenterPosition)*trans;
296  } else {
298  }
299  G4double c[4];
300  colorMap->GetMapColor(zphicell[z][phi], c);
301  att.SetColour(c[0], c[1], c[2]);//, c[3]);
302  //-
303  pVisManager->Draw(cylinder, att, trans);
304  }
305  }
306  }
307  axflg = axflg%10;
308  if(axflg==1) {
309  // r-phi plane
310  if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(rphimin, rphimax); }
311 
312  G4double rsize = fSize[0]/fNSegment[IR];
313  for(int phi = 0; phi < fNSegment[IPHI]; phi++) {
314  for(int r = 0; r < fNSegment[IR]; r++) {
315 
316  G4double rs[2] = {rsize*r, rsize*(r+1)};
317  G4double angle = twopi/fNSegment[IPHI]*phi;
318  G4double dphi = twopi/fNSegment[IPHI];
319  G4Tubs cylinder("z-phi", rs[0], rs[1], 0.001,
320  angle, dphi*0.99999);
321  /*
322  G4cout << ">>>> "
323  << rs[0] << " - " << rs[1] << " : "
324  << angle << " - " << angle + dphi
325  << G4endl;
326  */
327 
328  G4ThreeVector zposn(0., 0., -fSize[1]);
329  G4ThreeVector zposp(0., 0., fSize[1]);
330  G4Transform3D transn, transp;
331  if(fRotationMatrix) {
332  transn = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(zposn);
333  transn = G4Translate3D(fCenterPosition)*transn;
334  transp = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(zposp);
335  transp = G4Translate3D(fCenterPosition)*transp;
336  } else {
339  }
340  G4double c[4];
341  colorMap->GetMapColor(rphicell[r][phi], c);
342  att.SetColour(c[0], c[1], c[2]);//, c[3]);
343  /*
344  G4cout << " " << c[0] << ", "
345  << c[1] << ", " << c[2] << G4endl;
346  */
347  pVisManager->Draw(cylinder, att, transn);
348  pVisManager->Draw(cylinder, att, transp);
349  }
350  }
351  }
352 
353  colorMap->SetPSUnit(fDrawUnit);
354  colorMap->SetPSName(fDrawPSName);
355  colorMap->DrawColorChart();
356 
357  }
358 }
359 
360 void G4ScoringCylinder::DrawColumn(std::map<G4int, G4double*> * map, G4VScoreColorMap* colorMap,
361  G4int idxProj, G4int idxColumn)
362 {
363  G4int projAxis = 0;
364  switch(idxProj) {
365  case 0:
366  projAxis = IR;
367  break;
368  case 1:
369  projAxis = IZ;
370  break;
371  case 2:
372  projAxis = IPHI;
373  break;
374  }
375 
376  if(idxColumn<0 || idxColumn>=fNSegment[projAxis])
377  {
378  G4cerr << "Warning : Column number " << idxColumn << " is out of scoring mesh [0," << fNSegment[projAxis]-1 <<
379  "]. Method ignored." << G4endl;
380  return;
381  }
383  if(pVisManager) {
384 
385  // cell vectors
386  std::vector<std::vector<std::vector<double> > > cell; // cell[R][Z][PHI]
387  std::vector<double> ephi;
388  for(int phi = 0; phi < fNSegment[IPHI]; phi++) ephi.push_back(0.);
389  std::vector<std::vector<double> > ezphi;
390  for(int z = 0; z < fNSegment[IZ]; z++) ezphi.push_back(ephi);
391  for(int r = 0; r < fNSegment[IR]; r++) cell.push_back(ezphi);
392 
393  std::vector<std::vector<double> > rzcell; // rzcell[R][Z]
394  std::vector<double> ez;
395  for(int z = 0; z < fNSegment[IZ]; z++) ez.push_back(0.);
396  for(int r = 0; r < fNSegment[IR]; r++) rzcell.push_back(ez);
397 
398  std::vector<std::vector<double> > zphicell; // zphicell[Z][PHI]
399  for(int z = 0; z < fNSegment[IZ]; z++) zphicell.push_back(ephi);
400 
401  std::vector<std::vector<double> > rphicell; // rphicell[R][PHI]
402  for(int r = 0; r < fNSegment[IR]; r++) rphicell.push_back(ephi);
403 
404  // projections
405  G4int q[3];
406  std::map<G4int, G4double*>::iterator itr = map->begin();
407  for(; itr != map->end(); itr++) {
408  if(itr->first < 0) {
409  G4cout << itr->first << G4endl;
410  continue;
411  }
412  GetRZPhi(itr->first, q);
413 
414  if(projAxis == IR && q[IR] == idxColumn) { // zphi plane
415  zphicell[q[IZ]][q[IPHI]] += *(itr->second)/fDrawUnitValue;
416  }
417  if(projAxis == IZ && q[IZ] == idxColumn) { // rphi plane
418  rphicell[q[IR]][q[IPHI]] += *(itr->second)/fDrawUnitValue;
419  }
420  if(projAxis == IPHI && q[IPHI] == idxColumn) { // rz plane
421  rzcell[q[IR]][q[IZ]] += *(itr->second)/fDrawUnitValue;
422  }
423  }
424 
425  // search min./max. values
426  G4double rzmin = DBL_MAX, zphimin = DBL_MAX, rphimin = DBL_MAX;
427  G4double rzmax = 0., zphimax = 0., rphimax = 0.;
428  for(int r = 0; r < fNSegment[IR]; r++) {
429  for(int phi = 0; phi < fNSegment[IPHI]; phi++) {
430  if(rphimin > rphicell[r][phi]) rphimin = rphicell[r][phi];
431  if(rphimax < rphicell[r][phi]) rphimax = rphicell[r][phi];
432  }
433  for(int z = 0; z < fNSegment[IZ]; z++) {
434  if(rzmin > rzcell[r][z]) rzmin = rzcell[r][z];
435  if(rzmax < rzcell[r][z]) rzmax = rzcell[r][z];
436  }
437  }
438  for(int z = 0; z < fNSegment[IZ]; z++) {
439  for(int phi = 0; phi < fNSegment[IPHI]; phi++) {
440  if(zphimin > zphicell[z][phi]) zphimin = zphicell[z][phi];
441  if(zphimax < zphicell[z][phi]) zphimax = zphicell[z][phi];
442  }
443  }
444 
445 
446  G4VisAttributes att;
447  att.SetForceSolid(true);
448  att.SetForceAuxEdgeVisible(true);
449 
450 
451  G4Scale3D scale;
452  // z-phi plane
453  if(projAxis == IR) {
454  if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(zphimin,zphimax); }
455 
456  G4double zhalf = fSize[1]/fNSegment[IZ];
457  G4double rsize[2] = {fSize[0]/fNSegment[IR]*idxColumn,
458  fSize[0]/fNSegment[IR]*(idxColumn+1)};
459  for(int phi = 0; phi < fNSegment[IPHI]; phi++) {
460  for(int z = 0; z < fNSegment[IZ]; z++) {
461 
462  G4double angle = twopi/fNSegment[IPHI]*phi*radian;
463  G4double dphi = twopi/fNSegment[IPHI]*radian;
464  G4Tubs cylinder("z-phi", rsize[0], rsize[1], zhalf,
465  angle, dphi*0.99999);
466 
467  G4ThreeVector zpos(0., 0., -fSize[1] + fSize[1]/fNSegment[IZ]*(1 + 2.*z));
468  G4Transform3D trans;
469  if(fRotationMatrix) {
470  trans = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(zpos);
471  trans = G4Translate3D(fCenterPosition)*trans;
472  } else {
474  }
475  G4double c[4];
476  colorMap->GetMapColor(zphicell[z][phi], c);
477  att.SetColour(c[0], c[1], c[2]);//, c[3]);
478  pVisManager->Draw(cylinder, att, trans);
479  }
480  }
481 
482  // r-phi plane
483  } else if(projAxis == IZ) {
484  if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(rphimin,rphimax); }
485 
486  G4double rsize = fSize[0]/fNSegment[IR];
487  for(int phi = 0; phi < fNSegment[IPHI]; phi++) {
488  for(int r = 0; r < fNSegment[IR]; r++) {
489 
490  G4double rs[2] = {rsize*r, rsize*(r+1)};
491  G4double angle = twopi/fNSegment[IPHI]*phi*radian;
492  G4double dz = fSize[1]/fNSegment[IZ];
493  G4double dphi = twopi/fNSegment[IPHI]*radian;
494  G4Tubs cylinder("r-phi", rs[0], rs[1], dz,
495  angle, dphi*0.99999);
496  G4ThreeVector zpos(0., 0.,
497  -fSize[1]+fSize[1]/fNSegment[IZ]*(idxColumn*2+1));
498  G4Transform3D trans;
499  if(fRotationMatrix) {
500  trans = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(zpos);
501  trans = G4Translate3D(fCenterPosition)*trans;
502  } else {
504  }
505  G4double c[4];
506  colorMap->GetMapColor(rphicell[r][phi], c);
507  att.SetColour(c[0], c[1], c[2]);//, c[3]);
508  pVisManager->Draw(cylinder, att, trans);
509  }
510  }
511 
512  // r-z plane
513  } else if(projAxis == IPHI) {
514  if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(rzmin,rzmax); }
515 
516  G4double rsize = fSize[0]/fNSegment[IR];
517  G4double zhalf = fSize[1]/fNSegment[IZ];
518  G4double angle = twopi/fNSegment[IPHI]*idxColumn*radian;
519  G4double dphi = twopi/fNSegment[IPHI]*radian;
520  for(int z = 0; z < fNSegment[IZ]; z++) {
521  for(int r = 0; r < fNSegment[IR]; r++) {
522 
523  G4double rs[2] = {rsize*r, rsize*(r+1)};
524  G4Tubs cylinder("z-phi", rs[0], rs[1], zhalf,
525  angle, dphi);
526 
527  G4ThreeVector zpos(0., 0.,
528  -fSize[1]+fSize[1]/fNSegment[IZ]*(2.*z+1));
529  G4Transform3D trans;
530  if(fRotationMatrix) {
531  trans = G4Rotate3D(*fRotationMatrix).inverse()*G4Translate3D(zpos);
532  trans = G4Translate3D(fCenterPosition)*trans;
533  } else {
535  }
536  G4double c[4];
537  colorMap->GetMapColor(rzcell[r][z], c);
538  att.SetColour(c[0], c[1], c[2]);//, c[3]);
539  pVisManager->Draw(cylinder, att, trans);
540  }
541  }
542  }
543  }
544 
545  colorMap->SetPSUnit(fDrawUnit);
546  colorMap->SetPSName(fDrawPSName);
547  colorMap->DrawColorChart();
548 
549 }
550 
551 void G4ScoringCylinder::GetRZPhi(G4int index, G4int q[3]) const {
552  // index = k + j * k-size + i * jk-plane-size
553 
554  // nested : z -> phi -> r
555  G4int i = IZ;
556  G4int j = IPHI;
557  G4int k = IR;
558  G4int jk = fNSegment[j]*fNSegment[k];
559  q[i] = index/jk;
560  q[j] = (index - q[i]*jk)/fNSegment[k];
561  q[k] = index - q[j]*fNSegment[k] - q[i]*jk;
562 }
virtual void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
Definition: geomdefs.hh:54
void SetColour(const G4Colour &)
void SetPSName(G4String &psName)
G4ThreeVector fCenterPosition
virtual void Draw(std::map< G4int, G4double * > *map, G4VScoreColorMap *colorMap, G4int axflg=111)
CLHEP::Hep3Vector G4ThreeVector
static G4VVisManager * GetConcreteInstance()
G4double z
Definition: TRTMaterials.hh:39
G4MultiFunctionalDetector * fMFD
void SetVisibility(G4bool)
Definition: G4Tubs.hh:84
void SetPSUnit(G4String &unit)
virtual void GetMapColor(G4double val, G4double color[4])=0
Transform3D inverse() const
Definition: Transform3D.cc:142
G4double fSize[3]
void SetForceSolid(G4bool)
int G4int
Definition: G4Types.hh:78
void SetMinMax(G4double minVal, G4double maxVal)
virtual void List() const
G4double fDrawUnitValue
G4GLOB_DLL std::ostream G4cout
static G4int GetReplicaLevel()
const G4String & GetName() const
virtual void List() const
G4RotationMatrix * fRotationMatrix
G4double iz
Definition: TRTMaterials.hh:39
virtual void Construct(G4VPhysicalVolume *fWorldPhys)
void SetForceAuxEdgeVisible(G4bool)
G4LogicalVolume * fMeshElementLogical
G4ScoringCylinder(G4String wName)
HepGeom::Rotate3D G4Rotate3D
G4LogicalVolume * GetLogicalVolume() const
HepGeom::Translate3D G4Translate3D
G4bool IfFloatMinMax() const
#define G4endl
Definition: G4ios.hh:61
G4String fDivisionAxisNames[3]
double G4double
Definition: G4Types.hh:76
Definition: geomdefs.hh:54
#define DBL_MAX
Definition: templates.hh:83
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
G4String fDrawPSName
G4GLOB_DLL std::ostream G4cerr
virtual void DrawColumn(std::map< G4int, G4double * > *map, G4VScoreColorMap *colorMap, G4int idxProj, G4int idxColumn)
virtual void DrawColorChart(G4int nPoint=5)
void GetRZPhi(G4int index, G4int q[3]) const