v2.10-0 (21000JUN2005)

Go4Analysis
Class TGo4Analysis

Direct Known Subclasses:
TXXXAnalysis, TXXXAnalysis, TMeshAnalysis, TYYYAnalysis

class TGo4Analysis
derived from TGo4CommandReceiver, TObject

The mother of all go4 analyses. Provides services to organize
events, histogram data, and everything. May run standalone in batch mode,
or may be aggregated by analysis client for threaded online control. User
has to derive his/her own analysis from this base class and override the
virtual user event function and set event factory methods.

Author:
J. Adamczewski
Since: 19-jan-2001

Field Summary
 private Bool_tfbAutoSaveFileChange
          True if autosave name shall be changed when input file of multiple file input has changed.
 protected Bool_tfbAutoSaveOn
          True if Autosaving is enabled (default).
 private Bool_tfbAutoSaveOverwrite
          True if autosave file is in overwrite mode
 private static Bool_tfbExists
          This is used to check from outsid if an analysis is
already there.
 protected Bool_tfbInitIsDone
          True if analysis framework has been initialized and
the event classes are created.
 private Bool_tfbNewInputFile
          True if input file of multiple file input has changed.
 private Bool_tfbStopWatingFlag
          used for exit from WaitForStart() routine by interrupt
 const static const Text_t[]fgcDEFAULTFILENAME
          standard file name
 const static const Text_t[]fgcDEFAULTFILESUF
          filename suffix for object file
 const static const Text_t[]fgcDEFAULTSTATUSFILENAME
          standard file name for analysis settings
 const static const Text_t[]fgcTOPDYNAMICLIST
          Default name of the default (toplevel) dynamic list
 const static const Int_tfgiAUTOSAVECOUNTS
          Definition of default autosave interval.
 const static const Int_tfgiDYNLISTINTERVAL
          This value is the number of events in between subsequent dynamic list processing
 const static const Int_tfgiGO4VERSION
          Version Number of the Go4 build.
 const static const Int_tfgiMACROSTARTPOLL
          Time in ms to sleep in the polling loop of the WaitForStart
 private Int_tfiAutoSaveCompression
          compression level for autosave file
 private Int_tfiAutoSaveCount
          Event counter for autosave mechanism.
 private Int_tfiAutoSaveInterval
          Implicit Loop cycles in between two autosave actions.
 private TGo4AnalysisClient*fxAnalysisSlave
          Optional backpointer to analysis client if running in gui mode.
 private TFile*fxAutoFile
          Optional file for autosave of the important objects.
 private TStringfxAutoFileName
          Name of the autosave file.
 private TStopwatch*fxAutoSaveClock
          Clock for autosave by time mechanism.
 private TMutex*fxAutoSaveMutex
          Mutex protecting the autosave file access.
 private TStringfxConfigFilename
          name of configuration file used for this setup
 private TGo4DynamicListStatus*fxDynamicListStatus
          Status object representing the dynamic list (names of
the entries).
 private static TGo4Analysis*fxInstance
          Static Pointer to the analysis singleton instance.
 private TGo4AnalysisObjectManager*fxObjectManager
           
 private TGo4AnalysisObjectNames*fxObjectNames
           
 private TGo4EventElement*fxSampleEvent
          this holds event sample for the SingleEventTree.
 private TGo4AnalysisStepManager*fxStepManager
           

Constructor Summary
 protected TGo4Analysis()
          Protected constructor for singleton instance.

Destructor Summary
 virtual synchronized ~TGo4Analysis()
           

Method Summary
 Bool_tAddAnalysisCondition(TGo4Condition* con, const Text_t* subfolder)
          Puts a new analysis condition object in corresponding list.
 Bool_tAddAnalysisStep(TGo4AnalysisStep* next)
          Method for user analysis constructor to setup the list
of analyisis steps.
 Bool_tAddCanvas(TCanvas* can, const Text_t* subfolder)
          Puts a new TCanvas in corresponding folder.
 Bool_tAddDynamicHistogram(const Text_t* name, const Text_t* histo, const Text_t* hevx, const Text_t* hmemx, const Text_t* hevy, const Text_t* hmemy, const Text_t* hevz, const Text_t* hmemz, const Text_t* condition, const Text_t* cevx, const Text_t* cmemx, const Text_t* cevy, const Text_t* cmemy)
           
 Bool_tAddDynamicHistogram(TGo4HistogramEntryStatus* settings)
           
 private Bool_tAddEventProcessor(TGo4EventProcessor* pro)
          Add reference to event processor object to Go4 Folder structure.
 private Bool_tAddEventSource(TGo4EventSource* source)
          Add reference to event source object to Go4 Folder structure.
 private Bool_tAddEventStore(TGo4EventStore* store)
          Add reference to event store object to Go4 Folder structure.
 private Bool_tAddEventStructure(TGo4EventElement* ev)
          Add reference to event structure object to Go4 Folder structure.
 Bool_tAddHistogram(TH1* his, const Text_t* subfolder, Bool_t replace)
          Add external histogram to go4 histogram directory.
 Bool_tAddObject(TNamed* anything, const Text_t* subfolder, Bool_t replace)
          Add any external object to the user object folder.
 Bool_tAddParameter(TGo4Parameter* par, const Text_t* subfolder)
          Puts a new parameter object in corresponding folder.
 Bool_tAddPicture(TGo4Picture* pic, const Text_t* subfolder)
          Puts a new picture object in corresponding folder.
 Bool_tAddTree(TTree* tree, const Text_t* subfolder)
          Add reference to a tree in the go4 folder structure.
 Bool_tAddTreeHistogram(const Text_t* hisname, const Text_t* treename, const Text_t* varexp, TCut selection)
          Add Histogram into the dynamic list wich is linked to a tree.
 voidAutoSave()
          Perform autosave of all active stores, save existing calibration objects,
