EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Pid.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Pid.cxx
1 
10 #include "eicsmear/erhic/Pid.h"
11 
12 #include <exception>
13 #include <iostream>
14 #include <limits>
15 
16 #include <TDatabasePDG.h>
17 
18 namespace erhic {
19 
20 Pid::Pid(Int_t code)
21 : mCode(code) {
22 }
23 
25 }
26 
31 TParticlePDG* Pid::Info() const {
32  try {
33  return TDatabasePDG::Instance()->GetParticle(Code());
34  } // try
35  catch(std::exception& e) {
36  std::cerr
37  << "Caught exception in Pid::Info(): " << e.what()
38  << std::endl;
39  return NULL;
40  } // catch
41 }
42 
43 // CINT can't handle <limits> in header files so we hide it away here.
46 }
47 
48 } // namespace erhic