Logo ROOT   6.12/07
Reference Guide
TROOT.cxx
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 /** \class TROOT
13 \ingroup Base
14 
15 ROOT top level object description.
16 
17 The TROOT object is the entry point to the ROOT system.
18 The single instance of TROOT is accessible via the global gROOT.
19 Using the gROOT pointer one has access to basically every object
20 created in a ROOT based program. The TROOT object is essentially a
21 container of several lists pointing to the main ROOT objects.
22 
23 The following lists are accessible from gROOT object:
24 
25 ~~~ {.cpp}
26  gROOT->GetListOfClasses
27  gROOT->GetListOfColors
28  gROOT->GetListOfTypes
29  gROOT->GetListOfGlobals
30  gROOT->GetListOfGlobalFunctions
31  gROOT->GetListOfFiles
32  gROOT->GetListOfMappedFiles
33  gROOT->GetListOfSockets
34  gROOT->GetListOfSecContexts
35  gROOT->GetListOfCanvases
36  gROOT->GetListOfStyles
37  gROOT->GetListOfFunctions
38  gROOT->GetListOfSpecials (for example graphical cuts)
39  gROOT->GetListOfGeometries
40  gROOT->GetListOfBrowsers
41  gROOT->GetListOfCleanups
42  gROOT->GetListOfMessageHandlers
43 ~~~
44 
45 The TROOT class provides also many useful services:
46  - Get pointer to an object in any of the lists above
47  - Time utilities TROOT::Time
48 
49 The ROOT object must be created as a static object. An example
50 of a main program creating an interactive version is shown below:
51 
52 ### Example of a main program
53 
54 ~~~ {.cpp}
55  #include "TRint.h"
56 
57  int main(int argc, char **argv)
58  {
59  TRint *theApp = new TRint("ROOT example", &argc, argv);
60 
61  // Init Intrinsics, build all windows, and enter event loop
62  theApp->Run();
63 
64  return(0);
65  }
66 ~~~
67 */
68 
69 #include "RConfig.h"
70 #include "RConfigure.h"
71 #include "RConfigOptions.h"
72 #include "RVersion.h"
73 #include "RGitCommit.h"
74 
75 #include <string>
76 #include <map>
77 #include <stdlib.h>
78 #ifdef WIN32
79 #include <io.h>
80 #include "Windows4Root.h"
81 #include <Psapi.h>
82 #define RTLD_DEFAULT ((void *)::GetModuleHandle(NULL))
83 //#define dlsym(library, function_name) ::GetProcAddress((HMODULE)library, function_name)
84 #define dlopen(library_name, flags) ::LoadLibrary(library_name)
85 #define dlclose(library) ::FreeLibrary((HMODULE)library)
86 char *dlerror() {
87  static char Msg[1000];
88  FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
89  MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), Msg,
90  sizeof(Msg), NULL);
91  return Msg;
92 }
93 FARPROC dlsym(void *library, const char *function_name)
94 {
95  HMODULE hMods[1024];
96  DWORD cbNeeded;
97  FARPROC address = NULL;
98  unsigned int i;
99  if (library == RTLD_DEFAULT) {
100  if (EnumProcessModules(::GetCurrentProcess(), hMods, sizeof(hMods), &cbNeeded)) {
101  for (i = 0; i < (cbNeeded / sizeof(HMODULE)); i++) {
102  address = ::GetProcAddress((HMODULE)hMods[i], function_name);
103  if (address)
104  return address;
105  }
106  }
107  return address;
108  } else {
109  return ::GetProcAddress((HMODULE)library, function_name);
110  }
111 }
112 #else
113 #include <dlfcn.h>
114 #endif
115 
116 #include "Riostream.h"
117 #include "Gtypes.h"
118 #include "TROOT.h"
119 #include "TClass.h"
120 #include "TClassEdit.h"
121 #include "TClassGenerator.h"
122 #include "TDataType.h"
123 #include "TDatime.h"
124 #include "TStyle.h"
125 #include "TObjectTable.h"
126 #include "TClassTable.h"
127 #include "TSystem.h"
128 #include "THashList.h"
129 #include "TObjArray.h"
130 #include "TEnv.h"
131 #include "TError.h"
132 #include "TColor.h"
133 #include "TGlobal.h"
134 #include "TFunction.h"
135 #include "TVirtualPad.h"
136 #include "TBrowser.h"
137 #include "TSystemDirectory.h"
138 #include "TApplication.h"
139 #include "TInterpreter.h"
140 #include "TGuiFactory.h"
141 #include "TMessageHandler.h"
142 #include "TFolder.h"
143 #include "TQObject.h"
144 #include "TProcessUUID.h"
145 #include "TPluginManager.h"
146 #include "TMap.h"
147 #include "TObjString.h"
148 #include "TVirtualMutex.h"
149 #include "TInterpreter.h"
150 #include "TListOfTypes.h"
151 #include "TListOfDataMembers.h"
152 #include "TListOfEnumsWithLock.h"
153 #include "TListOfFunctions.h"
155 #include "TFunctionTemplate.h"
156 #include "ThreadLocalStorage.h"
157 #include "TVirtualRWMutex.h"
158 
159 #include <string>
160 namespace std {} using namespace std;
161 
162 #if defined(R__UNIX)
163 #if defined(R__HAS_COCOA)
164 #include "TMacOSXSystem.h"
165 #include "TUrl.h"
166 #else
167 #include "TUnixSystem.h"
168 #endif
169 #elif defined(R__WIN32)
170 #include "TWinNTSystem.h"
171 #endif
172 
173 extern "C" void R__SetZipMode(int);
174 
176 static void *gInterpreterLib = 0;
177 
178 // Mutex for protection of concurrent gROOT access
181 
182 // For accessing TThread::Tsd indirectly.
183 void **(*gThreadTsd)(void*,Int_t) = 0;
184 
185 //-------- Names of next three routines are a small homage to CMZ --------------
186 ////////////////////////////////////////////////////////////////////////////////
187 /// Return version id as an integer, i.e. "2.22/04" -> 22204.
188 
189 static Int_t IVERSQ()
190 {
191  Int_t maj, min, cycle;
192  sscanf(ROOT_RELEASE, "%d.%d/%d", &maj, &min, &cycle);
193  return 10000*maj + 100*min + cycle;
194 }
195 
196 ////////////////////////////////////////////////////////////////////////////////
197 /// Return built date as integer, i.e. "Apr 28 2000" -> 20000428.
198 
199 static Int_t IDATQQ(const char *date)
200 {
201  static const char *months[] = {"Jan","Feb","Mar","Apr","May",
202  "Jun","Jul","Aug","Sep","Oct",
203  "Nov","Dec"};
204 
205  char sm[12];
206  Int_t yy, mm=0, dd;
207  sscanf(date, "%s %d %d", sm, &dd, &yy);
208  for (int i = 0; i < 12; i++)
209  if (!strncmp(sm, months[i], 3)) {
210  mm = i+1;
211  break;
212  }
213  return 10000*yy + 100*mm + dd;
214 }
215 
216 ////////////////////////////////////////////////////////////////////////////////
217 /// Return built time as integer (with min precision), i.e.
218 /// "17:32:37" -> 1732.
219 
220 static Int_t ITIMQQ(const char *time)
221 {
222  Int_t hh, mm, ss;
223  sscanf(time, "%d:%d:%d", &hh, &mm, &ss);
224  return 100*hh + mm;
225 }
226 
227 ////////////////////////////////////////////////////////////////////////////////
228 /// Clean up at program termination before global objects go out of scope.
229 
230 static void CleanUpROOTAtExit()
231 {
232  if (gROOT) {
233  R__LOCKGUARD(gROOTMutex);
234 
235  if (gROOT->GetListOfFiles())
236  gROOT->GetListOfFiles()->Delete("slow");
237  if (gROOT->GetListOfSockets())
238  gROOT->GetListOfSockets()->Delete();
239  if (gROOT->GetListOfMappedFiles())
240  gROOT->GetListOfMappedFiles()->Delete("slow");
241  if (gROOT->GetListOfClosedObjects())
242  gROOT->GetListOfClosedObjects()->Delete("slow");
243  }
244 }
245 
246 ////////////////////////////////////////////////////////////////////////////////
247 /// A module and its headers. Intentionally not a copy:
248 /// If these strings end up in this struct they are
249 /// long lived by definition because they get passed in
250 /// before initialization of TCling.
251 
252 namespace {
253  struct ModuleHeaderInfo_t {
254  ModuleHeaderInfo_t(const char* moduleName,
255  const char** headers,
256  const char** includePaths,
257  const char* payloadCode,
258  const char* fwdDeclCode,
259  void (*triggerFunc)(),
260  const TROOT::FwdDeclArgsToKeepCollection_t& fwdDeclsArgToSkip,
261  const char** classesHeaders):
262  fModuleName(moduleName),
263  fHeaders(headers),
264  fPayloadCode(payloadCode),
265  fFwdDeclCode(fwdDeclCode),
266  fIncludePaths(includePaths),
267  fTriggerFunc(triggerFunc),
268  fClassesHeaders(classesHeaders),
269  fFwdNargsToKeepColl(fwdDeclsArgToSkip){}
270 
271  const char* fModuleName; // module name
272  const char** fHeaders; // 0-terminated array of header files
273  const char* fPayloadCode; // Additional code to be given to cling at library load
274  const char* fFwdDeclCode; // Additional code to let cling know about selected classes and functions
275  const char** fIncludePaths; // 0-terminated array of header files
276  void (*fTriggerFunc)(); // Pointer to the dict initialization used to find the library name
277  const char** fClassesHeaders; // 0-terminated list of classes and related header files
278  const TROOT::FwdDeclArgsToKeepCollection_t fFwdNargsToKeepColl; // Collection of
279  // pairs of template fwd decls and number of
280  };
281 
282  std::vector<ModuleHeaderInfo_t>& GetModuleHeaderInfoBuffer() {
283  static std::vector<ModuleHeaderInfo_t> moduleHeaderInfoBuffer;
284  return moduleHeaderInfoBuffer;
285  }
286 }
287 
291 
292 static void at_exit_of_TROOT() {
295 }
296 
297 // This local static object initializes the ROOT system
298 namespace ROOT {
299 namespace Internal {
300  class TROOTAllocator {
301  // Simple wrapper to separate, time-wise, the call to the
302  // TROOT destructor and the actual free-ing of the memory.
303  //
304  // Since the interpreter implementation (currently TCling) is
305  // loaded via dlopen by libCore, the destruction of its global
306  // variable (i.e. in particular clang's) is scheduled before
307  // those in libCore so we need to schedule the call to the TROOT
308  // destructor before that *but* we want to make sure the memory
309  // stay around until libCore itself is unloaded so that code
310  // using gROOT can 'properly' check for validity.
311  //
312  // The order of loading for is:
313  // libCore.so
314  // libRint.so
315  // ... anything other library hard linked to the executable ...
316  // ... for example libEvent
317  // libCling.so
318  // ... other libraries like libTree for example ....
319  // and the destruction order is (of course) the reverse.
320  // By default the unloading of the dictionary, does use
321  // the service of the interpreter ... which of course
322  // fails if libCling is already unloaded by that information
323  // has not been registered per se.
324  //
325  // To solve this problem, we now schedule the destruction
326  // of the TROOT object to happen _just_ before the
327  // unloading/destruction of libCling so that we can
328  // maximize the amount of clean-up we can do correctly
329  // and we can still allocate the TROOT object's memory
330  // statically.
331  //
332  char fHolder[sizeof(TROOT)];
333  public:
334  TROOTAllocator() {
335  new(&(fHolder[0])) TROOT("root", "The ROOT of EVERYTHING");
336  }
337 
338  ~TROOTAllocator() {
339  if (gROOTLocal) {
340  gROOTLocal->~TROOT();
341  }
342  }
343  };
344 
345  // The global gROOT is defined to be a function (ROOT::GetROOT())
346  // which itself is dereferencing a function pointer.
347 
348  // Initially this function pointer's value is & GetROOT1 whose role is to
349  // create and initialize the TROOT object itself.
350  // At the very end of the TROOT constructor the value of the function pointer
351  // is switch to & GetROOT2 whose role is to initialize the interpreter.
352 
353  // This mechanism was primarily intended to fix the issues with order in which
354  // global TROOT and LLVM globals are initialized. TROOT was initializing
355  // Cling, but Cling could not be used yet due to LLVM globals not being
356  // Initialized yet. The solution is to delay initializing the interpreter in
357  // TROOT till after main() when all LLVM globals are initialized.
358 
359  // Technically, the mechanism used actually delay the interpreter
360  // initialization until the first use of gROOT *after* the end of the
361  // TROOT constructor.
362 
363  // So to delay until after the start of main, we also made sure that none
364  // of the ROOT code (mostly the dictionary code) used during library loading
365  // is using gROOT (directly or indirectly).
366 
367  // In practice, the initialization of the interpreter is now delayed until
368  // the first use gROOT (or gInterpreter) after the start of main (but user
369  // could easily break this by using gROOT in their library initialization
370  // code).
371 
372  extern TROOT *gROOTLocal;
373 
375  if (gROOTLocal)
376  return gROOTLocal;
377  static TROOTAllocator alloc;
378  return gROOTLocal;
379  }
380 
382  static Bool_t initInterpreter = kFALSE;
383  if (!initInterpreter) {
384  initInterpreter = kTRUE;
385  gROOTLocal->InitInterpreter();
386  // Load and init threads library
387  gROOTLocal->InitThreads();
388  }
389  return gROOTLocal;
390  }
391  typedef TROOT *(*GetROOTFun_t)();
392 
394 
395  static Func_t GetSymInLibImt(const char *funcname)
396  {
397  const static bool loadSuccess = dlsym(RTLD_DEFAULT, "usedToIdentifyRootClingByDlSym")? false : 0 <= gSystem->Load("libImt");
398  if (loadSuccess) {
399  if (auto sym = gSystem->DynFindSymbol(nullptr, funcname)) {
400  return sym;
401  } else {
402  Error("GetSymInLibImt", "Cannot get symbol %s.", funcname);
403  }
404  }
405  return nullptr;
406  }
407 
408  //////////////////////////////////////////////////////////////////////////////
409  /// Globally enables the parallel branch processing, which is a case of
410  /// implicit multi-threading (IMT) in ROOT, activating the required locks.
411  /// This IMT use case, implemented in TTree::GetEntry, spawns a task for
412  /// each branch of the tree. Therefore, a task takes care of the reading,
413  /// decompression and deserialisation of a given branch.
415  {
416 #ifdef R__USE_IMT
417  if (!IsImplicitMTEnabled())
419  static void (*sym)() = (void(*)())Internal::GetSymInLibImt("ROOT_TImplicitMT_EnableParBranchProcessing");
420  if (sym)
421  sym();
422 #else
423  ::Warning("EnableParBranchProcessing", "Cannot enable parallel branch processing, please build ROOT with -Dimt=ON");
424 #endif
425  }
426 
427  //////////////////////////////////////////////////////////////////////////////
428  /// Globally disables the IMT use case of parallel branch processing,
429  /// deactivating the corresponding locks.
431  {
432 #ifdef R__USE_IMT
433  static void (*sym)() = (void(*)())Internal::GetSymInLibImt("ROOT_TImplicitMT_DisableParBranchProcessing");
434  if (sym)
435  sym();
436 #else
437  ::Warning("DisableParBranchProcessing", "Cannot disable parallel branch processing, please build ROOT with -Dimt=ON");
438 #endif
439  }
440 
441  //////////////////////////////////////////////////////////////////////////////
442  /// Returns true if parallel branch processing is enabled.
444  {
445 #ifdef R__USE_IMT
446  static Bool_t (*sym)() = (Bool_t(*)())Internal::GetSymInLibImt("ROOT_TImplicitMT_IsParBranchProcessingEnabled");
447  if (sym)
448  return sym();
449  else
450  return kFALSE;
451 #else
452  return kFALSE;
453 #endif
454  }
455 
456  ////////////////////////////////////////////////////////////////////////////////
457  /// Globally enables the parallel tree processing, which is a case of
458  /// implicit multi-threading in ROOT, activating the required locks.
459  /// This IMT use case, implemented in TTreeProcessor::Process, receives a user
460  /// function and applies it to subranges of the tree, which correspond to its
461  /// clusters. Hence, for every cluster, a task is spawned to potentially
462  /// process it in parallel with the other clusters.
464  {
465 #ifdef R__USE_IMT
466  if (!IsImplicitMTEnabled())
468  static void (*sym)() = (void(*)())Internal::GetSymInLibImt("ROOT_TImplicitMT_EnableParTreeProcessing");
469  if (sym)
470  sym();
471 #else
472  ::Warning("EnableParTreeProcessing", "Cannot enable parallel tree processing, please build ROOT with -Dimt=ON");
473 #endif
474  }
475 
476  //////////////////////////////////////////////////////////////////////////////
477  /// Globally disables the IMT use case of parallel branch processing,
478  /// deactivating the corresponding locks.
480  {
481 #ifdef R__USE_IMT
482  static void (*sym)() = (void(*)())Internal::GetSymInLibImt("ROOT_TImplicitMT_DisableParTreeProcessing");
483  if (sym)
484  sym();
485 #else
486  ::Warning("DisableParTreeProcessing", "Cannot disable parallel tree processing, please build ROOT with -Dimt=ON");
487 #endif
488  }
489 
490  ////////////////////////////////////////////////////////////////////////////////
491  /// Returns true if parallel tree processing is enabled.
493  {
494 #ifdef R__USE_IMT
495  static Bool_t (*sym)() = (Bool_t(*)())Internal::GetSymInLibImt("ROOT_TImplicitMT_IsParTreeProcessingEnabled");
496  if (sym)
497  return sym();
498  else
499  return kFALSE;
500 #else
501  return kFALSE;
502 #endif
503  }
504 
505  ////////////////////////////////////////////////////////////////////////////////
506  /// Keeps track of the status of ImplicitMT w/o resorting to the load of
507  /// libImt
509  {
510  static Bool_t isImplicitMTEnabled = kFALSE;
511  return isImplicitMTEnabled;
512  }
513 
514 } // end of Internal sub namespace
515 // back to ROOT namespace
516 
518  return (*Internal::gGetROOT)();
519  }
520 
521  TString &GetMacroPath() {
522  static TString macroPath;
523  return macroPath;
524  }
525 
526  ////////////////////////////////////////////////////////////////////////////////
527  /// Enables the global mutex to make ROOT thread safe/aware.
529  {
530  static void (*sym)() = (void(*)())Internal::GetSymInLibImt("ROOT_TThread_Initialize");
531  if (sym)
532  sym();
533  }
534 
535  ////////////////////////////////////////////////////////////////////////////////
536  /// @param[in] numthreads Number of threads to use. If not specified or
537  /// set to zero, the number of threads is automatically
538  /// decided by the implementation. Any other value is
539  /// used as a hint.
540  ///
541  /// ROOT must be built with the compilation flag `imt=ON` for this feature to be available.
542  /// The following objects and methods automatically take advantage of
543  /// multi-threading if a call to `EnableImplicitMT` has been made before usage:
544  ///
545  /// - TDataFrame internally runs the event-loop by parallelizing over clusters of entries
546  /// - TTree::GetEntry reads multiple branches in parallel
547  /// - TTree::FlushBaskets writes multiple baskets to disk in parallel
548  ///
549  /// EnableImplicitMT calls in turn EnableThreadSafety.
550  /// The 'numthreads' parameter allows to control the number of threads to
551  /// be used by the implicit multi-threading. However, this parameter is just
552  /// a hint for ROOT: it will try to satisfy the request if the execution
553  /// scenario allows it. For example, if ROOT is configured to use an external
554  /// scheduler, setting a value for 'numthreads' might not have any effect.
555  void EnableImplicitMT(UInt_t numthreads)
556  {
557 #ifdef R__USE_IMT
559  static void (*sym)(UInt_t) = (void(*)(UInt_t))Internal::GetSymInLibImt("ROOT_TImplicitMT_EnableImplicitMT");
560  if (sym)
561  sym(numthreads);
563 #else
564  ::Warning("EnableImplicitMT", "Cannot enable implicit multi-threading with %d threads, please build ROOT with -Dimt=ON", numthreads);
565 #endif
566  }
567 
568  ////////////////////////////////////////////////////////////////////////////////
569  /// Disables the implicit multi-threading in ROOT (see EnableImplicitMT).
571  {
572 #ifdef R__USE_IMT
573  static void (*sym)() = (void(*)())Internal::GetSymInLibImt("ROOT_TImplicitMT_DisableImplicitMT");
574  if (sym)
575  sym();
577 #else
578  ::Warning("DisableImplicitMT", "Cannot disable implicit multi-threading, please build ROOT with -Dimt=ON");
579 #endif
580  }
581 
582  ////////////////////////////////////////////////////////////////////////////////
583  /// Returns true if the implicit multi-threading in ROOT is enabled.
585  {
587  }
588 
589  ////////////////////////////////////////////////////////////////////////////////
590  /// Returns the size of the pool used for implicit multi-threading.
592  {
593 #ifdef R__USE_IMT
594  static UInt_t (*sym)() = (UInt_t(*)())Internal::GetSymInLibImt("ROOT_TImplicitMT_GetImplicitMTPoolSize");
595  if (sym)
596  return sym();
597  else
598  return 0;
599 #else
600  return 0;
601 #endif
602  }
603 
604 }
605 
607 
608 // Global debug flag (set to > 0 to get debug output).
609 // Can be set either via the interpreter (gDebug is exported to CINT),
610 // via the rootrc resource "Root.Debug", via the shell environment variable
611 // ROOTDEBUG, or via the debugger.
613 
614 
615 ClassImp(TROOT);
616 
617 ////////////////////////////////////////////////////////////////////////////////
618 /// Default ctor.
619 
621  fLineIsProcessing(0), fVersion(0), fVersionInt(0), fVersionCode(0),
622  fVersionDate(0), fVersionTime(0), fBuiltDate(0), fBuiltTime(0),
623  fTimer(0), fApplication(0), fInterpreter(0), fBatch(kTRUE), fEditHistograms(kTRUE),
624  fFromPopUp(kTRUE),fMustClean(kTRUE),fReadingObject(kFALSE),fForceStyle(kFALSE),
625  fInterrupt(kFALSE),fEscape(kFALSE),fExecutingMacro(kFALSE),fEditorMode(0),
626  fPrimitive(0),fSelectPad(0),fClasses(0),fTypes(0),fGlobals(0),fGlobalFunctions(0),
627  fClosedObjects(0),fFiles(0),fMappedFiles(0),fSockets(0),fCanvases(0),fStyles(0),fFunctions(0),
628  fTasks(0),fColors(0),fGeometries(0),fBrowsers(0),fSpecials(0),fCleanups(0),
629  fMessageHandlers(0),fStreamerInfo(0),fClassGenerators(0),fSecContexts(0),
630  fProofs(0),fClipboard(0),fDataSets(0),fUUIDs(0),fRootFolder(0),fBrowsables(0),
631  fPluginManager(0)
632 {
633 }
634 
635 ////////////////////////////////////////////////////////////////////////////////
636 /// Initialize the ROOT system. The creation of the TROOT object initializes
637 /// the ROOT system. It must be the first ROOT related action that is
638 /// performed by a program. The TROOT object must be created on the stack
639 /// (can not be called via new since "operator new" is protected). The
640 /// TROOT object is either created as a global object (outside the main()
641 /// program), or it is one of the first objects created in main().
642 /// Make sure that the TROOT object stays in scope for as long as ROOT
643 /// related actions are performed. TROOT is a so called singleton so
644 /// only one instance of it can be created. The single TROOT object can
645 /// always be accessed via the global pointer gROOT.
646 /// The name and title arguments can be used to identify the running
647 /// application. The initfunc argument can contain an array of
648 /// function pointers (last element must be 0). These functions are
649 /// executed at the end of the constructor. This way one can easily
650 /// extend the ROOT system without adding permanent dependencies
651 /// (e.g. the graphics system is initialized via such a function).
652 
653 TROOT::TROOT(const char *name, const char *title, VoidFuncPtr_t *initfunc)
664  fPluginManager(0)
665 {
666  if (fgRootInit || ROOT::Internal::gROOTLocal) {
667  //Warning("TROOT", "only one instance of TROOT allowed");
668  return;
669  }
670 
671  R__LOCKGUARD(gROOTMutex);
672 
673  ROOT::Internal::gROOTLocal = this;
674  gDirectory = 0;
675 
676  SetName(name);
677  SetTitle(title);
678 
679  // will be used by global "operator delete" so make sure it is set
680  // before anything is deleted
681  fMappedFiles = 0;
682 
683  // create already here, but only initialize it after gEnv has been created
685 
686  // Initialize Operating System interface
687  InitSystem();
688 
689  // Initialize static directory functions
690  GetRootSys();
691  GetBinDir();
692  GetLibDir();
693  GetIncludeDir();
694  GetEtcDir();
695  GetDataDir();
696  GetDocDir();
697  GetMacroDir();
698  GetTutorialDir();
699  GetSourceDir();
700  GetIconPath();
701  GetTTFFontDir();
702 
703  gRootDir = GetRootSys().Data();
704 
706 
707  // Initialize interface to CINT C++ interpreter
708  fVersionInt = 0; // check in TROOT dtor in case TCling fails
709  fClasses = 0; // might be checked via TCling ctor
710  fEnums = 0;
711 
712  fConfigOptions = R__CONFIGUREOPTIONS;
713  fConfigFeatures = R__CONFIGUREFEATURES;
716  fVersionInt = IVERSQ();
719  fBuiltDate = IDATQQ(__DATE__);
720  fBuiltTime = ITIMQQ(__TIME__);
721 
722  ReadGitInfo();
723 
724  fClasses = new THashTable(800,3); fClasses->UseRWLock();
725  //fIdMap = new IdMap_t;
727  fClassGenerators = new TList;
728 
729  // usedToIdentifyRootClingByDlSym is available when TROOT is part of
730  // rootcling.
731  if (!dlsym(RTLD_DEFAULT, "usedToIdentifyRootClingByDlSym")) {
732  // initialize plugin manager early
734 #if defined(R__MACOSX) && (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
735  if (TARGET_OS_IPHONE | TARGET_IPHONE_SIMULATOR) {
736  TEnv plugins(".plugins-ios");
738  }
739 #endif
740  }
741 
742  TSystemDirectory *workdir = new TSystemDirectory("workdir", gSystem->WorkingDirectory());
743 
744  auto setNameLocked = [](TSeqCollection *l, const char *collection_name) {
745  l->SetName(collection_name);
746  l->UseRWLock();
747  return l;
748  };
749 
750  fTimer = 0;
751  fApplication = 0;
752  fColors = setNameLocked(new TObjArray(1000), "ListOfColors");
753  fTypes = 0;
754  fGlobals = 0;
755  fGlobalFunctions = 0;
756  // fList was created in TDirectory::Build but with different sizing.
757  delete fList;
758  fList = new THashList(1000,3); fList->UseRWLock();
759  fClosedObjects = setNameLocked(new TList, "ClosedFiles");
760  fFiles = setNameLocked(new TList, "Files");
761  fMappedFiles = setNameLocked(new TList, "MappedFiles");
762  fSockets = setNameLocked(new TList, "Sockets");
763  fCanvases = setNameLocked(new TList, "Canvases");
764  fStyles = setNameLocked(new TList, "Styles");
765  fFunctions = setNameLocked(new TList, "Functions");
766  fTasks = setNameLocked(new TList, "Tasks");
767  fGeometries = setNameLocked(new TList, "Geometries");
768  fBrowsers = setNameLocked(new TList, "Browsers");
769  fSpecials = setNameLocked(new TList, "Specials");
770  fBrowsables = (TList*)setNameLocked(new TList, "Browsables");
771  fCleanups = setNameLocked(new THashList, "Cleanups");
772  fMessageHandlers = setNameLocked(new TList, "MessageHandlers");
773  fSecContexts = setNameLocked(new TList, "SecContexts");
774  fProofs = setNameLocked(new TList, "Proofs");
775  fClipboard = setNameLocked(new TList, "Clipboard");
776  fDataSets = setNameLocked(new TList, "DataSets");
778 
780  fUUIDs = new TProcessUUID();
781 
782  fRootFolder = new TFolder();
783  fRootFolder->SetName("root");
784  fRootFolder->SetTitle("root of all folders");
785  fRootFolder->AddFolder("Classes", "List of Active Classes",fClasses);
786  fRootFolder->AddFolder("Colors", "List of Active Colors",fColors);
787  fRootFolder->AddFolder("MapFiles", "List of MapFiles",fMappedFiles);
788  fRootFolder->AddFolder("Sockets", "List of Socket Connections",fSockets);
789  fRootFolder->AddFolder("Canvases", "List of Canvases",fCanvases);
790  fRootFolder->AddFolder("Styles", "List of Styles",fStyles);
791  fRootFolder->AddFolder("Functions", "List of Functions",fFunctions);
792  fRootFolder->AddFolder("Tasks", "List of Tasks",fTasks);
793  fRootFolder->AddFolder("Geometries","List of Geometries",fGeometries);
794  fRootFolder->AddFolder("Browsers", "List of Browsers",fBrowsers);
795  fRootFolder->AddFolder("Specials", "List of Special Objects",fSpecials);
796  fRootFolder->AddFolder("Handlers", "List of Message Handlers",fMessageHandlers);
797  fRootFolder->AddFolder("Cleanups", "List of RecursiveRemove Collections",fCleanups);
798  fRootFolder->AddFolder("StreamerInfo","List of Active StreamerInfo Classes",fStreamerInfo);
799  fRootFolder->AddFolder("SecContexts","List of Security Contexts",fSecContexts);
800  fRootFolder->AddFolder("PROOF Sessions", "List of PROOF sessions",fProofs);
801  fRootFolder->AddFolder("ROOT Memory","List of Objects in the gROOT Directory",fList);
802  fRootFolder->AddFolder("ROOT Files","List of Connected ROOT Files",fFiles);
803 
804  // by default, add the list of files, tasks, canvases and browsers in the Cleanups list
810  // And add TROOT's TDirectory personality
811  fCleanups->Add(fList);
812 
815  fFromPopUp = kFALSE;
817  fInterrupt = kFALSE;
818  fEscape = kFALSE;
819  fMustClean = kTRUE;
820  fPrimitive = 0;
821  fSelectPad = 0;
822  fEditorMode = 0;
823  fDefCanvasName = "c1";
825  fLineIsProcessing = 1; // This prevents WIN32 "Windows" thread to pick ROOT objects with mouse
826  gDirectory = this;
827  gPad = 0;
828 
829  //set name of graphical cut class for the graphics editor
830  //cannot call SetCutClassName at this point because the TClass of TCutG
831  //is not yet build
832  fCutClassName = "TCutG";
833 
834  // Create a default MessageHandler
835  new TMessageHandler((TClass*)0);
836 
837  // Create some styles
838  gStyle = 0;
840  SetStyle(gEnv->GetValue("Canvas.Style", "Modern"));
841 
842  // Setup default (batch) graphics and GUI environment
845  gGXBatch = new TVirtualX("Batch", "ROOT Interface to batch graphics");
847 
848 #if defined(R__WIN32)
849  fBatch = kFALSE;
850 #elif defined(R__HAS_COCOA)
851  fBatch = kFALSE;
852 #else
853  if (gSystem->Getenv("DISPLAY"))
854  fBatch = kFALSE;
855  else
856  fBatch = kTRUE;
857 #endif
858 
859  int i = 0;
860  while (initfunc && initfunc[i]) {
861  (initfunc[i])();
862  fBatch = kFALSE; // put system in graphics mode (backward compatible)
863  i++;
864  }
865 
866  // Set initial/default list of browsable objects
867  fBrowsables->Add(fRootFolder, "root");
868  fBrowsables->Add(fProofs, "PROOF Sessions");
869  fBrowsables->Add(workdir, gSystem->WorkingDirectory());
870  fBrowsables->Add(fFiles, "ROOT Files");
871 
872  atexit(CleanUpROOTAtExit);
873 
875 }
876 
877 ////////////////////////////////////////////////////////////////////////////////
878 /// Clean up and free resources used by ROOT (files, network sockets,
879 /// shared memory segments, etc.).
880 
882 {
883  using namespace ROOT::Internal;
884 
885  if (gROOTLocal == this) {
886 
887  // If the interpreter has not yet been initialized, don't bother
888  gGetROOT = &GetROOT1;
889 
890  // Mark the object as invalid, so that we can veto some actions
891  // (like autoloading) while we are in the destructor.
893 
894  // Turn-off the global mutex to avoid recreating mutexes that have
895  // already been deleted during the destruction phase
896  gGlobalMutex = 0;
897 
898  // Return when error occurred in TCling, i.e. when setup file(s) are
899  // out of date
900  if (!fVersionInt) return;
901 
902  // ATTENTION!!! Order is important!
903 
904 #ifdef R__COMPLETE_MEM_TERMINATION
906 
907  // FIXME: Causes rootcling to deadlock, debug and uncomment
908  // SafeDelete(fRootFolder);
909 
910  fSpecials->Delete(); SafeDelete(fSpecials); // delete special objects : PostScript, Minuit, Html
911 #endif
912  fClosedObjects->Delete("slow"); // and closed files
913  fFiles->Delete("slow"); // and files
915  fSecContexts->Delete("slow"); SafeDelete(fSecContexts); // and security contexts
916  fSockets->Delete(); SafeDelete(fSockets); // and sockets
917  fMappedFiles->Delete("slow"); // and mapped files
918  TSeqCollection *tl = fMappedFiles; fMappedFiles = 0; delete tl;
919 
921 
922  delete fUUIDs;
923  TProcessID::Cleanup(); // and list of ProcessIDs
924 
925  fFunctions->Delete(); SafeDelete(fFunctions); // etc..
928 #ifdef R__COMPLETE_MEM_TERMINATION
930 #endif
933 
934 #ifdef R__COMPLETE_MEM_TERMINATION
939 #endif
940 
941  // Stop emitting signals
943 
945 
946 #ifdef R__COMPLETE_MEM_TERMINATION
952 
953  fCleanups->Clear();
955  delete gClassTable; gClassTable = 0;
956  delete gEnv; gEnv = 0;
957 
958  if (fTypes) fTypes->Delete();
960  if (fGlobals) fGlobals->Delete();
964  fEnums.load()->Delete();
965 
966  // FIXME: Causes segfault in rootcling, debug and uncomment
967  // fClasses->Delete(); SafeDelete(fClasses); // TClass'es must be deleted last
968 #endif
969 
970  // Remove shared libraries produced by the TSystem::CompileMacro() call
972 
973  // Cleanup system class
974  delete gSystem;
975 
976  // ROOT-6022:
977  // if (gInterpreterLib) dlclose(gInterpreterLib);
978 #ifdef R__COMPLETE_MEM_TERMINATION
979  // On some 'newer' platform (Fedora Core 17+, Ubuntu 12), the
980  // initialization order is (by default?) is 'wrong' and so we can't
981  // delete the interpreter now .. because any of the static in the
982  // interpreter's library have already been deleted.
983  // On the link line, we must list the most dependent .o file
984  // and end with the least dependent (LLVM libraries), unfortunately,
985  // Fedora Core 17+ or Ubuntu 12 will also execute the initialization
986  // in the same order (hence doing libCore's before LLVM's and
987  // vice et versa for both the destructor. We worked around the
988  // initialization order by delay the TROOT creation until first use.
989  // We can not do the same for destruction as we have no way of knowing
990  // the last access ...
991  // So for now, let's avoid delete TCling except in the special build
992  // checking the completeness of the termination deletion.
993 
994  // TODO: Should we do more cleanup here than just call delete?
995  // Segfaults rootcling in some cases, debug and uncomment
996  // delete fInterpreter;
997 #endif
998 
999 #ifdef R__COMPLETE_MEM_TERMINATION
1001 #endif
1002 
1003  // Prints memory stats
1005 
1006  gROOTLocal = 0;
1007  fgRootInit = kFALSE;
1008  }
1009 }
1010 
1011 ////////////////////////////////////////////////////////////////////////////////
1012 /// Add a class to the list and map of classes.
1013 /// This routine is deprecated, use TClass::AddClass directly.
1014 
1016 {
1017  TClass::AddClass(cl);
1018 }
1019 
1020 ////////////////////////////////////////////////////////////////////////////////
1021 /// Add a class generator. This generator will be called by TClass::GetClass
1022 /// in case its does not find a loaded rootcint dictionary to request the
1023 /// creation of a TClass object.
1024 
1026 {
1027  if (!generator) return;
1028  fClassGenerators->Add(generator);
1029 }
1030 
1031 ////////////////////////////////////////////////////////////////////////////////
1032 /// Append object to this directory.
1033 ///
1034 /// If replace is true:
1035 /// remove any existing objects with the same same (if the name is not "")
1036 
1037 void TROOT::Append(TObject *obj, Bool_t replace /* = kFALSE */)
1038 {
1039  R__LOCKGUARD(gROOTMutex);
1040  TDirectory::Append(obj,replace);
1041 }
1042 
1043 ////////////////////////////////////////////////////////////////////////////////
1044 /// Add browsable objects to TBrowser.
1045 
1047 {
1048  TObject *obj;
1049  TIter next(fBrowsables);
1050 
1051  while ((obj = (TObject *) next())) {
1052  const char *opt = next.GetOption();
1053  if (opt && strlen(opt))
1054  b->Add(obj, opt);
1055  else
1056  b->Add(obj, obj->GetName());
1057  }
1058 }
1059 
1060 ////////////////////////////////////////////////////////////////////////////////
1061 /// return class status bit kClassSaved for class cl
1062 /// This function is called by the SavePrimitive functions writing
1063 /// the C++ code for an object.
1064 
1066 {
1067  if (cl == 0) return kFALSE;
1068  if (cl->TestBit(TClass::kClassSaved)) return kTRUE;
1070  return kFALSE;
1071 }
1072 
1073 namespace {
1074  static void R__ListSlowClose(TList *files)
1075  {
1076  // Routine to close a list of files using the 'slow' techniques
1077  // that also for the deletion ot update the list itself.
1078 
1079  static TObject harmless;
1080  TObjLink *cursor = files->FirstLink();
1081  while (cursor) {
1082  TDirectory *dir = static_cast<TDirectory*>( cursor->GetObject() );
1083  if (dir) {
1084  // In order for the iterator to stay valid, we must
1085  // prevent the removal of the object (dir) from the list
1086  // (which is done in TFile::Close). We can also can not
1087  // just move to the next iterator since the Close might
1088  // also (indirectly) remove that file.
1089  // So we SetObject to a harmless value, so that 'dir'
1090  // is not seen as part of the list.
1091  // We will later, remove all the object (see files->Clear()
1092  cursor->SetObject(&harmless); // this must not be zero otherwise things go wrong.
1093  // See related comment at the files->Clear("nodelete");
1094  dir->Close("nodelete");
1095  // Put it back
1096  cursor->SetObject(dir);
1097  }
1098  cursor = cursor->Next();
1099  };
1100  // Now were done, clear the list but do not delete the objects as
1101  // they have been moved to the list of closed objects and must be
1102  // deleted from there in order to avoid a double delete from a
1103  // use objects (on the interpreter stack).
1104  files->Clear("nodelete");
1105  }
1106 
1107  static void R__ListSlowDeleteContent(TList *files)
1108  {
1109  // Routine to delete the content of list of files using the 'slow' techniques
1110 
1111  static TObject harmless;
1112  TObjLink *cursor = files->FirstLink();
1113  while (cursor) {
1114  TDirectory *dir = dynamic_cast<TDirectory*>( cursor->GetObject() );
1115  if (dir) {
1116  // In order for the iterator to stay valid, we must
1117  // prevent the removal of the object (dir) from the list
1118  // (which is done in TFile::Close). We can also can not
1119  // just move to the next iterator since the Close might
1120  // also (indirectly) remove that file.
1121  // So we SetObject to a harmless value, so that 'dir'
1122  // is not seen as part of the list.
1123  // We will later, remove all the object (see files->Clear()
1124  cursor->SetObject(&harmless); // this must not be zero otherwise things go wrong.
1125  // See related comment at the files->Clear("nodelete");
1126  dir->GetList()->Delete("slow");
1127  // Put it back
1128  cursor->SetObject(dir);
1129  }
1130  cursor = cursor->Next();
1131  };
1132  }
1133 }
1134 
1135 ////////////////////////////////////////////////////////////////////////////////
1136 /// Close any files and sockets that gROOT knows about.
1137 /// This can be used to insures that the files and sockets are closed before any library is unloaded!
1138 
1140 {
1141  if (fFiles && fFiles->First()) {
1142  R__ListSlowClose(static_cast<TList*>(fFiles));
1143  }
1144  // and Close TROOT itself.
1145  Close("slow");
1146  // Now sockets.
1147  if (fSockets && fSockets->First()) {
1148  if (0==fCleanups->FindObject(fSockets) ) {
1151  }
1152  CallFunc_t *socketCloser = gInterpreter->CallFunc_Factory();
1153  Long_t offset = 0;
1154  TClass *socketClass = TClass::GetClass("TSocket");
1155  gInterpreter->CallFunc_SetFuncProto(socketCloser, socketClass->GetClassInfo(), "Close", "", &offset);
1156  if (gInterpreter->CallFunc_IsValid(socketCloser)) {
1157  static TObject harmless;
1158  TObjLink *cursor = static_cast<TList*>(fSockets)->FirstLink();
1159  TList notclosed;
1160  while (cursor) {
1161  TObject *socket = cursor->GetObject();
1162  // In order for the iterator to stay valid, we must
1163  // prevent the removal of the object (dir) from the list
1164  // (which is done in TFile::Close). We can also can not
1165  // just move to the next iterator since the Close might
1166  // also (indirectly) remove that file.
1167  // So we SetObject to a harmless value, so that 'dir'
1168  // is not seen as part of the list.
1169  // We will later, remove all the object (see files->Clear()
1170  cursor->SetObject(&harmless); // this must not be zero otherwise things go wrong.
1171 
1172  if (socket->IsA()->InheritsFrom(socketClass)) {
1173  gInterpreter->CallFunc_Exec(socketCloser, ((char*)socket)+offset);
1174  // Put the object in the closed list for later deletion.
1175  socket->SetBit(kMustCleanup);
1176  fClosedObjects->AddLast(socket);
1177  } else {
1178  // Crap ... this is not a socket, likely Proof or something, let's try to find a Close
1179  Long_t other_offset;
1180  CallFunc_t *otherCloser = gInterpreter->CallFunc_Factory();
1181  gInterpreter->CallFunc_SetFuncProto(otherCloser, socket->IsA()->GetClassInfo(), "Close", "", &other_offset);
1182  if (gInterpreter->CallFunc_IsValid(otherCloser)) {
1183  gInterpreter->CallFunc_Exec(otherCloser, ((char*)socket)+other_offset);
1184  // Put the object in the closed list for later deletion.
1185  socket->SetBit(kMustCleanup);
1186  fClosedObjects->AddLast(socket);
1187  } else {
1188  notclosed.AddLast(socket);
1189  }
1190  gInterpreter->CallFunc_Delete(otherCloser);
1191  // Put it back
1192  cursor->SetObject(socket);
1193  }
1194  cursor = cursor->Next();
1195  }
1196  // Now were done, clear the list
1197  fSockets->Clear();
1198  // Read the one we did not close
1199  cursor = notclosed.FirstLink();
1200  while (cursor) {
1201  static_cast<TList*>(fSockets)->AddLast(cursor->GetObject());
1202  cursor = cursor->Next();
1203  }
1204  }
1205  gInterpreter->CallFunc_Delete(socketCloser);
1206  }
1207  if (fMappedFiles && fMappedFiles->First()) {
1208  R__ListSlowClose(static_cast<TList*>(fMappedFiles));
1209  }
1210 
1211 }
1212 
1213 ////////////////////////////////////////////////////////////////////////////////
1214 /// Execute the cleanups necessary at the end of the process, in particular
1215 /// those that must be executed before the library start being unloaded.
1216 
1218 {
1219  // This will not delete the objects 'held' by the TFiles so that
1220  // they can still be 'reacheable' when ResetGlobals is run.
1221  CloseFiles();
1222 
1223  if (gInterpreter) {
1224  gInterpreter->ResetGlobals();
1225  }
1226 
1227  // Now delete the objects 'held' by the TFiles so that it
1228  // is done before the tear down of the libraries.
1229  if (fClosedObjects && fClosedObjects->First()) {
1230  R__ListSlowDeleteContent(static_cast<TList*>(fClosedObjects));
1231  }
1232 
1233  // Now a set of simpler things to delete. See the same ordering in
1234  // TROOT::~TROOT
1235  fFunctions->Delete();
1236  fGeometries->Delete();
1237  fBrowsers->Delete();
1238  fCanvases->Delete("slow");
1239  fColors->Delete();
1240  fStyles->Delete();
1241 }
1242 
1243 
1244 ////////////////////////////////////////////////////////////////////////////////
1245 /// Find an object in one Root folder
1246 
1248 {
1249  Error("FindObject","Not yet implemented");
1250  return 0;
1251 }
1252 
1253 ////////////////////////////////////////////////////////////////////////////////
1254 /// Returns address of a ROOT object if it exists
1255 ///
1256 /// If name contains at least one "/" the function calls FindObjectany
1257 /// else
1258 /// This function looks in the following order in the ROOT lists:
1259 /// - List of files
1260 /// - List of memory mapped files
1261 /// - List of functions
1262 /// - List of geometries
1263 /// - List of canvases
1264 /// - List of styles
1265 /// - List of specials
1266 /// - List of materials in current geometry
1267 /// - List of shapes in current geometry
1268 /// - List of matrices in current geometry
1269 /// - List of Nodes in current geometry
1270 /// - Current Directory in memory
1271 /// - Current Directory on file
1272 
1273 TObject *TROOT::FindObject(const char *name) const
1274 {
1275  if (name && strstr(name,"/")) return FindObjectAny(name);
1276 
1277  TObject *temp = 0;
1278 
1279  temp = fFiles->FindObject(name); if (temp) return temp;
1280  temp = fMappedFiles->FindObject(name); if (temp) return temp;
1281  {
1282  R__LOCKGUARD(gROOTMutex);
1283  temp = fFunctions->FindObject(name);if (temp) return temp;
1284  }
1285  temp = fGeometries->FindObject(name); if (temp) return temp;
1286  temp = fCanvases->FindObject(name); if (temp) return temp;
1287  temp = fStyles->FindObject(name); if (temp) return temp;
1288  {
1289  R__LOCKGUARD(gROOTMutex);
1290  temp = fSpecials->FindObject(name); if (temp) return temp;
1291  }
1292  TIter next(fGeometries);
1293  TObject *obj;
1294  while ((obj=next())) {
1295  temp = obj->FindObject(name); if (temp) return temp;
1296  }
1297  if (gDirectory) temp = gDirectory->Get(name);
1298  if (temp) return temp;
1299  if (gPad) {
1300  TVirtualPad *canvas = gPad->GetVirtCanvas();
1301  if (fCanvases->FindObject(canvas)) { //this check in case call from TCanvas ctor
1302  temp = canvas->FindObject(name);
1303  if (!temp && canvas != gPad) temp = gPad->FindObject(name);
1304  }
1305  }
1306  return temp;
1307 }
1308 
1309 ////////////////////////////////////////////////////////////////////////////////
1310 /// Returns address and folder of a ROOT object if it exists
1311 ///
1312 /// This function looks in the following order in the ROOT lists:
1313 /// - List of files
1314 /// - List of memory mapped files
1315 /// - List of functions
1316 /// - List of geometries
1317 /// - List of canvases
1318 /// - List of styles
1319 /// - List of specials
1320 /// - List of materials in current geometry
1321 /// - List of shapes in current geometry
1322 /// - List of matrices in current geometry
1323 /// - List of Nodes in current geometry
1324 /// - Current Directory in memory
1325 /// - Current Directory on file
1326 
1327 TObject *TROOT::FindSpecialObject(const char *name, void *&where)
1328 {
1329  TObject *temp = 0;
1330  where = 0;
1331 
1332  if (!temp) {
1333  temp = fFiles->FindObject(name);
1334  where = fFiles;
1335  }
1336  if (!temp) {
1337  temp = fMappedFiles->FindObject(name);
1338  where = fMappedFiles;
1339  }
1340  if (!temp) {
1341  R__LOCKGUARD(gROOTMutex);
1342  temp = fFunctions->FindObject(name);
1343  where = fFunctions;
1344  }
1345  if (!temp) {
1346  temp = fCanvases->FindObject(name);
1347  where = fCanvases;
1348  }
1349  if (!temp) {
1350  temp = fStyles->FindObject(name);
1351  where = fStyles;
1352  }
1353  if (!temp) {
1354  temp = fSpecials->FindObject(name);
1355  where = fSpecials;
1356  }
1357  if (!temp) {
1358  TObject *glast = fGeometries->Last();
1359  if (glast) {where = glast; temp = glast->FindObject(name);}
1360  }
1361  if (!temp && gDirectory) {
1362  temp = gDirectory->Get(name);
1363  where = gDirectory;
1364  }
1365  if (!temp && gPad) {
1366  TVirtualPad *canvas = gPad->GetVirtCanvas();
1367  if (fCanvases->FindObject(canvas)) { //this check in case call from TCanvas ctor
1368  temp = canvas->FindObject(name);
1369  where = canvas;
1370  if (!temp && canvas != gPad) {
1371  temp = gPad->FindObject(name);
1372  where = gPad;
1373  }
1374  }
1375  }
1376  if (!temp) return 0;
1377  if (temp->TestBit(kNotDeleted)) return temp;
1378  return 0;
1379 }
1380 
1381 ////////////////////////////////////////////////////////////////////////////////
1382 /// Return a pointer to the first object with name starting at //root.
1383 /// This function scans the list of all folders.
1384 /// if no object found in folders, it scans the memory list of all files.
1385 
1386 TObject *TROOT::FindObjectAny(const char *name) const
1387 {
1388  TObject *obj = fRootFolder->FindObjectAny(name);
1389  if (obj) return obj;
1390  return gDirectory->FindObjectAnyFile(name);
1391 }
1392 
1393 ////////////////////////////////////////////////////////////////////////////////
1394 /// Scan the memory lists of all files for an object with name
1395 
1397 {
1398  R__LOCKGUARD(gROOTMutex);
1399  TDirectory *d;
1400  TIter next(GetListOfFiles());
1401  while ((d = (TDirectory*)next())) {
1402  // Call explicitly TDirectory::FindObject to restrict the search to the
1403  // already in memory object.
1404  TObject *obj = d->TDirectory::FindObject(name);
1405  if (obj) return obj;
1406  }
1407  return 0;
1408 }
1409 
1410 ////////////////////////////////////////////////////////////////////////////////
1411 /// Returns class name of a ROOT object including CINT globals.
1412 
1413 const char *TROOT::FindObjectClassName(const char *name) const
1414 {
1415  // Search first in the list of "standard" objects
1416  TObject *obj = FindObject(name);
1417  if (obj) return obj->ClassName();
1418 
1419  // Is it a global variable?
1420  TGlobal *g = GetGlobal(name);
1421  if (g) return g->GetTypeName();
1422 
1423  return 0;
1424 }
1425 
1426 ////////////////////////////////////////////////////////////////////////////////
1427 /// Return path name of obj somewhere in the //root/... path.
1428 /// The function returns the first occurence of the object in the list
1429 /// of folders. The returned string points to a static char array in TROOT.
1430 /// If this function is called in a loop or recursively, it is the
1431 /// user's responsibility to copy this string in their area.
1432 
1433 const char *TROOT::FindObjectPathName(const TObject *) const
1434 {
1435  Error("FindObjectPathName","Not yet implemented");
1436  return "??";
1437 }
1438 
1439 ////////////////////////////////////////////////////////////////////////////////
1440 /// return a TClass object corresponding to 'name' assuming it is an STL container.
1441 /// In particular we looking for possible alternative name (default template
1442 /// parameter, typedefs template arguments, typedefed name).
1443 
1444 TClass *TROOT::FindSTLClass(const char *name, Bool_t load, Bool_t silent) const
1445 {
1446  // Example of inputs are
1447  // vector<int> (*)
1448  // vector<Int_t>
1449  // vector<long long>
1450  // vector<Long_64_t> (*)
1451  // vector<int, allocator<int> >
1452  // vector<Int_t, allocator<int> >
1453  //
1454  // One of the possibly expensive operation is the resolving of the typedef
1455  // which can provoke the parsing of the header files (and/or the loading
1456  // of clang pcms information).
1457 
1459 
1460  // Remove std::, allocator, typedef, add Long64_t, etc. in just one call.
1461  std::string normalized;
1462  TClassEdit::GetNormalizedName(normalized, name);
1463 
1464  TClass *cl = 0;
1465  if (normalized != name) cl = TClass::GetClass(normalized.c_str(),load,silent);
1466 
1467  if (load && cl==0) {
1468  // Create an Emulated class for this container.
1469  cl = gInterpreter->GenerateTClass(normalized.c_str(), kTRUE, silent);
1470  }
1471 
1472  return cl;
1473 }
1474 
1475 ////////////////////////////////////////////////////////////////////////////////
1476 /// Return pointer to class with name. Obsolete, use TClass::GetClass directly
1477 
1478 TClass *TROOT::GetClass(const char *name, Bool_t load, Bool_t silent) const
1479 {
1480  return TClass::GetClass(name,load,silent);
1481 }
1482 
1483 
1484 ////////////////////////////////////////////////////////////////////////////////
1485 /// Return pointer to class from its name. Obsolete, use TClass::GetClass directly
1486 /// See TClass::GetClass
1487 
1488 TClass *TROOT::GetClass(const std::type_info& typeinfo, Bool_t load, Bool_t silent) const
1489 {
1490  return TClass::GetClass(typeinfo,load,silent);
1491 }
1492 
1493 ////////////////////////////////////////////////////////////////////////////////
1494 /// Return address of color with index color.
1495 
1497 {
1499  TObjArray *lcolors = (TObjArray*) GetListOfColors();
1500  if (!lcolors) return 0;
1501  if (color < 0 || color >= lcolors->GetSize()) return 0;
1502  TColor *col = (TColor*)lcolors->At(color);
1503  if (col && col->GetNumber() == color) return col;
1504  TIter next(lcolors);
1505  while ((col = (TColor *) next()))
1506  if (col->GetNumber() == color) return col;
1507 
1508  return 0;
1509 }
1510 
1511 ////////////////////////////////////////////////////////////////////////////////
1512 /// Return a default canvas.
1513 
1515 {
1516  return (TCanvas*)gROOT->ProcessLine("TCanvas::MakeDefCanvas();");
1517 }
1518 
1519 ////////////////////////////////////////////////////////////////////////////////
1520 /// Return pointer to type with name.
1521 
1522 TDataType *TROOT::GetType(const char *name, Bool_t /* load */) const
1523 {
1524  return (TDataType*)gROOT->GetListOfTypes()->FindObject(name);
1525 }
1526 
1527 ////////////////////////////////////////////////////////////////////////////////
1528 /// Return pointer to file with name.
1529 
1530 TFile *TROOT::GetFile(const char *name) const
1531 {
1532  R__LOCKGUARD(gROOTMutex);
1533  return (TFile*)GetListOfFiles()->FindObject(name);
1534 }
1535 
1536 ////////////////////////////////////////////////////////////////////////////////
1537 /// Return pointer to style with name
1538 
1539 TStyle *TROOT::GetStyle(const char *name) const
1540 {
1541  return (TStyle*)GetListOfStyles()->FindObject(name);
1542 }
1543 
1544 ////////////////////////////////////////////////////////////////////////////////
1545 /// Return pointer to function with name.
1546 
1547 TObject *TROOT::GetFunction(const char *name) const
1548 {
1549  if (name == 0 || name[0] == 0) {
1550  return 0;
1551  }
1552 
1553  {
1554  R__LOCKGUARD(gROOTMutex);
1555  TObject *f1 = fFunctions->FindObject(name);
1556  if (f1) return f1;
1557  }
1558 
1559  gROOT->ProcessLine("TF1::InitStandardFunctions();");
1560 
1561  R__LOCKGUARD(gROOTMutex);
1562  return fFunctions->FindObject(name);
1563 }
1564 
1565 ////////////////////////////////////////////////////////////////////////////////
1566 
1568 {
1569  if (!gInterpreter) return 0;
1570 
1572 
1573  return (TFunctionTemplate*)fFuncTemplate->FindObject(name);
1574 }
1575 
1576 ////////////////////////////////////////////////////////////////////////////////
1577 /// Return pointer to global variable by name. If load is true force
1578 /// reading of all currently defined globals from CINT (more expensive).
1579 
1580 TGlobal *TROOT::GetGlobal(const char *name, Bool_t load) const
1581 {
1582  return (TGlobal *)gROOT->GetListOfGlobals(load)->FindObject(name);
1583 }
1584 
1585 ////////////////////////////////////////////////////////////////////////////////
1586 /// Return pointer to global variable with address addr.
1587 
1588 TGlobal *TROOT::GetGlobal(const TObject *addr, Bool_t /* load */) const
1589 {
1590  if (addr == 0 || ((Long_t)addr) == -1) return 0;
1591 
1592  TInterpreter::DeclId_t decl = gInterpreter->GetDataMemberAtAddr(addr);
1593  if (decl) {
1594  TListOfDataMembers *globals = ((TListOfDataMembers*)(gROOT->GetListOfGlobals(kFALSE)));
1595  return (TGlobal*)globals->Get(decl);
1596  }
1597  // If we are actually looking for a global that is held by a global
1598  // pointer (for example gRandom), we need to find a pointer with the
1599  // correct value.
1600  decl = gInterpreter->GetDataMemberWithValue(addr);
1601  if (decl) {
1602  TListOfDataMembers *globals = ((TListOfDataMembers*)(gROOT->GetListOfGlobals(kFALSE)));
1603  return (TGlobal*)globals->Get(decl);
1604  }
1605  return 0;
1606 }
1607 
1608 ////////////////////////////////////////////////////////////////////////////////
1609 /// Internal routine returning, and creating if necessary, the list
1610 /// of global function.
1611 
1613 {
1615  return fGlobalFunctions;
1616 }
1617 
1618 ////////////////////////////////////////////////////////////////////////////////
1619 /// Return the collection of functions named "name".
1620 
1622 {
1623  return ((TListOfFunctions*)fGlobalFunctions)->GetListForObject(name);
1624 }
1625 
1626 ////////////////////////////////////////////////////////////////////////////////
1627 /// Return pointer to global function by name.
1628 /// If params != 0 it will also resolve overloading other it returns the first
1629 /// name match.
1630 /// If params == 0 and load is true force reading of all currently defined
1631 /// global functions from Cling.
1632 /// The param string must be of the form: "3189,\"aap\",1.3".
1633 
1634 TFunction *TROOT::GetGlobalFunction(const char *function, const char *params,
1635  Bool_t load)
1636 {
1637  if (!params) {
1638  R__LOCKGUARD(gROOTMutex);
1639  return (TFunction *)GetListOfGlobalFunctions(load)->FindObject(function);
1640  } else {
1641  if (!fInterpreter)
1642  Fatal("GetGlobalFunction", "fInterpreter not initialized");
1643 
1644  R__LOCKGUARD(gROOTMutex);
1645  TInterpreter::DeclId_t decl = gInterpreter->GetFunctionWithValues(0,
1646  function, params,
1647  false);
1648 
1649  if (!decl) return 0;
1650 
1651  TFunction *f = GetGlobalFunctions()->Get(decl);
1652  if (f) return f;
1653 
1654  Error("GetGlobalFunction",
1655  "\nDid not find matching TFunction <%s> with \"%s\".",
1656  function,params);
1657  return 0;
1658  }
1659 }
1660 
1661 ////////////////////////////////////////////////////////////////////////////////
1662 /// Return pointer to global function by name. If proto != 0
1663 /// it will also resolve overloading. If load is true force reading
1664 /// of all currently defined global functions from CINT (more expensive).
1665 /// The proto string must be of the form: "int, char*, float".
1666 
1668  const char *proto, Bool_t load)
1669 {
1670  if (!proto) {
1671  R__LOCKGUARD(gROOTMutex);
1672  return (TFunction *)GetListOfGlobalFunctions(load)->FindObject(function);
1673  } else {
1674  if (!fInterpreter)
1675  Fatal("GetGlobalFunctionWithPrototype", "fInterpreter not initialized");
1676 
1677  R__LOCKGUARD(gROOTMutex);
1678  TInterpreter::DeclId_t decl = gInterpreter->GetFunctionWithPrototype(0,
1679  function, proto);
1680 
1681  if (!decl) return 0;
1682 
1683  TFunction *f = GetGlobalFunctions()->Get(decl);
1684  if (f) return f;
1685 
1686  Error("GetGlobalFunctionWithPrototype",
1687  "\nDid not find matching TFunction <%s> with \"%s\".",
1688  function,proto);
1689  return 0;
1690  }
1691 }
1692 
1693 ////////////////////////////////////////////////////////////////////////////////
1694 /// Return pointer to Geometry with name
1695 
1696 TObject *TROOT::GetGeometry(const char *name) const
1697 {
1698  return GetListOfGeometries()->FindObject(name);
1699 }
1700 
1701 ////////////////////////////////////////////////////////////////////////////////
1702 
1704 {
1705  if(!fEnums.load()) {
1706  R__LOCKGUARD(gROOTMutex);
1707  // Test again just in case, another thread did the work while we were
1708  // waiting.
1709  if (!fEnums.load()) fEnums = new TListOfEnumsWithLock(0);
1710  }
1711  if (load) {
1712  R__LOCKGUARD(gROOTMutex);
1713  (*fEnums).Load(); // Refresh the list of enums.
1714  }
1715  return fEnums.load();
1716 }
1717 
1718 ////////////////////////////////////////////////////////////////////////////////
1719 
1721 {
1722  R__LOCKGUARD(gROOTMutex);
1723  if(!fFuncTemplate) {
1725  }
1726  return fFuncTemplate;
1727 }
1728 
1729 ////////////////////////////////////////////////////////////////////////////////
1730 /// Return list containing the TGlobals currently defined.
1731 /// Since globals are created and deleted during execution of the
1732 /// program, we need to update the list of globals every time we
1733 /// execute this method. However, when calling this function in
1734 /// a (tight) loop where no interpreter symbols will be created
1735 /// you can set load=kFALSE (default).
1736 
1738 {
1739  if (!fGlobals) {
1740  // We add to the list the "funcky-fake" globals.
1741  fGlobals = new TListOfDataMembers(0);
1742  fGlobals->Add(new TGlobalMappedFunction("gROOT", "TROOT*",
1744  fGlobals->Add(new TGlobalMappedFunction("gPad", "TVirtualPad*",
1746  fGlobals->Add(new TGlobalMappedFunction("gInterpreter", "TInterpreter*",
1748  fGlobals->Add(new TGlobalMappedFunction("gVirtualX", "TVirtualX*",
1750  fGlobals->Add(new TGlobalMappedFunction("gDirectory", "TDirectory*",
1752  // Don't let TGlobalMappedFunction delete our globals, now that we take them.
1756  }
1757 
1758  if (!fInterpreter)
1759  Fatal("GetListOfGlobals", "fInterpreter not initialized");
1760 
1761  if (load) fGlobals->Load();
1762 
1763  return fGlobals;
1764 }
1765 
1766 ////////////////////////////////////////////////////////////////////////////////
1767 /// Return list containing the TFunctions currently defined.
1768 /// Since functions are created and deleted during execution of the
1769 /// program, we need to update the list of functions every time we
1770 /// execute this method. However, when calling this function in
1771 /// a (tight) loop where no interpreter symbols will be created
1772 /// you can set load=kFALSE (default).
1773 
1775 {
1776  R__LOCKGUARD(gROOTMutex);
1777 
1778  if (!fGlobalFunctions) {
1780  }
1781 
1782  if (!fInterpreter)
1783  Fatal("GetListOfGlobalFunctions", "fInterpreter not initialized");
1784 
1785  // A thread that calls with load==true and a thread that calls with load==false
1786  // will conflict here (the load==true will be updating the list while the
1787  // other is reading it). To solve the problem, we could use a read-write lock
1788  // inside the list itself.
1789  if (load) fGlobalFunctions->Load();
1790 
1791  return fGlobalFunctions;
1792 }
1793 
1794 ////////////////////////////////////////////////////////////////////////////////
1795 /// Return a dynamic list giving access to all TDataTypes (typedefs)
1796 /// currently defined.
1797 ///
1798 /// The list is populated on demand. Calling
1799 /// ~~~ {.cpp}
1800 /// gROOT->GetListOfTypes()->FindObject(nameoftype);
1801 /// ~~~
1802 /// will return the TDataType corresponding to 'nameoftype'. If the
1803 /// TDataType is not already in the list itself and the type does exist,
1804 /// a new TDataType will be created and added to the list.
1805 ///
1806 /// Calling
1807 /// ~~~ {.cpp}
1808 /// gROOT->GetListOfTypes()->ls(); // or Print()
1809 /// ~~~
1810 /// list only the typedefs that have been previously accessed through the
1811 /// list (plus the builtins types).
1812 
1814 {
1815  if (!fInterpreter)
1816  Fatal("GetListOfTypes", "fInterpreter not initialized");
1817 
1818  return fTypes;
1819 }
1820 
1821 
1822 ////////////////////////////////////////////////////////////////////////////////
1823 /// Execute command when system has been idle for idleTimeInSec seconds.
1824 
1825 void TROOT::Idle(UInt_t idleTimeInSec, const char *command)
1826 {
1827  if (!fApplication.load())
1829 
1830  if (idleTimeInSec <= 0)
1831  (*fApplication).RemoveIdleTimer();
1832  else
1833  (*fApplication).SetIdleTimer(idleTimeInSec, command);
1834 }
1835 
1836 ////////////////////////////////////////////////////////////////////////////////
1837 /// Check whether className is a known class, and only autoload
1838 /// if we can. Helper function for TROOT::IgnoreInclude().
1839 
1840 static TClass* R__GetClassIfKnown(const char* className)
1841 {
1842  // Check whether the class is available for auto-loading first:
1843  const char* libsToLoad = gInterpreter->GetClassSharedLibs(className);
1844  TClass* cla = 0;
1845  if (libsToLoad) {
1846  // trigger autoload, and only create TClass in this case.
1847  return TClass::GetClass(className);
1848  } else if (gROOT->GetListOfClasses()
1849  && (cla = (TClass*)gROOT->GetListOfClasses()->FindObject(className))) {
1850  // cla assigned in if statement
1851  } else if (gClassTable->FindObject(className)) {
1852  return TClass::GetClass(className);
1853  }
1854  return cla;
1855 }
1856 
1857 ////////////////////////////////////////////////////////////////////////////////
1858 /// Return 1 if the name of the given include file corresponds to a class that
1859 /// is known to ROOT, e.g. "TLorentzVector.h" versus TLorentzVector.
1860 
1861 Int_t TROOT::IgnoreInclude(const char *fname, const char * /*expandedfname*/)
1862 {
1863  if (fname == 0) return 0;
1864 
1865  TString stem(fname);
1866  // Remove extension if any, ignore files with extension not being .h*
1867  Int_t where = stem.Last('.');
1868  if (where != kNPOS) {
1869  if (stem.EndsWith(".so") || stem.EndsWith(".sl") ||
1870  stem.EndsWith(".dl") || stem.EndsWith(".a") ||
1871  stem.EndsWith(".dll", TString::kIgnoreCase))
1872  return 0;
1873  stem.Remove(where);
1874  }
1875 
1876  TString className = gSystem->BaseName(stem);
1877  TClass* cla = R__GetClassIfKnown(className);
1878  if (!cla) {
1879  // Try again with modifications to the file name:
1880  className = stem;
1881  className.ReplaceAll("/", "::");
1882  className.ReplaceAll("\\", "::");
1883  if (className.Contains(":::")) {
1884  // "C:\dir" becomes "C:::dir".
1885  // fname corresponds to whatever is stated after #include and
1886  // a full path name usually means that it's not a regular #include
1887  // but e.g. a ".L", so we can assume that this is not a header of
1888  // a class in a namespace (a global-namespace class would have been
1889  // detected already before).
1890  return 0;
1891  }
1892  cla = R__GetClassIfKnown(className);
1893  }
1894 
1895  if (!cla) {
1896  return 0;
1897  }
1898 
1899  // cla is valid, check wether it's actually in the header of the same name:
1900  if (cla->GetDeclFileLine() <= 0) return 0; // to a void an error with VisualC++
1901  TString decfile = gSystem->BaseName(cla->GetDeclFileName());
1902  if (decfile != gSystem->BaseName(fname)) {
1903  return 0;
1904  }
1905  return 1;
1906 }
1907 
1908 ////////////////////////////////////////////////////////////////////////////////
1909 /// Initialize operating system interface.
1910 
1912 {
1913  if (gSystem == 0) {
1914 #if defined(R__UNIX)
1915 #if defined(R__HAS_COCOA)
1916  gSystem = new TMacOSXSystem;
1917 #else
1918  gSystem = new TUnixSystem;
1919 #endif
1920 #elif defined(R__WIN32)
1921  gSystem = new TWinNTSystem;
1922 #else
1923  gSystem = new TSystem;
1924 #endif
1925 
1926  if (gSystem->Init())
1927  fprintf(stderr, "Fatal in <TROOT::InitSystem>: can't init operating system layer\n");
1928 
1929  if (!gSystem->HomeDirectory()) {
1930  fprintf(stderr, "Fatal in <TROOT::InitSystem>: HOME directory not set\n");
1931  fprintf(stderr, "Fix this by defining the HOME shell variable\n");
1932  }
1933 
1934  // read default files
1935  gEnv = new TEnv(".rootrc");
1936 
1937  gDebug = gEnv->GetValue("Root.Debug", 0);
1938 
1939  if (!gEnv->GetValue("Root.ErrorHandlers", 1))
1940  gSystem->ResetSignals();
1941 
1942  // by default the zipmode is 1 (see Bits.h)
1943  Int_t zipmode = gEnv->GetValue("Root.ZipMode", 1);
1944  if (zipmode != 1) R__SetZipMode(zipmode);
1945 
1946  const char *sdeb;
1947  if ((sdeb = gSystem->Getenv("ROOTDEBUG")))
1948  gDebug = atoi(sdeb);
1949 
1950  if (gDebug > 0 && isatty(2))
1951  fprintf(stderr, "Info in <TROOT::InitSystem>: running with gDebug = %d\n", gDebug);
1952 
1953  if (gEnv->GetValue("Root.MemStat", 0))
1955  int msize = gEnv->GetValue("Root.MemStat.size", -1);
1956  int mcnt = gEnv->GetValue("Root.MemStat.cnt", -1);
1957  if (msize != -1 || mcnt != -1)
1958  TStorage::EnableStatistics(msize, mcnt);
1959 
1960  fgMemCheck = gEnv->GetValue("Root.MemCheck", 0);
1961 
1962 #if defined(R__HAS_COCOA)
1963  // create and delete a dummy TUrl so that TObjectStat table does not contain
1964  // objects that are deleted after recording is turned-off (in next line),
1965  // like the TUrl::fgSpecialProtocols list entries which are created in the
1966  // TMacOSXSystem ctor.
1967  { TUrl dummy("/dummy"); }
1968 #endif
1969  TObject::SetObjectStat(gEnv->GetValue("Root.ObjectStat", 0));
1970  }
1971 }
1972 
1973 ////////////////////////////////////////////////////////////////////////////////
1974 /// Load and initialize thread library.
1975 
1977 {
1978  if (gEnv->GetValue("Root.UseThreads", 0) || gEnv->GetValue("Root.EnableThreadSafety", 0)) {
1980  }
1981 }
1982 
1983 ////////////////////////////////////////////////////////////////////////////////
1984 /// Initialize the interpreter. Should be called only after main(),
1985 /// to make sure LLVM/Clang is fully initialized.
1986 
1988 {
1989  // usedToIdentifyRootClingByDlSym is available when TROOT is part of
1990  // rootcling.
1991  if (!dlsym(RTLD_DEFAULT, "usedToIdentifyRootClingByDlSym")
1992  && !dlsym(RTLD_DEFAULT, "usedToIdentifyStaticRoot")) {
1993  // Make sure no llvm symbols are visible before loading libCling. If they
1994  // exist libCling will use those and not ours, causing havoc in the
1995  // interpreter. Look for an extern "C" symbol to avoid mangling; look for a
1996  // symbol from llvm because clang builds on top, so users would likely
1997  // have also their own llvm symbols when providing their own clang.
1998  void *LLVMEnablePrettyStackTraceAddr = 0;
1999  // Can't use gSystem->DynFindSymbol() because that iterates over all *known*
2000  // libraries which is not the same!
2001  LLVMEnablePrettyStackTraceAddr = dlsym(RTLD_DEFAULT, "LLVMEnablePrettyStackTrace");
2002  // FIXME: When we configure with -Dclingtest=On we intentionally export the symbols. Silence this error.
2003  if (LLVMEnablePrettyStackTraceAddr) {
2004  Error("InitInterpreter()", "LLVM SYMBOLS ARE EXPOSED TO CLING! "
2005  "This will cause problems; please hide them or dlopen() them "
2006  "after the call to TROOT::InitInterpreter()!");
2007  }
2008 
2009  char *libRIO = gSystem->DynamicPathName("libRIO");
2010  void *libRIOHandle = dlopen(libRIO, RTLD_NOW|RTLD_GLOBAL);
2011  delete [] libRIO;
2012  if (!libRIOHandle) {
2013  TString err = dlerror();
2014  fprintf(stderr, "Fatal in <TROOT::InitInterpreter>: cannot load library %s\n", err.Data());
2015  exit(1);
2016  }
2017 
2018  char *libcling = gSystem->DynamicPathName("libCling");
2019  gInterpreterLib = dlopen(libcling, RTLD_LAZY|RTLD_LOCAL);
2020  delete [] libcling;
2021 
2022  if (!gInterpreterLib) {
2023  TString err = dlerror();
2024  fprintf(stderr, "Fatal in <TROOT::InitInterpreter>: cannot load library %s\n", err.Data());
2025  exit(1);
2026  }
2027  dlerror(); // reset error message
2028  } else {
2029  gInterpreterLib = RTLD_DEFAULT;
2030  }
2031  CreateInterpreter_t *CreateInterpreter = (CreateInterpreter_t*) dlsym(gInterpreterLib, "CreateInterpreter");
2032  if (!CreateInterpreter) {
2033  TString err = dlerror();
2034  fprintf(stderr, "Fatal in <TROOT::InitInterpreter>: cannot load symbol %s\n", err.Data());
2035  exit(1);
2036  }
2037  // Schedule the destruction of TROOT.
2038  atexit(at_exit_of_TROOT);
2039 
2040  gDestroyInterpreter = (DestroyInterpreter_t*) dlsym(gInterpreterLib, "DestroyInterpreter");
2041  if (!gDestroyInterpreter) {
2042  TString err = dlerror();
2043  fprintf(stderr, "Fatal in <TROOT::InitInterpreter>: cannot load symbol %s\n", err.Data());
2044  exit(1);
2045  }
2046 
2047  fInterpreter = CreateInterpreter(gInterpreterLib);
2048 
2051 
2052  fgRootInit = kTRUE;
2053 
2054  // initialize gClassTable is not already done
2055  if (!gClassTable)
2056  new TClassTable;
2057 
2058  // Initialize all registered dictionaries.
2059  for (std::vector<ModuleHeaderInfo_t>::const_iterator
2060  li = GetModuleHeaderInfoBuffer().begin(),
2061  le = GetModuleHeaderInfoBuffer().end(); li != le; ++li) {
2062  // process buffered module registrations
2063  fInterpreter->RegisterModule(li->fModuleName,
2064  li->fHeaders,
2065  li->fIncludePaths,
2066  li->fPayloadCode,
2067  li->fFwdDeclCode,
2068  li->fTriggerFunc,
2069  li->fFwdNargsToKeepColl,
2070  li->fClassesHeaders,
2071  kTRUE /*lateRegistration*/);
2072  }
2073  GetModuleHeaderInfoBuffer().clear();
2074 
2076 
2077  // Read the rules before enabling the auto loading to not inadvertently
2078  // load the libraries for the classes concerned even-though the user is
2079  // *not* using them.
2080  TClass::ReadRules(); // Read the default customization rules ...
2081 
2082  // Enable autoloading
2084 }
2085 
2086 ////////////////////////////////////////////////////////////////////////////////
2087 /// Helper function used by TClass::GetClass().
2088 /// This function attempts to load the dictionary for 'classname'
2089 /// either from the TClassTable or from the list of generator.
2090 /// If silent is 'true', do not warn about missing dictionary for the class.
2091 /// (typically used for class that are used only for transient members)
2092 ///
2093 /// The 'requestedname' is expected to be already normalized.
2094 
2095 TClass *TROOT::LoadClass(const char *requestedname, Bool_t silent) const
2096 {
2097  return TClass::LoadClass(requestedname, silent);
2098 }
2099 
2100 ////////////////////////////////////////////////////////////////////////////////
2101 /// Check if class "classname" is known to the interpreter (in fact,
2102 /// this check is not needed anymore, so classname is ignored). If
2103 /// not it will load library "libname". If the library name does
2104 /// not start with "lib", "lib" will be prepended and a search will
2105 /// be made in the DynamicPath (see .rootrc). If not found a search
2106 /// will be made on libname (without "lib" prepended) and if not found
2107 /// a direct try of libname will be made (in case it contained an
2108 /// absolute path).
2109 /// If check is true it will only check if libname exists and is
2110 /// readable.
2111 /// Returns 0 on successful loading, -1 in case libname does not
2112 /// exist or in case of error and -2 in case of version mismatch.
2113 
2114 Int_t TROOT::LoadClass(const char * /*classname*/, const char *libname,
2115  Bool_t check)
2116 {
2117  Int_t err = -1;
2118 
2119  char *path;
2120  TString lib = libname;
2121  if (!lib.BeginsWith("lib"))
2122  lib = "lib" + lib;
2123  if ((path = gSystem->DynamicPathName(lib, kTRUE))) {
2124  if (check)
2125  err = 0;
2126  else {
2127  err = gSystem->Load(path, 0, kTRUE);
2128  }
2129  delete [] path;
2130  } else {
2131  if (check) {
2132  FileStat_t stat;
2133  if (!gSystem->GetPathInfo(libname, stat)) {
2134  if (R_ISREG(stat.fMode) &&
2136  err = 0;
2137  else
2138  err = -1;
2139  } else
2140  err = -1;
2141  } else {
2142  err = gSystem->Load(libname, 0, kTRUE);
2143  }
2144  }
2145 
2146  if (err == -1) {
2147  //Error("LoadClass", "library %s could not be loaded", libname);
2148  }
2149 
2150  if (err == 1) {
2151  //Error("LoadClass", "library %s already loaded, but class %s unknown",
2152  // libname, classname);
2153  err = 0;
2154  }
2155 
2156  return err;
2157 }
2158 
2159 ////////////////////////////////////////////////////////////////////////////////
2160 /// Return true if the file is local and is (likely) to be a ROOT file
2161 
2162 Bool_t TROOT::IsRootFile(const char *filename) const
2163 {
2164  Bool_t result = kFALSE;
2165  FILE *mayberootfile = fopen(filename,"rb");
2166  if (mayberootfile) {
2167  char header[5];
2168  if (fgets(header,5,mayberootfile)) {
2169  result = strncmp(header,"root",4)==0;
2170  }
2171  fclose(mayberootfile);
2172  }
2173  return result;
2174 }
2175 
2176 ////////////////////////////////////////////////////////////////////////////////
2177 /// To list all objects of the application.
2178 /// Loop on all objects created in the ROOT linked lists.
2179 /// Objects may be files and windows or any other object directly
2180 /// attached to the ROOT linked list.
2181 
2182 void TROOT::ls(Option_t *option) const
2183 {
2184 // TObject::SetDirLevel();
2185 // GetList()->R__FOR_EACH(TObject,ls)(option);
2186  TDirectory::ls(option);
2187 }
2188 
2189 ////////////////////////////////////////////////////////////////////////////////
2190 /// Load a macro in the interpreter's memory. Equivalent to the command line
2191 /// command ".L filename". If the filename has "+" or "++" appended
2192 /// the macro will be compiled by ACLiC. The filename must have the format:
2193 /// [path/]macro.C[+|++[g|O]].
2194 /// The possible error codes are defined by TInterpreter::EErrorCode.
2195 /// If check is true it will only check if filename exists and is
2196 /// readable.
2197 /// Returns 0 on successful loading and -1 in case filename does not
2198 /// exist or in case of error.
2199 
2200 Int_t TROOT::LoadMacro(const char *filename, int *error, Bool_t check)
2201 {
2202  Int_t err = -1;
2203  Int_t lerr, *terr;
2204  if (error)
2205  terr = error;
2206  else
2207  terr = &lerr;
2208 
2209  if (fInterpreter) {
2210  TString aclicMode;
2211  TString arguments;
2212  TString io;
2213  TString fname = gSystem->SplitAclicMode(filename, aclicMode, arguments, io);
2214 
2215  if (arguments.Length()) {
2216  Warning("LoadMacro", "argument(%s) ignored in %s", arguments.Data(), GetMacroPath());
2217  }
2218  char *mac = gSystem->Which(GetMacroPath(), fname, kReadPermission);
2219  if (!mac) {
2220  if (!check)
2221  Error("LoadMacro", "macro %s not found in path %s", fname.Data(), GetMacroPath());
2222  *terr = TInterpreter::kFatal;
2223  } else {
2224  err = 0;
2225  if (!check) {
2226  fname = mac;
2227  fname += aclicMode;
2228  fname += io;
2229  gInterpreter->LoadMacro(fname.Data(), (TInterpreter::EErrorCode*)terr);
2230  if (*terr)
2231  err = -1;
2232  }
2233  }
2234  delete [] mac;
2235  }
2236  return err;
2237 }
2238 
2239 ////////////////////////////////////////////////////////////////////////////////
2240 /// Execute a macro in the interpreter. Equivalent to the command line
2241 /// command ".x filename". If the filename has "+" or "++" appended
2242 /// the macro will be compiled by ACLiC. The filename must have the format:
2243 /// [path/]macro.C[+|++[g|O]][(args)].
2244 /// The possible error codes are defined by TInterpreter::EErrorCode.
2245 /// If padUpdate is true (default) update the current pad.
2246 /// Returns the macro return value.
2247 
2248 Long_t TROOT::Macro(const char *filename, Int_t *error, Bool_t padUpdate)
2249 {
2250  Long_t result = 0;
2251 
2252  if (fInterpreter) {
2253  TString aclicMode;
2254  TString arguments;
2255  TString io;
2256  TString fname = gSystem->SplitAclicMode(filename, aclicMode, arguments, io);
2257 
2258  char *mac = gSystem->Which(GetMacroPath(), fname, kReadPermission);
2259  if (!mac) {
2260  Error("Macro", "macro %s not found in path %s", fname.Data(), GetMacroPath());
2261  if (error)
2262  *error = TInterpreter::kFatal;
2263  } else {
2264  fname = mac;
2265  fname += aclicMode;
2266  fname += arguments;
2267  fname += io;
2268  result = gInterpreter->ExecuteMacro(fname, (TInterpreter::EErrorCode*)error);
2269  }
2270  delete [] mac;
2271 
2272  if (padUpdate && gPad)
2273  gPad->Update();
2274  }
2275 
2276  return result;
2277 }
2278 
2279 ////////////////////////////////////////////////////////////////////////////////
2280 /// Process message id called by obj.
2281 
2282 void TROOT::Message(Int_t id, const TObject *obj)
2283 {
2284  TIter next(fMessageHandlers);
2285  TMessageHandler *mh;
2286  while ((mh = (TMessageHandler*)next())) {
2287  mh->HandleMessage(id,obj);
2288  }
2289 }
2290 
2291 ////////////////////////////////////////////////////////////////////////////////
2292 /// Process interpreter command via TApplication::ProcessLine().
2293 /// On Win32 the line will be processed asynchronously by sending
2294 /// it to the CINT interpreter thread. For explicit synchronous processing
2295 /// use ProcessLineSync(). On non-Win32 platforms there is no difference
2296 /// between ProcessLine() and ProcessLineSync().
2297 /// The possible error codes are defined by TInterpreter::EErrorCode. In
2298 /// particular, error will equal to TInterpreter::kProcessing until the
2299 /// CINT interpreted thread has finished executing the line.
2300 /// Returns the result of the command, cast to a Long_t.
2301 
2302 Long_t TROOT::ProcessLine(const char *line, Int_t *error)
2303 {
2304  TString sline = line;
2305  sline = sline.Strip(TString::kBoth);
2306 
2307  if (!fApplication.load())
2309 
2310  return (*fApplication).ProcessLine(sline, kFALSE, error);
2311 }
2312 
2313 ////////////////////////////////////////////////////////////////////////////////
2314 /// Process interpreter command via TApplication::ProcessLine().
2315 /// On Win32 the line will be processed synchronously (i.e. it will
2316 /// only return when the CINT interpreter thread has finished executing
2317 /// the line). On non-Win32 platforms there is no difference between
2318 /// ProcessLine() and ProcessLineSync().
2319 /// The possible error codes are defined by TInterpreter::EErrorCode.
2320 /// Returns the result of the command, cast to a Long_t.
2321 
2323 {
2324  TString sline = line;
2325  sline = sline.Strip(TString::kBoth);
2326 
2327  if (!fApplication.load())
2329 
2330  return (*fApplication).ProcessLine(sline, kTRUE, error);
2331 }
2332 
2333 ////////////////////////////////////////////////////////////////////////////////
2334 /// Process interpreter command directly via CINT interpreter.
2335 /// Only executable statements are allowed (no variable declarations),
2336 /// In all other cases use TROOT::ProcessLine().
2337 /// The possible error codes are defined by TInterpreter::EErrorCode.
2338 
2340 {
2341  TString sline = line;
2342  sline = sline.Strip(TString::kBoth);
2343 
2344  if (!fApplication.load())
2346 
2347  Long_t result = 0;
2348 
2349  if (fInterpreter) {
2351  result = gInterpreter->Calc(sline, code);
2352  }
2353 
2354  return result;
2355 }
2356 
2357 ////////////////////////////////////////////////////////////////////////////////
2358 /// Read Git commit information and branch name from the
2359 /// etc/gitinfo.txt file.
2360 
2362 {
2363 #ifdef ROOT_GIT_COMMIT
2364  fGitCommit = ROOT_GIT_COMMIT;
2365 #endif
2366 #ifdef ROOT_GIT_BRANCH
2367  fGitBranch = ROOT_GIT_BRANCH;
2368 #endif
2369 
2370  TString gitinfo = "gitinfo.txt";
2371  char *filename = gSystem->ConcatFileName(TROOT::GetEtcDir(), gitinfo);
2372 
2373  FILE *fp = fopen(filename, "r");
2374  if (fp) {
2375  TString s;
2376  // read branch name
2377  s.Gets(fp);
2378  fGitBranch = s;
2379  // read commit SHA1
2380  s.Gets(fp);
2381  fGitCommit = s;
2382  // read date/time make was run
2383  s.Gets(fp);
2384  fGitDate = s;
2385  fclose(fp);
2386  }
2387  delete [] filename;
2388 }
2389 
2391  TTHREAD_TLS(Bool_t) fgReadingObject = false;
2392  return fgReadingObject;
2393 }
2394 
2395 ////////////////////////////////////////////////////////////////////////////////
2396 /// Deprecated (will be removed in next release).
2397 
2399 {
2400  return GetReadingObject();
2401 }
2402 
2404 {
2405  GetReadingObject() = flag;
2406 }
2407 
2408 
2409 ////////////////////////////////////////////////////////////////////////////////
2410 /// Return date/time make was run.
2411 
2412 const char *TROOT::GetGitDate()
2413 {
2414  if (fGitDate == "") {
2415  Int_t iday,imonth,iyear, ihour, imin;
2416  static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
2417  "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
2418  Int_t idate = gROOT->GetBuiltDate();
2419  Int_t itime = gROOT->GetBuiltTime();
2420  iday = idate%100;
2421  imonth = (idate/100)%100;
2422  iyear = idate/10000;
2423  ihour = itime/100;
2424  imin = itime%100;
2425  fGitDate.Form("%s %02d %4d, %02d:%02d:00", months[imonth-1], iday, iyear, ihour, imin);
2426  }
2427  return fGitDate;
2428 }
2429 
2430 ////////////////////////////////////////////////////////////////////////////////
2431 /// Recursively remove this object from the list of Cleanups.
2432 /// Typically RecursiveRemove is implemented by classes that can contain
2433 /// mulitple references to a same object or shared ownership of the object
2434 /// with others.
2435 
2437 {
2438  R__READ_LOCKGUARD(ROOT::gCoreMutex);
2439 
2440  fCleanups->RecursiveRemove(obj);
2441 }
2442 
2443 ////////////////////////////////////////////////////////////////////////////////
2444 /// Refresh all browsers. Call this method when some command line
2445 /// command or script has changed the browser contents. Not needed
2446 /// for objects that have the kMustCleanup bit set. Most useful to
2447 /// update browsers that show the file system or other objects external
2448 /// to the running ROOT session.
2449 
2451 {
2452  TIter next(GetListOfBrowsers());
2453  TBrowser *b;
2454  while ((b = (TBrowser*) next()))
2455  b->SetRefreshFlag(kTRUE);
2456 }
2457 ////////////////////////////////////////////////////////////////////////////////
2458 /// Insure that the files, canvases and sockets are closed.
2459 
2460 static void CallCloseFiles()
2461 {
2462  if (TROOT::Initialized() && ROOT::Internal::gROOTLocal) {
2463  gROOT->CloseFiles();
2464  }
2465 }
2466 
2467 ////////////////////////////////////////////////////////////////////////////////
2468 /// Called by static dictionary initialization to register clang modules
2469 /// for headers. Calls TCling::RegisterModule() unless gCling
2470 /// is NULL, i.e. during startup, where the information is buffered in
2471 /// the static GetModuleHeaderInfoBuffer().
2472 
2473 void TROOT::RegisterModule(const char* modulename,
2474  const char** headers,
2475  const char** includePaths,
2476  const char* payloadCode,
2477  const char* fwdDeclCode,
2478  void (*triggerFunc)(),
2479  const TInterpreter::FwdDeclArgsToKeepCollection_t& fwdDeclsArgToSkip,
2480  const char** classesHeaders)
2481 {
2482 
2483  // First a side track to insure proper end of process behavior.
2484 
2485  // Register for each loaded dictionary (and thus for each library),
2486  // that we need to Close the ROOT files as soon as this library
2487  // might start being unloaded after main.
2488  //
2489  // By calling atexit here (rather than directly from within the
2490  // library) we make sure that this is not called if the library is
2491  // 'only' dlclosed.
2492 
2493  // On Ubuntu the linker strips the unused libraries. Eventhough
2494  // stressHistogram is explicitly linked against libNet, it is not
2495  // retained and thus is loaded only as needed in the middle part of
2496  // the execution. Concretely this also means that it is loaded
2497  // *after* the construction of the TApplication object and thus
2498  // after the registration (atexit) of the EndOfProcessCleanups
2499  // routine. Consequently, after the end of main, libNet is
2500  // unloaded before EndOfProcessCleanups is called. When
2501  // EndOfProcessCleanups is executed it indirectly needs the TClass
2502  // for TSocket and its search will use resources that have already
2503  // been unloaded (technically the function static in TUnixSystem's
2504  // DynamicPath and the dictionary from libNet).
2505 
2506  // Similarly, the ordering (before this commit) was broken in the
2507  // following case:
2508 
2509  // TApplication creation (EndOfProcessCleanups registration)
2510  // load UserLibrary
2511  // create TFile
2512  // Append UserObject to TFile
2513 
2514  // and after the end of main the order of execution was
2515 
2516  // unload UserLibrary
2517  // call EndOfProcessCleanups
2518  // Write the TFile
2519  // attempt to write the user object.
2520  // ....
2521 
2522  // where what we need is to have the files closen/written before
2523  // the unloading of the library.
2524 
2525  // To solve the problem we now register an atexit function for
2526  // every dictionary thus making sure there is at least one executed
2527  // before the first library tear down after main.
2528 
2529  // If atexit is called directly within a library's code, the
2530  // function will called *either* when the library is 'dlclose'd or
2531  // after then end of main (whichever comes first). We do *not*
2532  // want the files to be closed whenever a library is unloaded via
2533  // dlclose. To avoid this, we add the function (CallCloseFiles)
2534  // from the dictionary indirectly (via ROOT::RegisterModule). In
2535  // this case the function will only only be called either when
2536  // libCore is 'dlclose'd or right after the end of main.
2537 
2538  atexit(CallCloseFiles);
2539 
2540  // Now register with TCling.
2541  if (gCling) {
2542  gCling->RegisterModule(modulename, headers, includePaths, payloadCode, fwdDeclCode,
2543  triggerFunc, fwdDeclsArgToSkip, classesHeaders);
2544  } else {
2545  GetModuleHeaderInfoBuffer()
2546  .push_back(ModuleHeaderInfo_t (modulename, headers, includePaths, payloadCode, fwdDeclCode,
2547  triggerFunc, fwdDeclsArgToSkip,classesHeaders));
2548  }
2549 }
2550 
2551 ////////////////////////////////////////////////////////////////////////////////
2552 /// Remove an object from the in-memory list.
2553 /// Since TROOT is global resource, this is lock protected.
2554 
2556 {
2557  R__LOCKGUARD(gROOTMutex);
2558  return TDirectory::Remove(obj);
2559 }
2560 
2561 ////////////////////////////////////////////////////////////////////////////////
2562 /// Remove a class from the list and map of classes.
2563 /// This routine is deprecated, use TClass::RemoveClass directly.
2564 
2566 {
2567  TClass::RemoveClass(oldcl);
2568 }
2569 
2570 ////////////////////////////////////////////////////////////////////////////////
2571 /// Delete all global interpreter objects created since the last call to Reset
2572 ///
2573 /// If option="a" is set reset to startup context (i.e. unload also
2574 /// all loaded files, classes, structs, typedefs, etc.).
2575 ///
2576 /// This function is typically used at the beginning (or end) of an unnamed macro
2577 /// to clean the environment.
2578 ///
2579 /// IMPORTANT WARNING:
2580 /// Do not use this call from within any function (neither compiled nor
2581 /// interpreted. This should only be used from a unnamed macro
2582 /// (which starts with a { (curly braces) ). For example, using TROOT::Reset
2583 /// from within an interpreted function will lead to the unloading of the
2584 /// dictionary and source file, including the one defining the function being
2585 /// executed.
2586 ///
2587 
2588 void TROOT::Reset(Option_t *option)
2589 {
2590  if (IsExecutingMacro()) return; //True when TMacro::Exec runs
2591  if (fInterpreter) {
2592  if (!strncmp(option, "a", 1)) {
2593  fInterpreter->Reset();
2595  } else
2596  gInterpreter->ResetGlobals();
2597 
2598  if (fGlobals) fGlobals->Unload();
2600 
2601  SaveContext();
2602  }
2603 }
2604 
2605 ////////////////////////////////////////////////////////////////////////////////
2606 /// Save the current interpreter context.
2607 
2609 {
2610  if (fInterpreter)
2611  gInterpreter->SaveGlobalsContext();
2612 }
2613 
2614 ////////////////////////////////////////////////////////////////////////////////
2615 /// Set the default graphical cut class name for the graphics editor
2616 /// By default the graphics editor creates an instance of a class TCutG.
2617 /// This function may be called to specify a different class that MUST
2618 /// derive from TCutG
2619 
2620 void TROOT::SetCutClassName(const char *name)
2621 {
2622  if (!name) {
2623  Error("SetCutClassName","Invalid class name");
2624  return;
2625  }
2626  TClass *cl = TClass::GetClass(name);
2627  if (!cl) {
2628  Error("SetCutClassName","Unknown class:%s",name);
2629  return;
2630  }
2631  if (!cl->InheritsFrom("TCutG")) {
2632  Error("SetCutClassName","Class:%s does not derive from TCutG",name);
2633  return;
2634  }
2635  fCutClassName = name;
2636 }
2637 
2638 ////////////////////////////////////////////////////////////////////////////////
2639 /// Set editor mode
2640 
2641 void TROOT::SetEditorMode(const char *mode)
2642 {
2643  fEditorMode = 0;
2644  if (!mode[0]) return;
2645  if (!strcmp(mode,"Arc")) {fEditorMode = kArc; return;}
2646  if (!strcmp(mode,"Line")) {fEditorMode = kLine; return;}
2647  if (!strcmp(mode,"Arrow")) {fEditorMode = kArrow; return;}
2648  if (!strcmp(mode,"Button")) {fEditorMode = kButton; return;}
2649  if (!strcmp(mode,"Diamond")) {fEditorMode = kDiamond; return;}
2650  if (!strcmp(mode,"Ellipse")) {fEditorMode = kEllipse; return;}
2651  if (!strcmp(mode,"Pad")) {fEditorMode = kPad; return;}
2652  if (!strcmp(mode,"Pave")) {fEditorMode = kPave; return;}
2653  if (!strcmp(mode,"PaveLabel")){fEditorMode = kPaveLabel; return;}
2654  if (!strcmp(mode,"PaveText")) {fEditorMode = kPaveText; return;}
2655  if (!strcmp(mode,"PavesText")){fEditorMode = kPavesText; return;}
2656  if (!strcmp(mode,"PolyLine")) {fEditorMode = kPolyLine; return;}
2657  if (!strcmp(mode,"CurlyLine")){fEditorMode = kCurlyLine; return;}
2658  if (!strcmp(mode,"CurlyArc")) {fEditorMode = kCurlyArc; return;}
2659  if (!strcmp(mode,"Text")) {fEditorMode = kText; return;}
2660  if (!strcmp(mode,"Marker")) {fEditorMode = kMarker; return;}
2661  if (!strcmp(mode,"CutG")) {fEditorMode = kCutG; return;}
2662 }
2663 
2664 ////////////////////////////////////////////////////////////////////////////////
2665 /// Change current style to style with name stylename
2666 
2667 void TROOT::SetStyle(const char *stylename)
2668 {
2669  TString style_name = stylename;
2670 
2671  TStyle *style = GetStyle(style_name);
2672  if (style) style->cd();
2673  else Error("SetStyle","Unknown style:%s",style_name.Data());
2674 }
2675 
2676 
2677 //-------- Static Member Functions ---------------------------------------------
2678 
2679 
2680 ////////////////////////////////////////////////////////////////////////////////
2681 /// Decrease the indentation level for ls().
2682 
2684 {
2685  return --fgDirLevel;
2686 }
2687 
2688 ////////////////////////////////////////////////////////////////////////////////
2689 ///return directory level
2690 
2692 {
2693  return fgDirLevel;
2694 }
2695 
2696 ////////////////////////////////////////////////////////////////////////////////
2697 /// Get macro search path. Static utility function.
2698 
2699 const char *TROOT::GetMacroPath()
2700 {
2701  TString &macroPath = ROOT::GetMacroPath();
2702 
2703  if (macroPath.Length() == 0) {
2704  macroPath = gEnv->GetValue("Root.MacroPath", (char*)0);
2705 #if defined(R__WIN32)
2706  macroPath.ReplaceAll("; ", ";");
2707 #else
2708  macroPath.ReplaceAll(": ", ":");
2709 #endif
2710  if (macroPath.Length() == 0)
2711 #if !defined(R__WIN32)
2712  macroPath = ".:" + TROOT::GetMacroDir();
2713 #else
2714  macroPath = ".;" + TROOT::GetMacroDir();
2715 #endif
2716  }
2717 
2718  return macroPath;
2719 }
2720 
2721 ////////////////////////////////////////////////////////////////////////////////
2722 /// Set or extend the macro search path. Static utility function.
2723 /// If newpath=0 or "" reset to value specified in the rootrc file.
2724 
2725 void TROOT::SetMacroPath(const char *newpath)
2726 {
2727  TString &macroPath = ROOT::GetMacroPath();
2728 
2729  if (!newpath || !*newpath)
2730  macroPath = "";
2731  else
2732  macroPath = newpath;
2733 }
2734 
2735 ////////////////////////////////////////////////////////////////////////////////
2736 /// Increase the indentation level for ls().
2737 
2739 {
2740  return ++fgDirLevel;
2741 }
2742 
2743 ////////////////////////////////////////////////////////////////////////////////
2744 /// Functions used by ls() to indent an object hierarchy.
2745 
2747 {
2748  for (int i = 0; i < fgDirLevel; i++) std::cout.put(' ');
2749 }
2750 
2751 ////////////////////////////////////////////////////////////////////////////////
2752 /// Return kTRUE if the TROOT object has been initialized.
2753 
2755 {
2756  return fgRootInit;
2757 }
2758 
2759 ////////////////////////////////////////////////////////////////////////////////
2760 /// Return kTRUE if the memory leak checker is on.
2761 
2763 {
2764  return fgMemCheck;
2765 }
2766 
2767 ////////////////////////////////////////////////////////////////////////////////
2768 /// Return Indentation level for ls().
2769 
2771 {
2772  fgDirLevel = level;
2773 }
2774 
2775 ////////////////////////////////////////////////////////////////////////////////
2776 /// Convert version code to an integer, i.e. 331527 -> 51507.
2777 
2779 {
2780  return 10000*(code>>16) + 100*((code&65280)>>8) + (code&255);
2781 }
2782 
2783 ////////////////////////////////////////////////////////////////////////////////
2784 /// Convert version as an integer to version code as used in RVersion.h.
2785 
2787 {
2788  int a = v/10000;
2789  int b = (v - a*10000)/100;
2790  int c = v - a*10000 - b*100;
2791  return (a << 16) + (b << 8) + c;
2792 }
2793 
2794 ////////////////////////////////////////////////////////////////////////////////
2795 /// Return ROOT version code as defined in RVersion.h.
2796 
2798 {
2799  return ROOT_VERSION_CODE;
2800 }
2801 
2802 ////////////////////////////////////////////////////////////////////////////////
2803 
2805  static const char** extraInterpArgs = 0;
2806  return extraInterpArgs;
2807 }
2808 
2809 ////////////////////////////////////////////////////////////////////////////////
2810 
2811 #ifdef ROOTPREFIX
2812 static Bool_t IgnorePrefix() {
2813  static Bool_t ignorePrefix = gSystem->Getenv("ROOTIGNOREPREFIX");
2814  return ignorePrefix;
2815 }
2816 #endif
2817 
2818 ////////////////////////////////////////////////////////////////////////////////
2819 /// Get the rootsys directory in the installation. Static utility function.
2820 
2821 const TString& TROOT::GetRootSys() {
2822 #ifdef ROOTPREFIX
2823  if (IgnorePrefix()) {
2824 #endif
2825  static TString rootsys;
2826  if (rootsys.IsNull())
2827  rootsys = gSystem->Getenv("ROOTSYS");
2828  if (rootsys.IsNull())
2829  rootsys = gRootDir;
2830  return rootsys;
2831 #ifdef ROOTPREFIX
2832  } else {
2833  const static TString rootsys = ROOTPREFIX;
2834  return rootsys;
2835  }
2836 #endif
2837 }
2838 
2839 ////////////////////////////////////////////////////////////////////////////////
2840 /// Get the binary directory in the installation. Static utility function.
2841 
2842 const TString& TROOT::GetBinDir() {
2843 #ifdef ROOTBINDIR
2844  if (IgnorePrefix()) {
2845 #endif
2846  static TString rootbindir;
2847  if (rootbindir.IsNull()) {
2848  rootbindir = "bin";
2849  gSystem->PrependPathName(GetRootSys(), rootbindir);
2850  }
2851  return rootbindir;
2852 #ifdef ROOTBINDIR
2853  } else {
2854  const static TString rootbindir = ROOTBINDIR;
2855  return rootbindir;
2856  }
2857 #endif
2858 }
2859 
2860 ////////////////////////////////////////////////////////////////////////////////
2861 /// Get the library directory in the installation. Static utility function.
2862 
2863 const TString& TROOT::GetLibDir() {
2864 #ifdef ROOTLIBDIR
2865  if (IgnorePrefix()) {
2866 #endif
2867  static TString rootlibdir;
2868  if (rootlibdir.IsNull()) {
2869  rootlibdir = "lib";
2870  gSystem->PrependPathName(GetRootSys(), rootlibdir);
2871  }
2872  return rootlibdir;
2873 #ifdef ROOTLIBDIR
2874  } else {
2875  const static TString rootlibdir = ROOTLIBDIR;
2876  return rootlibdir;
2877  }
2878 #endif
2879 }
2880 
2881 ////////////////////////////////////////////////////////////////////////////////
2882 /// Get the include directory in the installation. Static utility function.
2883 
2884 const TString& TROOT::GetIncludeDir() {
2885 #ifdef ROOTINCDIR
2886  if (IgnorePrefix()) {
2887 #endif
2888  static TString rootincdir;
2889  if (rootincdir.IsNull()) {
2890  rootincdir = "include";
2891  gSystem->PrependPathName(GetRootSys(), rootincdir);
2892  }
2893  return rootincdir;
2894 #ifdef ROOTINCDIR
2895  } else {
2896  const static TString rootincdir = ROOTINCDIR;
2897  return rootincdir;
2898  }
2899 #endif
2900 }
2901 
2902 ////////////////////////////////////////////////////////////////////////////////
2903 /// Get the sysconfig directory in the installation. Static utility function.
2904 
2905 const TString& TROOT::GetEtcDir() {
2906 #ifdef ROOTETCDIR
2907  if (IgnorePrefix()) {
2908 #endif
2909  static TString rootetcdir;
2910  if (rootetcdir.IsNull()) {
2911  rootetcdir = "etc";
2912  gSystem->PrependPathName(GetRootSys(), rootetcdir);
2913  }
2914  return rootetcdir;
2915 #ifdef ROOTETCDIR
2916  } else {
2917  const static TString rootetcdir = ROOTETCDIR;
2918  return rootetcdir;
2919  }
2920 #endif
2921 }
2922 
2923 ////////////////////////////////////////////////////////////////////////////////
2924 /// Get the data directory in the installation. Static utility function.
2925 
2926 const TString& TROOT::GetDataDir() {
2927 #ifdef ROOTDATADIR
2928  if (IgnorePrefix()) {
2929 #endif
2930  return GetRootSys();
2931 #ifdef ROOTDATADIR
2932  } else {
2933  const static TString rootdatadir = ROOTDATADIR;
2934  return rootdatadir;
2935  }
2936 #endif
2937 }
2938 
2939 ////////////////////////////////////////////////////////////////////////////////
2940 /// Get the documentation directory in the installation. Static utility function.
2941 
2942 const TString& TROOT::GetDocDir() {
2943 #ifdef ROOTDOCDIR
2944  if (IgnorePrefix()) {
2945 #endif
2946  return GetRootSys();
2947 #ifdef ROOTDOCDIR
2948  } else {
2949  const static TString rootdocdir = ROOTDOCDIR;
2950  return rootdocdir;
2951  }
2952 #endif
2953 }
2954 
2955 ////////////////////////////////////////////////////////////////////////////////
2956 /// Get the macro directory in the installation. Static utility function.
2957 
2958 const TString& TROOT::GetMacroDir() {
2959 #ifdef ROOTMACRODIR
2960  if (IgnorePrefix()) {
2961 #endif
2962  static TString rootmacrodir;
2963  if (rootmacrodir.IsNull()) {
2964  rootmacrodir = "macros";
2965  gSystem->PrependPathName(GetRootSys(), rootmacrodir);
2966  }
2967  return rootmacrodir;
2968 #ifdef ROOTMACRODIR
2969  } else {
2970  const static TString rootmacrodir = ROOTMACRODIR;
2971  return rootmacrodir;
2972  }
2973 #endif
2974 }
2975 
2976 ////////////////////////////////////////////////////////////////////////////////
2977 /// Get the tutorials directory in the installation. Static utility function.
2978 
2979 const TString& TROOT::GetTutorialDir() {
2980 #ifdef ROOTTUTDIR
2981  if (IgnorePrefix()) {
2982 #endif
2983  static TString roottutdir;
2984  if (roottutdir.IsNull()) {
2985  roottutdir = "tutorials";
2986  gSystem->PrependPathName(GetRootSys(), roottutdir);
2987  }
2988  return roottutdir;
2989 #ifdef ROOTTUTDIR
2990  } else {
2991  const static TString roottutdir = ROOTTUTDIR;
2992  return roottutdir;
2993  }
2994 #endif
2995 }
2996 
2997 ////////////////////////////////////////////////////////////////////////////////
2998 /// Get the source directory in the installation. Static utility function.
2999 
3000 const TString& TROOT::GetSourceDir() {
3001 #ifdef ROOTSRCDIR
3002  if (IgnorePrefix()) {
3003 #endif
3004  static TString rootsrcdir;
3005  if (rootsrcdir.IsNull()) {
3006  rootsrcdir = "src";
3007  gSystem->PrependPathName(GetRootSys(), rootsrcdir);
3008  }
3009  return rootsrcdir;
3010 #ifdef ROOTSRCDIR
3011  } else {
3012  const static TString rootsrcdir = ROOTSRCDIR;
3013  return rootsrcdir;
3014  }
3015 #endif
3016 }
3017 
3018 ////////////////////////////////////////////////////////////////////////////////
3019 /// Get the icon path in the installation. Static utility function.
3020 
3021 const TString& TROOT::GetIconPath() {
3022 #ifdef ROOTICONPATH
3023  if (IgnorePrefix()) {
3024 #endif
3025  static TString rooticonpath;
3026  if (rooticonpath.IsNull()) {
3027  rooticonpath = "icons";
3028  gSystem->PrependPathName(GetRootSys(), rooticonpath);
3029  }
3030  return rooticonpath;
3031 #ifdef ROOTICONPATH
3032  } else {
3033  const static TString rooticonpath = ROOTICONPATH;
3034  return rooticonpath;
3035  }
3036 #endif
3037 }
3038 
3039 ////////////////////////////////////////////////////////////////////////////////
3040 /// Get the fonts directory in the installation. Static utility function.
3041 
3042 const TString& TROOT::GetTTFFontDir() {
3043 #ifdef TTFFONTDIR
3044  if (IgnorePrefix()) {
3045 #endif
3046  static TString ttffontdir;
3047  if (ttffontdir.IsNull()) {
3048  ttffontdir = "fonts";
3049  gSystem->PrependPathName(GetRootSys(), ttffontdir);
3050  }
3051  return ttffontdir;
3052 #ifdef TTFFONTDIR
3053  } else {
3054  const static TString ttffontdir = TTFFONTDIR;
3055  return ttffontdir;
3056  }
3057 #endif
3058 }
3059 
3060 ////////////////////////////////////////////////////////////////////////////////
3061 /// Get the tutorials directory in the installation. Static utility function.
3062 /// Backward compatibility function - do not use for new code
3063 
3064 const char *TROOT::GetTutorialsDir() {
3065  return GetTutorialDir();
3066 }
TSeqCollection * fStreamerInfo
Definition: TROOT.h:164
void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add object with name to browser.
Definition: TBrowser.cxx:261
const char * FindObjectPathName(const TObject *obj) const
Return path name of obj somewhere in the //root/...
Definition: TROOT.cxx:1433
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:932
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1276
Bool_t fExecutingMacro
Definition: TROOT.h:141
void AddClass(TClass *cl)
Add a class to the list and map of classes.
Definition: TROOT.cxx:1015
virtual void RegisterModule(const char *, const char **, const char **, const char *, const char *, void(*)(), const FwdDeclArgsToKeepCollection_t &fwdDeclArgsToKeep, const char **classesHeaders, Bool_t lateRegistration=false)=0
virtual void Add(TObject *obj)
TListOfFunctionTemplates * fFuncTemplate
Definition: TROOT.h:147
UInt_t GetImplicitMTPoolSize()
Returns the size of the pool used for implicit multi-threading.
Definition: TROOT.cxx:591
static const TString & GetTTFFontDir()
Get the fonts directory in the installation. Static utility function.
Definition: TROOT.cxx:3042
TInterpreter * CreateInterpreter_t(void *shlibHandle)
Definition: TInterpreter.h:522
A TFolder object is a collection of objects and folders.
Definition: TFolder.h:30
TCanvas * MakeDefCanvas() const
Return a default canvas.
Definition: TROOT.cxx:1514
R__EXTERN TGuiFactory * gBatchGuiFactory
Definition: TGuiFactory.h:67
A collection of TDataMember objects designed for fast access given a DeclId_t and for keep track of T...
Semi-Abstract base class defining a generic interface to the underlying, low level, native graphics backend (X11, Win32, MacOS, OpenGL...).
Definition: TVirtualX.h:58
An array of TObjects.
Definition: TObjArray.h:37
virtual void Clear(Option_t *option="")=0
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
Definition: TROOT.cxx:2683
static Bool_t BlockAllSignals(Bool_t b)
Block or unblock all signals. Returns the previous block status.
Definition: TQObject.cxx:1055
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:467
TFolder * fRootFolder
Definition: TROOT.h:172
TCollection * GetListOfEnums(Bool_t load=kFALSE)
Definition: TROOT.cxx:1703
ROOT top level object description.
Definition: TROOT.h:100
static const TString & GetMacroDir()
Get the macro directory in the installation. Static utility function.
Definition: TROOT.cxx:2958
void * DestroyInterpreter_t(TInterpreter *)
Definition: TInterpreter.h:523
This class is a specialized TProcessID managing the list of UUIDs.
Definition: TProcessUUID.h:32
TSeqCollection * fProofs
Definition: TROOT.h:167
static const TString & GetTutorialDir()
Get the tutorials directory in the installation. Static utility function.
Definition: TROOT.cxx:2979
const char * GetDeclFileName() const
Definition: TClass.h:395
void RemoveClass(TClass *)
Remove a class from the list and map of classes.
Definition: TROOT.cxx:2565
TCollection * GetListOfGlobalFunctions(Bool_t load=kFALSE)
Return list containing the TFunctions currently defined.
Definition: TROOT.cxx:1774
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:869
Int_t LoadMacro(const char *filename, Int_t *error=0, Bool_t check=kFALSE)
Load a macro in the interpreter&#39;s memory.
Definition: TROOT.cxx:2200
virtual void Build(TFile *motherFile=0, TDirectory *motherDir=0)
Initialise directory to defaults.
Definition: TDirectory.cxx:237
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
static const char **& GetExtraInterpreterArgs()
Definition: TROOT.cxx:2804
TLine * line
TSeqCollection * fGeometries
Definition: TROOT.h:159
R__EXTERN TClassTable * gClassTable
Definition: TClassTable.h:95
Handle messages that might be generated by the system.
TDictionary::DeclId_t DeclId_t
Definition: TInterpreter.h:259
const char Option_t
Definition: RtypesCore.h:62
Dictionary for function template This class describes one single function template.
virtual TString SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const
This method split a filename of the form: ~~~ {.cpp} [path/]macro.C[+|++[k|f|g|O|c|s|d|v|-]][(args)]...
Definition: TSystem.cxx:4124
void DisableImplicitMT()
Disables the implicit multi-threading in ROOT (see EnableImplicitMT).
Definition: TROOT.cxx:570
static TVirtualX *& Instance()
Returns gVirtualX global.
Definition: TVirtualX.cxx:57
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
Short_t GetDeclFileLine() const
Definition: TClass.h:396
#define ROOT_RELEASE_TIME
Definition: RVersion.h:19
TList * fList
Definition: TDirectory.h:87
static const TString & GetIconPath()
Get the icon path in the installation. Static utility function.
Definition: TROOT.cxx:3021
R__EXTERN TVirtualMutex * gInterpreterMutex
Definition: TInterpreter.h:40
const Ssiz_t kNPOS
Definition: RtypesCore.h:111
This class represents a WWW compatible URL.
Definition: TUrl.h:35
Int_t fVersionDate
Definition: TROOT.h:123
Definition: Buttons.h:33
R__EXTERN TStyle * gStyle
Definition: TStyle.h:402
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
Definition: TSystem.cxx:1374
Bool_t fForceStyle
Definition: TROOT.h:138
virtual void HandleMessage(Int_t id, const TObject *obj)
Store message origin, keep statistics and call Notify().
Bool_t ReadingObject() const
Deprecated (will be removed in next release).
Definition: TROOT.cxx:2398
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
static Int_t RootVersionCode()
Return ROOT version code as defined in RVersion.h.
Definition: TROOT.cxx:2797
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
static Bool_t MemCheck()
Return kTRUE if the memory leak checker is on.
Definition: TROOT.cxx:2762
TString fVersion
Definition: TROOT.h:120
void R__SetZipMode(int)
virtual const char * HomeDirectory(const char *userName=0)
Return the user&#39;s home directory.
Definition: TSystem.cxx:885
#define ROOT_RELEASE_DATE
Definition: RVersion.h:18
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
static void SetObjectStat(Bool_t stat)
Turn on/off tracking of objects in the TObjectTable.
Definition: TObject.cxx:961
This class implements a mutex interface.
Definition: TVirtualMutex.h:34
void DisableParTreeProcessing()
Globally disables the IMT use case of parallel branch processing, deactivating the corresponding lock...
Definition: TROOT.cxx:479
void InitInterpreter()
Initialize the interpreter.
Definition: TROOT.cxx:1987
#define gROOT
Definition: TROOT.h:402
void LoadHandlersFromEnv(TEnv *env)
Load plugin handlers specified in config file, like: Plugin.TFile: ^rfio: TRFIOFile RFI...
TROOT * GetROOT2()
Definition: TROOT.cxx:381
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
Definition: TSystem.cxx:1829
The TEnv class reads config files, by default named .rootrc.
Definition: TEnv.h:125
void RefreshBrowsers()
Refresh all browsers.
Definition: TROOT.cxx:2450
static Func_t GetSymInLibImt(const char *funcname)
Definition: TROOT.cxx:395
TString & GetMacroPath()
Definition: TROOT.cxx:521
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
std::vector< std::pair< std::string, int > > FwdDeclArgsToKeepCollection_t
Definition: TInterpreter.h:121
static const TString & GetRootSys()
Get the rootsys directory in the installation. Static utility function.
Definition: TROOT.cxx:2821
#define gInterpreter
Definition: TInterpreter.h:526
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Definition: TSystem.cxx:1522
Int_t fVersionCode
Definition: TROOT.h:122
Option_t * GetOption() const
Definition: TCollection.h:249
void Reset(Option_t *option="")
Delete all global interpreter objects created since the last call to Reset.
Definition: TROOT.cxx:2588
Definition: Buttons.h:30
void Load()
Load all the DataMembers known to the interpreter for the scope &#39;fClass&#39; into this collection...
TFunction * Get(DeclId_t id)
Return (after creating it if necessary) the TMethod or TFunction describing the function correspondin...
This class registers for all classes their name, id and dictionary function in a hash table...
Definition: TClassTable.h:36
STL namespace.
#define ROOT_VERSION_CODE
Definition: RVersion.h:21
static constexpr double mm
static Bool_t & IsImplicitMTEnabledImpl()
Keeps track of the status of ImplicitMT w/o resorting to the load of libImt.
Definition: TROOT.cxx:508
virtual TObject * FindObjectAny(const char *name) const
Return a pointer to the first object with name starting at this folder.
Definition: TFolder.cxx:352
TObject * At(Int_t idx) const
Definition: TObjArray.h:165
virtual void ResetSignals()
Reset signals handlers to previous behaviour.
Definition: TSystem.cxx:592
std::atomic< TApplication * > fApplication
Definition: TROOT.h:131
void SetStyle(const char *stylename="Default")
Change current style to style with name stylename.
Definition: TROOT.cxx:2667
TDataType * GetType(const char *name, Bool_t load=kFALSE) const
Return pointer to type with name.
Definition: TROOT.cxx:1522
TCollection * GetListOfGlobals(Bool_t load=kFALSE)
Return list containing the TGlobals currently defined.
Definition: TROOT.cxx:1737
TString fGitCommit
Definition: TROOT.h:127
TStyle * GetStyle(const char *name) const
Return pointer to style with name.
Definition: TROOT.cxx:1539
void ls(Option_t *option="") const
To list all objects of the application.
Definition: TROOT.cxx:2182
static const TString & GetIncludeDir()
Get the include directory in the installation. Static utility function.
Definition: TROOT.cxx:2884
TROOT * GetROOT1()
Definition: TROOT.cxx:374
TObject * Remove(TObject *)
Remove an object from the in-memory list.
Definition: TROOT.cxx:2555
Bool_t R_ISREG(Int_t mode)
Definition: TSystem.h:119
virtual void AddLast(TObject *obj)
Add object at the end of the list.
Definition: TList.cxx:149
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:694
TString fCutClassName
Definition: TROOT.h:175
Bool_t & GetReadingObject()
Definition: TROOT.cxx:2390
static const char * GetTutorialsDir()
Get the tutorials directory in the installation.
Definition: TROOT.cxx:3064
TListOfFunctions * GetGlobalFunctions()
Internal routine returning, and creating if necessary, the list of global function.
Definition: TROOT.cxx:1612
static Int_t fgDirLevel
Definition: TROOT.h:108
Definition: Buttons.h:30
static const char * GetMacroPath()
Get macro search path. Static utility function.
Definition: TROOT.cxx:2699
TInterpreter * fInterpreter
Definition: TROOT.h:132
Int_t fMode
Definition: TSystem.h:128
static TList & GetEarlyRegisteredGlobals()
Definition: TGlobal.cxx:171
const char * GetGitDate()
Return date/time make was run.
Definition: TROOT.cxx:2412
virtual void cd()
Change current style.
Definition: TStyle.cxx:306
AListOfEnums_t fEnums
Definition: TROOT.h:170
TObject * GetFunction(const char *name) const
Return pointer to function with name.
Definition: TROOT.cxx:1547
TSeqCollection * fMappedFiles
Definition: TROOT.h:152
virtual void Delete(Option_t *option="")=0
Delete this object.
#define SafeDelete(p)
Definition: RConfig.h:509
Sequenceable collection abstract base class.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:128
static void * gInterpreterLib
Definition: TROOT.cxx:176
TVirtualMutex * gROOTMutex
Definition: TROOT.cxx:179
THashTable implements a hash table to store TObject&#39;s.
Definition: THashTable.h:35
static TVirtualPad *& Pad()
Return the current pad for the current thread.
Definition: TVirtualPad.cxx:32
Int_t fVersionInt
Definition: TROOT.h:121
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:34
Bool_t IsParTreeProcessingEnabled()
Returns true if parallel tree processing is enabled.
Definition: TROOT.cxx:492
void SetEditorMode(const char *mode="")
Set editor mode.
Definition: TROOT.cxx:2641
static Int_t ReadRules()
Read the class.rules files from the default location:.
Definition: TClass.cxx:1731
TSeqCollection * fCleanups
Definition: TROOT.h:162
Int_t fEditorMode
Definition: TROOT.h:142
Bool_t fMustClean
Definition: TROOT.h:136
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
Definition: TROOT.cxx:2754
void EndOfProcessCleanups()
Execute the cleanups necessary at the end of the process, in particular those that must be executed b...
Definition: TROOT.cxx:1217
static Bool_t fgRootInit
Definition: TROOT.h:109
virtual TObject * FindObjectAny(const char *name) const
Return a pointer to the first object with name starting at //root.
Definition: TROOT.cxx:1386
Long_t ProcessLineSync(const char *line, Int_t *error=0)
Process interpreter command via TApplication::ProcessLine().
Definition: TROOT.cxx:2322
void Message(Int_t id, const TObject *obj)
Process message id called by obj.
Definition: TROOT.cxx:2282
void EnableParTreeProcessing()
Globally enables the parallel tree processing, which is a case of implicit multi-threading in ROOT...
Definition: TROOT.cxx:463
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1638
static const TString & GetDocDir()
Get the documentation directory in the installation. Static utility function.
Definition: TROOT.cxx:2942
TCollection * GetListOfFunctionTemplates()
Definition: TROOT.cxx:1720
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
Definition: TSystem.cxx:1062
static Int_t ITIMQQ(const char *time)
Return built time as integer (with min precision), i.e.
Definition: TROOT.cxx:220
virtual void EnableAutoLoading()=0
void SaveContext()
Save the current interpreter context.
Definition: TROOT.cxx:2608
virtual void Close(Option_t *option="")
Delete all objects from memory and directory structure itself.
Definition: TDirectory.cxx:584
ClassInfo_t * GetClassInfo() const
Definition: TClass.h:400
virtual void Delete(Option_t *option="")
Delete all TFunction object files.
R__EXTERN TVirtualRWMutex * gCoreMutex
virtual bool UseRWLock()
Set this collection to use a RW lock upon access, making it thread safe.
virtual TList * GetList() const
Definition: TDirectory.h:149
TCollection * GetListOfFunctionOverloads(const char *name) const
Return the collection of functions named "name".
Definition: TROOT.cxx:1621
static void at_exit_of_TROOT()
Definition: TROOT.cxx:292
TSeqCollection * fClipboard
Definition: TROOT.h:168
virtual void Initialize()=0
TFolder * AddFolder(const char *name, const char *title, TCollection *collection=0)
Create a new folder and add it to the list of folders of this folder, return a pointer to the created...
Definition: TFolder.cxx:186
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:49
R__EXTERN TGuiFactory * gGuiFactory
Definition: TGuiFactory.h:66
static void Cleanup()
static function (called by TROOT destructor) to delete all TProcessIDs
Definition: TProcessID.cxx:188
void Error(const char *location, const char *msgfmt,...)
R__EXTERN TPluginManager * gPluginMgr
object has not been deleted
Definition: TObject.h:78
Definition: Buttons.h:38
Bool_t fEscape
Definition: TROOT.h:140
TSeqCollection * fFiles
Definition: TROOT.h:151
TSeqCollection * GetListOfGeometries() const
Definition: TROOT.h:249
Describes an Operating System directory for the browser.
virtual TObject * FindObject(const char *name) const
Specialize FindObject to do search for the a function just by name or create it if its not already in...
void EnableImplicitMT(UInt_t numthreads=0)
Enable ROOT&#39;s implicit multi-threading for all objects and methods that provide an internal paralleli...
Definition: TROOT.cxx:555
TCollection * fClasses
Definition: TROOT.h:145
A doubly linked list.
Definition: TList.h:44
Long_t Macro(const char *filename, Int_t *error=0, Bool_t padUpdate=kTRUE)
Execute a macro in the interpreter.
Definition: TROOT.cxx:2248
R__EXTERN TVirtualMutex * gGlobalMutex
Definition: TVirtualMutex.h:29
TStyle objects may be created to define special styles.
Definition: TStyle.h:27
R__EXTERN TROOT * gROOTLocal
Definition: TROOT.h:375
Bool_t fEditHistograms
Definition: TROOT.h:134
#define R__READ_LOCKGUARD(mutex)
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
virtual void AddLast(TObject *obj)=0
Bool_t ClassSaved(TClass *cl)
return class status bit kClassSaved for class cl This function is called by the SavePrimitive functio...
Definition: TROOT.cxx:1065
Int_t fVersionTime
Definition: TROOT.h:124
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
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)
Called by static dictionary initialization to register clang modules for headers. ...
Definition: TROOT.cxx:2473
R__EXTERN TVirtualX * gGXBatch
Definition: TVirtualX.h:353
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:1478
static Bool_t fgMemCheck
Definition: TROOT.h:110
Bool_t IsParBranchProcessingEnabled()
Returns true if parallel branch processing is enabled.
Definition: TROOT.cxx:443
TSeqCollection * fDataSets
Definition: TROOT.h:169
Definition: Buttons.h:33
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
Definition: TObject.cxx:321
TSeqCollection * fMessageHandlers
Definition: TROOT.h:163
void Browse(TBrowser *b)
Add browsable objects to TBrowser.
Definition: TROOT.cxx:1046
virtual Bool_t Init()
Initialize the OS interface.
Definition: TSystem.cxx:190
void AddClassGenerator(TClassGenerator *gen)
Add a class generator.
Definition: TROOT.cxx:1025
TString fDefCanvasName
Definition: TROOT.h:176
R__EXTERN TSystem * gSystem
Definition: TSystem.h:540
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:2620
TGlobal * GetGlobal(const char *name, Bool_t load=kFALSE) const
Return pointer to global variable by name.
Definition: TROOT.cxx:1580
Definition: Buttons.h:33
SVector< double, 2 > v
Definition: Dict.h:5
if object ctor succeeded but object should not be used
Definition: TObject.h:68
void GetNormalizedName(std::string &norm_name, std::string_view name)
Return the normalized name.
Definition: TClassEdit.cxx:788
Basic data type descriptor (datatype information is obtained from CINT).
Definition: TDataType.h:44
auto * a
Definition: textangle.C:12
Int_t gDebug
Definition: TROOT.cxx:612
TPluginManager * fPluginManager
Definition: TROOT.h:174
TString fGitBranch
Definition: TROOT.h:128
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
TSeqCollection * fSecContexts
Definition: TROOT.h:166
Collection abstract base class.
Definition: TCollection.h:63
void(* VoidFuncPtr_t)()
Definition: Rtypes.h:72
void SetRefreshFlag(Bool_t flag)
Definition: TBrowser.h:97
static Int_t ConvertVersionCode2Int(Int_t code)
Convert version code to an integer, i.e. 331527 -> 51507.
Definition: TROOT.cxx:2778
unsigned int UInt_t
Definition: RtypesCore.h:42
void ReadGitInfo()
Read Git commit information and branch name from the etc/gitinfo.txt file.
Definition: TROOT.cxx:2361
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
virtual TObject * FindObject(const char *name) const
Returns address of a ROOT object if it exists.
Definition: TROOT.cxx:1273
TObject * GetGeometry(const char *name) const
Return pointer to Geometry with name.
Definition: TROOT.cxx:1696
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
Definition: TDirectory.cxx:190
static void EnableStatistics(int size=-1, int ix=-1)
Enable memory usage statistics gathering.
Definition: TStorage.cxx:450
This class implements a plugin library manager.
static const TString & GetSourceDir()
Get the source directory in the installation. Static utility function.
Definition: TROOT.cxx:3000
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:2114
Objects following this interface can be passed onto the TROOT object to implement a user customized w...
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Definition: TROOT.cxx:2746
static TProcessID * AddProcessID()
Static function to add a new TProcessID to the list of PIDs.
Definition: TProcessID.cxx:100
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:75
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
Definition: TROOT.cxx:1037
TFile * GetFile() const
Definition: TROOT.h:265
virtual void SaveContext()=0
Global variables class (global variables are obtained from CINT).
Definition: TGlobal.h:27
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
Definition: TClass.cxx:4688
A collection of TDataType designed to hold the typedef information and numerical type information...
Definition: TListOfTypes.h:30
void SetName(const char *name)
Definition: TCollection.h:202
TROOT * GetROOT()
Definition: TROOT.cxx:517
void Warning(const char *location, const char *msgfmt,...)
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:2162
static TInterpreter * Instance()
returns gInterpreter global
void InitSystem()
Initialize operating system interface.
Definition: TROOT.cxx:1911
if object destructor must call RecursiveRemove()
Definition: TObject.h:60
#define gVirtualX
Definition: TVirtualX.h:350
TSeqCollection * fSpecials
Definition: TROOT.h:161
virtual TObjLink * FirstLink() const
Definition: TList.h:108
const Bool_t kFALSE
Definition: RtypesCore.h:88
static void CreateApplication()
Static function used to create a default application environment.
static void RemoveClass(TClass *cl)
static: Remove a class from the list and map of classes
Definition: TClass.cxx:470
TString fGitDate
Definition: TROOT.h:129
static void SetDirLevel(Int_t level=0)
Return Indentation level for ls().
Definition: TROOT.cxx:2770
long Long_t
Definition: RtypesCore.h:50
The Canvas class.
Definition: TCanvas.h:31
Bool_t IsExecutingMacro() const
Definition: TROOT.h:284
TSeqCollection * GetListOfColors() const
Definition: TROOT.h:237
TListOfFunctions * fGlobalFunctions
Definition: TROOT.h:149
Long_t ProcessLine(const char *line, Int_t *error=0)
Process interpreter command via TApplication::ProcessLine().
Definition: TROOT.cxx:2302
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
TSeqCollection * fCanvases
Definition: TROOT.h:154
static void BuildStyles()
Create some standard styles.
Definition: TStyle.cxx:290
virtual void SetName(const char *newname)
Set the name for directory If the directory name is changed after the directory was written once...
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
virtual const char * GetTypeName() const
Get type of global variable, e,g.
Definition: TGlobal.cxx:111
#define ClassImp(name)
Definition: Rtypes.h:359
void EnableThreadSafety()
Enables the global mutex to make ROOT thread safe/aware.
Definition: TROOT.cxx:528
TFunction * GetGlobalFunctionWithPrototype(const char *name, const char *proto=0, Bool_t load=kFALSE)
Return pointer to global function by name.
Definition: TROOT.cxx:1667
static DestroyInterpreter_t * gDestroyInterpreter
Definition: TROOT.cxx:175
void SetReadingObject(Bool_t flag=kTRUE)
Definition: TROOT.cxx:2403
virtual Func_t DynFindSymbol(const char *module, const char *entry)
Find specific entry point in specified library.
Definition: TSystem.cxx:2030
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
Definition: TSystem.cxx:2006
TString fConfigOptions
Definition: TROOT.h:118
void InitThreads()
Load and initialize thread library.
Definition: TROOT.cxx:1976
void RecursiveRemove(TObject *obj)
Recursively remove this object from the list of Cleanups.
Definition: TROOT.cxx:2436
void Unload()
Mark &#39;all func&#39; as being unloaded.
Describe directory structure in memory.
Definition: TDirectory.h:34
static TDirectory *& CurrentDirectory()
Return the current directory for the current thread.
Definition: TDirectory.cxx:380
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
TSeqCollection * GetListOfStyles() const
Definition: TROOT.h:246
static void AddClass(TClass *cl)
static: Add a class to the list and map of classes.
Definition: TClass.cxx:444
TSeqCollection * GetListOfFiles() const
Definition: TROOT.h:242
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
Definition: TROOT.cxx:2905
Definition: Buttons.h:31
Bool_t fFromPopUp
Definition: TROOT.h:135
static RooMathCoreReg dummy
Int_t fTimer
Definition: TROOT.h:130
TCanvas * style()
Definition: style.C:1
static void CallCloseFiles()
Insure that the files, canvases and sockets are closed.
Definition: TROOT.cxx:2460
void EnableParBranchProcessing()
Globally enables the parallel branch processing, which is a case of implicit multi-threading (IMT) in...
Definition: TROOT.cxx:414
Bool_t fBatch
Definition: TROOT.h:133
Long_t ProcessLineFast(const char *line, Int_t *error=0)
Process interpreter command directly via CINT interpreter.
Definition: TROOT.cxx:2339
void CloseFiles()
Close any files and sockets that gROOT knows about.
Definition: TROOT.cxx:1139
static constexpr double s
virtual ~TROOT()
Clean up and free resources used by ROOT (files, network sockets, shared memory segments, etc.).
Definition: TROOT.cxx:881
#define R__LOCKGUARD(mutex)
The color creation and management class.
Definition: TColor.h:19
TSeqCollection * fStyles
Definition: TROOT.h:155
virtual void Add(TObject *obj)=0
virtual void CleanCompiledMacros()
Remove the shared libs produced by the CompileMacro() function.
Definition: TSystem.cxx:4209
Bool_t fReadingObject
Definition: TROOT.h:137
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition: TClass.cxx:2887
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:399
TCollection * fClassGenerators
Definition: TROOT.h:165
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:1861
static TClass * LoadClass(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Definition: TClass.cxx:5479
virtual void Reset()=0
virtual void Delete(Option_t *option="")
Delete all TDataMember object files.
static Int_t GetDirLevel()
return directory level
Definition: TROOT.cxx:2691
Int_t fBuiltTime
Definition: TROOT.h:126
Mother of all ROOT objects.
Definition: TObject.h:37
Global functions class (global functions are obtained from CINT).
Definition: TFunction.h:28
This ABC is a factory for GUI components.
Definition: TGuiFactory.h:42
TFunction * GetGlobalFunction(const char *name, const char *params=0, Bool_t load=kFALSE)
Return pointer to global function by name.
Definition: TROOT.cxx:1634
std::vector< std::pair< std::string, int > > FwdDeclArgsToKeepCollection_t
Definition: TROOT.h:192
static Int_t ConvertVersionInt2Code(Int_t v)
Convert version as an integer to version code as used in RVersion.h.
Definition: TROOT.cxx:2786
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
Definition: TROOT.cxx:2738
typedef void((*Func_t)())
TCollection * GetListOfTypes(Bool_t load=kFALSE)
Return a dynamic list giving access to all TDataTypes (typedefs) currently defined.
Definition: TROOT.cxx:1813
static const TString & GetDataDir()
Get the data directory in the installation. Static utility function.
Definition: TROOT.cxx:2926
Int_t fBuiltDate
Definition: TROOT.h:125
void Unload()
Mark &#39;all func&#39; as being unloaded.
TFunctionTemplate * GetFunctionTemplate(const char *name)
Definition: TROOT.cxx:1567
TColor * GetColor(Int_t color) const
Return address of color with index color.
Definition: TROOT.cxx:1496
void Load()
Load all the functions known to the interpreter for the scope &#39;fClass&#39; into this collection.
TCollection * fFunctions
Definition: TROOT.h:156
const char * FindObjectClassName(const char *name) const
Returns class name of a ROOT object including CINT globals.
Definition: TROOT.cxx:1413
static void SetMacroPath(const char *newpath)
Set or extend the macro search path.
Definition: TROOT.cxx:2725
TROOT *(* GetROOTFun_t)()
Definition: TROOT.cxx:391
static Int_t IDATQQ(const char *date)
Return built date as integer, i.e. "Apr 28 2000" -> 20000428.
Definition: TROOT.cxx:199
virtual void Add(TObject *obj)
Definition: TList.h:87
auto * l
Definition: textangle.C:4
TListOfDataMembers * fGlobals
Definition: TROOT.h:148
static const TString & GetLibDir()
Get the library directory in the installation. Static utility function.
Definition: TROOT.cxx:2863
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.
Definition: TROOT.cxx:584
R__EXTERN const char * gRootDir
Definition: TSystem.h:223
virtual void ls(Option_t *option="") const
List Directory contents.
TSeqCollection * fClosedObjects
Definition: TROOT.h:150
TClass * FindSTLClass(const char *name, Bool_t load, Bool_t silent=kFALSE) const
return a TClass object corresponding to &#39;name&#39; assuming it is an STL container.
Definition: TROOT.cxx:1444
#define ROOT_RELEASE
Definition: RVersion.h:17
TF1 * f1
Definition: legend1.C:11
static Int_t IVERSQ()
Return version id as an integer, i.e. "2.22/04" -> 22204.
Definition: TROOT.cxx:189
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
Int_t fLineIsProcessing
Definition: TROOT.h:106
TSeqCollection * fTasks
Definition: TROOT.h:157
static void CleanUpROOTAtExit()
Clean up at program termination before global objects go out of scope.
Definition: TROOT.cxx:230
TSeqCollection * fColors
Definition: TROOT.h:158
Int_t GetNumber() const
Definition: TColor.h:54
TCollection * fTypes
Definition: TROOT.h:146
#define gPad
Definition: TVirtualPad.h:285
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
const char * proto
Definition: civetweb.c:11652
TSeqCollection * fBrowsers
Definition: TROOT.h:160
static GetROOTFun_t gGetROOT
Definition: TROOT.cxx:393
#define gDirectory
Definition: TDirectory.h:213
static void InitializeColors()
Initialize colors used by the TCanvas based graphics (via TColor objects).
Definition: TColor.cxx:1070
virtual TObject * FindObjectAnyFile(const char *name) const
Scan the memory lists of all files for an object with name.
Definition: TROOT.cxx:1396
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition: TROOT.cxx:2842
TList * fBrowsables
Definition: TROOT.h:173
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
TSeqCollection * fSockets
Definition: TROOT.h:153
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition: TObject.cxx:908
TObject * FindSpecialObject(const char *name, void *&where)
Returns address and folder of a ROOT object if it exists.
Definition: TROOT.cxx:1327
R__EXTERN TInterpreter * gCling
Definition: TInterpreter.h:528
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:357
virtual Int_t GetSize() const
Definition: TCollection.h:180
Bool_t fInterrupt
Definition: TROOT.h:139
Abstract base class defining a generic interface to the underlying Operating System.
Definition: TSystem.h:248
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
Definition: TNamed.cxx:164
void Idle(UInt_t idleTimeInSec, const char *command=0)
Execute command when system has been idle for idleTimeInSec seconds.
Definition: TROOT.cxx:1825
void *(* GlobalFunc_t)()
Definition: TGlobal.h:54
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
TSeqCollection * GetListOfBrowsers() const
Definition: TROOT.h:250
const Bool_t kTRUE
Definition: RtypesCore.h:87
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
Definition: TSystem.cxx:1052
#define sym(otri1, otri2)
Definition: triangle.c:932
static TClass * R__GetClassIfKnown(const char *className)
Check whether className is a known class, and only autoload if we can.
Definition: TROOT.cxx:1840
char name[80]
Definition: TGX11.cxx:109
TString fConfigFeatures
Definition: TROOT.h:119
TProcessUUID * fUUIDs
Definition: TROOT.h:171
void DisableParBranchProcessing()
Globally disables the IMT use case of parallel branch processing, deactivating the corresponding lock...
Definition: TROOT.cxx:430
static void PrintStatistics()
Print memory usage statistics.
Definition: TStorage.cxx:406
const TObject * fPrimitive
Definition: TROOT.h:143
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:866
TVirtualPad * fSelectPad
Definition: TROOT.h:144
virtual TObject * First() const =0
virtual TObject * Last() const =0
TDictionary * Get(DeclId_t id)
Return (after creating it if necessary) the TDataMember describing the data member corresponding to t...
TROOT()
Default ctor.
Definition: TROOT.cxx:620
static constexpr double g