20#include "TDataMember.h"
22#include "TBaseClass.h"
38 TIter iter(folder->GetListOfFolders());
39 while(
auto obj = iter()) {
41 if (entry) entry->
Reset();
49 TIter iter(folder->GetListOfFolders());
50 while(
auto obj = iter()) {
52 if (entry) entry->Print(
"*");
60 TIter iter(folder->GetListOfFolders());
61 while(
auto obj = iter()) {
63 if (entry) entry->RecursiveRemove(objtoremove);
73 TIter iter(folder->GetListOfFolders());
76 while(
auto obj = iter()) {
103 catch(std::exception& ex) {
105 TString::Format(
"!!!STD exception %s was raised processing dynamic entry!!!", ex.what()).Data());
113 if(!eventclass)
return nullptr;
118 Long_t indexoffset = 0;
119 const char *ixbegin = strchr(memname,
'[');
124 const char *ixend = strchr(ixbegin,
']');
126 TString buf(ixbegin, ixend-ixbegin);
127 indexoffset = buf.Atoll();
128 if(indexoffset < 0) indexoffset = 0;
133 TDataMember *eventmember = eventclass->GetDataMember(memname);
135 *totaloffset+=eventmember->GetOffset();
138 TIter baseiter(eventclass->GetListOfBases());
139 while(
auto ob = baseiter()) {
140 TBaseClass* baseclass =
dynamic_cast<TBaseClass*
>(ob);
144 TClass *bclass = baseclass->GetClassPointer();
149 *totaloffset+=baseclass->GetDelta();
162 const char *tname = eventmember->GetFullTypeName();
164 Int_t maxindex = eventmember->GetMaxIndex(0);
165 if(maxindex < 0) maxindex = 1;
166 if(indexoffset<maxindex)
168 Int_t datasize = eventmember->GetDataType()->Size();
169 *totaloffset += indexoffset*datasize;
174 TString::Format(
"Index %ld for array member:%s out of range %s[%d]", indexoffset, memname, tname, maxindex).Data());
183 if (!hentry)
return true;
192 TDataMember *eventmember =
nullptr;
212 TDataMember *eventmember =
nullptr;
236 evvalid[n] =
event->IsValid();
246 if (!tentry)
return true;
250 if(!processtrees)
return true;
257 TString::Format(
"Tree Histogram Entry: !!! Could not find Tree %s ",tentry->
GetTreeName()).Data());
264 TString::Format(
"Tree Histogram Entry: !!! Could not find Histogram %s ",hname).Data());
273 histo =
dynamic_cast<TH1 *
>(gROOT->FindObject(hname));
275 histo =
dynamic_cast<TH1 *
>(gROOT->FindObjectAny(hname));
TDataMember * FindDataMember(TClass *eventclass, const char *memname, Long_t *totaloffset)
The mother of all go4 analysis.
static TGo4Analysis * Instance()
return analysis instance
TGo4EventElement * GetEventStructure(const char *name) const
Search reference to event structure in folder.
TH1 * GetHistogram(const char *name)
Search histogram in histogram list (directory).
Bool_t AddHistogram(TH1 *his, const char *subfolder=nullptr, Bool_t replace=kTRUE)
Add external histogram to go4 histogram directory.
TGo4Condition * GetAnalysisCondition(const char *name, const char *cond_cl=nullptr)
Retrieves an analysis condition from list by name.
TTree * GetTree(const char *name)
Search tree in tree folder.
ABC for all entries that can be kept in a dynamic list.
virtual void Reset()
Resets this entry to an initial status.
Bool_t IsEnabledProcessing() const
Int_t Handle() override
This is a default handler function for the respective exception type.
static bool ProcessHEntry(TGo4HistogramEntry *hentry)
static void ProcessEntries(TFolder *folder, Bool_t processtrees, Int_t interval)
Iterates all entries of the list and processes the objects, depending on coordinate values and analys...
static void PrintEntries(TFolder *folder)
static bool ProcessTEntry(TGo4TreeHistogramEntry *tentry, Bool_t processtrees, Int_t interval)
static void ResetEntries(TFolder *folder)
static void CleanupPointerInEntries(TFolder *folder, TObject *obj)
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
Entry for the dynamic list, specialized for histogram like objects.
TObject * fxHisEvents[__MAXHISDIM__]
Pointer for event objects, class does not known to entry itself.
const char * GetConVarName(Int_t ix) const
TH1 * fxHistogram
The (histogram) object kept by this entry.
const char * GetHistogramName() const
Get name of the external histogram to be filled.
void InitHistPointer(Int_t ix, TObject *event, TDataMember *member, Long_t offset)
static const char * Get_fgcNOEVENT()
const char * GetHistEventName(Int_t ix) const
Bool_t NeedInitialisation() const
const char * GetConEventName(Int_t ix) const
void InitCondPointer(Int_t ix, TObject *event, TDataMember *member, Long_t offset)
const char * GetConditionName() const
void ProcessNew(Bool_t *evvalid)
void SetNeedInitialisation(Bool_t on=kTRUE)
const char * GetHistVarName(Int_t ix) const
static const char * Get_fgcNODATA()
TGo4Condition * fxCondition
Condition to be checked on processing this entry.
Dynamic list entry which links a histogram to a certain tree.
Bool_t fbNewHistogram
True before Process is called the first time.
const char * GetTreeName() const
const char * GetHistogramName() const
Get name of the external histogram to be filled.
void SetDynListInterval(Int_t value)
void ProcessTreeNew(TTree *tree, Int_t times)