Message: Re: Problem to get energy deposited by G4ionIonisation process Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Problem to get energy deposited by G4ionIonisation process 

Forum: Event and Track Management
Re: Question Problem to get energy deposited by G4ionIonisation process (Gabriel Sawakuchi)
Date: 21 Dec, 2005
From: <vnivanch@mail.cern.ch>

On Mon, 14 Nov 2005, Gabriel Sawakuchi wrote:

> *** Discussion title: Event and Track Management
> Email replies to PublicHyperNews@slac.stanford.edu must include:
>   In-Reply-To: <"/eventtrackmanage/409"@geant4-hn.slac.stanford.edu>
>   Subject: ...change this to be about your reply.
> 
> Dear Users,
> 
> I am trying to get information by different processes. When I try to get
> energy deposited by the G4ionIonisation I get 0 eV.
> 
> When I run my example with /tracking/verbose 2 I can see that, in fact,
> ions are losing energy by ionIoni.
> 
> *********************************************************************************************************
> * G4Track Information:   Particle = alpha,   Track ID = 11,   Parent ID = 1
> *********************************************************************************************************
> 
> Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
>     0   -5.4 cm  -6.59 mm  -2.79 mm   8.66 MeV     0 eV      0 fm      0 fm     Absorber    initStep
>     1   -5.4 cm  -6.61 mm  -2.71 mm      0 eV   8.66 MeV  86.1 mum  86.1 mum    Absorber     ionIoni
> *********************************************************************************************************
> * G4Track Information:   Particle = deuteron,   Track ID = 10,   Parent ID = 1
> *********************************************************************************************************
> 
> Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
>     0   -5.4 cm  -6.59 mm  -2.79 mm   4.55 MeV     0 eV      0 fm      0 fm     Absorber    initStep
>     1  -5.39 cm  -6.57 mm  -2.92 mm   1.67 MeV  2.88 MeV   151 mum   151 mum    Absorber     ionIoni
>     2  -5.39 cm  -6.57 mm  -2.95 mm      0 eV   1.67 MeV  35.9 mum   187 mum    Absorber     ionIoni
> .
> .
> .
> 
> *********************************************************************************************************
> * G4Track Information:   Particle = proton,   Track ID = 8,   Parent ID = 1
> *********************************************************************************************************
> 
> Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
>     0   -5.4 cm  -6.59 mm  -2.79 mm    200 keV     0 eV      0 fm      0 fm     Absorber    initStep
>     1   -5.4 cm  -6.59 mm  -2.79 mm      0 eV    200 keV  2.57 mum  2.57 mum    Absorber       hIoni
> *********************************************************************************************************
> 
> I am doing the following:
> 
> ************* PhysList
> 
>     } else if(particleName == "alpha"      ||
>               particleName == "deuteron"   ||
>               particleName == "triton"     ||
>               particleName == "He3"        ||
>               particleName == "GenericIon" ||
>              (particleType == "nucleus" && charge != 0))
>       {
>         G4MultipleScattering* ionMultipleScattering = new G4MultipleScattering();
>         G4ionIonisation* ionIonization = new G4ionIonisation();
>         pmanager->AddProcess(ionMultipleScattering,-1, 1,1);
>         pmanager->AddProcess(ionIonization,        -1, 2,2);
>       
>       } else if (particleName == "proton"){
>        
>         G4MultipleScattering* aMultipleScattering = new G4MultipleScattering();
>         G4hIonisation* ahadronIon = new G4hIonisation();
>         pmanager->AddProcess(aMultipleScattering,-1,1,1);
>         pmanager->AddProcess(ahadronIon,-1,2,2);        
>       } else if ((!particle->IsShortLived()) &&
>                  (particle->GetPDGCharge() != 0.0) && 
>                  (particle->GetParticleName() != "chargedgeantino")) {
>         pmanager->AddProcess(new G4MultipleScattering,-1,1,1);
>         pmanager->AddProcess(new G4hIonisation,       -1,2,2);
>     }
>    }
>  }
> 
> ************* SteppingAction
> 
>  G4Track* fTrack = aStep->GetTrack();
>  if (fTrack->GetTrackID() != 1 ) {
>    if (fTrack->GetCreatorProcess()->GetProcessName() == "ionIoni") {
>      if (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "pAbsor") edep = -edep; 
>      runAction->FillionIoni(nEvent,edep);
>    }
> }

Hello,

you are looking for the Creator process, ions are not created by ionIoni. 
You need to check what is the particle defintion of the track , if it is 
ion - collect ion energy.

VI


> 
> ************* RunAction.hh
> 
>     void FillionIoni(G4int n, G4double e) 
>     {
>       ionIoniEdep += e;
>       nEvent += n;
>     }
> 
> ****** RunAction.cc
> 
>    G4double ionIoni = ionIoniEdep;
>    //   G4int n = nEvent;  
>    G4cout << "Ion ionization = "  << G4BestUnit(ionIoni,"Energy")  << G4endl;
> 
> ***************************************************
> 
> If I change "ionIoni" by "hIoni" I get a
> non zero value of energy deposited. Am I doing something wrong ? 
> 
> Thanks,
> 
> Gabriel
> 
> 

-- 
    Vladimir Ivanchenko  
    ### CERN PH SFT Tel: +41-22-76-78-871  Vladimir.Ivantchenko@cern.ch ###

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

 Add Message Add Message
to: "Re: Problem to get energy deposited by G4ionIonisation process"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]