Get running the full Hyy analysis using the 13 TeV dataset in 5 minutes!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Introduction**\n",
"The analysis is based on the 13 TeV Open Data.\n",
"The ATLAS note [ATL-OREACH-PUB-2020-001](https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/PUBNOTES/ATL-OREACH-PUB-2020-001) can be used as a guide on the content, properties, capabilities and limitations of the released datasets.\n",
"\n",
"In the following, in about **5 minutes** we are going to re-produce the H->yy analysis plots from the note.\n",
"
\n",
" \n",
"
"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import ROOT\n",
"from ROOT import TMath\n",
"import time"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"start = time.time()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## First, we will download from github the 13 TeV C++ analysis software\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"myCmd = os.popen('ls -lhrt').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"in case it already exists, remove it"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"folder_demo = 'atlas-demo-Hyy'\n",
"command1 = 'rm -rf '+folder_demo\n",
"os.system(command1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"myCmd = os.popen('ls -lhrt').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"folder_demo = 'atlas-demo-Hyy'\n",
"command1 = 'mkdir '+folder_demo\n",
"os.system(command1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Show the contents in the current folder, and checck your new folder is there"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"myCmd = os.popen('ls -lhrt').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Get into the folder which we just created"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"os.chdir(folder_demo+\"/\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Print the current path and check that you are really there"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"myCmd = os.popen('pwd').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Clone the analysis code **(do this only once!)**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"myCmd = os.popen('git clone https://github.com/atlas-outreach-data-tools/atlas-outreach-cpp-framework-13tev.git').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Get into the folder which contains the analysis code"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"os.chdir(\"atlas-outreach-cpp-framework-13tev/\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"myCmd = os.popen('ls -lhrt').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"let's create the output folders **do it once**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"command3 = \"./welcome_web.sh\"\n",
"os.system(command3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Let's run the Hyy physics analysis\n",
"\n",
"#### From the list below, we will selection the proper HyyAnalysis option:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"os.chdir(\"Analysis/HyyAnalysis\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"myCmd = os.popen('pwd').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"myCmd = os.popen('ls -lhrt').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Check that the directory **Output_HyyAnalysis** is there! If not, **create it**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#command1 = 'mkdir Output_HyyAnalysis'\n",
"#os.system(command1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Now, we will execute the C++ analysis code. It will take some time (less than 5mins)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First, we will run over MC samples"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"command4 = \"./run_web.sh\"\n",
"os.system(command4)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Now the analysis is done"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Inside that directory **Output_HyyAnalysis** you will find the output root file: data.root"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"myCmd = os.popen('ls -lhrt Output_HyyAnalysis/*').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we will run over MC samples"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"command4 = \"./run_web2.sh\"\n",
"os.system(command4)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**only** if there are 5 root files, you can proceed with plotting"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"myCmd = os.popen('ls -lhrt Output_HyyAnalysis/*').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Let's run the Plotting code"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"os.chdir(\"../../Plotting/\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"myCmd = os.popen('pwd').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"myCmd = os.popen('ls -lhrt').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Check that the directory **histograms** is there! If not, **create it**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#command5 = 'mkdir histograms/'\n",
"#os.system(command5)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"command5 = \"./plotme_Hyyweb.sh\"\n",
"os.system(command5)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"myCmd = os.popen('ls -lhrt histograms/*png').read()\n",
"print(myCmd)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
\n",
"
The two photons invariant mass
\n",
" \n",
"
"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"end = time.time()\n",
"duration = end-start\n",
"print(\"Finished in {} min {} s\".format(int(duration//60),int(duration%60))) # Python3"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Finally, you can compare it to the ATLAS plot from a published [paper](https://arxiv.org/abs/1802.04146) that uses **3 times more data!**\n",
"\n",
"