Skip to content

Instantly share code, notes, and snippets.

import matplotlib.pyplot as plt
# Existing Data
data = [
[2012, 0.31, 420.0, 400.0, 996.0],
[2015, 0.25, 992.5, 98.8, 1057.1],
[2016, 0.91, 1005.8, 514.5, 4467.8],
[2017, 1.01, 976.0, 409.7, 4635.0],
[2018, 1.18, 1046.4, 2918.7, 4855.6],
[2022, 1.45, 1776.7, 2438.3, 22296.7],
#!/usr/bin/env python3
import os
import argparse
import json
import fnmatch
import statistics
from omsapi import OMSAPI
def getOMSAPI_krb():
@missirol
missirol / rerun_hlt_on_error_stream.sh
Last active July 27, 2023 07:27
rerun_hlt_on_error_stream.sh (230727)
#!/bin/bash
# defaults
showHelpMsg=false
runNumKeyword=-1
numThreadsDefault=32
numThreads="${numThreadsDefault}"
numStreamsDefault=0
numStreams="${numStreamsDefault}"
errDirPathDefault=/store/error_stream
@missirol
missirol / rerun_hlt_on_error_stream.sh
Created July 7, 2023 07:36
Script to (re)run an HLT menu on streamer files
#!/bin/bash
# defaults
showHelpMsg=false
runNumKeyword=-1
numThreadsDefault=32
numThreads="${numThreadsDefault}"
errDirPathDefault=/store/error_stream
errDirPath="${errDirPathDefault}"
outDirPathDefault=tmp
diff --git a/AODAnalyzer/plugins/AODAnalyzer.cc b/AODAnalyzer/plugins/AODAnalyzer.cc
index 9b1bec2..c07da1b 100644
--- a/AODAnalyzer/plugins/AODAnalyzer.cc
+++ b/AODAnalyzer/plugins/AODAnalyzer.cc
@@ -72,7 +72,9 @@ AODAnalyzer::AODAnalyzer(const edm::ParameterSet& iConfig):
//gtSource_L1GT_(consumes<L1GlobalTriggerReadoutRecord>(iConfig.getParameter<edm::InputTag> ("gtSource"))),
bRegressionWeightfileName_( iConfig.getUntrackedParameter<std::string>("bRegressionWeightfile")),
y_mean_(iConfig.getUntrackedParameter<double>("y_mean")),
- y_std_(iConfig.getUntrackedParameter<double>("y_std")),
+ y_std_(iConfig.getUntrackedParameter<double>("y_std")),
@missirol
missirol / testRun3ScoutingCollections.py
Created March 13, 2023 14:38
Test to consume Run3Scouting collections
# DataFormats/Scouting/test/testRun3ScoutingCollections.py
import FWCore.ParameterSet.Config as cms
## CLI parser
import argparse
import sys
parser = argparse.ArgumentParser(
prog = 'cmsRun '+sys.argv[0]+' --',
#!/usr/bin/env python3
import FWCore.ParameterSet.Config as cms
import os
import sys
import json
def getESModuleDict(process):
ret1 = {key:val.dumpPython() for key,val in process.es_producers_().items()}
ret2 = {key:val.dumpPython() for key,val in process.es_sources_().items()}
ret1.update(ret2)
#include <charconv>
#include <exception>
#include <iostream>
#include <regex>
#include <string>
// Pre PR
bool isNumber(const std::string &str) {
static const std::regex re("^[+-]?(\\d+\\.?|\\d*\\.\\d*)$");
return std::regex_match(str.c_str(), re);
import FWCore.ParameterSet.Config as cms
## VarParsing
import FWCore.ParameterSet.VarParsing as VarParsing
options = VarParsing.VarParsing('analysis')
options.register('logLevel', 'DEBUG', options.multiplicity.singleton, options.varType.string, 'value of process.MessageLogger.cerr.threshold')
options.register('globalTag', '124X_dataRun3_HLT_v7', options.multiplicity.singleton, options.varType.string, 'name of GlobalTag')
options.setDefault('inputFiles', [
'/store/data/Run2022F/Muon/AOD/PromptReco-v1/000/361/957/00000/1cb14e07-d436-4150-8891-a62c1e53e8fe.root',
])
import FWCore.ParameterSet.Config as cms
import sys
enableGPU = (sys.argv[-1] == 'enableGPU')
class SwitchProducerTest(cms.SwitchProducer):
def __init__(self, **kargs):
super(SwitchProducerTest,self).__init__(
dict(
cpu = lambda accelerators: (True, -10),
gpu = lambda accelerators: (enableGPU, -9)