TWiki
>
Main Web
>
ATLASWatchManTutorial1r15
(revision 7) (raw view)
Edit
Attach
PDF
---+!! !ATLASWatchMan Tutorial with r15 : how to make my own steering file step by step ? --- %TOC% --- ---++ Introduction 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 : <verbatim> cd ../run python -m ATLASWatchMan/ATLASWatchMan_Parser ATLASWatchMan_AnalysisSteeringFile_benchmarkChannels athena -c "InputCollections=['myNiceFile1', 'myNiceFile2']; EvtMax=500" ../share/ATLASWatchMan_Generated_jobOptionAthena.py </verbatim> * ... and check that the output !D3PD is not empty : <verbatim> root.exe -l OutputD3PD.root _file0->ls() sumWeightsMC->Draw(); // Contains total number of weighted events read benchmarkChannelsTree->Draw("channels.data()"); // channels passed benchmarkChannelsTree->Draw("jet4mom.Pt():jet4mom.Eta()"); // jet Pt vs Eta </verbatim> *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 <verbatim> treeName = "myTree" infoTreeName = "myInfoTree" </verbatim>. --- ---++ Constructing basic fields ---+++ Dumping common variables 1 First you can try running on an empty steering file. In order to do this edit <verbatim>ATLASWatchMan/run/ATLASWatchMan_AnalysisSteeringFile_sltopAna.py</verbatim> and copy there : <verbatim> #!python # @file: run/ATLASWatchMan_AnalysisSteeringFile_sltopAna.py # @author: FirstName LastName <FirstName.LastName@cern.ch> # @purpose: a working example of the ATLASWatchMan Steering File used to analyze semileptonic top pairs import GaudiKernel.SystemOfUnits as Units import ROOT </verbatim> and then run the usual commands : <verbatim> python -m ATLASWatchMan/ATLASWatchMan_Parser ATLASWatchMan_AnalysisSteeringFile_sltopAna athena -c "InputCollections=['myNiceFile1', 'myNiceFile2']; EvtMax=500" ../share/ATLASWatchMan_Generated_jobOptionAthena.py </verbatim> 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 [[https://svnweb.cern.ch/trac/atlasgrp/browser/Institutes/Freiburg/SUSY/SUSYTools/trunk/python/SUSYDefaultOptsLib.py][SUSYDefaultOptsLib.py]] 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 : <verbatim> #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}, 'muon':{'select':True}, 'jet':{'select':True}, 'truth_jet':{'select': True}, 'gen': {'select': False}, 'met': {}, } </verbatim> The different keys (container __name__, container __type__, __select__ to pass object selection) can be overwritten like <verbatim>'jet':{'select':True,'name':'Cone4H1TopoJets'}</verbatim> 4 In addition a __dumpContainers__ dictionary should be specified to define the list of container you want to dump in the output D3PD : <verbatim> dumpContainers = {'electron':{'Author':{'type':'int','method':'.author()'}}, 'muon':{}, 'jet':{}, 'truth_jet':{}, 'met':{}, } </verbatim> 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 : <verbatim>'electron':{'Author':{'type':'int','method':'.author()'}</verbatim>. 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 Below is an example of event selection for 2 different channels : semi-leptonic top pairs and fully leptonic (with two electrons) top pairs. <verbatim> # Event selection is based on the following two wikis : # - https://twiki.cern.ch/twiki/bin/view/AtlasProtected/TopSingleleptonPubNote#event_selection # - https://twiki.cern.ch/twiki/bin/view/AtlasProtected/TopDileptonPubNote#Event_Selection_and_reference_ef 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 'InvariantMassCut': r""" pxtot = pytot = pztot = etot = 0. for el in candidates['electron']: pxtot += el.px() pytot += el.py() pztot += el.pz() etot += el.e() pass mz = math.sqrt(etot*etot - pxtot*pxtot - pytot*pytot - pztot*pztot) if mz >= 86.*Units.GeV and mz <= 96.*Units.GeV: cutPassed = False """, } </verbatim> The key points to notice are : * When running with this new joboption and looking at the output D3PD, you can check quickly : * The number of events passed by every channel via : <verbatim> sltopAnaTree->Draw("channels.data()") sltopAnaTree->Scan("channels.data()") </verbatim> * The last cut passed by every channel. In order to do this last step, you need first to check which vector position is corresponding to which channel via the __channelsMap__ like <verbatim> sltopAnaInfoTree->Scan("channelsMap") *********************************** * Row * Instance * channelsM * *********************************** * 0 * 0 * fltop2jee * * 0 * 1 * sltop4j1l * *********************************** sltopAnaTree->Draw("channelsLastCutPassed[0]"); // Drawing last cut passed by fltop2jee selection </verbatim> * Many cuts are predefined in [[https://svnweb.cern.ch/trac/atlasgrp/browser/Institutes/Freiburg/SUSY/ATLASWatchMan/trunk/python/ATLASWatchMan_CutsLib.py][ATLASWatchMan_CutsLib.py]]. When designing your own event selection, you should first check whether the cut is existing in [[https://svnweb.cern.ch/trac/atlasgrp/browser/Institutes/Freiburg/SUSY/ATLASWatchMan/trunk/python/ATLASWatchMan_CutsLib.py][ATLASWatchMan_CutsLib.py]]. * If the cut is not existing in [[https://svnweb.cern.ch/trac/atlasgrp/browser/Institutes/Freiburg/SUSY/ATLASWatchMan/trunk/python/ATLASWatchMan_CutsLib.py][ATLASWatchMan_CutsLib.py]], you can design your custom cuts (like __InvariantMassCut__ in previous example) by : * adding the fields '__custom__':'Y' and 'formula': 'InvariantMassCut' * adding in the new dictionnary __userFormula__ a new entry explaining the code between triple quotes. By default a cut is assumed to be passed till you put the string <verbatim>cutPassed = False</verbatim>. ---+++ Playing with object selection and overlap removal Till now, we have been using a DEFAULT object selection and overlap removal that is defined in [[https://svnweb.cern.ch/trac/atlasgrp/browser/Institutes/Freiburg/SUSY/SUSYTools/trunk/src/SUSYDefinitions.cxx][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 : <verbatim> objectSelectionAndOverlap = {'slTopObjSel': {'muon':{'ptMin': 20.*Units.GeV,'etaMax': 2.5, 'etConeMax':6.*Units.GeV,'deltaRVeto_mj':0.3}, 'electron':{'ptMin': 20.*Units.GeV,'etaMax': 2.5, 'etConeMax':6.*Units.GeV,'deltaRVeto_ej':0.}, 'jet':{'ptMin': 20.*Units.GeV,'etaMax': 2.5}, }, } </verbatim> If you want that some of your channels are using one of the object selection you defined, you also need to specify it via e.g. : <verbatim> 'sltop4j1lep':{'channel': 'ljjjj', 'objSelection': 'slTopObjSel', 'cuts': {1: {'label': 'electronCrackVeto'}, 2: {'label': 'leptonPtCutsExclusive','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}, }, }, </verbatim> * Inside this dictionary every *electron*, *muon*, *photon*, *tau*, *jet* is following default definition from [[https://svnweb.cern.ch/trac/atlasgrp/browser/Institutes/Freiburg/SUSY/SUSYTools/trunk/src/SUSYDefinitions.cxx][SUSYDefinitions.cxx]]. Every cut can be overwritten in a similar way as shown above. * When defining new object selections, you need to know for every object stored in the D3PD and passing object selection (so with collection flag 'select':True) whether it was kept by your object selection. This information is stored in objects named __xxxObjSel__ which are std::vector< std::vector< int >>. Like for __channelsLastCutPassed__, a map named __objSelectionMap__ is stored to tell which array position is corresponding to which object selection like : <verbatim> sltopAnaInfoTree->Scan("objSelectionMap") *********************************** * Row * Instance * objSelect * *********************************** * 0 * 0 * objSelDEF * * 0 * 1 * slTopObjS * *********************************** sltopAnaTree->Draw("jet4mom[0].Pt()","@jet4mom.size() > 0 && jetObjSel[0][1] == 1"); // Draw leading jet pt only for jets passing my obj selection sltopAnaTree->Draw("electron4mom[0].Eta()","@electron4mom.size() > 0 && electronObjSel[0][1] == 1"); // Draw electron eta for selected electrons </verbatim> --- ---++ Decorating my !D3PD with new variables --- ---++ Running an Athena Algorithm --- ---++ Dumping a non pre-defined container into !D3PD -- Main.RenaudBruneliere - 18 Aug 2009
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r12
|
r9
<
r8
<
r7
<
r6
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r7 - 2009-08-26
-
RenaudBruneliere
Log In
Main
Home
Index
Search
User Search
Changes
Notifications
RSS Feed
Documentation
Support
Webs
Main
Main Archive
Plugins
Sandbox for tests
Public webs
Public webs
ABATBEA
ACPP
ADCgroup
AEGIS
AfricaMap
AgileInfrastructure
ALICE
AliceEbyE
AliceSPD
AliceSSD
AliceTOF
AliFemto
ALPHA
Altair
ArdaGrid
ASACUSA
AthenaFCalTBAna
Atlas
AtlasLBNL
AXIALPET
CAE
CALICE
CDS
CENF
CERNSearch
CLIC
Cloud
CloudServices
CMS
Controls
CTA
CvmFS
DB
DefaultWeb
DESgroup
DPHEP
DM-LHC
DSSGroup
EGEE
EgeePtf
ELFms
EMI
ETICS
FIOgroup
FlukaTeam
Frontier
Gaudi
GeneratorServices
GuidesInfo
HardwareLabs
HCC
HEPIX
ILCBDSColl
ILCTPC
IMWG
Inspire
IPv6
IT
ItCommTeam
ITCoord
ITdeptTechForum
ITDRP
ITGT
ITSDC
LAr
LCG
LCGAAWorkbook
Leade
LHCAccess
LHCAtHome
LHCb
LHCgas
LHCONE
LHCOPN
LinuxSupport
Main
Medipix
Messaging
MPGD
NA49
NA61
NA62
NTOF
Openlab
PDBService
Persistency
PESgroup
Plugins
PSAccess
PSBUpgrade
R2Eproject
RCTF
RD42
RFCond12
RFLowLevel
ROXIE
Sandbox
SocialActivities
SPI
SRMDev
SSM
Student
SuperComputing
Support
SwfCatalogue
TMVA
TOTEM
TWiki
UNOSAT
Virtualization
VOBox
WITCH
XTCA
Welcome Guest
Login
or
Register
Cern Search
TWiki Search
Google Search
Main
All webs
Copyright &© 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