Thank you @anna
To store the sum of energy
-
In B1SteppingAction.cc
a. I wroteif (volume == fScoringVolume) {
G4double edepStep = step->GetTotalEnergyDeposit();
fEventAction->AddEdep(edepStep);
return (edepStep);
}
if (volume == fScoringVolume2) {
G4double edepStep2 = step->GetTotalEnergyDeposit();
fEventAction->AddEdep2(edepStep2);
return (edepStep2);
}
if (volume == fScoringVolume || volume == fScoringVolume2) {
G4double edepStep2tartot = edepStep+edepStep2;
fEventAction->AddEdeptot(edepStep2tartot);
}
B1SteppingAction.cc (6.8 KB)
- In B1EventAction.cc
a. I addedfEdep2TarSum = 0.;
b. I addedfRunAction->AddEdeptot(fEdep);
c. I addedanalysisManager->FillNtupleDColumn(2,0, fEdep2TarSum);
analysisManager->AddNtupleRow(2);
B1EventAction.cc (4.3 KB)
- In B1RunAction.cc
a. I added
analysisManager->CreateNtuple("B1VolumeTot", "Volume Tot");
analysisManager->CreateNtupleDColumn("OutputEnergyTot");
analysisManager->FinishNtuple();
b. I added
void B1RunAction::AddEdeptot(G4double edep)
{
fEdep += edep;
}
B1RunAction.cc (8.8 KB)
- In B1EventAction.hh
a. I added voidvoid AddEdeptot(G4double edep) { fEdep2TarSum += edep; }
b. I addedG4double fEdep2TarSum;
B1EventAction.hh (3.0 KB)
- In B1RunAction.hh
a. I addedvoid AddEdeptot (G4double edep);
B1RunAction.hh (2.9 KB)
But compiling I get these errors
I understand they are due to
return (edepStep);
and return (edepStep2);
…
To watch what is happening
In my macro file I had the /tracking/verbose 1 line yet…what should I do to see what is happening?
run1.mac.txt (559 Bytes)