没有合适的资源?快使用搜索试试~ 我知道了~
首页CERN ROOT数据分析软件用户指南:OOP与C++实践
《ROOT数据分析软件用户指南》是CERN开发的一款专业工具,旨在探索和应用面向对象编程(Object-Oriented Programming,OOP)和C++语言在科学计算领域的潜力。该文档发表于2009年12月,由ROOT团队共同创作,主要作者包括Ilka Antcheva和Olivier Couet。特别感谢Nick West(牛津)、Elaine Lyons、Suzanne Panacek、Andrey Kubarovsky(FNAL)以及Damir Buskulic(LAPP)对指南的贡献。
编写背景是在1994年末,ROOT团队为了评估OOP技术和C++在科学研究中的实用性,决定亲身实践。他们首先使用C++编写了一个简单的直方图(histogramming)程序来解决实际问题。这个过程经历了多个迭代:最初是基于C++的基本实现,接着利用模板(template)特性进行优化,但受限于当时的平台兼容性和特定编译器。经过大约四个月的努力,他们成功地创建出一款性能更优且效率更高的直方图包。
这个用户指南详细介绍了如何在ROOT环境中使用这一软件,涵盖了从基础安装、环境配置到高级数据分析功能的方方面面。它不仅教授编程技巧,还展示了如何利用C++的面向对象特性,如类(classes)、对象(objects)、继承(inheritance)、封装(encapsulation)和多态(polymorphism),来设计和构建高效的数据分析工具。指南中可能还会涉及数据结构的选择、内存管理的最佳实践、错误处理、以及与其他CERN软件(如TTree)的集成等内容。
此外,由于CERN的特殊地位,指南可能会着重强调代码的可移植性、跨平台兼容性,以及与大型科学实验项目(如大型强子对撞机LHC)的集成,这些都是在高能物理研究中至关重要的特性。对于那些对C++有兴趣并从事数据分析工作的科研人员来说,这本指南是一份宝贵的参考资料,能够帮助他们提升工作效率和代码质量。
Getting Started 11
root[] TF1 f1("func1","sin(x)/x",0,10)
root[] f1.Draw()
<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
Figure 2-1 A canvas with drawing
The following components comprise the canvas window:
Menu bar – contains main menus for global operations with files, print, clear canvas, inspect, etc.
Tool bar – has buttons for global and drawing operations; such as arrow, ellipse, latex, pad, etc.
Canvas – an area to draw objects.
Status bar – displays descriptive messages about the selected object.
Editor frame - responds dynamically and presents the user interface according to the selected
object in the canvas.
Main Menus and Toolbar
At the top of the canvas window are File, Edit, View, Options, Inspect, Classes and Help menus.
File Menu
New Canvas: creates a new canvas window in the current ROOT session.
Open…: popup a dialog to open a file.
Close Canvas: close the canvas window.
Save: save the drawing of the current canvas in a format selectable from
the submenu. The current canvas name is used as a file name for various
formats such as PostScript, GIF, JPEG, C macro file, root file.
Save As…: popup a dialog for saving the current canvas drawing in a new
filename.
Print: popup a dialog to print the current canvas drawing
Quit ROOT: exit the ROOT session
Edit Menu
There is only one active menu entry in the Edit menu. The others menu entries will be implemented and will
become active in the near future.
Clear: delete all objects in the canvas or in the selected pad according to the selected entry in the
submenu.
View Menu
Editor: toggles the view of the editor. If it is selected activates and shows up
the editor on the left side of the canvas window. According to the selected
object, the editor loads the corresponding user interface for easy change of
the object’s attributes.
Toolbar: toggles the view of the toolbar. If it is selected activates and shows
up the toolbar. It contains buttons for easy and fast access to most frequently
12 Getting Started
used commands and for graphics primitive drawing. Tool tips are provided for helping users.
Status Bar: toggles the view of the status bar. If it is selected, the status bar below the canvas
window shows up. There the identification of the objects is displayed when moving the mouse
(such as the object’s name, the object’s type, its coordinates, etc.).
Colors: creates a new canvas showing the color palette.
Markers: creates a new canvas showing the various marker styles.
Iconify: create the canvas window icon, does not close the canvas
View With...: If the last selected pad contains a 3-d structure, a new canvas is created with a 3-D
picture according to the selection made from the cascaded menu: X3D or OpenGL. The 3-D
image can be interactively rotated, zoomed in wire-frame, solid, hidden line or stereo mode.
Options Menu
Auto Resize Canvas: turns auto-resize of the canvas on/off:
ON – the canvas fits to the window when changing the window size;
OFF – the canvas stays fixed when changing the window size.
Resize Canvas: resizes and fits the canvas to the window size.
Move Opaque: if selected, graphics objects are moved in opaque
mode; otherwise, only the outline of objects is drawn when moving
them. The option opaque produces the best effect but it requires a
reasonably fast workstation or response time.
Resize Opaque: if selected, graphics objects are resized in opaque
mode; otherwise, only the outline of objects is drawn when resizing
them.
Interrupt: interrupts the current drawing process.
Refresh: redraws the canvas contents.
Pad Auto Exec: executes the list of TExecs in the current pad.
Statistics: toggles the display of the histogram statistics box.
Histogram Title: toggles the display of the histogram title.
Fit Parameters: toggles the display of the histogram or graph fit parameters.
Can Edit Histogram: enables/disables the possibility to edit histogram bin contents.
Inspect Menu
ROOT: inspects the top-level gROOT object (in a new canvas).
Start Browser: starts a new object browser (in a separate window).
GUI Builder: starts the GUI builder application (in a separate window).
Classes Menu
Classes: starts the ClassTree viewer that draws inheritance tree for a list of classes.
Help Menu
Canvas: help on canvas as a whiteboard area for drawing.
Menus: help on canvas menus.
Graphics Editor: help on primitives’ drawing and objects’ editor.
Browser: help on the ROOT objects’ and files’ browser.
Objects: help on DrawClass, Inspect and Dump context menu items.
PostScript: help on how to print a canvas to a PostScript file format.
About ROOT: pops up the ROOT Logo with the version number.
Toolbar
The following menu shortcuts and utilities are available from the toolbar:
Create a new canvas window.
Popup the Open File dialog.
Popup the Save As… dialog.
Popup the Print dialog.
Interrupts the current drawing process.
Getting Started 13
Redraw the canvas.
Inspect the gROOT object.
Create a new objects’ browser.
You can create the following graphical objects using the toolbar buttons for primitive drawing. Tool tips are
provided for helping your choice.
An Arc or circle: Click on the center of the arc, and then move the mouse. A rubber band circle is shown.
Click again with the left button to freeze the arc.
A Line: Click with the left button at the point where you want to start the line, then move the mouse and
click again with the left button to freeze the line.
An Arrow: Click with the left button at the point where you want to start the arrow, then move the mouse
and click again with the left button to freeze the arrow.
A Diamond: Click with the left button and freeze again with the left button. The editor draws a rubber band
box to suggest the outline of the diamond.
An Ellipse: Proceed like for an arc. You can grow/shrink the ellipse by pointing to the sensitive points. They
are highlighted. You can move the ellipse by clicking on the ellipse, but not on the sensitive points. If, with the
ellipse context menu, you have selected a fill area color, you can move a filled-ellipse by pointing inside the
ellipse and dragging it to its new position.
A Pad: Click with the left button and freeze again with the left button. The editor draws a rubber band box to
suggest the outline of the pad.
A PaveLabel: Proceed like for a pad. Type the text of label and finish with a carriage return. The text will
appear in the box.
A Pave Text: Proceed like for a pad. You can then click on the TPaveText object with the right mouse
button and select the option InsertText.
Paves Text: Proceed like for a TPaveText.
A Poly Line: Click with the left button for the first point, move the moose, click again with the left button for
a new point. Close the poly-line with a double click. To edit one vertex point, pick it with the left button and drag
to the new point position.
A Curly Line: Proceed as for the arrow or line. Once done, click with the third button to change the
characteristics of the curly line, like transform it to wave, change the wavelength, etc.
A Curly Arc: Proceed like for an ellipse. The first click is located at the position of the center, the second
click at the position of the arc beginning. Once done, one obtains a curly ellipse, for which one can click with the
third button to change the characteristics, like transform it to wavy, change the wavelength, set the minimum
and maximum angle to make an arc that is not closed, etc.
A Text/Latex string: Click with the left button where you want to draw the text and then type in the text
terminated by carriage return. All TLatex expressions are valid. To move the text or formula, point on it keeping
the left mouse button pressed and drag the text to its new position. You can grow/shrink the text if you position
the mouse to the first top-third part of the string, then move the mouse up or down to grow or shrink the text
respectively. If you position the mouse near the bottom-end of the text, you can rotate it.
A Marker: Click with the left button where to place the marker. The marker can be modified by using the
method SetMarkerStyle() of TSystem.
A Graphical Cut: Click with the left button on each point of a polygon delimiting the selected area. Close
the cut by double clicking on the last point. A TCutG object is created. It can be used as a selection for a
TTree::Draw. You can get a pointer to this object with:
TCutG cut = (TCutG*)gPad->GetPrimitive("CUTG")
Once you are happy with your picture, you can select the Save as canvas.C item in the canvas File menu.
This will automatically generate a script with the C++ statements corresponding to the picture. This facility also
works if you have other objects not drawn with the graphics editor (histograms for example).
The Editor Frame
The ROOT graphics editor loads the corresponding object editor objEditor according to the selected object
obj in the canvas respecting the class inheritance. An object in the canvas is selected after the left mouse click
14 Getting Started
on it. For example, if the selected object is TAxis, the TAxisEditor will shows up in the editor frame giving
the possibility for changing different axis attributes. The graphics editor can be:
Embedded – connected only with the canvas in the application window that appears on the left of the canvas
window after been activated via View menu / Editor. It appears on the left side if the canvas window allowing
users to edit the attributes of the selected object via provided user interface. The name of the selected object is
displayed on the top of the editor frame in red color. If the user interface needs more space then the height of
the canvas window, a vertical scroll bar appears for easer navigation.
Global – has own application window and can be connected to any created canvas in a ROOT session. It can
be activated via the context menu entries for setting line, fill, text and marker attributes for backward
compatibility, but there will be a unique entry in the near future.
The user interface for the following classes is available since ROOT v.4.04: TAttLine, TAttFill,
TAttMarker, TAttText, TArrow, TAxis, TCurlyArc, TCurlyLine, TFrame, TH1, TH2, TGraph, TPad,
TCanvas, TPaveStats. For more details, see “The Graphics Editor”, “The User Interface for Histograms”, “The
User Interface for Graphs”.
Classes, Methods and Constructors
Object oriented programming introduces objects, which have data members and methods. The next line
creates an object named f1 of the class TF1 that is a one-dimensional function. The type of an object is called
a class. The object itself is called an instance of a class. When a method builds an object, it is called a
constructor.
TF1 f1("func1","sin(x)/x",0,10)
In our constructor the function sin(x)/x is defined for use, and 0 and 10 are the limits. The first parameter, func1
is the name of the object f1. Most objects in ROOT have a name. ROOT maintains a list of objects that can be
searched to find any object by its given name (in our example func1).
The syntax to call an object's method, or if one prefers, to make an object to do something is:
Getting Started 15
object.method_name(parameters)
The dot can be replaced by “->" if object is a pointer. In compiled code, the dot MUST be replaced by a "->"
if object is a pointer.
object_ptr->method_name(parameters)
So now, we understand the two lines of code that allowed us to draw our function. f1.Draw() stands for “call
the method Draw() associated with the object f1 of the class TF1”. Other methods can be applied to the object
f1 of the class TF1. For example, the evaluating and calculating the derivative and the integral are what one
would expect from a function.
root[] f1.Eval(3)
(Double_t)4.70400026866224020e-02
root[] f1.Derivative(3)
(Double_t)(-3.45675056671992330e-01)
root[] f1.Integral(0,3)
(Double_t)1.84865252799946810e+00
root[] f1.Draw()
By default the method TF1::Paint(), that draws the function, computes 100 equidistant points to draw it. The
number of points can be set to a higher value with:
root[] f1.SetNpx(2000);
Note that while the ROOT framework is an object-oriented framework, this does not prevent the user from
calling plain functions.
User Interaction
Now we will look at some interactive capabilities. Try to draw the function sin(x)/x again. Every object in a
window (which is called a canvas) is, in fact, a graphical object in the sense that you can grab it, resize it, and
change its characteristics with a mouse click. For example, bring the cursor over the x-axis. The cursor changes
to a hand with a pointing finger when it is over the axis. Now, left click and drag the mouse along the axis to the
right. You have a very simple zoom.
When you move the mouse over any object, you can get access to selected methods by pressing the right
mouse button and obtaining a context menu. If you try this on the function TF1, you will get a menu showing
available methods. The other objects on this canvas are the title, a TPaveText object; the x and y-axis, TAxis
objects, the frame, a TFrame object, and the canvas a TCanvas object. Try clicking on these and observe the
context menu with their methods.
Figure 2-2 A context menu
For example try selecting the SetRange() method and putting -10, 10 in the dialog box fields. This is
equivalent to executing f1.SetRange(-10,10) from the command line, followed by f1.Draw(). Here are
some other options you can try.
Once the picture suits your wishes, you may want to see the code you should put in a script to obtain the same
result. To do that, choose Save / canvas.C entry of the File menu. This will generate a script showing the
options set in the current canvas. Notice that you can also save the picture into various file formats such as
PostScript, GIF, etc. Another interesting possibility is to save your canvas into the native ROOT format (.root
file). This will enable you to open it again and to change whatever you like. All objects associated to the canvas
(histograms, graphs) are saved at the same time.
16 Getting Started
Building a Multi-pad Canvas
Let us now try to build a canvas with several pads.
root[] TCanvas *MyC = new TCanvas("MyC","Test canvas",1)
root[] MyC->Divide(2,2)
Once again, we call the constructor of a class, this time the class TCanvas. The difference between this and
the previous constructor call (TF1) is that here we are creating a pointer to an object. Next, we call the method
Divide() of the TCanvas class (that is TCanvas::Divide()), which divides the canvas into four zones and
sets up a pad in each of them. We set the first pad as the active one and than draw the function f1 there.
root[] MyC->cd(1)
root[] f1->Draw()
All objects will be drawn in that pad because it is the active one. The ways for changing the active pad are:
Click the middle mouse button on a pad will set this pad as the active one.
Use the method TCanvas::cd() with the pad number, as was done in the example above:
root[] MyC->cd(3)
Pads are numbered from left to right and from top to bottom. Each new pad created by TCanvas::Divide()
has a name, which is the name of the canvas followed by _1, _2, etc. To apply the method cd() to the third
pad, you would write:
root[] MyC_3->cd()
Third pad will be selected since you called TPad::cd() for the object MyC_3. ROOT will find the
pad that was named MyC_3 when you typed it on the command line (see ROOT/CINT
Extensions to C++).
Saving the Canvas
Using the File menu / Save cascade menu users can save the canvas as one of the
files from the list. Please note that saving the canvas this way will overwrite the file
with the same name without a warning.
All supported file types can be saved via File menu / SaveAs… This dialog gives a
choice to show or suppress the confirmation message for overwriting an existing file.
Figure 2-3 The SaveAs... dialog
If the Ovewrite check box is not selected, a message dialog appears asking the user to overwrite the file
(Yes/No). The user choice is saved for the next time the Save As… dialog shows up.
Printing the Canvas
The Print command in the canvas File menu pops-up a print dialog where the user can specify a preferred print
command and the printer name.
Both print parameters can be set via the new Print.Command and Print.Printer rootrc resources as follows:
# Printer settings.
WinNT.*.Print.Command: AcroRd32.exe
Unix.*.Print.Command: xprint -P%p %f
Print.Printer: 32-rb205-hp
Print.Directory: .
Getting Started 17
If the %p and %f are specified as a part of the print command, they will be replaced by the specified printer
name and the file name. All other parameters will be kept as they are written. A print button is available in the
canvas toolbar (activated via View menu/Toolbar).
The ROOT Command Line
We have briefly touched on how to use the command line. There are different types of commands.
1. CINT commands start with “.”
root[] .? //this command will list all the CINT commands
root[] .L <filename> //load [filename]
root[] .x <filename> //load and execute [filename]
2. SHELL commands start with “.!” for example:
root[] .! ls
3. C++ commands follow C++ syntax (almost)
root[] TBrowser *b = new TBrowser()
Multi-line Commands
You can use the command line to execute multi-line commands. To begin a multi-line command you must type
a single left curly bracket {, and to end it you must type a single right curly bracket }. For example:
root[] {
end with '}'> Int_t j = 0;
end with '}'> for (Int_t i = 0; i < 3; i++)
end with '}'> {
end with '}'> j= j + i;
end with '}'> cout << "i = " << i << ", j = " << j << endl;
end with '}'> }
end with '}'> }
i = 0, j = 0
i = 1, j = 1
i = 2, j = 3
It is more convenient to edit a script than the command line, and if your multi line commands are getting
unmanageable, you may want to start with a script instead.
CINT Extensions
We should say that some things are not standard C++. The CINT interpreter has several extensions. See
“ROOT/CINT Extensions to C++”.
Helpful Hints for Command Line Typing
The interpreter knows all the classes, functions, variables, and user defined types. This enables ROOT to help
users to complete the command line. For example, if we do not know anything about the TLine class, the Tab
feature helps us to get a list of all classes starting with TL(where <TAB> means type the Tab key).
root[] l = new TLi<TAB>
TList
TListIter
TLink
TLine
TLimitDataSource
TLimit
To list the different constructors and parameters for TLine use the <TAB> key as follows:
root[] l = new TLine(<TAB>
TLine TLine()
TLine TLine(Double_t x1,Double_t y1,Double_t x2,Double_t y2)
TLine TLine(const TLine& line)
Regular Expression
The meta-characters below can be used in a regular expression:
'^' start-of-line anchor
'$' end-of-line anchor
18 Getting Started
'.' matches any character
'[' start a character class
']’ end a character class
'^’ negates character class if first character
'*’ Kleene closure (matches 0 or more)
'+’ Positive closure (1 or more)
'?’ Optional closure (0 or 1)
When using wildcards the regular expression is assumed to be preceded by a '^' (BOL) and terminated by '$'
(EOL). All '*' (closures) are assumed to be preceded by a '.', i.e. any character, except slash _/_. Its special
treatment allows the easy matching of pathnames. For example, _*.root_ will match _aap.root_, but not
_pipo/aap.root_.
The escape characters are:
\\ backslash
\b backspace
\f form feed
\n new line
\r carriage return
\s space
\t tab
\e ASCII ESC character ('\033')
\DDD number formed of 1-3 octal digits
\xDD number formed of 1-2 hex digits
\^C C = any letter. Control code
The class TRegexp can be used to create a regular expression from an input string. If wildcard is true then
the input string contains a wildcard expression.
TRegexp(const char *re, Bool_t wildcard)
Regular expression and wildcards can be easily used in methods like:
Ssiz_t Index(const TString& string,Ssiz_t* len,Ssiz_t i) const
The method finds the first occurrence of the regular expression in the string and returns its position.
Conventions
In this paragraph, we will explain some of the conventions used in ROOT source and examples.
Coding Conventions
From the first days of ROOT development, it was decided to use a set of coding conventions. This allows a
consistency throughout the source code. Learning these will help you identify what type of information you are
dealing with and enable you to understand the code better and quicker. Of course, you can use whatever
convention you want but if you are going to submit some code for inclusion into the ROOT sources, you will
need to use these.
These are the coding conventions:
Classes begin with T: TLine, TTree
Non-class types end with _t: Int_t
Data members begin with f: fTree
Member functions begin with a capital: Loop()
Constants begin with k: kInitialSize, kRed
Global variables begin with g: gEnv
Static data members begin with fg: fgTokenClient
Enumeration types begin with E: EColorLevel
Locals and parameters begin with a lower case: nbytes
Getters and setters begin with Get and Set: SetLast(), GetFirst()
Machine Independent Types
Different machines may have different lengths for the same type. The most famous example is the int type. It
may be 16 bits on some old machines and 32 bits on some newer ones. To ensure the size of your variables,
use these pre defined types in ROOT:
Getting Started 19
Char_t Signed Character 1 byte
UChar_t Unsigned Character 1 byte
Short_t Signed Short integer 2 bytes
UShort_t Unsigned Short integer 2 bytes
Int_t Signed integer 4 bytes
UInt_t Unsigned integer 4 bytes
Long64_t Portable signed long integer 8 bytes
ULong64_t Portable unsigned long integer 8 bytes
Float_t Float 4 bytes
Double_t Float 8 bytes
Double32_t Double 8 bytes in memory, written as a Float 4 bytes
Bool_t Boolean (0=false, 1=true)
If you do not want to save a variable on disk, you can use int or Int_t, the result will be the same and the
interpreter or the compiler will treat them in exactly the same way.
TObject
In ROOT, almost all classes inherit from a common base class called TObject. This kind of architecture is also
used in the Java language. The TObject class provides default behavior and protocol for all objects in the
ROOT system. The main advantage of this approach is that it enforces the common behavior of the derived
classes and consequently it ensures the consistency of the whole system. See "The Role of TObject".
TObject provides protocol, i.e. (abstract) member functions, for:
Object I/O (Read(), Write())
Error handling (Warning(), Error(), SysError(), Fatal())
Sorting (IsSortable(), Compare(), IsEqual(), Hash())
Inspection (Dump(), Inspect())
Printing (Print())
Drawing (Draw(), Paint(), ExecuteEvent())
Bit handling (SetBit(), TestBit())
Memory allocation (operator new and delete, IsOnHeap())
Access to meta information (IsA(), InheritsFrom())
Object browsing (Browse(), IsFolder())
Global Variables
ROOT has a set of global variables that apply to the session. For example, gDirectory always holds the
current directory, and gStyle holds the current style. All global variables begin with “g” followed by a capital
letter.
gROOT
The single instance of TROOT is accessible via the global gROOT and holds information relative to the current
session. By using the gROOT pointer, you get the access to every object created in a ROOT program. The
TROOT object has several lists pointing to the main ROOT objects. During a ROOT session, the gROOT keeps a
series of collections to manage objects. They can be accessed via gROOT::GetListOf… methods.
gROOT->GetListOfClasses()
gROOT->GetListOfColors()
gROOT->GetListOfTypes()
gROOT->GetListOfGlobals()
gROOT->GetListOfGlobalFunctions()
gROOT->GetListOfFiles()
gROOT->GetListOfMappedFiles()
gROOT->GetListOfSockets()
gROOT->GetListOfCanvases()
gROOT->GetListOfStyles()
gROOT->GetListOfFunctions()
gROOT->GetListOfSpecials()
gROOT->GetListOfGeometries()
gROOT->GetListOfBrowsers()
gROOT->GetListOfMessageHandlers()
20 Getting Started
These methods return a TSeqCollection, meaning a collection of objects, and they can be used to do list
operations such as finding an object, or traversing the list and calling a method for each of the members. See
the TCollection class description for the full set of methods supported for a collection. For example, to find a
canvas called c1 you can do:
root[] gROOT->GetListOfCanvases()->FindObject("c1")
This returns a pointer to a TObject, and before you can use it as a canvas you need to cast it to a TCanvas*.
gFile
gFile is the pointer to the current opened file in the ROOT session.
gDirectory
gDirectory is a pointer to the current directory. The concept and role of a directory is explained in the chapter
“Input/Output”.
gPad
A graphic object is always drawn on the active pad. It is convenient to access the active pad, no matter what it
is. For that, we have gPad that is always pointing to the active pad. For example, if you want to change the fill
color of the active pad to blue, but you do not know its name, you can use gPad.
root[] gPad->SetFillColor(38)
To get the list of colors, if you have an open canvas, click in the "View" menu, selecting the "Colors" entry.
gRandom
gRandom is a pointer to the current random number generator. By default, it points to a TRandom3 object,
based on the "Mersenne-Twister" generator. This generator is very fast and has very good random proprieties
(a very long period of 10600). Setting the seed to 0 implies that the seed will be uniquely generated using the
TUUID. Any other value will be used as a constant. The following basic random distributions are provided:
Rndm() or Uniform(min,max), Gaus(mean,sigma), Exp(tau), BreitWigner(mean,sigma),
Landau(mean,sigma), Poisson(mean), Binomial(ntot,prob). You can customize your ROOT session
by replacing the random number generator. You can delete gRandom and recreate it with your own. For
example:
root[] delete gRandom;
root[] gRandom = new TRandom2(0); //seed=0
TRandom2 is another generator, which is also very fast and uses only three words for its state.
gEnv
gEnv is the global variable (of type TEnv) with all the environment settings for the current session. This variable
is set by reading the contents of a .rootrc file (or $ROOTSYS/etc/system.rootrc) at the beginning of the
root session. See Environment Setup below for more information.
Environment Setup
The behavior of a ROOT session can be tailored with the options in the .rootrc file. At start-up, ROOT looks
for a .rootrc file in the following order:
./.rootrc //local directory
$HOME/.rootrc //user directory
$ROOTSYS/etc/system.rootrc //global ROOT directory
If more than one .rootrc files are found in the search paths above, the options are merged, with precedence
local, user, global. While in a session, to see current settings, you can do:
root[] gEnv->Print()
The rootrc file typically looks like:
# Path used by dynamic loader to find shared libraries
Unix.*.Root.DynamicPath: .:~/rootlibs:$(ROOTSYS)/lib
Unix.*.Root.MacroPath: .:~/rootmacros:$(ROOTSYS)/macros
# Path where to look for TrueType fonts
Unix.*.Root.UseTTFonts: true
剩余244页未读,继续阅读
117 浏览量
2022-09-24 上传
7357 浏览量
265 浏览量
A、cp /root /root-bak B、cp -r /root /root-bak C、cp -r /root /root/bak D、cp /root /root/bak那个能正确运行,为什么
103 浏览量
324 浏览量
2023-06-10 上传
115 浏览量
2023-07-12 上传
144 浏览量
jstzhurj
- 粉丝: 0
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 数字信息图技术开发指南
- 掌握CSS样式初始化技巧提升网页设计效率
- Matlab开发:提升算法敏感性与腐蚀性策略
- Swift编程在遗传学领域的创新尝试
- Android ViewFlow无限循环轮播图开发教程
- 汽车网站焦点图实现:Flash雨刷样式代码解析
- SnapMark: 利用JavaScript实现的压缩包子工具
- JupyterNotebook在时尚数据挑战中的应用解析
- flaviodb: 用Erlang开发的Riak Core消息流存储项目
- 初涉C++与MFC框架,实习项目MotionPanel回顾
- stm8单片机空气净化器设计与实现教程
- 掌握OpenCV入门:计算机视觉PPT学习课件
- 实现Flutter应用状态不丢失的重新启动方法
- EF4、MVC6与AutofacIOC框架实例教程
- uwsgiFouine:解析UWSGI日志以优化Web服务器性能
- 实现智能人脸识别API的最终项目指南
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功