User Tools

Site Tools


How I compile root program with gcc

gcc `root-config --libs` `root-config --cflags`

How I run root form an editor (e.g. vim)

  • I've written the following script
# first look whether there is a terminal with root running
pid=$(ps -Ao ''%p %a'' |grep terminal|grep root|awk '{print $1}')
if [ -n ''$pid'' ]; then kill $pid; fi
# now run new terminal and root inside
gnome-terminal --disable-factory --geometry 130x50 --window-with-profile=root --hide-menubar -x root -l $1++&

It opens new terminal window and inside runs root which starts compiling source passed in $1. The first part looks for an existing root terminal window and closes it. Thus, after multiple script exucutions, there is just one root terminal window.

  • This script can be used in your favourite editor. In vim I use it through Ctrl-F9 hot key, it is achieved by following line in .vimrc
map <C-F9> :wa<cr>:!runroot %<cr><cr>

That :wa save all documents first.

Scram output colorized

See the script.

A great debugging tool

Tired of endless debugging? Try Valgrind!

Event dump - show structure of an event

module dump = EventContentAnalyzer {}


process.dump = cms.EDAnalyzer("EventContentAnalyzer")

Or use binary edmDumpEventContent.

Show steps/progress of processing

service = Tracer {}


process.Tracer = cms.Service("Tracer"

in the new format (note the name Tracer is obligatory).

A missing symbol ?

The following script can find where it comes from.


if [ -z "$1" ]
	echo "USAGE: cmssw_findsymbol <symbol to find>"
	exit 1

for file in  $CMSSW_BASE/lib/$SCRAM_ARCH/*.so
	output=`nm -C $file|grep -l "$1"`
	if [ -n "$output" ]
		echo ${file##*/}
en/prog/root.txt · Last modified: 2010/03/05 18:44 (external edit)