Skip to content
pequegnot edited this page Mar 18, 2014 · 2 revisions

Presentation

MttTools> cd PreSkim

At this step, we do a preselection on the events, that is:

  • we only keep events that passed our selections in Extractor (isSel == 1);
  • we impose a cut on the pt lepton: pt(lepton) > ptLeptonCut (ptLeptonCut = 26 GeV if the lepton is a muon and ptLeptonCut = 30 GeV if the lepton is an electron) ;
  • The TOP reference selection excludes electron with SuperCluster eta between 1.4442 and 1.5660. The TopTrigger efficiency does the same thing, but using electron eta instead of SuperCluster eta. That's why, in the step, we redo a cut on electron eta (we require fabs(etaLepton) < 1.442 && fabs(etaLepton) >= 1.5660) ;
  • we ask for at least one iteration for the MVA or Chi2 algorithm (used to find the best combination of the jets to reconstruct mtt).

The script containing this preselection and all the histogramms at generator level is preSkim.cpp. It is the script you have to edit if you want to change the preselection or add a generator-level histogram. The python files correspond to the configuration files which have to be tuned to run on your own datasets.

How to use it

The script preSkim.cpp takes as inputs the list of the Extractuples (.list file) and returns a .root output file. You have to put the list of the Extractuples you want to run on in the configuration files: skimMC.py for MC and skimData.py for data.

You can make a symbolic link of the Extractuples lists you have generated after the Extractor step (see the instructions here). If we consider that the the folder containing the lists of your Extractuples, as given in the example, is /<path>/MyListsFolder1, you can create a symbolic link just by typing these few commands:

PreSkim> mkdir lists
PreSkim> cd lists
lists> ln -s /<path>/MyListsFolder1/*.list .
lists> cd ../

Now, edit the skimMC.py and skimData.py scripts which will run automatically the preSkim script and complete them with the correct informations as explained below.

For data

The script is built like that:

files = [
    ["mySkimOutputFile1.root", "lists/myDataset1.list", "type"],
    ["mySkimOutputFile2.root", "lists/myDataset2.list", "type"]
]

where

  • myOutputFile1.root is the name of your output rootfile, called a skim. It will be stored in the skims// directory (the script generates automatically the directories "" and "" where aDate is the date when you create your directory and aCategory can be data, semimu or semie) ;
  • lists/myDataset1.list the lists of the Extractuples you have just linked ;
  • "type" is an option to specify if your dataset is a semi-muonic or a semi-electronic channel ;

Just adapt the script to run on your own datasets.

For MC

The script is built like that:

files = [
    ["mySkimOutputFile1.root", "lists/myDataset1_%s.list"],
    ["mySkimOutputFile2.root", "lists/myDataset2_%s.list"]
]

where

  • myOutputFile1.root is the name of your output rootfile, called a skim. It will be stored in the skims// directory (the script generates automatically the directories "" and "" where aDate is the date when you create your directory and aCategory can be data, semimu or semie) ;
  • lists/myDataset1.list the lists of the Extractuples you have just linked. Note that here, you don't have to specify the type (semimu or semie): %s stands for it (don't forget to remove "semie" or "semimu" from your lists name and replace it by "%s") and the script replaces it by corresponding types.

Just adapt the script to run on your own datasets.

This is the usage of preSkim script:

USAGE: 

   ./preSkim  {--input-list <string>|-i <string>} {--data|--mc} {--semimu
              |--semie} [--weight <double>] [-n <int>] [--pdf-syst
              <string>] [--pileup-syst <string>] [--pileup <string>] -o
              <string> [--] [--version] [-h]


Where: 

   --input-list <string>
     (OR required)  A text file containing a list of input files
         -- OR --
   -i <string>,  --input-file <string>
     (OR required)  The input file


   --data
     (OR required)  Is this data?
         -- OR --
   --mc
     (OR required)  Is this mc?


   --semimu
     (OR required)  Is this semi-mu channel?
         -- OR --
   --semie
     (OR required)  Is this semi-e channel?


   --weight <double>
     MC generator weight

   -n <int>,  -- <int>
     Maximal number of entries to process

   --pdf-syst <string>
     PDF systematic to compute

   --pileup-syst <string>
     PU profile to use for pileup reweigthing

   --pileup <string>
     PU profile used for MC production

   -o <string>,  --output-file <string>
     (required)  output file

   --,  --ignore_rest
     Ignores the rest of the labeled arguments following this flag.

   --version
     Displays version information and exits.

   -h,  --help
     Displays usage information and exits.


   Skim extractor tuples with basic selection

For example, if you want to run on a specific data file, type this command:

PreSkim> ./preSkim -i rfio:///dpm/in2p3.fr/home/cms/data/store/user/sbrochet/Extracted_step2/data/02Mar/SingleMu_Run2012D-TOPMuPlusJets-PromptSkim/extracted_28_1_v1d.root --data --semimu -o test.root

Run the script

Now you are ready to run the script. Type the following commands:

PreSkim> source ../setup_lyoserv_env.sh
PreSkim> grid-proxy-init
PreSkim> make
PreSkim> ./skimMC.py
PreSkim> ./skimData.py