Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:38

0001 #include <TCanvas.h>
0002 #include <TF1.h>
0003 
0004 //validation of the new pulse shape
0005 // comparison of old and new functions
0006 
0007 // Automatically generated using parametrizePulse::generateCode(low=-30, high=35, step=0.1)
0008 float decoValues[651] = 
0009                            { 0.00924234, 0.00994226, 0.0106394, 0.0115231, 0.0127115
0010                            , 0.0138952, 0.015074, 0.0162481, 0.0174175, 0.0185821
0011                            , 0.019742, 0.0208972, 0.0220476, 0.0231934, 0.0243346
0012                            , 0.0254711, 0.0266029, 0.0281052, 0.0298238, 0.0315354
0013                            , 0.03324, 0.0349377, 0.0366285, 0.0383124, 0.0399894
0014                            , 0.0416596, 0.0433229, 0.0449794, 0.0466291, 0.0482721
0015                            , 0.0499082, 0.0515377, 0.0531605, 0.0552102, 0.0574934
0016                            , 0.0597673, 0.0620319, 0.0642872, 0.0665332, 0.06877
0017                            , 0.0709976, 0.073216, 0.0754253, 0.0776255, 0.0798165
0018                            , 0.0819985, 0.0841715, 0.0863354, 0.0884904, 0.0906364
0019                            , 0.0927736, 0.0956311, 0.0984767, 0.101311, 0.104133
0020                            , 0.106943, 0.109742, 0.11253, 0.115305, 0.118069
0021                            , 0.120822, 0.123563, 0.126293, 0.129011, 0.131718
0022                            , 0.134414, 0.137098, 0.139771, 0.142433, 0.145342
0023                            , 0.148737, 0.152118, 0.155485, 0.158838, 0.162177
0024                            , 0.165501, 0.168812, 0.172109, 0.175392, 0.178662
0025                            , 0.181917, 0.185159, 0.188387, 0.191602, 0.194802
0026                            , 0.19799, 0.201164, 0.204324, 0.207728, 0.211617
0027                            , 0.215489, 0.219346, 0.223186, 0.22701, 0.230818
0028                            , 0.234609, 0.238385, 0.242145, 0.245888, 0.249616
0029                            , 0.253328, 0.257024, 0.260704, 0.264368, 0.268017
0030                            , 0.27165, 0.275268, 0.279366, 0.28368, 0.287975
0031                            , 0.292252, 0.296511, 0.300752, 0.304974, 0.309179
0032                            , 0.313365, 0.317534, 0.321685, 0.325817, 0.329932
0033                            , 0.33403, 0.338109, 0.342171, 0.346215, 0.350268
0034                            , 0.354953, 0.359618, 0.364262, 0.368887, 0.373492
0035                            , 0.378077, 0.382642, 0.387187, 0.391712, 0.396218
0036                            , 0.400705, 0.405172, 0.409619, 0.414047, 0.418456
0037                            , 0.422877, 0.427844, 0.43279, 0.437715, 0.442618
0038                            , 0.4475, 0.45236, 0.4572, 0.462018, 0.466815
0039                            , 0.471591, 0.476346, 0.48108, 0.485794, 0.490636
0040                            , 0.495805, 0.500951, 0.506075, 0.511177, 0.516256
0041                            , 0.521313, 0.526347, 0.53136, 0.53635, 0.541318
0042                            , 0.546369, 0.551673, 0.556954, 0.562211, 0.567445
0043                            , 0.572655, 0.577843, 0.583008, 0.588245, 0.593612
0044                            , 0.598955, 0.604274, 0.60957, 0.61494, 0.620297
0045                            , 0.62563, 0.630939, 0.636225, 0.641487, 0.646725
0046                            , 0.65194, 0.657131, 0.662299, 0.667444, 0.672566
0047                            , 0.677664, 0.682739, 0.687792, 0.692821, 0.697828
0048                            , 0.702812, 0.707773, 0.712711, 0.717627, 0.722521
0049                            , 0.727392, 0.732241, 0.737067, 0.741871, 0.746653
0050                            , 0.751413, 0.756151, 0.760867, 0.765562, 0.770234
0051                            , 0.774885, 0.779514, 0.784121, 0.788707, 0.793272
0052                            , 0.797815, 0.802336, 0.806837, 0.811316, 0.815774
0053                            , 0.820212, 0.824628, 0.829023, 0.833397, 0.837751
0054                            , 0.842084, 0.846396, 0.850687, 0.854958, 0.859209
0055                            , 0.863336, 0.867415, 0.871474, 0.875513, 0.879443
0056                            , 0.883142, 0.886823, 0.890485, 0.894129, 0.897755
0057                            , 0.901363, 0.904953, 0.908339, 0.911433, 0.914511
0058                            , 0.917573, 0.920619, 0.923649, 0.926664, 0.929663
0059                            , 0.932646, 0.935613, 0.938565, 0.941271, 0.943589
0060                            , 0.945894, 0.948186, 0.950465, 0.952732, 0.954985
0061                            , 0.957225, 0.959453, 0.961668, 0.963871, 0.96606
0062                            , 0.968237, 0.970402, 0.972099, 0.973515, 0.974922
0063                            , 0.97632, 0.977708, 0.979087, 0.980456, 0.981816
0064                            , 0.983167, 0.984508, 0.98584, 0.987163, 0.988476
0065                            , 0.98978, 0.991075, 0.992361, 0.993112, 0.993562
0066                            , 0.994007, 0.994446, 0.994879, 0.995307, 0.995729
0067                            , 0.996145, 0.996555, 0.99696, 0.99736, 0.997754
0068                            , 0.998142, 0.998524, 0.998902, 0.999273, 0.99964
0069                            , 1, 0.99947, 0.998939, 0.998406, 0.997871
0070                            , 0.997334, 0.996796, 0.996255, 0.995713, 0.995169
0071                            , 0.994623, 0.994076, 0.993526, 0.992975, 0.992422
0072                            , 0.991867, 0.991311, 0.990753, 0.990193, 0.989317
0073                            , 0.987837, 0.986359, 0.984883, 0.983409, 0.981937
0074                            , 0.980467, 0.978999, 0.977533, 0.976069, 0.974606
0075                            , 0.973146, 0.971688, 0.970231, 0.968777, 0.967324
0076                            , 0.965874, 0.964425, 0.962978, 0.961222, 0.958862
0077                            , 0.956508, 0.95416, 0.951817, 0.94948, 0.947149
0078                            , 0.944822, 0.942502, 0.940187, 0.937877, 0.935573
0079                            , 0.933274, 0.930981, 0.928693, 0.926411, 0.924134
0080                            , 0.921863, 0.919597, 0.916734, 0.913596, 0.910467
0081                            , 0.907348, 0.904237, 0.901134, 0.898041, 0.894956
0082                            , 0.89188, 0.888813, 0.885754, 0.882705, 0.879663
0083                            , 0.876631, 0.873607, 0.870591, 0.867585, 0.864555
0084                            , 0.860745, 0.856948, 0.853162, 0.849388, 0.845626
0085                            , 0.841876, 0.838137, 0.834409, 0.830693, 0.826989
0086                            , 0.823296, 0.819615, 0.815945, 0.812286, 0.808639
0087                            , 0.804965, 0.800616, 0.796281, 0.79196, 0.787653
0088                            , 0.78336, 0.779081, 0.774817, 0.770566, 0.766329
0089                            , 0.762106, 0.757897, 0.753701, 0.749519, 0.74517
0090                            , 0.740412, 0.735671, 0.730946, 0.726236, 0.721543
0091                            , 0.716865, 0.712203, 0.707557, 0.702927, 0.698312
0092                            , 0.693585, 0.688541, 0.683514, 0.678505, 0.673513
0093                            , 0.668538, 0.663581, 0.65864, 0.653601, 0.648394
0094                            , 0.643205, 0.638034, 0.632881, 0.627627, 0.622379
0095                            , 0.61715, 0.611939, 0.606746, 0.601572, 0.596415
0096                            , 0.591277, 0.586158, 0.581056, 0.575972, 0.570907
0097                            , 0.565859, 0.560829, 0.555817, 0.550823, 0.545846
0098                            , 0.540887, 0.535946, 0.531023, 0.526117, 0.521228
0099                            , 0.516357, 0.511503, 0.506667, 0.501848, 0.497046
0100                            , 0.492261, 0.487494, 0.482743, 0.47801, 0.473293
0101                            , 0.468594, 0.463911, 0.459245, 0.454596, 0.449964
0102                            , 0.445349, 0.44075, 0.436168, 0.431602, 0.427053
0103                            , 0.42252, 0.418003, 0.413503, 0.40902, 0.404552
0104                            , 0.400101, 0.395666, 0.391247, 0.386844, 0.382457
0105                            , 0.378118, 0.373803, 0.369503, 0.36522, 0.360979
0106                            , 0.356818, 0.352672, 0.348541, 0.344425, 0.340325
0107                            , 0.336239, 0.332169, 0.328169, 0.324268, 0.320381
0108                            , 0.316508, 0.31265, 0.308806, 0.304975, 0.301159
0109                            , 0.297357, 0.293569, 0.289795, 0.286104, 0.282541
0110                            , 0.27899, 0.275453, 0.271928, 0.268417, 0.264919
0111                            , 0.261433, 0.25796, 0.2545, 0.251053, 0.247619
0112                            , 0.244197, 0.240789, 0.237531, 0.234366, 0.231214
0113                            , 0.228072, 0.224943, 0.221825, 0.218719, 0.215624
0114                            , 0.212541, 0.209469, 0.206409, 0.20336, 0.200322
0115                            , 0.197296, 0.194281, 0.191278, 0.188445, 0.185712
0116                            , 0.182988, 0.180275, 0.177572, 0.174879, 0.172197
0117                            , 0.169524, 0.166861, 0.164208, 0.161565, 0.158932
0118                            , 0.156309, 0.153696, 0.151092, 0.148499, 0.145915
0119                            , 0.143341, 0.141045, 0.138757, 0.136478, 0.134208
0120                            , 0.131946, 0.129693, 0.127448, 0.125211, 0.122983
0121                            , 0.120764, 0.118552, 0.116349, 0.114155, 0.111969
0122                            , 0.109791, 0.107621, 0.105459, 0.103306, 0.101256
0123                            , 0.0993974, 0.0975454, 0.0957005, 0.0938625, 0.0920315
0124                            , 0.0902075, 0.0883903, 0.0865801, 0.0847768, 0.0829803
0125                            , 0.0811906, 0.0794078, 0.0776318, 0.0758625, 0.0741
0126                            , 0.0723443, 0.0705953, 0.0688529, 0.067212, 0.0657611
0127                            , 0.0643156, 0.0628756, 0.0614412, 0.0600122, 0.0585887
0128                            , 0.0571706, 0.055758, 0.0543508, 0.052949, 0.0515525
0129                            , 0.0501615, 0.0487758, 0.0473954, 0.0460204, 0.0446506
0130                            , 0.0432862, 0.041927, 0.0407559, 0.0396748, 0.0385978
0131                            , 0.037525, 0.0364564, 0.0353918, 0.0343314, 0.033275
0132                            , 0.0322228, 0.0311746, 0.0301305, 0.0290904, 0.0280544
0133                            , 0.0270223, 0.0259943, 0.0249703, 0.0239503, 0.0229442
0134                            , 0.0221806, 0.02142, 0.0206624, 0.0199077, 0.0191559
0135                            , 0.0184071, 0.0176611, 0.0169181, 0.016178, 0.0154408
0136                            , 0.0147064, 0.0139749, 0.0132463, 0.0125206, 0.0117976
0137                            , 0.0110893, 0.0105918, 0.0100963, 0.00960269, 0.00911102
0138                            , 0.00862127, 0.00813344, 0.00764753, 0.00716353, 0.00668143
0139                            , 0.00620122 };
0140 
0141 float peakValues[921] = 
0142                            { 0.000598718, 0.00179789, 0.00380417, 0.00622833, 0.00934726
0143                            , 0.0133483, 0.0172689, 0.0225072, 0.0282688, 0.0339136
0144                            , 0.040572, 0.0482572, 0.0557854, 0.063159, 0.0727605
0145                            , 0.082258, 0.0915594, 0.101262, 0.112735, 0.123969
0146                            , 0.134968, 0.146844, 0.159929, 0.172739, 0.185278
0147                            , 0.199281, 0.21373, 0.227871, 0.242102, 0.257926
0148                            , 0.273412, 0.288564, 0.305358, 0.321845, 0.338351
0149                            , 0.355808, 0.372906, 0.390895, 0.408861, 0.427103
0150                            , 0.445108, 0.462713, 0.479924, 0.496746, 0.513186
0151                            , 0.52925, 0.544943, 0.560272, 0.575241, 0.589857
0152                            , 0.604126, 0.618052, 0.631641, 0.644898, 0.657829
0153                            , 0.670439, 0.682733, 0.694716, 0.706393, 0.717768
0154                            , 0.728848, 0.739635, 0.750136, 0.760355, 0.770296
0155                            , 0.779964, 0.789363, 0.798498, 0.807373, 0.815993
0156                            , 0.824361, 0.832481, 0.840359, 0.847997, 0.8554
0157                            , 0.862572, 0.869516, 0.876237, 0.882738, 0.889022
0158                            , 0.895095, 0.900958, 0.906616, 0.912073, 0.917331
0159                            , 0.922394, 0.927265, 0.931949, 0.936447, 0.940763
0160                            , 0.944901, 0.948864, 0.952653, 0.956274, 0.959728
0161                            , 0.963019, 0.966149, 0.969122, 0.97194, 0.974606
0162                            , 0.977122, 0.979492, 0.981718, 0.983803, 0.985749
0163                            , 0.987559, 0.989235, 0.990781, 0.992197, 0.993487
0164                            , 0.994654, 0.995699, 0.996624, 0.997433, 0.998126
0165                            , 0.998708, 0.999178, 0.999541, 0.999797, 0.99995
0166                            , 1, 0.99995, 0.999803, 0.999559, 0.999221
0167                            , 0.998791, 0.99827, 0.997661, 0.996966, 0.996185
0168                            , 0.995321, 0.994376, 0.993351, 0.992248, 0.991068
0169                            , 0.989814, 0.988487, 0.987088, 0.985619, 0.984081
0170                            , 0.982477, 0.980807, 0.979073, 0.977276, 0.975419
0171                            , 0.973501, 0.971525, 0.969492, 0.967403, 0.96526
0172                            , 0.963064, 0.960816, 0.958517, 0.956169, 0.953772
0173                            , 0.951329, 0.94884, 0.946306, 0.943729, 0.941109
0174                            , 0.938448, 0.935747, 0.933006, 0.930228, 0.927412
0175                            , 0.924561, 0.921674, 0.918753, 0.915799, 0.912813
0176                            , 0.909796, 0.906748, 0.903671, 0.900566, 0.897432
0177                            , 0.894272, 0.891086, 0.887875, 0.884639, 0.88138
0178                            , 0.878099, 0.874795, 0.87147, 0.868125, 0.86476
0179                            , 0.861376, 0.857973, 0.854553, 0.851117, 0.847664
0180                            , 0.844195, 0.840712, 0.837214, 0.833703, 0.830178
0181                            , 0.826641, 0.823093, 0.819533, 0.815963, 0.812382
0182                            , 0.808792, 0.805193, 0.801586, 0.79797, 0.794347
0183                            , 0.790718, 0.787081, 0.783439, 0.779792, 0.776139
0184                            , 0.772482, 0.768821, 0.765157, 0.761489, 0.757818
0185                            , 0.754145, 0.75047, 0.746794, 0.743116, 0.739438
0186                            , 0.735759, 0.73208, 0.728402, 0.724724, 0.721048
0187                            , 0.717372, 0.713699, 0.710028, 0.706359, 0.702692
0188                            , 0.699029, 0.695369, 0.691713, 0.688061, 0.684413
0189                            , 0.680769, 0.67713, 0.673496, 0.669868, 0.666245
0190                            , 0.662627, 0.659016, 0.655411, 0.651812, 0.648221
0191                            , 0.644636, 0.641058, 0.637488, 0.633925, 0.63037
0192                            , 0.626823, 0.623284, 0.619754, 0.616232, 0.612719
0193                            , 0.609215, 0.605719, 0.602233, 0.598757, 0.59529
0194                            , 0.591833, 0.588385, 0.584948, 0.581521, 0.578104
0195                            , 0.574697, 0.571301, 0.567916, 0.564541, 0.561178
0196                            , 0.557825, 0.554484, 0.551154, 0.547835, 0.544528
0197                            , 0.541232, 0.537948, 0.534676, 0.531416, 0.528167
0198                            , 0.524931, 0.521707, 0.518495, 0.515295, 0.512107
0199                            , 0.508932, 0.50577, 0.50262, 0.499482, 0.496358
0200                            , 0.493246, 0.490146, 0.48706, 0.483986, 0.480926
0201                            , 0.477878, 0.474844, 0.471822, 0.468814, 0.465819
0202                            , 0.462837, 0.459868, 0.456913, 0.45397, 0.451041
0203                            , 0.448126, 0.445224, 0.442335, 0.43946, 0.436598
0204                            , 0.433749, 0.430914, 0.428092, 0.425284, 0.42249
0205                            , 0.419709, 0.416941, 0.414187, 0.411446, 0.408719
0206                            , 0.406006, 0.403306, 0.40062, 0.397947, 0.395287
0207                            , 0.392641, 0.390009, 0.38739, 0.384785, 0.382193
0208                            , 0.379615, 0.37705, 0.374499, 0.371961, 0.369436
0209                            , 0.366925, 0.364427, 0.361943, 0.359472, 0.357014
0210                            , 0.35457, 0.352139, 0.349721, 0.347317, 0.344926
0211                            , 0.342547, 0.340183, 0.337831, 0.335492, 0.333167
0212                            , 0.330854, 0.328555, 0.326268, 0.323995, 0.321734
0213                            , 0.319487, 0.317252, 0.31503, 0.312821, 0.310625
0214                            , 0.308441, 0.30627, 0.304112, 0.301966, 0.299833
0215                            , 0.297713, 0.295605, 0.293509, 0.291426, 0.289356
0216                            , 0.287297, 0.285252, 0.283218, 0.281196, 0.279187
0217                            , 0.27719, 0.275205, 0.273232, 0.271271, 0.269322
0218                            , 0.267385, 0.26546, 0.263546, 0.261645, 0.259755
0219                            , 0.257877, 0.25601, 0.254156, 0.252312, 0.250481
0220                            , 0.24866, 0.246852, 0.245054, 0.243268, 0.241493
0221                            , 0.239729, 0.237977, 0.236236, 0.234506, 0.232786
0222                            , 0.231078, 0.229381, 0.227695, 0.226019, 0.224355
0223                            , 0.222701, 0.221057, 0.219425, 0.217803, 0.216191
0224                            , 0.214591, 0.213, 0.21142, 0.20985, 0.208291
0225                            , 0.206742, 0.205203, 0.203674, 0.202155, 0.200647
0226                            , 0.199148, 0.19766, 0.196181, 0.194712, 0.193253
0227                            , 0.191804, 0.190364, 0.188934, 0.187514, 0.186103
0228                            , 0.184702, 0.18331, 0.181928, 0.180555, 0.179191
0229                            , 0.177836, 0.176491, 0.175155, 0.173828, 0.17251
0230                            , 0.171201, 0.169901, 0.16861, 0.167328, 0.166055
0231                            , 0.16479, 0.163535, 0.162287, 0.161049, 0.159819
0232                            , 0.158598, 0.157385, 0.15618, 0.154984, 0.153796
0233                            , 0.152617, 0.151446, 0.150283, 0.149128, 0.147981
0234                            , 0.146842, 0.145712, 0.144589, 0.143474, 0.142367
0235                            , 0.141268, 0.140177, 0.139093, 0.138017, 0.136949
0236                            , 0.135888, 0.134835, 0.133789, 0.132751, 0.131721
0237                            , 0.130697, 0.129681, 0.128672, 0.127671, 0.126676
0238                            , 0.125689, 0.124709, 0.123736, 0.12277, 0.121811
0239                            , 0.120859, 0.119914, 0.118975, 0.118044, 0.117119
0240                            , 0.116201, 0.115289, 0.114384, 0.113486, 0.112594
0241                            , 0.111709, 0.110831, 0.109958, 0.109092, 0.108233
0242                            , 0.10738, 0.106533, 0.105692, 0.104857, 0.104029
0243                            , 0.103207, 0.10239, 0.10158, 0.100776, 0.0999777
0244                            , 0.0991854, 0.0983989, 0.0976182, 0.0968433, 0.0960742
0245                            , 0.0953108, 0.094553, 0.093801, 0.0930545, 0.0923136
0246                            , 0.0915782, 0.0908483, 0.0901239, 0.0894049, 0.0886913
0247                            , 0.087983, 0.08728, 0.0865824, 0.0858899, 0.0852027
0248                            , 0.0845206, 0.0838437, 0.0831719, 0.0825052, 0.0818435
0249                            , 0.0811867, 0.080535, 0.0798882, 0.0792463, 0.0786092
0250                            , 0.077977, 0.0773496, 0.0767269, 0.076109, 0.0754958
0251                            , 0.0748872, 0.0742833, 0.073684, 0.0730893, 0.0724991
0252                            , 0.0719134, 0.0713321, 0.0707554, 0.070183, 0.0696151
0253                            , 0.0690514, 0.0684922, 0.0679372, 0.0673864, 0.0668399
0254                            , 0.0662976, 0.0657595, 0.0652255, 0.0646957, 0.0641699
0255                            , 0.0636482, 0.0631305, 0.0626168, 0.0621071, 0.0616013
0256                            , 0.0610995, 0.0606015, 0.0601074, 0.0596171, 0.0591307
0257                            , 0.058648, 0.058169, 0.0576938, 0.0572223, 0.0567545
0258                            , 0.0562903, 0.0558297, 0.0553727, 0.0549193, 0.0544694
0259                            , 0.0540231, 0.0535802, 0.0531408, 0.0527048, 0.0522722
0260                            , 0.0518431, 0.0514173, 0.0509948, 0.0505757, 0.0501598
0261                            , 0.0497472, 0.0493379, 0.0489318, 0.0485289, 0.0481291
0262                            , 0.0477325, 0.0473391, 0.0469487, 0.0465614, 0.0461772
0263                            , 0.045796, 0.0454178, 0.0450427, 0.0446704, 0.0443012
0264                            , 0.0439348, 0.0435714, 0.0432109, 0.0428532, 0.0424983
0265                            , 0.0421463, 0.041797, 0.0414506, 0.0411069, 0.0407659
0266                            , 0.0404277, 0.0400921, 0.0397593, 0.039429, 0.0391014
0267                            , 0.0387765, 0.0384541, 0.0381343, 0.037817, 0.0375023
0268                            , 0.0371902, 0.0368805, 0.0365733, 0.0362685, 0.0359662
0269                            , 0.0356663, 0.0353689, 0.0350738, 0.0347811, 0.0344907
0270                            , 0.0342027, 0.033917, 0.0336336, 0.0333525, 0.0330736
0271                            , 0.032797, 0.0325226, 0.0322504, 0.0319805, 0.0317127
0272                            , 0.031447, 0.0311836, 0.0309222, 0.030663, 0.0304058
0273                            , 0.0301508, 0.0298978, 0.0296468, 0.0293979, 0.029151
0274                            , 0.0289061, 0.0286632, 0.0284223, 0.0281833, 0.0279463
0275                            , 0.0277112, 0.027478, 0.0272467, 0.0270173, 0.0267897
0276                            , 0.026564, 0.0263402, 0.0261181, 0.0258979, 0.0256795
0277                            , 0.0254628, 0.025248, 0.0250349, 0.0248235, 0.0246138
0278                            , 0.0244059, 0.0241997, 0.0239951, 0.0237923, 0.023591
0279                            , 0.0233915, 0.0231936, 0.0229973, 0.0228026, 0.0226095
0280                            , 0.022418, 0.022228, 0.0220397, 0.0218528, 0.0216675
0281                            , 0.0214838, 0.0213015, 0.0211208, 0.0209415, 0.0207637
0282                            , 0.0205874, 0.0204125, 0.0202391, 0.0200671, 0.0198965
0283                            , 0.0197273, 0.0195595, 0.0193931, 0.0192281, 0.0190645
0284                            , 0.0189022, 0.0187412, 0.0185816, 0.0184233, 0.0182663
0285                            , 0.0181106, 0.0179562, 0.0178031, 0.0176512, 0.0175006
0286                            , 0.0173513, 0.0172032, 0.0170563, 0.0169106, 0.0167662
0287                            , 0.0166229, 0.0164809, 0.01634, 0.0162003, 0.0160617
0288                            , 0.0159244, 0.0157881, 0.015653, 0.015519, 0.0153862
0289                            , 0.0152544, 0.0151237, 0.0149942, 0.0148657, 0.0147383
0290                            , 0.0146119, 0.0144866, 0.0143624, 0.0142391, 0.014117
0291                            , 0.0139958, 0.0138756, 0.0137565, 0.0136384, 0.0135212
0292                            , 0.013405, 0.0132898, 0.0131756, 0.0130623, 0.01295
0293                            , 0.0128386, 0.0127281, 0.0126186, 0.01251, 0.0124023
0294                            , 0.0122955, 0.0121896, 0.0120846, 0.0119805, 0.0118773
0295                            , 0.0117749, 0.0116734, 0.0115727, 0.0114729, 0.0113739
0296                            , 0.0112758, 0.0111785, 0.011082, 0.0109863, 0.0108914
0297                            , 0.0107974, 0.0107041, 0.0106116, 0.0105199, 0.010429
0298                            , 0.0103388, 0.0102494, 0.0101607, 0.0100728, 0.00998569
0299                            , 0.00989927, 0.00981358, 0.00972862, 0.00964437, 0.00956084
0300                            , 0.00947802, 0.0093959, 0.00931447, 0.00923374, 0.00915369
0301                            , 0.00907432, 0.00899562, 0.00891759, 0.00884022, 0.00876351
0302                            , 0.00868745, 0.00861203, 0.00853726, 0.00846312, 0.00838961
0303                            , 0.00831673, 0.00824446, 0.00817281, 0.00810178, 0.00803134
0304                            , 0.0079615, 0.00789226, 0.00782361, 0.00775555, 0.00768806
0305                            , 0.00762115, 0.00755481, 0.00748903, 0.00742382, 0.00735916
0306                            , 0.00729506, 0.0072315, 0.00716848, 0.007106, 0.00704406
0307                            , 0.00698264, 0.00692175, 0.00686138, 0.00680153, 0.00674218
0308                            , 0.00668335, 0.00662502, 0.00656719, 0.00650985, 0.006453
0309                            , 0.00639664, 0.00634077, 0.00628537, 0.00623044, 0.00617599
0310                            , 0.006122, 0.00606848, 0.00601542, 0.00596281, 0.00591065
0311                            , 0.00585894, 0.00580767, 0.00575685, 0.00570646, 0.0056565
0312                            , 0.00560697, 0.00555787, 0.00550919, 0.00546093, 0.00541308
0313                            , 0.00536565, 0.00531862, 0.005272, 0.00522578, 0.00517995
0314                            , 0.00513452, 0.00508949, 0.00504484, 0.00500057, 0.00495669
0315                            , 0.00491318, 0.00487005, 0.00482729, 0.0047849, 0.00474288
0316                            , 0.00470122, 0.00465992, 0.00461897, 0.00457838, 0.00453814
0317                            , 0.00449824, 0.00445869, 0.00441948, 0.00438062, 0.00434208
0318                            , 0.00430388, 0.00426601, 0.00422847, 0.00419125, 0.00415436
0319                            , 0.00411778, 0.00408152, 0.00404558, 0.00400994, 0.00397462
0320                            , 0.0039396, 0.00390488, 0.00387046, 0.00383635, 0.00380253
0321                            , 0.003769, 0.00373576, 0.00370281, 0.00367015, 0.00363777
0322                            , 0.00360567, 0.00357385, 0.0035423, 0.00351103, 0.00348003
0323                            , 0.0034493, 0.00341884, 0.00338864, 0.00335871, 0.00332903
0324                            , 0.00329962, 0.00327046, 0.00324155, 0.00321289, 0.00318449
0325                            , 0.00315633, 0.00312841, 0.00310074, 0.00307331, 0.00304612
0326                            , 0.00301916 };
0327 
0328 Double_t oldPeakShape(Double_t *x, Double_t *) {
0329   // Time when read out relative to time hit produced.
0330   float readTimeNorm = -x[0]/52.17;
0331   // return the energyLoss weighted CR-RC shape peaked at t0.
0332   if (1 + readTimeNorm > 0) {
0333     return (1 + readTimeNorm)*exp(-readTimeNorm);
0334   } else {
0335     return 0.;
0336   }
0337 }
0338 
0339 Double_t oldDeconvolutionShape(Double_t *x, Double_t *) {
0340   // Time when read out relative to time hit produced.
0341   float readTimeNorm = -x[0]/12.06;
0342   // return the energyLoss weighted with a gaussian centered at t0 
0343   return exp(-0.5*readTimeNorm*readTimeNorm);
0344 }
0345 
0346 //new peak pulse
0347 Double_t newPeakShape(Double_t *x, Double_t *) {
0348   // x is difference between the tof and the tof for a photon (reference)
0349   int xx = int(-x[0]*2)+120;
0350   if(xx < 0 || xx > 920) return 0;
0351   return peakValues[xx];
0352 }
0353 
0354 //new deconv pulse
0355 Double_t newDeconvolutionShape(Double_t *x, Double_t *){
0356   // x is difference between the tof and the tof for a photon (reference)
0357   // converted into a bin number
0358   int xx = int(-x[0]*10)+300;
0359   if(xx < 0 || xx > 650) return 0;
0360   return decoValues[xx];
0361 }
0362 
0363 // difference in peak mode
0364 Double_t diffPeakShape(Double_t *x, Double_t *) {
0365   Double_t oldone = oldPeakShape(x,NULL);
0366   Double_t newone = newPeakShape(x,NULL);
0367   if(newone>1e-5) return (oldone-newone)/newone;
0368   else return 0.;
0369 }
0370 
0371 // difference in deconv mode
0372 Double_t diffDeconvolutionShape(Double_t *x, Double_t *) {
0373   Double_t oldone = oldDeconvolutionShape(x,NULL);
0374   Double_t newone = newDeconvolutionShape(x,NULL);
0375   if(newone>1e-5) return (oldone-newone)/newone;
0376   else return 0.;
0377 }
0378 
0379 void compare()
0380 {
0381   TF1 *theNewPeak = new TF1("theNewPeak",newPeakShape,-400,100,0);
0382   TF1 *theOldPeak = new TF1("theOldPeak",oldPeakShape,-400,100,0);
0383   TF1 *theNewDeco = new TF1("theNewDeco",newDeconvolutionShape,-50,50,0);
0384   TF1 *theOldDeco = new TF1("theOldDeco",oldDeconvolutionShape,-50,50,0);
0385  
0386   new TCanvas;
0387   theOldPeak->Draw();
0388   theNewPeak->Draw("same");
0389   new TCanvas;
0390   theNewDeco->Draw();
0391   theOldDeco->Draw("same");
0392 
0393 }
0394 
0395 void difference()
0396 {
0397   TF1 *theDiffPeak = new TF1("theDiffPeak",diffPeakShape,-400,100,0);
0398   TF1 *theDiffDeco = new TF1("theDiffDeco",diffDeconvolutionShape,-50,50,0);
0399 
0400   new TCanvas;
0401   theDiffPeak->Draw();
0402   new TCanvas;
0403   theDiffDeco->Draw();
0404 
0405 }