TWiki
>
ATLAS Web
>
TextToNtupleParser
(revision 6) (raw view)
Edit
Attach
-- Main.GavinKirby - 2011-02-08 This page contains instructions for setting up and using a tool to parse text files and create ntuples containing the information in them. %TOC% ---++ %MAKETEXT{"Set up the environment"}% For initial setup: =source ~cdfsoft/cdf2.shrc= =setup cdfsoft2 6.1.6.m= =setup neurobayes_expert= =setup root v5_26_00 -q GCC_3_4_6 -f Linux+2.6= =cd /data/cdf04/stdenis/hww_1fb/hwwcdf6.1.6.mv4_81/= =srt_setup -a= =cd -= The command =hwwcdf6.1.6.mv4_81/Hww/TRTuple/root/testFillFlatFromAscii.sh= runs the program on a text file. The code is executed via the command: =runFillFlatFromAscii teststeerFillFlatFromAscii.txt testFlatFillATLASl4vec.txt testFlatFillATLAS.root= The first argument is the steering file, the second is the text file you make and the third is the output root file. The steering file should be pointed at the evinfo, global and variable tree to ntp definitions. ---++ %MAKETEXT{"Test environment -- CDF Version"}% Copy the following files into a test area: =/data/cdf04/stdenis/hww_1fb/hwwcdf6.1.6.mv4_81/Hww/TRTuple/root/TreeSpecEv.txt= =/data/cdf04/stdenis/hww_1fb/hwwcdf6.1.6.mv4_81/Hww/TRTuple/root/TreeSpecGlobal.txt= =/data/cdf04/stdenis/hww_1fb/hwwcdf6.1.6.mv4_81/Hww/HwwMtuple/root/VariableTreeToNTP.txt= =/data/cdf04/stdenis/hww_1fb/hwwcdf6.1.6.mv4_81/Hww/TRTuple/root/teststeerFillFlatFromAscii.txt= =/data/cdf04/stdenis/hww_1fb/hwwcdf6.1.6.mv4_81/Hww/TRTuple/root/testFlatFillATLASl4vec.txt= Edit teststeerFillFlatFromAscii.txt so the three files have no directory spec: =GeneralParameter string 1 TreeSpecEv=TreeSpecEv.txt= =GeneralParameter string 1 TreeSpecGlobal=TreeSpecGlobal.txt= =GeneralParameter string 1 TreeToNTPMapFile=VariableTreeToNTP.txt= Now do: =setup neurobayes_expert= =setup root v5_26_00 -q GCC_3_4_6 -f Linux+2.6= Now you can run the tool via the command =runFillFlatFromAscii teststeerFillFlatFromAscii.txt testFlatFillATLASl4vec.txt testFlatFillATLAS.root= ---++ %MAKETEXT{"Test environment -- ATLAS Version"}% Once the CDF test has been successfully completed, you can move on to building an ATLAS ntuple (with additional variables). The relevant files can be found in: <verbatim> /home/ahgemmell/NNFitter-00-00-09-Edited/NNTraining/run119 </verbatim> The directory specification in the files will need to be changed; if they are in the working directory, leave it out: <verbatim> In teststeerFillFlatFromAscii.txt: GeneralParameter string 1 TreeSpecEv=TreeSpecATLAStth-v15.txt # Steering file with spec of global GeneralParameter string 1 TreeSpecGlobal=TreeSpecATLAStth-v15.txt # Variable tree to NTP GeneralParameter string 1 TreeToNTPMapFile=VariableTreeToNTPATLASttHSemiLeptonic-v15.txt </verbatim> Add the following lines: <verbatim> GeneralParameter string 1 TreeNameEvInfo=D3PD GeneralParameter string 1 TreeNameGlobalInfo=D3PD </verbatim> It is necessary to match the variable names in the lines containing the string "EvInfoTree" in <verbatim>VariableTreeToNTPATLASttHSemiLeptonic-v15.txt</verbatim> to the names in the output file from the event generator. Now the first problem I see is that the lepton inforamtion is not in EvInfoTree -- so you will need to try to figure out if it is available! Then you wil have to add this to <verbatim>VariableTreeToNTPATLASttHSemileptonic-v15.txt</verbatim> I do find that <verbatim>TreeSpecATLAStth-v15.txt</verbatim> has: <verbatim> ListParameter SpecifyVariable:PL_SelLepton_Pt 1 Type:double ListParameter SpecifyVariable:PL_SelLepton_Phi 1 Type:double ListParameter SpecifyVariable:PL_SelLepton_Eta 1 Type:double </verbatim> Note that the actual px,py,pz,e as you had are not there so you may have to make a new file with those variables. Then you need to add the variable defintions to <verbatim>VariableTreeToNTPATLASttHSemiLeptonic-v15.txt</verbatim> Here is an example: <verbatim> ListParameter EvInfoTree:28 1 PL_SelLepton_Pt:PL_SelLepton_Pt/PL_SelLepton_Pt: </verbatim> o For each variable you add, you need to increment the number. So EvInfoTree:28 needs to goto EvInfoTree:29 for the next varaible. o The value to the left of the : has to match your name in your text file that you write. This does no have to be the same as the stuff to the right. Later on this is used as the input variable to plotting and the neural net training. This however is your point where you are flexible in mapping the branch/leaf to that name of the varaible later. o The stuff to the right of the : is the branch/leaf as it appears in root. In fact if you have a root file, Alistair wrote a tool to make this file from it.
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r16
|
r8
<
r7
<
r6
<
r5
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r6 - 2011-02-15
-
GavinKirby
ATLAS
Log In
or
Register
ATLAS Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
Webs
ATLAS
PUUKA
DetDev
Gridmon
IT
LHCb
LinearCollider
Main
NA62
Sandbox
TWiki
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback