%CERTIFY%

Trigger Handler for ARATopQuarkAnalysis Rel 14.1.0.11

Introduction

This algorithm is meant to be a complement to the ARATopQuarkAnalysis tool. The basic functionality of the algorithm is to perform a match between offline objects and HLT rois of a given chain. The input of the algo is any of the offline containers (ElectronAODCollection, PhotonAODCollections, etc) and the output can be set to be a container in StoreGate with all the objects that match a given HLT chain, or the object that didn't match any rois of a given HLT chain.
Notes:
  • This algorithm was done to work under release 14.1.0.11 (AtlasPoint1), although a migration to newer releases seems to be straightforward.
  • Here we describe how to run the algorithm under the ARATopQuarkAnalysis enviroment. However, it can be implemented in any other package following the same steps.
  • Work to include the matching with LVL1 rois is ongoing.

General recipe to set up and run

  1. Set up release 14.1.0.11 ,
    e.g. source ~/cmthome/setup.sh -tag=14.1.0.11,AtlasPoint1,32;
    Just in case, a basic requirements and setup files are attached.
  2. Check out ARATopQuarkAnalysis and adapt it following Volker's Twiki http://personal.ifae.es/vorwerk/twikIFAE/ so it compiles and run by default .
  3. Copy the files TriggerHandler.cxx and TriggerHandler.h to the appropiate directories ( ARATopQuarkAnalysis/src and ARATopQuarkAnalysis/ARATopQuarkAnalysis ).
  4. Include in src/components/ARATopQuarkAnalysis_entries.cxx the following lines:
#include "ARATopQuarkAnalysis/TriggerHandler.h"
DECLARE_ALGORITHM_FACTORY(TriggerHandler)
DECLARE_ALGORITHM( TriggerHandler );
  
Add the following lines to the requirements file under /cmt
use UserAnalysisUtils           UserAnalysisUtils-*             PhysicsAnalysis/AnalysisCommon
use Particle                    Particle-*                      Reconstruction
use TrigConfigSvc               TrigConfigSvc-*                 Trigger/TrigConfiguration
use AtlasAnalysisRunTime        AtlasAnalysisRunTime-*
use TrigConfigSvc TrigConfigSvc-* Trigger/TrigConfiguration
use TrigInDetEvent TrigInDetEvent-* Trigger/TrigEvent
use TrigParticle TrigParticle-* Trigger/TrigEvent
  
5. Once this is ready, you should be able to compile again. Then all you need to do is include the tool in the main joboption. A basic usage is described in the next section.

Example

Reco-Trigger Electron Matching

For this example, we used the following AOD:
'/afs/cern.ch/atlas/offline/external/FullChainTest/long/14.1.0.2/root_files/AllBasicSamples.AOD.pool.root'
Note: Detector Description Version should be adapted according to the input sample.
For this AOD file the corresponding version is : "ATLAS-CSC-05-01-00"

Adding the following lines to the main joboption, one can perform a matching between offline electrons and the rois accepted by the EF_25i trigger chain. The code should be self-explanatory.

# list of the algorithms to be executed at run time
from ARATopQuarkAnalysis.ARATopQuarkAnalysisConf import TriggerHandler

##Add the algorithm to the actual sequence
TopAlg += TriggerHandler("TriggerHandlerE")
TriggerHandlerE = TriggerHandler("TriggerHandlerE")

############# The properties of the TriggerTool Algorithm
TriggerHandlerE.Particle = "Electrons"   ## Which particle are you interested in?  --   Electrons , Photons , Muons , Taus , Jets , MET   --

TriggerHandlerE.InputContainer = "ElectronAODCollection"
TriggerHandlerE.OutputContainer = "myGoodElectrons"
TriggerHandlerE.DeltaRMatchCut = 0.1    ## 0.1 default
TriggerHandlerE.TriggerChain   = "EF_e25i"
TriggerHandlerE.Inverse = False     ## False default . True if you like those particles rejected by the trigger selection.

