Geant4 Version: 11.3
Operating System:
Compiler/Version:
CMake Version:
I defined a SenstiveDetector that scores hits from optical photons. Then I want to handle separately cerenkov and scintillation photons, for example I want to save the global time of the hit in separate ntuples of they are cerenkov or optical photons.
In my EndOfEventAction() I put this:
for (int j = 0; j < totalHitsCH1; ++j) {
SiPMHit\* Hit = (\*SiPM_CH1_HitCollection)\[j\];
if (Hit->GetCreatorProcess() == “Scintillation”) {
++tot_phot_scint_CH1;
analysisManager->FillNtupleFColumn(21, Hit->GetEnergy());
analysisManager->FillNtupleFColumn(17, Hit->GetTime());
analysisManager->FillNtupleFColumn(25, Hit->GetPos().x());
analysisManager->FillNtupleFColumn(26, Hit->GetPos().y());
analysisManager->FillNtupleFColumn(27, Hit->GetPos().z());
analysisManager->AddNtupleRow();
}
else if (Hit->GetCreatorProcess() == “Cerenkov”) {
++tot_phot_cer_CH1;
analysisManager->FillNtupleFColumn(22, Hit->GetEnergy());
analysisManager->FillNtupleFColumn(18, Hit->GetTime());
analysisManager->FillNtupleFColumn(28, Hit->GetPos().x());
analysisManager->FillNtupleFColumn(29, Hit->GetPos().y());
analysisManager->FillNtupleFColumn(30, Hit->GetPos().z());
analysisManager->AddNtupleRow();
}
}
Then I if a look a the branches in output file, for example the branch containing the time of cerenkov photons I get a lot of zeros
It seems to me that the columns of cerenkov photons get filled with zeros when I fill columns for scintillation photons, is there a way to avoid this issue?
