.. _structure: ==================================== Structure of the framework ==================================== This framework is structured in two separate repositories, summarized in the next sections. User code --------- It should contain the user's configuration and custom tasks. As an example, `this repository `_ includes the code used for the HH->bbtt analysis, and it can be used as an example to add the desired configuration. It contains two folders: - *Config*: it contains different files in yaml and python format to define the configuration of the analysis. - *Tasks*: files in python format. Custom tasks (i.e. specific from your analysis or modifying a common task) can be stored here taking advantage of inheritance. `Main code `_ ----------------------------------------------------------------------------- Base code of the framework that shouldn't be modified unless there is any improvement suggestion. In this repository there are several folders, some of them just to document information about the code, and inside the main one (*/cmt/*) are a few relevant files on our understanding of the code: - `preprocessing.py `_: main tasks of the code to process data and to count events are defined here. - `plotting.py `_: definitions of the tasks used to make plots of the processed data. - `base_config.py `_: useful datasets and definitions of the mandatory variables for the analysis. All this code gives us the opportunity to execute multiple tasks depending on what we want to do, and can be summarized with this diagram: .. image:: lawStructure.png Where there are two branches of tasks before plotting depending on what the goal is: event counting or processing data. In the section :ref:`tasks` you can see step by step how it works and which are the specific tasks the code can make. .. _directories layout: Directories layout ------------------ Once installed the framework in your user area, the directories structure and some important folders and files located inside will be the following: - ``reponame/``: user code of the framework. This path would be ``/nfs/cms///`` in CIEMAT by default, and ``/afs/cern.ch///`` in CERN. - ``config/``: different files in yaml and python format to define the configuration of the analysis are inside. - ``modules/``: specific modules for some tasks are added here. - ``tasks/``: for custom tasks in python format. - ``setup.sh``: required to define environment variables and install important software code. The environment variables can be modified in this setup.sh script. - ``nanoaod_base_analysis/``: or main code. Defined with the variable ``$CMT_BASE``. - ``_readthedocs/`` and ``docs/``: folders where this docummentation you are looking at is defined. - ``bin/``: some useful scripts to use. - ``cmt/``: python modules from the framework's code. - ``data/``: - ``cmssw/``: CMS software used for this framework, also associated to the variable ``$CMT_CMSSW_BASE`` or ``$CMT_BASE/data/cmssw``. - ``jobs/``: submit files and the actual scripts submitted. Defined with the variable ``$CMT_JOB_DIR`` or ``$CMT_BASE/data/jobs``. - ``law/``: index of law tasks. - ``software/``: software of law, python and sphinx. Defined with ``$CMT_SOFTWARE``. - ``store/``: condor control files (json files) and htcondor logs (.txt files). Defined with the variable ``$CMT_STORE_LOCAL``. (Very) general structure of the folders inside the path is ``///[ (for PreprocessRDF, Categorization, PrePlot)]/``. - ``tmp/``: it contains sorted .txt lists of LFNs (Logical File Names) for the required input files needed for preprocessing or precounting. Defined with ``$CMT_TMP_DIR``. - ``x509up``: CMS VOMS proxy. It's created once you make a ``voms-proxy-init``. - Output area (``cmt/``): output files produced by every task. Defined with the variable ``$CMT_STORE`` and located by default in ``/nfs/cms//cmt/`` in CIEMAT and ``/eos/`` in CERN. (Very) general structure of the folders inside the path is ``/cmt///[ (all except FeaturePlot)]/[ (for PreprocessRDF, Categorization, MergeCategorization, PrePlot, FeaturePlot)]/``. - Temporal files area (``tmp/``): or ``$TMPDIR`` (do an ``echo $TMPDIR`` to see specific path), it contains temporal files created during the execution of tasks and within the HTCondor nodes. Git repositories ------------------------- Useful git repositories used in the framework. - Software: defined with ``$CMT_SOFTWARE`` and located in ``//nanoaod_base_analysis/data/software/``. - CIEMAT tools: - `analysis_tools `_ - `plotting_tools `_ - `law `_ - `plotlib `_ - Other software, located in different areas (do an ``echo $variable`` to see specific path): - `CMS-nanoAOD-tools ($NANOTOOLS_PATH) `_ - `Base modules cms-phys-ciemat ($BASEMODULES_PATH) `_ - Other git repositories that can be useful for your analysis: - `HHKinFit2 ($HHKINFIT_PATH) `_ - SVfit (``$SVFIT_PATH``) with two repositories: - `Classic SVfit `_ - `SVfitTF `_ - `GEM Modules ($GEM_PATH) `_ - HTT-utilities (``$HTT_PATH``) with several repositories: - `LeptonEff-interface `_ - `Lepton Efficiencies `_ - `TauAnalysisTools `_ - TauAnalysisTools data: `data1 `_ , `data2 `_ - `HHbtag ($HHBTAG_PATH): `_ - `hh/bbtautau `_ - `InterferenceTools `_ - `cms_hh_proc_interface `_ - `cms_hh_tf_inference `_ - `cms_runII_dnn_models `_ - Corrections (``$CORRECTIONS_PATH``): - `correctionlib-wrapper `_ - `tau-corrections `_ - `jme-corrections `_ - jme-corrections data: `1 `_, `2 `_, `3 `_, `4 `_. - `lum-corrections `_ - `muo-corrections `_ - `egm-corrections `_ - `btv-corrections `_