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

    r1337 r1340  
    2525//
    2626//
    27 // $Id: G4PSDoseDeposit.cc,v 1.2 2008/12/28 20:32:00 asaim Exp $
    28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     27// $Id: G4PSDoseDeposit.cc,v 1.5 2010/09/16 06:44:44 asaim Exp $
     28// GEANT4 tag $Name: $
    2929//
    3030// G4PSDoseDeposit
     
    4141//
    4242// Created: 2005-11-14  Tsukasa ASO, Akinori Kimura.
     43// 2010-07-22   Introduce Unit specification.
    4344//
    4445///////////////////////////////////////////////////////////////////////////////
     
    4647G4PSDoseDeposit::G4PSDoseDeposit(G4String name, G4int depth)
    4748  :G4VPrimitiveScorer(name,depth),HCID(-1)
    48 {;}
     49{
     50    SetUnit("Gy");
     51}
     52
     53G4PSDoseDeposit::G4PSDoseDeposit(G4String name, const G4String& unit,
     54                                 G4int depth)
     55  :G4VPrimitiveScorer(name,depth),HCID(-1)
     56{
     57    SetUnit(unit);
     58}
    4959
    5060G4PSDoseDeposit::~G4PSDoseDeposit()
     
    6373    G4int idx = ((G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable()))
    6474                ->GetReplicaNumber(indexDepth);
     75    if(idx<0)
     76    {
     77      G4Exception("G4PSDoseDeposit","G4PSDoseDeposit::ProcessHits",JustWarning,
     78                  "Incorrect replica number");
     79      G4cerr << " --- GetReplicaNumber : " << idx << G4endl;
     80    }
    6581    solid = physParam->ComputeSolid(idx, physVol);
    6682    solid->ComputeDimensions(physParam,idx,physVol);
     
    7187  }
    7288
    73   G4double density = aStep->GetTrack()->GetMaterial()->GetDensity();
     89  G4double density = aStep->GetTrack()->GetStep()->GetPreStepPoint()->GetMaterial()->GetDensity();
    7490  G4double dose    = edep / ( density * (solid->GetCubicVolume()) );
    7591  dose *= aStep->GetPreStepPoint()->GetWeight();
     
    106122  for(; itr != EvtMap->GetMap()->end(); itr++) {
    107123    G4cout << "  copy no.: " << itr->first
    108            << "  dose deposit: " << G4BestUnit(*(itr->second),"Dose")
     124           << "  dose deposit: "
     125           << *(itr->second)/GetUnitValue()
     126           << " ["<<GetUnit() <<"]"
    109127           << G4endl;
    110128  }
    111129}
    112130
     131void G4PSDoseDeposit::SetUnit(const G4String& unit)
     132{
     133        CheckAndSetUnit(unit,"Dose");
     134}
     135
     136
     137
Note: See TracChangeset for help on using the changeset viewer.