31 #include "EmulatorControl.h"
40 TString EntryPointInSetupWatchers =
"EB";
41 TString PathToOut =
"./Out";
42 TString PatternOfROOTFiles =
"";
43 TString TTreeName =
"TreeMaster";
44 TString TTeeTilte =
"GANIL Tree" ;
48 TString ProducerType =
"StogsAFP";
49 bool ADHitTreeMode =
false;
55 void StogsWatchers(Int_t start = -1,
const Char_t *rootafp =
"");
76 TDirectory *MainDir = gROOT;
84 if ( ! emulator->
Init(rootafp) ) {
85 std::cout <<
"Cannot Init emulator" <<
std::endl;
return;
89 TFile *tmp_rfile = 0x0;
90 if ( PatternOfROOTFiles !=
"" ) {
91 tmp_rfile = TFile::Open( Form(
"%s/%s.root",PathToOut.Data(),PatternOfROOTFiles.Data()) ,
"UPDATE" );
96 if ( MainDir != gROOT )
100 if(ProducerType ==
"StogsAFP")
108 gROOT->GetListOfTasks()->Add( control );
109 gROOT->GetListOfTasks()->Add( FDispatcher );
114 if ( !gROOT->IsBatch() ) {
115 TBrowser *
b = (TBrowser*)gROOT->GetListOfBrowsers()->Last();
117 TFolder *GwWatchersFolder = (TFolder*)gROOT->GetRootFolder()->FindObject(
"GwWatchers");
118 if(GwWatchersFolder) b->Add(GwWatchersFolder);
120 TFolder *RootFilesFolder = (TFolder*)gROOT->GetRootFolder()->FindObject(
"ROOT Files");
121 if(RootFilesFolder) b->Add(RootFilesFolder);
125 if(start==-1)emulator->
Run();
126 else if(start>0)emulator->
Run(start);
130 if ( MainDir != gROOT && start ) {
139 if(ProducerType ==
"StogsAFP")
virtual ADF::NarvalProducer * GetBaseProducer()
Process a buffer, trigg and dispachs the work to sub-watchers.
void Save(Option_t *opt="*")
Save the spectra.
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.
virtual Bool_t Run(UInt_t=kMaxUInt)
loop
virtual ADF::NarvalConsumer * GetBaseConsumer()
void StogsWatchers(Int_t start=-1, const Char_t *rootafp="")
This function shows how to do offline analysis using the watchers. if a root file is given...
virtual Bool_t Init()
It should be overwritten !
to have a common base class to be able to control the emulator through a TTask
ADF::LogMessage & endl(ADF::LogMessage &log)
BaseEmulatorChain * DefineEmulatorType()
void SetADHitTreeMode(bool active)
static void SetDefaultPathAndName(const char *new_path="./Out", const char *treename="TreeMaster")
to change the default value of path for output. It returns the old one
virtual void SetDirectory(TDirectory *mother_dir_of_watcher, TDirectory *mother_dir_for_tag, Bool_t load_objects=true)
change directories and Load objects if required