write known objects into user file.
 Bool_tCheckDynListInterval()
           
 Bool_tClearObjects(const Text_t* name)
          Clear (reset) the specified objects.
 virtual voidCloseAnalysis()
          Finish the analysis run and close all event sources/storages.
 private voidCloseAutoSaveFile()
          Close the autosave file if existing.
 TGo4AnalysisObjectNames*CreateNamesList()
          Creates a list of names (keys) of all objects in analysis directories.
 TGo4ObjectStatus*CreateObjectStatus(const Text_t* name, const Text_t* folder)
          Find Object of name in the folder structure
and create a complete status object of it.
 private TTree*CreateSingleEventTree(const Text_t* name, Bool_t isoutput)
          Create a tree that is filled with one single event sample.
 private TTree*CreateSingleEventTree(TGo4EventElement* event)
          Create a tree that is filled with one single event sample.
 TGo4AnalysisStatus*CreateStatus()
          Create a copy of the analysis internal state.
 TGo4TreeStructure*CreateTreeStructure(const Text_t* treename)
          Create a tree structure for a certain tree by name
 Bool_tDeleteObjects(const Text_t* name)
          Delete object of name, or all objects in folder name, respectively.
 static Bool_tExists()
           
 TGo4Condition*GetAnalysisCondition(const Text_t* name)
          Retrieves an analysis condition from list by name.
 TGo4AnalysisStep*GetAnalysisStep(const Text_t* name)
          Access to certain analysis step by name.
 TCanvas*GetCanvas(const Text_t* name)
          Retrieves a TCanvas by name from the Canvases folder.
 private TGo4DynamicList*GetDynamicList(const Text_t* listname)
           
 Int_tGetDynListInterval()
           
 TGo4EventElement*GetEventStructure(const Text_t* name)
          Search reference to event stucture in folder.
 TH1*GetHistogram(const Text_t* name)
          Search histogram in histogram list (directory).
 TGo4EventElement*GetInputEvent(const char * stepname)
          Returns the input event structure of analysis step.
 TGo4EventElement*GetInputEvent(Int_t stepindex)
          Returns the input event structure of analysis step.
 private const TGo4AnalysisObjectNames*GetNamesList()
          Returns the nameslist of the go4 object directory structure.
 TNamed*GetObject(const Text_t* name, const Text_t* folder)
          Searches for object by name in all directories.
 TFolder*GetObjectFolder()
          Access to top level go4 folder.
 TGo4EventElement*GetOutputEvent(const char * stepname)
          Returns the output event (detector) structure of analysis step.
 TGo4EventElement*GetOutputEvent(Int_t stepindex)
          Returns the output event (detector) structure of analysis step.
 TGo4EventElement*GetOutputEvent()
          Returns the output event (detector) structure of analysis step.
 TGo4Parameter*GetParameter(const Text_t* name)
          Retrieves a parameter object by name from the object folder.
 TGo4Picture*GetPicture(const Text_t* name)
          Retrieves a picture object by name from the object folder.
 TTree*GetTree(const Text_t* name)
          Search tree in tree folder.
 virtual Bool_tInitEventClasses()
          Initialization of the event class plugins which are delivered from
the user defined event factory.
 static TGo4Analysis*Instance()
           
 const Bool_tIsAutoSaveFileChange()
          True if autosave file is changed according to the current input file
of lmd file list.
 const Bool_tIsAutoSaveOn()
          True if autosaving is enabled
 Int_tIsErrorStopEnabled()
          True if current analysis step allows stop on error
 const Bool_tIsInitDone()
          True if the analysis steps are initialized
 const Bool_tIsNewInputFile()
          True if input filelist has changed to a new lmd file.
 Bool_t&IsRunning()
          True if the analysis as controlled by slave process is running.
if no slave task (analysis client) is available, always true
(plain batch mode never stops)
Test: read by reference than copy value, faster?
 Bool_tLoadObjects(const Text_t* filename)
          Load analysis objects from file.
 Bool_tLoadStatus(const Text_t* filename)
          Load Analysis Status from file and set analysis
to these settings.
 Int_tLockAutoSave()
          Lock the autosave mutex.
 Int_tMainCycle()
          The main analysis event cycle.
 voidMessage(Int_t prio, const Text_t* text, ... )
          Display a user message.
 Bool_tNewStepProcessor(const Text_t* name, TGo4EventProcessorParameter* par)
          Shuts down the old analysis step processor and creates a new
one specified by parameter par.
 Bool_tNewStepSource(const Text_t* name, TGo4EventSourceParameter* par)
          Shuts down the old analysis step event source and creates a new
one specified by parameter par.
 Bool_tNewStepStore(const Text_t* name, TGo4EventStoreParameter* par)
          Shuts down the old analysis step storage and creates a new
one specified by parameter par.
 TObject*NextMatchingObject(const Text_t* expr, const Text_t* folder, Bool_t reset)
          Delivers pointer to next object of the Go4 folder structure
with a name matching the expression expr.
 const TGo4AnalysisObjectManager*ObjectManager()
          Add (create) new dynamic histogram entry which connects an existing
histogram with existing condition and data.
 private voidOpenAutoSaveFile()
          Open the autosave file with the current settings.
 Int_tPostLoop()
          Method executed once after the main analysis event loop.
 Int_tPreLoop()
          Method executed once before the main analysis event loop.
 virtual const voidPrint(Option_t* opt)
          Printout the analysis (step-) setup.
 voidPrintConditions(const Text_t* expression)
          Print all condition counters to the terminal.
 voidPrintDynamicList()
          Print entries of current dynamic list.
 voidPrintHistograms(const Text_t* expression)
          Printout of all histogram statistic counters on the terminal.
 Int_tProcess()
          This method is meant to be called from a go4 cintserver macro
in an explicit event loop.
 protected Int_tProcessAnalysisSteps()
          Uses the chain of analysis steps to process the first input
