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/G4PSPassageCellFlux.cc

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4PSPassageCellFlux.cc,v 1.2 2008/12/28 20:32:00 asaim Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4PSPassageCellFlux.cc,v 1.4 2010/07/22 23:42:01 taso Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030// G4PSPassageCellFlux
     
    4747//
    4848// Created: 2005-11-14  Tsukasa ASO, Akinori Kimura.
     49// 2010-07-22   Introduce Unit specification.
     50// 2010-07-22   Add weighted option
    4951//
    5052///////////////////////////////////////////////////////////////////////////////
    5153
    5254G4PSPassageCellFlux::G4PSPassageCellFlux(G4String name, G4int depth)
     55    :G4VPrimitiveScorer(name,depth),HCID(-1),fCurrentTrkID(-1),fCellFlux(0),
     56     weighted(true)
     57{
     58    DefineUnitAndCategory();
     59    SetUnit("percm2");
     60}
     61
     62G4PSPassageCellFlux::G4PSPassageCellFlux(G4String name, const G4String& unit,
     63                                         G4int depth)
    5364  :G4VPrimitiveScorer(name,depth),HCID(-1),fCurrentTrkID(-1),fCellFlux(0)
    54 {;}
     65{
     66    DefineUnitAndCategory();
     67    SetUnit(unit);
     68}
    5569
    5670G4PSPassageCellFlux::~G4PSPassageCellFlux()
     
    92106  G4int  trkid  = aStep->GetTrack()->GetTrackID();
    93107  G4double trklength  = aStep->GetStepLength();
    94   trklength *= aStep->GetPreStepPoint()->GetWeight();
     108  if ( weighted ) trklength *= aStep->GetPreStepPoint()->GetWeight();
    95109
    96110  if ( IsEnter &&IsExit ){         // Passed at one step
     
    143157  for(; itr != EvtMap->GetMap()->end(); itr++) {
    144158    G4cout << "  copy no.: " << itr->first
    145            << "  cell flux : " << *(itr->second)*cm*cm << " [cm^-2]"
     159           << "  cell flux : " << *(itr->second)/GetUnitValue()
     160           << " [" << GetUnit()
    146161           << G4endl;
    147162  }
    148163}
    149164
     165void G4PSPassageCellFlux::SetUnit(const G4String& unit)
     166{
     167    CheckAndSetUnit(unit,"Per Unit Surface");
     168}
     169
     170void G4PSPassageCellFlux::DefineUnitAndCategory(){
     171   // Per Unit Surface
     172   new G4UnitDefinition("percentimeter2","percm2","Per Unit Surface",(1./cm2));
     173   new G4UnitDefinition("permillimeter2","permm2","Per Unit Surface",(1./mm2));
     174   new G4UnitDefinition("permeter2","perm2","Per Unit Surface",(1./m2));
     175}
     176
     177
Note: See TracChangeset for help on using the changeset viewer.