Changeset 1340 for trunk/source/digits_hits/utils/src/G4ScoringBox.cc
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/digits_hits/utils/src/G4ScoringBox.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ScoringBox.cc,v 1. 54 2008/08/29 02:50:05akimura Exp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ScoringBox.cc,v 1.61 2010/07/27 01:44:54 akimura Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 … … 37 37 #include "G4PVReplica.hh" 38 38 #include "G4PVDivision.hh" 39 #include "G4PVParameterised.hh"40 39 #include "G4VisAttributes.hh" 41 #include "G4ScoringBoxParameterisation.hh"42 40 #include "G4VVisManager.hh" 43 41 #include "G4VScoreColorMap.hh" … … 57 55 { 58 56 fShape = boxMesh; 57 fDivisionAxisNames[0] = "X"; 58 fDivisionAxisNames[1] = "Y"; 59 fDivisionAxisNames[2] = "Z"; 59 60 } 60 61 … … 186 187 fSize[2]/fNSegment[2]); 187 188 fMeshElementLogical = new G4LogicalVolume(elementSolid, 0, elementName); 188 if(fNSegment[2] > 1) 189 if(fSegmentPositions.size() > 0) { 190 if(verboseLevel > 9) G4cout << "G4ScoringBox::Construct() : Parameterise to z direction" << G4endl; 191 G4double motherDims[3] ={fSize[0]/fNSegment[0], 192 fSize[1]/fNSegment[1], 193 fSize[2]/fNSegment[2]}; 194 G4int nelement = fNSegment[2]; 195 fSegmentPositions.push_back(fSize[2]*2.); 196 //G4ScoringBoxParameterisation * param = 197 G4VPVParameterisation * param = 198 new G4ScoringBoxParameterisation(kZAxis, motherDims, fSegmentPositions); 199 new G4PVParameterised(elementName, 200 fMeshElementLogical, 201 layerLogical[1], 202 kZAxis, 203 nelement, 204 param); 205 206 if(verboseLevel > 9) { 207 G4cout << motherDims[0] << ", " << motherDims[1] << ", " << motherDims[2] << G4endl; 208 for(int i = 0; i < (int)fSegmentPositions.size(); i++) 209 G4cout << fSegmentPositions[i] << ", "; 210 G4cout << G4endl; 211 } 212 213 } else { 214 if(verboseLevel > 9) G4cout << "G4ScoringBox::Construct() : Replicate to z direction" << G4endl; 215 216 if(G4ScoringManager::GetReplicaLevel()>2) 217 { 218 new G4PVReplica(elementName, fMeshElementLogical, layerLogical[1], kZAxis, 189 if(fNSegment[2] > 1) { 190 if(verboseLevel > 9) G4cout << "G4ScoringBox::Construct() : Replicate to z direction" << G4endl; 191 192 if(G4ScoringManager::GetReplicaLevel()>2) 193 { 194 new G4PVReplica(elementName, fMeshElementLogical, layerLogical[1], kZAxis, 219 195 fNSegment[2], 2.*fSize[2]/fNSegment[2]); 220 } 221 else 222 { 223 new G4PVDivision(elementName, fMeshElementLogical, layerLogical[1], kZAxis, 224 fNSegment[2], 0.); 225 } 226 } 227 else if(fNSegment[2] == 1) { 196 } 197 else 198 { 199 new G4PVDivision(elementName, fMeshElementLogical, layerLogical[1], kZAxis, 200 fNSegment[2], 0.); 201 } 202 } else if(fNSegment[2] == 1) { 228 203 if(verboseLevel > 9) G4cout << "G4ScoringBox::Construct() : Placement" << G4endl; 229 204 new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), fMeshElementLogical, elementName, layerLogical[1], false, 0); … … 292 267 for(int x = 0; x < fNSegment[0]; x++) xzcell.push_back(ez); 293 268 269 // search max. & min. values in each slice 294 270 G4double xymin = DBL_MAX, yzmin = DBL_MAX, xzmin = DBL_MAX; 295 271 G4double xymax = 0., yzmax = 0., xzmax = 0.; … … 299 275 GetXYZ(itr->first, q); 300 276 301 xycell[q[0]][q[1]] += *(itr->second) ;277 xycell[q[0]][q[1]] += *(itr->second)/fDrawUnitValue; 302 278 if(xymin > xycell[q[0]][q[1]]) xymin = xycell[q[0]][q[1]]; 303 279 if(xymax < xycell[q[0]][q[1]]) xymax = xycell[q[0]][q[1]]; 304 280 305 yzcell[q[1]][q[2]] += *(itr->second) ;281 yzcell[q[1]][q[2]] += *(itr->second)/fDrawUnitValue; 306 282 if(yzmin > yzcell[q[1]][q[2]]) yzmin = yzcell[q[1]][q[2]]; 307 283 if(yzmax < yzcell[q[1]][q[2]]) yzmax = yzcell[q[1]][q[2]]; 308 284 309 xzcell[q[0]][q[2]] += *(itr->second) ;285 xzcell[q[0]][q[2]] += *(itr->second)/fDrawUnitValue; 310 286 if(xzmin > xzcell[q[0]][q[2]]) xzmin = xzcell[q[0]][q[2]]; 311 287 if(xzmax < xzcell[q[0]][q[2]]) xzmax = xzcell[q[0]][q[2]]; … … 404 380 } 405 381 } 382 colorMap->SetPSUnit(fDrawUnit); 383 colorMap->SetPSName(fDrawPSName); 406 384 colorMap->DrawColorChart(); 407 385 } … … 429 407 } 430 408 431 void G4ScoringBox::DrawColumn(std::map<G4int, G4double*> * map, G4VScoreColorMap* colorMap, 432 409 void G4ScoringBox::DrawColumn(std::map<G4int, G4double*> * map, G4VScoreColorMap* colorMap, 410 G4int idxProj, G4int idxColumn) 433 411 { 434 412 if(idxColumn<0 || idxColumn>=fNSegment[idxProj]) … … 460 438 for(int x = 0; x < fNSegment[0]; x++) xzcell.push_back(ez); 461 439 440 // search max. & min. values in each slice 462 441 G4double xymax = 0., yzmax = 0., xzmax = 0.; 463 442 G4int q[3]; … … 467 446 468 447 if(idxProj == 0 && q[2] == idxColumn) { // xy plane 469 xycell[q[0]][q[1]] += *(itr->second) ;448 xycell[q[0]][q[1]] += *(itr->second)/fDrawUnitValue; 470 449 if(xymax < xycell[q[0]][q[1]]) xymax = xycell[q[0]][q[1]]; 471 450 } 472 451 if(idxProj == 1 && q[0] == idxColumn) { // yz plane 473 yzcell[q[1]][q[2]] += *(itr->second) ;452 yzcell[q[1]][q[2]] += *(itr->second)/fDrawUnitValue; 474 453 if(yzmax < yzcell[q[1]][q[2]]) yzmax = yzcell[q[1]][q[2]]; 475 454 } 476 455 if(idxProj == 2 && q[1] == idxColumn) { // zx plane 477 xzcell[q[0]][q[2]] += *(itr->second) ;456 xzcell[q[0]][q[2]] += *(itr->second)/fDrawUnitValue; 478 457 if(xzmax < xzcell[q[0]][q[2]]) xzmax = xzcell[q[0]][q[2]]; 479 458 } … … 552 531 } 553 532 533 colorMap->SetPSUnit(fDrawUnit); 534 colorMap->SetPSName(fDrawPSName); 554 535 colorMap->DrawColorChart(); 555 536 }
Note: See TracChangeset
for help on using the changeset viewer.