event into an output event which then is accessible at
the output event member.
 Bool_tProtectObjects(const Text_t* name, const Option_t* flags)
          Change protection properties of object name as specified.
 Bool_tRemoveAnalysisCondition(const Text_t* name)
          Removes analysis condition from list by name.
 Bool_tRemoveCanvas(const Text_t* name)
          Removes TCanvas by name.
 Bool_tRemoveDynamicEntry(const Text_t* entryname, const Text_t* listname)
          Remove entry of that name from dynamic list of listname.
 private Bool_tRemoveEventProcessor(TGo4EventProcessor* pro)
          Remove reference to event processor from go4 folder structure.
 private Bool_tRemoveEventSource(TGo4EventSource* source)
          Remove reference to event source from go4 folder structure.
 private Bool_tRemoveEventStore(TGo4EventStore* store)
          Remove reference to event store from go4 folder structure.
 private Bool_tRemoveEventStructure(TGo4EventElement* ev)
          Remove reference to event structure from go4 folder structure.
 Bool_tRemoveHistogram(const Text_t* name, Bool_t del)
          Removes histogram from histogram dir by name.
 Bool_tRemoveObject(const Text_t* name, Bool_t del)
          Removes object from user object folder by name.
 Bool_tRemoveParameter(const Text_t* name)
          Removes parameter by name.
 Bool_tRemovePicture(const Text_t* name)
          Removes picture by name.
 Bool_tRemoveTree(TTree* tree, const Text_t* stepname)
          Remove reference to a tree in the go4 folder structure.
 Bool_tResetBackStores()
          Clear previous events of backstore tree.
 Int_tRunImplicitLoop(Int_t times)
          Processes the UserEventFunc in an implicit loop for "times" times.
 Bool_tSaveStatus(const Text_t* filename)
          Save current analysis settings into file of given name.
 private voidSendMessageToGUI(Int_t level, Bool_t printout, const char * text)
          Send message string in a status object to the gui.
 voidSendObjectToGUI(TNamed* ob)
          User May send any named object via data channel to the gui.
 voidSetAdministratorPassword(const char * passwd)
          Specify password for administrator account.
 private voidSetAnalysisClient(TGo4AnalysisClient* cli)
          Register analysis client if running in gui mode.
 Bool_tSetAnalysisCondition(const Text_t* name, TGo4Condition* con, Bool_t counter)
          Set existing analysis condition of name to the values
of external condition object con.
 voidSetAutoSave(Bool_t on)
          enable/disable functionality of AutoSave method
 voidSetAutoSaveFile(const Text_t* filename, Bool_t overwrite, Int_t compression)
          Set file for autosave action.
 voidSetAutoSaveFileChange(Bool_t on)
          Set analysis in mode where autosave file switches for each new input file
 voidSetAutoSaveInterval(Int_t interval)
          Set time interval (in s) for autosave action.
 Bool_tSetCanvas(const Text_t* name, TGo4CanvasStatus* stat)
          Set existing picture of name to the values
of external CanvasStatus object.
 voidSetControllerPassword(const char * passwd)
          Specify password for controller account.
 Bool_tSetDynamicEntryStatus(const Text_t* name, TGo4DynamicEntryStatus* state, const Text_t* listname)
          Set dynamic entry of name "name" to the values specified by external
dynamic entry status "state".
 voidSetDynListInterval(Int_t val)
           
 Bool_tSetFirstStep(const Text_t* name)
          Sets analysis step name as first one to be processed in
the chain of steps.
 Bool_tSetLastStep(const Text_t* name)
          Sets analysis step name as last one to be processed in
the chain of steps.
 voidSetNewInputFile(Bool_t on)
          Set flag that input file has changed
 voidSetObserverPassword(const char * passwd)
          Specify password for observer account.
 private voidSetOutputEvent(TGo4EventElement* event)
          Sets the current output event (detector) structure.
 Bool_tSetParameter(const Text_t* name, TGo4Parameter* par)
          Set existing parameter of name to the values
of external parameter object par.
 Bool_tSetPicture(const Text_t* name, TGo4Picture* pic)
          Set existing picture of name to the values
of external picture object pic.
 voidSetRunning(Bool_t on)
          Switch slave process into running state.
 voidSetStatus(TGo4AnalysisStatus* state)
          Set all analysis parameters to that of given
status object.
 voidSetStepChecking(Bool_t on)
          Enable or disable check of subsequent analysis step
for io consistency.
 Bool_tSetStepStorage(const Text_t* name, Bool_t on)
          Enables analysis step of name to write its output event into
its event store.
 voidShowEvent(const Text_t* stepname, Bool_t isoutput)
          Printout event content of single current event to analysis terminal
(using ROOT TTree::Show method).
 voidStartObjectServer(const Text_t* basename, const Text_t* passwd)
          Start the object (histogram) server.
 voidStopObjectServer()
          Stop the object (histogram) server.
 voidStopWaiting()
          Called by interrupt routine for normal exit from WaitForStart() function
 Int_tStoreCondition(const Text_t* name, TGo4Condition* con)
          Write condition con into eventstore of the step specified by name.
 Int_tStoreFitter(const Text_t* name, TGo4Fitter* fit)
          Write fitter fit into eventstore of the step specified by name.
 Int_tStoreFolder(const Text_t* stepname, TFolder* folder)
          Write folder into eventstore of the step specified by name.
 Int_tStoreFolder(const Text_t* stepname, const Text_t* foldername)
          Write registered folder of foldername to the step store of stepname.
 Int_tStoreParameter(const Text_t* name, TGo4Parameter* par)
          Write object obj into eventstore of the step specified by name.
 Int_tUnLockAutoSave()
          UnLock the autosave mutex.
 private voidUpdateNamesList()
          Update the internal list of object names.
 voidUpdateStatus(TGo4AnalysisStatus* state)
          Create a copy of the analysis internal state.
 virtual Int_tUserEventFunc()
          User defined function which processes the actual analysis.
 virtual Int_tUserPostLoop()
          User defined function called once after processing the main
event loop.
 virtual Int_tUserPreLoop()
          User defined function called once before processing the main
event loop.
 Int_tWaitForStart()
          Poll on the IsRunning state with sleep delay, returns number
of wait cycles.

Field Detail

fbAutoSaveFileChange

private Bool_t fbAutoSaveFileChange
True if autosave name shall be changed when input file of multiple file input has changed.
To be set in user analysis; will be evaluated in TGo4MbsFile

fbAutoSaveOn

protected Bool_t fbAutoSaveOn
True if Autosaving is enabled (default).
If false, calling AutoSave() will have no effect.

fbAutoSaveOverwrite

