{ "cells": [ { "cell_type": "markdown", "source": [ "It may take a few seconds" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "!wget -q --show-progress --progress=dot:giga https://www.dropbox.com/s/zza28peyjy8qgg6/T2tt_700_50.root\n", "!wget -q --show-progress --progress=dot:giga http://www.hepforge.org/archive/cutlang/atla_opendata_had_ttbar.root" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "# CutLang parameters\n", "- **file** = Root file name (**required**)\n", "- **filetype** = Root file type (**required**) | ROOT file type can be:\n", " *LHCO*\n", " *FCC*\n", " *LVL0*\n", " *DELPHES*\n", " *ATLASVLL*\n", " *ATLMIN*\n", " *ATLASOD*\n", " *ATLASODR2*\n", " *CMSOD*\n", " *CMSODR2*\n", " *CMSNANO*\n", " *VLLBG3*\n", " *VLLSIGNAL*\n", "- **file** : input root file\n", "- **filetype** : input event format (do not change!)\n", "- **adlfile** : the name we use for labeling the analysis \n", "- **events** : number of events used from each file\n", "- **verbose** : frequency of processed event numbers written in output text\n", "- **parallel** : enter 0 to speed up analysis with multiprocessing\n", "\n", "# Output file\n", "Output file name will be **histoOut-\\-\\.root**" ], "metadata": { "tags": [] } }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=example1 events=5000\n", "#CLA ADL example1\n", "info analysisExample\n", " title \"Search for electroweak production of charginos and neutralinos in WH events in proton-proton collisions at sqrt(s) = 13TeV\"\n", " experiment CMS\n", " id \"SUS-16-043\"\n", " publication \"JHEP 11 (2017) 029\"\n", " sqrtS 13.0\n", " lumi 35.9\n", " arXiv \"1706.09933\"\n", " hepdata \" http://adress.org \"\n", " doi \"10.1007/JHEP11(2017)029\"\n", "\n", "region testZ\n", " select ALL # to count all events\n", " select Size (ELE) >= 2 # events with 2 or more electrons \n", " histo h1mReco, \"Z candidate mass (GeV)\", 100, 0, 200, {ELE_0 ELE_1}m\n", " select {ELE[0] ELE[1] }q == 0 # Z is neutral\n", " histo h2mReco, \"Z candidate mass (GeV)\", 100, 0, 200, {ELE_0 ELE_1}m\n", " " ], "outputs": [], "metadata": { "tags": [] } }, { "cell_type": "markdown", "source": [ "> You can run the same analysis with different root files (separating each with ;) and add different parameters (separating each with ;) for each (optional)" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=example2 events=5000\n", "#CLA ADL example2\n", "\n", "region testZ\n", " select ALL # to count all events\n", " select Size (ELE) >= 2 # events with 2 or more electrons \n", " histo h1mReco, \"Z candidate mass (GeV)\", 100, 0, 200, {ELE_0 ELE_1}m\n", " select {ELE[0] ELE[1] }q == 0 # Z is neutral\n", " histo h2mReco, \"Z candidate mass (GeV)\", 100, 0, 200, {ELE_0 ELE_1}m\n", "\n", "region testdep\n", " testZ\n", " select Size (JET) >= 1\n", "\n", "region mapkap\n", " testdep\n", " select Size (MUO) == 2\n" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Example 3** we learn..." ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=example3 events=5000\n", "#CLA ADL example3\n", "\n", "define Zreco : MUO[0] MUO[1]\n", "\n", "region test\n", " select ALL # to count all events\n", " histo hamet, \"MET (GeV) \", 100, 0.0, 2000.0, MET\n", " select Size (MUO) >= 2 # events with 2 or more electrons \n", " histo h1mReco, \"Z candidate mass (GeV)\", 100, 0, 200, {Zreco}m\n", " select {Zreco}q == 0 # Z is neutral\n", " histo h2mReco, \"Z candidate mass (GeV)\", 100, 0, 200, m(Zreco)\n", " \n", "region mest\n", " test\n", " select size(JET) > 2\n" ], "outputs": [], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=example4 events=5000\n", "#CLA ADL example4\n", "\n", "define Zreco : ELE[0] ELE[1]\n", "\n", "object goodEle using ELE\n", " select Pt(ELE) > 10\n", " select abs({ELE}Eta) < 2.4\n", " select {ELE}AbsEta ][ 1.442 1.556\n", "\n", "object BiJET : JET\n", " select bTag(JET) == 1\n", "\n", "object myMu : MUO \n", " select Pt(MUO) > 20\n", "\n", "object myPho : PHO\n", " select Pt(PHO) > 10\n", "\n", "object myTau : TAU \n", " select Pt(TAU) > 10\n", "\n", "define goodZreco : goodEle[0] goodEle[1]\n", "\n", "region test\n", " select ALL # to count all events\n", " select Size(JET) == 1 # events with 2 or more jets \n", " select Size(BJET) == 1 # events with 2 or more jets \n", " select bTag(JET[0]) > 0\n", " select bTag(JET[0]) == 1 \n", " select Size(BiJET) >= 1 # events with 2 or more jets \n", " select Size(ELE) >= 2 # events with 2 or more electrons \n", " select Size(goodEle) >= 2 # events with 2 or more electrons \n", " select Size(MUO) >= 2 # events with 2 or more electrons \n", " select Size(myMu) >= 2 # events with 2 or more electrons \n", " histo h1mReco, \"Z candidate mass (GeV)\", 100, 0, 200, {Zreco}m\n", " histo h1mgoodReco, \"Z candidate mass (GeV)\", 100, 0, 200, {goodZreco}m\n", " select {Zreco}q == 0 # Z is neutral\n", " select {goodZreco}q == 0 # Z is neutral\n", " histo h2mReco , \"Z candidate mass (GeV)\", 100, 0, 200, m(Zreco)\n", " histo h2mgoodReco, \"Z candidate mass (GeV)\", 100, 0, 200, m(goodZreco)\n" ], "outputs": [], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=example5 events=5000\n", "#CLA ADL example5\n", "#SkipHistos = 1 # to not print histos in efficiency table\n", "#Skipeffs = 1 # to not print efficiencies at all\n", "\n", "define Zreco : ELE[0] ELE[1]\n", "define mZreco = m(Zreco)\n", "\n", "object goodEle : ELE\n", " select Pt(ELE) > 10\n", " select abs({ELE}Eta ) < 2.4\n", " select {ELE}AbsEta ][ 1.442 1.556\n", "\n", "define goodZreco : goodEle[0] goodEle[1]\n", "define wmc = 12.3 / 1.5\n", "\n", "algo preselection\n", " select ALL # to count all events\n", " select Size(ELE) >= 2 # events with 2 or more electrons \n", "\n", "algo testg\n", " preselection\n", " weight mcweight wmc\n", " select Size(goodEle) >= 2 # events with 2 or more electrons \n", " histo h1mgoodReco, \"Z candidate mass (GeV)\", 100, 0, 200, {goodZreco}m\n", " select {goodZreco}q == 0 # Z is neutral\n", " histo h2mgoodReco, \"Z candidate mass (GeV)\", 100, 0, 200, m(goodZreco)\n", "\n", "algo testA\n", " preselection\n", "# histo h1mReco, \"Z candidate mass (GeV)\", 100, 0, 200, {Zreco}m\n", " select {Zreco}q == 0 # Z is neutral\n", " histo h2mReco , \"Z candidate mass (GeV)\", 100, 0, 200, mZreco\n" ], "outputs": [], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=example6 events=5000\n", "#CLA ADL example6\n", "\n", "define Zreco : ELE[0] ELE[1]\n", "\n", "object goodEle : ELE\n", " select Pt(ELE) > 10\n", " select {ELE}AbsEta < 2.4\n", " select {ELE}AbsEta ][ 1.442 1.556\n", "\n", "define goodZreco : goodEle[-1] goodEle[-1]\n", "\n", "algo BestZ\n", " select ALL # to count all events\n", " select Size(ELE) >= 2 # events with 2 or more electrons \n", " histo hZRecoA, \"Zee mass (GeV)\", 100, 0, 200, m(Zreco)\n", " select Size(goodEle) >= 2 # events with 2 or more good electrons \n", " select {goodZreco}m ~= 91.2 # find the pair yielding mass closest to Z \n", " select {goodZreco}q == 0 # Z is neutral\n", " histo hZRecoB, \"Zee mass best electrons (GeV)\", 100, 0, 200, m(goodZreco)" ], "outputs": [], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=example7 events=1000 verbose=100\n", "#CLA ADL example7\n", "\n", "define WH1 : JET[-1] JET[-1] # - index means I do not know yet which jets to take\n", "define WH2 : JET[-3] JET[-3] # -3 here is different than -1, so these are two OTHER jets.\n", "# --------------> -3 & -3 repeated indices in the same hadronic W\n", "# --------------> this means the order is NOT important\n", "# --------------> Jet1 + Jet2 = Jet2 + Jet1\n", "\n", "### chi2 for W finder\n", "#define Wchi2 : (( m(WH1 ) - 80.4)/2.1)^2 + (( m(WH2) - 80.4)/2.1)^2 \n", "define Wchi2 : (( {WH1}m - 80.4)/2.1)^2 + (( {WH2}m - 80.4)/2.1)^2 \n", "\n", "## top quarks without b tagging \n", "define Top1 : WH1 JET[-2] # take another jet\n", "#----> 12 3 toplamakla, 13 2 toplamak ayni degil. cunku ilkinde bj candidate 3 ikincisinde 2 numarali jetler.\n", "define Top2 : WH2 JET[-4]\n", "define mTop1 : m(Top1)\n", "define mTop2 : m(Top2)\n", "### chi2 for top finder\n", "#define topchi2 : ((mTop1 - mTop2)/4.2)^2 \n", "define totchi : ((mTop1 - mTop2)/4.2)^2 + Wchi2\n", "#define PTj1 : pT(WH1)\n", "#define totchi : (({WH1}m - 80.4)/2.1)^2 + (({WH2}m - 80.4)/2.1)^2 + Hstep(300.0 - PTj1)*(300.0/PTj1 - 1.0 )\n", "\n", "algo besttop\n", " select ALL # to count all events\n", " select Size(JET) >= 6 # at least 6 jets\n", " histo hdrjj , \"dT between jjs\", 100, 0.0, 6.2, dR(JET_1, JET_0) \n", "# select MET < 100 # no large MET\n", " select totchi ~= 0 # find the tops and ws\n", " histo hchi , \"Histo of chi2\", 50, 0, 500, totchi\n", " select totchi < 10.5 # small than a certain value of chi2\n", " histo hmWH1 , \"Hadronic W reco (GeV)\", 50, 50, 150, m(WH1)\n", " histo hmWH2 , \"Hadronic W reco (GeV)\", 50, 50, 150, m(WH2)\n", " histo hmTop1 , \"Hadronic top reco (GeV)\", 70, 0, 700, mTop1\n", " histo hmTop2 , \"Hadronic top reco (GeV)\", 70, 0, 700, mTop2\n", " histo hdrtt , \"dT between tops\", 100, 0.0, 6.2, dR(Top1, Top2) " ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Union of two objects**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exampleUnions events=5000\n", "#CLA ADL exampleUnions\n", "\n", "object goodEle : ELE\n", " select Pt(ELE) > 10\n", " select abs({ELE}Eta) < 2.4\n", " select {ELE}AbsEta ][ 1.442 1.556\n", "\n", "object GMUO : MUO\n", " select Pt(MUO) > 10\n", " select abs({MUO}Eta) < 2.4\n", "\n", "\n", "object geps : Union( MUO , ELE, TAU) #add all leptons into a set\n", "object gleps : Union( goodEle , GMUO ) #add all good electrons and good muons into another set\n", "\n", "define Zreco = ELE[-1] ELE[-1] #negative indices are to be determined by optimization functions \n", "\n", "region test\n", " select ALL # to count all events\n", " select Size (goodEle) >= 1 # events with 2 or more electrons \n", " select Size(MUO) >= 1\n", " select Size (GMUO) >= 1 # events with 2 or more electrons \n", " select Size (gleps) > 2 # events with 2 or more leptons \n", " select Size(ELE) >= 2 # events with 2 or more electrons \n", " weight mcw 1.1\n", " select m(Zreco) ~= 90.1\n", " histo hmz1, \"before cut\", 50, 0, 150, {Zreco}m\n", " select m(Zreco) [] 70 110\n", " histo hmz2, \"after cut\", 50, 60, 120, m(Zreco)\n", " select {ELE_0 ELE_1 }q == 0 # Z is neutral" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Weights and Tables**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exTab events=5000\n", "#CLA ADL example for tables and efficiencies\n", "\n", "def effFunc = sqrt({ELE_0}pT)/({ELE_0}pT + {ELE_1}pT)\n", "\n", "table myWeight\n", " tabletype abuzittin\n", " nvars 1\n", " errors false\n", "# value min max \n", " 0.3 0.0 10.0\n", " 0.5 10.0 20.0\n", " 0.7 20.0 50.0\n", " 0.8 50.0 70.0\n", " 0.95 70.0 1000.0\n", "\n", "table my2dWeight\n", " tabletype abuzittin\n", " nvars 2\n", " errors false\n", "# value min max min max \n", " 0.1 0.0 10.0 -5.5 0.0\n", " 0.1 0.0 10.0 0.0 5.5\n", " 0.2 10.0 20.0 -5.5 0.0\n", " 0.5 10.0 20.0 0.0 5.5\n", " 0.4 20.0 50.0 -5.5 0.0\n", " 0.4 20.0 50.0 0.0 5.5\n", " 0.7 50.0 70.0 -5.5 0.0\n", " 0.7 50.0 70.0 0.0 5.5\n", " 0.95 70.0 1000.0 -5.5 0.0\n", " 0.95 70.0 1000.0 0.0 5.5\n", " \n", "table myDet\n", " tabletype abuzittin\n", " nvars 2\n", " errors true\n", "# value err- err+ min max min max \n", " 0.1 0.01 0.02 0.0 10.0 -5.5 0.0\n", " 0.1 0.01 0.02 0.0 10.0 0.0 5.5\n", " 0.2 0.01 0.03 10.0 20.0 -5.5 0.0\n", " 0.2 0.01 0.03 10.0 20.0 0.0 5.5\n", " 0.4 0.01 0.04 20.0 50.0 -5.5 0.0\n", " 0.4 0.01 0.04 20.0 50.0 0.0 5.5\n", " 0.7 0.01 0.05 50.0 70.0 -5.5 0.0\n", " 0.7 0.01 0.05 50.0 70.0 0.0 5.5\n", " 0.95 0.01 0.06 70.0 1000.0 -5.5 0.0\n", " 0.95 0.01 0.06 70.0 1000.0 0.0 5.5\n", "\n", "object myElectron\n", " take ELE\n", " select applyHM( myDet({ELE}pT , {ELE}Eta) == 1) # 0 to reject, 1 to accept.\n", "\n", "\n", "region test\n", " select ALL # to count all events\n", " select Size(ELE) >= 1 # events generic electrons \n", " select Size(myElectron) >= 1 #events with detected electrons\n", " select {ELE_0}Eta > 0\n", " weight randWeight 1.123\n", " weight ef1Weight myWeight( {ELE_0}pT ) # weight 1d\n", " weight ef2Weight SUSEff( {ELE_0}pT, {ELE_0}Eta ) # weight 2d\n", "\n", " histo h1ept, \"E0 pt (GeV)\", 100, 0, 2000, {ELE_0}pT\n", "\n", " select applyHM( myWeight( {ELE}pT ) == 1) # 0 to reject, 1 to accept. " ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Sorting**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exSort events=5000\n", "#CLA ADL Sorting\n", "\n", "object goodEle : ELE\n", " select Pt(ELE_) > 10\n", " select abs({ELE_}Eta ) < 2.4\n", " select {ELE_}AbsEta ][ 1.442 1.556\n", "\n", "\n", "algo Dsorting\n", " select ALL # to count all events\n", " select Size(goodEle) >= 2 \n", " Sort {goodEle_ }E descend\n", " histo h1d, \"test electron E sorting Des\", 100, 0, 1000, {goodEle_0}E \n", " Sort {goodEle_ }E ascend\n", " histo h1a, \"test electron E sorting Asc\", 100, 0, 1000, {goodEle_0}E \n", " Sort {goodEle_ }Pz descend\n", " histo h2d, \"test electron Pz sorting Des\", 100, 0, 1000, {goodEle_0}Pz \n", " Sort {goodEle_ }Pz ascend\n", " histo h2a, \"test electron Pz sorting Asc\", 100, 0, 1000, {goodEle_0}Pz \n" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Saving**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exampleSave events=5000\n", "#CLA ADL saving example\n", "\n", "\n", "region test\n", " select ALL # to count all events\n", " select Size (ELE) >= 2 # events with 2 or more electrons \n", "# weight randWeight 1.123\n", " save mid1file\n", "# reject Size (ELE) > 4 # events with 2 or more electrons \n", "# histo h1mReco, \"Z candidate mass (GeV)\", 100, 0, 200, {ELE_0 ELE_1}m\n", "# histo h1mEta, \"Z candidate Eta\", 100, -5, 5, {ELE_0 ELE_1}Eta\n", " save end1file\n", "\n", "# region mest\n", "# select ALL\n", "# select Size (MUO) >= 2 \n", "# select Size (ELE) >= 2 # events with 2 or more electrons \n", "# save mid2file\n", "# weight bWeight 2.321\n", "# Save end2file\n" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Histograms**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exampleHistos events=5000\n", "# Object selection\n", "object jets\n", " take jet\n", " select pT(jet) > 30\n", " select abs(eta(jet)) < 2.4\n", "\n", "histoList jetHistos\n", " histo hjet1pt , \"jet 1 pT (GeV)\", 40, 0, 1000, pT(jets[0])\n", " histo hjet2pt , \"jet 2 pT (GeV)\", 40, 0, 1000, pT(jets[1])\n", " histo hjet3pt , \"jet 3 pT (GeV)\", 40, 0, 1000, pT(jets[2])\n", " histo hjet4pt , \"jet 4 pT (GeV)\", 40, 0, 1000, pT(jets[3])\n", " histo hmetjet1pt, \"MET vs. jet pT\", 20, 300, 1300, 20, 0, 1000, MET, pT(jets[0])\n", "\n", "\n", "# Event selection\n", "region presel\n", " select ALL\n", " select size(jets) >= 4\n", " histo hmetjet1pt, \"MET vs. jet 1 pT\", 20, 300, 1300, 20, 0, 1000, MET, pT(jets[0])\n", " select MET > 300\n", " jetHistos \n" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Binning**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exampleBin events=5000\n", "#CLA ADL example on bins\n", "\n", "object jets : JET\n", " select Pt(JET) > 10\n", " histo h1jetpt, \"Jet PT (GeV)\", 100, 0, 200, PT(JET)\n", "\n", "define EHT = pT(ELE_0) + pT(ELE_1)\n", "define MHT = pT(MUO_0) + pT(MUO_1)\n", "define HT = fHT(jets)\n", "\n", "region test\n", " select ALL # to count all events\n", " select Size(JET) >= 2\n", " select Size(jets) >= 2\n", " select Size (ELE) >= 2 # events with 2 or more electrons \n", " histo h1eReco, \"Z candidate mass (GeV)\", 100, 0, 200, {ELE_0 ELE_1 }m\n", " histo h1eEta, \"Z candidate Eta\", 100, -5, 5, { ELE_0 ELE_1 }Eta\n", "# save testfile\n", " Bin EHT [] 0.0 300 && HT [] 000 500 # 0\n", " Bin EHT [] 0.0 300 && HT [] 500 1000 # 1\n", " Bin EHT [] 0.0 300 && HT > 1000 # 2\n", " Bin EHT [] 300 500 && HT [] 000 500\n", " Bin EHT [] 300 500 && HT [] 500 1000 # 4\n", " Bin EHT [] 300 500 && HT > 1000\n", " Bin EHT [] 500 750 && HT [] 000 1000 # 6\n", " Bin EHT [] 500 750 && HT > 1000\n", " Bin EHT > 750 && HT [] 750 1500 # 8\n", " Bin EHT > 750 && HT > 1500 # 9\n", "\n", "region mest\n", " select Size (MUO) >= 2 # events with 2 or more electrons \n", " histo h1mReco, \"Z candidate mass (GeV)\", 100, 0, 200, {MUO_0 MUO_1}m\n", " select MHT <1300 && HT < 1500\n", " bin MHT 300 500 700 1000\n" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Counting**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exampleCount events=5000\n", "#CLA ADL counting example\n", "\n", "countsformat results\n", " process est, \"Total estimated BG\", stat, syst \n", " process obs, \"Observed data\"\n", "\n", "countsformat bgests\n", " process lostlep, \"Lost lepton background\", stat, syst\n", " process zinv, \"Z --> vv background\", stat, syst\n", " process qcd, \"QCD background\", stat, syst\n", "\n", "region presel\n", " select ALL # to count all events\n", " select Size (ELE) >= 2 # events with 2 or more electrons \n", " histo h1mReco, \"Z candidate mass (GeV)\", 100, 0, 200, {ELE_0 ELE_1}m\n", "# select {ELE[0] ELE[1] }q == 0 # Z is neutral\n", "# histo h2mReco, \"Z candidate mass (GeV)\", 100, 0, 200, {ELE_0 ELE_1}m\n", " bin Size(ELE) == 2\n", " counts results 230.0 + 16.0 - 10.0 + 10.0 - 12.0 , 224.0\n", " counts bgests 105.0 +16.0 - 10.0 +-1.0 , 123.0 +-2.0 +-12.0 , 2.3 +-0.5 +-1.4 \n", "\n", "#region searchbins\n", "#  presel\n", "#  # Table 3, 1-10\n", "#  bin MHT [] 300 350 and HT [] 300 600 and size(jets) [] 2 3 and size(bjets) == 0\n", "#  counts bgests 38870 +- 320 +- 580 , 89100 +- 200 +- 2600 , 1800 +- 1000 +- 1200\n", "#  counts results 129800 +- 1100 +- 2800 , 130718\n", "#  bin MHT [] 300 350 and HT [] 600 1200 and size(jets) [] 2 3 and size(bjets) == 0\n", "#  counts bgests 2760 +- 61 +- 39 , 4970 +- 50 +- 150 , 330 +- 180 +- 160\n", "#  counts results 8060 +- 200 +- 220 , 7820\n", "#  bin MHT [] 300 350 and HT > 1200 and size(jets) [] 2 3 and size(bjets) == 0\n", "#  counts bgests 181 +- 17 +- 3 , 308 +- 12 +- 18 , 62 +- 34 +- 27\n", "#  counts results 552 +- 40 +- 32 , 514\n" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Jet constituents**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exampleConstituents events=5000\n", "#CLA ADL jet constituents example\n", "\n", "object goodJet using JET\n", " select q(JET constituents ) == 0\n", "# select q(JET:constituents ) == 0 \n", "# select q(constituents(Jet) ) == 0 \n", " select pT( JET ) > 50\n", " select Sum(pT(JET constituents ) ) < 40 # PT from remaining constituents\n", "# ^^^^^^^^^^^^^^\\_this is a cut on one JET. loop is over the constituents\n", "# select VertexTR(Jet constituents) < 4 # remove if far PrimaryVertex'ed constituents\n", "\n", "\n", "region test\n", " select ALL # to count all events\n", " select Size (goodJet) >= 5 # events with 2 or more electrons \n", "##select Sum(pT(JET constituents ) ) < 40 # PT from remaining constituents\n", "## ^^^^^^^ such a cut doesnt make sense here, this is event loop\n", "# select Sum(pT(goodJet)) > 55\n", "# ^^^^^^^\\_this is a loop over all jets, so it is OK." ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Using loops and reducers**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exampleLoop events=5000\n", "# ADL example for loops and reducers\n", "\n", "object goodjet : JET\n", " select pT(JET) > 20\n", " select abs(eta(JET)) < 2.5\n", "# select Sum( pT(JET)) >= 20 #### This doesnt make sense. \n", "# in a new object, The loop is over individual jets, not over all event variables\n", "\n", "\n", "region signal\n", " select ALL # to count all events\n", " select Size( JET ) > 2\n", " select Sum ( pT(JET) ) >= 20\n", " select Size( ELE ) > 0\n", " select min ( dR(JET[0:2], ELE[0] )) > 0.9\n", " select min ( dR(JET[0: ], ELE[0] )) > 0.9\n", " select min ( dR(ELE[0] , JET )) > 1.2\n", "\n", " region deneme\n", " select ALL\n", " select Size(ELE) > 0\n", " select Size(goodjet) > 2\n", " select min ( dR(goodjet[0: ], ELE[0] )) > 0.9\n", " select min ( dR(goodjet[0:2], ELE[0] )) > 1.3\n", "# select Size(MUO) > 2\n", "# select min ( dR(MUO[0:2], ELE[0] )) > 0.9\n" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Generator Level particles**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exampleGen events=5000\n", "object genelectrons : GEN\n", " select {GEN}PDGID == -11 \n", " select {GEN}pT > 5\n", " select {GEN}AbsEta < 2.4\n", "\n", "object genmuons : GEN\n", " select PDGID(GEN) == -13\n", " select Pt(GEN) > 5\n", " select Abs( Eta(GEN) ) < 2.4\n", "\n", "region test1\n", " select Size(genelectrons) == 1\n", " select vertexY(genelectrons_0) > 0\n", "\n", "#region test2\n", "# select {GEN_1}PDGID == -11\n", "# select {GEN_1}pT > 5\n", "# select {GEN_1}AbsEta < 2.4\n", "# select vertexX(GEN_1) > 0" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Using external functions**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exampleExtern events=5000\n", "#CLA ADL example for external functions\n", "\n", "#object megajets\n", "# take JET\n", "# select fmegajets(JET) == 2\n", "\n", "#object hemisjets\n", "# take JET\n", "# select fhemisphere(JET, 2, 3) == 2\n", "\n", "region test\n", " select ALL # to count all events\n", " select Size (JET) >= 2 # events with 2 or more electrons \n", "# select fMT2(hemisjets[0], hemisjets[1], METLV[0]) > 40.0\n", " select fMT2(JET[0], JET[1], METLV[0]) > 40.0\n", " select fMT2(JET[0], JET[1], METLV[0]) > 45.0\n", " select fMT2(JET[0], JET[1], METLV[0]) > 50.0\n", "\n", "\n", "# select fMTauTau(ELE[0], ELE[1], METLV[0]) [] 0 160" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "**Combinations for partitioning**" ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "%%cutlang file=T2tt_700_50.root filetype=DELPHES adlfile=exampleComb events=5000\n", "object jets : JET\n", " select {JET}Pt > 10\n", " select {JET}Eta < 4\n", "\n", "###### 12 21 13 31\n", "object hZs : COMB( jets[-1] jets[-2] ) alias ahz\n", " select { ahz }AbsEta < 3.0\n", " select {jets[-2] }Pt > 2.1\n", " select {jets[-1] }Pt > 5.1\n", " select {jets[-1], ahz }dR < 0.6 #--- means a member of hZs and its constituent number 1, not a loop between all members and all constituents\n", " select { ahz }m [] 10 200 # does get the paricle numbers (2) fromt the last cut\n", "\n", "define zz : hZs[-1]\n", "define zhad : jets[-1] jets[-2]\n", "define zham : {hZs[-1]}m\n", "define zhbm : {hZs[-2]}m\n", "#define chi2 : (zham - zhbm)^2\n", "define chi2 : (zham - 91.2)^2 + (zhbm - 91.2)^2\n", "\n", "object goodeles : ELE\n", " select {ELE}Pt > 10\n", " select {ELE}AbsEta < 4\n", "\n", "region testA\n", " select ALL # to count all events\n", "# count number size are all the same.\n", " select Size(jets) > 2 # we need at least 2 jets to reconstruct Zhads\n", " select Count(hZs) >= 2 # we need at least 2 Zhad candidates.\n", "# 4Jetli bir olayim var. 12, 21, 13, 31, 23, 32, 14, 41, 24, 42, 34, 43\n", "# ^^------------------------------------- ^^ ^^\n", " select { zz }m ~= 91.2 # we kill here overlapping candidates. \n", " select chi2 ~= 0 # we kill here overlapping candidates. \n", " histo hchi2, \"chi2 \", 50, 0, 500, chi2\n", " histo bm1hZ, \"mass Hrec GeV\", 50, 50, 150, zham\n", " histo bm2hZ, \"mass Hrec GeV\", 50, 50, 150, zhbm\n", " histo bm12hZ,\"mass 1 vs 2 GeV\", 50, 50, 150, 50, 50, 150, zham, zhbm\n", " select chi2 <= 100 # we kill bad candidates. \n", " histo am1hZ, \"mass Hrec GeV\", 50, 50, 150, zham\n", " histo am2hZ, \"mass Hrec GeV\", 50, 50, 150, zhbm\n", " histo am12hZ,\"mass 1 vs 2 GeV\", 50, 50, 150, 50, 50, 150, zham, zhbm\n", "\n" ], "outputs": [], "metadata": {} } ], "metadata": { "kernelspec": { "display_name": "ROOT C++ with CutLang v2.12.5", "language": "c++", "name": "cutlang" }, "language_info": { "codemirror_mode": "text/x-c++src", "file_extension": ".C", "mimetype": " text/x-c++src", "name": "c++" } }, "nbformat": 4, "nbformat_minor": 4 }