The analysis codes are kept in the directory ./AnalysisCodes. 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
TTreeReadermethod in theAnaOpenData.hfile needs to be modified accordingly. Otherwise it leads to "Segmentation error" during runtime.
The AOD2FunAOD maker codes can be found in the ./AOD2FunAOD 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 AOD2FunAOD 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
./pythondirectory 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_filesdirectory.
The miniAOD2FunAOD maker codes can be found in the ./miniAOD2FunAOD directory.
- Open the CMS Shell Terminal and locate the miniAOD2FunAOD 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
./pythondirectory to find the python exectuable configuration file,miniNtupleMaker_config.py. This file is going to give the output root file. - To execute the configuration file and get the output NTuple do:
cmsRun miniNtuplemaker_config.py isData=True nEvents=1000
cmsRun miniNtuplemaker_config.py isData=False nEvents=1000
- That's it.
The output NTuples should be available in the./output_filesdirectory.
- Open the Outer Shell Terminal (not the CMS Terminal) and locate the
./output_filesdirectory. - Now use the secure copy command
scpto 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 (For Run 1) or CMSSW_7_6_7 (For Run 2) should be installed.
- The AOD2FunAOD files shall be placed in the directory
./CMSSW_5_3_32/src/and the miniAOD2FunAOD files shall be placed in the directory./CMSSW_7_6_7/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/AOD2FunAOD/
- Git Clone this repository in the directory
/code/CMSSW_7_6_7/src/. Navigate to director/code/CMSSW_7_6_7/src/CMS-OpenData-analysis/miniAOD2FunAOD/ - Compile the code by doing:
scram b -j 8
- Open the
./pythondirectory to find the python exectuable configuration file,masterntuplemaker_cfg.py(for Run 1) orminiNtupleMaker_config.py(for Run 2). 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 miniNtuplemaker_config.py isData=True nEvents=1000
Run 1:
cmsRun masterntuplemaker_cfg.py isData=False nEvents=1000
Run 2:
cmsRun miniNtuplemaker_config.py isData=False nEvents=1000
- That's it.
The output NTuples should be available in the
./output_filesdirectory.
- Open another terminal on your local machine.
- Do the following:
For Run 1:
docker cp CMSSW_5_3_32:/code/CMSSW_5_3_32/CMS-OpenData-analysis/AOD2FunAOD/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/AOD2FunAOD/ouput_files/CMS_MC_AODSIM.root /home/username_localmachine/desired/path/to/store/the/output_file
For Run 2:
docker cp CMSSW_7_6_7:/code/CMSSW_7_6_7/CMS-OpenData-analysis/miniAOD2FunAOD/ouput_files/CMS_Data_AOD.root /home/username_localmachine/desired/path/to/store/the/output_file
docker cp CMSSW_7_6_7:/code/CMSSW_7_6_7/CMS-OpenData-analysis/miniAOD2FunAOD/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.