Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4TrackStatusDecode.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4TrackStatusDecode.cc
2 
3 #include <Geant4/G4TrackStatus.hh>
4 
5 #include <TSystem.h>
6 
7 #include <iostream>
8 #include <map>
9 
10 static std::map<int, std::string> trackstatus;
11 
13 {
14  if (trackstatus.empty())
15  {
16  std::cout << "filling trackstatus map" << std::endl;
17  trackstatus[fAlive] = "fAlive";
18  trackstatus[fStopButAlive] = "fStopButAlive";
19  trackstatus[fStopAndKill] = "fStopAndKill";
20  trackstatus[fKillTrackAndSecondaries] = "fKillTrackAndSecondaries";
21  trackstatus[fSuspend] = "fSuspend";
22  trackstatus[fPostponeToNextEvent] = "fPostponeToNextEvent";
23  }
24  if (trackstatus.find(istatus) == trackstatus.end())
25  {
26  std::cout << "could not find status " << istatus << " in trackstatus map" << std::endl;
27  gSystem->Exit(1);
28  }
29  return trackstatus[istatus];
30 }