[Notes] ROOT User Guide (1)

本文介绍ROOT系统的基础知识,包括如何启动、使用CINT命令、GUI操作等。还讲解了TObject、TCanvas等核心类的功能及用法,并提供了实用示例。

What is ROOT?

The ROOT system provides a set of OO frameworks with all the functionality needed to handle and analyze large amounts of data in a very efficient way. See here for more about ROOT.

Chapter 1. Getting Started

Command line

root [-?] [-b] [-q] [filename]

-?   : for help information

-b : run in batch mode without graphics

-q : run root then quit

filename : execute the source file

 

CINT commands start with "."

root[] .? //show help information of CINT/ROOT C/C++ interpreter

root[] .L //load file, note: not upper case not lower case

root[] .x //execute file

root[] .!ls //os shell command

 

For more useful CINT commands, use command ".?".

 

Use TAB to invoke helpful hints(works like linux shell)

 

TObject::Dump() and TObject::Inspect() are useful methods to see the state of an object.

 

Using GUI

Inheritance:

TObject<--TPad<--TCanvas

 

• Only one TCanvas can be active at a time

• Only one Tpad can be active at a time

• Every object have a method Draw() 

 

Editor Frame

e.g. TAxis ~ TAxisEditor

 

Context Menu

Right click any object in canvas to get its context menu showing available methods. This can be alternative to 

 

 

Interact with the GUI to make the picture suit your wishes. Once done you can save it into various formats(like GIF, C, etc.)

 

Multi-pad Canvas

root[] TCanvas *MyC = new TCanvas("MyC","Test canvas",1)

root[] MyC->Divide(2,2) // 2 * 2, total 4 pads

root[] MyC->Cd(1) // Pad 1 is the active pad

root[] f1->Draw() // Function f1 is drawn on pad 1

root[] MyC->Cd(3) // switch to Pad 3, which is the active now

root[] MyC_3->Cd() // equivalent to the previous line assuming MyC_3 is a pointer to the third pad in the canvas

 

 

Global Variables

  • gROOT: get a set of global variables, like functions, browsers, classes, colors, etc.
  • gFile: (don't understand)
  • gDirectory:(don't understand)

 

Common Methods:

TF1

• Eval

• Derivative

• Integrate

• Draw

• SetNpx: how many equidistant points to draw

 

 

在Gradle 8.0构建过程中,如果遇到 `Could not determine dependencies of task 'lintVitalReportRelease'` 错误,并且提示 `ANDROID_HOME` 或 `SDK location not found`,这通常意味着Gradle无法找到Android SDK的安装路径。此类问题可能由多种原因引起,以下是一些常见的排查与解决方法: 1. **设置 ANDROID_SDK_ROOT 环境变量** Gradle在构建Android项目时会依赖环境变量 `ANDROID_SDK_ROOT` 来定位Android SDK的位置。如果该变量未正确设置,将导致SDK路径解析失败。可以在系统环境变量中添加如下配置(以Linux为例): ```bash export ANDROID_SDK_ROOT=/home/zhengxiting/Android/Sdk ``` Windows用户可以通过系统属性设置环境变量,指向SDK安装目录。 2. **配置 local.properties 文件** 在项目根目录下的 `local.properties` 文件中手动指定SDK路径也是一种常见做法。可以编辑该文件并添加以下内容[^1]: ``` sdk.dir=/home/zhengxiting/Android/Sdk ``` 这样Gradle将会从该配置文件中读取SDK位置信息,避免因环境变量缺失而导致的问题。 3. **检查gradle.properties中的配置** 确保项目的 `gradle.properties` 文件中没有错误地覆盖了SDK路径或设置了不兼容的构建参数。例如,某些插件或第三方工具可能会引入冲突的配置项,需要逐一排查。 4. **使用国内镜像加速Gradle下载** 如果同时存在Gradle依赖下载缓慢的问题,可以考虑替换Gradle分发地址为国内镜像源,如腾讯云提供的镜像服务。修改 `gradle/wrapper/gradle-wrapper.properties` 文件中的 `distributionUrl` 如下[^2]: ``` distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.0-bin.zip ``` 5. **清理缓存并重新同步项目** Android Studio提供了清理缓存和重新同步的功能。可以通过菜单选择 **File > Sync Project with Gradle Files** 来触发一次完整的Gradle配置刷新。也可以手动删除 `.gradle` 和 `.idea` 目录后重新导入项目。 6. **验证Android Studio与SDK版本兼容性** Gradle 8.0对Android Studio版本有一定要求,建议使用最新稳定版Android Studio来支持最新的Gradle特性。此外,确保所使用的Android SDK Tools、Platform Tools等组件已更新至最新版本。 7. **检查gradle插件版本是否兼容** Gradle 8.0与旧版本的Android Gradle插件可能存在兼容性问题。建议将插件版本升级到7.4.x或更高版本,以获得更好的稳定性与功能支持。 通过上述步骤,大多数与SDK路径相关的Gradle构建失败问题都可以得到解决。如果仍然存在问题,建议查看详细的构建日志,寻找更具体的错误线索。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值