11 namespace __LoadWatchers__ {
21 using namespace __LoadWatchers__ ;
45 if (
tmp.Contains(
"g") ) {
46 gSystem->SetAclicMode(TSystem::kDebug);
54 gROOT->ProcessLine(
".include Macros");
55 tmp = Form(
".L Macros/EmulatorControl.C+%s",
CompOpt);
56 gROOT->ProcessLine(
tmp.Data());
63 tmp = Form(
".L MyWatchers/MyTree.C+%s",
CompOpt);
64 gROOT->ProcessLine(
tmp.Data());
74 printf(
"******************************************************************** \n") ;
75 printf(
" Messages from LoadWatchers.C \n") ;
76 printf(
"******************************************************************** \n") ;
82 if ( macroPATH.Contains(tmp.Data()) ==
false ) {
83 printf(
"- Add %s to the macros path \n",tmp.Data());
85 macroPATH.Prepend(tmp.Data()); gROOT->SetMacroPath(macroPATH.Data());
90 tmp.Prepend(
" .include ");
91 gROOT->ProcessLine(tmp.Data());
94 gSystem->Load(
"libGWCORE.so");
95 gSystem->Load(
"libGWADF.so");
96 gSystem->Load(
"libGWADFE.so");
97 gSystem->Load(
"libGWTOOLS.so");
99 if (
AGAPRO.Contains(
"/") ) {
101 AGAPRO.Append(
"/include");
printf(
"- Add path to AGAPRO includes [%s] to the include path \n",
AGAPRO.Data());
102 AGAPRO.Prepend(
" .include ");
103 gROOT->ProcessLine(
AGAPRO.Data());
105 gSystem->Load(
"libAgaProCommon.so");
106 gSystem->Load(
"libCrystalProducer.so");
107 gSystem->Load(
"libPreprocessingFilter.so");
108 gSystem->Load(
"libTrackingFilter.so");
113 tmp =
"./MyWatchers" ;
printf(
"- Add %s to the include path \n",tmp.Data());
114 tmp.Prepend(
" .include ");
115 gROOT->ProcessLine(tmp.Data());
116 tmp =
"./DefaultWatchers" ;
printf(
"- Add %s to the include path \n",tmp.Data());
117 tmp.Prepend(
" .include ");
118 gROOT->ProcessLine(tmp.Data());
121 if ( gSystem->AccessPathName(
"./SetupWatchers.C") ) {
122 cout <<
"- Standard configuration (Default setup, SetupWatchers.C) installed " <<
endl;
124 gSystem->CopyFile(
"Macros/SetupWatchers.C",
"./SetupWatchers.C");
127 TString isprisma = gSystem->Getenv(
"PRISMA_PREPROC"), isprespec = gSystem->Getenv(
"PRESPEC"), isgo4 = gSystem->Getenv(
"GOSYS");
128 std::ofstream fdefs(
"WatchersConfig.h",ios::out | ios::trunc);
129 if ( fdefs.is_open() ) {
130 fdefs <<
"// enable / disable prisma " <<
std::endl;
131 if ( isprisma ==
"" ) {
134 fdefs <<
"#define HAS_PRISMA " <<
std::endl;
136 fdefs <<
"// enable / disable prespec " <<
std::endl;
137 if ( isprespec ==
"" ) {
140 fdefs <<
"#define HAS_PRESPEC " <<
std::endl;
142 fdefs <<
"// enable / disable go4 " <<
std::endl;
146 fdefs <<
"#define HAS_GO4 " <<
std::endl;
148 if (
AGAPRO.Contains(
"/") ) {
149 fdefs <<
"#define HAS_AGAPROCONFIG " <<
std::endl;
153 if ( gSystem->AccessPathName(
"./OnlineWatchersLLP.C") ) {
154 cout <<
"- Customisable default OnlineWatchersLLP.C installed " <<
endl;
155 gSystem->CopyFile(
"Macros/OnlineWatchersLLP.C",
"./OnlineWatchersLLP.C");
158 if ( gSystem->AccessPathName(
"./OnlineWatchersGLP.C") ) {
159 cout <<
"- Customisable default OnlineWatchersGLP.C installed " <<
endl;
160 gSystem->CopyFile(
"Macros/OnlineWatchersGLP.C",
"./OnlineWatchersGLP.C");
163 if ( gSystem->AccessPathName(
"./OfflineWatchers.C") ) {
164 cout <<
"- Customisable default OfflineWatchers.C installed" <<
endl;
165 gSystem->CopyFile(
"Macros/OfflineWatchers.C",
"./OfflineWatchers.C");
169 if ( gSystem->AccessPathName(
"MyWatchers") ) {
170 cout <<
"- Add personnal customisable watchers " <<
endl;
171 gSystem->mkdir(
"./MyWatchers");
172 gSystem->CopyFile(
"Macros/MyTree.h",
"MyWatchers/MyTree.h");
173 gSystem->CopyFile(
"Macros/MyTree.C",
"MyWatchers/MyTree.C");
181 cout <<
" To start online (Local Level) Watchers : " <<
endl;
182 cout <<
" .L OnlineWatchersLLP.C+ " <<
endl;
183 cout <<
" - to watch only one selected actor " <<
endl;
184 cout <<
" OnlineWatchersLLP() or OnlineWatchersLLP(new TFile(\"MySpectra.root\",\"UPDATE\"),new TFile(\"MyTagSpectra.root\",\"UPDATE\"))" <<
endl;
185 cout <<
" - to watch simultaneously all the actors " <<
endl;
186 cout <<
" OnlineWatchersLLP(0x0,0x0,true) or OnlineWatchersLLP(new TFile(\"MySpectra.root\",\"UPDATE\"),new TFile(\"MyTagSpectra.root\",\"UPDATE\"),true)" <<
endl;
187 cout <<
" To start online (Global Level) Watchers : " <<
endl;
188 cout <<
" .L OnlineWatchersGLP.C+ " <<
endl;
189 cout <<
" OnlineWatchersGLP() or OnlineWatchersGLP(new TFile(\"MySpectra.root\",\"UPDATE\"),new TFile(\"MyTagSpectra.root\",\"UPDATE\"))" <<
endl;
190 cout <<
" Then start the watching from the ROOT Browser " << endl <<
endl;
191 cout <<
" To start offline Watchers : " <<
endl;
192 cout <<
" 1 - Configure OfflineWatcher.C (it could be a copy of of the one in DefaultWatchers)" <<
endl;
193 cout <<
" 2 - Compile/Run the Watchers with : " <<
endl;
194 cout <<
" .L OfflineWatchers.C+" <<
endl;
195 cout <<
" OfflineWatchers() or OfflineWatchers(new TFile(\"MySpectra.root\",\"UPDATE\"))" <<
endl;
199 TString adf_path = gSystem->Getenv(
"ADF_CONF_PATH");
200 if ( adf_path ==
"" ) {
201 if ( ! gSystem->AccessPathName(
"./ADF.conf") ) {
203 TString pwd_path = gSystem->Getenv(
"PWD");
205 gSystem->Setenv(
"ADF_CONF_PATH",pwd_path.Data());
207 printf(
"\n [Info] ADF_CONF_PATH has been set to %s \n\n ",pwd_path.Data());
210 cout <<
"\n ** [WARNING] ** , ADF_CONF_PATH not set ! " << endl <<
endl;
212 else printf(
"\n [Info] ADF_CONF_PATH is %s \n\n ",adf_path.Data());
215 TBrowser *
b =
new TBrowser();
221 tmp = Form(
".L DefaultWatchers/ADFWatchers.C+%s",
CompOpt);
222 gROOT->ProcessLine(
tmp.Data());
223 tmp = Form(
".L DefaultWatchers/WatcherClient.C+%s",
CompOpt);
224 gROOT->ProcessLine(
tmp.Data());
225 tmp = Form(
".L DefaultWatchers/MetaWatchers.C+%s",
CompOpt);
226 gROOT->ProcessLine(
tmp.Data());
227 tmp = Form(
".L DefaultWatchers/TrackedWatchers.C+%s",
CompOpt);
228 gROOT->ProcessLine(
tmp.Data());
229 tmp = Form(
".L DefaultWatchers/EventPSAWatchers.C+%s",
CompOpt);
230 gROOT->ProcessLine(
tmp.Data());
231 tmp = Form(
".L DefaultWatchers/PSAWatchers.C+%s",
CompOpt);
232 gROOT->ProcessLine(
tmp.Data());
233 tmp = Form(
".L DefaultWatchers/CrystalWatchers.C+%s",
CompOpt);
234 gROOT->ProcessLine(
tmp.Data());
235 tmp = Form(
".L DefaultWatchers/RancLegnaroWatchers.C+%s",
CompOpt);
236 gROOT->ProcessLine(
tmp.Data());
237 tmp = Form(
".L DefaultWatchers/EventWatchers.C+%s",
CompOpt);
238 gROOT->ProcessLine(
tmp.Data());
239 tmp = Form(
".L DefaultWatchers/DanteWatchers.C+%s",
CompOpt);
240 gROOT->ProcessLine(
tmp.Data());
241 tmp = Form(
".L DefaultWatchers/LLaBr3Watchers.C+%s",
CompOpt);
242 gROOT->ProcessLine(
tmp.Data());
249 TString prisma = gSystem->Getenv(
"PRISMA_PREPROC");
250 if ( prisma ==
"" ) {
255 tmp =
"$PRISMA_PREPROC/src/lib_prisma/include/";
printf(
"- Add %s to the include path \n",
tmp.Data());
256 tmp.Prepend(
" .include ");
257 gROOT->ProcessLine(
tmp.Data());
260 gSystem->Load(
"$PRISMA_PREPROC/lib/libPRISMA.so");
263 if ( gSystem->AccessPathName(
"MyWatchers/PrismaWatchers.h") )
264 gSystem->CopyFile(
"Macros/PrismaWatchers.h",
"MyWatchers/PrismaWatchers.h");
265 if ( gSystem->AccessPathName(
"MyWatchers/PrismaWatchers.C") )
266 gSystem->CopyFile(
"Macros/PrismaWatchers.C",
"MyWatchers/PrismaWatchers.C");
268 tmp = Form(
".L MyWatchers/PrismaWatchers.C+%s",
CompOpt);
269 gROOT->ProcessLine(
tmp.Data());
276 TString prespec = gSystem->Getenv(
"PRESPEC"), go4 = gSystem->Getenv(
"GOSYS");
277 if ( prespec ==
"" ) {
282 if ( gSystem->AccessPathName(
"MyWatchers/GSIWatchers.h") )
283 gSystem->CopyFile(
"Macros/GSIWatchers.h",
"MyWatchers/GSIWatchers.h");
284 if ( gSystem->AccessPathName(
"MyWatchers/GSIWatchers.C") )
285 gSystem->CopyFile(
"Macros/GSIWatchers.C",
"MyWatchers/GSIWatchers.C");
287 if ( gSystem->AccessPathName(
"MyWatchers/GSIPrespecWatchers.h") )
288 gSystem->CopyFile(
"Macros/GSIPrespecWatchers.h",
"MyWatchers/GSIPrespecWatchers.h");
289 if ( gSystem->AccessPathName(
"MyWatchers/GSIPrespecWatchers.C") )
290 gSystem->CopyFile(
"Macros/GSIPrespecWatchers.C",
"MyWatchers/GSIPrespecWatchers.C");
292 if ( gSystem->AccessPathName(
"MyWatchers/GSIGO4Watchers.h") )
293 gSystem->CopyFile(
"Macros/GSIGO4Watchers.h",
"MyWatchers/GSIGO4Watchers.h");
294 if ( gSystem->AccessPathName(
"MyWatchers/GSIGO4Watchers.C") )
295 gSystem->CopyFile(
"Macros/GSIGO4Watchers.C",
"MyWatchers/GSIGO4Watchers.C");
298 tmp = Form(
"-I%s",prespec.Data());
299 gSystem->AddIncludePath(
tmp.Data());
300 tmp = Form(
"-I%s/eventapiV50",prespec.Data());
301 gSystem->AddIncludePath(
tmp.Data());
304 if (
tmp.Contains(
"g") ) {
305 tmp = Form(
"%s/debug/lib/libgsievt.so",prespec.Data());
306 gSystem->Load(
tmp.Data()) ;
307 tmp = Form(
"%s/debug/lib/lib_prespec.so",prespec.Data());
308 gSystem->Load(
tmp.Data()) ;
311 tmp = Form(
"%s/release/lib/libgsievt.so",prespec.Data());
312 gSystem->Load(
tmp.Data()) ;
313 tmp = Form(
"%s/release/lib/lib_prespec.so",prespec.Data());
314 gSystem->Load(
tmp.Data()) ;
318 tmp = Form(
".L MyWatchers/GSIWatchers.C+%s",
CompOpt);
319 gROOT->ProcessLine(
tmp.Data());
322 tmp = Form(
".L MyWatchers/GSIPrespecWatchers.C+%s",
CompOpt);
323 gROOT->ProcessLine(
tmp.Data());
326 std::cout <<
"GO4 Watchers not yet defined ! " <<
std::endl;
printf("******************************************************************** \n")
void GSILoadWatchers(const Char_t *path_to_agapro="")
void LoadWatchers_AGATA()
ADF::LogMessage & endl(ADF::LogMessage &log)
void LoadWatchers_GSI()
Load watchers for ancillaries @ GSI.
void LoadWatchers_Legnaro()
Load watchers for ancillaries @ Legnaro i.e. Prisma LIB.
static const char * GetPath(const char *)
to get a particular GW environment variable