private Bool_t fbAutoSaveOverwrite
True if autosave file is in overwrite mode

fbExists

private static Bool_t fbExists
This is used to check from outsid if an analysis is
already there. Useful if one wants to prevent creating
a complete analysis instance in the gui task...

fbInitIsDone

protected Bool_t fbInitIsDone
True if analysis framework has been initialized and
the event classes are created.

fbNewInputFile

private Bool_t fbNewInputFile
True if input file of multiple file input has changed.
User analysis may check this and read mbs buffer infos then.

fbStopWatingFlag

private Bool_t fbStopWatingFlag
used for exit from WaitForStart() routine by interrupt

fgcDEFAULTFILENAME

public const static const Text_t[] fgcDEFAULTFILENAME
standard file name

fgcDEFAULTFILESUF

public const static const Text_t[] fgcDEFAULTFILESUF
filename suffix for object file

fgcDEFAULTSTATUSFILENAME

public const static const Text_t[] fgcDEFAULTSTATUSFILENAME
standard file name for analysis settings

fgcTOPDYNAMICLIST

public const static const Text_t[] fgcTOPDYNAMICLIST
Default name of the default (toplevel) dynamic list

fgiAUTOSAVECOUNTS

public const static const Int_t fgiAUTOSAVECOUNTS
Definition of default autosave interval.

fgiDYNLISTINTERVAL

public const static const Int_t fgiDYNLISTINTERVAL
This value is the number of events in between subsequent dynamic list processing

fgiGO4VERSION

public const static const Int_t fgiGO4VERSION
Version Number of the Go4 build. Number 10000 means Version1.00.00.
Will be compared to the Version number in static Version singleton on runtime.

fgiMACROSTARTPOLL

public const static const Int_t fgiMACROSTARTPOLL
Time in ms to sleep in the polling loop of the WaitForStart

fiAutoSaveCompression

private Int_t fiAutoSaveCompression
compression level for autosave file

fiAutoSaveCount

private Int_t fiAutoSaveCount
Event counter for autosave mechanism.

fiAutoSaveInterval

private Int_t fiAutoSaveInterval
Implicit Loop cycles in between two autosave actions. Autosave will write
calibration objects of steps into event file and will save all histograms into an default
root file.

fxAnalysisSlave

private TGo4AnalysisClient* fxAnalysisSlave
Optional backpointer to analysis client if running in gui mode.

fxAutoFile

private TFile* fxAutoFile
Optional file for autosave of the important objects.

fxAutoFileName

private TString fxAutoFileName
Name of the autosave file.

fxAutoSaveClock

private TStopwatch* fxAutoSaveClock
Clock for autosave by time mechanism.

fxAutoSaveMutex

private TMutex* fxAutoSaveMutex
Mutex protecting the autosave file access. On Termination, both the
main thread and the appcontrol timer might try to autosave or delete on
the same file.

fxConfigFilename

private TString fxConfigFilename
name of configuration file used for this setup

fxDynamicListStatus

private TGo4DynamicListStatus* fxDynamicListStatus
Status object representing the dynamic list (names of
the entries). May be sent to the display.
supplierCardinality 1
link aggregation

fxInstance

private static TGo4Analysis* fxInstance
Static Pointer to the analysis singleton instance.

fxObjectManager

private TGo4AnalysisObjectManager* fxObjectManager
supplierCardinality 1
link aggregationByValue

fxObjectNames

private TGo4AnalysisObjectNames* fxObjectNames
supplierCardinality 1
link aggregation

fxSampleEvent

private TGo4EventElement* fxSampleEvent
this holds event sample for the SingleEventTree. Must be clone
of the event in use, since TTree::Show() will modify it!

fxStepManager

private TGo4AnalysisStepManager* fxStepManager
supplierCardinality 1
link aggregationByValue
Constructor Detail

TGo4Analysis

protected TGo4Analysis()
Protected constructor for singleton instance.
Method Detail

~TGo4Analysis

public virtual synchronized ~TGo4Analysis()
Method Detail

AddAnalysisCondition

public Bool_t AddAnalysisCondition(TGo4Condition* con, const Text_t* subfolder)
Puts a new analysis condition object in corresponding list.
Object is owned by list afterwards. Returns false if object
of that name already exists in list.

AddAnalysisStep

public Bool_t AddAnalysisStep(TGo4AnalysisStep* next)
Method for user analysis constructor to setup the list
of analyisis steps. Each call of this method will add a new
analysis step at the end of the list. Caution: user has to take
care that output and input event types of subsequent steps
are matching! Analysis steps cannot be removed, since the
steplist is not intended to be dynamic. This is a pure creational method.
Analysis steps are owned by the steplist once they have been added.

AddCanvas

public Bool_t AddCanvas(TCanvas* can, const Text_t* subfolder)
Puts a new TCanvas in corresponding folder.
Object is owned by folder afterwards. Returns false if object
of that name already exist.

AddDynamicHistogram

public Bool_t AddDynamicHistogram(const Text_t* name, const Text_t* histo, const Text_t* hevx, const Text_t* hmemx, const Text_t* hevy, const Text_t* hmemy, const Text_t* hevz, const Text_t* hmemz, const Text_t* condition, const Text_t* cevx, const Text_t* cmemx, const Text_t* cevy, const Text_t* cmemy)

AddDynamicHistogram

public Bool_t AddDynamicHistogram(TGo4HistogramEntryStatus* settings)

AddEventProcessor

private Bool_t AddEventProcessor(TGo4EventProcessor* pro)
Add reference to event processor object to Go4 Folder structure.
To be used by framework only!

AddEventSource

private Bool_t AddEventSource(TGo4EventSource* source)
Add reference to event source object to Go4 Folder structure.
To be used by framework only!

AddEventStore

private Bool_t AddEventStore(TGo4EventStore* store)
Add reference to event store object to Go4 Folder structure.
To be used by framework only!

AddEventStructure

private Bool_t AddEventStructure(TGo4EventElement* ev)
Add reference to event structure object to Go4 Folder structure.
To be used by framework only!

AddHistogram

