The analysis codes are kept in the directory ./analysis codes
. Go to the directory and compile the code from the ROOT prompt by doing the following.
.L AnaOpenData.C+
The +
makes sure that it creates an .so
file in the same directory, which can be used later. After this step, the compiled library is loaded, and it can be used from the ROOT prompt. Next, the driver file is executed to feed the appropriate values to the input-output parameters and run the analysis.
.x driver.C(0)
That's it!
The verbosity number in the Process()
function of the main C script can be tweaked to display a status-update after some number of processed events.
Note : This particular set of codes works with a specific structure of the input ntuple. If there is any change made to the branches of the flat ntuple, The
TTreeReader
method in theAnaOpenData.h
file needs to be modified accordingly. Otherwise it leads to "Segmentation error" during runtime.
The NTuple maker codes can be found in the ./NtupleMaker
directory.
- CMS-OpenData-Virtual Machine should be up and running on the system.
- CMS Environment should be set up with version
CMSSW_5_3_32.
- The NTupleMaker files shall be placed in the directory
./CMSSW_5_3_32/src/
For more information on how to set up the CMS-OpenData Virtual Machine visit (https://opendata.cern.ch/docs/about-cms)
Note : For setting up the CMS environment, CMSSW_5_3_32, open CMS Shell, set up the software architecture and version by doing
export SCRAM_ARCH=slc6_amd64_gcc472
, set up a new release area for CMSSW_5_3_32 by doingcmsrel CMSSW_5_3_32
.
- Open the CMS Shell Terminal and locate the NTupleMaker directory.
- Set up the runtime environment needed to work with CMSSW by doing:
cmsenv
- Compile the code by doing:
scram b -j 8
- Open the
./python
directory to find the python exectuable configuration file,masterntuplemaker_cfg.py
. This file is going to give the output root file. - To execute the configuration file and get the output NTuple do:
cmsRun masterntuplemaker_cfg.py isData=True is7TeV=True nEvents=1000
cmsRun masterntuplemaker_cfg.py isData=True is8TeV=True nEvents=1000
cmsRun masterntuplemaker_cfg.py isData=False nEvents=1000
- That's it.
The output NTuples should be available in the
./output_files
directory.
- Open the Outer Shell Terminal (not the CMS Terminal) and locate the
./output_files
directory. - Now use the secure copy command
scp
to move the file to the desired local machine directory.
scp -C [output_filename.root] username_localmachine@[Host_IP_Address]:/home/username_localmachine/desired/path/to/store/the/output_file
- Now one can access the NTuples in their local machine and run the Analysis Codes.
- Docker-Desktop should be up and running on the system.
- Docker container image containing CMSSW_5_3_32 should be installed.
- The NTupleMaker files shall be placed in the directory
./CMSSW_5_3_32/src/
For more information on how to set up the Docker-Desktop visit (https://opendata.cern.ch/docs/cms-guide-docker)
- Open the terminal and run
docker start -i [name_of_container]
- Git Clone this repository in the directory
/code/CMSSW_5_3_32/src/
. Navigate to director/code/CMSSW_5_3_32/src/CMS-OpenData-analysis/NtupleMaker/
- Compile the code by doing:
scram b -j 8
- Open the
./python
directory to find the python exectuable configuration file,masterntuplemaker_cfg.py
. This file is going to give the output root file. - To execute the configuration file and get the output NTuple do:
For 7TeV:
cmsRun masterntuplemaker_cfg.py isData=True is7TeV=True nEvents=1000
For 8TeV:
cmsRun masterntuplemaker_cfg.py isData=True is8TeV=True nEvents=1000
cmsRun masterntuplemaker_cfg.py isData=False nEvents=1000
- That's it.
The output NTuples should be available in the
./output_files
directory.
- Open another terminal on your local machine.
- Do the following:
docker cp CMSSW_5_3_32:/code/CMSSW_5_3_32/CMS-OpenData-analysis/NtupleMaker/ouput_files/CMS_Data_AOD.root /home/username_localmachine/desired/path/to/store/the/output_file
docker cp CMSSW_5_3_32:/code/CMSSW_5_3_32/CMS-OpenData-analysis/NtupleMaker/ouput_files/CMS_MC_AODSIM.root /home/username_localmachine/desired/path/to/store/the/output_file
- Now one can access the NTuples in their local machine and run the Analysis Codes.