15 using namespace _LoadPFC_ ;
26 sprintf(
DefaultW,
" \033[1;34m [*] "); sprintf(
MyW,
" \033[1;32m [+] "); sprintf(
WarningW,
" \033[1;31m [!] "); sprintf(
EndColor,
"\033[0m");
28 printf(
"******************************************************************** \n") ;
29 printf(
" Messages from LoadPFC.C \n") ;
30 printf(
"******************************************************************** \n") ;
32 TString AGAPRO_ENV = gSystem->Getenv(
"AGAPRO_INC");
42 gSystem->Load(
"libADF.so");
43 gSystem->Load(
"libTrackingFilter.so");
45 LoadClass(
"../stogs/analysis/BashColor.cpp");
52 CheckConf(
"CrystalPositionLookUpTable.dat");
58 if(!gSystem->IsFileInIncludePath(cpp_path))
60 cout<<cpp_path<<
" not found, class not loaded."<<
endl;
65 TString CompileLine =
".L " + cpp_path + Form(
"+%s",
CompOpt.Data());
66 gROOT->ProcessLine(CompileLine.Data());
73 tmp = what_directory;
printf(
"{Conf} Add %s to the include path \n",
tmp.Data());
74 tmp.Prepend(
" .include ");
75 gROOT->ProcessLine(
tmp.Data());
80 if ( what_conf ==
"ADF.conf" ) {
82 TString adf_path = gSystem->Getenv(
"ADF_CONF_PATH");
84 if ( adf_path ==
"" ) {
87 if ( !gSystem->AccessPathName(
"./ADF.conf") ) {
92 TString tmp_dir = gSystem->TempDirectory();
93 std::cout <<
WarningW <<
"Cannot find ADF.conf ... try and install a default one from internet, make sure it fullfils your needs " <<
EndColor <<
std::endl;
94 gSystem->Exec(Form(
"svn --quiet checkout svn+ssh://anonsvn@anonsvn.in2p3.fr/agata/conf/watchers/ %s",tmp_dir.Data()));
95 if ( gSystem->CopyFile(Form(
"%s/ADF.conf",tmp_dir.Data()),
"./ADF.conf") == 0 )
99 adf_path = gSystem->Getenv(
"PWD");
103 if ( adf_path ==
"" ) {
107 gSystem->Setenv(
"ADF_CONF_PATH",adf_path.Data());
108 printf(
"\n\t{Conf}\tADF_CONF_PATH has been set to %s \n\n",adf_path.Data());
111 if ( what_conf ==
"CrystalPositionLookUpTable.dat" ) {
114 if ( !gSystem->AccessPathName(
"./CrystalPositionLookUpTable.dat") ) {
117 gSystem->Exec(
"ln -s Tools/CrystalLookUpTableIdentity.dat CrystalPositionLookUpTable.dat");
118 gSystem->Exec(
"ln -s Tools/CrystalLookUpTableIdentity.dat CrystalPositionLookUpTable");
120 std::cout<<
"CrystalPositionLookUpTable.dat not found, an Identity lookup table has been linked to avoid tracking problems"<<
std::endl;
121 gSystem->Exec(
"ls -l CrystalPositionLookUpTable*");
136 gSystem->Exec(Form(
"rm -rf %s/*_C.so %s/*_C.d %s/*.o %s/*_cpp.so %s/*_cpp.d %s/*.pcm", Dir.Data(),Dir.Data(),Dir.Data(),Dir.Data(),Dir.Data(),Dir.Data() ));
printf("******************************************************************** \n")
void LoadClass(TString cpp_path)
a usefull facility to compile/load a given Watcher
void Clean()
clean up all created watchers
void CleanDir(TString Dir)
clean up all created watchers
void AddInclude(TString what_directory)
ADF::LogMessage & endl(ADF::LogMessage &log)
void CheckConf(TString what_conf)