Hi all
i’m quite new to allpix and i was running through some examples, in this case the passive volume one. As i was looking at the output i noticed that both from the ROOT and .txt files the Creation process name (in my case phot or compt) always had the same creation process ID (equal to 2).
I thought that different creation processes should have different ID numbers, like 1 for phot and 2 for compt, am i wrong here?
Bests
Luca
Hi @luca_tero
I had a look and the reason might by that processes define both a Type
and a SubType
- for whatever (probably historic) reasons. We currently read the Type
, but maybe the SubType
would be the right thing to look at.
Do you compile your Allpix Squared yourself? Then could you maybe change this line and see if that helps:
diff --git a/src/modules/DepositionGeant4/TrackInfoG4.cpp b/src/modules/DepositionGeant4/TrackInfoG4.cpp
index bffe2a410..f0248a8e4 100644
--- a/src/modules/DepositionGeant4/TrackInfoG4.cpp
+++ b/src/modules/DepositionGeant4/TrackInfoG4.cpp
@@ -20,7 +20,7 @@ TrackInfoG4::TrackInfoG4(int custom_track_id, int parent_track_id, const G4Track
initial_g4_vol_name_(aTrack->GetVolume()->GetName()), initial_kin_E_(aTrack->GetKineticEnergy()),
initial_tot_E_(aTrack->GetTotalEnergy()) {
const auto* G4Process = aTrack->GetCreatorProcess();
- origin_g4_process_type_ = (G4Process != nullptr) ? G4Process->GetProcessType() : -1;
+ origin_g4_process_type_ = (G4Process != nullptr) ? G4Process->GetProcessSubType() : -1;
start_point_ = static_cast<ROOT::Math::XYZPoint>(aTrack->GetPosition());
origin_g4_process_name_ = (G4Process != nullptr) ? static_cast<std::string>(G4Process->GetProcessName()) : "none";
}
To add to the confusion, there is also GetProcessTypeName
as well as GetProcessName

I hope this helps - let us know which combination works for you!
Best,
Simon
Hi!
Thanks for the reply and i can understand the confusion then with all these similarly named cases.
Just to be sure, do you mean i should go into the allpix-squared directory then
src/modules/DepositionGeant4/TrackInfoG4.cpp and change the line as showed there? (so no need to rebuild and install again? or should i do something else before running allpix again?).
If so i tried changing all combinations and re running after each time but nothing changed (i also tried writing lines that should give me error but no error so i guess i am missing a step before running allpix simulation after modifying the TrackInfoG4.cpp file? )
Bests
Luca
Hi @luca_tero
the edits are correct, but you do need to rebuild the software afterwards! Otherwise the same old compiled code is executed. Nothing else is required though.
Best,
Simon
I imagined, thanks!
So i tried all the cases
GetProcessType: compt ID =2, photo ID =2
GetProcessSubType: compt ID =13, photo ID =12
GetProcessTypeName: Get error in make: no matching function for call to ‘G4VProcess::GetProcessTypeName() const’
GetProcessName: Get error in make: operands to ‘?:’ have different types ‘const G4String’ and ‘int’
Therefore for now i will leave the GetProcessSubType as at least it distinguish the ID of the 2 processes, thanks for the help!
Bests
Luca
Thanks for reporting back @luca_tero - we will fix this upstream via this MR:
This will become part of the next patch release.
Best,
Simon
1 Like