From f5193454811b7941ccc95025272cc4fcb09fe7f9 Mon Sep 17 00:00:00 2001
From: Andrea Tugores <tugoresa@jupyterMiLAB>
Date: Sun, 16 May 2021 13:41:30 -0500
Subject: [PATCH] command description

---
 ...hon-13-TeV-framework-script-analysis.ipynb | 117 ++++++++++++++----
 atlas-data/atlas-outreach-cpp-framework-13tev |   2 +-
 2 files changed, 95 insertions(+), 24 deletions(-)

diff --git a/ATLAS-Open-Data-Python-13-TeV-framework-script-analysis.ipynb b/ATLAS-Open-Data-Python-13-TeV-framework-script-analysis.ipynb
index 7a01e77..e6b233a 100644
--- a/ATLAS-Open-Data-Python-13-TeV-framework-script-analysis.ipynb
+++ b/ATLAS-Open-Data-Python-13-TeV-framework-script-analysis.ipynb
@@ -32,6 +32,14 @@
     "### Import some Python packages\n",
     "\n",
     "<p style='text-align: justify;'>\n",
+    "We organize a large number of files in different folders and subfolders based on some criteria, so that we can find and manage them easily. A package is a hierarchical file directory structure that defines a single Python application environment that consists of modules and subpackages.\n",
+    "</p>\n",
+    "\n",
+    "<p style='text-align: justify;'>\n",
+    "A module allows you to logically organize your Python code. Grouping related code into a module makes the code easier to understand and use. A module can define functions, classes and variables. A module can also include runnable code.\n",
+    "</p>\n",
+    "\n",
+    "<p style='text-align: justify;'>\n",
     "The <strong>OS module</strong> in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system-dependent functionality.It is possible to automatically perform many operating system tasks. The OS module provides functions for creating and removing a directory (folder), fetching its contents, changing and identifying the current directory, etc.\n",
     "</p>\n",
     "\n",
@@ -48,18 +56,14 @@
     "\n",
     "<p style='text-align: justify;'>\n",
     "Finally, the <strong>pandas</strong> library is a Python library that serves as a tool for reading, writing and manipulating data in the form of DataFrames and Series objects. It will not be used to running or plotting the Analysis, but to read the ATLAS Open Data database with the descriptions of the analysis that can be done in this notebook.\n",
