Changeset 1340 for trunk/source/digits_hits/utils/src
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- Location:
- trunk/source/digits_hits/utils/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/digits_hits/utils/src/CVS/Entries
r1337 r1340 1 /G4DefaultLinearColorMap.cc/1.3/Wed Sep 29 21:48:27 2010//Tgeant4-09-04-beta-01 2 /G4ScoreLogColorMap.cc/1.3/Wed Sep 29 21:48:27 2010//Tgeant4-09-04-beta-01 3 /G4ScoreQuantityMessenger.cc/1.8/Wed Sep 29 21:48:27 2010//Tgeant4-09-04-beta-01 4 /G4ScoreQuantityMessengerQCmd.cc/1.6/Wed Sep 29 21:48:27 2010//Tgeant4-09-04-beta-01 5 /G4ScoringBox.cc/1.54/Wed Sep 29 21:48:28 2010//Tgeant4-09-04-beta-01 6 /G4ScoringBoxParameterisation.cc/1.4/Wed Sep 29 21:48:28 2010//Tgeant4-09-04-beta-01 7 /G4ScoringCylinder.cc/1.6/Wed Sep 29 21:48:28 2010//Tgeant4-09-04-beta-01 8 /G4ScoringManager.cc/1.31/Wed Sep 29 21:48:28 2010//Tgeant4-09-04-beta-01 9 /G4ScoringMessenger.cc/1.39/Wed Sep 29 21:48:28 2010//Tgeant4-09-04-beta-01 10 /G4VScoreColorMap.cc/1.4/Wed Sep 29 21:48:28 2010//Tgeant4-09-04-beta-01 11 /G4VScoreWriter.cc/1.5/Wed Sep 29 21:48:29 2010//Tgeant4-09-04-beta-01 12 /G4VScoringMesh.cc/1.37/Wed Sep 29 21:48:29 2010//Tgeant4-09-04-beta-01 1 /G4DefaultLinearColorMap.cc/1.3/Thu Nov 4 15:58:45 2010// 2 /G4ScoreLogColorMap.cc/1.10/Fri Nov 5 09:56:24 2010// 3 /G4ScoreQuantityMessenger.cc/1.10/Fri Nov 5 09:56:24 2010// 4 /G4ScoreQuantityMessengerQCmd.cc/1.8/Fri Nov 5 09:56:24 2010// 5 /G4ScoringBox.cc/1.61/Fri Nov 5 09:56:25 2010// 6 /G4ScoringCylinder.cc/1.16/Fri Nov 5 09:56:25 2010// 7 /G4ScoringManager.cc/1.33/Fri Nov 5 09:56:25 2010// 8 /G4ScoringMessenger.cc/1.42/Fri Nov 5 09:56:25 2010// 9 /G4VScoreColorMap.cc/1.8/Fri Nov 5 09:56:25 2010// 10 /G4VScoreWriter.cc/1.10/Fri Nov 5 09:56:25 2010// 11 /G4VScoringMesh.cc/1.42/Fri Nov 5 09:56:25 2010// 13 12 D -
trunk/source/digits_hits/utils/src/G4DefaultLinearColorMap.cc
r1337 r1340 26 26 // 27 27 // $Id: G4DefaultLinearColorMap.cc,v 1.3 2008/08/29 02:50:05 akimura Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01$28 // GEANT4 tag $Name: $ 29 29 // 30 30 -
trunk/source/digits_hits/utils/src/G4ScoreLogColorMap.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ScoreLogColorMap.cc,v 1. 3 2009/05/04 15:57:33 akimuraExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ScoreLogColorMap.cc,v 1.10 2010/11/03 19:31:36 asaim Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 … … 50 50 {;} 51 51 52 #include "G4UIcommand.hh" 52 53 void G4ScoreLogColorMap::GetMapColor(G4double val, G4double color[4]) 53 54 { 54 55 G4bool lmin = true, lmax = true, lval = true; 55 if(fMinVal <= 0.) lmin = false; 56 if(fMaxVal <= 0.) lmax = false; 57 if(val <= 0.) lval = false; 56 if(fMinVal < 0.) { 57 lmin = false; 58 G4String message = " The min. value (fMinVal) is negative. : "; 59 message += G4UIcommand::ConvertToString(fMinVal); 60 G4Exception("G4ScoreLogColorMap::GetMapColor()", 61 "DigiHitsUtilsScoreLogColorMap000", JustWarning, 62 message); 63 } 64 if(fMaxVal < 0.) { 65 lmax = false; 66 G4String message = " The max. value (fMaxVal) is negative. : "; 67 message += G4UIcommand::ConvertToString(fMaxVal); 68 G4Exception("G4ScoreLogColorMap::GetMapColor()", 69 "DigiHitsUtilsScoreLogColorMap001", JustWarning, 70 message); 71 } 72 if(!lmin || !lmax) { 73 color[0] = 0.; 74 color[1] = 0.; 75 color[2] = 0.; 76 color[3] = 0.; 77 return; 78 } 79 80 if(val < 0.) { 81 lval = false; 82 G4String message = " 'val' (first argument) is negative : "; 83 message += G4UIcommand::ConvertToString(fMaxVal); 84 G4Exception("G4ScoreLogColorMap::GetMapColor()", 85 "DigiHitsUtilsScoreLogColorMap002", JustWarning, 86 message); 87 } 88 if(!lval) { 89 color[0] = 0.; 90 color[1] = 0.; 91 color[2] = 0.; 92 color[3] = -1.; 93 return; 94 } 95 58 96 G4double logmin = 0., logmax = 0., logval = 0.; 59 97 if(lmin) logmin = std::log10(fMinVal); … … 101 139 void G4ScoreLogColorMap::DrawColorChartBar(G4int _nPoint) { 102 140 141 G4cout << "++++++ " << fMinVal << " - " << fMaxVal << G4endl; 103 142 G4bool lmin = true, lmax = true; 104 143 if(fMinVal <= 0.) lmin = false; … … 118 157 G4double val = std::pow(10., (ra*max+rb*min)/(ra+rb)); 119 158 this->GetMapColor(val, c); 159 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == 0) return; 160 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == -1.) continue; 120 161 G4Colour col(c[0], c[1], c[2]); 121 162 G4VisAttributes att(col); … … 132 173 G4double min = 0.; 133 174 if(lmin) min = std::log10(fMinVal); 134 if(min > 0.) min = std::floor(min);135 else min = std::ceil(min);175 //if(min > 0.) min = std::floor(min); 176 //else min = std::ceil(min); 136 177 137 178 G4double max = 0.; 138 179 if(lmax) max = std::log10(fMaxVal); 139 if(max > 0.) max = std::floor(max);140 else max = std::ceil(max);180 //if(max > 0.) max = std::ceil(max); 181 //else max = std::floor(max); 141 182 142 183 G4double c[4]; … … 145 186 G4double a = n/(_nPoint-1.), b = 1.-a; 146 187 G4double v = (a*max + b*min)/(a+b); 188 189 this->GetMapColor(std::pow(10., v), c); 190 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == 0) return; 191 if(c[0] == 0 && c[1] == 0 && c[2] == 0 && c[3] == -1.) continue; 192 147 193 // background color 148 194 for(int l = 0; l < 21; l++) { … … 165 211 G4double size = 12.; 166 212 text.SetScreenSize(size); 167 this->GetMapColor(std::pow(10., v), c);213 //this->GetMapColor(std::pow(10., v), c); 168 214 G4Colour color(c[0], c[1], c[2]); 169 215 G4VisAttributes att(color); … … 172 218 fVisManager->Draw2D(text); 173 219 } 220 221 222 // draw ps name 223 // background 224 G4int lpsname = 20;// fPSName.size(); 225 if(lpsname > 0) { 226 for(int l = 0; l < 22; l++) { 227 G4Polyline line; 228 line.push_back(G4Point3D(-0.9, -0.965+0.002*l, 0.)); 229 line.push_back(G4Point3D(-0.9+0.025*lpsname, -0.965+0.002*l, 0.)); 230 G4VisAttributes attblack(black); 231 //G4VisAttributes attblack(G4Colour(.0, .5, .0)); 232 line.SetVisAttributes(&attblack); 233 fVisManager->Draw2D(line); 234 } 235 // ps name 236 G4Text txtpsname(fPSName, G4Point3D(-0.9, -0.96, 0.)); 237 G4double size = 12.; 238 txtpsname.SetScreenSize(size); 239 G4Colour color(1., 1., 1.); 240 G4VisAttributes att(color); 241 txtpsname.SetVisAttributes(&att); 242 fVisManager->Draw2D(txtpsname); 243 } 244 245 246 247 // draw unit 248 // background 249 G4int len = fPSUnit.size(); 250 if(len > 0) { 251 for(int l = 0; l < 21; l++) { 252 G4Polyline line; 253 line.push_back(G4Point3D(-0.7, -0.9+0.002*l, 0.)); 254 line.push_back(G4Point3D(-0.7+0.3, -0.9+0.002*l, 0.)); 255 G4VisAttributes attblack(black); 256 //G4VisAttributes attblack(G4Colour(.5, .0, .0)); 257 line.SetVisAttributes(&attblack); 258 fVisManager->Draw2D(line); 259 } 260 // unit 261 G4String psunit = "[" + fPSUnit + "]"; 262 G4Text txtunit(psunit, G4Point3D(-0.69, -0.9, 0.)); 263 G4double size = 12.; 264 txtunit.SetScreenSize(size); 265 G4Colour color(1., 1., 1.); 266 G4VisAttributes att(color); 267 txtunit.SetVisAttributes(&att); 268 fVisManager->Draw2D(txtunit); 269 } 270 174 271 } -
trunk/source/digits_hits/utils/src/G4ScoreQuantityMessenger.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ScoreQuantityMessenger.cc,v 1. 8 2007/11/07 04:12:07 akimuraExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ScoreQuantityMessenger.cc,v 1.10 2010/11/03 08:28:42 taso Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 // --------------------------------------------------------------------- 31 // Modifications 32 // 08-Oct-2010 T.Aso remove unit of G4PSPassageCellCurrent. 30 33 // --------------------------------------------------------------------- 31 34 … … 55 58 #include "G4PSTrackCounter3D.hh" 56 59 #include "G4PSTermination3D.hh" 60 #include "G4PSMinKinEAtGeneration3D.hh" 57 61 58 62 #include "G4SDChargedFilter.hh" … … 160 164 delete quantityDir; 161 165 delete qTouchCmd; 166 delete qGetUnitCmd; 167 delete qSetUnitCmd; 168 162 169 // 163 170 delete qCellChgCmd; … … 182 189 delete qTrackCountCmd; 183 190 delete qTerminationCmd; 191 delete qMinKinEAtGeneCmd; 184 192 // 185 193 delete filterDir; … … 209 217 if(command==qTouchCmd) { 210 218 mesh->SetCurrentPrimitiveScorer(newVal); 219 } else if(command == qGetUnitCmd ){ 220 G4cout << "Unit: "<< mesh->GetCurrentPSUnit() <<G4endl; 221 } else if(command == qSetUnitCmd ){ 222 mesh->SetCurrentPSUnit(newVal); 211 223 } else if(command== qCellChgCmd) { 212 if(!mesh->FindPrimitiveScorer(newVal)) { 213 mesh->SetPrimitiveScorer(new G4PSCellCharge3D(newVal)); 214 } else { 215 G4cout << "WARNING[" << qTouchCmd->GetCommandPath() 216 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 217 mesh->SetNullToCurrentPrimitiveScorer(); 218 } 224 if ( CheckMeshPS(mesh,token[0]) ){ 225 G4PSCellCharge3D* ps = new G4PSCellCharge3D(token[0]); 226 ps->SetUnit(token[1]); 227 mesh->SetPrimitiveScorer(ps); 228 } 219 229 } else if(command== qCellFluxCmd) { 220 if(!mesh->FindPrimitiveScorer(newVal)) { 221 mesh->SetPrimitiveScorer(new G4PSCellFlux3D(newVal)); 222 } else { 223 G4cout << "WARNING[" << qCellFluxCmd->GetCommandPath() 224 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 225 mesh->SetNullToCurrentPrimitiveScorer(); 226 } 230 if ( CheckMeshPS(mesh,token[0]) ){ 231 G4PSCellFlux3D* ps = new G4PSCellFlux3D(token[0]); 232 ps->SetUnit(token[1]); 233 mesh->SetPrimitiveScorer(ps); 234 } 227 235 } else if(command== qPassCellFluxCmd) { 228 if(!mesh->FindPrimitiveScorer(newVal)) { 229 mesh->SetPrimitiveScorer(new G4PSPassageCellFlux3D(newVal)); 230 } else { 231 G4cout << "WARNING[" << qPassCellFluxCmd->GetCommandPath() 232 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 233 mesh->SetNullToCurrentPrimitiveScorer(); 234 } 236 if ( CheckMeshPS(mesh,token[0]) ){ 237 G4PSPassageCellFlux3D* ps = new G4PSPassageCellFlux3D(token[0]); 238 ps->SetUnit(token[1]); 239 mesh->SetPrimitiveScorer(ps); 240 } 235 241 } else if(command==qeDepCmd) { 236 if(!mesh->FindPrimitiveScorer(newVal)) { 237 mesh->SetPrimitiveScorer(new G4PSEnergyDeposit3D(newVal)); 238 } else { 239 G4cout << "WARNING[" << qeDepCmd->GetCommandPath() 240 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 241 mesh->SetNullToCurrentPrimitiveScorer(); 242 } 242 if ( CheckMeshPS(mesh,token[0]) ){ 243 G4PSEnergyDeposit3D* ps =new G4PSEnergyDeposit3D(token[0]); 244 ps->SetUnit(token[1]); 245 mesh->SetPrimitiveScorer(ps); 246 } 243 247 } else if(command== qdoseDepCmd) { 244 if(!mesh->FindPrimitiveScorer(newVal)) { 245 mesh->SetPrimitiveScorer(new G4PSDoseDeposit3D(newVal)); 246 } else { 247 G4cout << "WARNING[" << qdoseDepCmd->GetCommandPath() 248 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 249 mesh->SetNullToCurrentPrimitiveScorer(); 250 } 248 if ( CheckMeshPS(mesh,token[0]) ){ 249 G4PSDoseDeposit3D* ps = new G4PSDoseDeposit3D(token[0]); 250 ps->SetUnit(token[1]); 251 mesh->SetPrimitiveScorer(ps); 252 } 251 253 } else if(command== qnOfStepCmd) { 252 if(!mesh->FindPrimitiveScorer(newVal)) { 253 mesh->SetPrimitiveScorer(new G4PSNofStep3D(newVal)); 254 } else { 255 G4cout << "WARNING[" << qnOfStepCmd->GetCommandPath() 256 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 257 mesh->SetNullToCurrentPrimitiveScorer(); 258 } 254 if ( CheckMeshPS(mesh,token[0]) ){ 255 G4PSNofStep3D* ps = new G4PSNofStep3D(token[0]); 256 mesh->SetPrimitiveScorer(ps); 257 } 259 258 } else if(command== qnOfSecondaryCmd) { 260 if(!mesh->FindPrimitiveScorer(newVal)) { 261 mesh->SetPrimitiveScorer(new G4PSNofSecondary3D(newVal)); 262 } else { 263 G4cout << "WARNING[" << qnOfSecondaryCmd->GetCommandPath() 264 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 265 mesh->SetNullToCurrentPrimitiveScorer(); 266 } 259 if ( CheckMeshPS(mesh,token[0]) ){ 260 G4PSNofSecondary3D* ps =new G4PSNofSecondary3D(token[0]); 261 mesh->SetPrimitiveScorer(ps); 262 } 267 263 } else if(command== qTrackLengthCmd) { 268 if(!mesh->FindPrimitiveScorer(newVal)){264 if ( CheckMeshPS(mesh,token[0]) ){ 269 265 G4PSTrackLength3D* ps = new G4PSTrackLength3D(token[0]); 270 266 ps->Weighted(StoB(token[1])); 271 267 ps->MultiplyKineticEnergy(StoB(token[2])); 272 268 ps->DivideByVelocity(StoB(token[3])); 273 mesh->SetPrimitiveScorer(ps); 274 } else { 275 G4cout << "WARNING[" << qTrackLengthCmd->GetCommandPath() 276 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 277 mesh->SetNullToCurrentPrimitiveScorer(); 278 } 269 ps->SetUnit(token[4]); 270 mesh->SetPrimitiveScorer(ps); 271 } 279 272 } else if(command== qPassCellCurrCmd){ 280 if(!mesh->FindPrimitiveScorer(newVal)) {273 if( CheckMeshPS(mesh,token[0]) ) { 281 274 G4PSPassageCellCurrent* ps = new G4PSPassageCellCurrent3D(token[0]); 282 275 ps->Weighted(StoB(token[1])); 283 mesh->SetPrimitiveScorer(ps); 284 } else { 285 G4cout << "WARNING[" << qPassCellCurrCmd->GetCommandPath() 286 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 287 mesh->SetNullToCurrentPrimitiveScorer(); 288 } 276 //ps->SetUnit(token[2]); 277 mesh->SetPrimitiveScorer(ps); 278 } 289 279 } else if(command== qPassTrackLengthCmd){ 290 if(!mesh->FindPrimitiveScorer(newVal)) {280 if( CheckMeshPS(mesh,token[0]) ) { 291 281 G4PSPassageTrackLength* ps = new G4PSPassageTrackLength3D(token[0]); 292 282 ps->Weighted(StoB(token[1])); 293 283 mesh->SetPrimitiveScorer(ps); 294 } else { 295 G4cout << "WARNING[" << qPassTrackLengthCmd->GetCommandPath() 296 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 297 mesh->SetNullToCurrentPrimitiveScorer(); 298 } 284 } 299 285 } else if(command== qFlatSurfCurrCmd){ 300 if(!mesh->FindPrimitiveScorer(newVal)) {286 if( CheckMeshPS(mesh,token[0])) { 301 287 G4PSFlatSurfaceCurrent3D* ps = 302 288 new G4PSFlatSurfaceCurrent3D(token[0],StoI(token[1])); 303 289 ps->Weighted(StoB(token[2])); 304 290 ps->DivideByArea(StoB(token[3])); 305 mesh->SetPrimitiveScorer(ps); 306 } else { 307 G4cout << "WARNING[" << qFlatSurfCurrCmd->GetCommandPath() 308 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 309 mesh->SetNullToCurrentPrimitiveScorer(); 310 } 291 ps->SetUnit(token[4]); 292 mesh->SetPrimitiveScorer(ps); 293 } 311 294 } else if(command== qFlatSurfFluxCmd){ 312 if(!mesh->FindPrimitiveScorer(newVal)) { 313 mesh->SetPrimitiveScorer( 314 new G4PSFlatSurfaceFlux3D(token[0],StoI(token[1]))); 315 } else { 316 G4cout << "WARNING[" << qFlatSurfFluxCmd->GetCommandPath() 317 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 318 mesh->SetNullToCurrentPrimitiveScorer(); 319 } 320 // } else if(command== qSphereSurfCurrCmd){ 321 // if(!mesh->FindPrimitiveScorer(newVal)) { 295 if( CheckMeshPS(mesh, token[0] )) { 296 G4PSFlatSurfaceFlux3D* ps = new G4PSFlatSurfaceFlux3D(token[0],StoI(token[1])); 297 ps->SetUnit(token[2]); 298 mesh->SetPrimitiveScorer(ps); 299 } 300 // } else if(command== qSphereSurfCurrCmd){ 301 // if( CheckMeshPS(mesh, token[0] )) { 322 302 // G4PSSphereSurfaceCurrent3D* ps = 323 303 // new G4PSSphereSurfaceCurrent3D(token[0],StoI(token[1])); 324 304 // ps->Weighted(StoB(token[2])); 325 305 // ps->DivideByArea(StoB(token[3])); 306 // ps->SetUnit(token[4]); 326 307 // mesh->SetPrimitiveScorer(ps); 327 // } else { 328 // G4cout << "WARNING[" << qSphereSurfCurrCmd->GetCommandPath() 329 // << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 330 // mesh->SetNullToCurrentPrimitiveScorer(); 331 // } 332 // } else if(command== qSphereSurfFluxCmd){ 333 // if(!mesh->FindPrimitiveScorer(newVal)) { 334 // mesh->SetPrimitiveScorer( 335 // new G4PSSphereSurfaceFlux3D(token[0], StoI(token[1]))); 336 // } else { 337 // G4cout << "WARNING[" << qSphereSurfFluxCmd->GetCommandPath() 338 // << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 339 // mesh->SetNullToCurrentPrimitiveScorer(); 340 // } 341 // } else if(command== qCylSurfCurrCmd){ 342 // if(!mesh->FindPrimitiveScorer(newVal)) { 308 // } 309 // } else if(command== qSphereSurfFluxCmd){ 310 // if( CheckMeshPS(mesh,token[0])) { 311 // G4PSSphereSurfaceFlux3D* ps = new G4PSSphereSurfaceFlux3D(token[0], StoI(token[1])); 312 // ps->SetUnit(token[2]); 313 // mesh->SetPrimitiveScorer(ps); 314 // } 315 // } else if(command== qCylSurfCurrCmd){ 316 // if( CheckMeshPS(mesh, token[0] ) ) { 343 317 // G4PSCylinderSurfaceCurrent3D* ps = 344 318 // new G4PSCylinderSurfaceCurrent3D(token[0],StoI(token[1])); 345 319 // ps->Weighted(StoB(token[2])); 346 320 // ps->DivideByArea(StoB(token[3])); 321 // ps->SetUnit(token[4]); 347 322 // mesh->SetPrimitiveScorer(ps); 348 // } else { 349 // G4cout << "WARNING[" << qCylSurfCurrCmd->GetCommandPath() 350 // << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 351 // mesh->SetNullToCurrentPrimitiveScorer(); 352 // } 353 // } else if(command== qCylSurfFluxCmd){ 354 // if(!mesh->FindPrimitiveScorer(newVal)) { 355 // mesh->SetPrimitiveScorer( 356 // new G4PSCylinderSurfaceFlux3D(token[0], StoI(token[1]))); 357 // } else { 358 // G4cout << "WARNING[" << qCylSurfFluxCmd->GetCommandPath() 359 // << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 360 // mesh->SetNullToCurrentPrimitiveScorer(); 361 // } 323 // } 324 // } else if(command== qCylSurfFluxCmd){ 325 // if( CheckMeshPS(mesh, token[0] ) { 326 // G4PSCylinerSurfaceFlux3D* ps =new G4PSCylinderSurfaceFlux3D(token[0], StoI(token[1])); 327 // ps->SetUnit(token[2]); 328 // mesh->SetPrimitiveScorer(ps); 329 // } 362 330 } else if(command== qNofCollisionCmd){ 363 if(!mesh->FindPrimitiveScorer(newVal)) {331 if( CheckMeshPS(mesh,token[0])) { 364 332 G4PSNofCollision3D* ps =new G4PSNofCollision3D(token[0]); 365 333 ps->Weighted(StoB(token[1])); 366 334 mesh->SetPrimitiveScorer(ps); 367 } else { 368 G4cout << "WARNING[" << qNofCollisionCmd->GetCommandPath() 369 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 370 mesh->SetNullToCurrentPrimitiveScorer(); 371 } 335 } 372 336 } else if(command== qPopulationCmd){ 373 if(!mesh->FindPrimitiveScorer(newVal)) {337 if( CheckMeshPS(mesh,token[0]) ) { 374 338 G4PSPopulation3D* ps =new G4PSPopulation3D(token[0]); 375 339 ps->Weighted(StoB(token[1])); 376 340 mesh->SetPrimitiveScorer(ps); 377 } else { 378 G4cout << "WARNING[" << qPopulationCmd->GetCommandPath() 379 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 380 mesh->SetNullToCurrentPrimitiveScorer(); 381 } 341 } 382 342 } else if(command== qTrackCountCmd){ 383 if(!mesh->FindPrimitiveScorer(newVal)) {343 if( CheckMeshPS(mesh,token[0])) { 384 344 G4PSTrackCounter3D* ps =new G4PSTrackCounter3D(token[0],StoI(token[1])); 385 345 mesh->SetPrimitiveScorer(ps); 386 } else { 387 G4cout << "WARNING[" << qTrackCountCmd->GetCommandPath() 388 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 389 mesh->SetNullToCurrentPrimitiveScorer(); 390 } 346 } 391 347 } else if(command== qTerminationCmd){ 392 if(!mesh->FindPrimitiveScorer(newVal)) {348 if( CheckMeshPS(mesh,token[0])) { 393 349 G4PSTermination3D* ps =new G4PSTermination3D(token[0]); 394 350 ps->Weighted(StoB(token[1])); 395 351 mesh->SetPrimitiveScorer(ps); 396 } else { 397 G4cout << "WARNING[" << qTerminationCmd->GetCommandPath() 398 << "] : Quantity name, \"" << newVal << "\", is already existing." << G4endl; 399 mesh->SetNullToCurrentPrimitiveScorer(); 400 } 352 } 353 354 } else if(command== qMinKinEAtGeneCmd){ 355 if( CheckMeshPS(mesh,token[0]) ){ 356 G4PSMinKinEAtGeneration3D* ps =new G4PSMinKinEAtGeneration3D(token[0]); 357 ps->SetUnit(token[1]); 358 mesh->SetPrimitiveScorer(ps); 359 } 401 360 402 361 // … … 488 447 mesh->SetFilter(filter); 489 448 } 490 449 450 G4bool G4ScoreQuantityMessenger::CheckMeshPS(G4VScoringMesh* mesh, G4String& psname){ 451 if(!mesh->FindPrimitiveScorer(psname)) { 452 return true; 453 } else { 454 G4cout << "WARNING[" << qTouchCmd->GetCommandPath() 455 << "] : Quantity name, \"" << psname << "\", is already existing." << G4endl; 456 mesh->SetNullToCurrentPrimitiveScorer(); 457 return false; 458 } 459 } -
trunk/source/digits_hits/utils/src/G4ScoreQuantityMessengerQCmd.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ScoreQuantityMessengerQCmd.cc,v 1.6 2007/11/07 04:12:07 akimura Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 29 // 27 // $Id: G4ScoreQuantityMessengerQCmd.cc,v 1.8 2010/11/03 08:29:02 taso Exp $ 28 // GEANT4 tag $Name: $ 29 // 30 // --------------------------------------------------------------------- 31 // Modifications 32 // 08-Oct-2010 T.Aso remove unit of G4PSPassageCellCurrent. 30 33 // --------------------------------------------------------------------- 31 34 … … 86 89 qTouchCmd->SetParameterName("qname",false); 87 90 // 88 qeDepCmd = new G4UIcmdWithAString("/score/quantity/energyDeposit",this); 91 qGetUnitCmd = new G4UIcmdWithoutParameter("/score/quantity/get/unit",this); 92 qGetUnitCmd->SetGuidance("Print output unit of the current quantity."); 93 // 94 qSetUnitCmd = new G4UIcmdWithAString("/score/quantity/set/unit",this); 95 qSetUnitCmd->SetGuidance("Set output unit of the current quantity."); 96 qSetUnitCmd->SetParameterName("unit",false); 97 98 // Primitive Scorers 99 qeDepCmd = new G4UIcommand("/score/quantity/energyDeposit",this); 89 100 qeDepCmd->SetGuidance("Energy deposit scorer."); 90 qeDepCmd->SetParameterName("qname",false); 91 // 92 qCellChgCmd = new G4UIcmdWithAString("/score/quantity/cellCharge",this); 101 qeDepCmd-> 102 SetGuidance("[usage] /score/quantiy/energyDeposit qname unit"); 103 qeDepCmd->SetGuidance(" qname :(String) scorer name"); 104 qeDepCmd->SetGuidance(" unit :(String) unit"); 105 param = new G4UIparameter("qname",'s',false); 106 qeDepCmd->SetParameter(param); 107 param = new G4UIparameter("unit",'s',true); 108 param->SetDefaultValue("MeV"); 109 qeDepCmd->SetParameter(param); 110 // 111 qCellChgCmd = new G4UIcommand("/score/quantity/cellCharge",this); 93 112 qCellChgCmd->SetGuidance("Cell charge scorer."); 94 qCellChgCmd->SetParameterName("qname",false); 95 // 96 qCellFluxCmd = new G4UIcmdWithAString("/score/quantity/cellFlux",this); 113 qCellChgCmd-> 114 SetGuidance("[usage] /score/quantiy/cellCharge qname unit"); 115 qCellChgCmd->SetGuidance(" qname :(String) scorer name"); 116 qCellChgCmd->SetGuidance(" unit :(String) unit"); 117 param = new G4UIparameter("qname",'s',false); 118 qCellChgCmd->SetParameter(param); 119 param = new G4UIparameter("unit",'s',true); 120 param->SetDefaultValue("e+"); 121 qCellChgCmd->SetParameter(param); 122 // 123 qCellFluxCmd = new G4UIcommand("/score/quantity/cellFlux",this); 97 124 qCellFluxCmd->SetGuidance("Cell flux scorer."); 98 qCellFluxCmd->SetParameterName("qname",false); 99 // 100 qPassCellFluxCmd = new G4UIcmdWithAString("/score/quantity/passageCellFlux",this); 125 qCellFluxCmd-> 126 SetGuidance("[usage] /score/quantiy/cellFlux qname unit"); 127 qCellFluxCmd->SetGuidance(" qname :(String) scorer name"); 128 qCellFluxCmd->SetGuidance(" unit :(String) unit"); 129 param = new G4UIparameter("qname",'s',false); 130 qCellFluxCmd->SetParameter(param); 131 param = new G4UIparameter("unit",'s',true); 132 param->SetDefaultValue("percm2"); 133 qCellFluxCmd->SetParameter(param); 134 // 135 qPassCellFluxCmd = new G4UIcommand("/score/quantity/passageCellFlux",this); 101 136 qPassCellFluxCmd->SetGuidance("Passage cell flux scorer"); 102 qPassCellFluxCmd->SetParameterName("qname",false); 103 // 104 qdoseDepCmd = new G4UIcmdWithAString("/score/quantity/doseDeposit",this); 137 qPassCellFluxCmd-> 138 SetGuidance("[usage] /score/quantiy/passageCellFlux qname unit"); 139 qPassCellFluxCmd->SetGuidance(" qname :(String) scorer name"); 140 qPassCellFluxCmd->SetGuidance(" unit :(String) unit"); 141 param = new G4UIparameter("qname",'s',false); 142 qPassCellFluxCmd->SetParameter(param); 143 param = new G4UIparameter("unit",'s',true); 144 param->SetDefaultValue("percm2"); 145 qPassCellFluxCmd->SetParameter(param); 146 // 147 qdoseDepCmd = new G4UIcommand("/score/quantity/doseDeposit",this); 105 148 qdoseDepCmd->SetGuidance("Dose deposit scorer."); 106 qdoseDepCmd->SetParameterName("qname",false); 107 // 108 qnOfStepCmd = new G4UIcmdWithAString("/score/quantity/nOfStep",this); 149 qdoseDepCmd-> 150 SetGuidance("[usage] /score/quantiy/doseDeposit qname unit"); 151 qdoseDepCmd->SetGuidance(" qname :(String) scorer name"); 152 qdoseDepCmd->SetGuidance(" unit :(String) unit"); 153 param = new G4UIparameter("qname",'s',false); 154 qdoseDepCmd->SetParameter(param); 155 param = new G4UIparameter("unit",'s',true); 156 param->SetDefaultValue("Gy"); 157 qdoseDepCmd->SetParameter(param); 158 // 159 qnOfStepCmd = new G4UIcommand("/score/quantity/nOfStep",this); 109 160 qnOfStepCmd->SetGuidance("Number of step scorer."); 110 qnOfStepCmd->SetParameterName("qname",false); 111 // 112 qnOfSecondaryCmd = new G4UIcmdWithAString("/score/quantity/nOfSecondary",this); 161 qnOfStepCmd-> 162 SetGuidance("[usage] /score/quantiy/nOfStep qname"); 163 qnOfStepCmd->SetGuidance(" qname :(String) scorer name"); 164 param = new G4UIparameter("qname",'s',false); 165 qnOfStepCmd->SetParameter(param); 166 // 167 qnOfSecondaryCmd = new G4UIcommand("/score/quantity/nOfSecondary",this); 113 168 qnOfSecondaryCmd->SetGuidance("Number of secondary scorer."); 114 qnOfSecondaryCmd->SetParameterName("qname",false); 169 qnOfSecondaryCmd-> 170 SetGuidance("[usage] /score/quantiy/nOfSecondary qname"); 171 qnOfSecondaryCmd->SetGuidance(" qname :(String) scorer name"); 172 param = new G4UIparameter("qname",'s',false); 173 qnOfSecondaryCmd->SetParameter(param); 115 174 // 116 175 qTrackLengthCmd = new G4UIcommand("/score/quantity/trackLength",this); 117 176 qTrackLengthCmd->SetGuidance("Track length scorer."); 118 177 qTrackLengthCmd-> 119 SetGuidance("[usage] /score/quantiy/trackLength qname wflag kflag vflag");178 SetGuidance("[usage] /score/quantiy/trackLength qname wflag kflag vflag unit"); 120 179 qTrackLengthCmd->SetGuidance(" qname :(String) scorer name"); 121 180 qTrackLengthCmd->SetGuidance(" wflag :(Bool) weighted"); 122 181 qTrackLengthCmd->SetGuidance(" kflag :(Bool) multiply kinetic energy"); 123 182 qTrackLengthCmd->SetGuidance(" vflag :(Bool) divide by velocity"); 183 qTrackLengthCmd->SetGuidance(" unit :(String) unit"); 124 184 param = new G4UIparameter("qname",'s',false); 125 185 qTrackLengthCmd->SetParameter(param); … … 132 192 param = new G4UIparameter("vflag",'b',true); 133 193 param->SetDefaultValue("false"); 194 qTrackLengthCmd->SetParameter(param); 195 param = new G4UIparameter("unit",'s',true); 196 param->SetDefaultValue("mm"); 134 197 qTrackLengthCmd->SetParameter(param); 135 198 // … … 137 200 qPassCellCurrCmd->SetGuidance("Passage cell current scorer."); 138 201 qPassCellCurrCmd-> 139 SetGuidance("[usage] /score/quantiy/passageCellCurrent qname wflag"); 202 SetGuidance("[usage] /score/quantiy/passageCellCurrent qname wflag"); 203 //SetGuidance("[usage] /score/quantiy/passageCellCurrent qname wflag unit"); 140 204 qPassCellCurrCmd->SetGuidance(" qname :(String) scorer name"); 141 205 qPassCellCurrCmd->SetGuidance(" wflag :(Bool) weighted"); 206 //qPassCellCurrCmd->SetGuidance(" unit :(Bool) unit"); 142 207 param = new G4UIparameter("qname",'s',false); 143 208 qPassCellCurrCmd->SetParameter(param); … … 145 210 param->SetDefaultValue("true"); 146 211 qPassCellCurrCmd->SetParameter(param); 212 //param = new G4UIparameter("unit",'s',true); 213 //param->SetDefaultValue("parcm2"); 214 //qPassCellCurrCmd->SetParameter(param); 147 215 // 148 216 qPassTrackLengthCmd = new G4UIcommand("/score/quantity/passageTrackLength",this); 149 217 qPassTrackLengthCmd->SetGuidance("Passage track length scorer."); 150 218 qPassTrackLengthCmd-> 151 SetGuidance("[usage] /score/quantiy/passageTrackLength qname wflag");219 SetGuidance("[usage] /score/quantiy/passageTrackLength qname wflag unit"); 152 220 qPassTrackLengthCmd->SetGuidance(" qname :(String) scorer name"); 153 221 qPassTrackLengthCmd->SetGuidance(" wflag :(Bool) weighted"); 222 qPassTrackLengthCmd->SetGuidance(" unit :(Bool) unit"); 154 223 param = new G4UIparameter("qname",'s',false); 155 224 qPassTrackLengthCmd->SetParameter(param); 156 225 param = new G4UIparameter("wflag",'b',true); 157 226 param->SetDefaultValue("true"); 227 qPassTrackLengthCmd->SetParameter(param); 228 param = new G4UIparameter("unit",'s',true); 229 param->SetDefaultValue("mm"); 158 230 qPassTrackLengthCmd->SetParameter(param); 159 231 // … … 161 233 qFlatSurfCurrCmd->SetGuidance("Flat surface current Scorer."); 162 234 qFlatSurfCurrCmd-> 163 SetGuidance("[usage] /score/quantiy/flatSurfaceCurrent qname dflag wflag aflag");235 SetGuidance("[usage] /score/quantiy/flatSurfaceCurrent qname dflag wflag aflag unit"); 164 236 qFlatSurfCurrCmd->SetGuidance(" qname :(String) scorer name"); 165 237 qFlatSurfCurrCmd->SetGuidance(" dflag :(Int) direction flag"); … … 169 241 qFlatSurfCurrCmd->SetGuidance(" wflag :(Bool) weighted"); 170 242 qFlatSurfCurrCmd->SetGuidance(" aflag :(Bool) divide by area"); 243 qFlatSurfCurrCmd->SetGuidance(" unit :(Bool) unit"); 171 244 param = new G4UIparameter("qname",'s',false); 172 245 qFlatSurfCurrCmd->SetParameter(param); … … 180 253 param->SetDefaultValue("true"); 181 254 qFlatSurfCurrCmd->SetParameter(param); 255 param = new G4UIparameter("unit",'s',true); 256 param->SetDefaultValue("percm2"); 257 qFlatSurfCurrCmd->SetParameter(param); 182 258 // 183 259 qFlatSurfFluxCmd = new G4UIcommand("/score/quantity/flatSurfaceFlux",this); 184 260 qFlatSurfFluxCmd->SetGuidance("Flat surface flux scorer."); 185 261 qFlatSurfFluxCmd-> 186 SetGuidance("[usage] /score/quantiy/flatSurfaceFlux qname dflag");262 SetGuidance("[usage] /score/quantiy/flatSurfaceFlux qname dflag unit"); 187 263 qFlatSurfFluxCmd->SetGuidance(" qname :(String) scorer name"); 188 264 qFlatSurfFluxCmd->SetGuidance(" dflag :(Int) direction flag"); … … 190 266 qFlatSurfFluxCmd->SetGuidance(" : 1 = In only"); 191 267 qFlatSurfFluxCmd->SetGuidance(" : 2 = Out only"); 268 qFlatSurfFluxCmd->SetGuidance(" unit :(String) unit"); 192 269 param = new G4UIparameter("qname",'s',false); 193 270 qFlatSurfFluxCmd->SetParameter(param); … … 195 272 param->SetDefaultValue("0"); 196 273 qFlatSurfFluxCmd->SetParameter(param); 274 param = new G4UIparameter("unit",'s',true); 275 param->SetDefaultValue("percm2"); 276 qFlatSurfFluxCmd->SetParameter(param); 197 277 // 198 278 // qSphereSurfCurrCmd = new G4UIcommand("/score/quantity/sphereSurfaceCurrent",this); 199 279 // qSphereSurfCurrCmd->SetGuidance("Sphere surface current Scorer."); 200 280 // qSphereSurfCurrCmd-> 201 // SetGuidance("[usage] /score/quantiy/sphereSurfaceCurrent qname dflag wflag aflag ");281 // SetGuidance("[usage] /score/quantiy/sphereSurfaceCurrent qname dflag wflag aflag unit"); 202 282 // qSphereSurfCurrCmd->SetGuidance(" qname :(String) scorer name"); 203 283 // qSphereSurfCurrCmd->SetGuidance(" dflag :(Int) direction flag"); … … 207 287 // qSphereSurfCurrCmd->SetGuidance(" wflag :(Bool) Weighted"); 208 288 // qSphereSurfCurrCmd->SetGuidance(" aflag :(Bool) DivideByArea"); 289 // qSphereSurfCurrCmd->SetGuidance(" unit :(String) unit"); 209 290 // param = new G4UIparameter("qname",'s',false); 210 291 // qSphereSurfCurrCmd->SetParameter(param); … … 218 299 // param->SetDefaultValue("true"); 219 300 // qSphereSurfCurrCmd->SetParameter(param); 301 // param = new G4UIparameter("unit",'s',true); 302 // param->SetDefaultValue("percm2"); 303 // qSphereSurfCurrCmd->SetParameter(param); 220 304 221 305 // … … 223 307 // qSphereSurfFluxCmd->SetGuidance("Sphere surface Flux Scorer."); 224 308 // qSphereSurfFluxCmd-> 225 // SetGuidance("[usage] /score/quantiy/sphereSurfaceFlux qname dflag");309 // SetGuidance("[usage] /score/quantiy/sphereSurfaceFlux qname dflag unit"); 226 310 // qSphereSurfFluxCmd->SetGuidance(" qname :(String) scorer name"); 227 311 // qSphereSurfFluxCmd->SetGuidance(" dflag :(Int) direction flag"); … … 229 313 // qSphereSurfFluxCmd->SetGuidance(" : 1 = In only"); 230 314 // qSphereSurfFluxCmd->SetGuidance(" : 2 = Out only"); 315 // qSphereSurfFluxCmd->SetGuidance(" unit :(String) unit"); 231 316 // param = new G4UIparameter("qname",'s',false); 232 317 // qSphereSurfFluxCmd->SetParameter(param); … … 234 319 // param->SetDefaultValue("0"); 235 320 // qSphereSurfFluxCmd->SetParameter(param); 321 // param = new G4UIparameter("unit",'s',true); 322 // param->SetDefaultValue("percm2"); 323 // qSphereSurfFluxCmd->SetParameter(param); 236 324 237 325 // … … 239 327 // qCylSurfCurrCmd->SetGuidance("Cylinder surface current Scorer."); 240 328 // qCylSurfCurrCmd-> 241 // SetGuidance("[usage] /score/quantiy/cylinderSurfaceCurrent qname dflag wflag aflag");329 // SetGuidance("[usage] /score/quantiy/cylinderSurfaceCurrent qname dflag wflag aflag unit"); 242 330 // qCylSurfCurrCmd->SetGuidance(" qname :(String) scorer name"); 243 331 // qCylSurfCurrCmd->SetGuidance(" dflag :(Int) direction flag"); … … 247 335 // qCylSurfCurrCmd->SetGuidance(" wflag :(Bool) Weighted"); 248 336 // qCylSurfCurrCmd->SetGuidance(" aflag :(Bool) DivideByArea"); 337 // qCylSurfCurrCmd->SetGuidance(" unit :(String) unit"); 249 338 // param = new G4UIparameter("qname",'s',false); 250 339 // qCylSurfCurrCmd->SetParameter(param); … … 258 347 // param->SetDefaultValue("true"); 259 348 // qCylSurfCurrCmd->SetParameter(param); 349 // param = new G4UIparameter("unit",'s',true); 350 // param->SetDefaultValue("percm2"); 351 // qCylSurfCurrCmd->SetParameter(param); 260 352 // 261 353 // qCylSurfFluxCmd = new G4UIcommand("/score/quantity/cylinderSurfaceFlux",this); 262 354 // qCylSurfFluxCmd->SetGuidance("Cylinder surface Flux Scorer."); 263 355 // qCylSurfFluxCmd-> 264 // SetGuidance("[usage] /score/quantiy/cylinderSurfaceFlux qname dflag");356 // SetGuidance("[usage] /score/quantiy/cylinderSurfaceFlux qname dflag unit"); 265 357 // qCylSurfFluxCmd->SetGuidance(" qname :(String) scorer name"); 266 358 // qCylSurfFluxCmd->SetGuidance(" dflag :(Int) direction flag"); … … 268 360 // qCylSurfFluxCmd->SetGuidance(" : 1 = In only"); 269 361 // qCylSurfFluxCmd->SetGuidance(" : 2 = Out only"); 362 // qCylSurfFluxCmd->SetGuidance(" unit :(String) unit"); 270 363 // param = new G4UIparameter("qname",'s',false); 271 364 // qCylSurfFluxCmd->SetParameter(param); … … 273 366 // param->SetDefaultValue("0"); 274 367 // qCylSurfFluxCmd->SetParameter(param); 368 // param = new G4UIparameter("unit",'s',true); 369 // param->SetDefaultValue("percm2"); 370 // qCylSurfFluxCmd->SetParameter(param); 371 // 275 372 // 276 373 qNofCollisionCmd = new G4UIcommand("/score/quantity/nOfCollision",this); 277 374 qNofCollisionCmd->SetGuidance("Number of collision scorer."); 278 375 qNofCollisionCmd-> 279 376 SetGuidance("[usage] /score/quantiy/nOfCollision qname wflag"); 280 377 qNofCollisionCmd->SetGuidance(" qname :(String) scorer name"); 281 qNofCollisionCmd->SetGuidance(" wflag :(Bool) weighted");282 378 param = new G4UIparameter("qname",'s',false); 283 379 qNofCollisionCmd->SetParameter(param); … … 289 385 qPopulationCmd->SetGuidance("Population scorer."); 290 386 qPopulationCmd-> 291 387 SetGuidance("[usage] /score/quantiy/population qname wflag"); 292 388 qPopulationCmd->SetGuidance(" qname :(String) scorer name"); 293 389 qPopulationCmd->SetGuidance(" wflag :(Bool) weighted"); … … 302 398 qTrackCountCmd->SetGuidance("Number of track scorer."); 303 399 qTrackCountCmd-> 304 400 SetGuidance("[usage] /score/quantiy/nOfTrack qname dflag wflag"); 305 401 qTrackCountCmd->SetGuidance(" qname :(String) scorer name"); 306 402 qTrackCountCmd->SetGuidance(" dflag :(Int) direction"); … … 330 426 param->SetDefaultValue("false"); 331 427 qTerminationCmd->SetParameter(param); 428 429 // 430 qMinKinEAtGeneCmd = new G4UIcommand("/score/quantity/minKinEAtGeneration",this); 431 qMinKinEAtGeneCmd->SetGuidance("Min Kinetic Energy at Generation"); 432 qMinKinEAtGeneCmd-> 433 SetGuidance("[usage] /score/quantiy/minKinEAtGeneration qname"); 434 qMinKinEAtGeneCmd->SetGuidance(" qname :(String) scorer name"); 435 param = new G4UIparameter("qname",'s',false); 436 qMinKinEAtGeneCmd->SetParameter(param); 332 437 } 333 438 -
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 } -
trunk/source/digits_hits/utils/src/G4ScoringCylinder.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ScoringCylinder.cc,v 1. 6 2008/08/29 02:50:05akimura Exp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ScoringCylinder.cc,v 1.16 2010/08/30 08:15:20 akimura Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 … … 38 38 #include "G4PVReplica.hh" 39 39 #include "G4PVDivision.hh" 40 #include "G4PVParameterised.hh"41 40 #include "G4VisAttributes.hh" 42 //#include "G4ScoringCylinderParameterisation.hh"43 41 #include "G4VVisManager.hh" 44 42 #include "G4VScoreColorMap.hh" … … 55 53 56 54 G4ScoringCylinder::G4ScoringCylinder(G4String wName) 57 :G4VScoringMesh(wName), fSegmentDirection(-1), 58 fMeshElementLogical(0) 55 :G4VScoringMesh(wName), fMeshElementLogical(0) 59 56 { 60 57 fShape = cylinderMesh; 58 59 fDivisionAxisNames[0] = "Z"; 60 fDivisionAxisNames[1] = "PHI"; 61 fDivisionAxisNames[2] = "R"; 61 62 } 62 63 63 64 G4ScoringCylinder::~G4ScoringCylinder() 64 { 65 } 65 {;} 66 66 67 67 void G4ScoringCylinder::Construct(G4VPhysicalVolume* fWorldPhys) … … 91 91 // Scoring Mesh 92 92 if(verboseLevel > 9) G4cout << fWorldName << G4endl; 93 G4String tubsName = fWorldName ;94 95 if(verboseLevel > 9) G4cout << fSize[0] << ", " << fSize[1] << G4endl;93 G4String tubsName = fWorldName+"_mesh"; 94 95 if(verboseLevel > 9) G4cout << "R max., Dz =: " << fSize[0] << ", " << fSize[1] << G4endl; 96 96 G4VSolid * tubsSolid = new G4Tubs(tubsName+"0", // name 97 97 0., // R min 98 98 fSize[0], // R max 99 fSize[1], // dZ99 fSize[1], // Dz 100 100 0., // starting phi 101 101 twopi*rad); // segment phi 102 102 G4LogicalVolume * tubsLogical = new G4LogicalVolume(tubsSolid, 0, tubsName); 103 103 new G4PVPlacement(fRotationMatrix, fCenterPosition, 104 104 tubsLogical, tubsName+"0", worldLogical, false, 0); 105 105 106 if(verboseLevel > 9) G4cout << " # of segments : r, phi, z =: " 107 << fNSegment[IR] << ", " << fNSegment[IPHI] << ", " << fNSegment[IZ] << G4endl; 106 108 107 109 G4String layerName[2] = {tubsName + "1", tubsName + "2"}; … … 109 111 G4LogicalVolume * layerLogical[2]; 110 112 111 //-- fisrt nested layer (replicated along rdirection)113 //-- fisrt nested layer (replicated along z direction) 112 114 if(verboseLevel > 9) G4cout << "layer 1 :" << G4endl; 113 layerSolid[0] = new G4Tubs(layerName[0], 114 0., 115 fSize[0]/fNSegment[0], 116 fSize[1], 117 0., twopi*rad); 115 layerSolid[0] = new G4Tubs(layerName[0], // name 116 0., // inner radius 117 fSize[0], // outer radius 118 fSize[1]/fNSegment[IZ], // half len. in z 119 0., // starting phi angle 120 twopi*rad); // delta angle of the segment 118 121 layerLogical[0] = new G4LogicalVolume(layerSolid[0], 0, layerName[0]); 119 if(fNSegment[0] > 1) { 120 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replicate along r direction" << G4endl; 121 G4double r = fSize[0]/fNSegment[0]; 122 //if(G4ScoringManager::GetReplicaLevel()>0) { 123 if(false) { // always use G4PVDivision 122 if(fNSegment[IZ] > 1) { 123 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replicate along z direction" << G4endl; 124 if(G4ScoringManager::GetReplicaLevel()>0) { 124 125 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replica" << G4endl; 125 new G4PVReplica(layerName[0], layerLogical[0], tubsLogical, kRho, 126 fNSegment[0], r, 0.); 126 new G4PVReplica(layerName[0], layerLogical[0], tubsLogical, kZAxis, fNSegment[IZ], 2.*fSize[1]/fNSegment[IZ]); 127 127 } else { 128 128 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Division" << G4endl; 129 new G4PVDivision(layerName[0], layerLogical[0], tubsLogical, kRho, 130 fNSegment[0], 0.); 131 } 132 } else if(fNSegment[0] == 1) { 129 new G4PVDivision(layerName[0], layerLogical[0], tubsLogical, kZAxis, fNSegment[IZ], 0.); 130 } 131 } else if(fNSegment[IZ] == 1) { 133 132 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Placement" << G4endl; 134 133 new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), layerLogical[0], layerName[0], tubsLogical, false, 0); 135 134 } else { 136 135 G4cerr << "G4ScoringCylinder::SetupGeometry() : invalid parameter (" 137 << fNSegment[ 0] << ") "136 << fNSegment[IZ] << ") " 138 137 << "in placement of the first nested layer." << G4endl; 139 138 } 140 139 141 if(verboseLevel > 9) { 142 G4cout << fSize[0] << ", " 143 << fSize[1] 144 << G4endl; 145 G4cout << layerName[0] << ": kRho, " 146 << fNSegment[0] << ", " 147 << fSize[0]/fNSegment[0] << G4endl; 148 } 149 150 // second nested layer (replicated along z direction) 140 // second nested layer (replicated along phi direction) 151 141 if(verboseLevel > 9) G4cout << "layer 2 :" << G4endl; 152 142 layerSolid[1] = new G4Tubs(layerName[1], 153 143 0., 154 fSize[0],///fNSegment[0], 155 fSize[1]/fNSegment[1], 156 0., twopi*rad); 144 fSize[0], 145 fSize[1]/fNSegment[IZ], 146 0., 147 twopi*rad/fNSegment[IPHI]); 157 148 layerLogical[1] = new G4LogicalVolume(layerSolid[1], 0, layerName[1]); 158 if(fNSegment[1] > 1) { 159 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replicate along z direction" << G4endl; 160 G4double width = fSize[1]/fNSegment[1]*2.; 161 //if(G4ScoringManager::GetReplicaLevel()>1) { 162 if(false) { // always use G4PVDivision 149 if(fNSegment[IPHI] > 1) { 150 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replicate along phi direction" << G4endl; 151 if(G4ScoringManager::GetReplicaLevel()>1) { 163 152 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replica" << G4endl; 164 new G4PVReplica(layerName[1], layerLogical[1], layerLogical[0], k ZAxis,165 fNSegment[ 1], width);153 new G4PVReplica(layerName[1], layerLogical[1], layerLogical[0], kPhi, 154 fNSegment[IPHI], twopi*rad/fNSegment[IPHI]); 166 155 } else { 167 156 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Division" << G4endl; 168 new G4PVDivision(layerName[1], layerLogical[1], layerLogical[0], kZAxis, 169 fNSegment[1], 0.); 170 } 171 } else if(fNSegment[1] == 1) { 157 new G4PVDivision(layerName[1], layerLogical[1], layerLogical[0], kPhi, fNSegment[IPHI], 0.); 158 } 159 } else if(fNSegment[IPHI] == 1) { 172 160 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Placement" << G4endl; 173 161 new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), layerLogical[1], layerName[1], layerLogical[0], false, 0); 174 162 } else 175 163 G4cerr << "ERROR : G4ScoringCylinder::SetupGeometry() : invalid parameter (" 176 << fNSegment[ 1] << ") "164 << fNSegment[IPHI] << ") " 177 165 << "in placement of the second nested layer." << G4endl; 178 179 if(verboseLevel > 9) {180 G4cout << fSize[0]/fNSegment[0] << ", "181 << fSize[1]/fNSegment[1] << G4endl;182 G4cout << layerName[1] << ": kZAxis, "183 << fNSegment[1] << ", "184 << fSize[1]/fNSegment[1] << G4endl;185 }186 187 166 188 167 // mesh elements … … 191 170 G4VSolid * elementSolid = new G4Tubs(elementName, 192 171 0., 193 fSize[0],//fNSegment[0], 194 fSize[1]/fNSegment[1], 195 0., twopi*rad/fNSegment[2]); 172 fSize[0]/fNSegment[IR], 173 fSize[1]/fNSegment[IZ], 174 0., 175 twopi*rad/fNSegment[IPHI]); 196 176 fMeshElementLogical = new G4LogicalVolume(elementSolid, 0, elementName); 197 if(fNSegment[2] > 1) { 198 199 /* 200 if(fSegmentPositions.size() > 0) { 201 G4double motherDims[3] ={fSize[0]/fsegParam[2][0], 202 fSize[1]/fsegParam[2][1], 203 fSize[2]/fsegParam[2][2]}; 204 G4int nelement = fSegmentPositions.size() + 1; 205 //G4ScoringCylinderParameterisation * param = 206 G4VPVParameterisation * param = 207 new G4ScoringCylinderParameterisation(axis[2], motherDims, fSegmentPositions); 208 new G4PVParameterised(elementName, 209 fMeshElementLogical, 210 layerLogical[1], 211 axis[2], 212 nelement, 213 param); 214 } else { 215 */ 216 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replicate along phi direction" << G4endl; 217 218 G4double angle = twopi*rad/fNSegment[2]; 219 //if(G4ScoringManager::GetReplicaLevel()>2) { 220 if(false) { // always use G4PVDivision 177 if(fNSegment[IR] > 1) { 178 179 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replicate along r direction" << G4endl; 180 181 if(G4ScoringManager::GetReplicaLevel()>2) { 221 182 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Replica" << G4endl; 222 new G4PVReplica(elementName, fMeshElementLogical, layerLogical[1], k Phi,223 fNSegment[ 2], angle, 0.);183 new G4PVReplica(elementName, fMeshElementLogical, layerLogical[1], kRho, 184 fNSegment[IR], fSize[0]/fNSegment[IR]); 224 185 } else { 225 186 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Division" << G4endl; 226 new G4PVDivision(elementName, fMeshElementLogical, layerLogical[1], kPhi, 227 fNSegment[2], 0.); 228 } 229 //} 230 } else if(fNSegment[2] == 1) { 187 new G4PVDivision(elementName, fMeshElementLogical, layerLogical[1], kRho, fNSegment[IR], 0.); 188 } 189 } else if(fNSegment[IR] == 1) { 231 190 if(verboseLevel > 9) G4cout << "G4ScoringCylinder::Construct() : Placement" << G4endl; 232 191 new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), fMeshElementLogical, elementName, layerLogical[1], false, 0); 233 192 } else { 234 193 G4cerr << "G4ScoringCylinder::SetupGeometry() : " 235 << "invalid parameter (" << fNSegment[ 2] << ") "194 << "invalid parameter (" << fNSegment[IR] << ") " 236 195 << "in mesh element placement." << G4endl; 237 }238 239 if(verboseLevel > 9) {240 G4cout << fSize[0]/fNSegment[0] << ", "241 << fSize[1]/fNSegment[1] << G4endl;242 G4cout << elementName << ": kPhi, "243 << fNSegment[2] << G4endl;244 196 } 245 197 … … 249 201 250 202 // vis. attributes 251 G4VisAttributes * visatt = new G4VisAttributes(G4Colour(.5,.5,.5 ,0.1));203 G4VisAttributes * visatt = new G4VisAttributes(G4Colour(.5,.5,.5)); 252 204 visatt->SetVisibility(true); 253 //layerLogical[0]->SetVisAttributes(visatt);254 //layerLogical[1]->SetVisAttributes(visatt);205 layerLogical[0]->SetVisAttributes(visatt); 206 layerLogical[1]->SetVisAttributes(visatt); 255 207 visatt = new G4VisAttributes(G4Colour(.5,.5,.5,0.01)); 256 208 //visatt->SetForceSolid(true); … … 272 224 void G4ScoringCylinder::Draw(std::map<G4int, G4double*> * map, G4VScoreColorMap* colorMap, G4int axflg) { 273 225 274 275 226 G4VVisManager * pVisManager = G4VVisManager::GetConcreteInstance(); 276 227 if(pVisManager) { 277 228 278 229 // cell vectors 279 std::vector<std::vector<std::vector<double> > > cell; // cell[R][Z][PHI]280 230 std::vector<double> ephi; 281 for(int phi = 0; phi < fNSegment[2]; phi++) ephi.push_back(0.); 282 std::vector<std::vector<double> > ezphi; 283 for(int z = 0; z < fNSegment[1]; z++) ezphi.push_back(ephi); 284 for(int r = 0; r < fNSegment[0]; r++) cell.push_back(ezphi); 285 286 std::vector<std::vector<double> > rzcell; // rzcell[R][Z] 287 std::vector<double> ez; 288 for(int z = 0; z < fNSegment[1]; z++) ez.push_back(0.); 289 for(int r = 0; r < fNSegment[0]; r++) rzcell.push_back(ez); 290 231 for(int phi = 0; phi < fNSegment[IPHI]; phi++) ephi.push_back(0.); 232 //- 291 233 std::vector<std::vector<double> > zphicell; // zphicell[Z][PHI] 292 for(int z = 0; z < fNSegment[ 1]; z++) zphicell.push_back(ephi);293 234 for(int z = 0; z < fNSegment[IZ]; z++) zphicell.push_back(ephi); 235 //- 294 236 std::vector<std::vector<double> > rphicell; // rphicell[R][PHI] 295 for(int r = 0; r < fNSegment[ 0]; r++) rphicell.push_back(ephi);237 for(int r = 0; r < fNSegment[IR]; r++) rphicell.push_back(ephi); 296 238 297 239 // search max. values 298 G4double rzmin = DBL_MAX,zphimin = DBL_MAX, rphimin = DBL_MAX;299 G4double rzmax = 0.,zphimax = 0., rphimax = 0.;240 G4double zphimin = DBL_MAX, rphimin = DBL_MAX; 241 G4double zphimax = 0., rphimax = 0.; 300 242 G4int q[3]; 301 243 std::map<G4int, G4double*>::iterator itr = map->begin(); 302 244 for(; itr != map->end(); itr++) { 245 if(itr->first < 0) { 246 G4cout << itr->first << G4endl; 247 continue; 248 } 303 249 GetRZPhi(itr->first, q); 304 250 305 rzcell[q[0]][q[1]] += *(itr->second); 306 if(rzmin > rzcell[q[0]][q[1]]) rzmin = rzcell[q[0]][q[1]]; 307 if(rzmax < rzcell[q[0]][q[1]]) rzmax = rzcell[q[0]][q[1]]; 308 309 zphicell[q[1]][q[2]] += *(itr->second); 310 if(zphimin > zphicell[q[1]][q[2]]) zphimin = zphicell[q[1]][q[2]]; 311 if(zphimax < zphicell[q[1]][q[2]]) zphimax = zphicell[q[1]][q[2]]; 312 313 rphicell[q[0]][q[2]] += *(itr->second); 314 if(rphimin > rphicell[q[0]][q[2]]) rphimin = rphicell[q[0]][q[2]]; 315 if(rphimax < rphicell[q[0]][q[2]]) rphimax = rphicell[q[0]][q[2]]; 251 // projections 252 zphicell[q[IZ]][q[IPHI]] += *(itr->second)/fDrawUnitValue; 253 if(zphimin > zphicell[q[IZ]][q[IPHI]]) zphimin = zphicell[q[IZ]][q[IPHI]]; 254 if(zphimax < zphicell[q[IZ]][q[IPHI]]) zphimax = zphicell[q[IZ]][q[IPHI]]; 255 //- 256 rphicell[q[IR]][q[IPHI]] += *(itr->second)/fDrawUnitValue; 257 if(rphimin > rphicell[q[IR]][q[IPHI]]) rphimin = rphicell[q[IR]][q[IPHI]]; 258 if(rphimax < rphicell[q[IR]][q[IPHI]]) rphimax = rphicell[q[IR]][q[IPHI]]; 316 259 } 317 260 … … 330 273 if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(zphimin, zphimax); } 331 274 332 G4double zhalf = fSize[1]/fNSegment[1]; 333 for(int phi = 0; phi < fNSegment[2]; phi++) { 334 for(int z = 0; z < fNSegment[1]; z++) { 335 336 G4double angle = twopi/fNSegment[2]*phi; 337 G4double dphi = twopi/fNSegment[2]; 338 G4Tubs cylinder("z-phi", fSize[0]*0.99, fSize[0], zhalf, 339 angle, dphi*0.99999); 340 /* 341 G4cout << ">>>> " 342 << fSize[1]/fNSegment[1]/2. << " : " 343 << angle << " - " << angle + dphi 344 << G4endl; 345 */ 346 347 G4ThreeVector zpos(0., 0., -fSize[1] + fSize[1]/fNSegment[1]*(1 + 2.*z)); 275 G4double zhalf = fSize[1]/fNSegment[IZ]; 276 for(int phi = 0; phi < fNSegment[IPHI]; phi++) { 277 for(int z = 0; z < fNSegment[IZ]; z++) { 278 //- 279 G4double angle = twopi/fNSegment[IPHI]*phi; 280 G4double dphi = twopi/fNSegment[IPHI]; 281 G4Tubs cylinder("z-phi", // name 282 fSize[0]*0.99, fSize[0], // inner radius, outer radius 283 zhalf, // half length in z 284 angle, dphi*0.99999); // starting phi angle, delta angle 285 //- 286 G4ThreeVector zpos(0., 0., -fSize[1] + fSize[1]/fNSegment[IZ]*(1 + 2.*z)); 348 287 G4Transform3D trans; 349 288 if(fRotationMatrix) { … … 356 295 colorMap->GetMapColor(zphicell[z][phi], c); 357 296 att.SetColour(c[0], c[1], c[2]);//, c[3]); 358 /* 359 G4cout << " " << c[0] << ", " 360 << c[1] << ", " << c[2] << G4endl; 361 */ 297 //- 362 298 pVisManager->Draw(cylinder, att, trans); 363 299 } … … 369 305 if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(rphimin, rphimax); } 370 306 371 G4double rsize = fSize[0]/fNSegment[ 0];372 for(int phi = 0; phi < fNSegment[ 2]; phi++) {373 for(int r = 0; r < fNSegment[ 0]; r++) {307 G4double rsize = fSize[0]/fNSegment[IR]; 308 for(int phi = 0; phi < fNSegment[IPHI]; phi++) { 309 for(int r = 0; r < fNSegment[IR]; r++) { 374 310 375 311 G4double rs[2] = {rsize*r, rsize*(r+1)}; 376 G4double angle = twopi/fNSegment[ 2]*phi;377 G4double dphi = twopi/fNSegment[ 2];312 G4double angle = twopi/fNSegment[IPHI]*phi; 313 G4double dphi = twopi/fNSegment[IPHI]; 378 314 G4Tubs cylinder("z-phi", rs[0], rs[1], 0.001, 379 315 angle, dphi*0.99999); … … 409 345 } 410 346 } 347 348 colorMap->SetPSUnit(fDrawUnit); 349 colorMap->SetPSName(fDrawPSName); 411 350 colorMap->DrawColorChart(); 351 412 352 } 413 353 } … … 416 356 G4int idxProj, G4int idxColumn) 417 357 { 418 419 if(idxColumn<0 || idxColumn>=fNSegment[idxProj]) 358 G4int projAxis = 0; 359 switch(idxProj) { 360 case 0: 361 projAxis = IR; 362 break; 363 case 1: 364 projAxis = IZ; 365 break; 366 case 2: 367 projAxis = IPHI; 368 break; 369 } 370 371 if(idxColumn<0 || idxColumn>=fNSegment[projAxis]) 420 372 { 421 G4cerr << " ERROR : Column number " << idxColumn << " is out of scoring mesh [0," << fNSegment[idxProj]-1 <<373 G4cerr << "Warning : Column number " << idxColumn << " is out of scoring mesh [0," << fNSegment[projAxis]-1 << 422 374 "]. Method ignored." << G4endl; 423 375 return; … … 425 377 G4VVisManager * pVisManager = G4VVisManager::GetConcreteInstance(); 426 378 if(pVisManager) { 427 379 428 380 // cell vectors 429 381 std::vector<std::vector<std::vector<double> > > cell; // cell[R][Z][PHI] 430 382 std::vector<double> ephi; 431 for(int phi = 0; phi < fNSegment[ 2]; phi++) ephi.push_back(0.);383 for(int phi = 0; phi < fNSegment[IPHI]; phi++) ephi.push_back(0.); 432 384 std::vector<std::vector<double> > ezphi; 433 for(int z = 0; z < fNSegment[ 1]; z++) ezphi.push_back(ephi);434 for(int r = 0; r < fNSegment[ 0]; r++) cell.push_back(ezphi);385 for(int z = 0; z < fNSegment[IZ]; z++) ezphi.push_back(ephi); 386 for(int r = 0; r < fNSegment[IR]; r++) cell.push_back(ezphi); 435 387 436 388 std::vector<std::vector<double> > rzcell; // rzcell[R][Z] 437 389 std::vector<double> ez; 438 for(int z = 0; z < fNSegment[ 1]; z++) ez.push_back(0.);439 for(int r = 0; r < fNSegment[ 0]; r++) rzcell.push_back(ez);390 for(int z = 0; z < fNSegment[IZ]; z++) ez.push_back(0.); 391 for(int r = 0; r < fNSegment[IR]; r++) rzcell.push_back(ez); 440 392 441 393 std::vector<std::vector<double> > zphicell; // zphicell[Z][PHI] 442 for(int z = 0; z < fNSegment[ 1]; z++) zphicell.push_back(ephi);394 for(int z = 0; z < fNSegment[IZ]; z++) zphicell.push_back(ephi); 443 395 444 396 std::vector<std::vector<double> > rphicell; // rphicell[R][PHI] 445 for(int r = 0; r < fNSegment[ 0]; r++) rphicell.push_back(ephi);397 for(int r = 0; r < fNSegment[IR]; r++) rphicell.push_back(ephi); 446 398 447 399 // search max. values … … 450 402 std::map<G4int, G4double*>::iterator itr = map->begin(); 451 403 for(; itr != map->end(); itr++) { 404 if(itr->first < 0) { 405 G4cout << itr->first << G4endl; 406 continue; 407 } 452 408 GetRZPhi(itr->first, q); 453 409 454 if( idxProj == 0 && q[0] == idxColumn) { // zphi plane455 zphicell[q[ 1]][q[2]] += *(itr->second);456 if(zphimax < zphicell[q[ 1]][q[2]]) zphimax = zphicell[q[1]][q[2]];457 } 458 if( idxProj == 1 && q[1] == idxColumn) { // rphi plane459 rphicell[q[ 0]][q[2]] += *(itr->second);460 if(rphimax < rphicell[q[ 0]][q[2]]) rphimax = rphicell[q[0]][q[2]];461 } 462 if( idxProj == 2 && q[2] == idxColumn) { // rz plane463 rzcell[q[ 0]][q[1]] += *(itr->second);464 if(rzmax < rzcell[q[ 0]][q[1]]) rzmax = rzcell[q[0]][q[1]];410 if(projAxis == IR && q[IR] == idxColumn) { // zphi plane 411 zphicell[q[IZ]][q[IPHI]] += *(itr->second)/fDrawUnitValue; 412 if(zphimax < zphicell[q[IZ]][q[IPHI]]) zphimax = zphicell[q[IZ]][q[IPHI]]; 413 } 414 if(projAxis == IZ && q[IZ] == idxColumn) { // rphi plane 415 rphicell[q[IR]][q[IPHI]] += *(itr->second)/fDrawUnitValue; 416 if(rphimax < rphicell[q[IR]][q[IPHI]]) rphimax = rphicell[q[IR]][q[IPHI]]; 417 } 418 if(projAxis == IPHI && q[IPHI] == idxColumn) { // rz plane 419 rzcell[q[IR]][q[IZ]] += *(itr->second)/fDrawUnitValue; 420 if(rzmax < rzcell[q[IR]][q[IZ]]) rzmax = rzcell[q[IR]][q[IZ]]; 465 421 } 466 422 } … … 472 428 473 429 G4Scale3D scale; 474 // r-phi plane475 if( idxProj == 0) {430 // z-phi plane 431 if(projAxis == IR) { 476 432 if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(0.,zphimax); } 477 433 478 G4double zhalf = fSize[1]/fNSegment[ 1];479 G4double rsize[2] = {fSize[0]/fNSegment[ 0]*idxColumn,480 fSize[0]/fNSegment[0]*(idxColumn+1)};481 for(int phi = 0; phi < fNSegment[ 2]; phi++) {482 for(int z = 0; z < fNSegment[ 1]; z++) {483 484 G4double angle = twopi/fNSegment[ 2]*phi*radian;485 G4double dphi = twopi/fNSegment[ 2]*radian;434 G4double zhalf = fSize[1]/fNSegment[IZ]; 435 G4double rsize[2] = {fSize[0]/fNSegment[IR]*idxColumn, 436 fSize[0]/fNSegment[IR]*(idxColumn+1)}; 437 for(int phi = 0; phi < fNSegment[IPHI]; phi++) { 438 for(int z = 0; z < fNSegment[IZ]; z++) { 439 440 G4double angle = twopi/fNSegment[IPHI]*phi*radian; 441 G4double dphi = twopi/fNSegment[IPHI]*radian; 486 442 G4Tubs cylinder("z-phi", rsize[0], rsize[1], zhalf, 487 443 angle, dphi*0.99999); 488 444 489 G4ThreeVector zpos(0., 0., -fSize[1] + fSize[1]/fNSegment[ 1]*(1 + 2.*z));445 G4ThreeVector zpos(0., 0., -fSize[1] + fSize[1]/fNSegment[IZ]*(1 + 2.*z)); 490 446 G4Transform3D trans; 491 447 if(fRotationMatrix) { … … 503 459 504 460 // r-phi plane 505 } else if( idxProj == 1) {461 } else if(projAxis == IZ) { 506 462 if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(0.,rphimax); } 507 463 508 G4double rsize = fSize[0]/fNSegment[ 0];509 for(int phi = 0; phi < fNSegment[ 2]; phi++) {510 for(int r = 0; r < fNSegment[ 0]; r++) {464 G4double rsize = fSize[0]/fNSegment[IR]; 465 for(int phi = 0; phi < fNSegment[IPHI]; phi++) { 466 for(int r = 0; r < fNSegment[IR]; r++) { 511 467 512 468 G4double rs[2] = {rsize*r, rsize*(r+1)}; 513 G4double angle = twopi/fNSegment[ 2]*phi*radian;514 G4double dz = fSize[1]/fNSegment[ 1];515 G4double dphi = twopi/fNSegment[ 2]*radian;469 G4double angle = twopi/fNSegment[IPHI]*phi*radian; 470 G4double dz = fSize[1]/fNSegment[IZ]; 471 G4double dphi = twopi/fNSegment[IPHI]*radian; 516 472 G4Tubs cylinder("r-phi", rs[0], rs[1], dz, 517 473 angle, dphi*0.99999); 518 474 G4ThreeVector zpos(0., 0., 519 -fSize[1]+fSize[1]/fNSegment[ 1]*(idxColumn*2+1));475 -fSize[1]+fSize[1]/fNSegment[IZ]*(idxColumn*2+1)); 520 476 G4Transform3D trans; 521 477 if(fRotationMatrix) { … … 533 489 534 490 // r-z plane 535 } else if( idxProj == 2) {491 } else if(projAxis == IPHI) { 536 492 if(colorMap->IfFloatMinMax()) { colorMap->SetMinMax(0.,rzmax); } 537 493 538 G4double rsize = fSize[0]/fNSegment[ 0];539 G4double zhalf = fSize[1]/fNSegment[ 1];540 G4double angle = twopi/fNSegment[ 2]*idxColumn*radian;541 G4double dphi = twopi/fNSegment[ 2]*radian;542 for(int z = 0; z < fNSegment[ 1]; z++) {543 for(int r = 0; r < fNSegment[ 0]; r++) {494 G4double rsize = fSize[0]/fNSegment[IR]; 495 G4double zhalf = fSize[1]/fNSegment[IZ]; 496 G4double angle = twopi/fNSegment[IPHI]*idxColumn*radian; 497 G4double dphi = twopi/fNSegment[IPHI]*radian; 498 for(int z = 0; z < fNSegment[IZ]; z++) { 499 for(int r = 0; r < fNSegment[IR]; r++) { 544 500 545 501 G4double rs[2] = {rsize*r, rsize*(r+1)}; … … 548 504 549 505 G4ThreeVector zpos(0., 0., 550 -fSize[1]+fSize[1]/fNSegment[ 1]*(2.*z+1));506 -fSize[1]+fSize[1]/fNSegment[IZ]*(2.*z+1)); 551 507 G4Transform3D trans; 552 508 if(fRotationMatrix) { … … 565 521 } 566 522 523 colorMap->SetPSUnit(fDrawUnit); 524 colorMap->SetPSName(fDrawPSName); 567 525 colorMap->DrawColorChart(); 568 526 … … 570 528 571 529 void G4ScoringCylinder::GetRZPhi(G4int index, G4int q[3]) const { 572 573 q[0] = index/(fNSegment[2]*fNSegment[1]); 574 q[1] = (index - q[0]*fNSegment[2]*fNSegment[1])/fNSegment[2]; 575 q[2] = index - q[1]*fNSegment[2] - q[0]*fNSegment[2]*fNSegment[1]; 576 577 } 530 // index = k + j * k-size + i * jk-plane-size 531 532 // nested : z -> phi -> r 533 G4int i = IZ; 534 G4int j = IPHI; 535 G4int k = IR; 536 G4int jk = fNSegment[j]*fNSegment[k]; 537 q[i] = index/jk; 538 q[j] = (index - q[i]*jk)/fNSegment[k]; 539 q[k] = index - q[j]*fNSegment[k] - q[i]*jk; 540 } -
trunk/source/digits_hits/utils/src/G4ScoringManager.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ScoringManager.cc,v 1.3 1 2008/03/25 02:18:38 akimuraExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ScoringManager.cc,v 1.33 2010/09/24 05:51:27 asaim Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 … … 40 40 G4ScoringManager* G4ScoringManager::fSManager = 0; 41 41 42 G4int G4ScoringManager::replicaLevel = 2;42 G4int G4ScoringManager::replicaLevel = 3; 43 43 44 44 G4ScoringManager* G4ScoringManager::GetScoringManager() -
trunk/source/digits_hits/utils/src/G4ScoringMessenger.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4ScoringMessenger.cc,v 1. 39 2008/11/26 21:27:35 asaimExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4ScoringMessenger.cc,v 1.42 2010/07/26 03:52:33 akimura Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 // --------------------------------------------------------------------- … … 185 185 drawCmd->SetGuidance("Draw projection(s) of scored quantities."); 186 186 drawCmd->SetGuidance("Parameter <proj> specified which projection(s) to be drawn."); 187 drawCmd->SetGuidance(" 100 : xy-plane, 010 : yz-place, 001 : zx-plane -- default 111"); 187 drawCmd->SetGuidance(" 100 : xy-plane, 010 : yz-plane, 001 : zx-plane -- default 111"); 188 drawCmd->SetGuidance(" 100 : N/A, 010 : z_phi-plane, 001 : r_phi-plane -- default 111"); 188 189 param = new G4UIparameter("meshName",'s',false); 189 190 drawCmd->SetParameter(param); … … 200 201 drawColumnCmd = new G4UIcommand("/score/drawColumn",this); 201 202 drawColumnCmd->SetGuidance("Draw a cell column."); 202 drawColumnCmd->SetGuidance(" plane = 0 : xy, 1: yz, 2: zx"); 203 drawColumnCmd->SetGuidance(" plane = 0 : x-y, 1: y-z, 2: z-x for box mesh"); 204 drawColumnCmd->SetGuidance(" 0 : z-phi, 1: r-phi, 2: r-z for cylinder mesh"); 203 205 param = new G4UIparameter("meshName",'s',false); 204 206 drawColumnCmd->SetParameter(param); … … 235 237 colorMapMinMaxCmd->SetParameter(param); 236 238 239 /* 237 240 chartCmd = new G4UIcommand("/score/drawChart",this); 238 241 chartCmd->SetGuidance("Draw color chart on the screen."); … … 252 255 param->SetDefaultValue("linear"); 253 256 chartCmd->SetParameter(param); 254 257 */ 258 255 259 // Dump a scored quantity 256 260 dumpQtyToFileCmd = new G4UIcommand("/score/dumpQuantityToFile", this); … … 541 545 G4int Nk = StoI(token[2]); 542 546 G4int nSegment[3]; 543 nSegment[0] = Ni; 544 nSegment[1] = Nj; 545 nSegment[2] = Nk; 547 548 if(dynamic_cast<G4ScoringBox*>(mesh)) { 549 G4cout << ".... G4ScoringMessenger::MeshBinCommand - G4ScoringBox" << G4endl; 550 nSegment[0] = Ni; 551 nSegment[1] = Nj; 552 nSegment[2] = Nk; 553 } else if(dynamic_cast<G4ScoringCylinder*>(mesh)) { 554 G4cout << ".... G4ScoringMessenger::MeshBinCommand - G4ScoringCylinder" << G4endl; 555 nSegment[0] = Nj; 556 nSegment[1] = Nk; 557 nSegment[2] = Ni; 558 } else { 559 G4Exception("G4ScoringMessenger::MeshBinCommand()", "001", FatalException, "invalid mesh type"); 560 } 546 561 // 547 562 mesh->SetNumberOfSegments(nSegment); -
trunk/source/digits_hits/utils/src/G4VScoreColorMap.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4VScoreColorMap.cc,v 1. 4 2009/05/04 15:57:33 akimura Exp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4VScoreColorMap.cc,v 1.8 2010/07/26 03:52:33 akimura Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 … … 80 80 } 81 81 void G4VScoreColorMap::DrawColorChartText(G4int _nPoint) { 82 82 83 G4double min = this->GetMin(); 83 84 G4double max = this->GetMax(); … … 115 116 fVisManager->Draw2D(text); 116 117 } 118 119 // draw ps name 120 // background 121 G4int lpsname = 20;//fPSName.size(); 122 if(lpsname > 0) { 123 for(int l = 0; l < 22; l++) { 124 G4Polyline line; 125 line.push_back(G4Point3D(-0.9, -0.965+0.002*l, 0.)); 126 line.push_back(G4Point3D(-0.9+0.025*lpsname, -0.965+0.002*l, 0.)); 127 G4VisAttributes attblack(black); 128 //G4VisAttributes attblack(G4Colour(.5, .5, 1.)); 129 line.SetVisAttributes(&attblack); 130 fVisManager->Draw2D(line); 131 } 132 // ps name 133 G4Text txtpsname(fPSName, G4Point3D(-0.9, -0.96, 0.)); 134 G4double size = 12.; 135 txtpsname.SetScreenSize(size); 136 G4Colour color(1., 1., 1.); 137 G4VisAttributes att(color); 138 txtpsname.SetVisAttributes(&att); 139 fVisManager->Draw2D(txtpsname); 140 } 141 142 // draw unit 143 // background 144 G4int len = fPSUnit.size(); 145 if(len > 0) { 146 for(int l = 0; l < 21; l++) { 147 G4Polyline line; 148 line.push_back(G4Point3D(-0.7, -0.9+0.002*l, 0.)); 149 line.push_back(G4Point3D(-0.7+0.3, -0.9+0.002*l, 0.)); 150 G4VisAttributes attblack(black); 151 //G4VisAttributes attblack(G4Colour(.5, .5, .5)); 152 line.SetVisAttributes(&attblack); 153 fVisManager->Draw2D(line); 154 } 155 // unit 156 G4String psunit = "[" + fPSUnit + "]"; 157 G4Text txtunit(psunit, G4Point3D(-0.69, -0.9, 0.)); 158 G4double size = 12.; 159 txtunit.SetScreenSize(size); 160 G4Colour color(1., 1., 1.); 161 G4VisAttributes att(color); 162 txtunit.SetVisAttributes(&att); 163 fVisManager->Draw2D(txtunit); 164 } 165 117 166 } -
trunk/source/digits_hits/utils/src/G4VScoreWriter.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4VScoreWriter.cc,v 1. 5 2008/03/04 23:19:09 tasoExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4VScoreWriter.cc,v 1.10 2010/07/27 01:44:54 akimura Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 … … 87 87 return; 88 88 } 89 90 89 91 std::map<G4int, G4double*> * score = msMapItr->second->GetMap(); 90 ofile << "# primitive scorer name: " << msMapItr->first << G4endl; 92 ofile << "# primitive scorer name: " << msMapItr->first << std::endl; 93 94 95 G4double unitValue = fScoringMesh->GetPSUnitValue(psName); 96 G4String unit = fScoringMesh->GetPSUnit(psName); 97 G4String divisionAxisNames[3]; 98 fScoringMesh->GetDivisionAxisNames(divisionAxisNames); 99 // index order 100 ofile << "# i" << divisionAxisNames[0] 101 << ", i" << divisionAxisNames[1] 102 << ", i" << divisionAxisNames[2]; 103 // unit of scored value 104 ofile << ", value "; 105 if(unit.size() > 0) ofile << "[" << unit << "]"; 106 ofile << G4endl; 91 107 92 108 // "sequence" option: write header info … … 111 127 ofile << 0.; 112 128 } else { 113 ofile << *(value->second) ;129 ofile << *(value->second)/unitValue; 114 130 } 115 131 … … 160 176 std::map<G4int, G4double*> * score; 161 177 for(; msMapItr != fSMap.end(); msMapItr++) { 178 179 G4String psname = msMapItr->first; 180 162 181 score = msMapItr->second->GetMap(); 163 ofile << "# primitive scorer name: " << msMapItr->first << G4endl; 182 ofile << "# primitive scorer name: " << msMapItr->first << std::endl; 183 184 G4double unitValue = fScoringMesh->GetPSUnitValue(psname); 185 G4String unit = fScoringMesh->GetPSUnit(psname); 186 G4String divisionAxisNames[3]; 187 fScoringMesh->GetDivisionAxisNames(divisionAxisNames); 188 // index order 189 ofile << "# i" << divisionAxisNames[0] 190 << ", i" << divisionAxisNames[1] 191 << ", i" << divisionAxisNames[2]; 192 // unit of scored value 193 ofile << ", value "; 194 if(unit.size() > 0) ofile << "[" << unit << "]"; 195 ofile << G4endl; 196 164 197 165 198 // "sequence" option: write header info … … 184 217 ofile << 0.; 185 218 } else { 186 ofile << *(value->second) ;219 ofile << *(value->second)/unitValue; 187 220 } 188 221 -
trunk/source/digits_hits/utils/src/G4VScoringMesh.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4VScoringMesh.cc,v 1. 37 2009/10/12 04:11:25akimura Exp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4VScoringMesh.cc,v 1.42 2010/07/27 01:44:54 akimura Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 … … 39 39 : fWorldName(wName),fConstructed(false),fActive(true), 40 40 fRotationMatrix(NULL), fMFD(new G4MultiFunctionalDetector(wName)), 41 verboseLevel(0),sizeIsSet(false),nMeshIsSet(false) 41 verboseLevel(0),sizeIsSet(false),nMeshIsSet(false), 42 fDrawUnit(""), fDrawUnitValue(1.) 42 43 { 43 44 G4SDManager::GetSDMpointer()->AddNewDetector(fMFD); … … 45 46 fSize[0] = fSize[1] = fSize[2] = 0.; 46 47 fNSegment[0] = fNSegment[1] = fNSegment[2] = 1; 48 fDivisionAxisNames[0] = fDivisionAxisNames[1] = fDivisionAxisNames[2] = ""; 47 49 } 48 50 … … 150 152 if(itr == fMap.end()) return false; 151 153 return true; 154 } 155 156 G4String G4VScoringMesh::GetPSUnit(G4String & psname) { 157 std::map<G4String, G4THitsMap<G4double>* >::iterator itr = fMap.find(psname);; 158 if(itr == fMap.end()) { 159 return G4String(""); 160 } else { 161 return GetPrimitiveScorer(psname)->GetUnit(); 162 } 163 } 164 165 G4String G4VScoringMesh::GetCurrentPSUnit(){ 166 G4String unit = ""; 167 if(fCurrentPS == NULL) { 168 G4String msg = "ERROR : G4VScoringMesh::GetCurrentPSUnit() : "; 169 msg += " Current primitive scorer is null."; 170 G4cerr << msg << G4endl; 171 }else{ 172 unit = fCurrentPS->GetUnit(); 173 } 174 return unit; 175 } 176 177 void G4VScoringMesh::SetCurrentPSUnit(const G4String& unit){ 178 if(fCurrentPS == NULL) { 179 G4String msg = "ERROR : G4VScoringMesh::GetCurrentPSUnit() : "; 180 msg += " Current primitive scorer is null."; 181 G4cerr << msg << G4endl; 182 }else{ 183 fCurrentPS->SetUnit(unit); 184 } 185 } 186 187 G4double G4VScoringMesh::GetPSUnitValue(G4String & psname) { 188 std::map<G4String, G4THitsMap<G4double>* >::iterator itr = fMap.find(psname);; 189 if(itr == fMap.end()) { 190 return 1.; 191 } else { 192 return GetPrimitiveScorer(psname)->GetUnitValue(); 193 } 194 } 195 196 void G4VScoringMesh::GetDivisionAxisNames(G4String divisionAxisNames[3]) { 197 for(int i = 0; i < 3; i++) divisionAxisNames[i] = fDivisionAxisNames[i]; 152 198 } 153 199
Note: See TracChangeset
for help on using the changeset viewer.