File indexing completed on 2024-04-06 12:23:29
0001 #include "PhysicsTools/Heppy/interface/RochCor2012.h"
0002 #include <TLorentzVector.h>
0003
0004 namespace heppy {
0005
0006 const double RochCor2012::pi = 3.14159265358979323846;
0007
0008 const float RochCor2012::genm_smr =
0009 9.09915e+01;
0010 const float RochCor2012::genm = 91.06;
0011
0012 const float RochCor2012::mrecm = 90.8177;
0013 const float RochCor2012::drecm = 90.5332;
0014 const float RochCor2012::mgscl_stat = 0.0001;
0015 const float RochCor2012::mgscl_syst = 0.0006;
0016 const float RochCor2012::dgscl_stat = 0.0001;
0017 const float RochCor2012::dgscl_syst = 0.0008;
0018
0019
0020 const float RochCor2012::delta = -5.48477e-06;
0021 const float RochCor2012::delta_stat = 4.38582e-07;
0022 const float RochCor2012::delta_syst = 6.992e-07;
0023
0024 const float RochCor2012::sf = 33.4956;
0025 const float RochCor2012::sf_stat = 0.312614;
0026 const float RochCor2012::sf_syst = 9.29;
0027
0028 const float RochCor2012::apar = 1.0;
0029 const float RochCor2012::bpar = -5.03313e-06;
0030 const float RochCor2012::cpar = -4.41463e-05;
0031 const float RochCor2012::d0par = -0.000148871;
0032 const float RochCor2012::e0par = 1.59501;
0033 const float RochCor2012::d1par = 7.95495e-05;
0034 const float RochCor2012::e1par = -0.364823;
0035 const float RochCor2012::d2par = 0.000152032;
0036 const float RochCor2012::e2par = 0.410195;
0037
0038 const float RochCor2012::netabin[9] = {-2.4, -2.1, -1.4, -0.7, 0.0, 0.7, 1.4, 2.1, 2.4};
0039
0040 const float RochCor2012::dcor_bf[8][8] = {
0041 {0.000107019, 0.000110872, 0.000104914, 0.000088356, 0.000098934, 0.000097173, 0.000076036, 0.000038352},
0042 {0.000027861, 0.000082929, 0.000079044, 0.000090323, 0.000096823, 0.000077726, 0.000089548, 0.000094251},
0043 {0.000096623, 0.000080357, 0.000116928, 0.000064621, 0.000089653, 0.000104048, 0.000075808, 0.000104033},
0044 {0.000056079, 0.000074857, 0.000091264, 0.000094404, 0.000089990, 0.000076868, 0.000063443, 0.000058654},
0045 {0.000020316, 0.000039838, 0.000085370, 0.000099329, 0.000089701, 0.000080920, 0.000061223, 0.000036706},
0046 {0.000079484, 0.000058457, 0.000115420, 0.000113329, 0.000085512, 0.000123082, 0.000063315, 0.000046771},
0047 {-0.000014849, 0.000063752, 0.000076973, 0.000115789, 0.000099257, 0.000090677, 0.000079501, 0.000033056},
0048 {0.000013455, 0.000084340, 0.000099403, 0.000102317, 0.000104791, 0.000125368, 0.000116473, 0.000060607}};
0049 const float RochCor2012::dcor_ma[8][8] = {
0050 {0.000100487, 0.000017322, -0.000130583, -0.000151975, -0.000160698, -0.000163992, 0.000058854, 0.000537338},
0051 {0.000797318, 0.000133807, -0.000012265, -0.000039851, -0.000014145, -0.000020469, -0.000038474, -0.000089369},
0052 {0.000127640, 0.000079630, 0.000096678, 0.000101597, 0.000103066, 0.000051955, -0.000052329, -0.000232106},
0053 {-0.000822448, -0.000093050, 0.000224437, 0.000199975, 0.000208382, 0.000161882, 0.000008895, -0.000055717},
0054 {-0.000659872, -0.000009989, 0.000204988, 0.000187290, 0.000147524, 0.000176117, 0.000146629, -0.000072046},
0055 {-0.000232191, 0.000003074, 0.000063732, 0.000058353, 0.000024090, 0.000055329, 0.000196989, 0.000152461},
0056 {0.000150637, -0.000069255, -0.000120556, -0.000129774, -0.000181534, -0.000185724, -0.000138647, 0.000415873},
0057 {-0.000069055, -0.000059101, -0.000171624, -0.000183451, -0.000229660, -0.000318313, -0.000075301, 0.000616515}};
0058 const float RochCor2012::mcor_bf[8][8] = {
0059 {0.000051096, 0.000053354, 0.000088067, 0.000069625, 0.000111574, 0.000054434, 0.000049471, 0.000029711},
0060 {-0.000011598, 0.000000375, 0.000060415, 0.000029346, 0.000033469, 0.000016833, 0.000015773, 0.000072907},
0061 {-0.000092219, 0.000008603, 0.000056443, 0.000072303, 0.000068745, 0.000029366, 0.000000943, 0.000025621},
0062 {-0.000046305, 0.000026115, 0.000040818, 0.000041803, 0.000029672, 0.000028866, -0.000037959, 0.000082943},
0063 {-0.000008281, 0.000014787, 0.000049244, 0.000048117, 0.000030259, 0.000017593, -0.000052198, 0.000045353},
0064 {0.000055014, 0.000010201, 0.000047900, 0.000049045, 0.000057969, 0.000055183, 0.000046076, 0.000138166},
0065 {-0.000013461, 0.000002464, 0.000078624, 0.000083703, 0.000082662, 0.000059725, 0.000023476, 0.000066592},
0066 {0.000015052, 0.000014736, 0.000068918, 0.000076644, 0.000089550, 0.000082794, 0.000028474, 0.000108749}};
0067 const float RochCor2012::mcor_ma[8][8] = {
0068 {0.000385236, 0.000085244, -0.000048248, -0.000046507, -0.000039849, -0.000074739, -0.000027738, 0.000147033},
0069 {0.000117999, -0.000031813, -0.000046653, -0.000014969, -0.000052586, -0.000031938, 0.000064566, 0.000151759},
0070 {-0.000049906, -0.000028434, 0.000014103, -0.000003392, 0.000000074, 0.000017360, 0.000041907, 0.000002294},
0071 {0.000203101, 0.000176454, 0.000070179, 0.000045394, 0.000059526, 0.000098039, 0.000121830, 0.000117598},
0072 {0.000226645, 0.000158641, 0.000060774, 0.000062295, 0.000058320, 0.000068351, 0.000102766, 0.000224776},
0073 {-0.000416113, -0.000065963, 0.000036343, 0.000031159, 0.000037239, 0.000038536, 0.000012286, 0.000196513},
0074 {-0.000465413, -0.000067328, -0.000001936, 0.000020537, -0.000037656, -0.000004558, 0.000001761, -0.000050296},
0075 {0.000273417, 0.000001643, -0.000056352, -0.000055155, -0.000073923, -0.000052147, -0.000106017, -0.000373331}};
0076
0077 const float RochCor2012::dcor_bfer[8][8] = {
0078 {0.000060607, 0.000033327, 0.000028317, 0.000026616, 0.000026635, 0.000028568, 0.000033216, 0.000059162},
0079 {0.000058346, 0.000032683, 0.000028301, 0.000026814, 0.000026649, 0.000028376, 0.000032958, 0.000058995},
0080 {0.000059405, 0.000033098, 0.000028297, 0.000026759, 0.000026544, 0.000028262, 0.000032849, 0.000059237},
0081 {0.000058096, 0.000032952, 0.000028116, 0.000026624, 0.000026511, 0.000028165, 0.000032528, 0.000058668},
0082 {0.000059777, 0.000033148, 0.000028356, 0.000026645, 0.000026687, 0.000028264, 0.000033157, 0.000059752},
0083 {0.000058886, 0.000032805, 0.000028226, 0.000026821, 0.000026998, 0.000028379, 0.000032977, 0.000057995},
0084 {0.000058887, 0.000033128, 0.000028232, 0.000026494, 0.000026707, 0.000028133, 0.000032632, 0.000058308},
0085 {0.000058322, 0.000033103, 0.000028333, 0.000026601, 0.000026502, 0.000028277, 0.000032777, 0.000058169}};
0086 const float RochCor2012::dcor_maer[8][8] = {
0087 {0.000060607, 0.000033327, 0.000028317, 0.000026616, 0.000026635, 0.000028568, 0.000033216, 0.000059162},
0088 {0.000058346, 0.000032683, 0.000028301, 0.000026814, 0.000026649, 0.000028376, 0.000032958, 0.000058995},
0089 {0.000059405, 0.000033098, 0.000028297, 0.000026759, 0.000026544, 0.000028262, 0.000032849, 0.000059237},
0090 {0.000058096, 0.000032952, 0.000028116, 0.000026624, 0.000026511, 0.000028165, 0.000032528, 0.000058668},
0091 {0.000059777, 0.000033148, 0.000028356, 0.000026645, 0.000026687, 0.000028264, 0.000033157, 0.000059752},
0092 {0.000058886, 0.000032805, 0.000028226, 0.000026821, 0.000026998, 0.000028379, 0.000032977, 0.000057995},
0093 {0.000058887, 0.000033128, 0.000028232, 0.000026494, 0.000026707, 0.000028133, 0.000032632, 0.000058308},
0094 {0.000058322, 0.000033103, 0.000028333, 0.000026601, 0.000026502, 0.000028277, 0.000032777, 0.000058169}};
0095 const float RochCor2012::mcor_bfer[8][8] = {
0096 {0.000057442, 0.000032512, 0.000028476, 0.000026441, 0.000026600, 0.000028609, 0.000033152, 0.000058520},
0097 {0.000059126, 0.000033023, 0.000028420, 0.000026487, 0.000026433, 0.000028348, 0.000033027, 0.000058155},
0098 {0.000058834, 0.000033739, 0.000028770, 0.000026521, 0.000026452, 0.000028520, 0.000033074, 0.000058708},
0099 {0.000057004, 0.000033420, 0.000028307, 0.000026526, 0.000026567, 0.000028409, 0.000032725, 0.000059488},
0100 {0.000059638, 0.000032488, 0.000028209, 0.000026119, 0.000026508, 0.000028089, 0.000033404, 0.000059850},
0101 {0.000058238, 0.000033400, 0.000028385, 0.000026755, 0.000026870, 0.000028312, 0.000032999, 0.000056991},
0102 {0.000059148, 0.000034134, 0.000028568, 0.000026543, 0.000026583, 0.000027788, 0.000032530, 0.000059904},
0103 {0.000060323, 0.000033258, 0.000028902, 0.000026263, 0.000026405, 0.000028263, 0.000032459, 0.000059398}};
0104 const float RochCor2012::mcor_maer[8][8] = {
0105 {0.000057442, 0.000032512, 0.000028476, 0.000026441, 0.000026600, 0.000028609, 0.000033152, 0.000058520},
0106 {0.000059126, 0.000033023, 0.000028420, 0.000026487, 0.000026433, 0.000028348, 0.000033027, 0.000058155},
0107 {0.000058834, 0.000033739, 0.000028770, 0.000026521, 0.000026452, 0.000028520, 0.000033074, 0.000058708},
0108 {0.000057004, 0.000033420, 0.000028307, 0.000026526, 0.000026567, 0.000028409, 0.000032725, 0.000059488},
0109 {0.000059638, 0.000032488, 0.000028209, 0.000026119, 0.000026508, 0.000028089, 0.000033404, 0.000059850},
0110 {0.000058238, 0.000033400, 0.000028385, 0.000026755, 0.000026870, 0.000028312, 0.000032999, 0.000056991},
0111 {0.000059148, 0.000034134, 0.000028568, 0.000026543, 0.000026583, 0.000027788, 0.000032530, 0.000059904},
0112 {0.000060323, 0.000033258, 0.000028902, 0.000026263, 0.000026405, 0.000028263, 0.000032459, 0.000059398}};
0113
0114
0115
0116 const float RochCor2012::dmavg[8][8] = {
0117 {0.025806983, 0.025159891, 0.024975842, 0.025455723, 0.025425207, 0.024926903, 0.025207309, 0.026048885},
0118 {0.025750965, 0.025097309, 0.024989121, 0.025452482, 0.025527396, 0.024992650, 0.025032483, 0.025745209},
0119 {0.025804636, 0.025158395, 0.025016371, 0.025488043, 0.025484602, 0.025030160, 0.025056485, 0.025666000},
0120 {0.025856440, 0.025213197, 0.025026234, 0.025434566, 0.025508311, 0.025036940, 0.025187392, 0.025890424},
0121 {0.025876249, 0.025281013, 0.024931971, 0.025371491, 0.025499941, 0.025069176, 0.025232100, 0.025805794},
0122 {0.025650327, 0.025166171, 0.025005627, 0.025408096, 0.025460445, 0.025019452, 0.025223815, 0.025741512},
0123 {0.025876350, 0.025175626, 0.024978362, 0.025447193, 0.025421566, 0.024991240, 0.025167436, 0.025891024},
0124 {0.025871826, 0.025199998, 0.024895251, 0.025438601, 0.025413080, 0.024985093, 0.025161586, 0.025951909}};
0125 const float RochCor2012::dpavg[8][8] = {
0126 {0.025863485, 0.025162835, 0.025030071, 0.025502551, 0.025451110, 0.024937023, 0.025201191, 0.025910362},
0127 {0.025625774, 0.024974553, 0.025011365, 0.025516130, 0.025527164, 0.024980470, 0.025081821, 0.025774996},
0128 {0.025843368, 0.025180360, 0.024976660, 0.025487988, 0.025465345, 0.025063817, 0.025222588, 0.025848188},
0129 {0.026043606, 0.025279730, 0.024916318, 0.025446864, 0.025459185, 0.024968978, 0.025218397, 0.026001596},
0130 {0.026105632, 0.025315669, 0.024938580, 0.025393917, 0.025404370, 0.024991038, 0.025172806, 0.025925590},
0131 {0.025834291, 0.025225312, 0.024968093, 0.025365828, 0.025470435, 0.024970995, 0.025149210, 0.025854499},
0132 {0.025907967, 0.025225916, 0.025005253, 0.025466169, 0.025463152, 0.024998250, 0.025108125, 0.025770905},
0133 {0.025902320, 0.025180646, 0.024998309, 0.025482915, 0.025518436, 0.025018455, 0.025214326, 0.025771985}};
0134 const float RochCor2012::mmavg[8][8] = {
0135 {0.026128584, 0.025420381, 0.025425881, 0.025276864, 0.025621923, 0.024943013, 0.024997684, 0.024951389},
0136 {0.025892397, 0.025324140, 0.024767618, 0.025466916, 0.025547697, 0.024931444, 0.024865503, 0.024965166},
0137 {0.025884594, 0.025299910, 0.024911579, 0.025545151, 0.025692597, 0.025396692, 0.025361045, 0.025631407},
0138 {0.026016195, 0.024945150, 0.024826044, 0.025509113, 0.025358243, 0.025056858, 0.025043673, 0.025082216},
0139 {0.025525420, 0.025148992, 0.025057081, 0.025180734, 0.025324788, 0.024978238, 0.025439115, 0.025149794},
0140 {0.025679313, 0.024968559, 0.024960063, 0.025743545, 0.025488564, 0.024816573, 0.025175969, 0.025249409},
0141 {0.025616512, 0.024970570, 0.024939109, 0.025640487, 0.025595783, 0.024913486, 0.025093671, 0.025319956},
0142 {0.025649297, 0.025295899, 0.025035573, 0.025319031, 0.025256918, 0.025451105, 0.024914639, 0.025190688}};
0143 const float RochCor2012::mpavg[8][8] = {
0144 {0.025604088, 0.025265064, 0.024723310, 0.025622864, 0.025484807, 0.025519480, 0.025055743, 0.024885352},
0145 {0.025536602, 0.024972232, 0.024960433, 0.025341841, 0.025646744, 0.024954528, 0.025367321, 0.024594933},
0146 {0.025733960, 0.024972564, 0.025092482, 0.025435571, 0.025381427, 0.024627063, 0.025213528, 0.026130881},
0147 {0.025760733, 0.025261410, 0.024756177, 0.025349453, 0.025471219, 0.024913743, 0.025367404, 0.025344302},
0148 {0.025564542, 0.025115323, 0.025066901, 0.025519108, 0.025278455, 0.025177200, 0.025202904, 0.025660497},
0149 {0.026146946, 0.025127524, 0.025185574, 0.025478394, 0.025289463, 0.025376077, 0.025378334, 0.025742637},
0150 {0.026086491, 0.025343798, 0.025090656, 0.025447269, 0.025322028, 0.024798416, 0.024731958, 0.024964551},
0151 {0.025714620, 0.024896867, 0.024996409, 0.025739719, 0.025418277, 0.024759519, 0.025287654, 0.024960841}};
0152
0153
0154
0155
0156
0157
0158 const float RochCor2012::ptlow[85] = {
0159 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0,
0160 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5, 11.0, 11.5, 12.0, 12.5, 13.0, 13.5, 14.0, 14.5,
0161 15.0, 15.5, 16.0, 16.5, 17.0, 17.5, 18.0, 18.5, 19.0, 19.5, 20.0, 20.5, 21.0, 21.5, 22.0,
0162 22.5, 23.0, 23.5, 24.0, 24.5, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 32.0, 34.0, 36.0, 38.0,
0163 40.0, 44.0, 48.0, 52.0, 56.0, 60.0, 65.0, 70.0, 75.0, 80.0, 85.0, 90.0, 95.0, 100.0, 110.0,
0164 120.0, 130.0, 140.0, 150.0, 175.0, 200.0, 250.0, 350.0, 500.0, 1000.0};
0165
0166
0167
0168 const float RochCor2012::zptscl[84] = {
0169 1.49177, 1.45654, 1.36283, 1.28569, 1.2418, 1.12336, 1.10416, 1.08731, 0.994051, 0.96532, 0.94427,
0170 0.932725, 0.918082, 0.899665, 0.898398, 0.927687, 0.908047, 0.892392, 0.924027, 0.945895, 0.937149, 0.923983,
0171 0.923387, 0.955362, 0.947812, 0.962943, 0.948781, 0.961555, 0.95222, 0.999207, 0.973884, 0.993013, 0.953487,
0172 0.951402, 0.985583, 0.986603, 0.981388, 1.00022, 1.0294, 0.964748, 0.974592, 1.01546, 0.992343, 1.00101,
0173 0.990866, 0.98982, 1.02924, 1.02265, 0.967695, 1.02411, 0.97331, 1.01052, 1.01561, 0.992594, 0.976504,
0174 1.01205, 0.981111, 1.00078, 1.02078, 1.00719, 1.0099, 1.02865, 1.03845, 1.03254, 1.09815, 1.10263,
0175 1.06302, 1.0725, 1.14703, 1.10574, 1.13911, 1.16947, 1.1709, 1.11413, 1.28793, 1.18953, 1.20212,
0176 1.18112, 1.25471, 1.15329, 1.14276, 1.17223, 1.09173, 2.00229};
0177
0178 const float RochCor2012::zptscler[84] = {
0179 0.0270027, 0.0154334, 0.0115338, 0.00958085, 0.0084683, 0.00736665, 0.0069567, 0.00671434, 0.00617693,
0180 0.00601943, 0.00594735, 0.00594569, 0.00594903, 0.00595495, 0.00608115, 0.00633704, 0.0063916, 0.0064468,
0181 0.00678106, 0.00706769, 0.00717517, 0.00727958, 0.00747182, 0.00785544, 0.00798754, 0.00828787, 0.00839147,
0182 0.00865826, 0.00876775, 0.00933276, 0.00935768, 0.0097289, 0.00962058, 0.00983828, 0.0103044, 0.0104871,
0183 0.0106575, 0.0110388, 0.0114986, 0.0111494, 0.0115202, 0.0121059, 0.0121345, 0.0124923, 0.0125972,
0184 0.0128401, 0.0134519, 0.0136279, 0.0133414, 0.014186, 0.00992195, 0.0105984, 0.0109484, 0.0111756,
0185 0.0114579, 0.00870013, 0.00904749, 0.00970734, 0.0104583, 0.0109818, 0.00837852, 0.00939894, 0.010415,
0186 0.0113433, 0.013007, 0.0128788, 0.0140174, 0.0156993, 0.0181717, 0.019765, 0.0222326, 0.0249408,
0187 0.0272806, 0.0211706, 0.0278087, 0.0306654, 0.0361387, 0.041327, 0.0341513, 0.0440116, 0.0473006,
0188 0.0680212, 0.149162, 0.56279};
0189
0190 RochCor2012::~RochCor2012() {}
0191
0192 RochCor2012::RochCor2012() {
0193 eran.SetSeed(123456);
0194 sran.SetSeed(1234);
0195
0196 gscler_mc_dev = 0;
0197 gscler_da_dev = 0;
0198
0199 for (int i = 0; i < 8; ++i) {
0200 for (int j = 0; j < 8; ++j) {
0201 mptsys_mc_dm[i][j] = 0;
0202 mptsys_mc_da[i][j] = 0;
0203 mptsys_da_dm[i][j] = 0;
0204 mptsys_da_da[i][j] = 0;
0205 }
0206 }
0207 }
0208
0209 RochCor2012::RochCor2012(int seed) {
0210 eran.SetSeed(123456);
0211 sran.SetSeed(seed);
0212
0213 gscler_mc_dev = sran.Gaus(0.0, 1.0);
0214 gscler_da_dev = sran.Gaus(0.0, 1.0);
0215
0216 for (int i = 0; i < 8; ++i) {
0217 for (int j = 0; j < 8; ++j) {
0218 mptsys_mc_dm[i][j] = sran.Gaus(0.0, 1.0);
0219 mptsys_mc_da[i][j] = sran.Gaus(0.0, 1.0);
0220 mptsys_da_dm[i][j] = sran.Gaus(0.0, 1.0);
0221 mptsys_da_da[i][j] = sran.Gaus(0.0, 1.0);
0222 }
0223 }
0224 }
0225
0226 void RochCor2012::momcor_mc(TLorentzVector& mu, float charge, float sysdev, int runopt) {
0227
0228
0229 float ptmu = mu.Pt();
0230 float muphi = mu.Phi();
0231 float mueta = mu.Eta();
0232
0233 float px = mu.Px();
0234 float py = mu.Py();
0235 float pz = mu.Pz();
0236 float e = mu.E();
0237
0238 int mu_phibin = phibin(muphi);
0239 int mu_etabin = etabin(mueta);
0240
0241
0242
0243 float dm = (mcor_bf[mu_phibin][mu_etabin] + mptsys_mc_dm[mu_phibin][mu_etabin] * mcor_bfer[mu_phibin][mu_etabin]) /
0244 mmavg[mu_phibin][mu_etabin];
0245 float da = mcor_ma[mu_phibin][mu_etabin] + mptsys_mc_da[mu_phibin][mu_etabin] * mcor_maer[mu_phibin][mu_etabin];
0246
0247 float cor = 1.0 / (1.0 + dm + charge * da * ptmu);
0248
0249
0250 px *= cor;
0251 py *= cor;
0252 pz *= cor;
0253 e *= cor;
0254
0255 float gscler = 0.0;
0256 float deltaer = 0.0;
0257 float sfer = 0.0;
0258
0259 gscler = TMath::Sqrt(TMath::Power(mgscl_stat, 2) + TMath::Power(mgscl_syst, 2));
0260 deltaer = TMath::Sqrt(TMath::Power(delta_stat, 2) + TMath::Power(delta_syst, 2));
0261 sfer = TMath::Sqrt(TMath::Power(sf_stat, 2) + TMath::Power(sf_syst, 2));
0262
0263 float tune =
0264 1.0 / (1.0 + (delta + sysdev * deltaer) * sqrt(px * px + py * py) * eran.Gaus(1.0, (sf + sysdev * sfer)));
0265
0266 px *= (tune);
0267 py *= (tune);
0268 pz *= (tune);
0269 e *= (tune);
0270
0271 float gscl = (genm_smr / mrecm);
0272
0273 px *= (gscl + gscler_mc_dev * gscler);
0274 py *= (gscl + gscler_mc_dev * gscler);
0275 pz *= (gscl + gscler_mc_dev * gscler);
0276 e *= (gscl + gscler_mc_dev * gscler);
0277
0278 mu.SetPxPyPzE(px, py, pz, e);
0279 }
0280
0281 void RochCor2012::momcor_data(TLorentzVector& mu, float charge, float sysdev, int runopt) {
0282 float ptmu = mu.Pt();
0283
0284 float muphi = mu.Phi();
0285 float mueta = mu.Eta();
0286
0287 float px = mu.Px();
0288 float py = mu.Py();
0289 float pz = mu.Pz();
0290 float e = mu.E();
0291
0292 int mu_phibin = phibin(muphi);
0293 int mu_etabin = etabin(mueta);
0294
0295
0296
0297 float dm = (dcor_bf[mu_phibin][mu_etabin] + mptsys_da_dm[mu_phibin][mu_etabin] * dcor_bfer[mu_phibin][mu_etabin]) /
0298 dmavg[mu_phibin][mu_etabin];
0299 float da = dcor_ma[mu_phibin][mu_etabin] + mptsys_da_da[mu_phibin][mu_etabin] * dcor_maer[mu_phibin][mu_etabin];
0300
0301 float cor = 1.0 / (1.0 + dm + charge * da * ptmu);
0302
0303 px *= cor;
0304 py *= cor;
0305 pz *= cor;
0306 e *= cor;
0307
0308
0309 float gscler = 0.0;
0310
0311 gscler = TMath::Sqrt(TMath::Power(dgscl_stat, 2) + TMath::Power(dgscl_syst, 2));
0312
0313 float gscl = (genm_smr / drecm);
0314
0315 px *= (gscl + gscler_da_dev * gscler);
0316 py *= (gscl + gscler_da_dev * gscler);
0317 pz *= (gscl + gscler_da_dev * gscler);
0318 e *= (gscl + gscler_da_dev * gscler);
0319
0320 mu.SetPxPyPzE(px, py, pz, e);
0321 }
0322
0323 void RochCor2012::musclefit_data(TLorentzVector& mu, TLorentzVector& mubar) {
0324 float dpar1 = 0.0;
0325 float dpar2 = 0.0;
0326 float epar1 = 0.0;
0327 float epar2 = 0.0;
0328
0329 if (fabs(mu.PseudoRapidity()) <= 0.9) {
0330 dpar1 = d0par;
0331 epar1 = e0par;
0332 } else if (mu.PseudoRapidity() > 0.9) {
0333 dpar1 = d1par;
0334 epar1 = e1par;
0335 } else if (mu.PseudoRapidity() < -0.9) {
0336 dpar1 = d2par;
0337 epar1 = e2par;
0338 }
0339
0340 if (fabs(mubar.PseudoRapidity()) <= 0.9) {
0341 dpar2 = d0par;
0342 epar2 = e0par;
0343 } else if (mubar.PseudoRapidity() > 0.9) {
0344 dpar2 = d1par;
0345 epar2 = e1par;
0346 } else if (mubar.PseudoRapidity() < -0.9) {
0347 dpar2 = d2par;
0348 epar2 = e2par;
0349 }
0350
0351 float corr1 = 1.0 + bpar * mu.Pt() +
0352 (-1.0) * cpar * mu.Pt() * TMath::Sign(float(1.0), float(mu.PseudoRapidity())) *
0353 TMath::Power(mu.PseudoRapidity(), 2) +
0354 (-1.0) * dpar1 * mu.Pt() * sin(mu.Phi() + epar1);
0355 float corr2 = 1.0 + bpar * mubar.Pt() +
0356 (1.0) * cpar * mubar.Pt() * TMath::Sign(float(1.0), float(mubar.PseudoRapidity())) *
0357 TMath::Power(mubar.PseudoRapidity(), 2) +
0358 (1.0) * dpar2 * mubar.Pt() * sin(mubar.Phi() + epar2);
0359
0360 float px1 = mu.Px();
0361 float py1 = mu.Py();
0362 float pz1 = mu.Pz();
0363 float e1 = mu.E();
0364
0365 float px2 = mubar.Px();
0366 float py2 = mubar.Py();
0367 float pz2 = mubar.Pz();
0368 float e2 = mubar.E();
0369
0370 px1 *= corr1;
0371 py1 *= corr1;
0372 pz1 *= corr1;
0373 e1 *= corr1;
0374
0375 px2 *= corr2;
0376 py2 *= corr2;
0377 pz2 *= corr2;
0378 e2 *= corr2;
0379
0380 mu.SetPxPyPzE(px1, py1, pz1, e1);
0381 mubar.SetPxPyPzE(px2, py2, pz2, e2);
0382 }
0383
0384 Int_t RochCor2012::phibin(float phi) {
0385 int nphibin = -1;
0386
0387 for (int i = 0; i < 8; i++) {
0388 if (-pi + (2.0 * pi / 8.0) * i <= phi && -pi + (2.0 * pi / 8.0) * (i + 1) > phi) {
0389 nphibin = i;
0390 break;
0391 }
0392 }
0393
0394 return nphibin;
0395 }
0396
0397 Int_t RochCor2012::etabin(float eta) {
0398 int nbin = -1;
0399
0400 for (int i = 0; i < 8; i++) {
0401 if (netabin[i] <= eta && netabin[i + 1] > eta) {
0402 nbin = i;
0403 break;
0404 }
0405 }
0406
0407 return nbin;
0408 }
0409
0410 float RochCor2012::zptcor(float gzpt) {
0411 int ibin(0);
0412
0413
0414 if (gzpt > ptlow[nptbins])
0415 return nptbins - 1;
0416 if (gzpt < ptlow[0])
0417 return 0;
0418
0419 for (int i = 0; i < nptbins; ++i) {
0420 if (gzpt >= ptlow[i] && gzpt < ptlow[i + 1]) {
0421 ibin = i;
0422 break;
0423 }
0424 }
0425
0426 float zptwt = zptscl[ibin];
0427
0428 return zptwt;
0429 }
0430
0431 }