Skip to content
jjswan33 edited this page Sep 26, 2014 · 11 revisions

This page will describe the use of the singletPrime repository for doing a single T` analysis. Some of the details will also be useful for running any single lepton analysis in LJMet.

Checking out the code

Check out the LJMet repository following the instructions here:

LJMet Twiki

then check out the head of singletPrime (similarly you could checkout Ljmet-singlelepton)

git clone git@github.com:cms-ljmet/singletPrime LJMet/singletPrime

Running LJMet Jobs

Running LJMet jobs with singletPrime is done using configuration files in singletprime/condor (or similarly in Ljmet-singlelepton) It is setup to run on either the LPC or Brux.

Running jobs is successfully completed by running the following command:

python singletPrimeSubmit.py --useMC True --sample TpBW --fileList TprimeToBW_750_Madgraph.txt --submit True --local True

  • --useMC - specifies if you are running MC or data
  • --sample - specifies the job name and output directory
  • --fileList - contains a list of the files/location of the patuples that you are running on. You can get this from DAS by finding the dataset and the py option. You can copy the full file.
  • --submit - specifies whether you want to submit the jobs or not. Setting false will create the individual jobs but not submit to condor
  • --local - if set to false it will try to find the dataset with xrootd

You can specify multiple jobs to submit with an included bash script inside the condor director:

./submit true true true

the bools specify which blocks to submit for signal background data respectively. Lines can be commented and uncommented respectively

Merging files

There is also a bash script for merging the jobs. This will hadd all of the jobs for the different datasets and then weight them with a pileup weight and normalize the cross section to 1/pb of luminosity in a single weight of __WEIGHT__. The jobs are output in the sandbox directory

./merge.sh

Making Plots

C Macros for making plots exist in the Plotting directory as well as combination scripts that make a number of plots.

The scripts expect a specific set of file names for your root files and can be modified by looking at Plotter.C. To make a plot first load the macro

root -b -l .L Plotting/Plotter.C // or a different path depending on your file location

The function for making a plot is the following:

int makePlot(string var, string decay, int bins, float min, float max, string cut, string lumi, string chn, TString labelX, TString units = "GeV", bool left = false, bool log = false, bool dndm = false, bool doRatio = false, string folder_name)

You have to create the output folder location ahead of time.

an example

makePlot("AllJets_M_LjetsTopoCalcNew","ALL",50,0,3000,"nTightMuons_CommonCalc==1","19300.","mu","AllJets M","",false,false,false,true,"Plots");

BDT Training

Inside the scripts folder there are several scripts available for training and applying a BDT for what I have called the TX and BW trainings. The TX is designed for TZ or TH in a generic way designed to compliment the tight TH category with sub-jet b-tagging.

To run the BDT you need a version of root with TMVA. Most versions of root include TMVA. All of the files that are needed outside of the scripts folder exist already, although include locations may have to change.

To start create a folder called tmvaXX where XX is the version of the BDT either TX or BW. Inside put the two scripts associated with that BDT. To run the BDT then do the following:

root -l ./TMVAClassification_XX.C\(\"BDT\"\)

Again be mindful of include locations and input root file locations. Also typically you need to split your training samples from what you are using for analysis. To do this read through the BDT documentation.

To then apply your BDT you need to run the Application script on all of your signal and background samples, this takes a few minutes since it has to loop through all of the events. As an example you can do the following:

root -l .L TMVAClassificationApplication_TX.C TMVAClassificationApplication_TX("BDT","TpTH750.root","../sandbox","../sandbox_BDTOut")

If you set your folders and locations in the proper way you can easily use the included script to apply both BDT's to all samples. Look over the ApplyBDTs.C script for details.

Running Theta Limits

There are some basic scripts available for running limits using Theta. They are not well developed but should give a good starting point for making limits. To make limits using Theta first you need to checkout the code for Theta. Instructions on how to do this are available here along with documentation of the package.

After installing and compiling Theta you need to load the package:

To create root files for Theta the function in Plotter.C makeThetaCard exists. This function will create a root file with the proper naming scheme for Theta. It is defined as follows:

void makeThetaCard(string var, string outfile, int bins, float min, float max, string cut, string lumi, string chn, string cat)

Most of the parameters are self explanatory but the last two chn signifies mu or ele channels and cat stands for a unique category name for your limit such as TZ, TH or BW or something else you want to define.

Additionally there is a script in the scripts folder that will make all the theta inputs for the last iteration of analysis categories I was working with called makeThetaInputs.C. It additionally makes mass plots for the final selection in each category for both the electron and muon channels. When you run the script it will produce theta inputs separately which you should merge using the hadd function.

Now to run the limits you will need to modify the limit script TpThetaScript.py for the categories and systematics you want to consider. Also specify the name of the input file. To run the limit do:

This first command only needs to be done once per session.

export PATH=YOURPATHTOTHETA/theta/utils2:$PATH

theta-auto.py TpThetaScript.py

Multiple options are commented out in the script which can be experimented with but most are not well developed. The command as current will run the limit and output the result on the screen and some additional details as a webpage.