cms-dpoa / cms-dpoa-getting-started

https://cms-dpoa.github.io/cms-dpoa-getting-started/intro.html
2 stars 2 forks source link

Andro - get familiar with POET #85

Open katilp opened 3 years ago

katilp commented 3 years ago

Based on what you learned in #83, have a look at the code in https://github.com/cms-legacydata-analyses/PhysObjectExtractorTool

There's an update of the code structure in modular branch. Git functionalities are a bit limited on the container, so it is best to clone it in your local area and then pass the code to the container in a mounted volume as instructed in the tutorial #84

For cloning, it is best to use ssh key. You can find a link to the instructions in https://cms-dpoa.github.io/cms-dpoa-getting-started/computing/basic/git.html

To get to the modular branch, in Linux bash of your local machine

git clone git@github.com:cms-legacydata-analyses/PhysObjectExtractorTool.git
cd PhysObjectExtractorTool/
git checkout modular

Then build a container passing this directory as instructed under "Mounting a local volume" in https://cms-opendata-workshop.github.io/workshop2021-lesson-docker/03-docker-for-cms-opendata/index.html

i.e.

docker run -it --name my_od -P -p 5901:5901 -p 6080:6080 -v ${PWD}:/home/cmsusr/PhysObjectExtractorTool cmsopendata/cmssw_5_3_32_vnc:latest /bin/bash

(if you already have a container with the name my_od, remove it or choose another name)

Then, compile the code in the container (this needs to be done at the src directory level, not as in step 4 the README instructions)

 ~/CMSSW_5_3_32/src $ ln -s ~/PhysObjectExtractorTool/
 ~/CMSSW_5_3_32/src $ scram b

In the configuration file PhysObjectExtractorTool/PhysObjectExtractor/python/poet_cfg.py, comment the current input file and uncomment the one from eospublic.

Then run the code with

cmsRun PhysObjectExtractorTool/PhysObjectExtractor/python/poet_cfg.py Look at the resulting root file with ROOT. To get the ROOT graphical window in the container, use start_vnc as instructed in the CMS Open Data container instructions.