Skip to content

NTrevisani/AnalysisCMS

 
 

Repository files navigation

  1. Analysis documentation ====

AnalysisCMS is a framework that produces Physics distributions based on latino trees. It should be fully synchronized with the common latinos framework.

https://twiki.cern.ch/twiki/bin/view/CMS/LatinosFrameworkTutorials
https://github.com/latinos/LatinoTrees
https://github.com/latinos/LatinoAnalysis
https://github.com/latinos/PlotsConfigurations
  1. Everything begins here ====

Log in to gridui or lxplus.

ssh -Y gridui.ifca.es -o ServerAliveInterval=240
ssh -Y lxplus.cern.ch -o ServerAliveInterval=240

bash -l

Execute this line only in gridui.

source /cvmfs/cms.cern.ch/cmsset_default.sh

Set a CMSSW release.

export SCRAM_ARCH=slc6_amd64_gcc530
cmsrel CMSSW_8_0_5
cd CMSSW_8_0_5/src
cmsenv

Go to the master repository (https://github.com/piedraj/AnalysisCMS) and click Fork in the top-right corner of the page. Then get the code in your working area.

git clone https://github.com/YOUR_USERNAME/AnalysisCMS
git clone https://github.com/scodella/BTagSFUtil

Create an empty Git repository or reinitialize an existing one.

git init

You should also add a remote upstream, to be able to modify both your and the master repository.

git remote add upstream https://github.com/piedraj/AnalysisCMS

Then, do a git remote in order to check if the upstream appears.

git remote -v

Do this only if you want to create a tag.

pushd AnalysisCMS
git tag -a 20160919_tau -m 'Third AnalysisCMS tag'
git push origin 20160919_tau
popd

Do this only if you want to use a tag.

pushd AnalysisCMS
git checkout tags/20160919_tau
popd
  1. Always do ====

    ssh -Y gridui.ifca.es -o ServerAliveInterval=240 source /cvmfs/cms.cern.ch/cmsset_default.sh cd CMSSW_8_0_5/src cmsenv cd AnalysisCMS

  2. Compile and run ====

    ./make

It is recommended to first test the code.

./runAnalysis

Submit jobs to the gridui batch system. It is encouraged to first read the Basic Grid Engine Usage documentation.

rm -rf minitrees/<systematic>
rm -rf rootfiles/<systematic>
rm -rf txt/<systematic>

./submit-jobs.sh

Show the status of the submitted jobs.

qstat -u $USER
qstat -j <job-ID.ja-task-ID>

Alternatively one can login to a node and run interactively. Do this only if your jobs will take less than 2 hours.

qlogin -P l.gaes
cd CMSSW_8_0_5/src
source /cvmfs/cms.cern.ch/cmsset_default.sh
cmsenv
cd AnalysisCMS

./runAnalysis

exit
  1. Draw ====

First hadd the files produced in the previous step.

cd test
./submit-hadd.sh

Then compile and draw your favorite distributions.

./make
./runPlotter
  1. Create your website ====

Follow the instructions at Permissions for your AFS folder.

ssh -Y lxplus.cern.ch
mkdir www
fs setacl www webserver:afs read
afind www -t d -e "fs setacl -dir {} -acl webserver:afs read"
cd www
wget https://raw.githubusercontent.com/piedraj/AnalysisCMS/master/test/.htaccess

Go to the CERN Web Services and click on Create a new website. Choose the "AFS folder" site type.

  1. Share on the web ====

Create a soft link to your figures folder.

cd figures
export FIGURES_DIR=`pwd`
cd
ln -s $FIGURES_DIR

Copy the distributions to lxplus.

ssh -Y lxplus.cern.ch
scp -r piedra@gridui.ifca.es:figures www/.

And they should appear here,

https://amanjong.web.cern.ch/amanjong/
https://bchazinq.web.cern.ch/bchazinq/
https://cprieels.web.cern.ch/cprieels/
https://fernanpe.web.cern.ch/fernanpe/
https://jgarciaf.web.cern.ch/jgarciaf/
https://ntrevisa.web.cern.ch/ntrevisa/
https://piedra.web.cern.ch/piedra/
https://rocio.web.cern.ch/rocio/
  1. It is commit time ====

This framework is intended to be used and developed by several people. If you want your changes to be shared by others, you should first get the latest modifications from the upstream repository, if any.

git pull https://github.com/piedraj/AnalysisCMS
git fetch upstream

Now you can commit any change (both from upstream/master and master) in your repository.

git status
git add <filepattern>
git commit -m 'Modified'
git push

If there isn't any conflict left you should be able to merge with the upstream/master repository.

git merge upstream/master

Finally, go to your repository and click Pull Request.

https://github.com/YOUR_USERNAME/AnalysisCMS
  1. Edit a CMS Analysis Note ====

The following instructions have been extracted from the CMS TWiki. The note number used below corresponds to the IFCA/Oviedo WZ analysis at 13 TeV.

ssh -Y lxplus.cern.ch -o ServerAliveInterval=240
svn co -N svn+ssh://svn.cern.ch/reps/tdr2 svn
cd svn
svn update utils
svn update -N notes
svn update notes/AN-16-010
eval `notes/tdr runtime -sh`
cd notes/AN-16-010/trunk
tdr --style=an b AN-16-010

Get the latest modifications from the note repository. Always do this first.

svn update

If you want to add new files.

svn add file1 file2 ... fileN

If you want to know which files you have added and/or modified.

svn status

Commit your changes.

svn commit -m 'Modified'

A detailed example of a CMS Note written in LaTeX using the cms-tdr document class can be found in the svn-instructions.pdf file.

  1. EOS ====

To access files at eos/cms.

eosmount  eoscms
eosumount eoscms
rmdir eoscms

To access files at eos/user.

/afs/cern.ch/project/eos/installation/0.3.84-aquamarine.user/bin/eos.select -b fuse mount  eosuser
/afs/cern.ch/project/eos/installation/0.3.84-aquamarine.user/bin/eos.select -b fuse umount eosuser
rmdir eosuser

Check the eos quota.

eos quota /eos/cms/store/group/phys_higgs

group      logi bytes  aval logib  filled[%]
zh         171.07 TB   250.00 TB   68.43
  1. Copy latino trees from cernbox to gridui ====

First of all add your lxplus pub key in ipa.

cat $HOME/.ssh/id_rsa.pub

Then log in to lxplus, mount eos and choose the input folder.

ssh -Y lxplus.cern.ch -o ServerAliveInterval=240
bash -l
cd eos/user/j/jlauwers/HWW2015
rsync --chmod=Du=rwx,Dg=rwx,Fu=rw,Fg=rw -azH 21Jun2016_Run2016B_PromptReco/l2loose__hadd__EpTCorr__l2tight $USER@pool03.ifca.es:

Check that the input folder has be copied at the following gridui path.

/gpfs/csic_projects/tier3data/LatinosSkims/RunII/cernbox/
  1. brilcalc ====

Log in to lxplus.

ssh -Y piedra@lxplus.cern.ch -o ServerAliveInterval=240

bash -l

Go to the Prerequisite section of the BRIL Work Suite and export the PATH that corresponds to the centrally installed virtual environment on lxplus.

export PATH=$HOME/.local/bin:/afs/cern.ch/cms/lumi/brilconda-1.0.3/bin:$PATH

Do this the first time. Do it also if you want to update the brilcalc version.

pip uninstall brilws

pip install --install-option="--prefix=$HOME/.local" brilws

Check your brilcalc version.

brilcalc --version
2.0.5

Get the 2016 luminosity. Based on the PdmV TWiki one should use the following.

brilcalc lumi -b "STABLE BEAMS" \
              --normtag /afs/cern.ch/user/l/lumipro/public/normtag_file/normtag_DATACERT.json \
              -u /fb \
              -i /afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions16/13TeV/Cert_271036-275125_13TeV_PromptReco_Collisions16_JSON.txt \
              --hltpath "HLT_Mu8_TrkIsoVVL_v*"

Get the 2015 luminosity.

brilcalc lumi --normtag /afs/cern.ch/user/l/lumipro/public/normtag_file/moriond16_normtag.json -u /fb -i /afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions15/13TeV/Reprocessing/Cert_13TeV_16Dec2015ReReco_Collisions15_25ns_JSON_v2.txt

+-------+------+-------+-------+-------------------+------------------+
| nfill | nrun | nls   | ncms  | totdelivered(/fb) | totrecorded(/fb) |
+-------+------+-------+-------+-------------------+------------------+
| 47    | 115  | 33208 | 33208 | 2.398             | 2.318            |
+-------+------+-------+-------+-------------------+------------------+

About

IFCA code for CMS analyses

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 70.4%
  • C++ 26.6%
  • Objective-C 1.5%
  • Shell 0.8%
  • PHP 0.5%
  • Makefile 0.2%