Catch case of ions and cherenkov photons not present in the standard...
Catch case of ions and cherenkov photons not present in the standard TDatabasePDG in CbmMCTrack::GetMass() and GetCharge(). Refs #1806 @1.5h
In the previous implementation of CbmMCTrack, the methods GetMass() and GetCharge() both returned the value 0 when a PDG code attributed to a CbmMCTrack object was not found in the TDatabasePDG, without throwing any error nor warning. Since both are physicswise meaningful return values, this is not considered a good procedure.
The case of a PDG code not known to TDatabasePDG occurs in our simulations for ions and for Cherenkov photons. Ions are added to the TVirtualMC during transport (e.g., by CbmShieldGenerator or FairIonGenerator), which also modifies then the TDatabasePDG instance, however, only transiently, such that the information is lost after the run. Cherenkov photons, with PDG 50000050, are produced by TGeant4.
The situation was coped with by checking the particular PDG code for ions (10LZZZAAAI, with ZZZ being the charge number and AAA the mass number) or 50000050 for Cherenkov photons. For ions, GetCharge() now returns ZZZ, GetMass() returns AAA time the proton mass. For Cherenkov photons, bothg methods return 0.
If still a different PDG code not in TDatabasePDG is found, a fatal error is thrown.