GithubHelp home page GithubHelp logo

ubparker / nanoaodjmartools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cms-jet/nanoaodjmartools

0.0 1.0 1.0 5.27 MB

Tools for using the NANOAOD postprocessing framework.

C++ 24.27% Python 75.73%

nanoaodjmartools's Introduction

NanoAODJMARTools

Tools for using the NANOAOD postprocessing framework for JMAR.

Obtaining JMAR NANOAOD

You should first follow the directions outlined in the NanoAODJMAR repository. This repository assumes the NANOAOD files follow that structure.

JMAR NANOAOD Analysis : With CMSSW

First, set up a new fastjet and fastjet-contrib. You need at least fastjet-3.3.0. This is in /cvmfs/cms.cern.ch/slc6_amd64_gcc630/external/fastjet/3.3.0/ and /cvmfs/cms.cern.ch/slc6_amd64_gcc630/external/fastjet-contrib/1.033/.

Now make a CMSSW working area and get this code:

cmsrel CMSSW_9_4_4
cd CMSSW_9_4_4/src
cmsenv
git clone https://github.com/cms-jet/NanoAODJMARTools.git PhysicsTools/NanoAODJMARTools

You can then use the following XML files to go into $CMSSW_BASE/config/toolbox/$SCRAM_ARCH/tools/selected/

cp $CMSSW_BASE/src/PhysicsTools/NanoAODJMARTools/xmlfiles/* $CMSSW_BASE/config/toolbox/$SCRAM_ARCH/tools/selected/
scram setup fastjet
scram setup fastjet-contrib

Add fastjet to your python path:

setenv PYTHONPATH /uscms_data/d2/rappocc/fastjet/bare/install_330/lib/python2.7/site-packages:$PYTHONPATH

(or export in bash)

Compile and run:

scram b -j 10
cd PhysicsTools/NanoAODJMARTools/test
python postproc_softdrop.py

If you just want the library for the SoftDrop python interface, do this in python (after scram above):

import fastjet
import ROOT

ROOT.gSystem.Load("libPhysicsToolsNanoAODJMARTools.so")
beta=0.0
zcut=0.1
R=0.8
ptmin=200.
sd = ROOT.SoftDropWrapper(beta,zcut, R, ptmin)

#### IN YOUR EVENT LOOP:
        pfCandsVec = ROOT.vector("TLorentzVector")()
        for p in pfCands :
            pfCandsVec.push_back( ROOT.TLorentzVector( p.p4().Px(), p.p4().Py(), p.p4().Pz(), p.p4().E()) )
        sdjets = self.sd.result( pfCandsVec )

JMAR NANOAOD Analysis : Without CMSSW

Coming soon.

Technical details

This assumes you have fastjet 3.3.0, which implements the python front-end to fastjet. The fastjet-contrib packages do not yet have a python implementation, so this is implemented here and here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.