Instructions for Re-running electron and photon identification on the AOD

Preface

This page describes how to run electron and gamma identification (ID) tools on the "PhotonAODCollection" and "ElectronAODCollection" in the AOD. The output is a rendered (or reprocessed) AOD

Motivation

There are several motivations for re-running ID at the AOD level. For example, when a release is ready and AODs are produced, one might want to re-optimise the identification cuts and check the performance after the implementation of these cuts. Moreover a method has been devised to re-calibrate the clusters on existing AODs ( EgammaAODReCluster), after which running ID will be a necessity.

Some Background Info On egamma Reconstruction

Reconstruction is run in RecExCommon_topOptions.py. Two main reconstruction job options are included in this file, SystemRec_config.py and CombinedRec_config.py. As the names suggest, the first performs initial system reconstruction (e.g. create calorimeter clusters) while the latter performs combined reconstruction e.g. attempts to match tracks in the inner detector to clusters in the calorimeter. For building electron and photon objects the following is called:

protectedInclude( "egammaRec/egammaRec_jobOptions.py" )

To re-run ID, we will adapt certain steps already existing in the egamma reconstruction. Electron and photon identification is carried out when the egammaAODBuilder algorithm in configured in egammaAODGetter.py. The egammaAODBuilder runs the EMPIDBuilder tool (EMPIDBuilder.py). It is EMPIDBuilder that calculates ID related variables i.e. the isEM flag (based on a conventional cut-based approach) and the multivariate ID variables e.g. likelihood discriminant, a H-matrix, boosted decision tree (BDT) and a neural network (NN).

How to run electron and gamma identification on an AOD (AOD reprocessing)

This "how to" is for Athena release 14.2.10. See this page to review how to setup a release.

Step 1

Check out the following packages:

Step 2

Copy the three files attached to this document, namely egammaAODRender.cxx, egammaAODRender.h, and egammaAODRenderGetter.py, into the relevant area
cp egammaAODRender.cxx  egammaRec/src/.
cp egammaAODRender.h egammaRec/egammaRec/.
cp egammaAODRenderGetter.py  in egammaRec/python

Step 3

Edit
egammaRec/src/components/egammaRec_entries.cxx
by adding
#include "egammaRec/egammaAODRender.h"
DECLARE_ALGORITHM_FACTORY( egammaAODRender )
DECLARE_ALGORITHM( egammaAODRender )
where exactly to place these lines will become self evident when you open the file with an editor

Step 4

A line of code called when running EMPIDBuilder was found not to be compatible with running over an AOD. Specifically one must replace
m_pT = (((*t).originalTrack())->perigeeParameters())->pT();
with
m_pT = t->measuredPerigee()->pT();
in
egammaRec/src/EPiLogLikelihoodSE.cxx

The former bit of code was found to cause segmentation faults when running over an AOD. The new code is compatible for both AOD and ESD data formats.

Step 5

One needs to call the egammaAODRender algorithm using the configurable egammaAODRenderGetter.py, which itself needs to be called in egammaRec_jobOptions.py which is a part of the Reconstruction/egammaRec package

Cut and paste the following into egammaRec/share/egammaRec_jobOptions.py

if rec.readAOD and rec.doWriteAOD:
    try:
        from egammaRec.egammaAODRenderGetter import egammaAODRenderGetter
        egammaAODRenderGetter()
    except Exception:
        treatException("Could not set up egammaAODRender. Switched off !")
at the end of the file

Step 6

In order to perform re-clustering and have the new cluster saved into a container,

In egammaRec/share/egammaOutputItemList_jobOptions.py add the following:

if rec.readAOD and rec.doWriteAOD:
    egammaAODList += [ "CaloClusterContainer#egClusterAODCorr" ]
    egammaAODList += [ "CaloCellLinkContainer#egClusterAODCorr_Link" ]
    egammaAODList += [ "CaloShowerContainer#egClusterAODCorr_Data" ]
at the end of the file

The above will ensure a new cluster collection with the key egClusterAODCorr is written into the rendered AOD.

Step 7

Recompile egammaRec

cd egammaRec/cmt 
cmt br gmake
to ensure egammaAODRender is integrated into the egammaRec package

Step 8

You can use the example top option below to run egammaAODRender. Note if you want to tune the reclustering you'll have to edit egammaAODRenderGetter.py i.e change the input arguments of egammaSWTool, alternatively you can turn off re-clustering by setting
  doReCluster = False 
Similarly EMPIDBuilder can can be turned off
  doEMPID = False 
Be aware if both tools are turned off, egammaAODRender will just be a computationally expensive way of copying an AOD i.e. it will do nothing useful.

An example topOptions file

##########################################
# egammaAODRender_topOptions.py
# Created by: A. Limosani
##########################################
#Set RecFlags
readAOD=True
doWriteAOD=True
doCBNT=False
doWriteRDO=False
doWriteESD=False
doAOD=False 
doWriteTAG=False 
readESD=False

#Set GlobalFlags
DetDescrVersion='ATLAS-CSC-xx-yy-zz'
    
#Set AthenaCommonFlags
PoolAODInput = ["AOD.pool.root"] 
PoolAODOutput="AOD.rendered.pool.root"
EvtMax=-1

include ("RecExCommon/RecExCommon_topOptions.py")
##########################################

Feedback

Please send your comments and suggestions to antonio.limosani@cernNOSPAMPLEASE.ch

-- AntonioLimosani - 07 Aug 2008

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2008-08-07 - AntonioLimosani
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

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