11 namespace __LoadWatchers__ {
21 using namespace __LoadWatchers__ ;
45 if (
tmp.Contains(
"g") ) {
46 gSystem->SetAclicMode(TSystem::kDebug);
55 gROOT->ProcessLine(
tmp.Data());
62 tmp = Form(
".L MyWatchers/MyTree.C+%s",
CompOpt);
63 gROOT->ProcessLine(
tmp.Data());
73 printf(
"******************************************************************** \n") ;
74 printf(
" Messages from LoadWatchers.C \n") ;
75 printf(
"******************************************************************** \n") ;
81 if ( macroPATH.Contains(tmp.Data()) ==
false ) {
82 printf(
"- Add %s to the macros path \n",tmp.Data());
84 macroPATH.Prepend(tmp.Data()); gROOT->SetMacroPath(macroPATH.Data());
89 tmp.Prepend(
" .include ");
90 gROOT->ProcessLine(tmp.Data());
93 gSystem->Load(
"libGWCORE.so");
94 gSystem->Load(
"libGWADF.so");
95 gSystem->Load(
"libGWADFE.so");
96 gSystem->Load(
"libGWTOOLS.so");
98 if (
AGAPRO.Contains(
"/") ) {
100 AGAPRO.Append(
"/include");
printf(
"- Add path to AGAPRO includes [%s] to the include path \n",
AGAPRO.Data());
101 AGAPRO.Prepend(
" .include ");
102 gROOT->ProcessLine(
AGAPRO.Data());
104 gSystem->Load(
"libAgaProCommon.so");
105 gSystem->Load(
"libCrystalProducer.so");
106 gSystem->Load(
"libPreprocessingFilter.so");
107 gSystem->Load(
"libTrackingFilter.so");
112 tmp =
"./MyWatchers" ;
printf(
"- Add %s to the include path \n",tmp.Data());
113 tmp.Prepend(
" .include ");
114 gROOT->ProcessLine(tmp.Data());
115 tmp =
"./DefaultWatchers" ;
printf(
"- Add %s to the include path \n",tmp.Data());
116 tmp.Prepend(
" .include ");
117 gROOT->ProcessLine(tmp.Data());
120 if ( gSystem->AccessPathName(
"./SetupWatchers.C") ) {
121 cout <<
"- Standard configuration (Default setup, SetupWatchers.C) installed " <<
endl;
123 gSystem->CopyFile(
"Macros/SetupWatchers.C",
"./SetupWatchers.C");
126 TString isprisma = gSystem->Getenv(
"PRISMA_PREPROC"), isprespec = gSystem->Getenv(
"PRESPEC"), isgo4 = gSystem->Getenv(
"GOSYS");
127 std::ofstream fdefs(
"WatchersConfig.h",ios::out | ios::trunc);
128 if ( fdefs.is_open() ) {
129 fdefs <<
"// enable / disable prisma " <<
std::endl;
130 if ( isprisma ==
"" ) {
133 fdefs <<
"#define HAS_PRISMA " <<
std::endl;
135 fdefs <<
"// enable / disable prespec " <<
std::endl;
136 if ( isprespec ==
"" ) {
139 fdefs <<
"#define HAS_PRESPEC " <<
std::endl;
141 fdefs <<
"// enable / disable go4 " <<
std::endl;
145 fdefs <<
"#define HAS_GO4 " <<
std::endl;
147 if (
AGAPRO.Contains(
"/") ) {
148 fdefs <<
"#define HAS_AGAPROCONFIG " <<
std::endl;
152 if ( gSystem->AccessPathName(
"./OnlineWatchersLLP.C") ) {
153 cout <<
"- Customisable default OnlineWatchersLLP.C installed " <<
endl;
154 gSystem->CopyFile(
"Macros/OnlineWatchersLLP.C",
"./OnlineWatchersLLP.C");
157 if ( gSystem->AccessPathName(
"./OnlineWatchersGLP.C") ) {
158 cout <<
"- Customisable default OnlineWatchersGLP.C installed " <<
endl;
159 gSystem->CopyFile(
"Macros/OnlineWatchersGLP.C",
"./OnlineWatchersGLP.C");
162 if ( gSystem->AccessPathName(
"./OfflineWatchers.C") ) {
163 cout <<
"- Customisable default OfflineWatchers.C installed" <<
endl;
164 gSystem->CopyFile(
"Macros/OfflineWatchers.C",
"./OfflineWatchers.C");
168 if ( gSystem->AccessPathName(
"MyWatchers") ) {
169 cout <<
"- Add personnal customisable watchers " <<
endl;
170 gSystem->mkdir(
"./MyWatchers");
171 gSystem->CopyFile(
"Macros/MyTree.h",
"MyWatchers/MyTree.h");
172 gSystem->CopyFile(
"Macros/MyTree.C",
"MyWatchers/MyTree.C");
180 cout <<
" To start online (Local Level) Watchers : " <<
endl;
181 cout <<
" .L OnlineWatchersLLP.C+ " <<
endl;
182 cout <<
" - to watch only one selected actor " <<
endl;
183 cout <<
" OnlineWatchersLLP() or OnlineWatchersLLP(new TFile(\"MySpectra.root\",\"UPDATE\"),new TFile(\"MyTagSpectra.root\",\"UPDATE\"))" <<
endl;
184 cout <<
" - to watch simultaneously all the actors " <<
endl;
185 cout <<
" OnlineWatchersLLP(0x0,0x0,true) or OnlineWatchersLLP(new TFile(\"MySpectra.root\",\"UPDATE\"),new TFile(\"MyTagSpectra.root\",\"UPDATE\"),true)" <<
endl;
186 cout <<
" To start online (Global Level) Watchers : " <<
endl;
187 cout <<
" .L OnlineWatchersGLP.C+ " <<
endl;
188 cout <<
" OnlineWatchersGLP() or OnlineWatchersGLP(new TFile(\"MySpectra.root\",\"UPDATE\"),new TFile(\"MyTagSpectra.root\",\"UPDATE\"))" <<
endl;
189 cout <<
" Then start the watching from the ROOT Browser " << endl <<
endl;
190 cout <<
" To start offline Watchers : " <<
endl;
191 cout <<
" 1 - Configure OfflineWatcher.C (it could be a copy of of the one in DefaultWatchers)" <<
endl;
192 cout <<
" 2 - Compile/Run the Watchers with : " <<
endl;
193 cout <<
" .L OfflineWatchers.C+" <<
endl;
194 cout <<
" OfflineWatchers() or OfflineWatchers(new TFile(\"MySpectra.root\",\"UPDATE\"))" <<
endl;
198 TString adf_path = gSystem->Getenv(
"ADF_CONF_PATH");
199 if ( adf_path ==
"" ) {
200 if ( ! gSystem->AccessPathName(
"./ADF.conf") ) {
202 TString pwd_path = gSystem->Getenv(
"PWD");
204 gSystem->Setenv(
"ADF_CONF_PATH",pwd_path.Data());
206 printf(
"\n [Info] ADF_CONF_PATH has been set to %s \n\n ",pwd_path.Data());
209 cout <<
"\n ** [WARNING] ** , ADF_CONF_PATH not set ! " << endl <<
endl;
211 else printf(
"\n [Info] ADF_CONF_PATH is %s \n\n ",adf_path.Data());
214 TBrowser *
b =
new TBrowser();
220 tmp = Form(
".L DefaultWatchers/ADFWatchers.C+%s",
CompOpt);
221 gROOT->ProcessLine(
tmp.Data());
222 tmp = Form(
".L DefaultWatchers/WatcherClient.C+%s",
CompOpt);
223 gROOT->ProcessLine(
tmp.Data());
224 tmp = Form(
".L DefaultWatchers/MetaWatchers.C+%s",
CompOpt);
225 gROOT->ProcessLine(
tmp.Data());
226 tmp = Form(
".L DefaultWatchers/TrackedWatchers.C+%s",
CompOpt);
227 gROOT->ProcessLine(
tmp.Data());
228 tmp = Form(
".L DefaultWatchers/EventPSAWatchers.C+%s",
CompOpt);
229 gROOT->ProcessLine(
tmp.Data());
230 tmp = Form(
".L DefaultWatchers/PSAWatchers.C+%s",
CompOpt);
231 gROOT->ProcessLine(
tmp.Data());
232 tmp = Form(
".L DefaultWatchers/CrystalWatchers.C+%s",
CompOpt);
233 gROOT->ProcessLine(
tmp.Data());
234 tmp = Form(
".L DefaultWatchers/RancLegnaroWatchers.C+%s",
CompOpt);
235 gROOT->ProcessLine(
tmp.Data());
236 tmp = Form(
".L DefaultWatchers/EventWatchers.C+%s",
CompOpt);
237 gROOT->ProcessLine(
tmp.Data());
238 tmp = Form(
".L DefaultWatchers/DanteWatchers.C+%s",
CompOpt);
239 gROOT->ProcessLine(
tmp.Data());
240 tmp = Form(
".L DefaultWatchers/LLaBr3Watchers.C+%s",
CompOpt);
241 gROOT->ProcessLine(
tmp.Data());
248 TString prisma = gSystem->Getenv(
"PRISMA_PREPROC");
249 if ( prisma ==
"" ) {
254 tmp = prisma +
"/src/lib_prisma/include/";
printf(
"- Add %s to the include path \n",
tmp.Data());
255 tmp.Prepend(
" .include ");
256 gROOT->ProcessLine(
tmp.Data());
259 gSystem->Load( Form(
"%s/lib/libPRISMA.so",prisma.Data()) );
262 if ( gSystem->AccessPathName(
"MyWatchers/PrismaWatchers.h") )
263 gSystem->CopyFile(
"Macros/PrismaWatchers.h",
"MyWatchers/PrismaWatchers.h");
264 if ( gSystem->AccessPathName(
"MyWatchers/PrismaWatchers.C") )
265 gSystem->CopyFile(
"Macros/PrismaWatchers.C",
"MyWatchers/PrismaWatchers.C");
267 tmp = Form(
".L MyWatchers/PrismaWatchers.C+%s",
CompOpt);
268 gROOT->ProcessLine(
tmp.Data());
275 TString prespec = gSystem->Getenv(
"PRESPEC"), go4 = gSystem->Getenv(
"GOSYS"), path_to_libs;
276 if ( prespec ==
"" ) {
278 if (
AGAPRO.Contains(
"/") ) {
286 if (
tmp.Contains(
"g") ) {
287 path_to_libs = Form(
"%s/debug/lib/",prespec.Data());
290 path_to_libs = Form(
"%s/release/lib/",prespec.Data());
295 if ( gSystem->AccessPathName(
"MyWatchers/GSIWatchers.h") )
296 gSystem->CopyFile(
"Macros/GSIWatchers.h",
"MyWatchers/GSIWatchers.h");
297 if ( gSystem->AccessPathName(
"MyWatchers/GSIWatchers.C") )
298 gSystem->CopyFile(
"Macros/GSIWatchers.C",
"MyWatchers/GSIWatchers.C");
300 if ( gSystem->AccessPathName(
"MyWatchers/GSIPrespecWatchers.h") )
301 gSystem->CopyFile(
"Macros/GSIPrespecWatchers.h",
"MyWatchers/GSIPrespecWatchers.h");
302 if ( gSystem->AccessPathName(
"MyWatchers/GSIPrespecWatchers.C") )
303 gSystem->CopyFile(
"Macros/GSIPrespecWatchers.C",
"MyWatchers/GSIPrespecWatchers.C");
305 if ( gSystem->AccessPathName(
"MyWatchers/GSIGO4Watchers.h") )
306 gSystem->CopyFile(
"Macros/GSIGO4Watchers.h",
"MyWatchers/GSIGO4Watchers.h");
307 if ( gSystem->AccessPathName(
"MyWatchers/GSIGO4Watchers.C") )
308 gSystem->CopyFile(
"Macros/GSIGO4Watchers.C",
"MyWatchers/GSIGO4Watchers.C");
311 tmp = Form(
"-I%s",prespec.Data());
312 gSystem->AddIncludePath(
tmp.Data());
313 tmp = Form(
"-I%s/eventapiV50",prespec.Data());
314 gSystem->AddIncludePath(
tmp.Data());
316 tmp = Form(
"%s/libgsievt.so",path_to_libs.Data());
317 gSystem->Load(
tmp.Data()) ;
318 tmp = Form(
"%s/lib_prespec.so",path_to_libs.Data());
319 gSystem->Load(
tmp.Data()) ;
322 tmp = Form(
".L MyWatchers/GSIWatchers.C+%s",
CompOpt);
323 gROOT->ProcessLine(
tmp.Data());
326 tmp = Form(
".L MyWatchers/GSIPrespecWatchers.C+%s",
CompOpt);
327 gROOT->ProcessLine(
tmp.Data());
330 std::cout <<
"GO4 Watchers not yet defined ! " <<
std::endl;
printf("******************************************************************** \n")
void LoadWatchers_GSI()
Load watchers for ancillaries @ GSI.
ADF::LogMessage & endl(ADF::LogMessage &log)
void LoadWatchers_Legnaro()
Load watchers for ancillaries @ Legnaro i.e. Prisma LIB.
void LoadWatchers_AGATA()
void LoadWatchers(const Char_t *path_to_agapro="")
static const char * GetPath(const char *)
to get a particular GW environment variable