TWiki
>
AtlasSandbox Web
>
SFrameD3PD
(revision 4) (raw view)
Edit
Attach
PDF
---+!!<nop> D3PD Analysis in SFrame %TOC% ---+ Introduction The manTree package contains a set of classes for storing physics objects for final analysis. It can be used outside of athena, for example in !SFrame. With the increasing size of data sets, for 8 !TeV analysis onwards manTree ntuples shall not be created. Instead !D3PD ntuples can be read into !SFrame and then analysed either as !D3PDs or converted to manTree objects at run time to allow existing analysis code to be used. The recommended way to compile the package is to follow the instructions [[#FirstTimeSetup][below]]. ---+ Analysis Framework In order to do a complete analysis, there are a set of packages provided by ATLAS for applying common prescriptions. These packages are made available through the AtlasProtected.TopRootCore package and we interface to these packages using the topUtils package. ---++ First Time Setup #FirstTimeSetup The following instructions should be followed to setup up & compile sframe, manTree and the common analysis packages: Export CERN_USER variable: <verbatim> export CERN_USER=yourcernlxplususername </verbatim> Setup root v5.28: <verbatim> source /opt/root/x86-64/root5.28.00/bin/thisroot.sh </verbatim> Setup root core: <verbatim> source /nfs/software/AtlasSoftware/RootCore/Root_v528_Summer2012Data/RootCore/scripts/setup.sh </verbatim> Export SVNMAN variable: <verbatim> export SVNMAN=svn+ssh://$CERN_USER@svn.cern.ch/reps/atlasinst/Institutes/Manchester </verbatim> Go to a directory where you want to work from: <verbatim> cd somedir </verbatim> Check out sframe: <verbatim> svn co https://sframe.svn.sourceforge.net/svnroot/sframe/SFrame/tags/SFrame-03-05-17 SFrameArea cd SFrameArea </verbatim> Build sframe: <verbatim> source ./setup.sh make </verbatim> Check out manTree and !D3PD packages: <verbatim> svn co $SVNMAN/SFrame/manTree/trunk manTree svn co $SVNMAN/SFrame/SFToolInterfaces/trunk SFToolInterface svn co $SVNMAN/SFrame/convertD3PDObjects/trunk convertD3PDObjects svn co $SVNMAN/SFrame/d3pdSFrameBase/trunk d3pdSFrameBase svn co $SVNMAN/SFrame/topUtils/trunk topUtils svn co $SVNMAN/SFrame/PlottingUtil/trunk PlottingUtil svn co $SVNMAN/SFrame/exampleD3PDCycle/trunk exampleD3PDCycle </verbatim> Build manTree packages: <verbatim> cd manTree make cd ../SFToolInterfaces make cd ../convertD3PDObjects make cd ../d3pdSFrameBase make cd ../topUtils make cd ../PlottingUtil make cd ../exampleD3PDCycle make </verbatim> Make a soft link to the !RootCore par file (needed for proof running): <verbatim> cd $SFRAME_LIB_PATH ln -s $ROOTCOREDIR/../RootCore.par . </verbatim> ---++ Setup for Each Session #SetupCmds Each time you start a new terminal and want to work on the analysis you need to do the following steps: Go to your sframe directory: <verbatim> cd pathto/SFrameArea </verbatim> Export CERN_USER variable: <verbatim> export CERN_USER=yourcernlxplususername </verbatim> Setup root v5.28: <verbatim> source /opt/root/x86-64/root5.28.00/bin/thisroot.sh </verbatim> Setup root core: <verbatim> source /nfs/software/AtlasSoftware/RootCore/Root_v528_Summer2012Data/RootCore/scripts/setup.sh </verbatim> setup sframe: <verbatim> source ./setup.sh </verbatim> It's probably most convenient to put these commands into a script to save typing them in each time. ---++ Running the Example Cycle There is an example sframe cycle in exampleD3PDCycle. It can be run with the following (don't forget the [[#SetupCmds][setup commands]]): <verbatim> cd $SFRAME_DIR cd exampleD3PDCycle sframe_main config/TestCycle_config.xml </verbatim> ---+ Converting from manTreeSFrame to d3pdSFrame Cycles It was intended that the user code would be as similar as possible to when running over manTrees, however some changes were necessary. For an example of how these changes are implemented you may wish to compare src/TestCycle.cxx located in exampleD3PDCycle with its equivalent located in exampleManTreeCycle. ---++ include/YourCycle.h Within your cycle's header file there are only two modifications required to access the !D3PD. The header file include to the parent class, and the subsequent inheritance. |!D3PD code required|Old manTree equivalent| |<verbatim>#include "d3pdSFrameBase/include/d3pdSCycleBase.h"</verbatim>|<verbatim>#include "manTreeSFrameBase/include/manTreeSCycleBase.h"</verbatim>| |<verbatim>class YourCycle : public d3pdSCycleBase { </verbatim>|<verbatim>class YourCycle : public manTreeSCycleBase { </verbatim>| ---++ src/YourCycle.cxx There are several modifications that should be made to allow previous manTree cycles to run on !D3PDs due to the nature in which the data is read. Similar to the header file the constructor's call to its parent class constructor should be changed. |!D3PD code required|Old manTree equivalent| |<verbatim>YourCycle::YourCycle() : d3pdSCycleBase() {</verbatim>|<verbatim>YourCycle::YourCycle : manTreeSCycleBase() {</verbatim>| With manTree analysis in order to optimise the cycle it was necessary to remove branches from the list to be read in. This is no longer necessary as within the !D3PD framework variables are only read in as they are needed for the first time. Inclusion of the command to disable branches within the !D3PD framework will result in a warning at runtime. |!D3PD code required|Old manTree equivalent| |<verbatim>-</verbatim>|<verbatim>disableBranch( std::string );</verbatim>| Within the new framework it is now necessary to tell the !D3PD reader which event it should be reading. This is done by adding the line <verbatim> GetEntry(data); </verbatim> as the first line of your !ExecuteEvent member function. As the physics objects are only read and filled as they are needed, rather than at the start of the analysis, it is no longer possible to access objects one of the previously available manners. Taking the muons as an example, previously they could be accessed either by <verbatim> m_muon </verbatim> or alternatively by <verbatim> m_event->getMuons() </verbatim> In the new regime, only <verbatim> m_event->getMuons() </verbatim> is valid. ---++ config/YourCycle_config.xml The config file for your cycle needs to contain links to the new !D3PD package libraries in place of the manTreeSFrameBase package. |!D3PD code required|Old manTree equivalent| |<verbatim><Library Name="libManTopD3PDReaderGen"/> <Library Name="libSFToolInterfaces"/> <Library Name="libconvertD3PDObjects"/> <Library Name="libd3pdSFrameBase"/></verbatim>|<verbatim><Library Name="libmanTreeSFrameBase"/></verbatim>| For the input data sets, the data's version should contain the type of !D3PD being run over. For instance to use NTUP_SM, you may wish to set the version to <verbatim> <InputData Version="NTUP_SMWZ.Reco"> </verbatim> In addition the input tree name should be set to physics using <verbatim> <InputTree Name="physics" /> </verbatim> ---+ ManTree Completeness There are a number of variables that were previously held in manTrees which have no !D3PDs equivalent. For this reason code written to work purely with manTrees may attempt to access data members that are no longer available. ---+ Accessing the !D3PD Directly It is also possible to access the !D3PD directly from the cycle without converting it to a manTree, however this code is dependent on the type of ntuple being read. Some variables held within the !D3PD do not have a manTree counterpart, and so this is the only way of accessing them. This can also be useful for optimising code, as when a !D3PD object is read into a manTree object, every data member is filled. Hence if a cut is being performed on a single variable which is held in the !D3PD, a significant amount of time can be saved by accessing the variable directly from the !D3PD and cutting there, prior to filling the manTree. -- Main.SteveMarsden - 03-Jul-2012
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r5
<
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r4 - 2012-07-05
-
MarkOwen
Log In
AtlasSandbox
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
ATLAS Home
Detectors
Computing
Physics
Help
Create
a LeftBar for this page
Welcome Guest
Login
or
Register
Search
Cern Search
TWiki Search
Google Search
Atlas
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