public Bool_t AddHistogram(TH1* his, const Text_t* subfolder, Bool_t replace)
Add external histogram to go4 histogram directory. Histogram will be owned
and streamed by go4 histogram list afterwards.

AddObject

public Bool_t AddObject(TNamed* anything, const Text_t* subfolder, Bool_t replace)
Add any external object to the user object folder.
Object is owned by go4 aferwards and will be saved automatically.
Object is accessible by name from the go4 display and from the
analysis itself. Subfolder of UserObjects may be specified.
If replace is true, old object of same name will be deleted and
replaced by the added one.

AddParameter

public Bool_t AddParameter(TGo4Parameter* par, const Text_t* subfolder)
Puts a new parameter object in corresponding folder.
Object is owned by folder afterwards. Returns false if object
of that name already exists in list.

AddPicture

public Bool_t AddPicture(TGo4Picture* pic, const Text_t* subfolder)
Puts a new picture object in corresponding folder.
Object is owned by folder afterwards. Returns false if object
of that name already exists in list.

AddTree

public Bool_t AddTree(TTree* tree, const Text_t* subfolder)
Add reference to a tree in the go4 folder structure.
If name of subfolder is given, tree will be assigned
to subfolder (e.g. subfolder with analysis step name).
If subfolder name is zero,
the tree will be put into general tree folder.

AddTreeHistogram

public Bool_t AddTreeHistogram(const Text_t* hisname, const Text_t* treename, const Text_t* varexp, TCut selection)
Add Histogram into the dynamic list wich is linked to a tree.
If Histogram of hisname already exists, this histogram will taken.
if not, the histogram will be created on first TTree::Draw.
Strings varexp and selection are used for applying cuts and variables to plot.

AutoSave

public void AutoSave()
Perform autosave of all active stores, save existing calibration objects,
write known objects into user file.

CheckDynListInterval

public Bool_t CheckDynListInterval()

ClearObjects

public Bool_t ClearObjects(const Text_t* name)
Clear (reset) the specified objects. Method will first
clear all objects in any folder if it is matching the namestring.
If no such folder exists, object of name is searched and cleared.
Returns kFALSE in case of not found objects.

CloseAnalysis

public virtual void CloseAnalysis()
Finish the analysis run and close all event sources/storages.
The analysis instance and the setup of the analysis steps is not deleted.

CloseAutoSaveFile

private void CloseAutoSaveFile()
Close the autosave file if existing.

CreateNamesList

public TGo4AnalysisObjectNames* CreateNamesList()
Creates a list of names (keys) of all objects in analysis directories.

CreateObjectStatus

public TGo4ObjectStatus* CreateObjectStatus(const Text_t* name, const Text_t* folder)
Find Object of name in the folder structure
and create a complete status object of it.
Used by GUI command to get updated information on certain object.

CreateSingleEventTree

private TTree* CreateSingleEventTree(const Text_t* name, Bool_t isoutput)
Create a tree that is filled with one single event sample.
Event is taken from analysis step of name. If isoutput
is kTRUE, the output event is used, otherwise the input event.
If no analysis step of that name exists, the event is
searched by object name in the eventstructure folder
of the object manager.

CreateSingleEventTree

private TTree* CreateSingleEventTree(TGo4EventElement* event)
Create a tree that is filled with one single event sample. To be sent to the gui.

CreateStatus

public TGo4AnalysisStatus* CreateStatus()
Create a copy of the analysis internal state.
To be sent to the Display.

CreateTreeStructure

public TGo4TreeStructure* CreateTreeStructure(const Text_t* treename)
Create a tree structure for a certain tree by name

DeleteObjects

public Bool_t DeleteObjects(const Text_t* name)
Delete object of name, or all objects in folder name, respectively.
Objects are only deleted if delete protection is false. Usually,
Objects registered from user code are delete protected by default.
Objects created dynamically from gui are not delete protected.

Exists

public static Bool_t Exists()

GetAnalysisCondition

public TGo4Condition* GetAnalysisCondition(const Text_t* name)
Retrieves an analysis condition from list by name. Returns 0 if no
such condtion.

GetAnalysisStep

public TGo4AnalysisStep* GetAnalysisStep(const Text_t* name)
Access to certain analysis step by name. For analysis internal usage.

GetCanvas

public TCanvas* GetCanvas(const Text_t* name)
Retrieves a TCanvas by name from the Canvases folder.
Returns 0 if no such object.

GetDynamicList

private TGo4DynamicList* GetDynamicList(const Text_t* listname)

GetDynListInterval

public Int_t GetDynListInterval()

GetEventStructure

public TGo4EventElement* GetEventStructure(const Text_t* name)
Search reference to event stucture in folder.

GetHistogram

public TH1* GetHistogram(const Text_t* name)
Search histogram in histogram list (directory).

GetInputEvent

public TGo4EventElement* GetInputEvent(const char * stepname)
Returns the input event structure of analysis step. Argument indicates
the step by name. For internal usage in the user defined event function
UserEventFunc, and is used by analysis steps to get result of previous steps.

GetInputEvent

public TGo4EventElement* GetInputEvent(Int_t stepindex)
Returns the input event structure of analysis step. Argument number indicates
the step from 0 (first) to n (last) in subsequent order.
For internal usage in the user defined event function
UserEventFunc, and is used by analysis steps to access event sources of previous steps.

GetNamesList

private const TGo4AnalysisObjectNames* GetNamesList()
Returns the nameslist of the go4 object directory structure. Is used
by analysis client to send the current object names to the gui.

GetObject

public TNamed* GetObject(const Text_t* name, const Text_t* folder)
Searches for object by name in all directories. Returns
pointer to object. If
object of that name does not exist, null is returned.
Optionally, folder may be specified to search in.

GetObjectFolder

public TFolder* GetObjectFolder()
Access to top level go4 folder. For histogram server.

GetOutputEvent

public TGo4EventElement* GetOutputEvent(const char * stepname)
Returns the output event (detector) structure of analysis step. Argument indicates
the step by name.
For internal usage in the user defined event function
UserEventFunc, and is used by analysis steps to get result of previous steps.

GetOutputEvent

