Difference: SpyRootTutorial (3 vs. 4)

Revision 42011-06-06 - CarlosChavezBarajas

Line: 1 to 1
 
META TOPICPARENT name="CarlosChavez"
<!-- This is the default ATLAS template. 
Please modify it in the sections indicated to create your topic! In particular, notice that at the bottom there are some sections that must be filled for publicly accessible pages.
Line: 26 to 26
 
  • the code is maintained using SVN

The part of the code that is common to all susy analysis is located under this directory: /afs/cern.ch/atlas/project/cern/susy1/SPyRoot/common_susy11b/

Added:
>
>
  1. For these common setup, instead of using a directory called "Cuts" we now use "Config" as default
  2. Do not modify any *.py files under .../common_susy11b/ dir without being discussed beforehand with people maintaining this code (Till, D. Berge, D. Salek, C. Chavez)
  3. If you want to make any modifications to the object definitions or scripts under .../common_susy11b/
    • First copy the file you want to modify to your workdir and modify this accordingly, python path is set such that will pick up any file in your workdir before looking under .../common_susy11b/
 

Main Selection Steeps

Line: 50 to 54
 
  1. Select the configuration file , execute_&_load step0 ntuple processing (step0 = trigger_selection ):
    • PyROOT> cutSet='myConfigFile'
    • PyROOT> execfile('LoadStep0.py')
Added:
>
>
  1. If you want to make any modifications to the object definitions or scripts under .../common_susy11b/
    • First copy the file you want to modify to your workdir and modify this accordingly, python path is set such that will pick up any file in your workdir before looking under .../common_susy11b/
  Data selection steeps:

  1. Make pickled files from D3PD (in castor), this is known as step -1:
Changed:
<
<
*./setupNtuples.py
>
>
    • setupNtuples.py
 
    • [delete old pickle files to re-do]
Added:
>
>
    • this should have made a directory called "sampleDir/p543/ntuples/" (if not, please make it your self)
 
  1. Split samples (at step -1) into sub-samples:
    • ./splitSample.py -f files cutset step sample1 sample2 ...
Line: 65 to 73
 
    • ./splitSample.py -f 10 myConfigFile -1 Zee+
    • [ delete old pickle files to re-do]
Added:
>
>
 Step 0:
  1. Trigger selection
Changed:
<
<
  1. Run : ./submitStep.py -c myConfigFile 0 JetTauEtmiss+
  2. Run : ./submitStep.py -c myConfigFile 0 Zee+
>
>
  1. Run : submitStep.py -c myConfigFile 0 JetTauEtmiss+
    • this will run over all the JetTauEtmiss stream data ntuples in the batch system
  2. Run : submitStep.py -c myConfigFile 0 Zee+
 
    • [overwrite castor ntuples, and pickle files]
    • [overwrite pickle files in afs group space]
Added:
>
>
  1. Interactively this can be run with spyroot (after running spyroot in the command line):
    • PyROOT> cutSet='myConfigFile'
    • PyROOT> execfile('LoadStep0.py')
 
  1. Merging of sub-samples into one can be done at any step for example:
Changed:
<
<
    • ./mergeSamples.py [cutSet] [step] [sample] [numSamples]
    • ./mergeSamples.py myConfigFile 0 JetTauEtmiss00180400
>
>
    • mergeSamples.py [cutSet] [step] [sample] [numSamples]
    • mergeSamples.py myConfigFile 0 JetTauEtmiss00180400
    • need to figure out numSubsamples by looking at the number of subsamples that were originally split into
    • for examples by doing something like : ls sampleDir/p543/step0/zlSUSY11b/ | grep JetTauEtmiss00180400 | cut -f2 -d_| sort -n |tail -1| cut -f1 -d.
  Step 1:
Changed:
<
<
  1. Run : ./submitStep.py -c elICHEP_v3 1 T1+ L1Calo00158801 MuonswBeam00158801
    • Usage: submitStep.py [-q ] [-c ] [sample1] [sample2]
>
>
  1. Run Step 1, object selection and general cuts:

  1. Run mergeSamples.py in order to merge subsamples in to one sample (useful for data mainly): * mergeSamples.py myConfigFile 0 JetTauEtmiss00180400 * find numSamples by doing something like : ls sampleDir/p543/step1/zlSUSY11b/ | grep JetTauEtmiss00180400 | cut -f2 -d_| sort -n |tail -1| cut -f1 -d.
  Step 2 :
Changed:
<
<
  1. Run : ./submitStep.py -c elICHEP_v3 2 T1+ L1Calo00158801 MuonswBeam00158801
    • [ as above ]
>
>
  1. Run Step 2, Final selection (signal region definition) and plotting (histogram definition):

Set Samples weight :

  1. In order to set the correct luminosity to the MC (base on the data luminosity), a script sets a weight to each event (for data ==1)
    • setSampleWeight.py [-s] [-v] [cutset] [step] [sample1] [sample2]

