2 namespace _LoadStogsToADF_ {
12 using namespace _LoadStogsToADF_ ;
32 sprintf(
DefaultW,
" \033[1;34m [*] "); sprintf(
MyW,
" \033[1;32m [+] "); sprintf(
WarningW,
" \033[1;31m [!] "); sprintf(
AncW,
" \033[1;35m [+] "); sprintf(
EndColor,
"\033[0m");
34 printf(
"******************************************************************** \n") ;
35 printf(
" Messages from LoadStogsToADF.C \n") ;
36 printf(
"******************************************************************** \n") ;
40 gSystem->Load(
"libADF.so");
41 gSystem->Load(
"libTrackingFilter.so");
48 LoadClass(
"../analysis/SToGS_BaseROOTEvents.C");
54 cout <<
endl <<
"|INFO| ... informations ... messages ... help ... for Online/Quasi Online Analysis |" <<
endl;
55 cout <<
"|INFO|" <<
endl;
56 cout <<
"|INFO|\tTo start StogsToADF : " <<
endl;
57 cout <<
"|INFO|\t\t- Compile/Run StogsToADF with : " <<
endl;
58 cout <<
"|INFO|\t\t.L StogsToADF.C+" <<
endl;
59 cout <<
"|INFO|StogsToADF()" <<
endl;
60 cout <<
"|INFO|" <<
endl;
64 CheckConf(
"CrystalPositionLookUpTable.dat");
70 if(!gSystem->IsFileInIncludePath(cpp_path))
72 cout<<cpp_path<<
" not found, class not loaded."<<
endl;
77 TString CompileLine =
".L " + cpp_path + Form(
"+%s",
CompOpt.Data());
78 gROOT->ProcessLine(CompileLine.Data());
85 tmp = what_directory;
printf(
"{Conf} Add %s to the include path \n",
tmp.Data());
86 tmp.Prepend(
" .include ");
87 gROOT->ProcessLine(
tmp.Data());
92 if ( what_conf ==
"ADF.conf" ) {
94 TString adf_path = gSystem->Getenv(
"ADF_CONF_PATH");
96 if ( adf_path ==
"" ) {
99 if ( !gSystem->AccessPathName(
"./ADF.conf") ) {
104 TString tmp_dir = gSystem->TempDirectory();
105 std::cout <<
WarningW <<
"Cannot find ADF.conf ... try and install a default one from internet, make sure it fullfils your needs " <<
EndColor <<
std::endl;
106 gSystem->Exec(Form(
"svn --quiet checkout svn+ssh://anonsvn@anonsvn.in2p3.fr/agata/conf/watchers/ %s",tmp_dir.Data()));
107 if ( gSystem->CopyFile(Form(
"%s/ADF.conf",tmp_dir.Data()),
"./ADF.conf") == 0 )
111 adf_path = gSystem->Getenv(
"PWD");
115 if ( adf_path ==
"" ) {
119 gSystem->Setenv(
"ADF_CONF_PATH",adf_path.Data());
120 printf(
"\n\t{Conf}\tADF_CONF_PATH has been set to %s \n\n",adf_path.Data());
123 if ( what_conf ==
"CrystalPositionLookUpTable.dat" ) {
126 if ( !gSystem->AccessPathName(
"./CrystalPositionLookUpTable.dat") ) {
129 gSystem->Exec(
"ln -s Tools/CrystalLookUpTableIdentity.dat CrystalPositionLookUpTable.dat");
130 gSystem->Exec(
"ln -s Tools/CrystalLookUpTableIdentity.dat CrystalPositionLookUpTable");
132 std::cout<<
"CrystalPositionLookUpTable.dat not found, an Identity lookup table has been linked to avoid tracking problems"<<
std::endl;
133 gSystem->Exec(
"ls -l CrystalPositionLookUpTable*");
150 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 AddInclude(TString what_directory)
void CleanDir(TString Dir)
clean up all created watchers
void LoadClass(TString cpp_path)
a usefull facility to compile/load a given Watcher
void CheckConf(TString what_conf)
ADF::LogMessage & endl(ADF::LogMessage &log)
void Clean()
clean up all created watchers