27 const char *which_experiment =
"/agatadisks/eagata/238u_comm_1/",
28 const char *which_adf_data =
"/Out/Global/",
29 const char *run_name_pattern =
"run",
30 const char *opt_adf_pattern =
"*.adf",
31 const char *which_output_dir=
"");
33 #if !defined(__CINT__)
41 #include "TSystemDirectory.h"
43 #include "EmulatorControl.h"
47 #include "BashColor.h"
55 TString PathToOut =
"./Out";
56 TString PatternOfROOTFiles =
"AGATA_VAMOS_Tree_";
57 TString TTreeName =
"TreeMaster" ;
58 TString TTeeTilte =
"GANIL Tree" ;
62 Bool_t OverWriteFile =
false;
72 AgataFrameTrigger *trig = AgataFrameTrigger::Build(
"Event",
"event:data data:tracked event:data:psa data:ranc0");
76 TTreeMaster *rootmaster = fd->
AddTreeMaster(Form(
"%s%s",PatternOfROOTFiles.Data(),Run.Data()) , TTeeTilte.Data(), OverWriteFile);
78 VAMOSWatcher *vamosw = rootmaster->
Add<VAMOSWatcher>(
"GVWInterface",
"Branch managed by the VAMOS librarie");
79 vamosw->InitVAMOS(2,Form(
"%s/VAMOS_Spectra_%s.root",PathToOut.Data(),Run.Data()),RunNr,PathToOut.Data());
81 rootmaster->
AddWatcher<VAMOSVertexBuilder>(
"VAMOSVertexBuilder",
"To Compute a vertex from VAMOS library");
92 if ( ! emulator->
Init(rootafpconf) ) {
96 TTreeMaster::SetDefaultPathAndName(PathToOut.Data(),TTreeName.Data());
107 void ADF_to_Tree(Int_t which_run,
const char *which_experiment,
const char *which_adf_data,
const char *run_name_pattern,
const char *opt_adf_pattern,
const char *which_output_dir)
110 if ( ! emulator->
Init(which_run,which_experiment,which_adf_data,run_name_pattern,opt_adf_pattern) ) {
115 if(which_output_dir !=
"")
116 PathToOut = which_output_dir ;
118 if(!gSystem->OpenDirectory(PathToOut.Data()))
119 if(gSystem->mkdir(PathToOut.Data()) == -1)
121 fBashColor->SetErrorOut();
122 cout <<
"ERROR : Could not create Output directory : " << PathToOut <<
endl;
123 fBashColor->ResetColor();
128 fBashColor->SetInfoOut();
129 cout <<
"INFO : Creating new output directory : " << PathToOut <<
endl;
130 fBashColor->ResetColor();
134 fBashColor->SetInfoOut();
135 cout <<
"INFO : Writing in output directory : " << PathToOut <<
endl;
136 fBashColor->ResetColor();
139 TTreeMaster::SetDefaultPathAndName(PathToOut.Data(),TTreeName.Data());
154 fBashColor->SetInfoOut();
156 std::cout<<
"Watchers properties:"<<
std::endl;
161 TIter iter(ListOfWatchers);
164 while( (o = iter.Next()) )
169 fBashColor->ResetColor();
TString GetRunDir() const
to get back the RunDirectory
virtual Bool_t Run(UInt_t max_loop=kMaxUInt_t)
loop
Watcher_T * AddWatcher(const Char_t *name, const Char_t *title)
Allocate a standard watcher i.e. not a tree builder.
Process a buffer, trigg and dispachs the work to sub-watchers.
Watcher_T * Add(const Char_t *name, const Char_t *title, Short_t do_spectra, Short_t do_tree)
Allocate a watcher in charge of filling one part of the tree ==> Should inherits from TreeBuilder...
virtual Bool_t SetTrigger(ADF::DFTrigger *)
This is the default trigger for any added watcher.
Cons_actor * GetConsumer()
header file for Trigger.cpp
AD ROOT TTree branches for the hit part.
header file for GANILWatchers.C
virtual ADF::NarvalConsumer * GetBaseConsumer()
To be used for Agata Data Flow.
to have a common base class to be able to control the emulator through a TTask
static const TList * GetListOfWatchers()
virtual void SetAgataOffset(Double_t offset=0.0)
set the agata offset in case it is not @ the optimal position
TTreeMaster * AddTreeMaster(const Char_t *name, const Char_t *title, Bool_t Overwrite=false, ADF::DFTrigger *t=0x0)
NarvalConsumer * GetBaseConsumer()
virtual Bool_t Init(const Char_t *rootafp)
Init the emulator using a different root afp file for the producer.
header file for RootAFP.cpp
Watcher to build a tree with branches processed in several watchers.
ADF::LogMessage & endl(ADF::LogMessage &log)
virtual void Print(std::ostream &out=std::cout) const
Print some informations (statistics)
AD ROOT TTree branches for the tracked part.
void ADF_to_Tree_UserSetup(Gw::FrameDispatcher *fd)
void ADF_to_Tree(const Char_t *rootafpconf="")
Transform ADF files into a ROOT Tree using the RootAFP.conf given as argument. No Arguments means Roo...
void PrintStats(BaseEmulatorChain *emulator)