Check samples :

  1. Run checkSamples.py to check for missing subsamples and lost events in data and MC for each selection step:

Some info on our specific ntuples:

The ntuples that are loaded after step2 have had:

  • GRL, MET cleaning cuts, Vtx cuts, and require exactly 1 selected isolated lepton with pt>10GeV to be in the event (after overlap removal etc...).
  • In Step2 we apply some 'virtual' cuts which are applied and feature in the cut statistics - but events get into the ntuple even if they fail these.
 
Changed:
<
<
  1. for MC: merge sub-samples into one again:
    • ./mergeSamplesStep2.py elICHEP_v3 T1
    • ./mergeSamplesStep2.py muICHEP_v3 T1
>
>
these can then be applied by selecting on the bits:
 
Added:
>
>
details of the config/cuts can be seen in these configuration files for -lepton analysis (used in step0,1,2):
  • /afs/cern.ch/atlas/project/cern/susy1/SPyRoot/zl_common_susy11b/Config/zlSUSY11b.py
  • /afs/cern.ch/atlas/project/cern/susy1/SPyRoot/zl_common_susy11b/Config/*

for cuts specific to el and mu channels in 1-lepton analysis:

  • /afs/cern.ch/atlas/project/cern/susy1/SPyRoot/susy11b_prod/Cuts/elSUSY11b.py
  • /afs/cern.ch/atlas/project/cern/susy1/SPyRoot/susy11b_prod/Cuts/muSUSY11b.py
  • [the above files might need slight modification to be run with the common setup]
 
Changed:
<
<
  1. update lumi information:
    • ./updateLumi.py muICHEP_v3 MuonswBeam L1_MU6
    • ./updateLumi.py elICHEP_v3 L1Calo L1_EM5
>
>
For monojet analysis :
  • /afs/cern.ch/atlas/project/cern/susy1/SPyRoot/monojet_common_susy11b/Config/*
 
Line: 101 to 146
 Now you are ready to analyse cat-susy ntuples

  1. Get a data sample handler object :
Changed:
<
<
    • PyROOT> a=Data.Samples['L1Calo00158582']
>
>
    • PyROOT> a=Data.Samples['JetTauEtmiss00180400']
 
  1. Print efficiencies from all algorithms:
  2. Print efficiency from algorithms that contain the word 'Cut' in their name :
Line: 139 to 185
 
a.Draw3D_UB a.LiveTime a.__delattr__ a.analyses a.unpickle

It does not work If you tab from an object that you get from a list, example this will not work :

Changed:
<
<
  • Data.Samples[L1Calo00154815'].[TAB_completion]
>
>
  • Data.Samples['JetTauEtmiss00180400'].[TAB_completion]
 

You can get a TTree (TChain) by doing :

Line: 204 to 250
 
    • here you add together all samples with the tag 'data' (which all data samples have).

or alternatively you can do:

Changed:
<
<
  1. PyROOT> listOfSamples=['L1Calo00155280','L1Calo00155669','L1Calo00158801']
>
>
  1. PyROOT> listOfSamples=['JetTauEtmiss00180400','JetTauEtmiss00180481','JetTauEtmiss00180481']
 
  1. PyROOT> AddCombinedSample('combData',Data, listOfSamples)

for data the combined sample have all the events in the sub samples and also the combine lumi of these samples.

Line: 220 to 266
 
    • so this makes the same plot for each of the given samples and Draws them on top of each other.

Deleted:
<
<
Some info on our specific ntuples:

The ntuples that are loaded after step2 have had:

  • GRL, MET cleaning cuts, Vtx cuts, and require exactly 1 selected isolated lepton with pt>10GeV to be in the event (after overlap removal etc...).
  • In Step2 we apply some 'virtual' cuts which are applied and feature in the cut statistics - but events get into the ntuple even if they fail these.

these can then be applied by selecting on the bits:

details of the cuts can be seen in these configuration files (used in step0,1,2):

  • /afs/cern.ch/user/j/jboyd/scratch1/susy_grp/SPyRoot/susy10_prod/Cuts/elICHEP_v3.py
  • /afs/cern.ch/user/j/jboyd/scratch1/susy_grp/SPyRoot/susy10_prod/Cuts/muICHEP_v3.py

for cuts specific to El or Mu mode - or in:

  • /afs/cern.ch/user/j/jboyd/scratch1/susy_grp/SPyRoot/susy10_prod/Cuts/ICHEP_v3.py
  The ntuples contain vectors for selected objects:
ntuple object
Line: 265 to 296
 
<!--For significant updates to the topic, consider adding your 'signature' (beneath this editing box)-->
Major updates:
Changed:
<
<
-- CarlosChavez - 20-Jul-2010
>
>
-- CarlosChavez - 6-June-2011
 
<!--Person responsible for the page: 
Either leave as is - the creator's name will be inserted; 
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback