TWiki> Main Web>ATLASWatchManTutorial1r15 (revision 6)EditAttachPDF

ATLASWatchMan Tutorial with r15 : how to make my own steering file step by step ?


The goal of this tutorial is to build from A to Z a non-trivial analysis with ATLASWatchMan. So we are going to select, reconstruct and dump candidates for semi-leptonic ttbar pairs events.

Installing ATLASWatchMan

  • First you have to create a new directory for athena r15.2.0 (if not already done) and install ATLASWatchMan in it. For this, you should follow step by step instructions given on ATLASWatchManQuickStart wiki.

  • Do not forget at the end of the installation process to try running the default steering file :
    cd ../run
    python -m ATLASWatchMan/ATLASWatchMan_Parser ATLASWatchMan_AnalysisSteeringFile_benchmarkChannels
    athena -c "InputCollections=['myNiceFile1', 'myNiceFile2']; EvtMax=500" ../share/

  • ... and check that the output D3PD is not empty :
    root.exe -l OutputD3PD.root
    sumWeightsMC->Draw(); // Contains total number of weighted events read
    benchmarkChannelsTree->Draw(""); // channels passed 
    benchmarkChannelsTree->Draw("jet4mom.Pt():jet4mom.Eta()"); // jet Pt vs Eta
    Two important points :
    • there are two output trees : benchmarkChannelsTree contains event by event information, benchmarkChannelsInfoTree contains global information like maps between each object selection and its subsequent array position.
    • the name of the D3PD trees are taken from your steering file name expect if you explicitly write in your steering file
      treeName = "myTree"
      infoTreeName = "myInfoTree"

Constructing basic fields

Dumping common variables

  1. First you can try running on an empty steering file. In order to do this edit
    and copy there :
    # @file:    run/
    # @author:  FirstName LastName <>
    # @purpose: a working example of the ATLASWatchMan Steering File used to analyze semileptonic top pairs
    import GaudiKernel.SystemOfUnits as Units
    import ROOT
    and then run the usual commands :
    python -m ATLASWatchMan/ATLASWatchMan_Parser ATLASWatchMan_AnalysisSteeringFile_sltopAna
    athena -c "InputCollections=['myNiceFile1', 'myNiceFile2']; EvtMax=500" ../share/
    When browsing the output D3PD, you will see that some containers branches named electron4mom, jet4mom,... xxx4mom is a std::vector < TLorentzVector > storing 4-momenta of particles named xxx. This is automatically dumped for every container in which EDM object posses a method named .hlv() returning HepLorentzVector.
  2. The list of all predefined containers with their access key can be found in under the dictionary named self.collections.
  3. If you want to run WatchMan on some of these containers, you have to specify a collections dictionary inside steering file like :
    #List of AOD/DPD Collections you want to use in your analysis either :
    # -> during event selection
    # -> to dump information in your output D3PD
    #Options are:
    # - Use the 'select':True flag to go through object selection
    # - The 'type' and 'name' flags are only needed if the collection has not been previously declared or has to be overwritten
    collections = {'electron':{'select':True},
                   'truth_jet':{'select': True},
                   'gen': {'select': False},
                   'met': {},
    The different keys (container name, container type, select to pass object selection) can be overwritten like
  4. In addition a dumpContainers dictionary should be specified to define the list of container you want to dump in the output D3PD :
    dumpContainers = {'electron':{'Author':{'type':'int','method':'.author()'}},
    By default, only 4-momenta 4mom and Charge are dumped into std::vector for each object into the collection. If, in addition, you want to dump to specific object information from which you know the method used to access it within athena, you can dump it like :
    . The resulting variable will be named electronAuthor and stored into an std::vector < int >. Via this way, you can easily make a list of additionnal variables you would like to dump in your output D3PD for each container.

Adding non-predefined containers (like clusters) will be explained below.

Event selection

# Event selection is based on the following two wikis :
# -
# -
channels = {'sltop4j1lep':{'channel': 'ljjjj',
                           'cuts': {1: {'label': 'electronCrackVeto'},
                                    2: {'label': 'electronPtCutsExclusive','value': [20*Units.GeV]},
                                    3: {'label': 'jetPtCuts',
                                        'value': [40*Units.GeV, 40*Units.GeV, 40*Units.GeV, 20*Units.GeV]},
                                    4: {'label': 'missingEtCut','value': 20*Units.GeV},
            'fltop2jee':{'channel': 'lljj',
                         'cuts': {1: {'label': 'electronCrackVeto'},
                                  2: {'label': 'leptonPtCutsExclusive','value': [20*Units.GeV,20*Units.GeV]},
                                  3: {'label': 'SumChargeCut','value': [0]},
                                  4: {'label': 'InvariantMassCut',
                                      'custom': 'Y',
                                      'formula': 'InvariantMassCut'},
                                  5: {'label': 'jetPtCuts','value': [20*Units.GeV, 20*Units.GeV]},
                                  6: {'label': 'missingEtCut','value': 35*Units.GeV},

userFormula = {

# Invariant mass cut for dileptons channels
pxtot = pytot = pztot = etot = 0.
for i,lepton in enumerate(candidates['lepton']):
    pxtot += lepton.px()
    pytot +=
    pztot += lepton.pz()
    etot += lepton.e()
mz = math.sqrt(etot*etot - pxtot*pxtot - pytot*pytot - pztot*pztot)
if mz >= 86.*Units.GeV or mz <= 96.*Units.GeV: cutPassed = False


Playing with object selection and overlap removal

Till now, we have been using a DEFAULT object selection and overlap removal that is defined in SUSYDefinitions.cxx.

But, it is possible to add a custom object selection and overlap removal by adding a new dictionary named objectSelectionAndOverlap inside your steering file :

objectSelectionAndOverlap = {'slTopObjSel': {'muon':{'ptMin': 20.*Units.GeV,'etaMax': 2.5},
                                                                        'electron':{'ptMin': 20.*Units.GeV},
                                                                        'jet':{'ptMin': 20.*Units.GeV},

  • Inside this dictionary every electron, muon, photon, tau, jet is following default definition from SUSYDefinitions.cxx. Every cut can be overwritten in a similar way as shown above.
  • xxxObjSel is a std::vector< std::vector< int >> telling you if an object has passed a given selection.

Decorating my D3PD with new variables

Running an Athena Algorithm

Dumping a non pre-defined container into D3PD

-- RenaudBruneliere - 18 Aug 2009

Edit | Attach | Watch | Print version | History: r12 | r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r6 - 2009-08-24 - RenaudBruneliere
    • 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-2022 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