-    "</p>"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "# Sugerencia\n",
-    "# !pip install pandas\n",
-    "# !pip install matplotlib"
+    "</p>\n",
+    "\n",
+    "\n",
+    "#### Install modules or packages in python\n",
+    "\n",
+    "To run from the virtual machine it is not necessary to install any package because the necessary ones are already installed.\n",
+    "\n",
+    "In case you need to install a package: **!pip install pandas**"
    ]
   },
   {
@@ -70,8 +74,8 @@
    "source": [
     "import os\n",
     "import datetime\n",
-    "import ROOT\n",
-    "from ROOT import TMath\n",
+    "#import ROOT\n",
+    "#from ROOT import TMath\n",
     "import pandas as pd\n",
     "import matplotlib.pyplot as plt"
    ]
@@ -267,7 +271,13 @@
     "\n",
     "If it is the first time the notebook is run, the data is cloned. Otherwise, it warns that the data already exists.\n",
     "\n",
-    "The frameworks implement the protocols needed for reading the datasets, making an analysis selection, writing out histograms and plotting the results."
+    "The frameworks implement the protocols needed for reading the datasets, making an analysis selection, writing out histograms and plotting the results.\n",
+    "\n",
+    "<p style='text-align: justify;'>\n",
+    "<strong>os.path</strong> is a module implements some useful functions on pathnames. The path parameters can be passed as either strings, or bytes. The os.path module is always the path module suitable for the operating system Python is running on, and therefore usable for local paths. \n",
+    "</p>\n",
+    "\n",
+    "**os.path.exists** os.path is checking if the path physically exists."
    ]
   },
   {
@@ -432,7 +442,9 @@
     "The naming of the sub-folders follows a simple rule: \"NNAnalysis\", where NN can be WBoson, ZBoson, TTbar, SingleTop, WZDiBoson, ZZDiBoson, HZZ, HWW, Hyy, ZPrimeBoosted, ZTauTau and SUSY. After you enter your choice, you will see the description of the analysis that has been obtained from a pandas dataframe generated from a .csv file with the analysis information. \n",
     "</p>\n",
     "\n",
-    "### Select one analysis"
+    "### Select one analysis\n",
+    "\n",
+    "**analysis_df** is a DataFrame that contains description and explanation about each of the analyzes."
    ]
   },
   {
@@ -444,6 +456,13 @@
     "analysis_df = pd.read_csv(f\"{directory0}/notebooks-info/analysis_info.csv\", sep=\"_\").set_index(\"Analysis\")"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Print all possible analysis options."
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -468,6 +487,13 @@
     "        print(\"Analysis not found\")"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Show a short description of the selected analysis."
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -525,15 +551,16 @@
     "<p style='text-align: justify;'>\n",
     "After you choose the options, the code will compile and create the needed ROOT shared libraries, and the analysis selection will begin: it will run over each input sample defined in main_NNAnalysis.C.\n",
     "</p>\n",
-    "\n",
-    "<p style='text-align: justify;'>\n",
-    "<strong>\"echo \\\"0\\n0\\\" | ./run.sh >log\"</strong> : the first 0 indicates run all data and MC one after another. The second 0 indicates that you don't want to use PROOF.\n",
-    "</p>\n",
-    "\n",
-    "\n",
     "\n"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Setting the path as a variable."
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -544,6 +571,17 @@
     "print(directory3)"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Functions such as **expanduser()** and **expandvars()** can be invoked explicitly when an application desires shell-like path expansion.\n",
+    "\n",
+    "<p style='text-align: justify;'>\n",
+    "<strong>os.path.expanduser()</strong> method in Python is used to expand an initial path component ~(tilde symbol) or ~user in the given path to user’s home directory. On Unix platforms, an initial ~ is replaced by the value of HOME environment variable, if it is set. Otherwise, os.path.expanduser() method search for user’s home directory in password directory using an in-built module pwd. Path containing an initial ~user component is looked up directly in the password directory.\n",
+    "</p>"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -564,6 +602,13 @@
     "print(logPath)"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "**tail:** output the last part of files."
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -573,6 +618,15 @@
     "print(f\"Copy all of this command:\\ntail -f {logPath}/log\")"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<p style='text-align: justify;'>\n",
+    "<strong>\"echo \\\"0\\n0\\\" | ./run.sh >log\"</strong> : the first 0 indicates run all data and MC one after another. The second 0 indicates that you don't want to use PROOF.\n",
+    "</p>"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -727,6 +781,13 @@
     "print(myCmd)"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Setting the path as a variable."
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -736,6 +797,16 @@
     "directory4 = os.getcwd()"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "#### Show histograms\n",
+    "\n",
+    "**os.listdir()** method in python is used to get the list of all files and directories in the specified directory.\n",
+    "\n"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
@@ -804,7 +875,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.6.9"
+   "version": "3.7.3"
   }
  },
  "nbformat": 4,
diff --git a/atlas-data/atlas-outreach-cpp-framework-13tev b/atlas-data/atlas-outreach-cpp-framework-13tev
index 0fabe1d..e80943d 160000
--- a/atlas-data/atlas-outreach-cpp-framework-13tev
+++ b/atlas-data/atlas-outreach-cpp-framework-13tev
@@ -1 +1 @@
-Subproject commit 0fabe1d45102cb4339d808c9187276e6c555bf8c
+Subproject commit e80943df6c4e9e22e79662bdd9c90915cc237427
-- 
GitLab