Skip to content

Instantly share code, notes, and snippets.

@veprbl
veprbl / calo_thresh.py
Created September 4, 2023 19:42
Read EICrecon exported parameters JSON and calculate effective thresholds
#!/usr/bin/env python3
import json
expected_threshold = {
"HcalBarrelRawHits": 5000, # cHCAL (per layer) Barrel 7680 (scint tiles) 5 MeV (deposited in scintillator)
"EcalEndcapPInsertRawHits": "???",
"HcalEndcapPInsertRawHits": 250, # fHCAL insert Forward 9000 250 keV (0.5 MIP, with 1 MIP MPV=15 p.e at +2V and 1e5 gain)
"EcalBarrelImagingRawHits": 15, # AstroPix Barrel 510M pixels (3.54E+05 chips) 15 keV
"EcalEndcapNRawHits": 5000, # EEMC Backward 3000 5000 keV
____ _ ___ ___ _
`MM' dM. `MM\ `M' dM.
MM ,MMb MMM\ M ,MMb
MM d'YM. M\MM\ M d'YM. ____
MM ,P `Mb M \MM\ M ,P `Mb 6MMMMb
MM d' YM. M \MM\ M d' YM. MM' `Mb
MM ,P `Mb M \MM\ M ,P `Mb ,MM
MM d' YM. M \MM\M d' YM. ,MM'
(8) MM ,MMMMMMMMb M \MMM ,MMMMMMMMb ,M'
(( ,M9 d' YM. M \MM d' YM. ,M'
____ _ ___ ___ _
`MM' dM. `MM\ `M' dM.
MM ,MMb MMM\ M ,MMb
MM d'YM. M\MM\ M d'YM. ____
MM ,P `Mb M \MM\ M ,P `Mb 6MMMMb
MM d' YM. M \MM\ M d' YM. MM' `Mb
MM ,P `Mb M \MM\ M ,P `Mb ,MM
MM d' YM. M \MM\M d' YM. ,MM'
(8) MM ,MMMMMMMMb M \MMM ,MMMMMMMMb ,M'
curl https://lhapdf.hepforge.org/downloads/?f=LHAPDF-6.5.1.tar.gz -o LHAPDF-6.5.1.tar.gz
tar zxf LHAPDF-6.5.1.tar.gz
cd LHAPDF-6.5.1
CFLAGS="-Wl,-rpath -Wl,$HOME/.local/lib/" ./configure --prefix=$HOME/.local
make && make install
export PYTHONPATH=$PYTHONPATH:$HOME/.local/lib/python2.7/site-packages/ # you might want to add this to your ~/.profile
python -c 'import lhapdf; print(lhapdf.version())'
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/xflnpkcjxq99r6bghyrx8sw7kqipcgcy-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
patching script interpreter paths in genversion.sh
genversion.sh: interpreter directive changed from "#!/bin/bash" to "/nix/store/vssrny41k0mr33jclrrn67rxhbdpwrr0-bash-5.1-p12/bin/bash"
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/8v5mdkz708wcarf093rwnla7cv24va2j-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/d7szffid9hbn7cnhrxk32ghdh6kdzsq0-LaTeXML-0.8.6.tar.gz
source root is LaTeXML-0.8.6
setting SOURCE_DATE_EPOCH to timestamp 1633018764 of file LaTeXML-0.8.6/META.yml
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
patching ./bin/latexmlc...
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pip-build-hook
Using pipBuildPhase
Using pipShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pip-build-hook
Using pipBuildPhase
Using pipShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
@veprbl
veprbl / -
Created January 27, 2021 14:37
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/s52ccphmplinc0q43jwr0s096q35jfmk-llvm-7.1.0.src.tar.xz
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/mkj2k7z4f9jvbzpcqmf9ap0y19fgpg44-da1fb72bb305d6bc1f3899d541414146934bf80f.patch
patching file lib/Bitcode/Reader/MetadataLoader.cpp
Hunk #1 succeeded at 1308 (offset -5 lines).
patching file test/Assembler/debug-variant-discriminator.ll
applying patch /nix/store/i8g7bvajyym2n9skmhgal804d18q1a6p-cc1f2a595ead516812a6c50398f0f3480ebe031f.patch