Message: Energy_Deposition_Layer3 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Energy_Deposition_Layer3 

Forum: Event and Track Management
Date: 06 May, 2014
From: Ibrahim <Ibrahim>

Dear Geant4 users,

My detector consists of many layers. I would like to calculate the energy deposition of the incoming particles in a given layer (let say layer 3). In My I did the following:

void MySteppingAction::UserSteppingAction(const G4Step* aStep) {

// collect energy deposited in this step

G4double EdepStep = aStep->GetTotalEnergyDeposit();

G4TouchableHistory* theTouchable
    = (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());

//Collect only the energy deposition in the Layer2

if (EdepStep > 0.)
      G4VPhysicalVolume* physVol = theTouchable->GetVolume();

      if(strcmp(physVol->GetName(),"PhyLayer3")== 0)

    { eventAction->addEdep(EdepStep);}

Is it correct? Or should I use Layer3 as a sensitive detector? Thank you very much in advance.

Best regards


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

1 Feedback: Re: Energy_Deposition_Layer3   (Gumplinger Peter - 06 May, 2014)
 Add Message Add Message
to: "Energy_Deposition_Layer3"

 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 ]