Hello everyone,
I want to save the spectrum of deposited energy in a detector.
I was able to create a histogram with a constant step size and I would like to know if it is possible to use a histogram in which energy values are specified for each bin. So as to obtain the spectrum based on a energy calibration of the detector (with energy bins unequally spaced).
These are the lines of code I use.
RunAction.cc
//
analysisManager->CreateH1(“1”,“Energy deposited”,1000,0.,2.500);
SteppingAction.cc
//
G4double EdepStep = aStep->GetTotalEnergyDeposit();
if (EdepStep > 0.) fEventAction->AddEdep(EdepStep);
EventAction.cc
//
analysisManager->FillH1(1, fTotalEnergyDeposit/MeV);
In Analysis.hh I included g4csv.hh to save the histogram in a csv file.
I am using geant4-10-06-patch-02.