Skip to content

Instantly share code, notes, and snippets.

@brynmathias
brynmathias / L1JetMET.cfg
Created July 19, 2011 14:39
L1JetMET_cfg.py
import FWCore.ParameterSet.Config as cms
from UserCode.L1TriggerDPG.l1Ntuple_cfg import *
# global tag
process.GlobalTag.globaltag = cms.string('GR_R_42_V14::All')
# load standard RECO for MET cleaning
process.load('Configuration.StandardSequences.Reconstruction_cff')
@brynmathias
brynmathias / l1RecoJet.cc
Created July 19, 2011 14:44
l1RecoJet.cc Snippet
void L1Analysis::L1AnalysisRecoJet::SetCaloJet(const edm::Event& event,
const edm::EventSetup& setup,
edm::Handle<reco::CaloJetCollection> caloJets,
edm::Handle<edm::ValueMap<reco::JetID> > jetsID,
const JetCorrector* caloJetCorrector,
unsigned maxJet)
{
recoJet_.nJets=0;
@brynmathias
brynmathias / l1RecoTreeProducer_cfg.py
Created July 19, 2011 14:46
l1RecoTreeProducer_cfg.py
import FWCore.ParameterSet.Config as cms
l1RecoTreeProducer = cms.EDAnalyzer("L1RecoTreeProducer",
jetTag = cms.untracked.InputTag("ak5CaloJets"),
jetIdTag = cms.untracked.InputTag("ak5JetID"),
metTag = cms.untracked.InputTag("met"),
ebRecHitsTag = cms.untracked.InputTag("ecalRecHit:EcalRecHitsEB"),
eeRecHitsTag = cms.untracked.InputTag("ecalRecHit:EcalRecHitsEE"),
superClustersBarrelTag = cms.untracked.InputTag("hybridSuperClusters"),
@brynmathias
brynmathias / PdfPlottingOps.cc
Created August 20, 2011 18:15
Fill PDF plots
#include "AlphaT.hh"
#include "CommonOps.hh"
#include "EventData.hh"
#include "GenMatrixBin.hh"
#include "Jet.hh"
#include "KinSuite.hh"
#include "Lepton.hh"
#include "Math/VectorUtil.h"
#include "Photon.hh"
#include "TH1D.h"
@brynmathias
brynmathias / L1Ntuple.h
Created August 26, 2011 15:03
L1Ntuple.h
//////////////////////////////////////
// Example root macro for l1 ntuples
//////////////////////////////////////
#ifndef L1Ntuple_h
#define L1Ntuple_h
#include <vector>
#include <string>
#include <iostream>
@brynmathias
brynmathias / l1Ntuple_cfi.py
Created September 2, 2011 09:46
l1Ntuple_cfi.py
import FWCore.ParameterSet.Config as cms
# make L1 ntuples from RAW+RECO
process = cms.Process("L1NTUPLE")
# import of standard configurations
process.load('Configuration/StandardSequences/Services_cff')
process.load('FWCore/MessageService/MessageLogger_cfi')
#process.load('Configuration/StandardSequences/GeometryIdeal_cff')
@brynmathias
brynmathias / EffCombination.py
Created December 8, 2011 16:05
How to calculate the errors for combinations of eff histograms
asymErrorCumu = r.TGraphAsymmErrors()
asymErrorCumu.Divide(cumuNomTotal,cumuDenomTotal)
for bin in range(CumuNomList[0].GetNbinsX()):
binLumi = 0
BinEff = 0.
point = bin + 1
errPlus = 0.
errMinus = 0.
yval = 0.
@brynmathias
brynmathias / setup.sh
Created January 25, 2012 10:47
setup.sh
#!/bin/bash
pwd=$PWD
# prompt analysis directory
export CAF_TRIGGER=/vols/cms03/bm409/
export L1CMSSW=CMSSW_4_2_5
# 64bit architecture
export SCRAM_ARCH=slc5_amd64_gcc434
@brynmathias
brynmathias / hltAlphaTFilter.c
Created February 3, 2012 21:30
HLTAlphaT Filter
/** \class HLTAlphaTFilter
*
*
* \author Bryn Mathias
*
*/
#include "HLTrigger/JetMET/interface/HLTAlphaTFilter.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
@brynmathias
brynmathias / alphaTFilter.hh
Created February 3, 2012 21:40
AlphaTFilter header
#ifndef HLTAlphaTFilter_h
#define HLTAlphaTFilter_h
/** \class HLTAlphaTFilter
*
* \author Bryn Mathias
*
*/
#include "HLTrigger/HLTcore/interface/HLTFilter.h"