User Tools

Site Tools


asc:tutorials:2014october28

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
asc:tutorials:2014october28 [2014/10/28 16:03]
asc [Lesson 2: Using pyROOT to read xAOD]
asc:tutorials:2014october28 [2014/10/29 13:53]
asc old revision restored (2014/10/28 16:33)
Line 95: Line 95:
 __Method 1. If you are at ANL, copy it__: __Method 1. If you are at ANL, copy it__:
 <code bash> <code bash>
-cp /data/nfs/chakanau/tutorial_xAOD_long/valid2.117050.PowhegPythia_P2011C_ttbar.digit.AOD.e2657_s1933_s1964_r5534_tid01482225_00/AOD.01482225._000140.pool.root.1 +cp /data/nfs/chakanau/tutorial_xAOD_long/valid2.117050.PowhegPythia_P2011C_ttbar.digit.AOD.e2657_s1933_s1964_r5534_tid01482225_00/AOD.01482225._000140.pool.root.1  AOD.01482225._000140.pool.root
-AOD.01482225._000140.pool.root .+
 </code> </code>
  
Line 104: Line 103:
 localSetupFAX --rootVersion=current-SL6 localSetupFAX --rootVersion=current-SL6
 voms-proxy-init -voms atlas voms-proxy-init -voms atlas
-xrdcp $STORAGEPREFIX/atlas/rucio/valid2:AOD.01482225._000140.pool.root.1 AOD.01482225._000140.pool.root.1+xrdcp $STORAGEPREFIX/atlas/rucio/valid2:AOD.01482225._000140.pool.root.1 AOD.01482225._000140.pool.root
 </code> </code>
  
Line 120: Line 119:
 setMeUpData anl-oct2014 mydata setMeUpData anl-oct2014 mydata
 </code> </code>
-The file will appear in "mydata/tutorial/anl-oct2014/datase/" directory+The file will appear in "mydata/tutorial/anl-oct2014/database/" directory
  
  
Line 196: Line 195:
 Using this code, one can fill histograms. But the code runs slow. Below we will show how to use C++/ROOT compiled code to  Using this code, one can fill histograms. But the code runs slow. Below we will show how to use C++/ROOT compiled code to 
 run over this file. run over this file.
 +
 +How do you know about methods of "el.trackParticle()"? You can print methods of this object as:
 +
 +<code python>
 +print dir(el.trackParticle())
 +</code>
  
 How will you find xAOD variables without using ROOT TBrowser? Try this code: How will you find xAOD variables without using ROOT TBrowser? Try this code:
Line 204: Line 209:
 </code> </code>
  
-You will see a table with the names of the variables.+ 
 +<note warning> 
 +To run the next example, please start from a new terminal, run rcSetupThis is needed to avoid a conflict with asetup</note> 
  
 Now you can fill a histogram in this Python code. You should create a histogram before the event loop: Now you can fill a histogram in this Python code. You should create a histogram before the event loop:
Line 259: Line 267:
  
 Now open the root file and look at the histogram. Now open the root file and look at the histogram.
-====== Lesson 3: Analysis program to read xAOD ======+====== Lesson 3: C++/ROOT program to read xAOD ======
  
-Now we will create a C++/ROOT analysis program and run over this input xAOD file. Do not forget to run "kinit [email protected]".+Now we will create a C++/ROOT analysis program and run over this input xAOD file.
 Use the same setup file as above. Use the same setup file as above.
  
Line 285: Line 293:
 python Make_input <directory with xAOD files> python Make_input <directory with xAOD files>
 </code> </code>
 +
 +In case if you need xAOD data, do this:
 +
 +<code bash>
 +mkdir data
 +cd data
 +localSetupFAX --rootVersion=current-SL6
 +voms-proxy-init -voms atlas
 +xrdcp $STORAGEPREFIX/atlas/rucio/valid2:AOD.01482225._000140.pool.root.1 .
 +xrdcp $STORAGEPREFIX/atlas/rucio/valid2:AOD.01482225._000141.pool.root.1 .
 +xrdcp $STORAGEPREFIX/atlas/rucio/valid2:AOD.01482225._000142.pool.root.1 .
 +</code>
 +
 +and run:
 +
 +<code>
 +cd ..
 +python Make_input data
 +</code>
 +Now inputdata.txt should pick up your xAOD files.
 +
 +
 Now the input file is ready and we run the example as: Now the input file is ready and we run the example as:
  
Line 303: Line 333:
 To do this we will need a number of changes: To do this we will need a number of changes:
  
-1) We need to link several ATLAS packages. +1) We need to link several ATLAS packages (it's done already, just look what is inside of the package prepared for this lesson)
  
 <code> <code>
Line 311: Line 341:
 in "cmt/Makefile.RootCore". We linked more packaged than needed to illustrate what can be linked.  Use "rc version" to check their versions. in "cmt/Makefile.RootCore". We linked more packaged than needed to illustrate what can be linked.  Use "rc version" to check their versions.
  
-2) Then we need to modify 2 places to put histograms +2) Then we need to modify 2 places to put histograms (it's done already in the example shown below)
  
 <code python> <code python>
Line 363: Line 393:
 TBrowser a TBrowser a
 </code> </code>
-and look at the histograms of jet and muon pT.+and look at the histograms with jet and muon pT.
  
  
asc/tutorials/2014october28.txt · Last modified: 2014/10/29 13:55 by asc