File indexing completed on 2024-09-28 07:02:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include "eicsmear/erhic/Pid.h"
0011
0012 #include <exception>
0013 #include <iostream>
0014 #include <limits>
0015
0016 #include <TDatabasePDG.h>
0017
0018 namespace erhic {
0019
0020 Pid::Pid(Int_t code)
0021 : mCode(code) {
0022 }
0023
0024 Pid::~Pid() {
0025 }
0026
0027
0028
0029
0030
0031 TParticlePDG* Pid::Info() const {
0032 try {
0033 return TDatabasePDG::Instance()->GetParticle(Code());
0034 }
0035 catch(std::exception& e) {
0036 std::cerr
0037 << "Caught exception in Pid::Info(): " << e.what()
0038 << std::endl;
0039 return NULL;
0040 }
0041 }
0042
0043
0044 Int_t Pid::InvalidCode() {
0045 return std::numeric_limits<Int_t>::max();
0046 }
0047
0048 }