This package was designed to allow studies and optimizations on TrackInCaloTools using AODs as input.
It provides C++ functions and dictionaries for PyAthena to access information from the tool. Checking out together this code with the PyH4l, one can dump ntuples containing the cells around the track and the extrapolations on each layer (actually a minimum of information is kept).

It provides also functionalities to check differences between releases. See TrackInCaloToolsOpt#CompareReleases.


To really profit from this code you should have a working area set with PyH4l.
In what follows example the full list of commands will be given in order to dump the cells and other information from the TrackInCaloOpt package in an ntuple out of an AOD file, using the TrackInCaloTools package.
The example below runs on 14.4.0 release Commands to be typed in the prompt are showed in in red.
Prepare your working directory

    • zsh
    • mkdir TestArea
    • cd TestArea
    • mkdir 14.4.0
    • cd 14.4.0
    • mkdir cmthome
    • cd cmthome

Prepare your cmt environment (copy the following requirements file in your cmthome directory)
    • #-----------------------------------------------------------------------
      set CMTSITE CERN
      set SITEROOT /afs/
      macro ATLAS_DIST_AREA /afs/
      macro ATLAS_TEST_AREA ${HOME}/TestArea/
      apply_tag setup
      apply_tag simpleTest
      apply_tag setupCMT
      apply_tag 14.4.0
      apply_tag 32
      apply_tag opt
      use AtlasLogin AtlasLogin-* $(ATLAS_DIST_AREA)

cd $TestArea
mkdir -p Reconstruction/RecoTools
cd Reconstruction/RecoTools

export CVSROOT="$"
export CVS_RSH="ssh"

If you are using a release older than 15.1.0, with the standard version of TrackInCaloTools, you should checkout the branch:

cvs co -r Before-ITCT-change TrackInCaloToolsOpt

For the new version:

cvs co TrackInCaloToolsOpt

WARNING: If you are running in release 14 with the new version, you have to edit TrackInCaloTools.cxx, replacing CaloInterface by CaloUtils

WARNING 2: For versions older than 15.0.0, there is a bug in CaloDetDescrManager::cellsInZone. Phi is not consider continuous when taking cells and this is used by CaloCellList::select. To fix it:

cmt co -r CaloDetDescr-00-09-57 Calorimeter/CaloDetDescr

Then config and compile:

cd TrackInCaloToolsOpt/cmt
cmt config

If everything goes fine, at this point you have compiled all the necessary packages TrackInCaloToolsOpt and PyH4l


    • The package was tested in release 14.2.23, 14.4.0 , 14.5.0 *(To use in releases older than 14.2.0, one should change TrackInCaloTools to allow the selection of the CaloCellContainer via jobOptions (the default is for ESDs).)
    • Go to the share/ directory and edit the file athena, replacing the InputCollections with the path of your AOD(s) and the output ntuple file with the path you want to store you ntuple After run with the command:
    • athena

You should get a file root file containing ntuples like muon and true_muon. The former should hold branches like 'cells' and 'extrapolations', that need a dictionary to be accessed. The latter should contain information from the generator, including the "true" energy loss of the muons. An example can be found at share/

Even if you do not have PyH4l installed, you should be able to see the code working by launching (again replacing the InputCollections by a list with the path of your AODs):

athena -i 

Reading the output

The normal output of the code is a ROOT file, created by PyH4l, that contains trees like muon. TrackInCaloToolsOpt added 2 branches to the tree: cells and extrapolations. Both are classes, so to read it you need a dictionary. If you are inside athena, check or read_ntuple.C.

If you are outside, you need to copy MyCaloCell.h, MyExtrapolation.h and Loader.C, and generate the dictionary:

root [0] .L Loader.C+

WARNING: Does not work in ROOT 5.18, tested in 5.17 and 5.20. A ROOT post with the same problem

Content of the ntuples

The branch cells is a vector < vector < MyCaloCell* > > with one entry per muon per cell. MyCaloCell contains the following information about the cells:

  • Energy: e, et
  • Noise: noise
  • Position: eta, phi
  • Size: deta, dphi
  • Calorimeter:
    • subcalo (c->caloDDE()->getSampling(), should be LAREM=0, LARHEC=1, LARFCAL=2, TILE=3, NSUBCALO=4, NOT_VALID=999999 )
    • layer: ps=0,em1=1,em2=2,em3=3,tile1=4,tile2=5,tile3=6,hec0=7,hec1=8,hec2=9,hec3=10

The branch extrapolations is a vector of vector of MyExtrapolation* with one entry per muon, and one per layer where extrapolation succeeded. Also the extrapolation to the entrance of the muon spectrometer is present as the last entry of the vector (layer = 11). MyExtrapolation contains the following variables:

  • layer (same convention as in MyCaloCell, with MS entrance as layer 11)
  • p
  • eta
  • phi


Tested at Lyon with single muon AODs:

  • 5 minutes to run 10k events (removing the outputs from AthenaEventLoopMsg)
  • output file size: 23 MB

Compare Releases

To check the method IEnergyDepositionTool::measurement, the jobOptions share/ is provided, which can run on AODs or ESDs (default setting).

The etcone variables can be dumped calling share/ You can re-run reconstruction using this jobOptions file.


For the extrapolation to the MS, using D. Lopez's MuonTrackThroughCalo: r=4250 / z = 6500 (hardcoded)

Issues with CaloDetDesc

- Tag 00-09-56 fixes the problem with phi continuity - Tag 00-09-57 fixes the problem with the wrong surface if eta outside the subcalo (end-cap)

cmt co -r CaloDetDescr-00-09-57 Calorimeter/CaloDetDescr

-- BrunoLenzi - 17 Dec 2008

Topic attachments
I Attachment History Action Size Date Who Comment
Texttxt r1 manage 2.1 K 2009-02-11 - 19:42 BrunoLenzi  
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r12 - 2009-04-15 - BrunoLenzi
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main 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