` ====== Analysis Description Language (ADL)======
Develop a domain-specific language capable of describing the contents of an LHC analysis in a standard and unambiguous way.
[[https://www.dropbox.com/s/a9gn1iyg26h3qms/SekmenLHADL1906.pdf?dl=0|Link to Sezen's presentation]]
HSF Gitter forum for discussions: {{https://gitter.im/HSF/ADL|}}
**ADL-related projects/discussions in Les Houches:**
* Estimation of overlaps in analysis using analysis descriptions ([[2019:groups:tools:correlations|correlations exercise]], [[2019:groups:tools:adl#Quantifying overlaps between analysis search regions using ADLs|how to use ADLs]])
* Recasting tools/methods comparison exercise with ADLs ([[2019:groups:tools:recastcmp|recast comparison exercise]], [[2019:groups:tools:adl#ADLs for recasting|ADL implementation]])
* Questions for us to answer:
* What is the ideal physics content for an ADL? An inclusive list discussed at the [[https://indico.cern.ch/event/769263/|Fermilab ADL workshop]] is [[https://docs.google.com/document/d/1KrSarg4_c_Ph76SI8i9_b-wBEN6V90mWNLTaZq3y85E/edit?usp=sharing|in this googledoc]]. You are welcome to take a look and edit.
* What is the best syntax for expressing composite particles, like Zs, tops, Higgsses, etc.? How can we access information on the constituents?
* What is the minimal list of math and HEP functions/operators we need for describing the analysis?
* What are some challenging analysis descriptions to try?
* How can we benefit from an ADL in analysis combination / finding out non-overlapping regions?
Parsing/interpreting tools for the current ADL:
* **adl2tnm** (transpiler: python script converts adl to generic c++ analysis code) ([[https://github.com/hbprosper/adl2tnm|github]])
* **lhada2rivet** (transpiler: python script converts LHADA to c++ code for Rivet) ([[https://github.com/lhada-hep/lhada/tree/master/lhada2rivet.d|github]])
* **CutLang** (runtime interpreter of adl, no intermediate code generation, no compilation) ([[https://github.com/unelg/CutLang|github]], Jupyter notebook: [[https://gke.mybinder.org/v2/gh/unelg/CutLang/master?urlpath=/lab/tree/binder%2Fexample1.ipynb|binder link]])
==== Quantifying overlaps between analysis search regions using ADLs ====
Members: Sezen, Wolfgang (, Harrison)
Find and visualize overlaps in a model-independent way, without generating events. Directly sample the event selection. Useful for analysis design phase, or quick comparisons within experiments (e.g. Run2 CMS SUSY pMSSM combination)
* Start from the analysis description, which lists objects and event selections.
* Construct a feature space from all mathematically orthogonal "basic" variables (e.g. MET, jet1.pt, jet2.pt, electron1.eta, ...).
* Randomly sample the feature space for each analysis based on cuts on the feature space components (jet1.pt > 100, MET > 299, etc.).
* Use the sampled points to compute values for "composite" variables such as HT(jets), dphi(jets), MT(lepton, MET), etc.
* Compare feature spaces between analyses, find and visualize overlaps and exclusions.
* As a very simple first step, we simply check if two analyses are disjoint in any of the basic variables.
==== ADLs for recasting ====
Members: Sezen, (Harrison, Gokhan as parser developers)
The ADL file and the external function fMtautau are given below for the CMS soft dilepton analysis considered in the LH19 [[2019:groups:tools:recastcmp|recasting comparison]]
=== The ADL file ===
info analysis
title "Search for new physics in events with two soft oppositely charged leptons and missing transverse momentum in proton-proton collisions at sqrts = 13 TeV "
experiment CMS
id SUS-16-048
publication Phys. Lett. B 782 (2018) 440
sqrtS 13.0
lumi 35.9
arXiv 1801.01846
hepdata
doi 10.1016/j.physletb.2018.05.062
# ANALYSIS OBJECTS
object muons
take Muon
select pT [] 3.5 30
select abs(eta) < 2.4
# ID/iso efficiencies already folded into efficiencies provided by CMS:
# https://twiki.cern.ch/twiki/bin/view/CMSPublic/SUSMoriond2017ObjectsEfficiency
object electrons
take Electron
select pT [] 3.5 30
select abs(eta) < 2.5
# ID/iso efficiencies already folded into efficiencies provided by CMS:
# https://twiki.cern.ch/twiki/bin/view/CMSPublic/SUSMoriond2017ObjectsEfficiency
object leptons
take electrons
take muons
object jets
take Jet
select pT > 25
select abs(Eta) < 2.4
object bjets
take jets
select BTag == 1
object MET
take MissingET
# EVENT VARIABLES
define dilepton = leptons[0] + leptons[1]
define dielectron = electrons[0] + electrons[1]
define dimuon = muons[0] + muons[1]
define HT = sum(jets.pT)
define MTl1 = sqrt( 2*leptons[0].pT * MET.MET*(1-cos(MET.phi - leptons[0].phi )))
define MTl2 = sqrt( 2*leptons[1].pT * MET.MET*(1-cos(MET.phi - leptons[1].phi )))
define Mtautau = fMtautau(leptons[0], leptons[1], MET)
# EVENT SELECTION
# Dimuon selection
# This selection follows the cutflow table in LH recasting twiki
# https://phystev.cnrs.fr/wiki/_detail/2019:groups:tools:cms-sus-16-048_cutflow.png?id=2019%3Agroups%3Atools%3Arecastcmp
region CharginoDimuonPresel
weight xsec 0.688016
select size(muons) == 2
select muons[0].pT [] 5 30
select muons[0].charge * muons[1].charge == -1
select dimuon.pT > 3
select dimuon.mass [] 4 50
select dimuon.mass ][ 9 10.5
select MET.MET [] 125 200
weight trigger 0.65
select size(jets) >= 0
select size(jets) >= 1
select HT > 100
select (MET.MET / HT) [] 0.6 1.4
select size(bjets) == 0
select Mtautau ][ 0 160
select MTl1 < 70 and MTl2 < 70
# Additional selections from the analysis (not included in the recast study)
# Dilepton preselection
#region DileptonPresel
# This selection follows Table 1 in the paper
# (for the time being, except for the isolation criteria)
# select size(leptons) == 2
# select size(electrons) == 2 or size(muons) == 2
# select leptons[0].charge * leptons[1].charge == -1
# select leptons[0].pT > 5
# select leptons[1].pT > 5
# select size(bjets) == 0
# select size(electrons) == 2 or size(muons) == 2 ? mass(dilepton) [] 4 9 : mass(dilepton) [] 10.5 50
# select dilepton.pT > 3
# select size(muons) == 2 ? MET.pT > 125 : MET.pT > 200
# select MET.pT / HT [] 0.6 1.4
# select HT > 100
# select MTl1 < 70 and MTl2 < 70
# Dielectron selection
#region CharginoDielectronPresel
# This selection follows the cutflow table in the twiki
# select size(electrons) == 2
# select electrons[0].pT [] 5 30
# select electrons[0].charge * electrons[1].charge == -1
# select dielectron.pT > 3
# select dielectron.mass [] 4 9 or dielectron.mass [] 10.5 50
# reject dielectron.mass [] 9 10.5
# select MET.pT [] 125 200
# select MET.pT / HT [] 0.6 1.4
# select size(jets) >= 1
# select HT > 100
# select size(bjets) == 0
# reject Mtautau [] 0 160
# select MTl1 < 70 and MTl2 < 70
# Stop dimuon preselection
#region StopDimuonPresel
# # This selection follows the cutflow table in the twiki
# select size(muons) == 2
# select muons[0].pT [] 5 30
# select muons[0].charge * muons[1].charge == -1
# select dimuon.pT > 3
# select dimuon.mass [] 4 50
# reject dimuon.mass [] 9 10.5
# select MET.pT [] 125 200
# select MET.pT / HT [] 0.6 1.4
# select size(jets) >= 1
# select HT > 100
# select size(bjets) == 0
# reject Mtautau [] 0 160
=== The external function Mtautau ===
// Find m(tautau) for boosted taus with alligned decay products.
// For leptons l1, l2 and neutrino(s) nu1, nu2 coming from tau1, tau2 decays,
// collinearity implies p(nu1) = a * p(l1), p(nu2) = b * p(l2)
// 1) Use the constraint from MET to find a and b
// 2) Compute nu and tau momenta
// 3) Find the ditau invariant mass
// Suggested in arXiv:1401.1235 , used in CMS SUS-16-048
// Coded by S. Sekmen
double fMtautau(TLorentzVector& lep1, TLorentzVector& lep2, TLorentzVector& met){
double px1 = lep1.Px();
double py1 = lep1.Py();
double px2 = lep2.Px();
double py2 = lep2.Py();
double metx = met.Px();
double mety = met.Py();
// Compute the solution of the two coupled equations:
// metx = a * px1 + b * px2
// mety = a * py1 + b * py2
// for a and b:
double a = (metx * py2 - mety * px2) / (px1 * py2 - py1 * px2);
double b = (metx * py1 - mety * px1) / (px2 * py1 - py2 * px1);
// Neutrino vectors
TLorentzVector nu1, nu2;
nu1.SetPxPyPzE(a*px1, a*py1, 0., sqrt(a*px1 * a*px1 + a*py1 * a*py1));
nu2.SetPxPyPzE(b*px2, b*py2, 0., sqrt(b*px2 * b*px2 + b*py2 * b*py2));
// Reconstruct the taus from leptons and neutrinos
TLorentzVector tau1 = lep1 + nu1;
TLorentzVector tau2 = lep2 + nu2;
// Reconstruct the Z from Z --> tau tau
TLorentzVector Z = tau1 + tau2;
return Z.M();
}