Changeset 1340 for trunk/source/digits_hits/scorer/src/G4PSCellFlux.cc
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/digits_hits/scorer/src/G4PSCellFlux.cc
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4PSCellFlux.cc,v 1. 2 2008/12/28 20:32:00 asaimExp $28 // GEANT4 tag $Name: geant4-09-04-beta-01$27 // $Id: G4PSCellFlux.cc,v 1.4 2010/07/22 23:42:01 taso Exp $ 28 // GEANT4 tag $Name: $ 29 29 // 30 30 // G4PSCellFlux … … 48 48 // 49 49 // Created: 2005-11-14 Tsukasa ASO, Akinori Kimura. 50 // 2010-07-22 Introduce Unit specification. 51 // 2010-07-22 Add weighted option 50 52 // 51 53 /////////////////////////////////////////////////////////////////////////////// 52 54 53 55 G4PSCellFlux::G4PSCellFlux(G4String name, G4int depth) 56 :G4VPrimitiveScorer(name,depth),HCID(-1),weighted(true) 57 { 58 DefineUnitAndCategory(); 59 SetUnit("percm2"); 60 } 61 62 G4PSCellFlux::G4PSCellFlux(G4String name, const G4String& unit, G4int depth) 54 63 :G4VPrimitiveScorer(name,depth),HCID(-1) 55 {;} 64 { 65 DefineUnitAndCategory(); 66 SetUnit(unit); 67 } 56 68 57 69 G4PSCellFlux::~G4PSCellFlux() … … 79 91 80 92 G4double CellFlux = stepLength / (solid->GetCubicVolume()); 81 CellFlux *= aStep->GetPreStepPoint()->GetWeight();93 if (weighted) CellFlux *= aStep->GetPreStepPoint()->GetWeight(); 82 94 G4int index = GetIndex(aStep); 83 95 EvtMap->add(index,CellFlux); … … 112 124 for(; itr != EvtMap->GetMap()->end(); itr++) { 113 125 G4cout << " copy no.: " << itr->first 114 << " cell flux : " << *(itr->second)*cm*cm << " [cm^-2]" 126 << " cell flux : " << *(itr->second)/GetUnitValue() 127 << " [" << GetUnit() << "]" 115 128 << G4endl; 116 129 } 117 130 } 118 131 132 void G4PSCellFlux::SetUnit(const G4String& unit) 133 { 134 CheckAndSetUnit(unit,"Per Unit Surface"); 135 } 136 137 void G4PSCellFlux::DefineUnitAndCategory(){ 138 // Per Unit Surface 139 new G4UnitDefinition("percentimeter2","percm2","Per Unit Surface",(1./cm2)); 140 new G4UnitDefinition("permillimeter2","permm2","Per Unit Surface",(1./mm2)); 141 new G4UnitDefinition("permeter2","perm2","Per Unit Surface",(1./m2)); 142 }
Note: See TracChangeset
for help on using the changeset viewer.