public TGo4EventElement* GetOutputEvent(Int_t stepindex)
Returns the output event (detector) structure of analysis step. Argument number indicates
the step from 0 (first) to n (last) in subsequent
order. Default is the output event of the
currently processed step, which is set by SetEvent method.
For internal usage in the user defined event function
UserEventFunc, and is used by analysis steps to get result of previous steps.

GetOutputEvent

public TGo4EventElement* GetOutputEvent()
Returns the output event (detector) structure of analysis step. Is set by
SetOutputEvent method. For internal usage in the user defined event function
UserEventFunc, and is used by analysis steps to get result of previous steps.

GetParameter

public TGo4Parameter* GetParameter(const Text_t* name)
Retrieves a parameter object by name from the object folder. Returns 0 if no
such paramter.

GetPicture

public TGo4Picture* GetPicture(const Text_t* name)
Retrieves a picture object by name from the object folder.
Returns 0 if no such picture.

GetTree

public TTree* GetTree(const Text_t* name)
Search tree in tree folder.

InitEventClasses

public virtual Bool_t InitEventClasses()
Initialization of the event class plugins which are delivered from
the user defined event factory. The virtual standard base class method may be changed
by overriding; normally, this is not necessary.

Instance

public static TGo4Analysis* Instance()

IsAutoSaveFileChange

public const Bool_t IsAutoSaveFileChange()
True if autosave file is changed according to the current input file
of lmd file list.

IsAutoSaveOn

public const Bool_t IsAutoSaveOn()
True if autosaving is enabled

IsErrorStopEnabled

public Int_t IsErrorStopEnabled()
True if current analysis step allows stop on error

IsInitDone

public const Bool_t IsInitDone()
True if the analysis steps are initialized

IsNewInputFile

public const Bool_t IsNewInputFile()
True if input filelist has changed to a new lmd file.

IsRunning

public Bool_t& IsRunning()
True if the analysis as controlled by slave process is running.
if no slave task (analysis client) is available, always true
(plain batch mode never stops)
Test: read by reference than copy value, faster?

LoadObjects

public Bool_t LoadObjects(const Text_t* filename)
Load analysis objects from file. File is the autosave file by
default, but may be specified by name.

LoadStatus

public Bool_t LoadStatus(const Text_t* filename)
Load Analysis Status from file and set analysis
to these settings.

LockAutoSave

public Int_t LockAutoSave()
Lock the autosave mutex. For usage in analysis client

MainCycle

public Int_t MainCycle()
The main analysis event cycle. This method is called by the
main runnable, or by RunImplicitLoop(). Processes the analysis steps
first, then the user event function. Finally, the dynamic list is updated.

Message

public void Message(Int_t prio, const Text_t* text, ... )
Display a user message. Argument pri defines message priority:
<0: display text as info on local terminal and in logfile anyway, independent of ignorelevel
0: local terminal only; if debug level is enabled (TGo4Log::SetIgnorelevel(0))
1: local terminal and info message in gui log panel (if gui mode)
2: local terminal and warning message in gui log panel (if gui mode)
3: local terminal and error message in gui log panel (if gui mode)

NewStepProcessor

public Bool_t NewStepProcessor(const Text_t* name, TGo4EventProcessorParameter* par)
Shuts down the old analysis step processor and creates a new
one specified by parameter par. To be used in online mode to
switch event processing.

NewStepSource

public Bool_t NewStepSource(const Text_t* name, TGo4EventSourceParameter* par)
Shuts down the old analysis step event source and creates a new
one specified by parameter par. To be used in online mode to
switch input.

NewStepStore

public Bool_t NewStepStore(const Text_t* name, TGo4EventStoreParameter* par)
Shuts down the old analysis step storage and creates a new
one specified by parameter par. To be used in online mode to
switch output files.

NextMatchingObject

public TObject* NextMatchingObject(const Text_t* expr, const Text_t* folder, Bool_t reset)
Delivers pointer to next object of the Go4 folder structure
with a name matching the expression expr. If reset is true,
The list of matchint objects will be created anew by comparing
all names with expr. If reset is false, the next object of a
previously created matching list is returned. Optionally the
search can be limited to a given folder.

ObjectManager

public const TGo4AnalysisObjectManager* ObjectManager()
Add (create) new dynamic histogram entry which connects an existing
histogram with existing condition and data.
Dynamic entry is specified by name. Histogram histo will be searched in
registered histograms folder, condition in conditions folder. If
condition is true or not existing (condition=0), histogram will be filled
from the values that are found in registered eventstructure classes of
names evx, evy, evz at the data members of names memx, memy, memz,
for the three coordinate axes, respectively. Histogram dimension is
checked against given values.

OpenAutoSaveFile

private void OpenAutoSaveFile()
Open the autosave file with the current settings.

PostLoop

public Int_t PostLoop()
Method executed once after the main analysis event loop. This method is called by the thread postrun, or at the end of
RunImplicitLoop(). Calls virtual user postloop function.

PreLoop

public Int_t PreLoop()
Method executed once before the main analysis event loop. This method is called by the thread prerun, or at the beginning of
RunImplicitLoop(). Calls virtual user preloop function.

Print

public virtual const void Print(Option_t* opt)
Printout the analysis (step-) setup.

PrintConditions

public void PrintConditions(const Text_t* expression)
Print all condition counters to the terminal.

PrintDynamicList

public void PrintDynamicList()
Print entries of current dynamic list.

PrintHistograms

public void PrintHistograms(const Text_t* expression)
Printout of all histogram statistic counters on the terminal.

Process

public Int_t Process()
This method is meant to be called from a go4 cintserver macro
in an explicit event loop. It executes any queued commands and calls MainCycle() once, protected
by main go4 lockguard. Returns 0 if analysis has IsRunning() state true;
returns negative value if IsRunning() is false.

ProcessAnalysisSteps

protected Int_t ProcessAnalysisSteps()
Uses the chain of analysis steps to process the first input
event into an output event which then is accessible at
the output event member. Returns number of
steps run. For internal usage in the MainCycle and
GetEvent methods; may also be called from UserEventFunc directly.

ProtectObjects

