Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TROOT.h
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Rene Brun 08/12/94
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TROOT
13#define ROOT_TROOT
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TROOT //
19// //
20// The TROOT object is the entry point to the system. //
21// The single instance of TROOT is accessible via the global gROOT. //
22// Using the gROOT pointer one has access to basically every object //
23// created in a ROOT based program. The TROOT object is essentially a //
24// container of several lists pointing to the main ROOT objects. //
25// //
26//////////////////////////////////////////////////////////////////////////
27
28#include "TDirectory.h"
29// #include "TList.h" // included in TDirectory.h
30// #include "RConfigure.h" // included via Rtypes.h
31
32#include <atomic>
33#include <string>
34#include <vector>
35#include <utility>
36
37class TClass;
38class TCanvas;
39class TColor;
40class TDataType;
41class TFile;
42class TStyle;
43class TVirtualPad;
44class TApplication;
45class TInterpreter;
46class TBrowser;
47class TGlobal;
48class TFunction;
49class TFolder;
50class TPluginManager;
51class TProcessUUID;
52class TClassGenerator;
53class TVirtualMutex;
54class TROOT;
56class TListOfEnums;
59class TSeqCollection;
62
64
65namespace ROOT {
66namespace Internal {
67 class TROOTAllocator;
68
69 TROOT *GetROOT2();
70
71 // Manage parallel branch processing
80} } // End ROOT::Internal
81
82namespace ROOT {
83 enum class EIMTConfig {
84 kWholeMachine = 0, ///< Default configuration
85 kExistingTBBArena = 1, ///< Use the existing TBB arena
86 kNumConfigs = 2 ///< Number of support IMT semantic configurations
87 };
88 /// \brief Enable support for multi-threading within the ROOT code
89 /// in particular, enables the global mutex to make ROOT thread safe/aware.
90 void EnableThreadSafety();
91 /// \brief Enable ROOT's implicit multi-threading for all objects and methods that provide an internal
92 /// parallelisation mechanism.
94 /// \brief Enable ROOT's implicit multi-threading for all objects and methods that provide an internal
95 /// parallelisation mechanism.
97 void DisableImplicitMT();
100 namespace Experimental {
104 } // namespace Experimental
105}
106
109} // namespace ROOT::Deprecated::Internal
110
111class TROOT : public TDirectory {
112
113friend class TCling;
116
117private:
118 Int_t fLineIsProcessing = 0; ///< To synchronize multi-threads
119
120 static Int_t fgDirLevel; ///< Indentation level for ls()
121 static Bool_t fgRootInit; ///< Singleton initialization flag
122
123 TROOT(const TROOT&) = delete;
124 TROOT& operator=(const TROOT&) = delete;
125
126protected:
127 typedef std::atomic<TListOfEnums*> AListOfEnums_t;
128
129 TString fConfigOptions; ///< ROOT ./configure set build options
130 TString fConfigFeatures; ///< ROOT ./configure detected build features
131 TString fVersion; ///< ROOT version as TString, example: 0.05.01
132 Int_t fVersionInt = 0; ///< ROOT version in integer format (501)
133 Int_t fVersionCode = 0; ///< ROOT version code as used in RVersion.h
134 Int_t fVersionDate = 0; ///< Date of ROOT version (ex 951226)
135 Int_t fVersionTime = 0; ///< Time of ROOT version (ex 1152)
136 Int_t fBuiltDate = 0; ///< Date of ROOT built
137 Int_t fBuiltTime = 0; ///< Time of ROOT built
138 TString fGitCommit; ///< Git commit SHA1 of built
139 TString fGitBranch; ///< Git branch
140 TString fGitDate; ///< Date and time when make was run
141 Int_t fTimer = 0; ///< Timer flag
142 std::atomic<TApplication*> fApplication = nullptr; ///< Pointer to current application
143 TInterpreter *fInterpreter = nullptr; ///< Command interpreter
144 Bool_t fBatch = true; ///< True if session without graphics
145 TString fWebDisplay; ///< If not empty it defines where web graphics should be rendered (cef, qt6, browser...)
146 Bool_t fIsWebDisplay = false; ///< True if session uses web widgets
147 Bool_t fIsWebDisplayBatch = false; ///< True if web widgets are not displayed
148 Bool_t fEditHistograms = true; ///< True if histograms can be edited with the mouse
149 Bool_t fFromPopUp = true; ///< True if command executed from a popup menu
150 Bool_t fMustClean = true; ///< True if object destructor scans canvases
151 Bool_t fForceStyle = false; ///< Force setting of current style when reading objects
152 Bool_t fInterrupt = false; ///< True if macro should be interrupted
153 Bool_t fEscape = false; ///< True if ESC has been pressed
154 Bool_t fExecutingMacro = false; ///< True while executing a TMacro
155 Int_t fEditorMode = 0; ///< Current Editor mode
156 const TObject *fPrimitive = nullptr; ///< Currently selected primitive
157 TVirtualPad *fSelectPad = nullptr; ///< Currently selected pad
158 TCollection *fClasses = nullptr; ///< List of classes definition
159 TCollection *fTypes = nullptr; ///< List of data types definition
160 TListOfFunctionTemplates *fFuncTemplate = nullptr; ///< List of global function templates
161 TListOfDataMembers*fGlobals = nullptr; ///< List of global variables
162 TListOfFunctions*fGlobalFunctions = nullptr; ///< List of global functions
163 TSeqCollection *fClosedObjects = nullptr; ///< List of closed objects from the list of files and sockets, so we can delete them if neededCl.
164 TSeqCollection *fFiles = nullptr; ///< List of files
165 TSeqCollection *fMappedFiles = nullptr; ///< List of memory mapped files
166 TSeqCollection *fSockets = nullptr; ///< List of network sockets
167 TSeqCollection *fCanvases = nullptr; ///< List of canvases
168 TSeqCollection *fStyles = nullptr; ///< List of styles
169 TCollection *fFunctions = nullptr; ///< List of analytic functions
170 TSeqCollection *fTasks = nullptr; ///< List of tasks
171 TSeqCollection *fColors = nullptr; ///< List of colors
172 TSeqCollection *fGeometries = nullptr; ///< List of geometries
173 TSeqCollection *fBrowsers = nullptr; ///< List of browsers
174 TSeqCollection *fSpecials = nullptr; ///< List of special objects
175 TSeqCollection *fCleanups = nullptr; ///< List of recursiveRemove collections
176 TSeqCollection *fMessageHandlers = nullptr; ///< List of message handlers
177 TSeqCollection *fStreamerInfo = nullptr; ///< List of active StreamerInfo classes
178 TCollection *fClassGenerators = nullptr; ///< List of user defined class generators;
179 TSeqCollection *fSecContexts = nullptr; ///< List of security contexts (TSecContext)
180 TSeqCollection *fClipboard = nullptr; ///< List of clipboard objects
181 TSeqCollection *fDataSets = nullptr; ///< List of data sets (TDSet or TChain)
182 AListOfEnums_t fEnums = nullptr; ///< List of enum types
183 TProcessUUID *fUUIDs = nullptr; ///< Pointer to TProcessID managing TUUIDs
184 TFolder *fRootFolder = nullptr; ///< top level folder //root
185 TList *fBrowsables = nullptr; ///< List of browsables
186 TPluginManager *fPluginManager = nullptr; ///< Keeps track of plugin library handlers
187 TString fCutClassName; ///< Name of default CutG class in graphics editor
188 TString fDefCanvasName; ///< Name of default canvas
189
190 TROOT(); ///< Only used by Dictionary
191 void InitSystem(); ///< Operating System interface
192 void InitThreads(); ///< Initialize threads library
193 void InitInterpreter(); ///< Initialize interpreter (cling)
194 void ReadGitInfo(); ///< Read Git commit SHA1 and branch name
195 void *operator new(size_t l) { return TObject::operator new(l); }
196 void *operator new(size_t l, void *ptr) { return TObject::operator new(l,ptr); }
197
198 friend class ::ROOT::Internal::TROOTAllocator;
199
201
202public:
203
204 typedef std::vector<std::pair<std::string, int> > FwdDeclArgsToKeepCollection_t;
205
206 TROOT(const char *name, const char *title, VoidFuncPtr_t *initfunc = nullptr);
207 virtual ~TROOT();
208 void AddClass(TClass *cl);
210 void Append(TObject *obj, Bool_t replace = kFALSE) override;
211 void Browse(TBrowser *b) override;
213 void CloseFiles();
215 TObject *FindObject(const char *name) const override;
216 TObject *FindObject(const TObject *obj) const override;
217 TObject *FindObjectAny(const char *name) const override;
218 TObject *FindObjectAnyFile(const char *name) const override;
219 TObject *FindSpecialObject(const char *name, void *&where);
220 const char *FindObjectClassName(const char *name) const;
221 const char *FindObjectPathName(const TObject *obj) const;
222 TClass *FindSTLClass(const char *name, Bool_t load, Bool_t silent = kFALSE) const;
224 Bool_t FromPopUp() const { return fFromPopUp; }
228 TClass *GetClass(const char *name, Bool_t load = kTRUE, Bool_t silent = kFALSE) const;
229 TClass *GetClass(const std::type_info &typeinfo, Bool_t load = kTRUE, Bool_t silent = kFALSE) const;
230 TColor *GetColor(Int_t color) const;
231 const char *GetConfigOptions() const { return fConfigOptions; }
232 const char *GetConfigFeatures() const { return fConfigFeatures; }
233 const char *GetCutClassName() const { return fCutClassName; }
234 const char *GetDefCanvasName() const { return fDefCanvasName; }
236 Int_t GetEditorMode() const { return fEditorMode; }
237 Bool_t GetForceStyle() const { return fForceStyle; }
238 Int_t GetBuiltDate() const { return fBuiltDate; }
239 Int_t GetBuiltTime() const { return fBuiltTime; }
240 const char *GetGitCommit() const { return fGitCommit; }
241 const char *GetGitBranch() const { return fGitBranch; }
242 const char *GetGitDate();
245 Int_t GetVersionInt() const { return fVersionInt; }
247 const char *GetVersion() const { return fVersion; }
260 TCollection *GetListOfFunctionOverloads(const char* name) const;
270 R__DEPRECATED(6, 42, "GetListOfSecContexts is deprecated. See README.AUTH for details.")
277 TDataType *GetType(const char *name, Bool_t load = kFALSE) const;
278 TFile *GetFile() const override { if (gDirectory && gDirectory != this) return gDirectory->GetFile(); else return nullptr;}
279 TFile *GetFile(const char *name) const;
281 TStyle *GetStyle(const char *name) const;
282 TObject *GetFunction(const char *name) const;
283 TGlobal *GetGlobal(const char *name, Bool_t load = kFALSE) const;
284 TGlobal *GetGlobal(const TObject *obj, Bool_t load = kFALSE) const;
285 TFunction *GetGlobalFunction(const char *name, const char *params = nullptr, Bool_t load = kFALSE);
286 TFunction *GetGlobalFunctionWithPrototype(const char *name, const char *proto = nullptr, Bool_t load = kFALSE);
287 TObject *GetGeometry(const char *name) const;
288 const TObject *GetSelectedPrimitive() const { return fPrimitive; }
290 Int_t GetNclasses() const;
291 Int_t GetNtypes() const;
292 TFolder *GetRootFolder() const { return fRootFolder; }
293 TProcessUUID *GetUUIDs() const { return fUUIDs; }
294 const TString &GetWebDisplay() const { return fWebDisplay; }
295 void Idle(UInt_t idleTimeInSec, const char *command = nullptr);
296 Int_t IgnoreInclude(const char *fname, const char *expandedfname);
297 Bool_t IsBatch() const { return fBatch; }
299 Bool_t IsFolder() const override { return kTRUE; }
300 Bool_t IsInterrupted() const { return fInterrupt; }
301 Bool_t IsEscaped() const { return fEscape; }
303 Bool_t IsRootFile(const char *filename) const;
306 void ls(Option_t *option = "") const override;
307 Int_t LoadClass(const char *classname, const char *libname, Bool_t check = kFALSE);
308 TClass *LoadClass(const char *name, Bool_t silent = kFALSE) const;
309 Int_t LoadMacro(const char *filename, Int_t *error = nullptr, Bool_t check = kFALSE);
310 Longptr_t Macro(const char *filename, Int_t *error = nullptr, Bool_t padUpdate = kTRUE);
311 TCanvas *MakeDefCanvas() const;
312 void Message(Int_t id, const TObject *obj);
313 Bool_t MustClean() const { return fMustClean; }
314 Longptr_t ProcessLine(const char *line, Int_t *error = nullptr);
315 Longptr_t ProcessLineSync(const char *line, Int_t *error = nullptr);
316 Longptr_t ProcessLineFast(const char *line, Int_t *error = nullptr);
317 Bool_t ReadingObject() const;
318 void RecursiveRemove(TObject *obj) override;
319 void RefreshBrowsers();
320 static void RegisterModule(const char* modulename,
321 const char** headers,
322 const char** includePaths,
323 const char* payLoadCode,
324 const char* fwdDeclCode,
325 void (*triggerFunc)(),
327 const char** classesHeaders,
328 bool hasCxxModule = false);
329 TObject *Remove(TObject*) override;
330 void RemoveClass(TClass *);
331 void Reset(Option_t *option="");
332 void ResetClassSaved();
333 void SaveContext();
335 void SetBatch(Bool_t batch = kTRUE);
336 void SetWebDisplay(const char *webdisplay = "");
337 void SetCutClassName(const char *name = "TCutG");
338 void SetDefCanvasName(const char *name = "c1") { fDefCanvasName = name; }
340 void SetEditorMode(const char *mode = "");
349 void SetSelectedPrimitive(const TObject *obj) { fPrimitive = obj; }
351 void SetStyle(const char *stylename = "Default");
353 Int_t Timer() const { return fTimer; }
354
355 //---- static functions
356 static Int_t DecreaseDirLevel();
357 static Int_t GetDirLevel();
358 static const char *GetMacroPath();
359 static void SetMacroPath(const char *newpath);
360 static Int_t IncreaseDirLevel();
361 static void IndentLevel();
362 static void Initialize();
363 static Bool_t Initialized();
364 static void SetDirLevel(Int_t level = 0);
367 static Int_t RootVersionCode();
368 static const std::vector<std::string> &AddExtraInterpreterArgs(const std::vector<std::string> &args);
369 static const char**&GetExtraInterpreterArgs();
370
371 static const TString& GetRootSys();
372 static const TString& GetBinDir();
373 static const TString& GetLibDir();
374 static const TString& GetSharedLibDir();
375 static const TString& GetIncludeDir();
376 static const TString& GetEtcDir();
377 static const TString& GetDataDir();
378 static const TString& GetDocDir();
379 static const TString& GetMacroDir();
380 static const TString& GetTutorialDir();
381 static const TString &GetSourceDir()
382 R__DEPRECATED(6, 42,
383 "This function is removed because it made only sense in the corner case where the ROOT source is "
384 "copied inside the ROOT installation, which is never the case unless the user does it by hand.");
387
388 // Backward compatibility function - do not use for new code
390 static void ShutDown();
391
392 ClassDefOverride(TROOT,0) //Top level (or root) structure for all classes
393};
394
395
397 TROOT *GetROOT();
398 namespace Internal {
400
401 inline void SetRequireCleanup(TObject &obj) {
403 obj.SetUniqueID(0);
404 }
405
407 return obj.TestBit(kIsReferenced) && obj.GetUniqueID() == 0;
408 }
409 }
410
411 /// \brief call RecursiveRemove for obj if gROOT is valid
412 /// and obj.TestBit(kMustCleanup) is true.
413 /// Note: this reset the kMustCleanup bit to allow
414 /// harmless multiple call to this function.
416 {
417 if (obj.TestBit(kMustCleanup)) {
419 if (root && root != &obj && (root->MustClean() || Internal::RequiresCleanup(obj))) {
420 root->RecursiveRemove(&obj);
422 }
423 }
424 }
425}
426#define gROOT (ROOT::GetROOT())
427
428#endif
#define R__EXTERN
Definition DllImport.h:26
#define b(i)
Definition RSha256.hxx:100
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
void(* VoidFuncPtr_t)()
Definition Rtypes.h:85
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define gDirectory
Definition TDirectory.h:385
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char mode
char name[80]
Definition TGX11.cxx:148
@ kIsReferenced
Definition TObject.h:378
R__EXTERN TVirtualMutex * gROOTMutex
Definition TROOT.h:63
const char * proto
Definition civetweb.c:18822
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
The Canvas class.
Definition TCanvas.h:23
Objects following this interface can be passed onto the TROOT object to implement a user customized w...
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
This class defines an interface to the cling C++ interpreter.
Definition TCling.h:102
Collection abstract base class.
Definition TCollection.h:65
The color creation and management class.
Definition TColor.h:22
Basic data type descriptor (datatype information is obtained from CINT).
Definition TDataType.h:44
TFile * GetFile() const override
Describe directory structure in memory.
Definition TDirectory.h:45
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Definition TFile.h:130
<div class="legacybox"><h2>Legacy Code</h2> TFolder is a legacy interface: there will be no bug fixes...
Definition TFolder.h:30
Dictionary for function template This class describes one single function template.
Global functions class (global functions are obtained from CINT).
Definition TFunction.h:30
Global variables class (global variables are obtained from CINT).
Definition TGlobal.h:28
This class defines an abstract interface to a generic command line interpreter.
A collection of TDataMember objects designed for fast access given a DeclId_t and for keep track of T...
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
A doubly linked list.
Definition TList.h:38
Mother of all ROOT objects.
Definition TObject.h:42
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:204
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition TObject.cxx:477
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:885
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition TObject.cxx:896
void ResetBit(UInt_t f)
Definition TObject.h:203
@ kMustCleanup
if object destructor must call RecursiveRemove()
Definition TObject.h:73
This class implements a plugin library manager.
This class is a specialized TProcessID managing the list of UUIDs.
ROOT top level object description.
Definition TROOT.h:111
void SetApplication(TApplication *app)
Definition TROOT.h:334
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
Definition TROOT.cxx:3053
Int_t GetVersionInt() const
Definition TROOT.h:245
const char * GetConfigFeatures() const
Definition TROOT.h:232
TSeqCollection * GetListOfCleanups() const
Definition TROOT.h:265
void Time(Int_t casetime=1)
Definition TROOT.h:352
Int_t IgnoreInclude(const char *fname, const char *expandedfname)
Return 1 if the name of the given include file corresponds to a class that is known to ROOT,...
Definition TROOT.cxx:2084
Int_t fVersionCode
ROOT version code as used in RVersion.h.
Definition TROOT.h:133
const char * GetDefCanvasName() const
Definition TROOT.h:234
Bool_t IsInterrupted() const
Definition TROOT.h:300
const TString & GetWebDisplay() const
Definition TROOT.h:294
TCollection * GetListOfClasses() const
Definition TROOT.h:248
void Message(Int_t id, const TObject *obj)
Process message id called by obj.
Definition TROOT.cxx:2512
void RemoveClass(TClass *)
Remove a class from the list and map of classes.
Definition TROOT.cxx:2792
TCollection * fClassGenerators
List of user defined class generators;.
Definition TROOT.h:178
TROOT()
Only used by Dictionary.
Definition TROOT.cxx:790
void SetCutClassName(const char *name="TCutG")
Set the default graphical cut class name for the graphics editor By default the graphics editor creat...
Definition TROOT.cxx:2847
TSeqCollection * fCanvases
List of canvases.
Definition TROOT.h:167
TObject * FindObjectAnyFile(const char *name) const override
Scan the memory lists of all files for an object with name.
Definition TROOT.cxx:1592
const TObject * fPrimitive
Currently selected primitive.
Definition TROOT.h:156
void SetWebDisplay(const char *webdisplay="")
Specify where web graphics shall be rendered.
Definition TROOT.cxx:2997
Bool_t fIsWebDisplay
True if session uses web widgets.
Definition TROOT.h:146
TFolder * fRootFolder
top level folder //root
Definition TROOT.h:184
void AddClassGenerator(TClassGenerator *gen)
Add a class generator.
Definition TROOT.cxx:1191
const char * GetCutClassName() const
Definition TROOT.h:233
Int_t GetBuiltTime() const
Definition TROOT.h:239
void SetFromPopUp(Bool_t flag=kTRUE)
Definition TROOT.h:342
TSeqCollection * fGeometries
List of geometries.
Definition TROOT.h:172
TString fCutClassName
Name of default CutG class in graphics editor.
Definition TROOT.h:187
TInterpreter * fInterpreter
Command interpreter.
Definition TROOT.h:143
TSeqCollection * GetListOfMessageHandlers() const
Definition TROOT.h:267
std::vector< std::pair< std::string, int > > FwdDeclArgsToKeepCollection_t
Definition TROOT.h:204
Int_t fVersionTime
Time of ROOT version (ex 1152)
Definition TROOT.h:135
void SetLineIsProcessing()
Definition TROOT.h:345
void SetMustClean(Bool_t flag=kTRUE)
Definition TROOT.h:348
void EndOfProcessCleanups()
Execute the cleanups necessary at the end of the process, in particular those that must be executed b...
Definition TROOT.cxx:1404
Bool_t fBatch
True if session without graphics.
Definition TROOT.h:144
Bool_t IsWebDisplayBatch() const
Definition TROOT.h:305
TSeqCollection * GetListOfFiles() const
Definition TROOT.h:254
Bool_t fEscape
True if ESC has been pressed.
Definition TROOT.h:153
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition TROOT.cxx:3159
TSeqCollection * GetListOfSockets() const
Definition TROOT.h:256
Int_t fVersionInt
ROOT version in integer format (501)
Definition TROOT.h:132
static const TString & GetIncludeDir()
Get the include directory in the installation. Static utility function.
Definition TROOT.cxx:3356
Bool_t fFromPopUp
True if command executed from a popup menu.
Definition TROOT.h:149
void Idle(UInt_t idleTimeInSec, const char *command=nullptr)
Execute command when system has been idle for idleTimeInSec seconds.
Definition TROOT.cxx:2048
TSeqCollection * fSockets
List of network sockets.
Definition TROOT.h:166
void ls(Option_t *option="") const override
To list all objects of the application.
Definition TROOT.cxx:2412
Bool_t IsEscaped() const
Definition TROOT.h:301
static const char * GetMacroPath()
Get macro search path. Static utility function.
Definition TROOT.cxx:2926
TCollection * fFunctions
List of analytic functions.
Definition TROOT.h:169
Int_t GetVersionDate() const
Definition TROOT.h:243
void SaveContext()
Save the current interpreter context.
Definition TROOT.cxx:2835
TCollection * GetListOfClassGenerators() const
Definition TROOT.h:268
Bool_t IsExecutingMacro() const
Definition TROOT.h:298
TDataType * GetType(const char *name, Bool_t load=kFALSE) const
Return pointer to type with name.
Definition TROOT.cxx:1718
TSeqCollection GetListOfSecContexts is deprecated See README AUTH for details
Definition TROOT.h:271
static void Initialize()
Initialize ROOT explicitly.
Definition TROOT.cxx:3069
static void ShutDown()
Shut down ROOT.
Definition TROOT.cxx:3474
TObject * GetFunction(const char *name) const
Return pointer to function with name.
Definition TROOT.cxx:1743
static Int_t ConvertVersionCode2Int(Int_t code)
Convert version code to an integer, i.e. 331527 -> 51507.
Definition TROOT.cxx:3092
TSeqCollection * fMessageHandlers
List of message handlers.
Definition TROOT.h:176
static const TString & GetSourceDir() R__DEPRECATED(6
Get the source directory in the installation. Static utility function.
Definition TROOT.cxx:3485
void SetStyle(const char *stylename="Default")
Change current style to style with name stylename.
Definition TROOT.cxx:2894
TSeqCollection * GetListOfMappedFiles() const
Definition TROOT.h:255
void SetEditHistograms(Bool_t flag=kTRUE)
Definition TROOT.h:339
AListOfEnums_t fEnums
List of enum types.
Definition TROOT.h:182
void ReadGitInfo()
Read Git commit SHA1 and branch name.
Definition TROOT.cxx:2591
void ForceStyle(Bool_t force=kTRUE)
Definition TROOT.h:223
static Bool_t fgRootInit
Singleton initialization flag.
Definition TROOT.h:121
void RefreshBrowsers()
Refresh all browsers.
Definition TROOT.cxx:2674
void CloseFiles()
Close any files and sockets that gROOT knows about.
Definition TROOT.cxx:1324
const char * GetVersion() const
Definition TROOT.h:247
std::atomic< TApplication * > fApplication
Pointer to current application.
Definition TROOT.h:142
const char * FindObjectPathName(const TObject *obj) const
Return path name of obj somewhere in the //root/... path.
Definition TROOT.cxx:1629
static Int_t ConvertVersionInt2Code(Int_t v)
Convert version as an integer to version code as used in RVersion.h.
Definition TROOT.cxx:3100
void ResetClassSaved()
Reset the ClassSaved status of all classes.
Definition TROOT.cxx:1252
static const TString & GetTTFFontDir()
Get the fonts directory in the installation. Static utility function.
Definition TROOT.cxx:3527
const char * GetGitBranch() const
Definition TROOT.h:241
Bool_t fForceStyle
Force setting of current style when reading objects.
Definition TROOT.h:151
Bool_t FromPopUp() const
Definition TROOT.h:224
const TObject * GetSelectedPrimitive() const
Definition TROOT.h:288
TCanvas * MakeDefCanvas() const
Return a default canvas.
Definition TROOT.cxx:1710
TCollection * fTypes
List of data types definition.
Definition TROOT.h:159
TColor * GetColor(Int_t color) const
Return address of color with index color.
Definition TROOT.cxx:1692
Bool_t IsLineProcessing() const
Definition TROOT.h:302
TGlobal * GetGlobal(const char *name, Bool_t load=kFALSE) const
Return pointer to global variable by name.
Definition TROOT.cxx:1787
TSeqCollection * GetListOfSecContexts() const R__DEPRECATED(6
TClass * FindSTLClass(const char *name, Bool_t load, Bool_t silent=kFALSE) const
return a TClass object corresponding to 'name' assuming it is an STL container.
Definition TROOT.cxx:1640
TSeqCollection * fStreamerInfo
List of active StreamerInfo classes.
Definition TROOT.h:177
void Append(TObject *obj, Bool_t replace=kFALSE) override
Append object to this directory.
Definition TROOT.cxx:1203
static const TString & GetIconPath()
Get the icon path in the installation. Static utility function.
Definition TROOT.cxx:3506
TSeqCollection * GetListOfCanvases() const
Definition TROOT.h:257
std::atomic< TListOfEnums * > AListOfEnums_t
Definition TROOT.h:127
TCollection * GetListOfGlobalFunctions(Bool_t load=kFALSE)
Return list containing the TFunctions currently defined.
Definition TROOT.cxx:1982
TString fGitDate
Date and time when make was run.
Definition TROOT.h:140
TSeqCollection * fSpecials
List of special objects.
Definition TROOT.h:174
TCollection * GetListOfFunctionTemplates()
Definition TROOT.cxx:1927
void SetExecutingMacro(Bool_t flag=kTRUE)
Definition TROOT.h:341
static void RegisterModule(const char *modulename, const char **headers, const char **includePaths, const char *payLoadCode, const char *fwdDeclCode, void(*triggerFunc)(), const FwdDeclArgsToKeepCollection_t &fwdDeclsArgToSkip, const char **classesHeaders, bool hasCxxModule=false)
Called by static dictionary initialization to register clang modules for headers.
Definition TROOT.cxx:2699
TObject * FindObject(const char *name) const override
Returns address of a ROOT object if it exists.
Definition TROOT.cxx:1469
TCollection * fClasses
List of classes definition.
Definition TROOT.h:158
void SetInterrupt(Bool_t flag=kTRUE)
Definition TROOT.h:343
Bool_t fEditHistograms
True if histograms can be edited with the mouse.
Definition TROOT.h:148
TListOfDataMembers * fGlobals
List of global variables.
Definition TROOT.h:161
TListOfFunctionTemplates * fFuncTemplate
List of global function templates.
Definition TROOT.h:160
TSeqCollection * GetClipboard() const
Definition TROOT.h:272
Int_t fTimer
Timer flag.
Definition TROOT.h:141
TSeqCollection * fDataSets
List of data sets (TDSet or TChain)
Definition TROOT.h:181
TString fConfigOptions
ROOT ./configure set build options.
Definition TROOT.h:129
TStyle * GetStyle(const char *name) const
Return pointer to style with name.
Definition TROOT.cxx:1735
TCollection * GetListOfEnums(Bool_t load=kFALSE)
Definition TROOT.cxx:1910
Longptr_t ProcessLineSync(const char *line, Int_t *error=nullptr)
Process interpreter command via TApplication::ProcessLine().
Definition TROOT.cxx:2552
void InitInterpreter()
Initialize interpreter (cling)
Definition TROOT.cxx:2223
TCollection * GetListOfGlobals(Bool_t load=kFALSE)
Return list containing the TGlobals currently defined.
Definition TROOT.cxx:1944
TVirtualPad * GetSelectedPad() const
Definition TROOT.h:289
static void SetDirLevel(Int_t level=0)
Return Indentation level for ls().
Definition TROOT.cxx:3084
TSeqCollection * fSecContexts
List of security contexts (TSecContext)
Definition TROOT.h:179
TString fWebDisplay
If not empty it defines where web graphics should be rendered (cef, qt6, browser.....
Definition TROOT.h:145
static const char * GetTutorialsDir()
Get the tutorials directory in the installation.
Definition TROOT.cxx:3549
TCollection * GetListOfFunctionOverloads(const char *name) const
Return the collection of functions named "name".
Definition TROOT.cxx:1828
TSeqCollection * fCleanups
List of recursiveRemove collections.
Definition TROOT.h:175
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
Definition TROOT.cxx:3076
TApplication * GetApplication() const
Definition TROOT.h:226
void SetBatch(Bool_t batch=kTRUE)
Set batch mode for ROOT If the argument evaluates to true, the session does not use interactive graph...
Definition TROOT.cxx:2968
Int_t fLineIsProcessing
To synchronize multi-threads.
Definition TROOT.h:118
Int_t Timer() const
Definition TROOT.h:353
static const TString & GetMacroDir()
Get the macro directory in the installation. Static utility function.
Definition TROOT.cxx:3432
TString fGitCommit
Git commit SHA1 of built.
Definition TROOT.h:138
Longptr_t ProcessLine(const char *line, Int_t *error=nullptr)
Process interpreter command via TApplication::ProcessLine().
Definition TROOT.cxx:2532
TSeqCollection * fClosedObjects
List of closed objects from the list of files and sockets, so we can delete them if neededCl.
Definition TROOT.h:163
TSeqCollection * fTasks
List of tasks.
Definition TROOT.h:170
TSeqCollection * fClipboard
List of clipboard objects.
Definition TROOT.h:180
const char * GetGitDate()
Return date/time make was run.
Definition TROOT.cxx:2636
TProcessUUID * GetUUIDs() const
Definition TROOT.h:293
void SetEditorMode(const char *mode="")
Set editor mode.
Definition TROOT.cxx:2868
TSeqCollection * GetListOfStreamerInfo() const
Definition TROOT.h:266
static const TString & GetTutorialDir()
Get the tutorials directory in the installation. Static utility function.
Definition TROOT.cxx:3453
virtual ~TROOT()
Clean up and free resources used by ROOT (files, network sockets, shared memory segments,...
Definition TROOT.cxx:1025
TSeqCollection * fColors
List of colors.
Definition TROOT.h:171
Int_t GetBuiltDate() const
Definition TROOT.h:238
TCollection * GetListOfFunctions() const
Definition TROOT.h:259
TFunction * GetGlobalFunctionWithPrototype(const char *name, const char *proto=nullptr, Bool_t load=kFALSE)
Return pointer to global function by name.
Definition TROOT.cxx:1874
Bool_t GetForceStyle() const
Definition TROOT.h:237
TFolder * GetRootFolder() const
Definition TROOT.h:292
TSeqCollection * GetListOfBrowsers() const
Definition TROOT.h:262
Bool_t ReadingObject() const
Deprecated (will be removed in next release).
Definition TROOT.cxx:2622
TSeqCollection * fStyles
List of styles.
Definition TROOT.h:168
Bool_t GetEditHistograms() const
Definition TROOT.h:235
Int_t fVersionDate
Date of ROOT version (ex 951226)
Definition TROOT.h:134
TSeqCollection * GetListOfColors() const
Definition TROOT.h:249
Longptr_t Macro(const char *filename, Int_t *error=nullptr, Bool_t padUpdate=kTRUE)
Execute a macro in the interpreter.
Definition TROOT.cxx:2478
Int_t fBuiltTime
Time of ROOT built.
Definition TROOT.h:137
static const std::vector< std::string > & AddExtraInterpreterArgs(const std::vector< std::string > &args)
Provide command line arguments to the interpreter construction.
Definition TROOT.cxx:3122
void SetLineHasBeenProcessed()
Definition TROOT.h:346
TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE) const
Return pointer to class with name. Obsolete, use TClass::GetClass directly.
Definition TROOT.cxx:1674
TVirtualPad * fSelectPad
Currently selected pad.
Definition TROOT.h:157
TSeqCollection * fFiles
List of files.
Definition TROOT.h:164
void Browse(TBrowser *b) override
Add browsable objects to TBrowser.
Definition TROOT.cxx:1212
static const TString & GetRootSys()
Get the rootsys directory in the installation. Static utility function.
Definition TROOT.cxx:3149
TListOfFunctions * GetGlobalFunctions()
Internal routine returning, and creating if necessary, the list of global function.
Definition TROOT.cxx:1819
Bool_t fInterrupt
True if macro should be interrupted.
Definition TROOT.h:152
Bool_t fMustClean
True if object destructor scans canvases.
Definition TROOT.h:150
Int_t LoadClass(const char *classname, const char *libname, Bool_t check=kFALSE)
Check if class "classname" is known to the interpreter (in fact, this check is not needed anymore,...
Definition TROOT.cxx:2342
TFunction * GetGlobalFunction(const char *name, const char *params=nullptr, Bool_t load=kFALSE)
Return pointer to global function by name.
Definition TROOT.cxx:1841
void AddClass(TClass *cl)
Add a class to the list and map of classes.
Definition TROOT.cxx:1181
static Int_t RootVersionCode()
Return ROOT version code as defined in RVersion.h.
Definition TROOT.cxx:3111
TObject * FindSpecialObject(const char *name, void *&where)
Returns address and folder of a ROOT object if it exists.
Definition TROOT.cxx:1523
TObject * Remove(TObject *) override
Remove an object from the in-memory list.
Definition TROOT.cxx:2782
void InitSystem()
Operating System interface.
Definition TROOT.cxx:2134
Longptr_t ProcessLineFast(const char *line, Int_t *error=nullptr)
Process interpreter command directly via CINT interpreter.
Definition TROOT.cxx:2569
Int_t GetEditorMode() const
Definition TROOT.h:236
Bool_t ClassSaved(TClass *cl)
return class status 'ClassSaved' for class cl This function is called by the SavePrimitive functions ...
Definition TROOT.cxx:1239
const char * GetGitCommit() const
Definition TROOT.h:240
TString fGitBranch
Git branch.
Definition TROOT.h:139
static const TString This function is removed because it made only sense in the corner case where the ROOT source is copied inside the ROOT installation
Definition TROOT.h:382
TCollection * GetListOfTypes(Bool_t load=kFALSE)
Return a dynamic list giving access to all TDataTypes (typedefs) currently defined.
Definition TROOT.cxx:2021
static Int_t fgDirLevel
Indentation level for ls()
Definition TROOT.h:120
TSeqCollection * GetListOfTasks() const
Definition TROOT.h:264
Bool_t IsBatch() const
Definition TROOT.h:297
Bool_t IsRootFile(const char *filename) const
Return true if the file is local and is (likely) to be a ROOT file.
Definition TROOT.cxx:2392
Bool_t IsWebDisplay() const
Definition TROOT.h:304
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition TROOT.cxx:3061
Int_t GetVersionTime() const
Definition TROOT.h:244
static const TString & GetDocDir()
Get the documentation directory in the installation. Static utility function.
Definition TROOT.cxx:3416
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
Definition TROOT.cxx:3390
TROOT(const TROOT &)=delete
Int_t GetNclasses() const
Get number of classes.
Definition TROOT.cxx:2032
static const char **& GetExtraInterpreterArgs()
INTERNAL function! Used by rootcling to inject interpreter arguments through a C-interface layer.
Definition TROOT.cxx:3132
static void SetMacroPath(const char *newpath)
Set or extend the macro search path.
Definition TROOT.cxx:2952
void SetSelectedPad(TVirtualPad *pad)
Definition TROOT.h:350
void InitThreads()
Initialize threads library.
Definition TROOT.cxx:2211
TProcessUUID * fUUIDs
Pointer to TProcessID managing TUUIDs.
Definition TROOT.h:183
TString fConfigFeatures
ROOT ./configure detected build features.
Definition TROOT.h:130
TFunctionTemplate * GetFunctionTemplate(const char *name)
Definition TROOT.cxx:1774
TPluginManager * fPluginManager
Keeps track of plugin library handlers.
Definition TROOT.h:186
TObject * GetGeometry(const char *name) const
Return pointer to Geometry with name.
Definition TROOT.cxx:1903
void RecursiveRemove(TObject *obj) override
Recursively remove this object from the list of Cleanups.
Definition TROOT.cxx:2660
Bool_t fExecutingMacro
True while executing a TMacro.
Definition TROOT.h:154
static const TString This function is removed because it made only sense in the corner case where the ROOT source is copied inside the ROOT which is never the case unless the user does it by hand
Definition TROOT.h:384
TList * GetListOfBrowsables() const
Definition TROOT.h:276
Int_t fBuiltDate
Date of ROOT built.
Definition TROOT.h:136
Bool_t fIsWebDisplayBatch
True if web widgets are not displayed.
Definition TROOT.h:147
static const TString & GetSharedLibDir()
Get the shared libraries directory in the installation.
Definition TROOT.cxx:3217
void SetEscape(Bool_t flag=kTRUE)
Definition TROOT.h:344
Int_t GetVersionCode() const
Definition TROOT.h:246
TSeqCollection * fMappedFiles
List of memory mapped files.
Definition TROOT.h:165
Int_t GetNtypes() const
Get number of types.
Definition TROOT.cxx:2040
TSeqCollection * GetListOfSpecials() const
Definition TROOT.h:263
Int_t LoadMacro(const char *filename, Int_t *error=nullptr, Bool_t check=kFALSE)
Load a macro in the interpreter's memory.
Definition TROOT.cxx:2430
TFile * GetFile() const override
Definition TROOT.h:278
static const TString & GetLibDir()
Get the library directory in the installation.
Definition TROOT.cxx:3187
void SetDefCanvasName(const char *name="c1")
Definition TROOT.h:338
TSeqCollection * fBrowsers
List of browsers.
Definition TROOT.h:173
TString fDefCanvasName
Name of default canvas.
Definition TROOT.h:188
TListOfFunctions * fGlobalFunctions
List of global functions.
Definition TROOT.h:162
TList * fBrowsables
List of browsables.
Definition TROOT.h:185
TObject * FindObjectAny(const char *name) const override
Return a pointer to the first object with name starting at //root.
Definition TROOT.cxx:1582
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
Definition TROOT.cxx:2910
Bool_t IsFolder() const override
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition TROOT.h:299
void SetSelectedPrimitive(const TObject *obj)
Definition TROOT.h:349
void Reset(Option_t *option="")
Delete all global interpreter objects created since the last call to Reset.
Definition TROOT.cxx:2815
Int_t fEditorMode
Current Editor mode.
Definition TROOT.h:155
const char * FindObjectClassName(const char *name) const
Returns class name of a ROOT object including CINT globals.
Definition TROOT.cxx:1609
TSeqCollection * GetListOfDataSets() const
Definition TROOT.h:273
Bool_t MustClean() const
Definition TROOT.h:313
TSeqCollection * GetListOfClosedObjects() const
Definition TROOT.h:253
const char * GetConfigOptions() const
Definition TROOT.h:231
static const TString & GetDataDir()
Get the data directory in the installation. Static utility function.
Definition TROOT.cxx:3400
TROOT & operator=(const TROOT &)=delete
TSeqCollection * GetListOfGeometries() const
Definition TROOT.h:261
friend TSeqCollection * ROOT::Deprecated::Internal::GetListOfSecContexts(const TROOT &)
TSeqCollection * GetListOfStyles() const
Definition TROOT.h:258
TString fVersion
ROOT version as TString, example: 0.05.01.
Definition TROOT.h:131
static Int_t GetDirLevel()
return directory level
Definition TROOT.cxx:2918
void SetReadingObject(Bool_t flag=kTRUE)
Definition TROOT.cxx:2627
TInterpreter * GetInterpreter() const
Definition TROOT.h:227
TPluginManager * GetPluginManager() const
Definition TROOT.h:225
Sequenceable collection abstract base class.
Basic string class.
Definition TString.h:138
TStyle objects may be created to define special styles.
Definition TStyle.h:29
This class implements a mutex interface.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition TVirtualPad.h:51
TLine * line
for(Int_t i=0;i< n;i++)
Definition legend1.C:18
TSeqCollection * GetListOfSecContexts(const TROOT &)
Definition TROOT.cxx:175
void EnableObjectAutoRegistration()
Enable automatic registration of objects for the current thread (ROOT 6 default).
Definition TROOT.cxx:752
void DisableObjectAutoRegistration()
Disable automatic registration of objects for the current thread (ROOT 7 default).
Definition TROOT.cxx:760
bool ObjectAutoRegistrationEnabled()
Test whether objects in this thread auto-register themselves, e.g.
Definition TROOT.cxx:768
void SetRequireCleanup(TObject &obj)
Definition TROOT.h:401
R__EXTERN TROOT * gROOTLocal
Definition TROOT.h:399
void DisableParBranchProcessing()
Globally disables the IMT use case of parallel branch processing, deactivating the corresponding lock...
Definition TROOT.cxx:515
void EnableParBranchProcessing()
Globally enables the parallel branch processing, which is a case of implicit multi-threading (IMT) in...
Definition TROOT.cxx:501
Bool_t IsParBranchProcessingEnabled()
Returns true if parallel branch processing is enabled.
Definition TROOT.cxx:528
TROOT * GetROOT2()
Definition TROOT.cxx:468
Bool_t RequiresCleanup(TObject &obj)
Definition TROOT.h:406
void EnableImplicitMT(UInt_t numthreads=0)
Enable ROOT's implicit multi-threading for all objects and methods that provide an internal paralleli...
Definition TROOT.cxx:619
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.
Definition TROOT.cxx:675
UInt_t GetThreadPoolSize()
Returns the size of ROOT's thread pool.
Definition TROOT.cxx:682
void EnableThreadSafety()
Enable support for multi-threading within the ROOT code in particular, enables the global mutex to ma...
Definition TROOT.cxx:581
void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition TROOT.h:415
EIMTConfig
Definition TROOT.h:83
@ kWholeMachine
Default configuration.
@ kNumConfigs
Number of support IMT semantic configurations.
@ kExistingTBBArena
Use the existing TBB arena.
void DisableImplicitMT()
Disables the implicit multi-threading in ROOT (see EnableImplicitMT).
Definition TROOT.cxx:661
TLine l
Definition textangle.C:4