diff --git a/B_tasks.ipynb b/B_tasks.ipynb index b0a4b16..ca5066e 100644 --- a/B_tasks.ipynb +++ b/B_tasks.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -21,9 +21,20 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 23, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "9056" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "file = uproot.open(\"tracking_losses_ntuple_Bd2KstEE.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\")\n", "#file = uproot.open(\"tracking_losses_ntuple_Dst0ToD0EE.root:PrDebugTrackingLosses.PrDebugTrackingTool/Tuple;1\")\n", @@ -34,13 +45,13 @@ "found = allcolumns[(allcolumns.isElectron) & (~allcolumns.lost) & (allcolumns.fromSignal) & (allcolumns.p > 5e3)] #B: 9056\n", "lost = allcolumns[(allcolumns.isElectron) & (allcolumns.lost) & (allcolumns.fromSignal) & (allcolumns.p > 5e3)] #B: 1466\n", "\n", - "#ak.num(found, axis=0)\n", + "ak.num(found, axis=0)\n", "#ak.count(found, axis=None)\n" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -49,20 +60,125 @@ "0.8606728758791105" ] }, - "execution_count": 3, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "def t_eff(found, lost):\n", - " sel = found[\"energy\"]\n", - " des = lost[\"energy\"]\n", - " return ak.count(sel,axis=None)/(ak.count(sel,axis=None)+ak.count(des,axis=None))\n", + "def t_eff(found, lost, axis = 0):\n", + " sel = ak.num(found, axis=axis)\n", + " des = ak.num(lost, axis=axis)\n", + " return sel/(sel + des)\n", "\n", "t_eff(found, lost)" ] }, + { + "cell_type": "code", + "execution_count": 104, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sample size: 32\n", + "eff (cutoff = 0 ) = 0.96875\n", + "sample size: 32\n", + "eff (cutoff = 50 ) = 0.96875\n", + "sample size: 32\n", + "eff (cutoff = 100 ) = 0.96875\n", + "sample size: 43\n", + "eff (cutoff = 150 ) = 0.9767441860465116\n", + "sample size: 65\n", + "eff (cutoff = 200 ) = 0.9692307692307692\n", + "sample size: 97\n", + "eff (cutoff = 250 ) = 0.9587628865979382\n", + "sample size: 129\n", + "eff (cutoff = 300 ) = 0.9457364341085271\n", + "sample size: 150\n", + "eff (cutoff = 350 ) = 0.9533333333333334\n", + "sample size: 169\n", + "eff (cutoff = 400 ) = 0.9408284023668639\n", + "sample size: 197\n", + "eff (cutoff = 450 ) = 0.9390862944162437\n", + "sample size: 227\n", + "eff (cutoff = 500 ) = 0.920704845814978\n", + "sample size: 257\n", + "eff (cutoff = 550 ) = 0.9260700389105059\n", + "sample size: 297\n", + "eff (cutoff = 600 ) = 0.9326599326599326\n", + "sample size: 334\n", + "eff (cutoff = 650 ) = 0.9281437125748503\n", + "sample size: 366\n", + "eff (cutoff = 700 ) = 0.9289617486338798\n", + "sample size: 400\n", + "eff (cutoff = 750 ) = 0.925\n", + "sample size: 436\n", + "eff (cutoff = 800 ) = 0.9151376146788991\n", + "sample size: 468\n", + "eff (cutoff = 850 ) = 0.9102564102564102\n", + "sample size: 500\n", + "eff (cutoff = 900 ) = 0.912\n", + "sample size: 533\n", + "eff (cutoff = 950 ) = 0.9136960600375235\n", + "sample size: 562\n", + "eff (cutoff = 1000 ) = 0.9163701067615658\n", + "\n", + "sample size: 150\n" + ] + }, + { + "data": { + "text/plain": [ + "0.9533333333333334" + ] + }, + "execution_count": 104, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "#finden wir die elektronen die keine bremsstrahlung gemacht haben mit hoher effizienz?\n", + "#von energie der photonen abmachen\n", + "#scan ab welcher energie der photonen die effizienz abfällt\n", + "\n", + "#abhängigkeit vom ort der emission untersuchen <- noch nicht gemacht\n", + "\n", + "\n", + "\n", + "#idea: we make an event cut st all events that contain a photon of energy > cutoff_energy are not included\n", + "\"\"\"\n", + "ph_e = found[\"brem_photons_pe\"]\n", + "event_cut = ak.all(ph_e