public Bool_t ProtectObjects(const Text_t* name, const Option_t* flags)
Change protection properties of object name as specified.
If object is a folder, change properties of all objects in this folder recursively.
Flags may contain key letters like:
"+C"/"-C" to enable/disable protection against Clear()(histogram zeroing etc).
"+D"/"-D" to enable/disable protection against object deletion
For example flags="+C-D", "+C+D", "-D-C", "-C"
Properties not appearing in flags are not changed.

RemoveAnalysisCondition

public Bool_t RemoveAnalysisCondition(const Text_t* name)
Removes analysis condition from list by name. Returns 0 if no
such condition. Condition object is deleted on heap.

RemoveCanvas

public Bool_t RemoveCanvas(const Text_t* name)
Removes TCanvas by name. Returns 0 if no
such canvas. TCanvas object is deleted on heap.

RemoveDynamicEntry

public Bool_t RemoveDynamicEntry(const Text_t* entryname, const Text_t* listname)
Remove entry of that name from dynamic list of listname.
The referred objects (histograms, conditions..) are still on heap, since
they are owned by their special folders.

RemoveEventProcessor

private Bool_t RemoveEventProcessor(TGo4EventProcessor* pro)
Remove reference to event processor from go4 folder structure.

RemoveEventSource

private Bool_t RemoveEventSource(TGo4EventSource* source)
Remove reference to event source from go4 folder structure.

RemoveEventStore

private Bool_t RemoveEventStore(TGo4EventStore* store)
Remove reference to event store from go4 folder structure.

RemoveEventStructure

private Bool_t RemoveEventStructure(TGo4EventElement* ev)
Remove reference to event structure from go4 folder structure.

RemoveHistogram

public Bool_t RemoveHistogram(const Text_t* name, Bool_t del)
Removes histogram from histogram dir by name. Returns kFALSE if no
such index. Histogram object is deleted on heap.
Dynamic list entry for that histogram object is also removed.

RemoveObject

public Bool_t RemoveObject(const Text_t* name, Bool_t del)
Removes object from user object folder by name. Returns kFALSE if no
such histogram. Object is deleted on heap only if del is true.
Otherwise, user owns the object afterwords.

RemoveParameter

public Bool_t RemoveParameter(const Text_t* name)
Removes parameter by name. Returns 0 if no
such parameter. Parameter object is deleted on heap.

RemovePicture

public Bool_t RemovePicture(const Text_t* name)
Removes picture by name. Returns 0 if no
such picture. Picture object is deleted on heap.

RemoveTree

public Bool_t RemoveTree(TTree* tree, const Text_t* stepname)
Remove reference to a tree in the go4 folder structure.
If name of analysis step is given, tree will be assigned
to folder dedicated to that step. In stepname is zero,
the tree will be put into general tree folder.

ResetBackStores

public Bool_t ResetBackStores()
Clear previous events of backstore tree. For reset of dynamic tree histogram

RunImplicitLoop

public Int_t RunImplicitLoop(Int_t times)
Processes the UserEventFunc in an implicit loop for "times" times.
For non-threaded usage of the analysis class.

SaveStatus

public Bool_t SaveStatus(const Text_t* filename)
Save current analysis settings into file of given name.

SendMessageToGUI

private void SendMessageToGUI(Int_t level, Bool_t printout, const char * text)
Send message string in a status object to the gui.
Will be displayed in status window. Level indicates info (1), warning (2) or error(3),
if printout is true, message will also be printed on terminal.
In non-GUI mode, this method is equivalent to TGo4Log::Message

SendObjectToGUI

public void SendObjectToGUI(TNamed* ob)
User May send any named object via data channel to the gui.
In batch mode, this method is disabled.

SetAdministratorPassword

public void SetAdministratorPassword(const char * passwd)
Specify password for administrator account. For login from
remote gui into analysis server

SetAnalysisClient

private void SetAnalysisClient(TGo4AnalysisClient* cli)
Register analysis client if running in gui mode.

SetAnalysisCondition

public Bool_t SetAnalysisCondition(const Text_t* name, TGo4Condition* con, Bool_t counter)
Set existing analysis condition of name to the values
of external condition object con. Used to set condition by command
from gui, or to update the precompiled condition from the values
that were saved to the autosave file.

SetAutoSave

public void SetAutoSave(Bool_t on)
enable/disable functionality of AutoSave method

SetAutoSaveFile

public void SetAutoSaveFile(const Text_t* filename, Bool_t overwrite, Int_t compression)
Set file for autosave action.

SetAutoSaveFileChange

public void SetAutoSaveFileChange(Bool_t on)
Set analysis in mode where autosave file switches for each new input file

SetAutoSaveInterval

public void SetAutoSaveInterval(Int_t interval)
Set time interval (in s) for autosave action.

SetCanvas

public Bool_t SetCanvas(const Text_t* name, TGo4CanvasStatus* stat)
Set existing picture of name to the values
of external CanvasStatus object. Used to set TCanvas by command
from gui. Optional parent folder can be specified.
by default, TCanvas is searched relative to Canvases folder.

SetControllerPassword

public void SetControllerPassword(const char * passwd)
Specify password for controller account. For login from
remote gui into analysis server

SetDynamicEntryStatus

public Bool_t SetDynamicEntryStatus(const Text_t* name, TGo4DynamicEntryStatus* state, const Text_t* listname)
Set dynamic entry of name "name" to the values specified by external
dynamic entry status "state". If no dynamic entry of that name exists, a
new entry is created with the properties of the state, and
added to the current dynamic list.

SetDynListInterval

public void SetDynListInterval(Int_t val)

SetFirstStep

public Bool_t SetFirstStep(const Text_t* name)
Sets analysis step name as first one to be processed in
the chain of steps. First step will read input event from its
event source. If name is nullpointer, takes first step in steplist.

SetLastStep

public Bool_t SetLastStep(const Text_t* name)
Sets analysis step name as last one to be processed in
the chain of steps. Last step will write output event into its
event store by default, its output event is accessible in the user
analysis. If name is nullpointer, takes last step in steplist.

SetNewInputFile

public void SetNewInputFile(Bool_t on)
Set flag that input file has changed

