Message: Problems obtaining energy deposition spectrum Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Problems obtaining energy deposition spectrum 

Keywords: Silicon Energy Deposition
Forum: Event and Track Management
Date: 11 May, 2008
From: Ashley Cullen <Ashley Cullen>

Hey all, I'm a newcomer to GEANT4. I have created a relatively basic thin silicon detector geometry in GEANT4 and I'm trying to obtain the energy deposition spectrum from 150keV monochromatic gammas from a point source.

I am using G4Step to obtain the total energy deposit per step, sum this for each step and then output the total deposit (as a rounded integer) to my RunAction class. From there, I bin the energy as a count in an array, which is eventually output to a file.

I have graphed the output for 150M runs, and the compton features are clearly discernable, but I have a gaussian feature peaking at 159keV... 9keV higher than my incident beam. Note that the start of this gaussian feature is at 150keV and has a FWHM of the order of 8 keV.

I was wondering if anyone knows why this is?

Thanks in advance to anyone able to help, Ash

==== Here is the bulk of my Sensitive Detector class: ==== SensitiveDetector::SensitiveDetector(G4String name) : G4VSensitiveDetector(name){}

SensitiveDetector::~SensitiveDetector(){;}

void SensitiveDetector::Initialize(G4HCofThisEvent* HCE){
    totaledep = 0;
}

G4bool SensitiveDetector::ProcessHits(G4Step* theStep, G4TouchableHistory*){
	const G4double edep = (theStep->GetTotalEnergyDeposit() * keV);
	if(edep > 0.){
	    totaledep += edep;
	}
  return true;
}

void SensitiveDetector::EndOfEvent(G4HCofThisEvent*)
{
	if(totaledep > 0){
		if (totaledep > 0.5)
		{
			totaledep_int = (G4int)(totaledep+0.5);
		}
		else totaledep_int = 0;
	    RunAction* myRunAction = (RunAction*)(G4RunManager::GetRunManager()->GetUserRunAction());
	    if(myRunAction)
		myRunAction->ProcessCountEvent(totaledep_int);
	}	
}

==== and the Run Action class ====
RunAction::RunAction(DetectorConstruction* DC){
	max_energy = 250;
	counts = new int[max_energy];
    myDC = DC;

	G4String Filename = "spectrum.txt";
    outfile.open(Filename);
}

RunAction::~RunAction(){
    outfile.close();
}

void RunAction::BeginOfRunAction(const G4Run* aRun){

	for (i=0; i<max_energy; i++)
	{
		counts[i] = 0;
	}

}

void RunAction::ProcessCountEvent(const G4int edeptotal){
	if (edeptotal < max_energy)
	{
		counts[edeptotal]++;
	}
}
void RunAction::EndOfRunAction(const G4Run* aRun){
    G4double NumberOfEvents = aRun->GetNumberOfEventToBeProcessed();
	for (i=0; i<max_energy; i++)
	{	
		if (counts[i]>0) (G4cout << i << " kev: " << counts[i] << " counts." << G4endl);
		outfile << i << " " << counts[i] << endl;
	}  
}

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

1 Note: Re: Problems obtaining energy deposition spectrum (fixed... kind of?)   (Ashley Cullen - 11 May, 2008)
3 Feedback: Re: Problems obtaining energy deposition spectrum   (Peter Gumplinger - 20 May, 2008)
 Add Message Add Message
to: "Problems obtaining energy deposition spectrum"

 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 ]