ECCE @ EIC 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 using namespace std;
11 static map<int, string> trackstatus;
12 
13 string PHG4TrackStatusDecode::GetTrackStatus(const int istatus)
14 {
15  if (trackstatus.empty())
16  {
17  cout << "filling trackstatus map" << endl;
18  trackstatus[fAlive] = "fAlive";
19  trackstatus[fStopButAlive] = "fStopButAlive";
20  trackstatus[fStopAndKill] = "fStopAndKill";
21  trackstatus[fKillTrackAndSecondaries] = "fKillTrackAndSecondaries";
22  trackstatus[fSuspend] = "fSuspend";
23  trackstatus[fPostponeToNextEvent] = "fPostponeToNextEvent";
24  }
25  if (trackstatus.find(istatus) == trackstatus.end())
26  {
27  cout << "could not find status " << istatus << " in trackstatus map" << endl;
28  gSystem->Exit(1);
29  }
30  return trackstatus[istatus];
31 }