Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/digits_hits/scorer/src/G4PSCellFlux.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4PSCellFlux.cc,v 1.2 2008/12/28 20:32:00 asaim Exp $
    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: $
    2929//
    3030// G4PSCellFlux
     
    4848//
    4949// Created: 2005-11-14  Tsukasa ASO, Akinori Kimura.
     50// 2010-07-22   Introduce Unit specification.
     51// 2010-07-22   Add weighted option
    5052//
    5153///////////////////////////////////////////////////////////////////////////////
    5254
    5355G4PSCellFlux::G4PSCellFlux(G4String name, G4int depth)
     56    :G4VPrimitiveScorer(name,depth),HCID(-1),weighted(true)
     57{
     58    DefineUnitAndCategory();
     59    SetUnit("percm2");
     60}
     61
     62G4PSCellFlux::G4PSCellFlux(G4String name, const G4String& unit, G4int depth)
    5463    :G4VPrimitiveScorer(name,depth),HCID(-1)
    55 {;}
     64{
     65    DefineUnitAndCategory();
     66    SetUnit(unit);
     67}
    5668
    5769G4PSCellFlux::~G4PSCellFlux()
     
    7991
    8092  G4double CellFlux = stepLength / (solid->GetCubicVolume());
    81   CellFlux *= aStep->GetPreStepPoint()->GetWeight();
     93  if (weighted) CellFlux *= aStep->GetPreStepPoint()->GetWeight();
    8294  G4int index = GetIndex(aStep);
    8395  EvtMap->add(index,CellFlux);
     
    112124  for(; itr != EvtMap->GetMap()->end(); itr++) {
    113125    G4cout << "  copy no.: " << itr->first
    114            << "  cell flux : " << *(itr->second)*cm*cm << " [cm^-2]"
     126           << "  cell flux : " << *(itr->second)/GetUnitValue()
     127           << " [" << GetUnit() << "]"
    115128           << G4endl;
    116129  }
    117130}
    118131
     132void G4PSCellFlux::SetUnit(const G4String& unit)
     133{
     134    CheckAndSetUnit(unit,"Per Unit Surface");
     135}
     136
     137void 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.