SetObserverPassword

public void SetObserverPassword(const char * passwd)
Specify password for observer account. For login from
remote gui into analysis server

SetOutputEvent

private void SetOutputEvent(TGo4EventElement* event)
Sets the current output event (detector) structure.
For internal usage by the chain of analysis steps, since
TGo4AnalysisStep is friend.

SetParameter

public Bool_t SetParameter(const Text_t* name, TGo4Parameter* par)
Set existing parameter of name to the values
of external parameter object par. Used to set parameter by command
from gui, or to update the precompiled parameter from the values
that were saved to the autosave file.

SetPicture

public Bool_t SetPicture(const Text_t* name, TGo4Picture* pic)
Set existing picture of name to the values
of external picture object pic. Used to set picture by command
from gui, or to update the precompiled picture from the values
that were saved to the autosave file.

SetRunning

public void SetRunning(Bool_t on)
Switch slave process into running state. To be used
from analysis macro to start/stop the go4 loop on certain
conditions.

SetStatus

public void SetStatus(TGo4AnalysisStatus* state)
Set all analysis parameters to that of given
status object. Analysis will be stopped,
all steps are closed (deleted). Then analysis
steps are created due to list of analysis step
status objects encapsulated in the analysis status
object. This method does _not_ initialize the
analysis due to the new parameters; this is left
to InitEventClasses.

SetStepChecking

public void SetStepChecking(Bool_t on)
Enable or disable check of subsequent analysis step
for io consistency. Default is on, disable for non
serial type analyses.

SetStepStorage

public Bool_t SetStepStorage(const Text_t* name, Bool_t on)
Enables analysis step of name to write its output event into
its event store. By default only the last analysis step
will keep the output event in the store, the intermediate
steps will only pass the output to the subsequent step.
This method lets also any intermediate step write the
result to its store, which can later be used to process from
this point of the analysis chain. However, you may also
switch off the storage of the last analysis step output
if you only want to use the histograms produced by the
final user event function.

ShowEvent

public void ShowEvent(const Text_t* stepname, Bool_t isoutput)
Printout event content of single current event to analysis terminal
(using ROOT TTree::Show method).
Event is searched by name of analyis step. If isoutput true, then
output event of that step is used, otherwise input event.
If analysis step not found, event of stepname is searched in registered folders.

StartObjectServer

public void StartObjectServer(const Text_t* basename, const Text_t* passwd)
Start the object (histogram) server. Existing server will be stopped and replaced
by new server with different basename and password.

StopObjectServer

public void StopObjectServer()
Stop the object (histogram) server.

StopWaiting

public void StopWaiting()
Called by interrupt routine for normal exit from WaitForStart() function

StoreCondition

public Int_t StoreCondition(const Text_t* name, TGo4Condition* con)
Write condition con into eventstore of the step specified by name.
Current event number will be added to parameter name in the file.
Returns -1 in case of not active eventstore. Returns +1 in case
of unknown step.

StoreFitter

public Int_t StoreFitter(const Text_t* name, TGo4Fitter* fit)
Write fitter fit into eventstore of the step specified by name.
Current event number will be added to parameter name in the file.
Returns -1 in case of not active eventstore. Returns +1 in case
of unknown step.

StoreFolder

public Int_t StoreFolder(const Text_t* stepname, TFolder* folder)
Write folder into eventstore of the step specified by name.
Current event number will be added to parameter name in the file.
Returns -1 in case of not active eventstore. Returns +1 in case
of unknown step.

StoreFolder

public Int_t StoreFolder(const Text_t* stepname, const Text_t* foldername)
Write registered folder of foldername to the step store of stepname.
Returns -1 in case of not active eventstore. Returns +1 in case
of unknown step, +2 in case of unknown folder

StoreParameter

public Int_t StoreParameter(const Text_t* name, TGo4Parameter* par)
Write object obj into eventstore of the step specified by name.
Current event number will be added to object name in the file.
Returns -1 in case of not active eventstore. Returns +1 in case
of unknown step.

UnLockAutoSave

public Int_t UnLockAutoSave()
UnLock the autosave mutex. For usage in analysis client

UpdateNamesList

private void UpdateNamesList()
Update the internal list of object names. To be used internally and by analysis client.

UpdateStatus

public void UpdateStatus(TGo4AnalysisStatus* state)
Create a copy of the analysis internal state. To be sent to the Display.

UserEventFunc

public virtual Int_t UserEventFunc()
User defined function which processes the actual analysis.
May be called explicitely from analysis client thread, or may run
in an implicit loop provided by method RunImplicit, if
analyis works in a non threaded standalone mode. To be overridden
in the user analysis class.

UserPostLoop

public virtual Int_t UserPostLoop()
User defined function called once after processing the main
event loop. Optionally.

UserPreLoop

public virtual Int_t UserPreLoop()
User defined function called once before processing the main
event loop. Optionally.

WaitForStart

public Int_t WaitForStart()
Poll on the IsRunning state with sleep delay, returns number
of wait cycles. For slave server controlled cint macros to
start/stop execution of explicit user loop.

Association Links

to Class TGo4Analysis

Static Pointer to the analysis singleton instance.

to Class TGo4AnalysisClient

Optional backpointer to analysis client if running in gui mode.

to Class TGo4AnalysisStepManager

Supplier Cardinality 1
Type aggregationByValue

to Class TGo4AnalysisObjectManager

Supplier Cardinality 1
Type aggregationByValue

to Class TGo4DynamicListStatus

Status object representing the dynamic list (names of
the entries). May be sent to the display.

Supplier Cardinality 1
Type aggregation

to Class TStopwatch

Clock for autosave by time mechanism.

to Class TMutex

Mutex protecting the autosave file access. On Termination, both the
main thread and the appcontrol timer might try to autosave or delete on
the same file.

to Class TGo4EventElement

this holds event sample for the SingleEventTree. Must be clone
of the event in use, since TTree::Show() will modify it!

to Class TGo4AnalysisObjectNames

Supplier Cardinality 1
Type aggregation

J.Adamczewski, M.Al-Turany, D.Bertini, H.G.Essel, S.Linev

30-06-2005