GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OnlineWatchersGLP.C
Go to the documentation of this file.
1 
2 #include "TROOT.h"
3 #include "WatcherClient.h"
4 #include "TBrowser.h"
5 #include "TFolder.h"
6 
7 using namespace ADF;
8 using namespace Gw;
9 
10 // include there the macros that contains your own setup
11 // i.e. what are the watchers you would like to execute for a given data flow.
12 
13 #include "GANILSetup.C"
14 
16 /*
17 */
18 void OnlineWatchersGLP(TFile *file = 0x0, TFile *file_tag = 0x0)
19 {
20  TDirectory *Watcher_dir = gROOT, *Watcher_dir_tag = gROOT;
21  if ( file )
22  Watcher_dir = file;
23  if ( file_tag )
24  Watcher_dir_tag = file_tag;
25 
26  // main task.
27  // Adding all emulators to this helps to loop in case Option is l in ExecuteTasks
28  TTask *Snooper = new LoopOnTasks(Watcher_dir,Watcher_dir_tag);
29 
30  // ADF //
31  // Can scan any kind of data flow
32  WatcherClient *wADF = new WatcherClient("ADF","Watchers on any Agata Frame",Watcher_dir,Watcher_dir_tag);
33  if ( SetupWatchers("ADF",wADF) ) {
34  Snooper->Add ( wADF );
35  wADF->SetConnection("172.16.1.126", 9002);
36  }
37  // EB //
38  // to analyse the data flow coming out from the Event Builder i.e. a Data Flow composed of event:data:psa Frames
39  WatcherClient *wEventPSA = new WatcherClient("EB","Watchers to analyse data after the Event Builder",Watcher_dir,Watcher_dir_tag);
40  if ( SetupWatchers("EB",wEventPSA) ){
41  Snooper->Add ( wEventPSA );
42  wEventPSA->SetConnection("172.16.1.126", 9000);
43  }
44 /*
45  // MERGER //
46  // to analyse the data flow coming out from the Merger i.e. a Data Flow composed of any combinaisons of
47  // event:data:pa
48  // data:ranc1
49  WatcherClient *wMerger = new WatcherClient("MERGER","Watchers to analyse data @ the MERGER level",Watcher_dir,Watcher_dir_tag);
50  if ( SetupWatchers("MERGER",wMerger) ){
51  Snooper->Add ( wMerger );
52  wMerger->SetConnection("10.10.1.118", 9020);
53  }
54 */
55  // TRACKING //
56  // to analyse the data flow coming out from the Event Builder i.e. a Data Flow composed of any combinaisons of
57  // event:data:pa
58  // data:ranc1
59  // data:tracked
60  WatcherClient *wTrack = new WatcherClient("TRACKING","Watchers to analyse data after TRACKING",Watcher_dir,Watcher_dir_tag);
61  if ( SetupWatchers("TRACKING",wTrack) ){
62  Snooper->Add ( wTrack );
63  wTrack->SetConnection("172.16.1.126", 9002);
64  }
65 
66 
67 // add the main ADF to the list of task
68 
69  // add the main ADF to the list of task
70  TSRateCollector *TSCollector = new TSRateCollector("GTS_Rate","Global Timestamp rates");
71  TSCollector->SetDirectory(Watcher_dir,Watcher_dir_tag);
72  Snooper->Add(TSCollector);
73  DoTSRateCollector(Snooper,TSCollector);
74 
75  gROOT->GetListOfTasks()->Add(Snooper);
76 
77 
78  TBrowser *b = (TBrowser*)gROOT->GetListOfBrowsers()->Last();
79 
80  TFolder *GwWatchersFolder = (TFolder*)gROOT->GetRootFolder()->FindObject("GwWatchers");
81  if(GwWatchersFolder) b->Add(GwWatchersFolder);
82 
83  TFolder *RootFilesFolder = (TFolder*)gROOT->GetRootFolder()->FindObject("ROOT Files");
84  if(RootFilesFolder) b->Add(RootFilesFolder);
85 }
86 
87 void CloseOnlineWatchers() { gROOT->GetListOfTasks()->At(0)->Delete(); }
88 
89 
90 
TBrowser * b
void CloseOnlineWatchers()
Bool_t SetupWatchers(const char *df_type, FrameDispatcher *fd, const char *ext="")
It shows how to set up the watchers for different kind of data flow.
void DoTSRateCollector(TTask *top_task, TSRateCollector *collector)
browse all dispatchers to look for TSRate Watcher and add them to the rate collector ...
To get a buffer from an actor, trigg on a Frame and dispach the Frame to sub-watchers.
void OnlineWatchersGLP(TFile *file=0x0, TFile *file_tag=0x0)
This is the default configuration.
Bool_t SetConnection(const Char_t *machine="localhost", UInt_t port=9090)
change the place where are picked data
To start a loop on tasks.
Definition: Watchers.h:551
virtual void SetDirectory(TDirectory *mother_dir_of_watcher, TDirectory *mother_dir_tag, Bool_t load_objects=true)
to change the directory in which watcher's objects are stored
Definition: Watchers.cpp:458
compute histograms for several TSRate