##########################################
## Set up trigger configuration service and metadata service is relies on, for analysis job without RecExCommon

# might be needed for TriggerConfigGetter...
from RecExConfig.RecFlags  import rec
rec.readAOD=True
rec.doWriteAOD=False
rec.doWriteESD=False
# set up trigger config service
from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
cfg =  TriggerConfigGetter()

## END of trigger setup 

So doing for example, athena.py TopQuarkAnalysis_joboption.py > test.log

you should see: grep TriggerHandler test.log

TriggerHandlerE                                 INFO  Looking for EF_e25i accepted electrons ...
TriggerHandlerE                                 INFO     Recorded myGoodElectrons (1 of 14 electrons in the event)
TriggerHandlerE                                 INFO  Looking for EF_e25i accepted electrons ...
TriggerHandlerE                                 INFO   No active RoIs for this chain
TriggerHandlerE                                 INFO  Looking for EF_e25i accepted electrons ...
TriggerHandlerE                                 INFO     Recorded myGoodElectrons (1 of 7 electrons in the event)
...
After this, one can include the output container in the DPD just adding the following line in the main joboption:
StreamDPD.ItemList += ['ElectronContainer#myGoodElectrons']
So one would get in the DPD file a new container named myGoodElectrons that contains all the electrons that matched an EF_e25i trigger object.

Extra Exercise

Using the Trigger Decision in ARA

Using ARA one can obtain which events satisfied a given Trigger Menu in a simple way. The procedure is described in the following section. The exercise is based on the use of the isPassed() method of the TriggerBitDecoder class

Implementation

  1. Set up release 14.1.0.11 ,
  2. Check out all the packages necessaries to properly run ARA in this release: You can use the file attached (named check_compile.sh) and just run it from your work directory. Note: you should compile the packages twice.
  3. Copy the attached files electronsTEST.C and testAOD14.py to your run directory, and execute the .C file in your ROOT session. The code should be easy to read (it's just ROOT code). This will create a plot similar to this one Electrons.AOD14.eps
Notes :
  • Of Course, you can play with the electronsTEST.C and for example ask the electrons to satisfy a different trigger chain, or instead of using electrons, you can look for any other particle.
  • This example is set to run over AOD14.pool.root that you can either link for instance to
'/afs/cern.ch/atlas/offline/external/FullChainTest/long/14.1.0.2/root_files/AllBasicSamples.AOD.pool.root'
or well change the filename inside testAOD14.py

  • If you don't have the utils.c and utils.h neccesaries for the AtlasStyle, just comment those lines in the .C file.

Useful Links

AthenaROOTAccess
PhysicsAnalysisWorkBookAODAnalysisRel14
TrigDecisionTool
TriggerARA130303

Major updates:
-- XabierAnduaga - 30 Jun 2008

%RESPONSIBLE% XabierAnduaga -- MartinTripiana
%REVIEW% -- MartinTripiana - 26 Jun 2008

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formateps Electrons.AOD14.eps r1 manage 38.1 K 2008-06-26 - 12:34 XabierAnduaga  
Unknown file formatcxx TriggerHandler.cxx r1 manage 17.1 K 2008-06-30 - 15:11 XabierAnduaga  
Header fileh TriggerHandler.h r1 manage 1.9 K 2008-06-30 - 15:11 XabierAnduaga  
Unix shell scriptsh check_compile.sh r1 manage 3.6 K 2008-06-26 - 12:24 XabierAnduaga  
C source code filec electronsTEST.C r1 manage 7.0 K 2008-06-26 - 12:34 XabierAnduaga  
Unknown file formatext requirements r1 manage 0.4 K 2008-06-27 - 14:35 XabierAnduaga  
Unix shell scriptsh setup.sh r1 manage 0.4 K 2008-06-27 - 14:45 XabierAnduaga  
Texttxt testAOD14.py.txt r1 manage 0.8 K 2008-06-26 - 12:40 XabierAnduaga delete the .txt in the filename
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r7 - 2008-07-02 - XabierAnduaga
 
    • 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