#include "MessageService/MsgService.h"#include "TSystem.h"#include "TEnv.h"#include "TDatabasePDG.h"#include "TParticle.h"Go to the source code of this file.
Functions | |
| CVSID ("$Id: LoadMinosPDG.cxx,v 1.2 2009/05/12 22:36:19 rhatcher Exp $") | |
| void | LoadMinosPDG (bool onlyRootVersion, bool fake) |
| Load PDG database and insert MINOS specifc particles. | |
|
||||||||||||
|
|
|
||||||||||||
|
Load PDG database and insert MINOS specifc particles. This function need only be called once but is internally protected against multiple calls Definition at line 19 of file LoadMinosPDG.cxx. References gSystem(), and MSG. Referenced by GeoSwimmer::GeoSwimmer(), MCApplication::MCApplication(), MCMerge::MCMerge(), Mint::Mint(), NtpMCDigiScintHit::NtpMCDigiScintHit(), NtpMCStdHep::NtpMCStdHep(), NtpMCTruth::NtpMCTruth(), PhotonTransport::PhotonTransport(), PTSimModule::PTSimModule(), RerootToTruthModule::RerootToTruthModule(), and ToyMCModule::ToyMCModule(). 00020 {
00021
00022 static bool first = true;
00023 if (!first) return;
00024 first = false;
00025
00026 if (fake) {
00027 MSG("DataUtil", Msg::kInfo)
00028 << "LoadMinosPDG fake: NOT initializing PDG database "
00029 << ", assume user will do so via alternative method (e.g. GENIE)"
00030 << endl;
00031 return;
00032 }
00033
00034 MSG("DataUtil", Msg::kInfo)
00035 << "LoadMinosPDG: initializing PDG database "
00036 << (onlyRootVersion ? "(root version only)" : "(minos version)" )
00037 << endl;
00038
00039 TDatabasePDG *pdg = TDatabasePDG::Instance();
00040
00041 // read default $ROOTSYS/etc/pdg_table.txt
00042 // (unless overridden by Root.DatabasePDG)
00043 // Only do it once, since it crashes the program the second time. NJT Sept 03
00044
00045 const char* minos_search_path =
00046 ".:$SRT_PRIVATE_CONTEXT/etc:$SRT_PUBLIC_CONTEXT/etc";
00047 const char* minos_file = "minos_pdg_table.txt";
00048
00049 char *minos_pdg = (onlyRootVersion) ? 0 :
00050 gSystem->Which(minos_search_path,minos_file,kReadPermission);
00051 if ( minos_pdg ) {
00052 MSG("DataUtil", Msg::kInfo)
00053 << "LoadMinosPDG: reading " << minos_pdg << endl;
00054
00055 pdg->ReadPDGTable(minos_pdg);
00056 // gSystem->Which returns a string the user must delete
00057 delete [] minos_pdg;
00058 }
00059 else {
00060 if (!onlyRootVersion)
00061 MSG("DataUtil", Msg::kInfo)
00062 << "No \"" << minos_file << "\" file found " << endl
00063 << "search path was: " << minos_search_path << endl;
00064
00065 const char* root_search_path =
00066 ".:$ROOTSYS/etc:/etc/root";
00067 const char* root_file = "pdg_table.txt";
00068
00069 char *root_pdg =
00070 gSystem->Which(root_search_path,root_file,kReadPermission);
00071 if ( root_pdg ) {
00072
00073 MSG("DataUtil", Msg::kInfo)
00074 << "LoadMinosPDG: reading " << root_pdg << endl;
00075
00076 pdg->ReadPDGTable(root_pdg);
00077 // gSystem->Which returns a string the user must delete
00078 delete [] root_pdg;
00079 }
00080 else {
00081 MSG("DataUtil", Msg::kInfo)
00082 << "No \"" << root_file << "\" file found " << endl
00083 << "search path was: " << root_search_path << endl;
00084 }
00085 }
00086 }
|
1.3.9.1