Skip to content

Instantly share code, notes, and snippets.

View ram1123's full-sized avatar
πŸ’­
I may be slow to respond.

Ram krishna Sharma ram1123

πŸ’­
I may be slow to respond.
View GitHub Profile
@ram1123
ram1123 / plot_all_variations.py
Last active October 9, 2026 14:14
Nominal / Up / Down m_gg plot for EVERY systematic variation in the flashggFinalFit signal input.
#!/usr/bin/env python3
"""Nominal / Up / Down m_gg plot for EVERY systematic variation in the flashggFinalFit signal input.
Two kinds of variation exist in the input workspace (tagsDumper/cms_hgg_13TeV):
* dataset : separate RooDataHist '<base>_<name>{Up,Down}01sigma' (event-level: energy scales, JES, ...)
* weight : columns '<name>_{Up,Down}01sigma' in the nominal RooDataSet holding varied/central weight
ratios (scale factors); varied weight = weight * column.
For each variation, year and category one plot is made: upper pad m_gg (nominal black, Up red,
Down blue dashed), lower pad Up/nominal and Down/nominal. The text box gives the yield ratios,
the mean and RMS shifts (115-135 GeV) and, if found, the value of the matching datacard nuisance.
@ram1123
ram1123 / manage_dask.py
Last active September 25, 2026 17:03
This script provisions, monitors, and cleans up Dask Gateway clusters on Kubernetes/Slurm backends. It handles proxy paths, environment variable setup, and provides commands for lifecycle management.
"""
===============================================================================
Dask Gateway Cluster Management Script
===============================================================================
This script provisions, monitors, and cleans up Dask Gateway clusters on
Kubernetes/Slurm backends. It handles proxy paths, environment variable setup,
and provides commands for lifecycle management.
PRE-REQUISITES & ENVIRONMENT SETUP
@ram1123
ram1123 / pdf_unc_shape.C
Last active September 11, 2026 18:04
pdf shape uncertainty
#include <TCanvas.h>
#include <TFile.h>
#include <TH1D.h>
#include <TLegend.h>
#include <TLine.h>
#include <TLorentzVector.h>
#include <TPad.h>
#include <TROOT.h>
#include <TStyle.h>
#include <TTreeReader.h>
@ram1123
ram1123 / pdf_unc.C
Last active September 11, 2026 18:10
Get the pdf uncertainty as number (not shape)
#include <TFile.h>
#include <TTreeReader.h>
#include <TTreeReaderArray.h>
#include <TTreeReaderValue.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <memory>
@ram1123
ram1123 / Issue.md
Last active August 12, 2026 12:58
Possible issue in coffea as per Claude

sometime I get following error with same sample same code sometime I don't. What do you think the issue is?

INFO     [resume] attempt 1 for zz_4l[1] using root://eos.cms.rcac.purdue.edu/                                                                                                                                                                                         run_stage1.py:435
INFO     rm command executed for: /work/projects/hmm/shar1172/hmm_ntuples/copperheadV1clean/Run3_nanoAODv12_FilterJets_July08_tightPassLepVeto_DefaultjetPt25GeV_JVMFilterJets/stage1_output/2022postEE/f1_0/zz_4l/1                                                   run_stage1.py:449
Preprocessing 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 94/94 [ 0:00:02 < 0:00:00 | 41.1 file/s ]
WARNING  [resume] attempt 1 failed for zz_4l[1] (AttributeError
@ram1123
ram1123 / awakward_copy.py
Created May 31, 2026 16:19
awakward_copy.py
import awkward as ak
events = ak.Array([
{"Muon": [{"pt": 10.0}, {"pt": 20.0}]},
{"Muon": [{"pt": 30.0}]},
])
print("Original pt:")
print(events.Muon.pt)
@ram1123
ram1123 / Run2_Run3_DAS_lists.txt
Last active March 6, 2026 20:09
List of all datasets from Run-2 and Run-3 (2022, 2023, and 2024)
/Muon/Run2022C-16Dec2023-v1/NANOAOD
/SingleMuon/Run2022C-16Dec2023-v1/NANOAOD
/Muon/Run2022D-16Dec2023-v1/NANOAOD
/DYto2L-2Jets_MLL-50_0J_TuneCP5_13p6TeV_amcatnloFXFX-pythia8/Run3Summer22NanoAODv12-130X_mcRun3_2022_realistic_v5-v2/NANOAODSIM
/DYto2L-2Jets_MLL-50_1J_TuneCP5_13p6TeV_amcatnloFXFX-pythia8/Run3Summer22NanoAODv12-130X_mcRun3_2022_realistic_v5-v2/NANOAODSIM
/DYto2L-2Jets_MLL-50_2J_TuneCP5_13p6TeV_amcatnloFXFX-pythia8/Run3Summer22NanoAODv12-130X_mcRun3_2022_realistic_v5-v2/NANOAODSIM
/DYto2Mu-2Jets_MLL-105To160_TuneCP5_13p6TeV_amcatnloFXFX-pythia8/Run3Summer22NanoAODv12-130X_mcRun3_2022_realistic_v5-
@ram1123
ram1123 / FileReadIssue.md
Last active December 2, 2025 16:47
Log of file Read Issue

File information

From dasgoclient

adler32 = b866399c

(/depot/cms/users/yun79/conda_envs/yun_coffea_latest) [shar1172@purdue-af-182 copperheadV2_main]$ dasgoclient --query="file=/store/mc/RunIII2024Summer24NanoAODv15/TTtoLNu2Q_TuneCP5_13p6TeV_powheg-pythia8/NANOAODSIM/150X_mcRun3_2024_realistic_v2-v2/2520000/004eb958-f042-48a7-b7a3-2f1cd5185215.root" --json
[
{"das":{"expire":1764689399,"instance":"prod/global","primary_key":"file.name","record":1,"services":["dbs3:files"]},"file":[{"adler32":"b866399c","auto_cross_section":0,"block.name":"/TTtoLNu2Q_TuneCP5_13p6TeV_powheg-pythia8/RunIII2024Summer24NanoAODv15-150X_mcRun3_2024_realistic_v2-v2/NANOAODSIM#c405159c-915d-4680-bcc7-ef75513c7895","block_id":40603398,"block_name":"/TTtoLNu2Q_TuneCP5_13p6TeV_powheg-pythia8/RunIII2024Summer24NanoAODv15-150X_mcRun3_2024_realistic_v2-v2/NANOAODSIM#c405159c-915d-4680-bcc7-ef75513c7895","branch_hash_id":null,"check_sum":"699935532","create_by":"WMAgent","created_by":"WMAgent","creation_date":1745031136,"crea
@ram1123
ram1123 / DaskGatewayLogs.md
Last active December 1, 2025 16:05
Log while running the dask gateway