14#ifndef TGO4ANALYSISOBJECTMANAGER_H
15#define TGO4ANALYSISOBJECTMANAGER_H
72 Bool_t
AddObject(TNamed *anything,
const char *subfolder =
nullptr, Bool_t replace = kTRUE);
81 TNamed *
GetObject(
const char *name,
const char *folder =
nullptr);
90 TObject *
GetAsTObject(
const char *name,
const char *folder =
nullptr);
130 Bool_t istopbranch = kFALSE);
141 Int_t startindex, Int_t *skip,
142 const char *name,
const char *title);
160 Bool_t
AddHistogram(TH1 *his,
const char *subfolder =
nullptr, Bool_t replace = kTRUE);
192 TH1 *
MakeTH1(
const char *histotype,
193 const char *foldername,
194 const char *histoname,
198 const char *title =
nullptr,
199 const char *xtitle =
nullptr,
200 const char *ytitle =
nullptr);
222 TH2 *
MakeTH2(
const char *histotype,
223 const char *foldername,
224 const char *histoname,
231 const char *title =
nullptr,
232 const char *xtitle =
nullptr,
233 const char *ytitle =
nullptr);
241 Bool_t
AddTree(TTree *tree,
const char *subfolder =
nullptr);
246 TTree *
GetTree(
const char *name);
254 Bool_t
RemoveTree(TTree *tree,
const char *stepname =
nullptr);
271 Bool_t counter = kTRUE, TFolder *parent =
nullptr);
300 const char *conditionname,
303 const char *bindhistogram =
nullptr,
304 Bool_t invert = kFALSE);
322 const char *conditionname,
327 const char *bindhistogram =
nullptr,
328 Bool_t invert = kFALSE);
353 const char *conditionname,
355 Float_t (*points)[2],
356 const char *bindhistogram =
nullptr,
357 Bool_t invert = kFALSE);
427 Bool_t
AddCanvas(TCanvas *can,
const char *subfolder =
nullptr);
565 const char *hevx,
const char *hmemx,
566 const char *hevy =
nullptr,
const char *hmemy =
nullptr,
567 const char *hevz =
nullptr,
const char *hmemz =
nullptr,
568 const char *condition =
nullptr,
569 const char *cevx =
nullptr,
const char *cmemx =
nullptr,
570 const char *cevy =
nullptr,
const char *cmemy =
nullptr);
579 Bool_t
AddTreeHistogram(
const char *hisname,
const char *treename,
const char *varexp,
const char *cutexp);
633 TFolder *
FindSubFolder(TFolder *parent,
const char *subfolder, Bool_t create = kTRUE);
849 const char *subfolder =
nullptr,
850 Bool_t replace = kTRUE,
851 Bool_t uniquename = kFALSE,
852 Bool_t resetbits = kTRUE);
867 Bool_t
LoadFolder(TFolder *source, TFolder *destination, Bool_t replace = kFALSE);
874 Bool_t
LoadFolder(TDirectory *source, TFolder *destination, Bool_t replace = kFALSE);
881 Bool_t
PutToFolder(TObject *ob, TFolder *destination, Bool_t replace = kFALSE);
908 Int_t
PrintFolder(TFolder *fold, Option_t *opt,
const char *expression =
nullptr);
968 Bool_t
IsMatching(
const char *
string,
const char *expression)
const;
981 const char *&pathname,
982 const char *objectname,
static const char * GetTMPFOLDER()
TH1 * MakeTH1(const char *histotype, const char *foldername, const char *histoname, Int_t nbinsx, Axis_t xlow, Axis_t xup, const char *title=nullptr, const char *xtitle=nullptr, const char *ytitle=nullptr)
Create 1-dim histogram in histogram folder.
TFolder * fxEventDir
Directory containing references to event structures.
Bool_t IsMatching(const char *string, const char *expression) const
Finds out if string is matching the expression.
Bool_t RemoveTree(TTree *tree, const char *stepname=nullptr)
Remove reference to a tree in the go4 folder structure.
void PrintDynamicList()
Print entries of current dynamic list.
Bool_t ProtectFolder(TFolder *fold, const Option_t *flags)
Change protection properties of all objects in this folder as specified.
Bool_t ClearFolder(TFolder *fold)
Clear (reset) all objects in folder fold, e.g.
static const char * GetTOPDYNAMICLIST()
Int_t fiDynListCount
Event counter for dynamic list processing.
Bool_t AddCanvas(TCanvas *can, const char *subfolder=nullptr)
Puts a new TCanvas in corresponding folder.
Bool_t ProtectObjects(const char *name, const Option_t *flags)
Change protection properties of object name as specified.
void SetSortedOrder(Bool_t on=kTRUE)
Configure sorting order for newly created sub-folders.
void PrintConditions(const char *expression=nullptr)
Print all condition counters to the terminal.
TGo4AnalysisObjectManager()
Bool_t fbCreatedinMake
Boolean flag indicates, if object was created in last calls of one of Make* functions.
static const char * GetTREEFOLDER()
Bool_t AddParameter(TGo4Parameter *par, const char *subfolder=nullptr)
Puts a new parameter object in corresponding folder.
void SaveObjects(TFile *file)
Save folder structure to given file.
Int_t PrintFolder(TFolder *fold, Option_t *opt, const char *expression=nullptr)
Printout all objects in folder fold on the terminal.
static const char * GetHISTFOLDER()
static const char * fgcSRCFOLDER
Event source reference folder name.
Bool_t DeleteObjects(const char *name)
Delete object of name, or all objects in folder name, respectively.
TFolder * fxTempFolder
Temporary folder for nameslist objects.
TGo4Condition * GetAnalysisCondition(const char *name, const char *cond_cl=nullptr)
Retrieves an analysis condition from list by name.
Bool_t ClearObjects(const char *name)
Clear (reset) the specified objects.
Bool_t AddEventStructure(TGo4EventElement *ev)
Add reference to event structure object to Go4 Folder structure.
void AppendToDir(TObject *ob, TDirectory *dir)
Append object ob to directory dir.
void CloseAnalysis()
Cleanups required when analysis is closed.
static const char * GetSTOREFOLDER()
Bool_t RemoveParameter(const char *name)
Removes parameter by name.
Bool_t AddObject(TNamed *anything, const char *subfolder=nullptr, Bool_t replace=kTRUE)
Add any external object to the user object folder.
Bool_t DeleteFolder(TFolder *fold)
Delete all objects in folder fold only if the kGo4CanDelete bit is set.
Bool_t RemoveEventProcessor(TGo4EventProcessor *pro)
Remove reference to event processor from go4 folder structure.
TH1 * GetHistogram(const char *name)
Search histogram in histogram list (directory).
TFolder * CreateCompositeBranchFolder(TObjArray *branchlist, TGo4CompositeEvent *compevent, Int_t startindex, Int_t *skip, const char *name, const char *title)
Create a folder with subfolders from a list of TBranchElements that belongs to a TGo4CompositeEvent.
Bool_t SetParameterStatus(const char *name, TGo4ParameterStatus *par, TFolder *parent=nullptr)
Set existing parameter of name to the values of external parameter object par.
static const char * GetUSRFOLDER()
static const char * GetDYNFOLDER()
Bool_t RemovePicture(const char *name)
Removes picture by name.
void RecursiveRemove(TObject *obj) override
Method used in case when object is cleaned up by the ROOT.
static const char * fgcTREEFOLDER
Tree reference folder name.
Bool_t RemoveEventSource(TGo4EventSource *source)
Remove reference to event source from go4 folder structure.
static const char * fgcUSRFOLDER
User objects folder name.
Bool_t AddTree(TTree *tree, const char *subfolder=nullptr)
Add reference to a tree in the go4 folder structure.
Bool_t fbSuppressLoadHistograms
If this is set to true, any found histogram will not be loaded from the file current TDirectory.
TFolder * fxAnalysisDir
Top Directory for all references to event classes.
TGo4ObjectStatus * CreateObjectStatus(const char *name, const char *folder=nullptr)
Find Object of name in the folder structure and create a complete status object of it.
void ProcessDynamicList()
Loop over the dynamic list and process the actions linked to the entries.
TFolder * GetObjectFolder()
Access to top folder of all objects.
void CleanupDynamicLists(TObject *oldobject)
Remove reference to object from all dynamic lists.Object type is noticed automatically.
Bool_t AddHistogram(TH1 *his, const char *subfolder=nullptr, Bool_t replace=kTRUE)
Add external histogram to go4 histogram directory.
static const char * fgcTOPFOLDER
Top level folder name.
TFolder * fxTreeDir
Directory containing references to trees.
TList * fxMatchList
List of matching objects for name expression.
TObject * TestObject(TFolder *folder, const char *&pathname, const char *objectname, const TClass *cl)
Test, if object exists in provided folder.
static const char * GetTOPFOLDER()
Bool_t RemoveDynamicEntry(const char *entryname)
Remove entry of that name from dynamic list of listname.
Bool_t fbSortedOrder
Is sub-folder created is sorted order.
void PrintParameters(const char *expression=nullptr)
Print all parameters to the terminal.
static const char * GetSRCFOLDER()
Bool_t RemoveEventStructure(TGo4EventElement *ev)
Remove reference to event structure from go4 folder structure.
TObject * FindObjectInFolder(TFolder *folder, const char *fullname) const
Search in folder for object with specified name Uses fxDirMutex until search is working.
Bool_t ResetBackStores(Bool_t clearflag=kFALSE)
Reset all registered backstore instances.Called by dynamic list processing.
TGo4WinCond * MakeWindowCond(const char *foldername, const char *conditionname, Double_t xlow, Double_t xup, const char *bindhistogram=nullptr, Bool_t invert=kFALSE)
Create 1-dim window condition in conditions folder.
Bool_t RemoveEventStore(TGo4EventStore *store)
Remove reference to event store from go4 folder structure.
TFolder * fxCanvasDir
Directory containing TCanvases.
Bool_t AddObjectToFolder(TObject *ob, TFolder *fold, const char *subfolder=nullptr, Bool_t replace=kTRUE, Bool_t uniquename=kFALSE, Bool_t resetbits=kTRUE)
Add any named object to a folder.
TCanvas * GetCanvas(const char *name)
Retrieves a TCanvas by name from the Canvases folder.
TFolder * fxProcessorDir
Directory containing references to event processors.
Bool_t CreatedInMake() const
TMutex * fxDirMutex
Mutex protecting the object directories.
Bool_t SetPicture(const char *name, TGo4Picture *pic, TFolder *parent=nullptr)
Set existing picture of name to the values of external picture object pic.
Bool_t AddEventProcessor(TGo4EventProcessor *pro)
Add reference to event processor object to Go4 Folder structure.
Bool_t AddDynamicHistogram(const char *name, const char *histo, const char *hevx, const char *hmemx, const char *hevy=nullptr, const char *hmemy=nullptr, const char *hevz=nullptr, const char *hmemz=nullptr, const char *condition=nullptr, const char *cevx=nullptr, const char *cmemx=nullptr, const char *cevy=nullptr, const char *cmemy=nullptr)
Add (create) new dynamic histogram entry which connects an existing histogram with existing condition...
static const char * GetPICTFOLDER()
TGo4AnalysisObjectNames * CreateNamesList()
Creates a list of names (keys) of all objects in analysis directories.
TFolder * fxSourceDir
Directory containing references to event sources.
TObject * NextMatchingObject(const char *expr, const char *folder, Bool_t reset)
Delivers pointer to next object of the Go4 folder structure with a name matching the expression expr.
static const char * fgcPARAFOLDER
Analysis user parameters folder name.
TH2 * MakeTH2(const char *histotype, const char *foldername, const char *histoname, Int_t nbinsx, Axis_t xlow, Axis_t xup, Int_t nbinsy, Axis_t ylow, Axis_t yup, const char *title=nullptr, const char *xtitle=nullptr, const char *ytitle=nullptr)
Create 2-dim histogram in histogram folder.
TGo4Parameter * GetParameter(const char *name, const char *parameter_class=nullptr)
Retrieves a parameter object by name from the object folder.
Bool_t AddDynamicEntry(TGo4DynamicEntry *entry)
Adds entry to object manager.
TObject * GetAsTObject(const char *name, const char *folder=nullptr)
Searches for object by name in all go4 folders.
TFolder * fxParameterDir
Directory containing user parameter objects.
static const char * fgcCONDFOLDER
Analysis conditions folder name.
Bool_t RemoveHistogram(const char *name, Bool_t del=kTRUE)
Removes histogram from histogram dir by name.
TList * CreateObjectList(const char *expr, const char *folder=nullptr)
Create a list of objects which names are matching expression expr.
Bool_t SaveFolder(TFolder *source)
Save this folder as a new subdirectory (TDirectory) of the current directory i.e.
static const char * fgcSTOREFOLDER
Event store reference folder name.
Bool_t IsSortedOrder() const
Returns true if sub-folders will be created in sorted order.
TGo4EventElement * GetEventStructure(const char *name) const
Search reference to event structure in folder.
static const char * GetANALYSISFOLDER()
static const char * fgcHISTFOLDER
Histograms folder name.
TFolder * fxStoreDir
Directory containing references to event stores.
TFolder * fxPictureDir
Directory containing the pictures.
Bool_t AddAnalysisCondition(TGo4Condition *con, const char *subfolder=nullptr)
Puts a new analysis condition object in corresponding list.
TFolder * fxDynListDir
Directory containing all action objects to be used by dynamic list and by user analysis.
TFolder * fxConditionDir
Directory containing all condition objects to be used by dynamic list and by user analysis.
Bool_t AddEventSource(TGo4EventSource *source)
Add reference to event source object to Go4 Folder structure.
static const char * GetPARAFOLDER()
TFolder * FindSubFolder(TFolder *parent, const char *subfolder, Bool_t create=kTRUE)
Get pointer to subfolder of parent specified by name.
Bool_t LoadFolder(TFolder *source, TFolder *destination, Bool_t replace=kFALSE)
Update folder destination with the content of the folder source.
TNamed * GetObject(const char *name, const char *folder=nullptr)
Searches for object by name in all go4 folders.
static const char * fgcPICTFOLDER
Picture objects folder name.
static const char * fgcTOPDYNAMICLIST
Default name of the default (toplevel) dynamic list.
TFolder * CreateMembersFolder(TObject *obj, const char *membrfoldername, TClass *cl)
Create a folder with members of this class.
Bool_t DeleteObject(TObject *ob)
Delete the specified object if the kGo4CanDelete bit is set.
TGo4Picture * GetPicture(const char *name)
Retrieves a picture object by name from the object folder.
static const char * fgcANALYSISFOLDER
top analysis objects reference folder name
static const char * fgcTMPFOLDER
Temporary dummy folder name.
static const char * GetCANVFOLDER()
TFolder * CreateBranchFolder(TObjArray *branchlist, const char *name, const char *title, Bool_t istopbranch=kFALSE)
Create a folder with subfolders from a list of TBranchElements.
void ResetCurrentDynList()
Reset the current dynamic list.
void RemoveFromDir(TFolder *fold, TDirectory *dir)
Remove all objects in folder fold from directory dir, recursively.
static const char * fgcEVENTFOLDER
Event references folder name.
TIterator * fxMatchIterator
Iterator for list of matching objects.
Bool_t AddPicture(TGo4Picture *pic, const char *subfolder=nullptr)
Puts a new picture object in corresponding folder.
TGo4PolyCond * MakePolyCond(const char *foldername, const char *conditionname, Int_t size, Float_t(*points)[2], const char *bindhistogram=nullptr, Bool_t invert=kFALSE)
Create polygon 2-dim condition in conditions folder.
static const char * GetPROCFOLDER()
TFolder * fxGo4Dir
Top level Go4 Directory (root folder)
Bool_t PutToFolder(TObject *ob, TFolder *destination, Bool_t replace=kFALSE)
Method used by both LoadFolder variants to assign object ob into destination folder by object type.
Bool_t SetAnalysisCondition(const char *name, TGo4Condition *con, Bool_t counter=kTRUE, TFolder *parent=nullptr)
Set existing analysis condition of name to the values of external condition object con.
TTree * GetTree(const char *name)
Search tree in tree folder.
static const char * GetEVENTFOLDER()
TGo4TreeStructure * CreateTreeStructure(TTree *thetree)
Create a tree structure object that maps the TBranchelements into a TFolder hierarchy.
Bool_t ClearObject(TObject *ob)
Clear (reset) the specified object.
Int_t GetDynListInterval() const
TFolder * fxUserDir
Directory containing all user objects.
Bool_t LoadObjects(TFile *statusfile)
Load objects from file.
TFolder * fxHistogramDir
Directory containing all histogram objects to be used by dynamic list and user analysis.
Bool_t RemoveObject(const char *name, Bool_t del=kTRUE)
Removes object from user object folder by name.
Bool_t AddTreeHistogram(const char *hisname, const char *treename, const char *varexp, const char *cutexp)
Add Histogram into the dynamic list which is linked to a tree.
Bool_t ProtectObject(TObject *ob, const Option_t *flags)
Change protection properties of object name as specified.
Int_t fiDynListInterval
Interval for dynamic list processing.
static const char * fgcCANVFOLDER
TCanvas folder name.
Bool_t RemoveObjectFromFolder(const char *fullname, TFolder *fold, Bool_t isDel)
Remove object specified by full name ("subfolder/subssubfolder/name") from folder fold.
void SetDynListInterval(Int_t val)
void PrintHistograms(const char *expression=nullptr)
Printout of all histogram statistic counters on the terminal.
static const char * fgcPROCFOLDER
Event processor reference folder name.
Bool_t RemoveAnalysisCondition(const char *name)
Removes analysis condition from list by name.
TFolder * CreateNamesFolder(TFolder *objectfolder)
Conversion of the TFolder of objects into a TFolder containing the object names as TObjectStrings.
Bool_t AddEventStore(TGo4EventStore *store)
Add reference to event store object to Go4 Folder structure.
Bool_t FindObjectPathName(TObject *obj, TString &pathname, TFolder *fold=nullptr)
Return full path name to object, relative to specified folder.
static const char * GetCONDFOLDER()
static const char * fgcDYNFOLDER
Dynamic lists folder name.
Bool_t SetParameter(const char *name, TGo4Parameter *par, TFolder *parent=nullptr)
Set existing parameter of name to the values of external parameter object par.
virtual ~TGo4AnalysisObjectManager()
Bool_t RemoveCanvas(const char *name)
Removes TCanvas by name.
Contains the name (key) list of all objects in the analysis scope.
Base type for object composition.
ABC for all entries that can be kept in a dynamic list.
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
Abstract event processor.
The abstract interface class for the raw event store.
Object container for the mbs histogram buffer structure.
One entry of the object names folder.
Status object for an analysis parameter.
Base class for all parameter aggregations, e.g.
Picture cconfiguration in Go4.
Contains the branchelement structure of a certain TTree on the analysis side.