Skip to content

Instantly share code, notes, and snippets.

View artlbv's full-sized avatar

Artur Lobanov artlbv

  • Uni Hamburg / CMS
  • Hamburg
View GitHub Profile
@artlbv
artlbv / .gitconfig
Last active August 29, 2015 14:07
Config of Git
[user]
name = Artur Lobanov
email = [email protected]
github = artlbv
[core]
autocrlf = input
safecrlf = true
editor = emacs
[color]
@artlbv
artlbv / .gitignore
Created October 21, 2014 11:10 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.d
@artlbv
artlbv / gist:15d3c236e930b0b9e4aa
Created February 13, 2015 15:48
ZS simpleAna
std::string zshist = "HO_ZS";
zshist += std::to_string(ZSthr);
float TSsum = 0;
// search within first 3 2TS pairs
for (int sample=0; sample < it->size()-1; ++sample) {
// for (int sample=0; sample < 6; ++sample) {
TSsum = it->sample(sample).nominal_fC();
@artlbv
artlbv / matchIsr.py
Created July 21, 2016 11:28
ISR jet counting
def countISR(jets, genParts):
nISR = 0
for jet in jets:
matched = False
for genPart in genParts: #use GenPart
if matched: break
@artlbv
artlbv / replacePDFtext.sh
Last active July 28, 2023 04:46
Batch replace text in PDF
#!/bin/bash
#!-----------------------------------
#! Replace "oldtext" with "newtext"
#! inside all pdf files in the directory.
@artlbv
artlbv / relval_samples_hgcal_930.txt
Created October 3, 2017 09:46
RelVal Samples for HGCAL 930
# Backgrounds
/RelValQCD_Pt-15To7000_Flat_14TeV/CMSSW_9_3_0-93X_upgrade2023_realistic_v2_2023D17noPU-v1/GEN-SIM-RECO
## Electrons
# SM
[320.7, 321.5, 322.7, 323.4, 324.7, 325.4, 326.6, 327.4, 328.6, 329.4, 330.7, 331.6, 332.9, 333.7, 335.0, 335.9, 337.2, 338.1, 339.4, 340.3, 341.7, 342.8, 344.2, 345.3, 346.8, 347.8, 349.3]
1 320.7
2 321.5
3 322.7
4 323.4
5 324.7
6 325.4
7 326.6
8 327.4
@artlbv
artlbv / read_L1uGT_algoblock.py
Last active April 20, 2023 12:41
Read L1 uGT algo block bits and names
# method to read L1 bits
# only unprescaled ones are considered for the total L1 decision
def read_L1_bits_alias(fnames, prescale_file_name = None, use_prescale_file=True, L1bitTree = "l1uGTTree/L1uGTTree"):
L1bittrees = []
for filepath in fnames:
file = uproot.open(filepath)
L1bittrees.append( file[L1bitTree] )
# we need to make sure to apply prescales properly!
@artlbv
artlbv / ph2L1Menu_gmtTkMuOnly_cfg.py
Last active June 13, 2023 10:14
cmsRun config to run in 125x producing NANO output with the gmtTkMuon collection
import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
from PhysicsTools.NanoAOD.common_cff import Var, ExtVar, P3Vars
process = cms.Process("RESP", eras.Phase2C9)
process.load('Configuration.StandardSequences.Services_cff')
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.options = cms.untracked.PSet(
wantSummary = cms.untracked.bool(True),
@artlbv
artlbv / Ph2L1Menu_nano_cfg.py
Created June 13, 2023 12:34
cmsRun config for 125x to dump some PhL1 collection as in menu ntuple
import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
from PhysicsTools.NanoAOD.nano_eras_cff import *
from PhysicsTools.NanoAOD.common_cff import *
process = cms.Process("L1Ph2Nano", eras.Phase2C9)
process.load('Configuration.StandardSequences.Services_cff')
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.options = cms.untracked.PSet(