QtRoot

QtRoot is a tool developed by Valeri Fine from BNL. For more information see QtRoot main page or UNIX installation guide.

Jan has made a few modifications for a better performance in within the TotemDQM. All modifications are annotated by "by kaspi" comment. The modified files are

  • qt/src/TGQt.cxx
  • qt/src/TQtWidget.cxx
  • qtgui/src/TQtGuiFactory.cxx
  • qt/src/TQtPadFont.cxx
  • qtgui/src/TQtMmlTextProxy.cxx
The original build system was found hardly applicable for CMSSW and hence a replacement has been created - the build script. Only qt and qtgui modules are built since they seem sufficient for a smooth work of the TotemDQM. All that is available in the TOTEM SVN repository under trunk/offline/cmssw/tools/QtRoot.

Installation as a CMSSW tool

Step 1: download and compile QtRoot

If you can use AFS, you may skip this step as there is a version ready to use (only for CMSSW 3.1.1) at /afs/cern.ch/exp/totem/scratch/Release/cmssw/slc4_ia32_gcc345/lcg/QtRoot.

Otherwise download the package from SVN. You should load CMSSW environmental settings prior to the compilation! You will also need gcc and root settings and there are 2 ways to obtain them. If you have existing Totem software project you can get to that directory and type eval `scram runtime -sh`. Otherwise you can manually load needed settings, e.g. for CMSSW 4.2.4 from:

/afs/cern.ch/sw/lcg/external/gcc/4.3.2/x86_64-slc5/setup.sh

/afs/cern.ch/sw/lcg/app/releases/ROOT/5.27.06/x86_64-slc5-gcc43-opt/root/bin/thisroot.sh

After that, run ./build script to compile qtroot.

Step 2: update CMSSW tools

  • In config/toolbox/ARCHITECTURE/tools/selected (under your local CMSSW workspace) save the following file in qtroot.xml

  <tool name="qtroot" version="ValeriFineCVS">
    <lib name="GQt"/>
    <lib name="QtRootGui"/>

    <client>
      <!-- replace following path with a path to your qtroot -->
      <environment name="QTROOT_BASE" default="/afs/cern.ch/exp/totem/scratch/Release/cmssw/slc4_ia32_gcc345/lcg/QtRoot"/>
      <environment name="LIBDIR" default="$QTROOT_BASE/lib"/>
      <environment name="INCLUDE" default="$QTROOT_BASE/"/>
    </client>

    <runtime name="QTROOT_DIR" value="$QTROOT_BASE/"/>
    <runtime name="USE_CUSTOM_QTROOT" value="1"/>

    <use name="qt"/>
    <use name="libjpg"/>
    <use name="libpng"/>
    <use name="rootgpad"/>
    <use name="root"/>
    <use name="rootcore"/>
    <use name="rootgraphics"/>
    <use name="rootinteractive"/>
  </tool>

  • In the same directory edit qt.xml and add the following line
<lib name="QtWebKit"/>

  • Detach the libGQt.so library from rootinteractive tool: Open rootinteractive.xml and remove line
    <lib name="GQt"/>

  • Eventually, update all the modified tools by
    scram setup <tool>
    (I might be necessary to reload the entire CMSSW environment afterwards, or even to do scram b distclean and recompile everything from scratch).

Step 3: Use it

  • Obviously, you should add
<use name="qtroot">
to any BuildFile that relies on the QtRoot interface.

  • Then, whenever you include a header file from the QtRoot interface (e.g. TQtWidget.h, TQGt.h), you should prefix it with qt/inc/ (e.g. #include "qt/inc/TQtWidget.h"). It is clear that this modification will make it complicated to share the code with colleagues that don't use the QtRoot tool. To make it smooth and transparent, you may employ the following trick. The header file inclusion would use a condition:
#if (CUSTOM_QTROOT + 1) > 1
  #include "qt/inc/TQtWidget.h"
#else
  #include "TQtWidget.h"
#endif
The symbol CUSTOM_QTROOT shall be set by BuildFile:
<flags cxxflags="-g3 -O0 -DCUSTOM_QTROOT=$(USE_CUSTOM_QTROOT)">
And the environment variable USE_CUSTOM_QTROOT is set by the tool itself (see the qtroot.xml).

  • And finally, add path to libQtRootGui.so to your LD_LIBRARY_PATH. The path would probably be $CMSSW_BASE/external/slc4_ia32_gcc345/lib.

-- JanKaspar - 07 Aug 2009

Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r12 - 2011-09-13 - unknown
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    TOTEM All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback