Dear Experts, I am beginner in Geant4. I have modified geant4/examples/basic/B4d input to score energy spectrum in the sensitive volume. I have used the following code for energy binning char name[16]; for (G4int i=0; iadd(“gamma”); filter->SetKineticEnergy(kmin,kmax); primitive->SetFilter(filter);

logvol->RegisterPrimitive(primitive); Now as per B4d examples, B4dEventAction.cc for hist collection I did the foloowing

 fphotonCurrentHCID=G4SDManager::GetSDpointer()->GetCollectionID("Det/current"); Then auto current=GetSum(GetHitsCollection(  fphotonCurrentHCID, event)); Now as per B4d examples,  B4dRunAction.cc for hist collection I did the foloowing analysismanager->CreateH1("current","photon current", 48, 0., 1.2*MeV); Now, how I feel that some modification is required in B4dEventAction.cc and B4dRunAction.cc to get histogram in the format of (energy-bin vs counts)?But I do not know how to do it.

Kindly give me some suggestion. Thanking you in advance.

Similar questions and discussions