#ifndef L2EM2B_LHOOD_L2LIKELIHOOD_HPP_ #define L2EM2B_LHOOD_L2LIKELIHOOD_HPP_ //////////////////////////////////////////////////////////////////////////////////////////////// // This file was generated from the ROOT script create_L2LikelihoodHPP.cc // That script takes the PDFs used for the L2EM likelihood calculation // (ROOT histograms) and creates the code below along with a function for // calculating the L2EM Likelihood. // // Author: generated by create_L2LikelihoodHPP.cc (Joe Haley) // // File: L2Likelihood.hpp // // Purpose: Contains the function L2EM_Likelihood(...) which returns the // the likelihood for L2EM object given the four quantities: // - float emf1 = EM fraction (EM/TOT) of seed TT // - float emf9 = EM fraction of 3x3 grid of 9 TTs // - float iso19 = EM isolation fraction of seed TT w.r.t. 9 TTs // - float nsratio = Neighbor/seed EM ratio (EM of neighbor/EM seed) // // Details: To geneate the 2-D "likelihood ratio" arrays: // - Start with: // + two signal (electron) 2-D ROOT histograms: (emf1 vs. emf9) and (iso19 vs. nsratio). // + two background (enhanced bias) 2-D ROOT histograms of the same variables. // - To avoid dividing by zero, 0.1 is added to each bin for all four 2-D // histograms (bins with zero now have 0.1). // - The histograms are then normalized to 1 -> making binned PDFs // - The signal PDF is divided by the background PDF bin-by-bin -> giving // the likelihood ratio for each bin. // - The likelihood ratio for each bin is stored in the arrays below and // used to calculate the final likelihood. //////////////////////////////////////////////////////////////////////////////////////////////// ////// DO NOT EDIT THIS FILE. IT IS GENERATED BY create_L2LikelihoodHPP.cc ////// //Made From: // Signal PDF file: "PDFs_MC5+bsZ15.root" with emf & iso histograms: "emfPDF" & "isoPDF" // Background PDF file: "PDFs_ebias10.root" with emf & iso histograms: "emfPDF" & "isoPDF" #include using namespace std; namespace l2em2b_lhood{ // GLOBAL QUANTITIES USED FOR LIKELIHOOD CALCULATION //number of bins for each variable static const int n_emf1=11, n_emf9=21, n_iso19=40, n_nsratio=31; //array of the lower bin edge for each variable static const float LowEdge_emf1 [n_emf1] = { 0, 0.5, 0.7, 0.8, 0.9, 0.95, 0.97, 0.98, 0.99, 0.995, 0.999999 }; static const float LowEdge_emf9 [n_emf9] = { 0, 0.4, 0.6, 0.7, 0.8, 0.825, 0.85, 0.875, 0.89, 0.9, 0.91, 0.92, 0.93, 0.94, 0.95, 0.9575, 0.965, 0.9725, 0.98, 0.9875, 0.995 }; static const float LowEdge_iso19 [n_iso19] = { 0, 0.3, 0.4, 0.45, 0.475, 0.5, 0.52, 0.54, 0.56, 0.58, 0.6, 0.62, 0.64, 0.66, 0.68, 0.7, 0.72, 0.74, 0.76, 0.78, 0.8, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.9, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99 }; static const float LowEdge_nsratio[n_nsratio] = { 0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95 }; //2-D array of emf1 vs. emf9 Likelihood Ratio static const float LR_emf1_emf9[n_emf1][n_emf9] = { { 1.41502e-05, 0.000536604, 0.000184393, 0.000561456, 0.00369088, 0.225144, 0.0072627, 0.0204676, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144}, { 7.03354e-05, 0.00125149, 0.00805766, 0.00738027, 0.00101875, 0.00124389, 0.00247411, 0.00441458, 0.0107211, 0.0204676, 0.225144, 0.0204676, 0.225144, 0.0204676, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144}, { 0.000192266, 0.00124389, 0.00347354, 0.0174043, 0.00684228, 0.000723935, 0.000801223, 0.00202832, 0.0072627, 0.0072627, 0.00549131, 0.0107211, 0.0107211, 0.0204676, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144, 0.225144}, { 0.000184393, 0.00115571, 0.00970753, 0.0277252, 0.0521617, 0.0530383, 0.0697436, 0.104294, 0.0704058, 0.177993, 0.103444, 0.122024, 0.00222915, 0.0107211, 0.00369088, 0.0107211, 0.0204676, 0.225144, 0.225144, 0.225144, 0.225144}, { 0.000214219, 0.00595158, 0.0315563, 0.100522, 0.154992, 0.201107, 0.210678, 0.309686, 0.324556, 0.479967, 0.458517, 0.535564, 0.504519, 0.607858, 1.2393, 1.18368, 0.530894, 0.297771, 0.117932, 0.225144, 0.225144}, { 0.000249882, 0.0060538, 0.0432292, 0.188004, 0.365685, 0.431739, 0.456215, 0.556408, 0.719939, 0.914069, 1.07101, 1.12555, 1.32751, 1.50883, 2.07359, 1.70038, 4.04776, 3.68032, 0.871596, 0.0204676, 0.225144}, { 0.000303838, 0.000416162, 0.0133963, 0.0468997, 0.134647, 0.137946, 0.206393, 0.325317, 0.425025, 0.54003, 0.779505, 1.13637, 1.20234, 1.92591, 2.27741, 2.587, 3.77039, 4.80263, 7.40005, 1.83331, 0.225144}, { 0.000307994, 0.00369088, 0.000830789, 0.026037, 0.056812, 0.183566, 0.488099, 0.703546, 1.75592, 2.05799, 2.17494, 2.08939, 5.27147, 5.5854, 9.72914, 13.5255, 24.9967, 19.4719, 44.9586, 36.6508, 2.47658}, { 0.00202832, 0.000623667, 0.00222915, 0.0204676, 0.0485604, 0.0348814, 0.133622, 0.151326, 0.225144, 1.03054, 2.33133, 3.15307, 6.15516, 15.1611, 26.8214, 26.6519, 78.0813, 302.532, 358.886, 151.429, 23.5582}, { 0.225144, 0.00222915, 0.0204676, 0.0072627, 0.0204676, 0.0107211, 0.0107211, 0.225144, 0.225144, 0.0072627, 0.225144, 0.117932, 0.634496, 36.9986, 45.2539, 13.188, 21.5797, 532.315, 924.065, 865.528, 306.421}, { 2.57572e-05, 0.00105096, 0.0184678, 0.117529, 0.233291, 0.243221, 0.326684, 0.420515, 0.399005, 0.579599, 0.657793, 0.877062, 1.24297, 1.43075, 2.60456, 3.13358, 5.60921, 8.24398, 6.65776, 39.0818, 3.71918} }; //2-D array of iso19 vs. nsratio Likelihood Ratio static const float LR_iso19_nsratio[n_iso19][n_nsratio] = { { 0.000174838, 0.00186542, 0.00370026, 0.0107484, 0.00550527, 0.00278662, 0.0107484, 0.0031791, 0.00223481, 0.00370026, 0.00102134, 0.000749887, 0.000977126, 0.000643066, 0.000643066, 0.00022326, 0.000218929, 0.000242445, 0.000214763, 0.000208803, 0.000180428, 0.000157733, 0.000165846, 0.000114519, 0.00112807, 0.00105162, 8.17516e-05, 0.00229341, 0.00211972, 0.00289967, 0.00181023}, { 0.000425077, 0.00442581, 0.00223481, 0.00728116, 0.00442581, 0.0107484, 0.00728116, 0.00550527, 0.00728116, 0.00728116, 0.0031791, 0.00124705, 0.00186542, 0.00442581, 0.0024804, 0.000500479, 0.000592431, 0.000511828, 0.000450531, 0.000262156, 0.000232457, 0.000161111, 0.00403558, 0.0168712, 0.0407214, 0.0210159, 0.0271201, 0.0206716, 0.0278102, 0.0329302, 0.0302606}, { 0.00370026, 0.0107484, 0.225716, 0.00728116, 0.0205196, 0.00728116, 0.225716, 0.00728116, 0.0205196, 0.00728116, 0.00728116, 0.00442581, 2.48288, 0.00370026, 0.0107484, 0.00203348, 0.000479227, 0.0107484, 0.00420114, 0.00438486, 0.0361897, 0.0540161, 0.0465568, 0.0568896, 0.0624727, 0.0567975, 0.0642345, 0.105465, 0.117677, 0.191631, 0.17558}, { 0.0107484, 0.0107484, 0.225716, 0.0205196, 0.225716, 0.0205196, 0.225716, 0.00728116, 0.225716, 0.00728116, 0.00728116, 0.0107484, 0.0205196, 0.0107484, 0.00550527, 0.00106974, 0.000562883, 0.000523703, 0.000363472, 0.0392774, 0.0554096, 0.0739742, 0.0637084, 0.0779144, 0.127482, 0.138172, 0.164022, 0.251973, 0.367998, 0.559085, 1.15965}, { 0.00370026, 0.0205196, 0.225716, 0.0107484, 0.0205196, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.0205196, 0.00728116, 0.00728116, 0.0205196, 0.00550527, 0.00916191, 0.000536143, 0.00485886, 0.0142224, 0.0565981, 0.0696836, 0.0831809, 0.0754003, 0.151366, 0.13092, 0.203613, 0.371553, 0.563707, 0.914977, 1.01421, 3.47166}, { 0.0031791, 0.225716, 0.225716, 0.225716, 0.0205196, 0.0205196, 0.225716, 0.0205196, 0.225716, 0.0205196, 0.0107484, 0.225716, 0.00278662, 0.0777055, 0.0031791, 0.000681922, 0.00041722, 0.0423934, 0.0852586, 0.0818248, 0.0858063, 0.104049, 0.16268, 0.229801, 0.273314, 0.410056, 0.781265, 1.09287, 2.48887, 1.8364, 0.548666}, { 0.00728116, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.0205196, 0.225716, 0.225716, 0.0205196, 0.225716, 0.00442581, 0.0107484, 0.0306528, 0.00203348, 0.000523703, 0.00591765, 0.0612097, 0.093072, 0.106005, 0.116969, 0.186538, 0.294843, 0.382502, 0.512687, 0.97341, 1.53644, 2.56756, 1.41304, 0.31301, 0.225716}, { 0.0107484, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.0800928, 0.00203348, 0.00203348, 0.0176091, 0.00223481, 0.013016, 0.0154122, 0.110629, 0.127725, 0.136103, 0.200034, 0.248659, 0.388849, 0.704193, 1.04501, 2.04257, 2.42397, 0.586349, 0.841305, 0.225716, 0.225716}, { 0.00728116, 0.0205196, 0.225716, 0.225716, 0.225716, 0.0205196, 0.225716, 0.0205196, 0.0107484, 0.0205196, 0.0349701, 0.00278662, 0.00370026, 0.0145197, 0.0348119, 0.0195199, 0.0773305, 0.201554, 0.18089, 0.266462, 0.241822, 0.445131, 0.904314, 1.57338, 4.44655, 1.86233, 0.756813, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.00728116, 0.0107484, 0.225716, 0.225716, 0.0205196, 0.0107484, 0.225716, 0.0107484, 0.0107484, 0.225716, 0.0349701, 0.0031791, 0.0154216, 0.00102134, 0.0261881, 0.0170306, 0.108897, 0.178359, 0.215597, 0.298178, 0.526194, 0.852526, 1.17883, 2.69943, 1.26893, 0.358735, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.00442581, 0.225716, 0.225716, 0.225716, 0.225716, 2.48288, 0.225716, 0.060558, 0.0800928, 0.0107484, 0.0189533, 0.00124705, 0.0329337, 0.022095, 0.0166204, 0.0374981, 0.169638, 0.260662, 0.383016, 0.464976, 0.871846, 1.53144, 2.16854, 1.9071, 1.00277, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.0107484, 0.225716, 0.225716, 0.225716, 0.0205196, 0.225716, 0.0205196, 0.225716, 0.0107484, 0.00728116, 0.0154216, 0.0211396, 0.000549187, 0.0178373, 0.0153983, 0.114879, 0.267822, 0.40639, 0.613309, 1.07276, 1.64489, 2.15153, 2.25206, 0.511835, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.0205196, 0.225716, 2.48288, 0.0205196, 0.225716, 0.225716, 0.00728116, 0.0107484, 0.118232, 0.0107484, 0.0438595, 0.0280086, 0.0839137, 0.0315517, 0.0792447, 0.223661, 0.354507, 0.540316, 1.1482, 1.68566, 2.38859, 3.49355, 1.38182, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.0205196, 0.225716, 0.225716, 0.225716, 4.74004, 0.0929419, 0.118232, 0.060558, 0.0667611, 0.0245829, 0.0598767, 0.0272474, 0.0610969, 0.0888371, 0.184634, 0.295743, 0.43816, 0.941637, 1.89256, 2.73197, 3.81433, 0.9887, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.00442581, 0.225716, 0.0107484, 0.0205196, 0.225716, 0.0349701, 0.00728116, 0.0349701, 0.0715001, 0.0916273, 0.0843674, 0.0402351, 0.0644248, 0.210261, 0.284689, 0.465169, 0.936725, 1.84689, 2.51323, 3.91585, 1.47616, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.225716, 0.225716, 0.0205196, 4.74004, 0.00728116, 0.298528, 0.0800928, 0.031391, 0.0434609, 0.0548553, 0.0809906, 0.0895957, 0.25486, 0.418906, 0.449032, 0.683211, 1.0939, 3.22607, 4.89301, 2.11469, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.0205196, 0.0205196, 0.118232, 0.225716, 1.0465, 0.193925, 0.262719, 0.0986897, 0.236413, 0.130587, 0.138133, 0.163769, 0.45191, 0.64752, 0.950365, 1.12989, 2.67946, 4.39493, 2.8801, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 2.48288, 0.225716, 0.118232, 0.0205196, 0.18102, 0.103707, 0.0973467, 0.0832375, 0.127171, 0.170969, 0.274968, 0.564321, 0.916536, 0.777845, 1.70594, 1.8828, 2.80357, 4.01489, 6.9972, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.225716, 0.0205196, 0.0107484, 0.763135, 0.337774, 0.300539, 0.17142, 0.149248, 0.337617, 0.355966, 0.647075, 0.718177, 1.35311, 1.36311, 2.12473, 3.1295, 7.06914, 4.35467, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.225716, 2.48288, 0.0486839, 1.08559, 0.671575, 0.478593, 0.263254, 0.303024, 0.524947, 0.704861, 1.15607, 1.52825, 2.37558, 2.84145, 3.85405, 7.24966, 3.96631, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.0205196, 0.225716, 0.00442581, 0.735398, 0.534148, 0.550205, 0.621394, 0.602744, 1.03529, 1.38752, 1.67746, 2.37207, 4.61828, 4.56411, 6.70782, 4.98106, 8.84397, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.0205196, 0.225716, 0.269974, 2.37539, 0.267284, 0.384587, 0.598783, 0.829627, 1.20807, 2.02327, 2.05034, 3.39592, 3.36638, 5.18228, 7.28332, 11.0247, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.225716, 0.430912, 0.402748, 0.96335, 0.423854, 0.808324, 1.1328, 1.01814, 1.79791, 1.81298, 2.34597, 3.21982, 6.89149, 5.07621, 5.27746, 2.43313, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.430912, 2.48288, 0.390874, 92.0169, 0.697693, 1.09187, 1.13358, 1.76096, 2.97294, 1.78404, 2.7441, 4.01071, 5.41768, 5.91704, 14.4494, 2.77412, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.225716, 0.225716, 0.72119, 2.11406, 0.955795, 0.647104, 1.58977, 2.58791, 1.73216, 3.59497, 3.06913, 5.60682, 8.06138, 12.1354, 4.90993, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.152904, 0.225716, 0.649596, 2.23915, 1.2426, 1.81567, 2.05272, 2.46836, 6.46097, 3.83811, 6.1399, 10.7509, 6.57553, 7.71288, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.841305, 11.5115, 0.771403, 1.36321, 1.30029, 2.43955, 2.33925, 3.03518, 2.61418, 6.41892, 4.87833, 11.5694, 8.82266, 1.82757, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 1.45689, 0.249987, 1.07415, 4.19441, 1.6028, 10.6907, 3.83982, 4.84101, 6.30959, 7.10894, 10.6223, 13.6654, 2.49521, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 20.5402, 2.68807, 1.26259, 4.00467, 4.39954, 2.97172, 6.26354, 4.26942, 4.2125, 25.7098, 6.03209, 6.66417, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 0.978103, 1.41497, 1.79435, 3.54608, 2.80879, 6.37509, 5.44559, 7.63472, 12.4218, 10.8329, 21.3411, 82.2359, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 4.32964, 3.18672, 4.71724, 7.80233, 5.86368, 6.15545, 8.0655, 7.71757, 8.61772, 440.372, 5.30619, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 5.15043, 3.00376, 6.82034, 7.75442, 6.34366, 19.7878, 14.951, 19.8979, 499.811, 14.3061, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 8.63877, 6.9866, 11.0479, 16.6443, 11.3255, 9.13381, 14.1031, 25.771, 11.4872, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 2.77649, 28.5595, 8.97002, 26.4792, 9.67894, 13.0535, 7.81573, 4.563, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 205.627, 25.1702, 31.2012, 33.1158, 16.659, 13.1343, 17.4622, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 23.2631, 29.3276, 10.927, 44.4985, 19.3321, 4.27234, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 28.0824, 40.8546, 24.1041, 83.7765, 37.6399, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 17.6488, 242.172, 8.43812, 141.674, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 24.5358, 28.0516, 5.56524, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716}, { 4.07237, 13.7687, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716, 0.225716} }; // GLOBAL FUNCTION FOR FINDING L2EM LIKELIHOOD static float L2EM_Likelihood(float emf1, float emf9, float iso19, float nsratio){ float tmp_emfLR = 0.0; //use to store likelihood ratio for emf1 vs. emf9 float tmp_isoLR = 0.0; //use to store likelihood ratio for iso19 vs. nsratio //Finding the Likelihood ratio for the given emf1, emf9, iso19, and nsratio //The order of each iteration is chosen for speed on "typical" enhanced bias L2EM objects for(int i=1; i0; l--){ //iterate through nsratio bins (high to low) if(nsratio >= LowEdge_nsratio[l]){ //nsratio in bin l tmp_isoLR = LR_iso19_nsratio[k-1][l]; //get likelihood ratio for this iso19 & nsratio goto found_isoLR; //done searching } } //the program gets here iff nsratio is in the lowest bin (0) tmp_isoLR = LR_iso19_nsratio[k-1][0]; //get likelihood ratio for this iso19 & nsratio goto found_isoLR; //done searching } } //the program gets here iff iso19 is in the highest bin (n_iso19-1) for(int l=n_nsratio-1; l>0; l--){ //iterate through nsratio bins (high to low) if(nsratio >= LowEdge_nsratio[l]){ //nsratio in bin l tmp_isoLR = LR_iso19_nsratio[n_iso19-1][l]; //get likelihood ratio for this iso19 & nsratio goto found_isoLR; //done searching } } //the program gets here iff iso19 is in the highest bin and nsratio is in the lowest bin (n_iso19-1 and 0) tmp_isoLR = LR_iso19_nsratio[n_iso19-1][0]; //get likelihood ratio for this iso19 & nsratio found_isoLR: float total_LR = tmp_emfLR * tmp_isoLR; //set the total likelihood ratio //return the likelihood = LR/(LR+1) return ( total_LR / (total_LR + 1.0) ); } // GLOBAL FUNCTIONS FOR DEBUGGING LIKELIHOOD CALCULATION static void dump_L2EM_Likelihood_Binning(){ cout<<"LowEdge_emf1["<