void Sens_Matrix_LAr1ND_200m_T600_on_axis_Shape_and_Rate_5sigma(TCanvas* c)
{
   c->cd();
   TGraph *graph = new TGraph(501);
   graph->SetName("Graph0");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);
   graph->SetLineColor(9);
   graph->SetLineStyle(2);
   graph->SetPoint(0,1,0.01);
   graph->SetPoint(1,1,0.01018591388);
   graph->SetPoint(2,1,0.01037528416);
   graph->SetPoint(3,1,0.01056817509);
   graph->SetPoint(4,1,0.01076465214);
   graph->SetPoint(5,1,0.01096478196);
   graph->SetPoint(6,1,0.01116863248);
   graph->SetPoint(7,1,0.01137627286);
   graph->SetPoint(8,1,0.01158777356);
   graph->SetPoint(9,1,0.01180320636);
   graph->SetPoint(10,1,0.01202264435);
   graph->SetPoint(11,1,0.01224616199);
   graph->SetPoint(12,1,0.01247383514);
   graph->SetPoint(13,1,0.01270574105);
   graph->SetPoint(14,1,0.01294195841);
   graph->SetPoint(15,1,0.01318256739);
   graph->SetPoint(16,1,0.01342764961);
   graph->SetPoint(17,1,0.01367728826);
   graph->SetPoint(18,1,0.01393156803);
   graph->SetPoint(19,1,0.01419057522);
   graph->SetPoint(20,1,0.01445439771);
   graph->SetPoint(21,1,0.01472312502);
   graph->SetPoint(22,1,0.01499684836);
   graph->SetPoint(23,1,0.01527566058);
   graph->SetPoint(24,1,0.01555965632);
   graph->SetPoint(25,1,0.01584893192);
   graph->SetPoint(26,1,0.01614358557);
   graph->SetPoint(27,1,0.01644371723);
   graph->SetPoint(28,1,0.01674942876);
   graph->SetPoint(29,1,0.01706082389);
   graph->SetPoint(30,1,0.01737800829);
   graph->SetPoint(31,1,0.01770108958);
   graph->SetPoint(32,1,0.01803017741);
   graph->SetPoint(33,1,0.01836538343);
   graph->SetPoint(34,1,0.0187068214);
   graph->SetPoint(35,1,0.01905460718);
   graph->SetPoint(36,1,0.01940885878);
   graph->SetPoint(37,1,0.0197696964);
   graph->SetPoint(38,1,0.0201372425);
   graph->SetPoint(39,1,0.02051162179);
   graph->SetPoint(40,1,0.02089296131);
   graph->SetPoint(41,1,0.02128139046);
   graph->SetPoint(42,1,0.02167704105);
   graph->SetPoint(43,1,0.02208004733);
   graph->SetPoint(44,1,0.02249054606);
   graph->SetPoint(45,1,0.02290867653);
   graph->SetPoint(46,1,0.02333458062);
   graph->SetPoint(47,1,0.02376840287);
   graph->SetPoint(48,1,0.02421029047);
   graph->SetPoint(49,1,0.02466039337);
   graph->SetPoint(50,1,0.02511886432);
   graph->SetPoint(51,1,0.02558585887);
   graph->SetPoint(52,1,0.0260615355);
   graph->SetPoint(53,1,0.02654605562);
   graph->SetPoint(54,1,0.02703958364);
   graph->SetPoint(55,1,0.02754228703);
   graph->SetPoint(56,1,0.02805433638);
   graph->SetPoint(57,1,0.02857590543);
   graph->SetPoint(58,1,0.02910717118);
   graph->SetPoint(59,1,0.0296483139);
   graph->SetPoint(60,1,0.0301995172);
   graph->SetPoint(61,1,0.03076096815);
   graph->SetPoint(62,1,0.03133285724);
   graph->SetPoint(63,1,0.03191537855);
   graph->SetPoint(64,1,0.03250872974);
   graph->SetPoint(65,1,0.03311311215);
   graph->SetPoint(66,1,0.03372873087);
   graph->SetPoint(67,1,0.03435579479);
   graph->SetPoint(68,1,0.0349945167);
   graph->SetPoint(69,1,0.03564511334);
   graph->SetPoint(70,1,0.03630780548);
   graph->SetPoint(71,1,0.03698281798);
   graph->SetPoint(72,1,0.0376703799);
   graph->SetPoint(73,1,0.03837072455);
   graph->SetPoint(74,1,0.03908408958);
   graph->SetPoint(75,1,0.03981071706);
   graph->SetPoint(76,1,0.04055085354);
   graph->SetPoint(77,1,0.0413047502);
   graph->SetPoint(78,1,0.04207266284);
   graph->SetPoint(79,1,0.04285485204);
   graph->SetPoint(80,1,0.04365158322);
   graph->SetPoint(81,1,0.04446312675);
   graph->SetPoint(82,1,0.04528975799);
   graph->SetPoint(83,1,0.04613175746);
   graph->SetPoint(84,1,0.04698941086);
   graph->SetPoint(85,1,0.04786300923);
   graph->SetPoint(86,1,0.04875284901);
   graph->SetPoint(87,1,0.04965923215);
   graph->SetPoint(88,1,0.0505824662);
   graph->SetPoint(89,1,0.05152286446);
   graph->SetPoint(90,1,0.05248074602);
   graph->SetPoint(91,1,0.05345643594);
   graph->SetPoint(92,1,0.05445026528);
   graph->SetPoint(93,1,0.0554625713);
   graph->SetPoint(94,1,0.05649369748);
   graph->SetPoint(95,1,0.05754399373);
   graph->SetPoint(96,1,0.05861381645);
   graph->SetPoint(97,1,0.05970352866);
   graph->SetPoint(98,1,0.06081350013);
   graph->SetPoint(99,1,0.06194410751);
   graph->SetPoint(100,1,0.06309573445);
   graph->SetPoint(101,1,0.06426877173);
   graph->SetPoint(102,1,0.06546361741);
   graph->SetPoint(103,1,0.06668067692);
   graph->SetPoint(104,1,0.06792036326);
   graph->SetPoint(105,1,0.06918309709);
   graph->SetPoint(106,1,0.0704693069);
   graph->SetPoint(107,1,0.07177942913);
   graph->SetPoint(108,1,0.07311390835);
   graph->SetPoint(109,1,0.07447319739);
   graph->SetPoint(110,1,0.0758577575);
   graph->SetPoint(111,1,0.07726805851);
   graph->SetPoint(112,1,0.07870457897);
   graph->SetPoint(113,1,0.08016780634);
   graph->SetPoint(114,1,0.08165823714);
   graph->SetPoint(115,1,0.08317637711);
   graph->SetPoint(116,1,0.08472274141);
   graph->SetPoint(117,1,0.08629785478);
   graph->SetPoint(118,1,0.08790225168);
   graph->SetPoint(119,1,0.08953647655);
   graph->SetPoint(120,1,0.09120108394);
   graph->SetPoint(121,1,0.09289663868);
   graph->SetPoint(122,1,0.09462371614);
   graph->SetPoint(123,1,0.09638290236);
   graph->SetPoint(124,1,0.0981747943);
   graph->SetPoint(125,1,0.1);
   graph->SetPoint(126,0.981747943,0.1018591388);
   graph->SetPoint(127,0.9462371614,0.1037528416);
   graph->SetPoint(128,0.9120108394,0.1056817509);
   graph->SetPoint(129,0.8790225168,0.1076465214);
   graph->SetPoint(130,0.8472274141,0.1096478196);
   graph->SetPoint(131,0.8165823714,0.1116863248);
   graph->SetPoint(132,0.7870457897,0.1137627286);
   graph->SetPoint(133,0.758577575,0.1158777356);
   graph->SetPoint(134,0.7311390835,0.1180320636);
   graph->SetPoint(135,0.704693069,0.1202264435);
   graph->SetPoint(136,0.6792036326,0.1224616199);
   graph->SetPoint(137,0.6668067692,0.1247383514);
   graph->SetPoint(138,0.6426877173,0.1270574105);
   graph->SetPoint(139,0.6194410751,0.1294195841);
   graph->SetPoint(140,0.5970352866,0.1318256739);
   graph->SetPoint(141,0.5754399373,0.1342764961);
   graph->SetPoint(142,0.554625713,0.1367728826);
   graph->SetPoint(143,0.5345643594,0.1393156803);
   graph->SetPoint(144,0.5152286446,0.1419057522);
   graph->SetPoint(145,0.4965923215,0.1445439771);
   graph->SetPoint(146,0.4786300923,0.1472312502);
   graph->SetPoint(147,0.4613175746,0.1499684836);
   graph->SetPoint(148,0.4446312675,0.1527566058);
   graph->SetPoint(149,0.4285485204,0.1555965632);
   graph->SetPoint(150,0.413047502,0.1584893192);
   graph->SetPoint(151,0.3981071706,0.1614358557);
   graph->SetPoint(152,0.3837072455,0.1644371723);
   graph->SetPoint(153,0.3698281798,0.1674942876);
   graph->SetPoint(154,0.3564511334,0.1706082389);
   graph->SetPoint(155,0.349945167,0.1737800829);
   graph->SetPoint(156,0.3372873087,0.1770108958);
   graph->SetPoint(157,0.3250872974,0.1803017741);
   graph->SetPoint(158,0.3133285724,0.1836538343);
   graph->SetPoint(159,0.301995172,0.187068214);
   graph->SetPoint(160,0.2910717118,0.1905460718);
   graph->SetPoint(161,0.2805433638,0.1940885878);
   graph->SetPoint(162,0.2703958364,0.197696964);
   graph->SetPoint(163,0.260615355,0.201372425);
   graph->SetPoint(164,0.2511886432,0.2051162179);
   graph->SetPoint(165,0.2466039337,0.2089296131);
   graph->SetPoint(166,0.2376840287,0.2128139046);
   graph->SetPoint(167,0.2290867653,0.2167704105);
   graph->SetPoint(168,0.2208004733,0.2208004733);
   graph->SetPoint(169,0.2128139046,0.2249054606);
   graph->SetPoint(170,0.2051162179,0.2290867653);
   graph->SetPoint(171,0.197696964,0.2333458062);
   graph->SetPoint(172,0.1905460718,0.2376840287);
   graph->SetPoint(173,0.187068214,0.2421029047);
   graph->SetPoint(174,0.1803017741,0.2466039337);
   graph->SetPoint(175,0.1737800829,0.2511886432);
   graph->SetPoint(176,0.1674942876,0.2558585887);
   graph->SetPoint(177,0.1614358557,0.260615355);
   graph->SetPoint(178,0.1555965632,0.2654605562);
   graph->SetPoint(179,0.1527566058,0.2703958364);
   graph->SetPoint(180,0.1472312502,0.2754228703);
   graph->SetPoint(181,0.1419057522,0.2805433638);
   graph->SetPoint(182,0.1367728826,0.2857590543);
   graph->SetPoint(183,0.1318256739,0.2910717118);
   graph->SetPoint(184,0.1294195841,0.296483139);
   graph->SetPoint(185,0.1247383514,0.301995172);
   graph->SetPoint(186,0.1202264435,0.3076096815);
   graph->SetPoint(187,0.1158777356,0.3133285724);
   graph->SetPoint(188,0.1137627286,0.3191537855);
   graph->SetPoint(189,0.1096478196,0.3250872974);
   graph->SetPoint(190,0.1056817509,0.3311311215);
   graph->SetPoint(191,0.1018591388,0.3372873087);
   graph->SetPoint(192,0.1,0.3435579479);
   graph->SetPoint(193,0.09638290236,0.349945167);
   graph->SetPoint(194,0.09289663868,0.3564511334);
   graph->SetPoint(195,0.09120108394,0.3630780548);
   graph->SetPoint(196,0.08790225168,0.3698281798);
   graph->SetPoint(197,0.08472274141,0.376703799);
   graph->SetPoint(198,0.08317637711,0.3837072455);
   graph->SetPoint(199,0.08016780634,0.3908408958);
   graph->SetPoint(200,0.07726805851,0.3981071706);
   graph->SetPoint(201,0.0758577575,0.4055085354);
   graph->SetPoint(202,0.07311390835,0.413047502);
   graph->SetPoint(203,0.07177942913,0.4207266284);
   graph->SetPoint(204,0.06918309709,0.4285485204);
   graph->SetPoint(205,0.06792036326,0.4365158322);
   graph->SetPoint(206,0.06546361741,0.4446312675);
   graph->SetPoint(207,0.06309573445,0.4528975799);
   graph->SetPoint(208,0.06194410751,0.4613175746);
   graph->SetPoint(209,0.05970352866,0.4698941086);
   graph->SetPoint(210,0.05861381645,0.4786300923);
   graph->SetPoint(211,0.05754399373,0.4875284901);
   graph->SetPoint(212,0.0554625713,0.4965923215);
   graph->SetPoint(213,0.05445026528,0.505824662);
   graph->SetPoint(214,0.05248074602,0.5152286446);
   graph->SetPoint(215,0.05152286446,0.5248074602);
   graph->SetPoint(216,0.0505824662,0.5345643594);
   graph->SetPoint(217,0.04875284901,0.5445026528);
   graph->SetPoint(218,0.04786300923,0.554625713);
   graph->SetPoint(219,0.04698941086,0.5649369748);
   graph->SetPoint(220,0.04528975799,0.5754399373);
   graph->SetPoint(221,0.04446312675,0.5861381645);
   graph->SetPoint(222,0.04365158322,0.5970352866);
   graph->SetPoint(223,0.04207266284,0.6081350013);
   graph->SetPoint(224,0.0413047502,0.6194410751);
   graph->SetPoint(225,0.04055085354,0.6309573445);
   graph->SetPoint(226,0.03981071706,0.6426877173);
   graph->SetPoint(227,0.03908408958,0.6546361741);
   graph->SetPoint(228,0.03837072455,0.6668067692);
   graph->SetPoint(229,0.03698281798,0.6792036326);
   graph->SetPoint(230,0.03630780548,0.6918309709);
   graph->SetPoint(231,0.03564511334,0.704693069);
   graph->SetPoint(232,0.0349945167,0.7177942913);
   graph->SetPoint(233,0.03435579479,0.7311390835);
   graph->SetPoint(234,0.03372873087,0.7447319739);
   graph->SetPoint(235,0.03311311215,0.758577575);
   graph->SetPoint(236,0.03250872974,0.7726805851);
   graph->SetPoint(237,0.03191537855,0.7870457897);
   graph->SetPoint(238,0.03133285724,0.8016780634);
   graph->SetPoint(239,0.03076096815,0.8165823714);
   graph->SetPoint(240,0.0301995172,0.8317637711);
   graph->SetPoint(241,0.0296483139,0.8472274141);
   graph->SetPoint(242,0.0296483139,0.8629785478);
   graph->SetPoint(243,0.02910717118,0.8790225168);
   graph->SetPoint(244,0.02857590543,0.8953647655);
   graph->SetPoint(245,0.02805433638,0.9120108394);
   graph->SetPoint(246,0.02754228703,0.9289663868);
   graph->SetPoint(247,0.02703958364,0.9462371614);
   graph->SetPoint(248,0.02703958364,0.9638290236);
   graph->SetPoint(249,0.02654605562,0.981747943);
   graph->SetPoint(250,0.0260615355,1);
   graph->SetPoint(251,0.02558585887,1.018591388);
   graph->SetPoint(252,0.02511886432,1.037528416);
   graph->SetPoint(253,0.02511886432,1.056817509);
   graph->SetPoint(254,0.02466039337,1.076465214);
   graph->SetPoint(255,0.02421029047,1.096478196);
   graph->SetPoint(256,0.02421029047,1.116863248);
   graph->SetPoint(257,0.02376840287,1.137627286);
   graph->SetPoint(258,0.02333458062,1.158777356);
   graph->SetPoint(259,0.02333458062,1.180320636);
   graph->SetPoint(260,0.02290867653,1.202264435);
   graph->SetPoint(261,0.02249054606,1.224616199);
   graph->SetPoint(262,0.02249054606,1.247383514);
   graph->SetPoint(263,0.02208004733,1.270574105);
   graph->SetPoint(264,0.02208004733,1.294195841);
   graph->SetPoint(265,0.02167704105,1.318256739);
   graph->SetPoint(266,0.02167704105,1.342764961);
   graph->SetPoint(267,0.02128139046,1.367728826);
   graph->SetPoint(268,0.02128139046,1.393156803);
   graph->SetPoint(269,0.02089296131,1.419057522);
   graph->SetPoint(270,0.02089296131,1.445439771);
   graph->SetPoint(271,0.02089296131,1.472312502);
   graph->SetPoint(272,0.02051162179,1.499684836);
   graph->SetPoint(273,0.02051162179,1.527566058);
   graph->SetPoint(274,0.02051162179,1.555965632);
   graph->SetPoint(275,0.0201372425,1.584893192);
   graph->SetPoint(276,0.0201372425,1.614358557);
   graph->SetPoint(277,0.0201372425,1.644371723);
   graph->SetPoint(278,0.0201372425,1.674942876);
   graph->SetPoint(279,0.0201372425,1.706082389);
   graph->SetPoint(280,0.0201372425,1.737800829);
   graph->SetPoint(281,0.0197696964,1.770108958);
   graph->SetPoint(282,0.0197696964,1.803017741);
   graph->SetPoint(283,0.0197696964,1.836538343);
   graph->SetPoint(284,0.0197696964,1.87068214);
   graph->SetPoint(285,0.0197696964,1.905460718);
   graph->SetPoint(286,0.0197696964,1.940885878);
   graph->SetPoint(287,0.0197696964,1.97696964);
   graph->SetPoint(288,0.0201372425,2.01372425);
   graph->SetPoint(289,0.0201372425,2.051162179);
   graph->SetPoint(290,0.0201372425,2.089296131);
   graph->SetPoint(291,0.0201372425,2.128139046);
   graph->SetPoint(292,0.0201372425,2.167704105);
   graph->SetPoint(293,0.02051162179,2.208004733);
   graph->SetPoint(294,0.02051162179,2.249054606);
   graph->SetPoint(295,0.02051162179,2.290867653);
   graph->SetPoint(296,0.02051162179,2.333458062);
   graph->SetPoint(297,0.02089296131,2.376840287);
   graph->SetPoint(298,0.02089296131,2.421029047);
   graph->SetPoint(299,0.02128139046,2.466039337);
   graph->SetPoint(300,0.02128139046,2.511886432);
   graph->SetPoint(301,0.02167704105,2.558585887);
   graph->SetPoint(302,0.02167704105,2.60615355);
   graph->SetPoint(303,0.02208004733,2.654605562);
   graph->SetPoint(304,0.02249054606,2.703958364);
   graph->SetPoint(305,0.02249054606,2.754228703);
   graph->SetPoint(306,0.02290867653,2.805433638);
   graph->SetPoint(307,0.02333458062,2.857590543);
   graph->SetPoint(308,0.02376840287,2.910717118);
   graph->SetPoint(309,0.02376840287,2.96483139);
   graph->SetPoint(310,0.02421029047,3.01995172);
   graph->SetPoint(311,0.02466039337,3.076096815);
   graph->SetPoint(312,0.02511886432,3.133285724);
   graph->SetPoint(313,0.02558585887,3.191537855);
   graph->SetPoint(314,0.0260615355,3.250872974);
   graph->SetPoint(315,0.02654605562,3.311311215);
   graph->SetPoint(316,0.02703958364,3.372873087);
   graph->SetPoint(317,0.02754228703,3.435579479);
   graph->SetPoint(318,0.02805433638,3.49945167);
   graph->SetPoint(319,0.02857590543,3.564511334);
   graph->SetPoint(320,0.02910717118,3.630780548);
   graph->SetPoint(321,0.02910717118,3.698281798);
   graph->SetPoint(322,0.0296483139,3.76703799);
   graph->SetPoint(323,0.0301995172,3.837072455);
   graph->SetPoint(324,0.03076096815,3.908408958);
   graph->SetPoint(325,0.03133285724,3.981071706);
   graph->SetPoint(326,0.03133285724,4.055085354);
   graph->SetPoint(327,0.03191537855,4.13047502);
   graph->SetPoint(328,0.03191537855,4.207266284);
   graph->SetPoint(329,0.03250872974,4.285485204);
   graph->SetPoint(330,0.03250872974,4.365158322);
   graph->SetPoint(331,0.03250872974,4.446312675);
   graph->SetPoint(332,0.03250872974,4.528975799);
   graph->SetPoint(333,0.03250872974,4.613175746);
   graph->SetPoint(334,0.03250872974,4.698941086);
   graph->SetPoint(335,0.03250872974,4.786300923);
   graph->SetPoint(336,0.03250872974,4.875284901);
   graph->SetPoint(337,0.03191537855,4.965923215);
   graph->SetPoint(338,0.03191537855,5.05824662);
   graph->SetPoint(339,0.03191537855,5.152286446);
   graph->SetPoint(340,0.03191537855,5.248074602);
   graph->SetPoint(341,0.03191537855,5.345643594);
   graph->SetPoint(342,0.03191537855,5.445026528);
   graph->SetPoint(343,0.03191537855,5.54625713);
   graph->SetPoint(344,0.03191537855,5.649369748);
   graph->SetPoint(345,0.03191537855,5.754399373);
   graph->SetPoint(346,0.03191537855,5.861381645);
   graph->SetPoint(347,0.03191537855,5.970352866);
   graph->SetPoint(348,0.03250872974,6.081350013);
   graph->SetPoint(349,0.03250872974,6.194410751);
   graph->SetPoint(350,0.03250872974,6.309573445);
   graph->SetPoint(351,0.03311311215,6.426877173);
   graph->SetPoint(352,0.03311311215,6.546361741);
   graph->SetPoint(353,0.03372873087,6.668067692);
   graph->SetPoint(354,0.03435579479,6.792036326);
   graph->SetPoint(355,0.03435579479,6.918309709);
   graph->SetPoint(356,0.0349945167,7.04693069);
   graph->SetPoint(357,0.03564511334,7.177942913);
   graph->SetPoint(358,0.03630780548,7.311390835);
   graph->SetPoint(359,0.03698281798,7.447319739);
   graph->SetPoint(360,0.0376703799,7.58577575);
   graph->SetPoint(361,0.03837072455,7.726805851);
   graph->SetPoint(362,0.03908408958,7.870457897);
   graph->SetPoint(363,0.03981071706,8.016780634);
   graph->SetPoint(364,0.04055085354,8.165823714);
   graph->SetPoint(365,0.0413047502,8.317637711);
   graph->SetPoint(366,0.04207266284,8.472274141);
   graph->SetPoint(367,0.04207266284,8.629785478);
   graph->SetPoint(368,0.04285485204,8.790225168);
   graph->SetPoint(369,0.04285485204,8.953647655);
   graph->SetPoint(370,0.04365158322,9.120108394);
   graph->SetPoint(371,0.04365158322,9.289663868);
   graph->SetPoint(372,0.04446312675,9.462371614);
   graph->SetPoint(373,0.04446312675,9.638290236);
   graph->SetPoint(374,0.04446312675,9.81747943);
   graph->SetPoint(375,0.04528975799,10);
   graph->SetPoint(376,0.04613175746,10.18591388);
   graph->SetPoint(377,0.04613175746,10.37528416);
   graph->SetPoint(378,0.04698941086,10.56817509);
   graph->SetPoint(379,0.04786300923,10.76465214);
   graph->SetPoint(380,0.04786300923,10.96478196);
   graph->SetPoint(381,0.04875284901,11.16863248);
   graph->SetPoint(382,0.04875284901,11.37627286);
   graph->SetPoint(383,0.04875284901,11.58777356);
   graph->SetPoint(384,0.04965923215,11.80320636);
   graph->SetPoint(385,0.04965923215,12.02264435);
   graph->SetPoint(386,0.04965923215,12.24616199);
   graph->SetPoint(387,0.0505824662,12.47383514);
   graph->SetPoint(388,0.0505824662,12.70574105);
   graph->SetPoint(389,0.05152286446,12.94195841);
   graph->SetPoint(390,0.05248074602,13.18256739);
   graph->SetPoint(391,0.05345643594,13.42764961);
   graph->SetPoint(392,0.05445026528,13.67728826);
   graph->SetPoint(393,0.0554625713,13.93156803);
   graph->SetPoint(394,0.05649369748,14.19057522);
   graph->SetPoint(395,0.05754399373,14.45439771);
   graph->SetPoint(396,0.05861381645,14.72312502);
   graph->SetPoint(397,0.05970352866,14.99684836);
   graph->SetPoint(398,0.06081350013,15.27566058);
   graph->SetPoint(399,0.06194410751,15.55965632);
   graph->SetPoint(400,0.06426877173,15.84893192);
   graph->SetPoint(401,0.06546361741,16.14358557);
   graph->SetPoint(402,0.06668067692,16.44371723);
   graph->SetPoint(403,0.06792036326,16.74942876);
   graph->SetPoint(404,0.06918309709,17.06082389);
   graph->SetPoint(405,0.0704693069,17.37800829);
   graph->SetPoint(406,0.07177942913,17.70108958);
   graph->SetPoint(407,0.07311390835,18.03017741);
   graph->SetPoint(408,0.07447319739,18.36538343);
   graph->SetPoint(409,0.0758577575,18.7068214);
   graph->SetPoint(410,0.0758577575,19.05460718);
   graph->SetPoint(411,0.07726805851,19.40885878);
   graph->SetPoint(412,0.07726805851,19.7696964);
   graph->SetPoint(413,0.07870457897,20.1372425);
   graph->SetPoint(414,0.08016780634,20.51162179);
   graph->SetPoint(415,0.08165823714,20.89296131);
   graph->SetPoint(416,0.08472274141,21.28139046);
   graph->SetPoint(417,0.08629785478,21.67704105);
   graph->SetPoint(418,0.08953647655,22.08004733);
   graph->SetPoint(419,0.09289663868,22.49054606);
   graph->SetPoint(420,0.09462371614,22.90867653);
   graph->SetPoint(421,0.09638290236,23.33458062);
   graph->SetPoint(422,0.0981747943,23.76840287);
   graph->SetPoint(423,0.1,24.21029047);
   graph->SetPoint(424,0.1018591388,24.66039337);
   graph->SetPoint(425,0.1056817509,25.11886432);
   graph->SetPoint(426,0.1116863248,25.58585887);
   graph->SetPoint(427,0.1180320636,26.0615355);
   graph->SetPoint(428,0.1270574105,26.54605562);
   graph->SetPoint(429,0.1367728826,27.03958364);
   graph->SetPoint(430,0.1445439771,27.54228703);
   graph->SetPoint(431,0.1527566058,28.05433638);
   graph->SetPoint(432,0.1555965632,28.57590543);
   graph->SetPoint(433,0.1584893192,29.10717118);
   graph->SetPoint(434,0.1614358557,29.6483139);
   graph->SetPoint(435,0.1614358557,30.1995172);
   graph->SetPoint(436,0.1644371723,30.76096815);
   graph->SetPoint(437,0.1674942876,31.33285724);
   graph->SetPoint(438,0.1706082389,31.91537855);
   graph->SetPoint(439,0.1706082389,32.50872974);
   graph->SetPoint(440,0.1737800829,33.11311215);
   graph->SetPoint(441,0.1803017741,33.72873087);
   graph->SetPoint(442,0.187068214,34.35579479);
   graph->SetPoint(443,0.1940885878,34.9945167);
   graph->SetPoint(444,0.2051162179,35.64511334);
   graph->SetPoint(445,0.2128139046,36.30780548);
   graph->SetPoint(446,0.2208004733,36.98281798);
   graph->SetPoint(447,0.2290867653,37.6703799);
   graph->SetPoint(448,0.2333458062,38.37072455);
   graph->SetPoint(449,0.2376840287,39.08408958);
   graph->SetPoint(450,0.2466039337,39.81071706);
   graph->SetPoint(451,0.2558585887,40.55085354);
   graph->SetPoint(452,0.2703958364,41.3047502);
   graph->SetPoint(453,0.2857590543,42.07266284);
   graph->SetPoint(454,0.301995172,42.85485204);
   graph->SetPoint(455,0.3133285724,43.65158322);
   graph->SetPoint(456,0.3191537855,44.46312675);
   graph->SetPoint(457,0.3250872974,45.28975799);
   graph->SetPoint(458,0.3311311215,46.13175746);
   graph->SetPoint(459,0.3435579479,46.98941086);
   graph->SetPoint(460,0.349945167,47.86300923);
   graph->SetPoint(461,0.3564511334,48.75284901);
   graph->SetPoint(462,0.3698281798,49.65923215);
   graph->SetPoint(463,0.3837072455,50.5824662);
   graph->SetPoint(464,0.4055085354,51.52286446);
   graph->SetPoint(465,0.413047502,52.48074602);
   graph->SetPoint(466,0.4207266284,53.45643594);
   graph->SetPoint(467,0.4207266284,54.45026528);
   graph->SetPoint(468,0.4207266284,55.4625713);
   graph->SetPoint(469,0.413047502,56.49369748);
   graph->SetPoint(470,0.4055085354,57.54399373);
   graph->SetPoint(471,0.4055085354,58.61381645);
   graph->SetPoint(472,0.4055085354,59.70352866);
   graph->SetPoint(473,0.413047502,60.81350013);
   graph->SetPoint(474,0.413047502,61.94410751);
   graph->SetPoint(475,0.4207266284,63.09573445);
   graph->SetPoint(476,0.4285485204,64.26877173);
   graph->SetPoint(477,0.4365158322,65.46361741);
   graph->SetPoint(478,0.4446312675,66.68067692);
   graph->SetPoint(479,0.4446312675,67.92036326);
   graph->SetPoint(480,0.4528975799,69.18309709);
   graph->SetPoint(481,0.4528975799,70.4693069);
   graph->SetPoint(482,0.4446312675,71.77942913);
   graph->SetPoint(483,0.4528975799,73.11390835);
   graph->SetPoint(484,0.4528975799,74.47319739);
   graph->SetPoint(485,0.4446312675,75.8577575);
   graph->SetPoint(486,0.4528975799,77.26805851);
   graph->SetPoint(487,0.4528975799,78.70457897);
   graph->SetPoint(488,0.4528975799,80.16780634);
   graph->SetPoint(489,0.4446312675,81.65823714);
   graph->SetPoint(490,0.4446312675,83.17637711);
   graph->SetPoint(491,0.4446312675,84.72274141);
   graph->SetPoint(492,0.4446312675,86.29785478);
   graph->SetPoint(493,0.4528975799,87.90225168);
   graph->SetPoint(494,0.4446312675,89.53647655);
   graph->SetPoint(495,0.4528975799,91.20108394);
   graph->SetPoint(496,0.4528975799,92.89663868);
   graph->SetPoint(497,0.4446312675,94.62371614);
   graph->SetPoint(498,0.4446312675,96.38290236);
   graph->SetPoint(499,0.4446312675,98.1747943);
   graph->SetPoint(500,0.4446312675,100);

    graph->SetLineColor(kBlue-3);
    graph->SetLineStyle(1);
    graph->SetLineWidth(2);
    graph->Draw("l same");

}
Ejemplo n.º 2
0
TGraph* GetStat(TString className="CVHMV0M-B-NOPF-CENTNOTRD",Bool_t lumi=1, Bool_t goodOnly=0, TString part="PHYSICS_1"){
  Double_t stat[100000];
  Double_t time_stamp[100000];
  TH1D* hStat      = new TH1D("hStat","",1,0,1);
  TH1D* hTimeStart = new TH1D("hTimeStart","",1,0,1);
  TH1D* hTimeEnd   = new TH1D("hTimeEnd","",1,0,1);
  TString classNameRun;

  for (Int_t r=0;r<t->GetEntries();r++){
    t->GetEntry(r);
    if (!partition->String().Contains(part.Data())) continue;
    if (!lhcState->String().Contains("STABLE")) continue;
    if (!lhcPeriod->String().Contains("LHC15m")) continue;
    if (run<225000) continue;
    hTimeStart->Fill(Form("%i",run),timeStart);
    hTimeEnd->Fill(Form("%i",run),timeEnd);
    classNameRun = TString(className);
    if (className.EqualTo("CEMC7-B-NOPF-CENTNOTRD")                  && run<=236224) classNameRun="CEMC7-ABCE-NOPF-ALLNOTRD";
    if (className.EqualTo("CDMC7-B-NOPF-CENTNOTRD")                  && run<=236224) classNameRun="CDMC7-ABCE-NOPF-ALLNOTRD";
    if (className.EqualTo("CMUL7-B-NOPF-MUFAST")                     && run<=226606) classNameRun="CMUL7-B-NOPF-ALLNOTRD";
    if (className.EqualTo("CVHMV0M-B-NOPF-CENTNOTRD")                && run<=236221) classNameRun="CVHMV0M-B-NOPF-CENT";
    if (className.EqualTo("CVHMSH2-B-NOPF-CENTNOTRD")                && run<=236226) classNameRun="CVHMSH2-B-NOPF-CENT";
    if (className.EqualTo("CVHMV0M-B-NOPF-CENTNOTRD") && run>=238432 && run<=239144) classNameRun="CVHMV0M-B-SPD1-CENTNOTRD"; 
    if (className.EqualTo("CVHMSH2-B-NOPF-CENTNOTRD") && run>=238432               ) classNameRun="CVHMSH2-B-SPD1-CENTNOTRD";
    if (className.EqualTo("CINT7-B-NOPF-CENT")        && run>=225000 && run<=228935) classNameRun="CINT7-B-NOPF-ALLNOTRD";
    if (className.EqualTo("CINT7-B-NOPF-CENT")        && run>=228936 && run<=229893) classNameRun="CINT7-B-NOPF-CENTNOTRD";
    if (className.EqualTo("CINT7-B-NOPF-CENT")        && run>=229894 && run<=229899) classNameRun="CINT7-B-NOPF-ALLNOTRD";
    if (className.EqualTo("CINT7-B-NOPF-CENT")        && run>=229900 && run<=233911) classNameRun="CINT7-B-NOPF-CENT";
    if (className.EqualTo("CINT7-B-NOPF-CENT")        && run>=233912 && run<=234050) classNameRun="CINT7-B-NOPF-ALLNOTRD";
    if (className.EqualTo("CINT7-B-NOPF-CENT")        && run>=238890 && run<=239144) classNameRun="CINT7-I-NOPF-CENTNOTRD";
    if (className.EqualTo("CEMC7-B-NOPF-CENTNOTRD")                  && run<=236224) classNameRun="CEMC7-ABCE-NOPF-ALLNOTRD";
    if (className.EqualTo("CDMC7-B-NOPF-CENTNOTRD")                  && run<=236224) classNameRun="CDMC7-ABCE-NOPF-ALLNOTRD";

    AliTriggerClass* cl = (AliTriggerClass*) classes->FindObject(classNameRun.Data());
    if (!cl) { 
      hStat->Fill(Form("%i",run),0.); 
      continue; 
    }
    
    if (goodOnly){
      if (classNameRun.Contains("CINT7") || classNameRun.Contains("CVHM")){
        Int_t good=0;
        for (Int_t i=0;i<nGoodRuns;i++) good|= (goodRuns[i]==run);
        if (!good) {
          hStat->Fill(Form("%i",run),0.);
          continue;
        }
      }

      if (className.Contains("MC7")){
        if (run<235709 || run==236855 || run==236858 || run==236861 || fill==4440) {
          hStat->Fill(Form("%i",run),0.);
          continue;
        }
      }

      if (classNameRun.Contains("CMUL")){
        if (!activeDetectors->String().Contains("MUONTRK") ||
            !activeDetectors->String().Contains("MUONTRG") ||
            !activeDetectors->String().Contains("T0") ||
            !activeDetectors->String().Contains("VZERO") ||
            !activeDetectors->String().Contains("ITSSPD")
        ){
          hStat->Fill(Form("%i",run),0.);
          continue;
        }
      }
    }
//    printf("%i\n",classes->IndexOf(cl));
    Double_t x = lumi ? class_lumi[classes->IndexOf(cl)] : class_l2a[classes->IndexOf(cl)];
    hStat->Fill(Form("%i",run),x);
  }
  hStat->GetXaxis()->LabelsOption("a");
  hTimeEnd->GetXaxis()->LabelsOption("a");
  hTimeStart->GetXaxis()->LabelsOption("a");
  hStat->LabelsDeflate("x");
  hTimeStart->LabelsDeflate("x");
  hTimeEnd->LabelsDeflate("x");
  
  Int_t n = 2*hStat->GetNbinsX();

  for (Int_t i=0;i<hStat->GetNbinsX();i++){
    time_stamp[2*i  ] = hTimeStart->GetBinContent(i+1);
    time_stamp[2*i+1] = hTimeEnd->GetBinContent(i+1);
    stat[2*i]         = i>0?stat[2*i-1]:0;
    stat[2*i+1]       = stat[2*i]+hStat->GetBinContent(i+1)/1000000.;
  }

  delete hStat;
  delete hTimeStart;
  delete hTimeEnd;
  TGraph* gStat = new TGraph(n,time_stamp,stat);
  gStat->SetLineColor(kBlue);
  gStat->SetLineWidth(2);
  return gStat;
}
Ejemplo n.º 3
0
void PlotRakeBunch( const TString &sim, Int_t time, Int_t index = 0, const TString &options="") {
  
#ifdef __CINT__  
  gSystem->Load("libplasma.so");
#endif

  PlasmaGlob::Initialize();

  TString opt = options;
 
  // Palettes!
  gROOT->Macro("PlasmaPalettes.C");

  if(opt.Contains("grid")) {
    gStyle->SetPadGridX(1);
    gStyle->SetPadGridY(1);
  }
  gStyle->SetLabelFont(42,"xyz");
  gStyle->SetTextFont(62);
 

  // Load PData
  PData *pData = PData::Get(sim.Data());
  pData->LoadFileNames(time);
  if(!pData->IsInit()) return;

  Bool_t CYL = kFALSE;
  if(sim.Contains("cyl")) CYL = kTRUE; 
    
  Bool_t ThreeD = kFALSE;
  if(sim.Contains("3D")) ThreeD = kTRUE; 

  // Some plasma constants
  Double_t n0 = pData->GetPlasmaDensity();
  Double_t kp = pData->GetPlasmaK();
  Double_t skindepth = 1.;
  if(kp!=0.0) skindepth = 1/kp;
  Double_t E0 = pData->GetPlasmaE0();

  // Time in OU
  Float_t Time = pData->GetRealTime();
  // z start of the plasma in normalized units.
  Float_t zStartPlasma = pData->GetPlasmaStart()*kp;
  // z start of the beam in normalized units.
  Float_t zStartBeam = pData->GetBeamStart()*kp;
  
  opt += "comovcenter";

  // Centering time and z position:
  Double_t shiftz = pData->Shift(opt);
  TString sshiftz = Form("(x1-%f)",shiftz);

  if(opt.Contains("center")) {
    Time -= zStartPlasma;
    if(opt.Contains("comov"))      // Centers on the head of the beam.
      Time += zStartBeam;
  } 
  
  // Spatial coordinates intervals:
  Float_t x1Min = -4.3;
  Float_t x1Max = -3.9;
  Float_t x2Min = -0.5;
  Float_t x2Max =  0.5;
  Float_t x3Min = -0.5;
  Float_t x3Max =  0.5;

  // Momentum coordinates intervals:
  Float_t p1Min =  6500.01;
  Float_t p1Max =  10099.99;
  Float_t p2Min = -20.0;
  Float_t p2Max =  20.0;
  Float_t p3Min = -20.0;
  Float_t p3Max =  20.0;

  // Bining, intervals, labels, etc.
  Int_t xNbin = 200;
  Int_t yNbin = 200;

  if(sim.Contains("DR")) {
    xNbin = 200;
    yNbin = 200;
   
    // p1Min =  2200.01;
    // p1Max =  3399.99;
    // p1Min =  3500.01;
    // p1Max =  4999.99;
    p1Min =  1800.01;
    p1Max =  3999.99;

    // x1Min = -4.0;
    // x1Max = -3.2;
    x1Min = 8637.0;
    x1Max = 8639.0;
    x2Min = -0.5;
    x2Max =  0.5;
    x3Min = -0.5;
    x3Max =  0.5;
  } else if(sim.Contains("flash") && sim.Contains(".G.") ) {
    
    x1Min = -6.3;
    x1Max = -5.0;

    //p1Min =  0.001;
    p1Min =  650.001;
    p1Max =  1499.99;
    
  } else if(sim.Contains("facet_v23kA.G.A")) {
    x1Min = -7.8;
    x1Max = -7.1;

    x2Min = -1.0;
    x2Max =  1.0;
    x3Min = -1.0;
    x3Max =  1.0;
    // t=150
    p1Min =  1100.001;
    p1Max =  1999.99;
  } else if(sim.Contains("facet_v23kA.G")) {
    x1Min = -7.8;
    x1Max = -7.0;

    x2Min = -1.0;
    x2Max =  1.0;
    x3Min = -1.0;
    x3Max =  1.0;
    // t=60
     p1Min =  350.01;
     p1Max =  799.99;
    // t = 100
    // p1Min =  700.01;
    // p1Max =  1399.99;
    // t=105
    //p1Min =  800.001;
    //p1Max =  1399.99;
    // t=183
    // p1Min =  1500.001;
    // p1Max =  2499.99;
    // t=235
    // p1Min =  2000.01;
    // p1Max =  3499.99; 
    // t=310
    // p1Min =  2800.01;
    // p1Max =  4799.99; 
  }
  
  
  // Get phasespace histos
  Int_t Nspecies = pData->NSpecies();
  if(index>Nspecies-1) {
    return;
  }
  if(!pData->GetRawFileName(index)) {
    return;    
  }
  TH1F *hX1 = NULL;
  TH1F *hP1 = NULL;
  TH2F *hP1X1 = NULL;
  TH2F *hP2X2 = NULL;


  cout << Form("\n1. Getting data... ") << endl; 
  char cutString[512];
  sprintf(cutString,"TMath::Abs(q)*(%s > %.1f && %s < %.1f && x2 > %.1f && x2 < %.1f && x3 > %.1f && x3 < %.1f)",sshiftz.Data(),x1Min,sshiftz.Data(),x1Max,x2Min,x2Max,x3Min,x3Max); 
  TCut Cut = cutString;
  cout << Form("   (applied cut: \n %s)",cutString) << endl;
  TTree *tree = pData->GetTreeRaw(pData->GetRawFileName(index)->c_str(),opt);
  
  char hName[24];
  char dCommand[128];

  cout << Form("\n2. Dumping 1D histograms.. ") << endl;
  
  sprintf(hName,"hX1");
  hX1 = (TH1F*) gROOT->FindObject(hName);
  if(hX1) delete hX1;
  hX1 = new TH1F(hName,"",xNbin,x1Min,x1Max);
  sprintf(dCommand,"%s>>%s",sshiftz.Data(),hName);
  cout << Form("   - x1. ") << endl;    
  tree->Draw(dCommand,Cut,"goff");

  sprintf(hName,"hP1");
  hP1 = (TH1F*) gROOT->FindObject(hName);
  if(hP1) delete hP1;
  hP1 = new TH1F(hName,"",yNbin,p1Min,p1Max);
  sprintf(dCommand,"p1>>%s",hName);
  cout << Form("   - p1. ") << endl;    
  tree->Draw(dCommand,Cut,"goff");

  cout << Form("\n3. Dumping 2D histograms.. ") << endl;

  sprintf(hName,"hP1X1");
  hP1X1 = (TH2F*) gROOT->FindObject(hName);
  if(hP1X1) delete hP1X1;
  hP1X1 = new TH2F(hName,"",xNbin,x1Min,x1Max,yNbin,p1Min,p1Max);
  sprintf(dCommand,"p1:%s>>%s",sshiftz.Data(),hName);
  cout << Form("   - p1 vs. x1 ") << endl;    
  tree->Draw(dCommand,Cut,"goff");
  
  sprintf(hName,"hP2X2");
  hP2X2 = (TH2F*) gROOT->FindObject(hName);
  if(hP2X2) delete hP2X2;
  hP2X2 = new TH2F(hName,"",xNbin,x2Min,x2Max,yNbin,p2Min,p2Max);
  sprintf(dCommand,"p2:x2>>%s",hName);
  cout << Form("   - p2 vs. x2 ") << endl;    
  tree->Draw(dCommand,Cut,"goff");
  
  hX1->GetXaxis()->CenterTitle();
  hX1->GetYaxis()->CenterTitle();
  hX1->GetZaxis()->CenterTitle();
  hP1X1->GetXaxis()->CenterTitle();
  hP1X1->GetYaxis()->CenterTitle();
  hP1X1->GetZaxis()->CenterTitle();
  hP2X2->GetXaxis()->CenterTitle();
  hP2X2->GetYaxis()->CenterTitle();
  hP2X2->GetZaxis()->CenterTitle();
   
  // Integrated long. emittance:

  cout << Form("\n4. Calculating integrated quantities.. ") << endl;

  Double_t xmean = 0.0;
  Double_t ymean = 0.0;
  Double_t x2mean = 0.0;
  Double_t y2mean = 0.0;
  Double_t xymean = 0.0;
  Double_t Ntotal = 0.0;
  for(Int_t i=1;i<=xNbin;i++) {
    Double_t x = hP1X1->GetXaxis()->GetBinCenter(i);
    // if(x<xmin || x>xmax) continue;
    for(Int_t j=1;j<=yNbin;j++) {
      Double_t y = hP1X1->GetYaxis()->GetBinCenter(j);
      // if(y<ymin || y>ymax) continue;
      Double_t value = TMath::Abs(hP1X1->GetBinContent(i,j));
      xmean += x*value;
      ymean += y*value;
      x2mean += x*x*value;
      y2mean += y*y*value;
      xymean += x*y*value;

      Ntotal += value;
    }
  }
  
  xmean  /= Ntotal;
  ymean  /= Ntotal;
  x2mean /= Ntotal;
  y2mean /= Ntotal;
  xymean /= Ntotal;

  Double_t xrms2  = x2mean - xmean*xmean;
  Double_t yrms2  = y2mean - ymean*ymean;
  Double_t xrms   = TMath::Sqrt(xrms2);
  Double_t yrms   = TMath::Sqrt(yrms2);
  Double_t xyrms2 = xymean - xmean*ymean;

  Double_t emittance = TMath::Sqrt(xrms2*yrms2 - xyrms2*xyrms2);
  
  // cout << " xrms = " << xrms << endl;
  
  // Sliced emittance:
  // --------------------------------------------------------------------------

  cout << Form("\n5. Slicing ") << endl;


  // Bining for sliced quantities:
  // const Int_t SNbin = 7;
  // Float_t sBinLim[SNbin+1] = {-4.16,-4.14,-4.12,-4.10,-4.08,-4.06,-4.04,-4.02};
  // const Int_t SNbin = 7;
  // Float_t sBinLim[SNbin+1] = {-4.20,-4.17,-4.14,-4.12,-4.10,-4.08,-4.06,-4.00};
  // const Int_t SNbin = 8;
  // Float_t sBinLim[SNbin+1] = {-3.93,-3.87,-3.81,-3.75,-3.69,-3.63,-3.57,-3.51,-3.45};
  
  Int_t SNbin = 7;
  Float_t nsigma = 2;
  Float_t x1BinMin = -4.16;
  Float_t x1BinMax = -4.02;
  if(sim.Contains("DR")) {
    SNbin = 150; 
    nsigma = 1.4;
  } else if(sim.Contains("facet_v23kA.G.A")) {
    SNbin = 46;
    nsigma = 1;
    x1BinMin = -7.55;
    x1BinMax = -7.25;
  } else if(sim.Contains("facet_v23kA.G")) {
    SNbin = 10;
    nsigma = 1;
    x1BinMin = -7.55;
    x1BinMax = -7.15;
  }
  
  Float_t *sBinLim = new Float_t[SNbin+1];

  if(opt.Contains("rms")) {
    sBinLim[0] = xmean - nsigma*xrms;
    sBinLim[SNbin] = xmean + nsigma*xrms;
  } else {
    sBinLim[0] = x1BinMin;
    sBinLim[SNbin] = x1BinMax;
  }

  Float_t slbinSize = (sBinLim[SNbin] - sBinLim[0])/SNbin;
  
  for(Int_t i=1;i<SNbin;i++) {
    sBinLim[i] = sBinLim[i-1] + slbinSize;
  }
  
  TH1F **hP1sl = new TH1F*[SNbin];
  TH2F **hP2X2sl = new TH2F*[SNbin];

  cout << Form("\n   - Dumping in %i bins ",SNbin) << endl;

  
  for(Int_t k=0;k<SNbin;k++) {

    cout<< Form("k = %i : (x1 > %f && x1 < %f)",k,sBinLim[k],sBinLim[k+1]) << endl; 

    sprintf(hName,"hP2X2sl_%2i",k);
    hP2X2sl[k] = (TH2F*) gROOT->FindObject(hName);
    if(hP2X2sl[k]) delete hP2X2sl[k];
    hP2X2sl[k] = new TH2F(hName,"",xNbin,x2Min,x2Max,yNbin,p2Min,p2Max);

    char zCutString[128];
    sprintf(zCutString,"(%s > %f && %s < %f)",sshiftz.Data(),sBinLim[k],sshiftz.Data(),sBinLim[k+1]); 
    TCut zCut = zCutString;
    tree->Project(hName,"p2:x2",Cut + zCut);

    sprintf(hName,"hP1sl_%2i",k);
    hP1sl[k] = (TH1F*) gROOT->FindObject(hName);
    if(hP1sl[k]) delete hP1sl[k];
    hP1sl[k] = new TH1F(hName,"",yNbin,p1Min,p1Max);
    tree->Project(hName,"p1",Cut + zCut);

  }
  

  cout << Form("\n6. Calculating sliced quantities.. ") << endl;

  TGraph *gemit = NULL;
  TGraph *gYrms = NULL;
  TGraph *gErms = NULL;
  TGraph *gErmsB = NULL;
 
  Double_t * sxmean = new Double_t[SNbin];
  Double_t * symean = new Double_t[SNbin];
  Double_t * sx2mean = new Double_t[SNbin];
  Double_t * sy2mean = new Double_t[SNbin];
  Double_t * sxymean = new Double_t[SNbin];
  Double_t * sNtotal = new Double_t[SNbin];
  Double_t * sxrms2 = new Double_t[SNbin];  
  Double_t * syrms2 = new Double_t[SNbin]; 
  Double_t * sxrms = new Double_t[SNbin];  
  Double_t * syrms = new Double_t[SNbin];  
  Double_t * sxyrms2 = new Double_t[SNbin];
 
  Double_t * xbin = new Double_t[SNbin];
  Double_t * semittance = new Double_t[SNbin];

  Double_t * sNEtotal = new Double_t[SNbin]; 
  Double_t * sEmean = new Double_t[SNbin];
  Double_t * sE2mean = new Double_t[SNbin];
  Double_t * sErms = new Double_t[SNbin];

  for(Int_t k=0;k<SNbin;k++) {
    sxmean[k] = symean[k] = sx2mean[k] = sy2mean[k] = sxymean[k] 
      = sNtotal[k] = sxrms2[k] = syrms2[k] = sxrms[k] = syrms[k]
      = sxyrms2[k] = xbin[k] = semittance[k] = 0.0;
    sNEtotal[k] = sEmean[k] = sE2mean[k] = sErms[k] = 0.0;
    
    xbin[k] = (sBinLim[k] + sBinLim[k+1])/2.;
    
    for(Int_t i=1;i<=xNbin;i++) {
      Double_t x = hP2X2sl[k]->GetXaxis()->GetBinCenter(i);
      // if(x<xmin || x>xmax) continue;
      for(Int_t j=1;j<=yNbin;j++) {
	Double_t y = hP2X2sl[k]->GetYaxis()->GetBinCenter(j);
	// if(y<ymin || y>ymax) continue;
	Double_t value = TMath::Abs(hP2X2sl[k]->GetBinContent(i,j));
	sxmean[k] += x*value;
	symean[k] += y*value;
	sx2mean[k] += x*x*value;
	sy2mean[k] += y*y*value;
	sxymean[k] += x*y*value;
	
	sNtotal[k] += value;
      }	
    }
    
    for(Int_t i=1;i<=yNbin;i++) {
      Double_t y = hP1sl[k]->GetXaxis()->GetBinCenter(i);
      Double_t value = TMath::Abs(hP1sl[k]->GetBinContent(i));
      sEmean[k] += y*value;
      sE2mean[k] += y*y*value;
      sNEtotal[k] += value;
    }
    
    sxmean[k]  /= sNtotal[k];
    symean[k]  /= sNtotal[k];
    sx2mean[k] /= sNtotal[k];
    sy2mean[k] /= sNtotal[k];
    sxymean[k] /= sNtotal[k];
      
    sxrms2[k]  = sx2mean[k] - sxmean[k]*sxmean[k];
    syrms2[k]  = sy2mean[k] - symean[k]*symean[k];
    sxrms[k]   = TMath::Sqrt(sxrms2[k]);
    syrms[k]   = TMath::Sqrt(syrms2[k]);
    sxyrms2[k] = sxymean[k] - sxmean[k]*symean[k];
      
    semittance[k] = TMath::Sqrt(sxrms2[k]*syrms2[k] - sxyrms2[k]*sxyrms2[k]);

    sEmean[k]  /= sNEtotal[k];
    sE2mean[k] /= sNEtotal[k];
    sErms[k]   =  TMath::Sqrt(sE2mean[k] - sEmean[k]*sEmean[k]);
    
    
    cout << " Bunch properties: " << endl;
    cout << Form("  xMean = %7.3f   yMean = %7.3f",sxmean[k],symean[k]) << endl;
    cout << Form("  xRms  = %7.3f   yRms  = %7.3f",sxrms[k],syrms[k]) << endl;
    cout << Form("  Emittance = %7.3f",semittance[k]) << endl;

    cout << Form("  Emean = %7.3f   Erms = %7.3f",sEmean[k],sErms[k]) << endl;
    

  }

  // Charge
  Double_t dx1 = pData->GetDX(0);
  Double_t dx2 = pData->GetDX(1);
  Double_t dx3 = pData->GetDX(2);
  
  hX1->Scale(dx1*dx2*dx3);
  Double_t Charge = hX1->Integral();
  
  // Charge *= dx1*dx2*dx3;
 
  if(opt.Contains("units")) {
    Double_t dV = skindepth * skindepth * skindepth;
    Charge *= n0 * dV * (PConst::ElectronCharge/PUnits::picocoulomb);
    cout << Form(" Integrated charge (RAW) of specie %3i = %8f pC",index,Charge) << endl;
  } else {
    cout << Form(" Integrated charge (RAW) of specie %3i = %8.4f n0 * kp^-3",index,Charge) << endl;
  }
  

  // Chaning to user units: 
  // --------------------------
  
  if(opt.Contains("units") && n0) {
    
    Int_t NbinsX = hP1X1->GetNbinsX();
    Double_t xMin = skindepth * hP1X1->GetXaxis()->GetXmin() / PUnits::um;
    Double_t xMax = skindepth * hP1X1->GetXaxis()->GetXmax() / PUnits::um;
    Int_t NbinsY = hP1X1->GetNbinsY();
    Double_t yMin = hP1X1->GetYaxis()->GetXmin() * pData->GetBeamMass() / PUnits::GeV;
    Double_t yMax = hP1X1->GetYaxis()->GetXmax() * pData->GetBeamMass() / PUnits::GeV;
    hP1X1->SetBins(NbinsX,xMin,xMax,NbinsY,yMin,yMax);
    // Converting electron density
    Double_t dVb = skindepth * skindepth * skindepth;
    Double_t dX = (xMax-xMin)/NbinsX; 
    Double_t dE = (yMax-yMin)/NbinsY; 
    for(Int_t j=0;j<hP1X1->GetNbinsX();j++) {
      for(Int_t k=0;k<hP1X1->GetNbinsY();k++) {
	Double_t binValue =  fabs(hP1X1->GetBinContent(j,k) * dx1 * dx2 * dx3 * dVb * n0 *
				  (PConst::ElectronCharge/PUnits::picocoulomb));
     	//cout << Form(" value = %f",binValue) << endl;
	hP1X1->SetBinContent(j,k,binValue);
	
      }
    }
    
    if(opt.Contains("comov"))
      hP1X1->GetXaxis()->SetTitle("#zeta [#mum]");
    else
      hP1X1->GetXaxis()->SetTitle("z [#mum]");
    
    hP1X1->GetYaxis()->SetTitle("p_{z} [GeV/c]");
    
    hP1X1->GetZaxis()->SetTitle("dQ/d#zetadp_{z} [pC]");

    hP1->SetBins(NbinsY,yMin,yMax);
    hP1->GetYaxis()->SetTitle("p_{z} [GeV/c]");

    hX1->SetBins(NbinsX,xMin,xMax);
    Double_t binSize = (xMax - xMin)/NbinsX;

    Double_t dV = skindepth * skindepth * skindepth;
    Double_t  lightspeed =  PConst::c_light / (PUnits::um/PUnits::femtosecond);
    cout << Form("Speed of light = %f",lightspeed) << endl;
    hX1->Scale(TMath::Abs(n0 * dV * (PConst::ElectronCharge/PUnits::picocoulomb) * (lightspeed/binSize)));
    
    // hX1->Scale(TMath::Abs((PUnits::um/skindepth)*(PConst::ElectronCharge/PUnits::picocoulomb)*PConst::c_light));
    
    // hX1->GetYaxis()->SetTitle("I[kA]");
    hX1->GetYaxis()->SetTitle("");
    if(opt.Contains("comov"))
      hX1->GetXaxis()->SetTitle("#zeta [#mum]");
    else
      hX1->GetXaxis()->SetTitle("z [#mum]");
    
    
    xmean *= skindepth / PUnits::um;
    xrms  *= skindepth / PUnits::um;
    ymean *= pData->GetBeamMass() / PUnits::GeV;
    yrms  *= pData->GetBeamMass() / PUnits::GeV;
    
    emittance *= (skindepth / PUnits::um);
    
    for(Int_t k=0;k<SNbin;k++) {
      xbin[k] *= skindepth / PUnits::um;

      sxmean[k] *= skindepth / PUnits::um;
      sxrms[k]  *= skindepth / PUnits::um;
      symean[k] *= pData->GetBeamMass() / PUnits::MeV;
      syrms[k] *= pData->GetBeamMass() / PUnits::MeV;
      
      semittance[k] *= (skindepth / PUnits::um);

      sEmean[k] *= pData->GetBeamMass() / PUnits::GeV;
      sErms[k]  *= 100 * pData->GetBeamMass() / PUnits::GeV / ymean; //sEmean[k];
      // sErms[k]  *= pData->GetBeamMass() / PUnits::GeV;

    }

  }


  // Create the graph with the emittances:
  gemit = new TGraph(SNbin,xbin,semittance);
  gYrms = new TGraph(SNbin,xbin,sxrms);
  gErms = new TGraph(SNbin,xbin,sErms);
  
  
  // Profile energy for p1 vs x1:
  TString pname = hP1X1->GetName();
  pname += "_pfx";
  TProfile *hP1X1prof = (TProfile*) gROOT->FindObject(pname.Data());
  if(hP1X1prof) { delete hP1X1prof; hP1X1prof = NULL; }
  hP1X1prof = hP1X1->ProfileX("_pfx",1,-1,"s");

  // get the errors from the profile:
  Int_t NP1X1Bins = hP1X1prof->GetNbinsX();
  Double_t *x1bins = new Double_t[NP1X1Bins];
  Double_t *eRms   = new Double_t[NP1X1Bins];
  for(Int_t i=1;i<=hP1X1prof->GetNbinsX();i++) {
    x1bins[i] = hP1X1prof->GetBinCenter(i);
    eRms[i] = 100 * hP1X1prof->GetBinError(i) / hP1X1prof->GetBinContent(i);
  }
  gErmsB = new TGraph(NP1X1Bins,x1bins,eRms);
  
  // Vertical Energy histogram:
  // --------------------------------------------------------------------------------   
  TGraph *gP1left = NULL;
  if(hP1) {
    Double_t *yarray   = new Double_t[yNbin];
    Double_t *xarray   = new Double_t[yNbin];
    
    // This is for the right side:
    // Double_t xMax = x1Min + (x1Max-x1Min) * 0.9;
    // Double_t xMin = x1Max;
    // And this for left:
    Double_t xMin = hX1->GetXaxis()->GetXmin();
    Double_t xMax = hX1->GetXaxis()->GetXmin() + (hX1->GetXaxis()->GetXmax()
						  -hX1->GetXaxis()->GetXmin()) * 0.2;
    Double_t EneMax = hP1->GetMaximum();
    // cout << Form("  EneMax = %f ", EneMax) << endl;
 
    for(Int_t j=0; j<yNbin; j++) {
      yarray[j] = hP1->GetBinCenter(j+1);
      xarray[j] = ((xMax-xMin)/EneMax)*hP1->GetBinContent(j+1) + xMin;

      // cout << Form("  x = %f  y = %f ", xarray[j],yarray[j]) << endl;
    }

    gP1left = new TGraph(yNbin,xarray,yarray);
    gP1left->SetLineColor(PlasmaGlob::elecLine);
    gP1left->SetLineWidth(2);
    gP1left->SetFillStyle(1001);
    gP1left->SetFillColor(PlasmaGlob::elecFill);
       
  }

  

  // Plotting
  // -----------------------------------------------
    
  // Canvas setup
  // Create the canvas and the pads before the Frame loop
  // Resolution:
  Int_t sizex = 800;
  Int_t sizey = 600;
  if(opt.Contains("hres")) {
    Int_t sizex = 1600;
    Int_t sizey = 1200;    
  }
  
  TCanvas *C = new TCanvas("C1","Evolution of Injection",sizex,sizey);
  C->cd();

  // Set palette:
  PPalette * pPalette = (PPalette*) gROOT->FindObject("electron");
  pPalette->cd();

  // Float_t Max  = hP1X1->GetMaximum();
  // Float_t Min  = hP1X1->GetMinimum();
  
  // hP1X1->GetZaxis()->SetRangeUser(Min,Max); 


  // Text objects
  TPaveText *textTime = new TPaveText(0.55,0.8,0.82,0.9,"NDC");
  PlasmaGlob::SetPaveTextStyle(textTime,32); 
  textTime->SetTextColor(kGray+2);
  char ctext[128];
  if(opt.Contains("units") && pData->GetPlasmaDensity()) 
    sprintf(ctext,"z = %5.1f mm", Time * skindepth / PUnits::mm);
  else
    sprintf(ctext,"t = %5.1f #omega_{p}^{-1}",Time);
  textTime->AddText(ctext);
 
  TPaveText *textDen = new TPaveText(0.15,0.85,0.48,0.9,"NDC");
  PlasmaGlob::SetPaveTextStyle(textDen,12); 
  textDen->SetTextColor(kOrange+10);
  if(opt.Contains("units") && pData->GetPlasmaDensity())
    sprintf(ctext,"n_{0} = %5.2f x 10^{17} / cc", n0 / (1e17/PUnits::cm3));
  else if(pData->GetBeamDensity() && pData->GetPlasmaDensity())
    sprintf(ctext,"n_{b}/n_{0} = %5.2f", pData->GetBeamDensity()/n0);
  textDen->AddText(ctext);

  TPaveText *textWav = new TPaveText(0.15,0.2,0.48,0.25,"NDC");
  PlasmaGlob::SetPaveTextStyle(textWav,12); 
  textWav->SetTextColor(kGray+2);
  sprintf(ctext,"#lambda_{p} = %5.2f #mum", pData->GetPlasmaWaveLength() / PUnits::um);
  textWav->AddText(ctext);

  TPaveText *textCharge = new TPaveText(0.15,0.25,0.48,0.3,"NDC");
  PlasmaGlob::SetPaveTextStyle(textCharge,12); 
  textCharge->SetTextColor(kGray+2);
  if(opt.Contains("units") && pData->GetPlasmaDensity())
    sprintf(ctext,"Charge = %5.2f pC", Charge);
  else
    sprintf(ctext,"Charge = %5.2f n0#timeskp^{-3}", Charge);    
  textCharge->AddText(ctext);

  TPaveText *textMom = new TPaveText(0.55,0.03,0.82,0.13,"NDC");
  PlasmaGlob::SetPaveTextStyle(textMom,32); 
  textMom->SetTextColor(kGray+3);
  textMom->SetTextFont(62);
  if(opt.Contains("units") && pData->GetPlasmaDensity())
    sprintf(ctext,"#LTp_{z}#GT = %5.2f GeV/c", ymean);
  else
    sprintf(ctext,"Mom = %5.2f mc", ymean);    
  textMom->AddText(ctext);


  TPaveText *textInfo = new TPaveText(0.55,0.52,0.82,0.75,"NDC");
  PlasmaGlob::SetPaveTextStyle(textInfo,32); 
  textInfo->SetTextColor(kGray+2);
  textInfo->SetTextFont(42);
  sprintf(ctext,"Charge = %5.2f pC",Charge);
  textInfo->AddText(ctext);
  sprintf(ctext,"#LT#zeta#GT_{rms} = %5.2f #mum",xrms);
  textInfo->AddText(ctext);
  sprintf(ctext,"#LTp_{z}#GT_{rms} = %5.2f GeV/c",yrms);
  textInfo->AddText(ctext);
  // sprintf(ctext,"#epsilon_{N} = %5.2f #mum",emittance);
  // textInfo->AddText(ctext);
  
  // Setup Pad layout:
  const Int_t NFrames = 2;
  TPad **pad = new TPad*[NFrames];
  TH1F *hFrame[NFrames];

  Double_t lMargin = 0.15;
  Double_t rMargin = 0.18;
  Double_t bMargin = 0.15;
  Double_t tMargin = 0.04;
  Double_t vSpacing = 0.00; 
  Double_t hStep = (1.-lMargin-rMargin);
  Double_t vStep = (1.- bMargin - tMargin - (NFrames-1) * vSpacing) / NFrames;
  
  Float_t vposd = 0.0;
  Float_t vposu = 0.0;
  Float_t vmard = 0.0;
  Float_t vmaru = 0.0;
  Float_t vfactor = 0.0;
  Float_t hposl = 0.0;
  Float_t hposr = 1.0;
  Float_t hmarl = lMargin;
  Float_t hmarr = rMargin;
  Float_t hfactor = 1.0;
  
  // Actual Plotting!
  // ------------------------------------------------------------
  
  
  for(Int_t k=0;k<NFrames;k++) {

    // PLOTTING!
    if(k==0) {
      vposd = 0.0;
      vposu = bMargin + vStep;
      vfactor = vposu-vposd;  
      vmard = bMargin / vfactor;
      vmaru = 0.0;
    } else if(k == NFrames-1) {
      vposd = vposu + vSpacing;
      vposu = vposd + vStep + tMargin;
      vfactor = vposu-vposd;   
      vmard = 0.0;
      vmaru = tMargin / (vposu-vposd);
    } else {
      vposd = vposu + vSpacing;
      vposu = vposd + vStep; 
      vfactor = vposu-vposd;
      vmard = 0.0;
      vmaru = 0.0;
    } 
    hfactor = hposl-hposr;

    char name[16];
    sprintf(name,"pad_%i",k);
    pad[k] = new TPad(name,"",hposl,vposd,hposr,vposu);
    // // cout << Form("%f %f %f %f",hposl,vposd,hposr,vposu) << endl;
    // // cout << Form("%f %f %f %f",hmarl,vmard,hmarr,vmaru) << endl;
    pad[k]->SetLeftMargin(hmarl);
    pad[k]->SetRightMargin(hmarr);  
    pad[k]->SetBottomMargin(vmard);
    pad[k]->SetTopMargin(vmaru);
    pad[k]->SetFrameLineWidth(3);
    
    sprintf(name,"hFrame_%i",k);  
    hFrame[k] = (TH1F*) gROOT->FindObject(name);
    if(hFrame[k]) delete hFrame[k];
    hFrame[k] = (TH1F*) hX1->Clone(name);
    hFrame[k]->Reset();
    
    hFrame[k]->GetXaxis()->CenterTitle();
    hFrame[k]->GetYaxis()->CenterTitle();
    hFrame[k]->GetZaxis()->CenterTitle();
    hFrame[k]->SetLabelFont(42,"xyz");
    hFrame[k]->SetTitleFont(42,"xyz");
  
    hFrame[k]->SetNdivisions(505,"xyz");
  
    hFrame[k]->SetTickLength(0.04,"xyz");
    hFrame[k]->SetTickLength(0.04*vfactor,"y");
  
    hFrame[k]->GetYaxis()->SetLabelSize(0.04/vfactor);
    hFrame[k]->GetYaxis()->SetLabelOffset(0.02);
  
    hFrame[k]->GetYaxis()->SetTitleSize(0.05/vfactor);
    hFrame[k]->GetYaxis()->SetTitleOffset(1.2*vfactor);

    if(k==0) {  
      hFrame[k]->GetXaxis()->SetLabelSize(0.08);
      hFrame[k]->GetXaxis()->SetLabelOffset(0.02);
      hFrame[k]->GetXaxis()->SetTitleSize(0.12);
      hFrame[k]->GetXaxis()->SetTitleOffset(1.0);
    } else {
      hFrame[k]->GetXaxis()->SetLabelSize(0.0);
      hFrame[k]->GetXaxis()->SetTitleSize(0.0);
    }


  }

  // Ranges!!
  Double_t yMin =  999.9;
  Double_t yMax =  -999.9;
  for(Int_t k=0;k<SNbin;k++) {
    if(semittance[k]<yMin)
      yMin = semittance[k];
    
    if(semittance[k]>yMax)
      yMax = semittance[k];

    if(sErms[k]<yMin)
      yMin = sErms[k];
    
    if(sErms[k]>yMax)
      yMax = sErms[k];
  }

  for(Int_t k=1;k<=xNbin;k++) {
    Double_t value = hX1->GetBinContent(k);
    if(value<yMin)
      yMin = value;
    
    if(value>yMax)
      yMax = value;

  }
  
  C->cd();

  pad[1]->Draw();
  pad[1]->cd();

  if(opt.Contains("logz")) {
    gPad->SetLogz(1);
  } else {
    gPad->SetLogz(0);
  }
  
  hFrame[1]->GetYaxis()->SetRangeUser(hP1X1->GetYaxis()->GetXmin(),hP1X1->GetYaxis()->GetXmax());

  if(opt.Contains("units"))
    hFrame[1]->GetYaxis()->SetTitle("p_{z} [GeV/c]");
  
  hFrame[1]->Draw();

  gP1left->SetLineWidth(2);
  gP1left->Draw("F");
  gP1left->Draw("L");

  TLine lZmean(xmean,hP1X1->GetYaxis()->GetXmin(),xmean,hP1X1->GetYaxis()->GetXmax());
  lZmean.SetLineColor(kGray+2);
  lZmean.SetLineStyle(2);
  lZmean.Draw();

  TLine lPmean(hP1X1->GetXaxis()->GetXmin(),ymean,hP1X1->GetXaxis()->GetXmax(),ymean);
  lPmean.SetLineColor(kGray+2);
  lPmean.SetLineStyle(2);
  lPmean.Draw();


  hP1X1->GetYaxis()->SetNdivisions(503);
  hP1X1->GetZaxis()->SetNdivisions(503);
  hP1X1->GetZaxis()->SetRangeUser(0.001*hP1X1->GetMaximum(),hP1X1->GetMaximum());
  hP1X1->GetZaxis()->SetLabelSize(0.05);
  hP1X1->GetZaxis()->SetTitleSize(0.04);
  hP1X1->GetZaxis()->SetTitleFont(42);

  hP1X1->Draw("colzsame");
  // hP1X1->SetContour(20);
  // hP1X1->Draw("contzsame");
  // hP1X1prof->SetMarkerStyle(1);
  // hP1X1prof->SetLineWidth(2);
  // hP1X1prof->Draw("zsame");

  //hP1->Draw("C");
  
  gPad->Update();

  TPaletteAxis *palette = (TPaletteAxis*)hP1X1->GetListOfFunctions()->FindObject("palette");
  if(palette) {
    Float_t y1 = gPad->GetBottomMargin();
    Float_t y2 = 1 - gPad->GetTopMargin();
    Float_t x1 = 1 - gPad->GetRightMargin();
    palette->SetY2NDC(y2 - 0.04);
    palette->SetY1NDC(y1 + 0.04);
    palette->SetX1NDC(x1 + 0.01);
    palette->SetX2NDC(x1 + 0.04);
    
    palette->SetLabelFont(42);
    
    palette->SetLabelSize(0.08);
    //palette->SetLabelOffset(0.005/vfactor);
    palette->SetTitleSize(0.10);
    //    palette->SetTitleOffset(9999.0*vfactor);
    palette->SetTitleOffset(0.6);
    
    palette->SetBorderSize(2);
    palette->SetLineColor(1);
  }


  textTime->Draw();
  textInfo->Draw();
  // textCharge->Draw();
  textMom->Draw();
   
  gPad->RedrawAxis(); 

  // Bottom plot -----------------------------------------

  C->cd();

  pad[0]->Draw();
  pad[0]->cd();

  hFrame[0]->GetYaxis()->SetRangeUser(0.0,1.1*yMax);
  hFrame[0]->Draw();
    

  hX1->SetLineWidth(2);
  hX1->SetFillStyle(1001);
  hX1->SetFillColor(PlasmaGlob::elecFill);
  // hX1->SetLineColor(kBlue);
  hX1->Draw("FL same");
  //hX1->Draw("C");

  TLine lZmean2(xmean,0.0,xmean,1.1*yMax);
  lZmean2.SetLineColor(kGray+2);
  lZmean2.SetLineStyle(2);
  lZmean2.Draw();

  Int_t markerSize = 1.2; 
  Int_t lineWidth  = 2.0;   

  gYrms->SetMarkerStyle(20);
  gYrms->SetLineStyle(1);
  gYrms->SetMarkerColor(kGray+1);
  gYrms->SetMarkerSize(markerSize); 
  gYrms->SetLineColor(kGray+1);
  gYrms->SetLineWidth(lineWidth);
  gYrms->Draw("PL");
  
  // hP2X2sl[0]->Draw("colz");
  gemit->SetMarkerStyle(20);
  //  gemit->SetMarkerColor(kMagenta-2);
  gemit->SetMarkerColor(kGray+2);
  gemit->SetMarkerSize(markerSize);
  gemit->SetLineWidth(lineWidth);
  gemit->SetLineColor(kGray+2);
  gemit->Draw("PL");

  gErms->SetMarkerStyle(20);
  gErms->SetMarkerSize(markerSize);
  gErms->SetMarkerColor(kOrange+10);
  gErms->SetLineColor(kOrange+10);
  gErms->SetLineWidth(lineWidth);
  gErms->Draw("PL");


  TLegend *Leg;
  if(!sim.Contains("DR")) 
    Leg=new TLegend(0.55,0.60,1 - gPad->GetRightMargin() - 0.02,0.95);
  else
    Leg=new TLegend(gPad->GetLeftMargin() + 0.02, 1.0-gPad->GetTopMargin()-0.20,
		    gPad->GetLeftMargin() + 0.30, 1.0-gPad->GetTopMargin()-0.02);
  
  
  PlasmaGlob::SetPaveStyle(Leg);
  Leg->SetTextAlign(12);
  Leg->SetTextColor(kGray+3);
  Leg->SetTextFont(42);
  Leg->SetLineColor(1);
  Leg->SetBorderSize(0);
  Leg->SetFillColor(0);
  Leg->SetFillStyle(1001);
  Leg->SetFillStyle(0); // Hollow
 
  Leg->AddEntry(hX1  ,"Current [kA]","L");
  //  Leg->AddEntry(gErms,"Energy spread (GeV)","PL");
  Leg->AddEntry(gErms,"Energy spread [%]","PL");
  Leg->AddEntry(gemit,"Emittance [#mum]","PL");
  Leg->AddEntry(gYrms,"Bunch width [#mum]","PL");
 
  Leg->Draw();

  gPad->RedrawAxis(); 

  gPad->Update();
  

  // Print to file --------------------------------------
  
  C->cd();
  
  // Print to a file
  // Output file
  TString fOutName = Form("./%s/Plots/RakeBunch/RakeBunch",sim.Data());
  fOutName += Form("-%s_%i",sim.Data(),time);

  PlasmaGlob::imgconv(C,fOutName,opt);
  // ---------------------------------------------------------
  
}
Ejemplo n.º 4
0
//____________________________________________________________________________________
// Plot blue band (SM Higgs curve)
void blueBand( )
{

  double zerror = 4;
  double xmin = 76;

  int npoints = 31;
  double x[] = { 10.000000, 11.392849, 12.979700, 14.787576, 16.847262, 19.193831, 21.867241, 
                 24.913018, 28.383024, 32.336350, 36.840315, 41.971614, 47.817625, 54.477897,
                 62.065844, 70.710678, 76, 80.559606, 91.780341, 104.563955, 119.128133, 135.720881,
                 154.624747, 176.161637, 200.698289, 228.652526, 260.500365, 296.784127, 
                 338.121669, 385.216905, 438.871795, 500.000000 };

  double y[] = { 20.929260, 18.757168, 16.647426, 14.611732, 12.661571, 10.808107, 9.062193,
                 7.434501, 5.935701, 4.576664, 3.368675, 2.323612, 1.454084, 0.776111,
                 0.300018, 0.042673, 0.0001, 0.020469, 0.251087, 0.750519, 1.538231, 2.633789,
                 4.056692, 5.826546, 7.962673, 10.483595, 13.406320, 16.745357, 20.511276,
                 24.717583, 29.345917, 34.380810 };


  TGraph* smGraph = new TGraph( npoints, x, y );

  if ( npoints > MAXPOINTS ) {
    std::cerr << "FATAL: npoints = " << npoints << " is greater than MAXPOINTS" << std::endl;
    exit(-1);
  }
  double x1[2*MAXPOINTS], y1[2*MAXPOINTS];
  double x2[MAXPOINTS], y2[MAXPOINTS];

  // Find mH at minimum
  int i1=0; // iterator for upper curve
  int i2=0; // iterator for lower curve
  double x0,y0;
  double step = 5;
  smGraph->GetPoint( 0, x0, y0 );
  for ( int i=0; i<100; ++i )
    {
      double ix = x0+i*step;
      double iy = smGraph->Eval( ix, 0, "S" );
      double error = TMath::Log( ix/12. )*3.;
      if ( ix<=xmin-error ) { 
        x1[i1] = ix+error; y1[i1]=iy; ++i1; 
        x2[i2] = ix-error; y2[i2]=iy; ++i2;
      }
      else if ( ix>=xmin+error) { 
        x1[i1] = ix-error; y1[i1]=iy; ++i1; 
        x2[i2] = ix+error; y2[i2]=iy; ++i2;
      } else {//if ( iy>0. ) {
        x2[i2] = (ix<=xmin)?ix-error:ix+error; 
        y2[i2]=iy; 
        ++i2;
      }
      
    }
  // Merge arrays
  for ( int i=0; i<i2; ++i ) {
    x1[i+i1] = x2[i2-i-1];
    y1[i+i1] = y2[i2-i-1];
  }
  if ( doBands ) {
    TGraph* blueBand = new TGraph( i1+i2, x1, y1 );
    blueBand->SetFillColor(7);
    blueBand->SetLineColor(7);
    blueBand->Draw("LF");
    blueBand->Draw("C");
  } else {
    smGraph->SetLineWidth(5);
  }

  smGraph->SetLineColor(4);
  smGraph->Draw("C");
  double chi2limit = smGraph->Eval( LEPLIMIT, 0, "S" );
  std::cout << "Value at limit (" << LEPLIMIT << "): " << chi2limit << std::endl;

  TGraph* lowband = new TGraph( i2, x2, y2 );
  std::cout << "Value of (low) blueband at limit: " << lowband->Eval( LEPLIMIT, 0, "S" )
            << std::endl;

}
Ejemplo n.º 5
0
TCanvas *timeonaxis()
{

//Author:

   time_t script_time;
   script_time = time(0);
   script_time = 3600*(int)(script_time/3600);

// The time offset is the one that will be used by all graphs.
// If one changes it, it will be changed even on the graphs already defined
   gStyle->SetTimeOffset(script_time);

   TCanvas *ct = new TCanvas("ct","Time on axis",10,10,700,900);
   ct->Divide(1,3);
   ct->SetFillColor(28);

   int i;

//======= Build a signal : noisy damped sine ======
//        Time interval : 30 minutes

   gStyle->SetTitleH(0.08);
   float noise;
   TH1F *ht = new TH1F("ht","Love at first sight",3000,0.,2000.);
   for (i=1;i<3000;i++) {
      noise = gRandom->Gaus(0,120);
      if (i>700) {
         noise += 1000*sin((i-700)*6.28/30)*exp((double)(700-i)/300);
      }
      ht->SetBinContent(i,noise);
   }
   ct->cd(1);
   gPad->SetFillColor(41);
   gPad->SetFrameFillColor(33);
   ht->SetLineColor(2);
   ht->GetXaxis()->SetLabelSize(0.05);
   ht->Draw();
// Sets time on the X axis
// The time used is the one set as time offset added to the value
// of the axis. This is converted into day/month/year hour:min:sec and
// a reasonable tick interval value is chosen.
   ht->GetXaxis()->SetTimeDisplay(1);

//======= Build a simple graph beginning at a different time ======
//        Time interval : 5 seconds

   float x[100], t[100];
   for (i=0;i<100;i++) {
      x[i] = sin(i*4*3.1415926/50)*exp(-(double)i/20);
      t[i] = 6000+(double)i/20;
   }
   TGraph *gt = new TGraph(100,t,x);
   gt->SetTitle("Politics");
   ct->cd(2);
   gPad->SetFillColor(41);
   gPad->SetFrameFillColor(33);
   gt->SetFillColor(19);
   gt->SetLineColor(5);
   gt->SetLineWidth(2);
   gt->Draw("AL");
   gt->GetXaxis()->SetLabelSize(0.05);
// Sets time on the X axis
   gt->GetXaxis()->SetTimeDisplay(1);
   gPad->Modified();

//======= Build a second simple graph for a very long time interval ======
//        Time interval : a few years

   float x2[10], t2[10];
   for (i=0;i<10;i++) {
      x2[i] = gRandom->Gaus(500,100)*i;
      t2[i] = i*365*86400;
   }
   TGraph *gt2 = new TGraph(10,t2,x2);
   gt2->SetTitle("Number of monkeys on the moon");
   ct->cd(3);
   gPad->SetFillColor(41);
   gPad->SetFrameFillColor(33);
   gt2->SetFillColor(19);
   gt2->SetMarkerColor(4);
   gt2->SetMarkerStyle(29);
   gt2->SetMarkerSize(1.3);
   gt2->Draw("AP");
   gt2->GetXaxis()->SetLabelSize(0.05);
// Sets time on the X axis
   gt2->GetXaxis()->SetTimeDisplay(1);
//
// One can choose a different time format than the one chosen by default
// The time format is the same as the one of the C strftime() function
// It's a string containing the following formats :
//    for date :
//      %a abbreviated weekday name
//      %b abbreviated month name
//      %d day of the month (01-31)
//      %m month (01-12)
//      %y year without century
//      %Y year with century
//
//    for time :
//      %H hour (24-hour clock)
//      %I hour (12-hour clock)
//      %p local equivalent of AM or PM
//      %M minute (00-59)
//      %S seconds (00-61)
//      %% %
// The other characters are output as is.

   gt2->GetXaxis()->SetTimeFormat("y. %Y %F2000-01-01 00:00:00");
   gPad->Modified();
   return ct;
}
Ejemplo n.º 6
0
/**
The purpose of this function is to conveniently plot an event. Each event is plotted on a TCanvas. Divided into as many pads as there are panels. Each pad is a TMultiGraph with a TLegend, and shows the channels of the digitizer connected to the lines of that panel. The grouping into pads must not necessarily be according to panels, but in any other prefered way.

@param a_channels - a vector of a vector of samples, containing all 32 channels
@ param a_channelsToPadsAssociation - a map from std::string, which is the name of the panel (or group of channels) to be assigned to each pad to a vector if integers, which is the list of channels indices corresponding to indices of channels in the paramater a_channels to associate to a pad
@param sEventTitle - a string containing the title of the event (for example, the time stamp)
*/
void RangePlotter::PlotRanges(Channels_t& a_channels, Range_t& a_channelsToPadsAssociation, std::string sEventTitle)
{	
//	printf("Plotting\n");
	//m_pCanvas->Clear();
	m_pCanvas->SetTitle(sEventTitle.c_str());
	
	
	int iPadCounter = 0;
	if(0 == m_vpMultiGraph.size())
	{
		MakePads(a_channelsToPadsAssociation.size());	
		for (auto& rangeIt: a_channelsToPadsAssociation)
		{	
			TMultiGraph* pMg = new TMultiGraph();	
			m_vpMultiGraph.push_back(std::unique_ptr<TMultiGraph>(pMg));

	//		m_pCanvas->cd(iPadCounter + 1);
			ChangePad(iPadCounter);
			int i = 0;

			auto legend = new TLegend(0.8,0.8,1,1, "Channels");
			m_vpLegends.push_back(std::unique_ptr<TLegend>(legend));
			printf("printing panel %s\n", rangeIt.first.c_str());
			for (auto& chanIt: rangeIt.second)
			{
				int iNumOfSamples = a_channels[chanIt].size();
				TGraph* pGr = new TGraph(iNumOfSamples);
				std::vector<float> vTimeSeq = CommonUtils::GenerateTimeSequence(iNumOfSamples, m_fSamplingFreqGHz);
				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					pGr->SetPoint(counter, vTimeSeq[counter], TransformToVoltage(a_channels[chanIt][counter]));
				}

				m_vpGraph[chanIt] = pGr;
				pGr->SetLineColor(m_colors[i%(sizeof(m_colors)/sizeof(int))]);
				pGr->SetName((m_sInstanceName + std::string("Pan_") + rangeIt.first + std::string("chan_") + std::to_string(chanIt)).c_str());
				std::string sGraphTitle = std::string("Channel ") + std::to_string(chanIt);
				pGr->SetTitle(sGraphTitle.c_str());
				legend->AddEntry(pGr,std::to_string(chanIt).c_str(), "l");
		
				pMg->Add(pGr);
				i++;
			}

			if(Configuration::Instance().ShowTriggerInWaveformsStep())
			{
				int iNumOfSamples = a_channels[a_channels.size() - 1].size();
				m_vpGraphPrecisionTrigger = new TGraph(iNumOfSamples);
				std::vector<float> vTimeSeq = CommonUtils::GenerateTimeSequence(iNumOfSamples, m_fSamplingFreqGHz);
				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					m_vpGraphPrecisionTrigger->SetPoint(counter, vTimeSeq[counter], TransformToVoltage(a_channels[a_channels.size() - 1][counter]));
				}
				
				m_vpGraphPrecisionTrigger->SetName((m_sInstanceName + std::string("Pan_") + rangeIt.first + "_Trig").c_str());	
				m_vpGraphPrecisionTrigger->SetTitle("Trigger");
				legend->AddEntry(m_vpGraphPrecisionTrigger,"Trigger", "l");
				pMg->Add(m_vpGraphPrecisionTrigger);
			}
			
			std::string sMultiGraphTitle = std::string("Panel ") + rangeIt.first;
			pMg->SetTitle(sMultiGraphTitle.c_str());

			pMg->Draw("AL");
			pMg->GetXaxis()->SetTitle("Time [nanoseconds]");
			pMg->GetXaxis()->CenterTitle();
			pMg->GetYaxis()->SetTitle("Voltage [volts]");
			pMg->GetYaxis()->CenterTitle();

			gPad->Modified();

			pMg->SetMinimum(m_fMinVoltage);
			pMg->SetMaximum(m_fMaxVoltage);
			legend->Draw();
			iPadCounter++;
		}
		m_pCanvas->Update();
	}
	else
	{
//		printf("Plottin again\n");
		for (auto& rangeIt: a_channelsToPadsAssociation)
		{
			printf("Panel %s\n", rangeIt.first.c_str());
			m_pCanvas->cd(iPadCounter + 1);
			for (auto& chanIt: rangeIt.second)
			{
//				printf("Chanenl %d\n", chanIt);
				//TODO: num of samples is constant per run at least!
				m_vpGraph[chanIt]->SetLineWidth(1);
				int iNumOfSamples = a_channels[chanIt].size();	
				std::vector<float> vTimeSeq = CommonUtils::GenerateTimeSequence(iNumOfSamples, m_fSamplingFreqGHz);	
				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					(m_vpGraph[chanIt]->GetY())[counter] = TransformToVoltage(a_channels[chanIt][counter]);
				}

				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					(m_vpGraphPrecisionTrigger->GetY())[counter] = TransformToVoltage(a_channels[a_channels.size() - 1][counter]);
				}
	
				gPad->Modified();
			}

			m_vpMultiGraph[iPadCounter]->Draw("AC");
			m_vpLegends[iPadCounter]->Draw();
			iPadCounter++;
		}
		printf("Updating\n");
		m_pCanvas->Update();
		printf("After updating\n");
	}
	printf("done\n");
}
Ejemplo n.º 7
0
// Function for the computation of channeling efficiency at various incoming angle
Int_t AnalyseChannelingEfficiency(TTree *fTree,Float_t fChannelingMinimum = 35., Float_t fChannelingMaximum = 70.){
    //**//Channeling Gaussian Fit Function
    TF1 *vChanneling = new TF1("vChanneling","gaus",fChannelingMinimum,fChannelingMaximum);
    vChanneling->SetParNames("Const","Mean","Sigma");
    vChanneling->SetLineColor(4);
    vChanneling->SetLineStyle(2);

    TH2D *hChannelingPlot = new TH2D("hChannelingPlot","Deflection Angle vs. Incoming Angle;Horizontal Incoming Angle [#murad];Horizontal Deflection Angle [#murad]",21,-10.5,10.5,256,-127.5,128.5);
    
    TH1F *hChannelingEfficiency = new TH1F("hChannelingEfficiency","G4Channeling;Horizontal Incoming Angle [#murad];Efficiency [%]",21,-10.5,10.5);

    fTree->Draw("-(angXout-angXin):-angXin>>hChannelingPlot");
    
    Double_t vNormalizationToAmorphous = 0.965; // Normalization for channeling efficiency, see PRSTAB 11, 063501 (2008)
    
    for(int i=2;i<=21;i++){
        TH1D* h1 = hChannelingPlot->ProjectionY("h1",i,i);
        h1->Fit(vChanneling,"QR");
        Double_t *vChannelingParameters;
        vChannelingParameters = vChanneling->GetParameters();
        hChannelingEfficiency->SetBinContent(i,ComputeEfficiency(h1,vChannelingParameters)/vNormalizationToAmorphous);
        h1->Delete();
    }
    hChannelingEfficiency->SetLineColor(3);
    hChannelingEfficiency->SetLineStyle(4);
    hChannelingEfficiency->SetMarkerColor(3);
    hChannelingEfficiency->SetFillStyle(0);
    hChannelingEfficiency->SetMarkerStyle(20);
    hChannelingEfficiency->Draw("PL");

    TGraph* gRoughExperimentalData = new TGraph(11);
    gRoughExperimentalData->SetPoint(	0	,	-10	,	20	);
    gRoughExperimentalData->SetPoint(	1	,	-8	,	38	);
    gRoughExperimentalData->SetPoint(	2	,	-6	,	56	);
    gRoughExperimentalData->SetPoint(	3	,	-4	,	72	);
    gRoughExperimentalData->SetPoint(	4	,	-2	,	80	);
    gRoughExperimentalData->SetPoint(	5	,	0	,	84	);
    gRoughExperimentalData->SetPoint(	6	,	2	,	82	);
    gRoughExperimentalData->SetPoint(	7	,	4	,	78	);
    gRoughExperimentalData->SetPoint(	8	,	6	,	66	);
    gRoughExperimentalData->SetPoint(	9	,	8	,	52	);
    gRoughExperimentalData->SetPoint(	10	,	10	,	37	);

    gRoughExperimentalData->SetLineColor(4);
    gRoughExperimentalData->SetLineStyle(3);
    gRoughExperimentalData->SetFillStyle(0);
    gRoughExperimentalData->SetFillColor(0);
    gRoughExperimentalData->SetMarkerColor(4);
    gRoughExperimentalData->SetMarkerStyle(21);
    gRoughExperimentalData->SetTitle("Phys. Lett. B 680, 129");

    gRoughExperimentalData->Draw("sameCP");

    TLegend *aLegend = new TLegend(0.30,0.15,0.55,0.3);
    aLegend->AddEntry(hChannelingEfficiency);
    aLegend->AddEntry(gRoughExperimentalData);
    aLegend->SetFillStyle(0);
    aLegend->SetLineColor(0);
    aLegend->Draw();

    return 0;
}
Ejemplo n.º 8
0
void plotExclusion() {
  //CMSstyle();
  setTDRStyle();
  gROOT->ForceStyle();
  //gStyle->SetOptStat(0);

  TMultiGraph *mg = new TMultiGraph("mg", ";M_{W'} (GeV);W'#rightarrowWZ Coupling");
  TCanvas* c1 = new TCanvas("c1");
  c1->SetLogy(1);

   float masses[15];
   masses[0] = 200;
   masses[1] = 250;
   masses[2] = 300;
   masses[3] = 400;
   masses[4] = 500;
   masses[5] = 600;
   masses[6] = 700;
   masses[7] = 800;
   masses[8] = 900;
   masses[9] = 1000;
   masses[10] = 1100;
   masses[11] = 1200;
   masses[12] = 1300;
   masses[13] = 1400;
   masses[14] = 1500;

   float masses2D[30];
   masses2D[0] = 200;
   masses2D[29] = 200;
   masses2D[1] = 250;
   masses2D[28] = 250;
   masses2D[2] = 300;
   masses2D[27] = 300;
   masses2D[3] = 400;
   masses2D[26] = 400;
   masses2D[4] = 500;
   masses2D[25] = 500;
   masses2D[5] = 600;
   masses2D[24] = 600;
   masses2D[6] = 700;
   masses2D[23] = 700;
   masses2D[7] = 800;
   masses2D[22] = 800;
   masses2D[8] = 900;
   masses2D[21] = 900;
   masses2D[9] = 1000;
   masses2D[20] = 1000;
   masses2D[10] = 1100;
   masses2D[19] = 1100;
   masses2D[11] = 1200;
   masses2D[18] = 1200;
   masses2D[12] = 1300;
   masses2D[17] = 1300;
   masses2D[13] = 1400;
   masses2D[16] = 1400;
   masses2D[14] = 1500;
   masses2D[15] = 1500;
   float exp[15];
   float obs[15];
   float exp1[30];
   float exp2[30];
   exp[0] = 0.258951497072;
   obs[0] = 0.264236507723;
   exp1[0] = 0.302958978755;
   exp1[29] = 0.221380623691;
   exp2[0] = 0.361484816545;
   exp2[29] = 0.134881244455;
   exp[1] = 0.238074875871;
   obs[1] = 0.262501951025;
   exp1[1] = 0.271489954939;
   exp1[28] = 0.212149800065;
   exp2[1] = 0.31212926296;
   exp2[28] = 0.188396377283;
   exp[2] = 0.203941984681;
   obs[2] = 0.195862072551;
   exp1[2] = 0.228775587519;
   exp1[27] = 0.15388234499;
   exp2[2] = 0.258549678245;
   exp2[27] = 0.0761613633144;
   exp[3] = 0.221149265622;
   obs[3] = 0.197161298736;
   exp1[3] = 0.25146417874;
   exp1[26] = 0.195849275574;
   exp2[3] = 0.302745675541;
   exp2[26] = 0.102178773493;
   exp[4] = 0.265859426326;
   obs[4] = 0.281814245586;
   exp1[4] = 0.316136059804;
   exp1[25] = 0.241393072817;
   exp2[4] = 0.39001755547;
   exp2[25] = 0.221096337301;
   exp[5] = 0.318011210571;
   obs[5] = 0.27969609314;
   exp1[5] = 0.37957804241;
   exp1[24] = 0.276992405418;
   exp2[5] = 0.447262299127;
   exp2[24] = 0.222377913436;
   exp[6] = 0.398436976666;
   obs[6] = 0.42176421485;
   exp1[6] = 0.459808375625;
   exp1[23] = 0.364154826684;
   exp2[6] = 0.537189459921;
   exp2[23] = 0.357480425803;
   exp[7] = 0.46411170267;
   obs[7] = 0.481806072966;
   exp1[7] = 0.565467804363;
   exp1[22] = 0.425115372019;
   exp2[7] = 0.672064509509;
   exp2[22] = 0.4120593318;
   exp[8] = 0.563947415859;
   obs[8] = 0.536922403468;
   exp1[8] = 0.672650081221;
   exp1[21] = 0.534487182571;
   exp2[8] = 0.808457381294;
   exp2[21] = 0.514649041607;
   exp[9] = 0.700579859433;
   obs[9] = 0.676280384249;
   exp1[9] = 0.798482092783;
   exp1[20] = 0.674378686191;
   exp2[9] = 1.0120004248;
   exp2[20] = 0.663954563503;
   exp[10] = 0.918970653344;
   obs[10] = 0.889845853577;
   exp1[10] = 1.04923440155;
   exp1[19] = 0.858375432352;
   exp2[10] = 1.24717913491;
   exp2[19] = 0.746731022724;
   exp[11] = 1.19793401961;
   obs[11] = 1.17653186674;
   exp1[11] = 1.39512272299;
   exp1[18] = 1.16185610477;
   exp2[11] = 1.62812001722;
   exp2[18] = 1.01020656441;
   exp[12] = 1.58254134376;
   obs[12] = 1.56834374153;
   exp1[12] = 1.84607923047;
   exp1[17] = 1.51628586669;
   exp2[12] = 2.18103685499;
   exp2[17] = 1.31304946585;
   exp[13] = 2.30981854338;
   obs[13] = 2.30117260535;
   exp1[13] = 2.42189837009;
   exp1[16] = 2.13395645197;
   exp2[13] = 2.92307163497;
   exp2[16] = 2.04337780276;
   exp[14] = 3.19375101546;
   obs[14] = 3.16458908761;
   exp1[14] = 3.28113723449;
   exp1[15] = 2.99139611866;
   exp2[14] = 4.07139223438;
   exp2[15] = 2.84407249777;

  TGraph* grExp = new TGraph(15, masses, exp);
  TGraph* grObs = new TGraph(15, masses, obs);
  TGraph* grExp1 = new TGraph(30, masses2D, exp1);
  TGraph* grExp2 = new TGraph(30, masses2D, exp2);

  grExp->SetLineColor(kBlack);
  grExp->SetMarkerColor(kBlack);
  grExp->SetLineStyle(kDashed);
  grObs->SetLineColor(kBlack);
  grObs->SetMarkerColor(kBlack);
  grObs->SetMarkerStyle(20);
  grExp1->SetFillStyle(1001);
  grExp1->SetFillColor(kGreen);
  grExp2->SetFillStyle(1001);
  grExp2->SetFillColor(kYellow);

  mg->Add(grExp2, "F");
  mg->Add(grExp1, "F");
  mg->Add(grExp,  "L");
  mg->Add(grObs,  "P");
  mg->SetMinimum(0.1);
  mg->SetMaximum(10.);
  mg->Draw("a");

  TLine* line = new TLine(200, 1, 1500, 1);
  line->Draw();

  TLegend* leg = new TLegend(0.2, 0.62, 0.58, 0.92);
  leg->SetTextSize(0.05);
  leg->SetTextFont(42);
  leg->AddEntry(grObs, "Obs. Limit", "p");
  leg->AddEntry(grExp, "Exp. Limit", "l");
  leg->AddEntry(grExp1, "Exp. #pm 1#sigma", "f");
  leg->AddEntry(grExp2, "Exp. #pm 2#sigma", "f");
  leg->AddEntry(line, "W'_{SSM}#rightarrowWZ Coupling", "l");
  leg->SetBorderSize(0);
  leg->SetFillColor(0);
  leg->Draw();

  TLatex latexLabel;
  latexLabel.SetNDC();
  latexLabel.SetTextSize(0.05);
  latexLabel.SetTextFont(42);
  latexLabel.DrawLatex(0.33, 0.96, "CMS Preliminary 2011");
  latexLabel.DrawLatex(0.67, 0.38, "#sqrt{s} = 7 TeV");
  latexLabel.DrawLatex(0.62, 0.25, Form("#intL dt = %.2f fb^{-1}",4.98));


  c1->RedrawAxis();
  c1->Print("wprimewz_limits.C");
  c1->Print("wprimewz_limits.pdf");
  c1->Print("wprimewz_limits.png");
}
Ejemplo n.º 9
0
void BackgroundPrediction(std::string pname,int rebin_factor,int model_number = 0,int imass=750, bool plotBands = false)
{
    rebin = rebin_factor;
    std::string fname = std::string("../fitFilesMETPT34/") + pname + std::string("/histos_bkg.root");
    
    stringstream iimass ;
    iimass << imass;
    std::string dirName = "info_"+iimass.str()+"_"+pname;
    
    
    gStyle->SetOptStat(000000000);
    gStyle->SetPadGridX(0);
    gStyle->SetPadGridY(0);
    
    setTDRStyle();
    gStyle->SetPadGridX(0);
    gStyle->SetPadGridY(0);
    gStyle->SetOptStat(0000);
    
    writeExtraText = true;       // if extra text
    extraText  = "Preliminary";  // default extra text is "Preliminary"
    lumi_13TeV  = "2.7 fb^{-1}"; // default is "19.7 fb^{-1}"
    lumi_7TeV  = "4.9 fb^{-1}";  // default is "5.1 fb^{-1}"
    
    
    double ratio_tau=-1;
    
    TFile *f=new TFile(fname.c_str());
    TH1F *h_mX_CR_tau=(TH1F*)f->Get("distribs_18_10_1")->Clone("CR_tau");
    TH1F *h_mX_SR=(TH1F*)f->Get("distribs_18_10_0")->Clone("The_SR");
    double maxdata = h_mX_SR->GetMaximum();
    double nEventsSR = h_mX_SR->Integral(600,4000);
    ratio_tau=(h_mX_SR->GetSumOfWeights()/(h_mX_CR_tau->GetSumOfWeights()));
    //double nEventsSR = h_mX_SR->Integral(600,4000);
    
    std::cout<<"ratio tau "<<ratio_tau<<std::endl;
    
    TH1F *h_SR_Prediction;
    TH1F *h_SR_Prediction2;
    
    if(blind) {
        h_SR_Prediction2 = (TH1F*)h_mX_CR_tau->Clone("h_SR_Prediction2");
        h_mX_CR_tau->Rebin(rebin);
        h_mX_CR_tau->SetLineColor(kBlack);
        h_SR_Prediction=(TH1F*)h_mX_CR_tau->Clone("h_SR_Prediction");
    } else {
        h_SR_Prediction2=(TH1F*)h_mX_SR->Clone("h_SR_Prediction2");
        h_mX_SR->Rebin(rebin);
        h_mX_SR->SetLineColor(kBlack);
        h_SR_Prediction=(TH1F*)h_mX_SR->Clone("h_SR_Prediction");
        
    }
    h_SR_Prediction->SetMarkerSize(0.7);
    h_SR_Prediction->GetYaxis()->SetTitleOffset(1.2);
    h_SR_Prediction->Sumw2();
    
    /*TFile *f_sig = new TFile((dirName+"/w_signal_"+iimass.str()+".root").c_str());
    RooWorkspace* xf_sig = (RooWorkspace*)f_sig->Get("Vg");
    RooAbsPdf *xf_sig_pdf = (RooAbsPdf *)xf_sig->pdf((std::string("signal_fixed_")+pname).c_str());
    
    RooWorkspace w_sig("w");
    w_sig.import(*xf_sig_pdf,RooFit::RenameVariable((std::string("signal_fixed_")+pname).c_str(),(std::string("signal_fixed_")+pname+std::string("low")).c_str()),RooFit::RenameAllVariablesExcept("low","x"));
    xf_sig_pdf = w_sig.pdf((std::string("signal_fixed_")+pname+std::string("low")).c_str());
   
    RooArgSet* biasVars = xf_sig_pdf->getVariables();
    TIterator *it = biasVars->createIterator();
    RooRealVar* var = (RooRealVar*)it->Next();
    while (var) {
        var->setConstant(kTRUE);
        var = (RooRealVar*)it->Next();
    }
    */
    RooRealVar x("x", "m_{X} (GeV)", SR_lo, SR_hi);
    
    RooRealVar nBackground((std::string("bg_")+pname+std::string("_norm")).c_str(),"nbkg",h_mX_SR->GetSumOfWeights());
    RooRealVar nBackground2((std::string("alt_bg_")+pname+std::string("_norm")).c_str(),"nbkg",h_mX_SR->GetSumOfWeights());
    std::string blah = pname;
    //pname=""; //Antibtag=tag to constrain b-tag to the anti-btag shape
    
    
    /* RooRealVar bg_p0((std::string("bg_p0_")+pname).c_str(), "bg_p0", 4.2, 0, 200.);
     RooRealVar bg_p1((std::string("bg_p1_")+pname).c_str(), "bg_p1", 4.5, 0, 300.);
     RooRealVar bg_p2((std::string("bg_p2_")+pname).c_str(), "bg_p2", 0.000047, 0, 10.1);
     RooGenericPdf bg_pure = RooGenericPdf((std::string("bg_pure_")+blah).c_str(),"(pow(1-@0/13000,@1)/pow(@0/13000,@2+@3*log(@0/13000)))",RooArgList(x,bg_p0,bg_p1,bg_p2));
   */
    RooRealVar bg_p0((std::string("bg_p0_")+pname).c_str(), "bg_p0", 0., -1000, 200.);
    RooRealVar bg_p1((std::string("bg_p1_")+pname).c_str(), "bg_p1", -13, -1000, 1000.);
    RooRealVar bg_p2((std::string("bg_p2_")+pname).c_str(), "bg_p2", -1.4, -1000, 1000.);
    bg_p0.setConstant(kTRUE);
    //RooGenericPdf bg_pure = RooGenericPdf((std::string("bg_pure_")+blah).c_str(),"(pow(@0/13000,@1+@2*log(@0/13000)))",RooArgList(x,bg_p1,bg_p2));
    RooGenericPdf bg = RooGenericPdf((std::string("bg_")+blah).c_str(),"(pow(@0/13000,@1+@2*log(@0/13000)))",RooArgList(x,bg_p1,bg_p2));
  

    /*TF1* biasFunc = new TF1("biasFunc","(0.63*x/1000-1.45)",1350,3600);
    TF1* biasFunc2 = new TF1("biasFunc2","TMath::Min(2.,2.3*x/1000-3.8)",1350,3600);
    double bias_term_s = 0;
    if ((imass > 2450 && blah == "antibtag") || (imass > 1640 && blah == "btag")) {
        if (blah == "antibtag") {
            bias_term_s = 2.7*biasFunc->Eval(imass);
        } else {
            bias_term_s = 2.7*biasFunc2->Eval(imass);
        }
       bias_term_s/=nEventsSR;
    }
    
    RooRealVar bias_term((std::string("bias_term_")+blah).c_str(), "bias_term", 0., -bias_term_s, bias_term_s);
    //bias_term.setConstant(kTRUE);
    RooAddPdf bg((std::string("bg_")+blah).c_str(), "bg_all", RooArgList(*xf_sig_pdf, bg_pure), bias_term);
    */
    string name_output = "CR_RooFit_Exp";
    
    std::cout<<"Nevents "<<nEventsSR<<std::endl;
    RooDataHist pred("pred", "Prediction from SB", RooArgList(x), h_SR_Prediction);
    RooFitResult *r_bg=bg.fitTo(pred, RooFit::Minimizer("Minuit2"), RooFit::Range(SR_lo, SR_hi), RooFit::SumW2Error(kTRUE), RooFit::Save());
    //RooFitResult *r_bg=bg.fitTo(pred, RooFit::Range(SR_lo, SR_hi), RooFit::Save());
    //RooFitResult *r_bg=bg.fitTo(pred, RooFit::Range(SR_lo, SR_hi), RooFit::Save(),RooFit::SumW2Error(kTRUE));
    std::cout<<" --------------------- Building Envelope --------------------- "<<std::endl;
    //std::cout<< "bg_p0_"<< pname << "   param   "<<bg_p0.getVal() <<  " "<<bg_p0.getError()<<std::endl;
    std::cout<< "bg_p1_"<< pname << "   param   "<<bg_p1.getVal() <<  " "<<100*bg_p1.getError()<<std::endl;
    std::cout<< "bg_p2_"<< pname << "   param   "<<bg_p2.getVal() <<  " "<<100*bg_p2.getError()<<std::endl;
    //std::cout<< "bias_term_"<< blah << "   param   0 "<<bias_term_s<<std::endl;
    
    RooPlot *aC_plot=x.frame();
    pred.plotOn(aC_plot, RooFit::MarkerColor(kPink+2));
    if (!plotBands) {
        bg.plotOn(aC_plot, RooFit::VisualizeError(*r_bg, 2), RooFit::FillColor(kYellow));
        bg.plotOn(aC_plot, RooFit::VisualizeError(*r_bg, 1), RooFit::FillColor(kGreen));
    }
    bg.plotOn(aC_plot, RooFit::LineColor(kBlue));
    //pred.plotOn(aC_plot, RooFit::LineColor(kBlack), RooFit::MarkerColor(kBlack));
    
    TGraph* error_curve[5]; //correct error bands
    TGraphAsymmErrors* dataGr = new TGraphAsymmErrors(h_SR_Prediction->GetNbinsX()); //data w/o 0 entries

    for (int i=2; i!=5; ++i) {
        error_curve[i] = new TGraph();
    }
    error_curve[2] = (TGraph*)aC_plot->getObject(1)->Clone("errs");
    int nPoints = error_curve[2]->GetN();
    
    error_curve[0] = new TGraph(2*nPoints);
    error_curve[1] = new TGraph(2*nPoints);
    
    error_curve[0]->SetFillStyle(1001);
    error_curve[1]->SetFillStyle(1001);
    
    error_curve[0]->SetFillColor(kGreen);
    error_curve[1]->SetFillColor(kYellow);
    
    error_curve[0]->SetLineColor(kGreen);
    error_curve[1]->SetLineColor(kYellow);
    
    if (plotBands) {
        RooDataHist pred2("pred2", "Prediction from SB", RooArgList(x), h_SR_Prediction2);

        error_curve[3]->SetFillStyle(1001);
        error_curve[4]->SetFillStyle(1001);
        
        error_curve[3]->SetFillColor(kGreen);
        error_curve[4]->SetFillColor(kYellow);
        
        error_curve[3]->SetLineColor(kGreen);
        error_curve[4]->SetLineColor(kYellow);
        
        error_curve[2]->SetLineColor(kBlue);
        error_curve[2]->SetLineWidth(3);
        
        double binSize = rebin;
        
        for (int i=0; i!=nPoints; ++i) {
            double x0,y0, x1,y1;
            error_curve[2]->GetPoint(i,x0,y0);
            
            RooAbsReal* nlim = new RooRealVar("nlim","y0",y0,-100000,100000);
            //double lowedge = x0 - (SR_hi - SR_lo)/double(2*nPoints);
            //double upedge = x0 + (SR_hi - SR_lo)/double(2*nPoints);
            
            double lowedge = x0 - binSize/2.;
            double upedge = x0 + binSize/2.;
            
            x.setRange("errRange",lowedge,upedge);
            
            RooExtendPdf* epdf = new RooExtendPdf("epdf","extpdf",bg, *nlim,"errRange");
            
            // Construct unbinned likelihood
            RooAbsReal* nll = epdf->createNLL(pred2,NumCPU(2));
            // Minimize likelihood w.r.t all parameters before making plots
            RooMinimizer* minim = new RooMinimizer(*nll);
            minim->setMinimizerType("Minuit2");
            minim->setStrategy(2);
            minim->setPrintLevel(-1);
            minim->migrad();
            
            minim->hesse();
            RooFitResult* result = minim->lastMinuitFit();
            double errm = nlim->getPropagatedError(*result);
            
            //std::cout<<x0<<" "<<lowedge<<" "<<upedge<<" "<<y0<<" "<<nlim->getVal()<<" "<<errm<<std::endl;
            
            error_curve[0]->SetPoint(i,x0,(y0-errm));
            error_curve[0]->SetPoint(2*nPoints-i-1,x0,y0+errm);
            
            error_curve[1]->SetPoint(i,x0,(y0-2*errm));
            error_curve[1]->SetPoint(2*nPoints-i-1,x0,(y0+2*errm));
            
            error_curve[3]->SetPoint(i,x0,-errm/sqrt(y0));
            error_curve[3]->SetPoint(2*nPoints-i-1,x0,errm/sqrt(y0));
            
            error_curve[4]->SetPoint(i,x0,-2*errm/sqrt(y0));
            error_curve[4]->SetPoint(2*nPoints-i-1,x0,2*errm/sqrt(y0));
            
        }
        
        int npois = 0;
        dataGr->SetMarkerSize(1.0);
        dataGr->SetMarkerStyle (20);
        
        const double alpha = 1 - 0.6827;
        
        for (int i=0; i!=h_SR_Prediction->GetNbinsX(); ++i){
            if (h_SR_Prediction->GetBinContent(i+1) > 0) {
                
                int N = h_SR_Prediction->GetBinContent(i+1);
                double L =  (N==0) ? 0  : (ROOT::Math::gamma_quantile(alpha/2,N,1.));
                double U =  ROOT::Math::gamma_quantile_c(alpha/2,N+1,1) ;
                
                dataGr->SetPoint(npois,h_SR_Prediction->GetBinCenter(i+1),h_SR_Prediction->GetBinContent(i+1));
                dataGr->SetPointEYlow(npois, N-L);
                dataGr->SetPointEYhigh(npois, U-N);
                npois++;
            }
        }
    }
    
    double xG[2] = {-10,4000};
    double yG[2] = {0.0,0.0};
    TGraph* unityG = new TGraph(2, xG, yG);
    unityG->SetLineColor(kBlue);
    unityG->SetLineWidth(1);

    double xPad = 0.3;
    TCanvas *c_rooFit=new TCanvas("c_rooFit", "c_rooFit", 800*(1.-xPad), 600);
    c_rooFit->SetFillStyle(4000);
    c_rooFit->SetFrameFillColor(0);
    
    TPad *p_1=new TPad("p_1", "p_1", 0, xPad, 1, 1);
    p_1->SetFillStyle(4000);
    p_1->SetFrameFillColor(0);
    p_1->SetBottomMargin(0.02);
    TPad* p_2 = new TPad("p_2", "p_2",0,0,1,xPad);
    p_2->SetBottomMargin((1.-xPad)/xPad*0.13);
    p_2->SetTopMargin(0.03);
    p_2->SetFillColor(0);
    p_2->SetBorderMode(0);
    p_2->SetBorderSize(2);
    p_2->SetFrameBorderMode(0);
    p_2->SetFrameBorderMode(0);
    
    p_1->Draw();
    p_2->Draw();
    p_1->cd();
    
    int nbins = (int) (SR_hi- SR_lo)/rebin;
    x.setBins(nbins);
    
    std::cout << "chi2(data) " <<  aC_plot->chiSquare()<<std::endl;
    
    //std::cout << "p-value: data     under hypothesis H0:  " << TMath::Prob(chi2_data->getVal(), nbins - 1) << std::endl;
    
    aC_plot->GetXaxis()->SetRangeUser(SR_lo, SR_hi);
    aC_plot->GetXaxis()->SetLabelOffset(0.02);
    aC_plot->GetYaxis()->SetRangeUser(0.1, 1000.);
    h_SR_Prediction->GetXaxis()->SetRangeUser(SR_lo, SR_hi);
    string rebin_ = itoa(rebin);
    
    aC_plot->GetXaxis()->SetTitle("M_{Z#gamma} [GeV] ");
    aC_plot->GetYaxis()->SetTitle(("Events / "+rebin_+" GeV ").c_str());
    aC_plot->SetMarkerSize(0.7);
    aC_plot->GetYaxis()->SetTitleOffset(1.2);
    aC_plot->Draw();
    
    if (plotBands) {
        error_curve[1]->Draw("Fsame");
        error_curve[0]->Draw("Fsame");
        error_curve[2]->Draw("Lsame");
        dataGr->Draw("p e1 same");
    }
    
    aC_plot->SetTitle("");
    TPaveText *pave = new TPaveText(0.85,0.4,0.67,0.5,"NDC");
    pave->SetBorderSize(0);
    pave->SetTextSize(0.05);
    pave->SetTextFont(42);
    pave->SetLineColor(1);
    pave->SetLineStyle(1);
    pave->SetLineWidth(2);
    pave->SetFillColor(0);
    pave->SetFillStyle(0);
    char name[1000];
    sprintf(name,"#chi^{2}/n = %.2f",aC_plot->chiSquare());
    pave->AddText(name);
    //pave->Draw();
    
    TLegend *leg = new TLegend(0.88,0.65,0.55,0.90,NULL,"brNDC");
    leg->SetBorderSize(0);
    leg->SetTextSize(0.05);
    leg->SetTextFont(42);
    leg->SetLineColor(1);
    leg->SetLineStyle(1);
    leg->SetLineWidth(2);
    leg->SetFillColor(0);
    leg->SetFillStyle(0);
    h_SR_Prediction->SetMarkerColor(kBlack);
    h_SR_Prediction->SetLineColor(kBlack);
    h_SR_Prediction->SetMarkerStyle(20);
    h_SR_Prediction->SetMarkerSize(1.0);
    //h_mMMMMa_3Tag_SR->GetXaxis()->SetTitleSize(0.09);
    if (blind)
        leg->AddEntry(h_SR_Prediction, "Data: sideband", "ep");
    else {
        if (blah == "antibtag" )
            leg->AddEntry(h_SR_Prediction, "Data: anti-b-tag SR", "ep");
        else
            leg->AddEntry(h_SR_Prediction, "Data: b-tag SR", "ep");
        
    }
    
    leg->AddEntry(error_curve[2], "Fit model", "l");
    leg->AddEntry(error_curve[0], "Fit #pm1#sigma", "f");
    leg->AddEntry(error_curve[1], "Fit #pm2#sigma", "f");
    leg->Draw();
    
    aC_plot->Draw("axis same");
    
    
    CMS_lumi( p_1, iPeriod, iPos );
    
    p_2->cd();
    RooHist* hpull;
    hpull = aC_plot->pullHist();
    RooPlot* frameP = x.frame() ;
    frameP->SetTitle("");
    frameP->GetXaxis()->SetRangeUser(SR_lo, SR_hi);
    
    frameP->addPlotable(hpull,"P");
    frameP->GetYaxis()->SetRangeUser(-7,7);
    frameP->GetYaxis()->SetNdivisions(505);
    frameP->GetYaxis()->SetTitle("#frac{(data-fit)}{#sigma_{stat}}");
    
    frameP->GetYaxis()->SetTitleSize((1.-xPad)/xPad*0.06);
    frameP->GetYaxis()->SetTitleOffset(1.0/((1.-xPad)/xPad));
    frameP->GetXaxis()->SetTitleSize((1.-xPad)/xPad*0.06);
    //frameP->GetXaxis()->SetTitleOffset(1.0);
    frameP->GetXaxis()->SetLabelSize((1.-xPad)/xPad*0.05);
    frameP->GetYaxis()->SetLabelSize((1.-xPad)/xPad*0.05);
    
    
    frameP->Draw();
    if (plotBands) {
        error_curve[4]->Draw("Fsame");
        error_curve[3]->Draw("Fsame");
        unityG->Draw("same");
        hpull->Draw("psame");
        
        frameP->Draw("axis same");
    }
    
    
    c_rooFit->SaveAs((dirName+"/"+name_output+".pdf").c_str());
    
    const int nModels = 9;
    TString models[nModels] = {
        "env_pdf_0_13TeV_dijet2", //0
        "env_pdf_0_13TeV_exp1", //1
        "env_pdf_0_13TeV_expow1", //2
        "env_pdf_0_13TeV_expow2", //3 => skip
        "env_pdf_0_13TeV_pow1", //4
        "env_pdf_0_13TeV_lau1", //5
        "env_pdf_0_13TeV_atlas1", //6
        "env_pdf_0_13TeV_atlas2", //7 => skip
        "env_pdf_0_13TeV_vvdijet1" //8
    };
    
    int nPars[nModels] = {
        2, 1, 2, 3, 1, 1, 2, 3, 2
    };
    
    TString parNames[nModels][3] = {
        "env_pdf_0_13TeV_dijet2_log1","env_pdf_0_13TeV_dijet2_log2","",
        "env_pdf_0_13TeV_exp1_p1","","",
        "env_pdf_0_13TeV_expow1_exp1","env_pdf_0_13TeV_expow1_pow1","",
        "env_pdf_0_13TeV_expow2_exp1","env_pdf_0_13TeV_expow2_pow1","env_pdf_0_13TeV_expow2_exp2",
        "env_pdf_0_13TeV_pow1_p1","","",
        "env_pdf_0_13TeV_lau1_l1","","",
        "env_pdf_0_13TeV_atlas1_coeff1","env_pdf_0_13TeV_atlas1_log1","",
        "env_pdf_0_13TeV_atlas2_coeff1","env_pdf_0_13TeV_atlas2_log1","env_pdf_0_13TeV_atlas2_log2",
        "env_pdf_0_13TeV_vvdijet1_coeff1","env_pdf_0_13TeV_vvdijet1_log1",""
    }
    
    if(bias){
        //alternative model
        gSystem->Load("libHiggsAnalysisCombinedLimit");
        gSystem->Load("libdiphotonsUtils");
        
        TFile *f = new TFile("antibtag_multipdf.root");
        RooWorkspace* xf = (RooWorkspace*)f->Get("wtemplates");
        RooWorkspace *w_alt=new RooWorkspace("Vg");
        for(int i=model_number; i<=model_number; i++){
            RooMultiPdf *alternative = (RooMultiPdf *)xf->pdf("model_bkg_AntiBtag");
            std::cout<<"Number of pdfs "<<alternative->getNumPdfs()<<std::endl;
            for (int j=0; j!=alternative->getNumPdfs(); ++j){
                std::cout<<alternative->getPdf(j)->GetName()<<std::endl;
            }
            RooAbsPdf *alt_bg = alternative->getPdf(alternative->getCurrentIndex()+i);//->clone();
            w_alt->import(*alt_bg, RooFit::RenameVariable(alt_bg->GetName(),("alt_bg_"+blah).c_str()));
            w_alt->Print("V");
            std::cerr<<w_alt->var("x")<<std::endl;
            RooRealVar * range_ = w_alt->var("x");
            range_->setRange(SR_lo,SR_hi);
            char* asd = ("alt_bg_"+blah).c_str()	;
            w_alt->import(nBackground2);
            std::cout<<alt_bg->getVal() <<std::endl;
            w_alt->pdf(asd)->fitTo(pred, RooFit::Minimizer("Minuit2"), RooFit::Range(SR_lo, SR_hi), RooFit::SumW2Error(kTRUE), RooFit::Save());

    	    RooArgSet* altVars = w_alt->pdf(asd)->getVariables();
            TIterator *it2 = altVars->createIterator();
            RooRealVar* varAlt = (RooRealVar*)it2->Next();
            while (varAlt) {
               varAlt->setConstant(kTRUE);
               varAlt = (RooRealVar*)it2->Next();
            }



            alt_bg->plotOn(aC_plot, RooFit::LineColor(i+1), RooFit::LineStyle(i+2));
            p_1->cd();
            aC_plot->GetYaxis()->SetRangeUser(0.01, maxdata*50.);
            aC_plot->Draw("same");
            TH1F *h=new TH1F();
            h->SetLineColor(1+i);
            h->SetLineStyle(i+2);
            leg->AddEntry(h, alt_bg->GetName(), "l");
            
            
            w_alt->SaveAs((dirName+"/w_background_alternative.root").c_str());
        }
        leg->Draw();
        p_1->SetLogy();
        c_rooFit->Update();
        c_rooFit->SaveAs((dirName+"/"+name_output+blah+"_multipdf.pdf").c_str());
        
        for (int i=0; i!=nPars[model_number]; ++i) {
            std::cout<<parNames[model_number][i]<<" param "<< w_alt->var(parNames[model_number][i])->getVal()<<"   "<<w_alt->var(parNames[model_number][i])->getError()<<std::endl;
        }
        
        
    } else {
        p_1->SetLogy();
        c_rooFit->Update();
        c_rooFit->SaveAs((dirName+"/"+name_output+"_log.pdf").c_str());
    }
    
    RooWorkspace *w=new RooWorkspace("Vg");
    w->import(bg);
    w->import(nBackground);
    w->SaveAs((dirName+"/w_background_GaussExp.root").c_str());
    
    TH1F *h_mX_SR_fakeData=(TH1F*)h_mX_SR->Clone("h_mX_SR_fakeData");
    h_mX_SR_fakeData->Scale(nEventsSR/h_mX_SR_fakeData->GetSumOfWeights());
    RooDataHist data_obs("data_obs", "Data", RooArgList(x), h_mX_SR_fakeData);
    std::cout<<" Background number of events = "<<nEventsSR<<std::endl;
    RooWorkspace *w_data=new RooWorkspace("Vg");
    w_data->import(data_obs);
    w_data->SaveAs((dirName+"/w_data.root").c_str());
    
}
Ejemplo n.º 10
0
void fitWM2testbkg()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Sat May  7 16:37:03 2016) by ROOT version6.06/02
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(230.8642,-26.4,724.6914,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_3ccfe90__1 = new TH1D("frame_3ccfe90__1","",100,300,700);
   frame_3ccfe90__1->SetBinContent(1,5.10717);
   frame_3ccfe90__1->SetMinimum(-8.8);
   frame_3ccfe90__1->SetMaximum(8.8);
   frame_3ccfe90__1->SetEntries(1);
   frame_3ccfe90__1->SetDirectory(0);
   frame_3ccfe90__1->SetStats(0);
   frame_3ccfe90__1->SetLineWidth(2);
   frame_3ccfe90__1->SetMarkerStyle(20);
   frame_3ccfe90__1->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_3ccfe90__1->GetXaxis()->SetNdivisions(505);
   frame_3ccfe90__1->GetXaxis()->SetLabelFont(132);
   frame_3ccfe90__1->GetXaxis()->SetLabelOffset(0.01);
   frame_3ccfe90__1->GetXaxis()->SetLabelSize(0.15);
   frame_3ccfe90__1->GetXaxis()->SetTitleSize(0.2);
   frame_3ccfe90__1->GetXaxis()->SetTitleOffset(1.1);
   frame_3ccfe90__1->GetXaxis()->SetTitleFont(132);
   frame_3ccfe90__1->GetYaxis()->SetTitle("Pull");
   frame_3ccfe90__1->GetYaxis()->CenterTitle(true);
   frame_3ccfe90__1->GetYaxis()->SetNdivisions(505);
   frame_3ccfe90__1->GetYaxis()->SetLabelFont(132);
   frame_3ccfe90__1->GetYaxis()->SetLabelOffset(0.01);
   frame_3ccfe90__1->GetYaxis()->SetLabelSize(0.15);
   frame_3ccfe90__1->GetYaxis()->SetTitleSize(0.15);
   frame_3ccfe90__1->GetYaxis()->SetTitleOffset(0.45);
   frame_3ccfe90__1->GetYaxis()->SetTitleFont(132);
   frame_3ccfe90__1->GetZaxis()->SetLabelFont(132);
   frame_3ccfe90__1->GetZaxis()->SetLabelSize(0.06);
   frame_3ccfe90__1->GetZaxis()->SetTitleSize(0.072);
   frame_3ccfe90__1->GetZaxis()->SetTitleOffset(1.2);
   frame_3ccfe90__1->GetZaxis()->SetTitleFont(132);
   frame_3ccfe90__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[35] = {
   322,
   326,
   330,
   334,
   338,
   342,
   346,
   350,
   354,
   358,
   362,
   366,
   370,
   374,
   378,
   382,
   386,
   390,
   394,
   398,
   402,
   406,
   410,
   414,
   418,
   422,
   426,
   430,
   434,
   438,
   442,
   446,
   450,
   454,
   458};
   Double_t pull_Hist_curvetot_fy3001[35] = {
   -14.37582,
   -1.231303,
   0.6542373,
   -0.1012747,
   0.6586727,
   0.9361556,
   1.585286,
   1.240297,
   3.131789,
   2.962823,
   1.838456,
   -0.2757796,
   2.151454,
   1.076709,
   1.552119,
   0.04534553,
   0.6586382,
   -0.3716997,
   0.7208352,
   -1.282129,
   -0.7404776,
   1.910613,
   -0.8040488,
   0.1550784,
   0.6914252,
   -0.5314845,
   -2.311921,
   -0.1689179,
   -0.9708803,
   0.1380298,
   -1.732067,
   -2.863975,
   -2.350354,
   0.6556862,
   -1.221229};
   Double_t pull_Hist_curvetot_felx3001[35] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[35] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   Double_t pull_Hist_curvetot_fehx3001[35] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[35] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(35,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of data_plot__R_WM and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of data_plot__R_WM and Projection of totalPdf",100,308.4,471.6);
   Graph_pull_Hist_curvetot3001->SetMinimum(-17.32658);
   Graph_pull_Hist_curvetot3001->SetMaximum(6.082551);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_3ccfe90__2 = new TH1D("frame_3ccfe90__2","",100,300,700);
   frame_3ccfe90__2->SetBinContent(1,5.10717);
   frame_3ccfe90__2->SetMinimum(-8.8);
   frame_3ccfe90__2->SetMaximum(8.8);
   frame_3ccfe90__2->SetEntries(1);
   frame_3ccfe90__2->SetDirectory(0);
   frame_3ccfe90__2->SetStats(0);
   frame_3ccfe90__2->SetLineWidth(2);
   frame_3ccfe90__2->SetMarkerStyle(20);
   frame_3ccfe90__2->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_3ccfe90__2->GetXaxis()->SetNdivisions(505);
   frame_3ccfe90__2->GetXaxis()->SetLabelFont(132);
   frame_3ccfe90__2->GetXaxis()->SetLabelOffset(0.01);
   frame_3ccfe90__2->GetXaxis()->SetLabelSize(0.15);
   frame_3ccfe90__2->GetXaxis()->SetTitleSize(0.2);
   frame_3ccfe90__2->GetXaxis()->SetTitleOffset(1.1);
   frame_3ccfe90__2->GetXaxis()->SetTitleFont(132);
   frame_3ccfe90__2->GetYaxis()->SetTitle("Pull");
   frame_3ccfe90__2->GetYaxis()->CenterTitle(true);
   frame_3ccfe90__2->GetYaxis()->SetNdivisions(505);
   frame_3ccfe90__2->GetYaxis()->SetLabelFont(132);
   frame_3ccfe90__2->GetYaxis()->SetLabelOffset(0.01);
   frame_3ccfe90__2->GetYaxis()->SetLabelSize(0.15);
   frame_3ccfe90__2->GetYaxis()->SetTitleSize(0.15);
   frame_3ccfe90__2->GetYaxis()->SetTitleOffset(0.45);
   frame_3ccfe90__2->GetYaxis()->SetTitleFont(132);
   frame_3ccfe90__2->GetZaxis()->SetLabelFont(132);
   frame_3ccfe90__2->GetZaxis()->SetLabelSize(0.06);
   frame_3ccfe90__2->GetZaxis()->SetTitleSize(0.072);
   frame_3ccfe90__2->GetZaxis()->SetTitleOffset(1.2);
   frame_3ccfe90__2->GetZaxis()->SetTitleFont(132);
   frame_3ccfe90__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(230.8642,0,724.6914,1257.834);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_34f0720__3 = new TH1D("frame_34f0720__3","A RooPlot of \"m(#pi p#rightarrow#pi)\"",100,300,700);
   frame_34f0720__3->SetBinContent(1,1182.364);
   frame_34f0720__3->SetMaximum(1182.364);
   frame_34f0720__3->SetEntries(1);
   frame_34f0720__3->SetDirectory(0);
   frame_34f0720__3->SetStats(0);
   frame_34f0720__3->SetLineWidth(2);
   frame_34f0720__3->SetMarkerStyle(20);
   frame_34f0720__3->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_34f0720__3->GetXaxis()->SetNdivisions(505);
   frame_34f0720__3->GetXaxis()->SetLabelFont(132);
   frame_34f0720__3->GetXaxis()->SetLabelOffset(0.01);
   frame_34f0720__3->GetXaxis()->SetLabelSize(0.06);
   frame_34f0720__3->GetXaxis()->SetTitleSize(0.072);
   frame_34f0720__3->GetXaxis()->SetTitleOffset(0.95);
   frame_34f0720__3->GetXaxis()->SetTitleFont(132);
   frame_34f0720__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_34f0720__3->GetYaxis()->SetLabelFont(132);
   frame_34f0720__3->GetYaxis()->SetLabelOffset(0.01);
   frame_34f0720__3->GetYaxis()->SetLabelSize(0.06);
   frame_34f0720__3->GetYaxis()->SetTitleSize(0.072);
   frame_34f0720__3->GetYaxis()->SetTitleOffset(0.95);
   frame_34f0720__3->GetYaxis()->SetTitleFont(132);
   frame_34f0720__3->GetZaxis()->SetLabelFont(132);
   frame_34f0720__3->GetZaxis()->SetLabelSize(0.06);
   frame_34f0720__3->GetZaxis()->SetTitleSize(0.072);
   frame_34f0720__3->GetZaxis()->SetTitleOffset(1.2);
   frame_34f0720__3->GetZaxis()->SetTitleFont(132);
   frame_34f0720__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   302,
   306,
   310,
   314,
   318,
   322,
   326,
   330,
   334,
   338,
   342,
   346,
   350,
   354,
   358,
   362,
   366,
   370,
   374,
   378,
   382,
   386,
   390,
   394,
   398,
   402,
   406,
   410,
   414,
   418,
   422,
   426,
   430,
   434,
   438,
   442,
   446,
   450,
   454,
   458,
   462,
   466,
   470,
   474,
   478,
   482,
   486,
   490,
   494,
   498,
   502,
   506,
   510,
   514,
   518,
   522,
   526,
   530,
   534,
   538,
   542,
   546,
   550,
   554,
   558,
   562,
   566,
   570,
   574,
   578,
   582,
   586,
   590,
   594,
   598,
   602,
   606,
   610,
   614,
   618,
   622,
   626,
   630,
   634,
   638,
   642,
   646,
   650,
   654,
   658,
   662,
   666,
   670,
   674,
   678,
   682,
   686,
   690,
   694,
   698};
   Double_t Hist_fy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   49,
   150,
   189,
   193,
   218,
   236,
   260,
   267,
   314,
   323,
   313,
   286,
   340,
   329,
   347,
   327,
   346,
   334,
   361,
   330,
   345,
   402,
   353,
   375,
   389,
   368,
   338,
   379,
   365,
   387,
   352,
   332,
   340,
   395,
   357,
   331,
   347,
   354,
   377,
   368,
   460,
   538,
   677,
   916,
   1093,
   919,
   645,
   486,
   368,
   306,
   271,
   268,
   239,
   204,
   194,
   222,
   168,
   147,
   135,
   118,
   98,
   88,
   43,
   27,
   8,
   3,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_felx3002[100] = {
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2};
   Double_t Hist_fely3002[100] = {
   0,
   0,
   0,
   0,
   0,
   7,
   12.24745,
   13.74773,
   13.89244,
   14.76482,
   15.36229,
   16.12452,
   16.34013,
   17.72005,
   17.9722,
   17.69181,
   16.91153,
   18.43909,
   18.13836,
   18.62794,
   18.08314,
   18.60108,
   18.27567,
   19,
   18.1659,
   18.57418,
   20.04994,
   18.78829,
   19.36492,
   19.72308,
   19.18333,
   18.38478,
   19.46792,
   19.10497,
   19.67232,
   18.76166,
   18.22087,
   18.43909,
   19.87461,
   18.89444,
   18.19341,
   18.62794,
   18.81489,
   19.41649,
   19.18333,
   21.44761,
   23.19483,
   26.01922,
   30.26549,
   33.06055,
   30.31501,
   25.39685,
   22.04541,
   19.18333,
   17.49286,
   16.46208,
   16.37071,
   15.45962,
   14.28286,
   13.92839,
   14.89966,
   12.96148,
   12.12436,
   11.61895,
   10.86278,
   9.899495,
   9.380832,
   6.557439,
   5.196152,
   2.828427,
   1.732051,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_fehx3002[100] = {
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2};
   Double_t Hist_fehy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   7,
   12.24745,
   13.74773,
   13.89244,
   14.76482,
   15.36229,
   16.12452,
   16.34013,
   17.72005,
   17.9722,
   17.69181,
   16.91153,
   18.43909,
   18.13836,
   18.62794,
   18.08314,
   18.60108,
   18.27567,
   19,
   18.1659,
   18.57418,
   20.04994,
   18.78829,
   19.36492,
   19.72308,
   19.18333,
   18.38478,
   19.46792,
   19.10497,
   19.67232,
   18.76166,
   18.22087,
   18.43909,
   19.87461,
   18.89444,
   18.19341,
   18.62794,
   18.81489,
   19.41649,
   19.18333,
   21.44761,
   23.19483,
   26.01922,
   30.26549,
   33.06055,
   30.31501,
   25.39685,
   22.04541,
   19.18333,
   17.49286,
   16.46208,
   16.37071,
   15.45962,
   14.28286,
   13.92839,
   14.89966,
   12.96148,
   12.12436,
   11.61895,
   10.86278,
   9.899495,
   9.380832,
   6.557439,
   5.196152,
   2.828427,
   1.732051,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of data_plot__R_WM");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of data_plot__R_WM",100,260,740);
   Graph_Hist3002->SetMinimum(0);
   Graph_Hist3002->SetMaximum(1238.667);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[102] = {
   320,
   321.4,
   322.8,
   324.2,
   325.6,
   327,
   328.4,
   329.8,
   331.2,
   332.6,
   334,
   335.4,
   336.8,
   338.2,
   339.6,
   341,
   342.4,
   343.8,
   345.2,
   346.6,
   348,
   349.4,
   350.8,
   352.2,
   353.6,
   355,
   356.4,
   357.8,
   359.2,
   360.6,
   362,
   363.4,
   364.8,
   366.2,
   367.6,
   369,
   370.4,
   371.8,
   373.2,
   374.6,
   376,
   377.4,
   378.8,
   380.2,
   381.6,
   383,
   384.4,
   385.8,
   387.2,
   388.6,
   390,
   391.4,
   392.8,
   394.2,
   395.6,
   397,
   398.4,
   399.8,
   401.2,
   402.6,
   404,
   405.4,
   406.8,
   408.2,
   409.6,
   411,
   412.4,
   413.8,
   415.2,
   416.6,
   418,
   419.4,
   420.8,
   422.2,
   423.6,
   425,
   426.4,
   427.8,
   429.2,
   430.6,
   432,
   433.4,
   434.8,
   436.2,
   437.6,
   439,
   440.4,
   441.8,
   443.2,
   444.6,
   446,
   447.4,
   448.8,
   450.2,
   451.6,
   453,
   454.4,
   455.8,
   457.2,
   458.6,
   460,
   460};
   Double_t curvetot_fy1[102] = {
   141.7174,
   147.2761,
   152.7703,
   158.2002,
   163.5657,
   168.8668,
   174.1036,
   179.276,
   184.384,
   189.4277,
   194.407,
   199.3219,
   204.1724,
   208.9586,
   213.6803,
   218.3378,
   222.9308,
   227.4595,
   231.9238,
   236.3237,
   240.6593,
   244.9305,
   249.1373,
   253.2797,
   257.3578,
   261.3715,
   265.3208,
   269.2058,
   273.0263,
   276.7826,
   280.4744,
   284.1019,
   287.665,
   291.1637,
   294.598,
   297.968,
   301.2736,
   304.5148,
   307.6917,
   310.8042,
   313.8523,
   316.8361,
   319.7554,
   322.6104,
   325.4011,
   328.1273,
   330.7892,
   333.3867,
   335.9199,
   338.3887,
   340.7931,
   343.1331,
   345.4087,
   347.62,
   349.7669,
   351.8495,
   353.8677,
   355.8214,
   357.7109,
   359.5359,
   361.2966,
   362.9929,
   364.6249,
   366.1924,
   367.6956,
   369.1344,
   370.5089,
   371.819,
   373.0647,
   374.246,
   375.363,
   376.4156,
   377.4038,
   378.3276,
   379.1871,
   379.9822,
   380.7129,
   381.3793,
   381.9813,
   382.5189,
   382.9921,
   383.401,
   383.7455,
   384.0256,
   384.2414,
   384.3928,
   384.4798,
   384.5024,
   384.4607,
   384.3546,
   384.1841,
   383.9493,
   383.65,
   383.2864,
   382.8585,
   382.3661,
   381.8094,
   381.1884,
   380.5029,
   379.7531,
   378.9389,
   378.9389};
   TGraph *graph = new TGraph(102,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",102,306,474);
   Graph_curvetot1->SetMinimum(117.439);
   Graph_curvetot1->SetMaximum(408.7809);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t bkg_fx2[102] = {
   320,
   321.4,
   322.8,
   324.2,
   325.6,
   327,
   328.4,
   329.8,
   331.2,
   332.6,
   334,
   335.4,
   336.8,
   338.2,
   339.6,
   341,
   342.4,
   343.8,
   345.2,
   346.6,
   348,
   349.4,
   350.8,
   352.2,
   353.6,
   355,
   356.4,
   357.8,
   359.2,
   360.6,
   362,
   363.4,
   364.8,
   366.2,
   367.6,
   369,
   370.4,
   371.8,
   373.2,
   374.6,
   376,
   377.4,
   378.8,
   380.2,
   381.6,
   383,
   384.4,
   385.8,
   387.2,
   388.6,
   390,
   391.4,
   392.8,
   394.2,
   395.6,
   397,
   398.4,
   399.8,
   401.2,
   402.6,
   404,
   405.4,
   406.8,
   408.2,
   409.6,
   411,
   412.4,
   413.8,
   415.2,
   416.6,
   418,
   419.4,
   420.8,
   422.2,
   423.6,
   425,
   426.4,
   427.8,
   429.2,
   430.6,
   432,
   433.4,
   434.8,
   436.2,
   437.6,
   439,
   440.4,
   441.8,
   443.2,
   444.6,
   446,
   447.4,
   448.8,
   450.2,
   451.6,
   453,
   454.4,
   455.8,
   457.2,
   458.6,
   460,
   460};
   Double_t bkg_fy2[102] = {
   141.7174,
   147.2761,
   152.7703,
   158.2002,
   163.5657,
   168.8668,
   174.1036,
   179.276,
   184.384,
   189.4277,
   194.407,
   199.3219,
   204.1724,
   208.9586,
   213.6803,
   218.3378,
   222.9308,
   227.4595,
   231.9238,
   236.3237,
   240.6593,
   244.9305,
   249.1373,
   253.2797,
   257.3578,
   261.3715,
   265.3208,
   269.2058,
   273.0263,
   276.7826,
   280.4744,
   284.1019,
   287.665,
   291.1637,
   294.598,
   297.968,
   301.2736,
   304.5148,
   307.6917,
   310.8042,
   313.8523,
   316.8361,
   319.7554,
   322.6104,
   325.4011,
   328.1273,
   330.7892,
   333.3867,
   335.9199,
   338.3887,
   340.7931,
   343.1331,
   345.4087,
   347.62,
   349.7669,
   351.8495,
   353.8677,
   355.8214,
   357.7109,
   359.5359,
   361.2966,
   362.9929,
   364.6249,
   366.1924,
   367.6956,
   369.1344,
   370.5089,
   371.819,
   373.0647,
   374.246,
   375.363,
   376.4156,
   377.4038,
   378.3276,
   379.1871,
   379.9822,
   380.7129,
   381.3793,
   381.9813,
   382.5189,
   382.9921,
   383.401,
   383.7455,
   384.0256,
   384.2414,
   384.3928,
   384.4798,
   384.5024,
   384.4607,
   384.3546,
   384.1841,
   383.9493,
   383.65,
   383.2864,
   382.8585,
   382.3661,
   381.8094,
   381.1884,
   380.5029,
   379.7531,
   378.9389,
   378.9389};
   graph = new TGraph(102,bkg_fx2,bkg_fy2);
   graph->SetName("bkg");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_bkg2 = new TH1F("Graph_bkg2","Projection of totalPdf",102,306,474);
   Graph_bkg2->SetMinimum(117.439);
   Graph_bkg2->SetMaximum(408.7809);
   Graph_bkg2->SetDirectory(0);
   Graph_bkg2->SetStats(0);
   Graph_bkg2->SetLineWidth(2);
   Graph_bkg2->SetMarkerStyle(20);
   Graph_bkg2->GetXaxis()->SetNdivisions(505);
   Graph_bkg2->GetXaxis()->SetLabelFont(132);
   Graph_bkg2->GetXaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetXaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetXaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetXaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetXaxis()->SetTitleFont(132);
   Graph_bkg2->GetYaxis()->SetLabelFont(132);
   Graph_bkg2->GetYaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetYaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetYaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetYaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetYaxis()->SetTitleFont(132);
   Graph_bkg2->GetZaxis()->SetLabelFont(132);
   Graph_bkg2->GetZaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetZaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetZaxis()->SetTitleOffset(1.2);
   Graph_bkg2->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_bkg2);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.75,0.02,1,0.42,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("bkg","Background","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_34f0720__4 = new TH1D("frame_34f0720__4","A RooPlot of \"m(#pi p#rightarrow#pi)\"",100,300,700);
   frame_34f0720__4->SetBinContent(1,1182.364);
   frame_34f0720__4->SetMaximum(1182.364);
   frame_34f0720__4->SetEntries(1);
   frame_34f0720__4->SetDirectory(0);
   frame_34f0720__4->SetStats(0);
   frame_34f0720__4->SetLineWidth(2);
   frame_34f0720__4->SetMarkerStyle(20);
   frame_34f0720__4->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_34f0720__4->GetXaxis()->SetNdivisions(505);
   frame_34f0720__4->GetXaxis()->SetLabelFont(132);
   frame_34f0720__4->GetXaxis()->SetLabelOffset(0.01);
   frame_34f0720__4->GetXaxis()->SetLabelSize(0.06);
   frame_34f0720__4->GetXaxis()->SetTitleSize(0.072);
   frame_34f0720__4->GetXaxis()->SetTitleOffset(0.95);
   frame_34f0720__4->GetXaxis()->SetTitleFont(132);
   frame_34f0720__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_34f0720__4->GetYaxis()->SetLabelFont(132);
   frame_34f0720__4->GetYaxis()->SetLabelOffset(0.01);
   frame_34f0720__4->GetYaxis()->SetLabelSize(0.06);
   frame_34f0720__4->GetYaxis()->SetTitleSize(0.072);
   frame_34f0720__4->GetYaxis()->SetTitleOffset(0.95);
   frame_34f0720__4->GetYaxis()->SetTitleFont(132);
   frame_34f0720__4->GetZaxis()->SetLabelFont(132);
   frame_34f0720__4->GetZaxis()->SetLabelSize(0.06);
   frame_34f0720__4->GetZaxis()->SetTitleSize(0.072);
   frame_34f0720__4->GetZaxis()->SetTitleOffset(1.2);
   frame_34f0720__4->GetZaxis()->SetTitleFont(132);
   frame_34f0720__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Ejemplo n.º 11
0
void draw_width() {


    TCanvas *c1 = new TCanvas("c1","Heaviest H width, M_{A} = 15 GeV",200,10,700,500);
    c1->SetLogy();
    c1->SetFillColor(0);
    c1->SetGrid();

    const Int_t n = 8;
    Double_t M[n]= {126, 200, 350, 500, 600, 700, 800, 900};
    Double_t W_15[n]= {8.12477269e-02, 1.36517184e+00, 1.19121726e+01, 4.40044052e+01, 7.74130955e+01, 1.22668305e+02, 1.81925299e+02, 2.57306382e+02};

    const Int_t n2 = 6;
    Double_t M2[n2] = {350, 500, 600, 700, 800, 900};
    Double_t W_200[n2] = {2.16288379e+00, 2.69462533e+01, 5.58588957e+01, 9.67469376e+01, 1.51721744e+02, 2.22878605e+02};

    const Int_t n3 = 4;
    Double_t M3[n3] = {600, 700, 800, 900};
    Double_t W_500[n3] = {9.10391108e+00, 2.11743549e+01, 4.72556689e+01, 8.96368631e+01};

    const Int_t n4 = 2;
    Double_t M4[n4] = {800, 900};
    Double_t W_700[n4] = { 1.47759627e+01, 2.74841698e+01};


    const Int_t nA = 14;
    Double_t M_A[nA]= {10, 11, 15, 23, 53, 142, 248, 329, 378, 435, 500, 662, 875, 1006 };
    Double_t W_A[nA]= { 3.59374088e-04, 5.89460809e-04, 1.07254526e-03, 1.68222604e-03, 3.39350655e-03, 7.98661276e-03, 1.50107862e-02, 4.75666163e-02, 5.56925012e+00, 8.12049501e+00, 1.02416303e+01, 1.44832862e+01, 1.92577931e+01, 2.19907445e+01};


    TCanvas *c1 = new TCanvas("c1","c1",1000,900);

    gPad->SetLogy();
    gPad->SetGridx();
    gPad->SetGridy();
    gStyle->SetOptTitle(0);

    gPad->SetBottomMargin(0.15);
    gPad->SetLeftMargin(0.15);

    TGraph *gr = new TGraph(n,M,W_15);
    gr->SetLineColor(kRed-8);
    gr->SetLineWidth(4);
    gr->SetMarkerColor(kRed-8);
    gr->SetMarkerStyle(21);
    gr->SetTitle("Heaviest H width, M_{A} = 15 GeV");
    gr->GetXaxis()->SetTitle("M_{H}");
    gr->GetYaxis()->SetTitle("#Gamma_{Tot}^{H}");
    gr->GetXaxis()->SetTitleSize(0.05);
    gr->GetYaxis()->SetTitleSize(0.05);
    gr->GetXaxis()->SetLabelSize(0.05);
    gr->GetYaxis()->SetLabelSize(0.05);
    gr->GetXaxis()->SetTitleOffset(1.2);
    gr->GetYaxis()->SetTitleOffset(1.2);
    gr->GetXaxis()->SetNdivisions(5);


    gr->Draw("ACP");


    TGraph *gr2 = new TGraph(n2,M2,W_200);
    gr2->SetLineColor(kRed-6);
    gr2->SetLineWidth(4);
    gr2->SetMarkerColor(kRed-6);
    gr2->SetMarkerStyle(21);
    //gr->SetTitle("Heaviest H width, M_{A} = 15 GeV");
    //gr->GetXaxis()->SetTitle("M_{H}");
    //gr->GetYaxis()->SetTitle("#Gamma_{Tot}");
    gr2->Draw("CP");


    TGraph *gr3 = new TGraph(n3,M3,W_500);
    gr3->SetLineColor(kRed-3);
    gr3->SetLineWidth(4);
    gr3->SetMarkerColor(kRed-3);
    gr3->SetMarkerStyle(21);
    gr3->Draw("CP");


    TGraph *gr4 = new TGraph(n4,M4,W_700);
    gr4->SetLineColor(kRed+2);
    gr4->SetLineWidth(4);
    gr4->SetMarkerColor(kRed+2);
    gr4->SetMarkerStyle(21);
    gr4->Draw("CP");

    TPaveText *pave1 = new TPaveText(0.2,0.7,0.4,0.9,"brNDC");
    pave1->SetBorderSize(0);
    pave1->SetFillStyle(0);
    pave1->SetTextAlign(12);
    pave1->SetTextFont(62);
    pave1->SetTextSize(0.04);
    pave1->AddText("#splitline{cos(#beta-#alpha) = 0.01}{tan #beta = 1.5}");
    pave1->Draw("same");

    TLegend *leg = new TLegend(0.6,0.2,0.89,0.4);
    leg->SetLineColor(0);
    leg->SetFillStyle(0);
    leg->AddEntry(gr,"M_{A} = 15 GeV","l");
    leg->AddEntry(gr2,"M_{A} = 200 GeV","l");
    leg->AddEntry(gr3,"M_{A} = 500 GeV","l");
    leg->AddEntry(gr4,"M_{A} = 700 GeV","l");
    leg->Draw();


    TCanvas *c2 = new TCanvas("c2","c2",1000,900);
    gPad->SetLogy();
    gPad->SetGridx();
    gPad->SetGridy();
    gStyle->SetOptTitle(0);

    gPad->SetBottomMargin(0.15);
    gPad->SetLeftMargin(0.15);

    TGraph *grA = new TGraph(nA,M_A,W_A);
    grA->SetLineColor(kRed-8);
    grA->SetLineWidth(4);
    grA->SetMarkerColor(kRed-8);
    grA->SetMarkerStyle(21);
    grA->SetTitle("A width (GeV)");
    grA->GetXaxis()->SetTitle("M_{A}");
    grA->GetYaxis()->SetTitle("#Gamma_{Tot}");
    grA->Draw("ACP");
    grA->GetXaxis()->SetTitleSize(0.05);
    grA->GetYaxis()->SetTitleSize(0.05);
    grA->GetXaxis()->SetLabelSize(0.05);
    grA->GetYaxis()->SetLabelSize(0.05);
    grA->GetXaxis()->SetTitleOffset(1.2);
    grA->GetYaxis()->SetTitleOffset(1.2);
    grA->GetXaxis()->SetNdivisions(10);

}
Ejemplo n.º 12
0
void buildPlotAxial_DD(){

	TH2F *dummyHist = new TH2F("dum","",1,1,900,1,6E-43,1E-37);
	dummyHist->GetYaxis()->SetTitle("#sigma_{SD} (cm^{2})");
	dummyHist->GetXaxis()->SetTitle("m_{DM} (GeV)");
	dummyHist->GetYaxis()->SetTitleOffset(1.5);
	dummyHist->GetYaxis()->SetTitleSize(0.046);
	dummyHist->GetXaxis()->SetTitleSize(0.046);
	dummyHist->GetYaxis()->SetTitleOffset(1.5);
	dummyHist->GetXaxis()->SetTitleOffset(1.25);
	dummyHist->GetYaxis()->SetTitleSize(0.045);
	dummyHist->GetXaxis()->SetTitleSize(0.045);
	dummyHist->GetYaxis()->SetLabelSize(0.04);
	dummyHist->GetXaxis()->SetLabelSize(0.04);


	gROOT->ProcessLine(".x paperStyle.C"); 
	gStyle->SetOptStat(0);
	gStyle->SetPalette(51);
	
	TFile *fiDD = TFile::Open("MassLimit_1_801_0_Both_updatePICO.root");
	TGraph *DDF = (TGraph*)fiDD->Get("DD");

	TFile *fi = TFile::Open("MassLimit_1_801_0_Both.root");

	TCanvas *can = new TCanvas();
	dummyHist->Draw("AXIS");
	
	TGraph *combinedD 	= makeOBV(combined_obs); combinedD->SetLineColor(1); combinedD->SetName("EXP");
	TGraph *combined_obsD 	= makeOBV(combined); combined_obsD->SetLineColor(1);combined_obsD->SetName("OBS");
	TGraph *monojetD 	= makeOBV(monojet); monojetD->SetLineColor(kBlue); monojetD->SetName("mjet");
	// Phil swapped boosted and resolved
	TGraph *boostedD 	= makeOBV(resolved); boostedD->SetLineColor(kMagenta); boostedD->SetName("bjet");
	TGraph *resolvedD 	= makeOBV(boosted); resolvedD->SetLineColor(kGreen); resolvedD->SetName("rjet");
	TGraph *monovD 		= makeOBV(monov); monovD->SetLineColor(kRed); monovD->SetName("MV");

	/* other lines */
	combinedD->Draw("lsame"); 
	combined_obsD->Draw("lsame"); 
	monojetD->Draw("lsame"); 
	boostedD->Draw("lsame"); 
	resolvedD->Draw("lsame"); 
	monovD->Draw("lsame"); 
	DDF->Draw("lsame");
	

	TLegend *leg = new TLegend(0.19,0.40,0.51,0.63,NULL,"brNDC");
	leg->SetFillStyle(0);
	leg->AddEntry(combinedD,"Median Expected","L");
	leg->AddEntry(combined_obsD,"Observed","L");
	leg->AddEntry(monojetD,"Monojet","L");
	leg->AddEntry(boostedD,"Boosted","L");
	leg->AddEntry(resolvedD,"Resolved","L");
	leg->AddEntry(monovD,"V-tagged","L");
	leg->AddEntry(DDF,"PICO-2L","L");
	leg->Draw();
	
   	TLatex *   texCMS = new TLatex(0.20,0.84,"#bf{CMS}");
	//TLegend *WHITEBOX = new TLegend(0.18,0.83,0.3,0.89);
   	//TLatex *   texCMS = new TLatex(0.20,0.84,"#bf{CMS}#it{Preliminary}");
	TLegend *WHITEBOX = new TLegend(0.18,0.83,0.42,0.89);
	WHITEBOX->SetFillColor(kWhite);
	//WHITEBOX->Draw();
	texCMS->SetNDC();
   	texCMS->SetTextFont(42);
   	texCMS->SetLineWidth(2);
   	texCMS->SetTextSize(0.042); texCMS->Draw();
	//tex->SetFillColor(kWhite);
	TLatex * tex = new TLatex();
	tex->SetNDC();
   	tex->SetTextFont(42);
   	tex->SetLineWidth(2);
   	tex->SetTextSize(0.035);
	tex->Draw();
   	tex->DrawLatex(0.69,0.94,"19.7 fb^{-1} (8 TeV)");
   	tex->DrawLatex(0.20,0.8,"g_{DM}=g_{SM}=1");
   	tex->DrawLatex(0.20,0.7,"Axial");
	
	can->SetRightMargin(0.11);
	can->SetLogx();
	can->SetLogy();
	can->RedrawAxis();	

	can->SaveAs("MassLimit_1_801_0_Both_DD.pdf");
	
        TFile *rout = new TFile("axialDD_out.root","RECREATE");
        rout->WriteTObject(combined_obsD,"combined");
        rout->WriteTObject(combinedD,"combined_expected"); 
        rout->WriteTObject(DDF,"DD_mass");
	rout->Close();
	
/*
 KEY: TCanvas	A;1	A
  KEY: TGraph	DD_mass;1	DD_mass
  KEY: TGraph	DD;1	DD
  KEY: TGraph	monojet;1	monojet
  KEY: TGraph	resolved;1	resolved
  KEY: TGraph	boosted;1	boosted
  KEY: TGraph	monov;1	monov
  KEY: TGraph	combined;1	combined
  KEY: TGraph	combinedUp;1	combinedUp
  KEY: TGraph	combinedDown;1	combinedDown
  KEY: TGraph	monojet_obs;1	monojet_obs
  KEY: TGraph	resolved_obs;1	resolved_obs
  KEY: TGraph	boosted_obs;1	boosted_obs
  KEY: TGraph	monov_obs;1	monov_obs
  KEY: TGraph	combined_obs;1	combined_obs
  KEY: TGraph2D	2D;1	2D	
*/	

}
//_________________________________________________________________________________
void multipleSplinesWithHistogramsVb(int iEventLook = 163, int nEvents = 1000, int nPoints = 9, double seed = 231) 
{
	double lowerBound = 10; //bounds for random vector function
	double upperBound = 20;
	double lowerErrorBound = 1;
	double upperErrorBound = 2;

	//Load the data
	vector< vector<double> > xEvents, yEvents, yErrorEvents; //each of these is a vector of vectors (of randomized data points)
	for(int i = 0; i < nEvents; i++) 
	{
		vector <double> xData, yData, yErrorData; //temporary vectors that are only used to get random values from FillRand function
		FillRandVectors(nPoints, xData, yData, yErrorData, seed*(i+1), lowerBound, upperBound, lowerErrorBound, upperErrorBound); //populates random vectors for y values and y error vector
		xEvents.push_back(xData);
		yEvents.push_back(yData);
		yErrorEvents.push_back(yErrorData);
	}

	//Intialization of the variables
	const int npar = nPoints;
	const int orderSpline = 4;
	const int nbreak = npar+2-orderSpline;
	double stepSpline = 0.01;
	double xminBSplineWorkspace = 0;
	double xmaxBSplineWorkspace = 9;
	double startCSplineWorkspace = 15.;
	double stepCSplineWorkspace = 1.5;

	acc_GLOB = gsl_interp_accel_alloc ();
	spline_GLOB = gsl_spline_alloc (gsl_interp_cspline, nPoints);	
	bw_GLOB = gsl_bspline_alloc(orderSpline, nbreak);
	
	//B- and C-splines
	clock_t tbstart, tbstop, tcstart, tcstop;
	vector <double> timeb, timec;

	vector< vector<double> > xBSplineValues, yBSplineValues;
	vector< vector<double> > xCSplineValues, yCSplineValues; 

//Setup for the C-spline_________________________________________________________________________
	TMinuit *myMinuit = new TMinuit(npar);  //initialize TMinuit with a maximum of npar 
	myMinuit->SetFCN(fcn);
	myMinuit->SetPrintLevel(-1);//No output: -1, output:1

	double arglist[10];
	int ierflg = 0;
	arglist[0] = 1;
	myMinuit->mnexcm("SET ERR", arglist, 1, ierflg);

	//Initialize Minuit
	vector<double> vstart, vstep;
	for(int i=0; i<npar; i++) 	//set starting values and step sizes for parameters
	{
		vstart.push_back(startCSplineWorkspace);
		vstep.push_back(stepCSplineWorkspace);
	}

	for (int i = 0; i < npar; i++) {
		stringstream ss;
		ss<<"a"<<i;
		myMinuit->mnparm(i, ss.str().c_str(), vstart.at(i), vstep.at(i), 0, 0, ierflg);
	}

//Setup for the B-spline_________________________________________________________________________

	//Looping begins for the calculations of the B and C-splines for each event
	for(int i = 0; i < (int)xEvents.size(); i++)
	{
		//Populate the global variables
		xData_GLOB = xEvents.at(i);
		yData_GLOB = yEvents.at(i);
		yErrorData_GLOB = yErrorEvents.at(i);

		tbstart = clock();
		vector< vector<double> > bSplineValues = bSpline(nPoints, npar, xEvents.at(i), yEvents.at(i), yErrorEvents.at(i), stepSpline, xminBSplineWorkspace, xmaxBSplineWorkspace);
		tbstop = clock();
		timeb.push_back(((float)tbstop-(float)tbstart)/ (CLOCKS_PER_SEC/1000.) );		

		std::cout<<timeb.back()<<std::endl;

		xBSplineValues.push_back(bSplineValues.at(0));
		yBSplineValues.push_back(bSplineValues.at(1));

		tcstart = clock();
		vector< vector<double> > cSplineValues = cSpline(nPoints, npar, xEvents.at(i), stepSpline, myMinuit);
		tcstop = clock();
		timec.push_back(((float)tcstop-(float)tcstart)/ (CLOCKS_PER_SEC/1000.) );		

		xCSplineValues.push_back(cSplineValues.at(0));
		yCSplineValues.push_back(cSplineValues.at(1));
	}

	//Histograms______________________________________________________________________________________

	//Time
	int nbins = 100;
	double xlow = 0;
	double xup = 1.;

	TH1D *hTimeB = new TH1D("Time","Timing; time [ms]; Number of Events", nbins, xlow, xup); 
	hTimeB->SetStats(0);
	hTimeB->SetMarkerStyle(10);
	TH1D *hTimeC = new TH1D("TimeC","Timing; time [ms]; Number of Events", nbins, xlow, xup); 
	hTimeC->SetLineColor(kRed);
	hTimeC->SetMarkerStyle(10);
	hTimeC->SetStats(0);

	for(int i=0; i<(int)timec.size(); i++) 
	{
		hTimeB->Fill(timeb.at(i));
		hTimeC->Fill(timec.at(i));	
	}

	//Interpolation
	vector <double> interpB, interpC;
	for(int i = 0; i < (int)yEvents.size(); i++)
	{
		for(int j = 0; j < (int)yEvents[i].size(); j++)
		{
			int indexForB = binarySearch(xBSplineValues[i], xEvents[i][j]);
			int indexForC = binarySearch(xCSplineValues[i], xEvents[i][j]);

			interpB.push_back( (yEvents[i][j]-yBSplineValues[i][indexForB])/yErrorEvents[i][j] );
			interpC.push_back( (yEvents[i][j]-yCSplineValues[i][indexForC])/yErrorEvents[i][j] );
		}
	}	

	//Test graphs for splines
	TGraph *GCspline = new TGraph(xCSplineValues[iEventLook].size(), &xCSplineValues[iEventLook][0], &yCSplineValues[iEventLook][0]);
	GCspline->SetLineColor(kRed);
	TGraph *GBspline = new TGraph(xBSplineValues[iEventLook].size(), &xBSplineValues[iEventLook][0], &yBSplineValues[iEventLook][0]);
	TGraph *Gdata = new TGraph(xEvents[0].size(), &xEvents[iEventLook][0], &yEvents[iEventLook][0]);
		Gdata->SetMarkerStyle(20);

	int nbinsI = 101;
	double xlowI = -0.1;
	double xupI = 0.1;
	TH1D *hInterpB = new TH1D("Interp B","Interpolation; Distance between spline and data normalized by error; Number of Events", nbinsI, xlowI, xupI); 
	for(int i=0; i<(int)interpB.size(); i++) hInterpB->Fill(interpB.at(i));
	hInterpB->SetStats(0);

	TH1D *hInterpC = new TH1D("Interp C","Interpolation; Distance between spline and data normalized by error; Number of Events", nbinsI, xlowI, xupI); 
	for (int i=0; i<(int)interpC.size(); i++) hInterpC->Fill(interpC.at(i));
	hInterpC->SetLineColor(kGreen);
	hInterpC->SetStats(0);	

	//Draws______________________________________________________________________________________

	//Interpolation 
	TLegend *legInterp = new TLegend(0.9,0.70,0.75,0.85);
	legInterp->SetLineColor(kWhite); 
	legInterp->SetFillColor(kWhite);
	legInterp->SetMargin(0.3); 
	legInterp->AddEntry(hInterpB,"b-spline","l");
	legInterp->AddEntry(hInterpC,"c-spline","l");
	legInterp->SetTextSize(0.05);

	TCanvas *c1 = new TCanvas("c1", "Interpolation distance");
	c1->cd();
	hInterpB->Draw("");
	hInterpC->Draw("same");
	legInterp->Draw();

	//Time
	TLegend *legTime = new TLegend(0.9,0.70,0.75,0.85);
	legTime->SetLineColor(kWhite); 
	legTime->SetFillColor(kWhite);
	legTime->SetMargin(0.3); 
	legTime->AddEntry(hTimeB,"b-spline","l");
	legTime->AddEntry(hTimeC,"c-spline","l");
	legTime->SetTextSize(0.05);

	TCanvas *c2 = new TCanvas("c2", "Computation time");
	c2->cd();
	hTimeB->Draw();
//	hTimeC->Draw("same");
	legTime-> Draw();

	TCanvas *c3 = new TCanvas("c3", "Test splines");
	c3->cd();
	Gdata->Draw("ap");
	GCspline->Draw("samel");
	GBspline->Draw("samel");

	//Free the memory used
	gsl_spline_free (spline_GLOB); 
 	gsl_interp_accel_free (acc_GLOB);
	gsl_bspline_free(bw_GLOB);
}
int evaluate( std::string filelist, std::string outfile )
{
  gStyle->SetOptStat(0);

  TCanvas *ctemp = new TCanvas();

  TCanvas *cres = new TCanvas("TimeDependence");
  TH1F* hres = new TH1F("hres","",100,0,650);
  hres->GetYaxis()->SetRangeUser(0,50);
  hres->SetTitle("");
  hres->GetXaxis()->SetTitle("time (s)");
  hres->GetYaxis()->SetTitle("B_{int} (mT)");
  hres->Draw();
  leg = new TLegend(0.2,0.6,0.9,0.9);
//  leg->SetHeader("The Legend Title"); // option "C" allows to center the header
  leg->SetNColumns(5);

  vector< double > v_Bint;
  vector< double > v_BintErr;
  vector< double > v_Bext;
  vector< double > v_BextErr;

  /* Loop over all lines in input file */
  std::ifstream infilelist(filelist);
  std::string line;

  unsigned colorcounter=38;

  while (std::getline(infilelist, line))
  {
    // skip lines with '#' and empty lines
    if ( line.find("#") != string::npos )
      {
        cout << "Skip line " << line << endl;
        continue;
      }

    if ( line == "" )
      continue;

    //cout << "Processing file " << line << endl;


    TString infilename("data_calib/");
    infilename.Append(line);

    TFile *fin = new TFile( infilename );
    TTree *tin = (TTree*)fin->Get("t");

    ctemp->cd();
    tin->Draw("Bi:time");
    TGraph *gtime = new TGraph(tin->GetEntries(), &(tin->GetV2()[0]), &(tin->GetV1()[0]));
    gtime->SetLineColor(colorcounter);
    colorcounter++;

    TH1F* hBext = new TH1F("hBext","",100,0,1000);
    tin->Draw("Bo >> hBext");

    cres->cd();
    gtime->Draw("lsame");

    double Bext_i = hBext->GetMean();
    double BextErr_i = hBext->GetRMS();

    double Bint_i = gtime->Eval(590);
    double BintErr_i = 0;

    /* add legend entry */
    TString legname("B_ext ~ ");
    legname += (int)Bext_i;
    leg->AddEntry(gtime,legname,"l");

    cout << "B_ext: " << Bext_i << " \t B_int: " << Bint_i << endl;

    v_Bint.push_back(Bint_i);
    v_BintErr.push_back(BintErr_i);
    v_Bext.push_back(Bext_i);
    v_BextErr.push_back(BextErr_i);

  }

  cres->cd();
  leg->Draw();

  TGraphErrors *gfinal = new TGraphErrors(v_Bext.size(), &(v_Bext[0]), &(v_Bint[0]), &(v_BextErr[0]), &(v_BintErr[0]));
  gfinal->Sort();
  gfinal->SetName("Bint_Vs_Bext");
  gfinal->SetTitle("");
  gfinal->GetXaxis()->SetTitle("B_{ext} (mT)");
  gfinal->GetYaxis()->SetTitle("B_{int} (mT)");

  TCanvas *cfinal = new TCanvas();
  gfinal->Draw("APL");

  /* Save output graph */
  TString outfilename("output/");
  outfilename.Append(outfile);
  TFile *fout = new TFile(outfilename,"RECREATE");

  cres->Write();
  gfinal->Write();

  fout->Close();

  /* Write result to txt output file */
  TString outfilenametxt = outfilename;
  outfilenametxt.ReplaceAll(".root",".txt");

  ofstream foutxt;
  foutxt.open( outfilenametxt );
  foutxt <<  "# Bo sig_Bo Bi sig_Bi shield sig_shield sf sig_sf time_dependent" << endl;

  for ( int i = 0; i < gfinal->GetN(); i++ )
  {
    double Bo = gfinal->GetX()[i];
    double sig_Bo = gfinal->GetEX()[i];
    double Bi = gfinal->GetY()[i];
    double sig_Bi = gfinal->GetEY()[i];
    double shield = 0;
    double sig_shield = 0;
    double sf = 0;
    double sig_sf = 0;
    double time_dependent = 0;

    foutxt <<  Bo << " " << sig_Bo << " " << Bi << " " << sig_Bi << " "
         << shield << " " << sig_shield << " " << sf << " " << sig_sf
         << " " << time_dependent << endl;
  }

  return 0;
}
Ejemplo n.º 15
0
TGraph* getGraph(TGraph* gin , int ndiv = 10 , bool verbose = false ){

  const unsigned int n = gin->GetN();

  if( verbose ) cout << "npoints " << n << endl;

  float x[n];
  float y[n];

  Double_t thisx;
  Double_t thisy;

  for(int i = 0 ; i < n ; ++i){
    gin->GetPoint(i,thisx,thisy);
    x[i] = thisx;
    y[i] = thisy;
  }

  if( verbose ){
    cout << endl << "Original points" << endl;
    for( int i = 0 ; i < n ; i++ ){
      cout << i << " " << x[i] << " " << y[i] << endl;
    }
  }

  const unsigned int nnew = ndiv * (n-1);

  float xnew[nnew];
  float ynew[nnew];

  if( verbose ) cout << endl << "New points" << endl;
  for( int i = 0 ; i < n-1 ; ++i){

    float xgraph = x[i];
    float ygraph = y[i];

    float slope = (y[i+1]-y[i])/(x[i+1]-x[i]);

    if( verbose ) cout << i << " " << xgraph << " " << ygraph << " " << slope << endl;

    for( int j = 0 ; j < ndiv ; ++j ){

      //cout << "counter " << i*10+j << endl;
      xnew[i*ndiv+j] = xgraph;
      ynew[i*ndiv+j] = ygraph;

      xgraph += 20.0 / (float)ndiv;
      ygraph += (20.0/(float)ndiv)*slope;
    }
  }

  if( verbose ){
    cout << endl << "New graph points" << endl;
    for( int i = 0 ; i < nnew ; i++ ){
      cout << i << " " << xnew[i] << " " << ynew[i] << endl;
    }
  }

  TGraph *gout = new TGraph(nnew,xnew,ynew);

  gout->SetLineColor(gin->GetLineColor());
  gout->SetLineWidth(gin->GetLineWidth());
  gout->SetLineStyle(gin->GetLineStyle());
  //gout->SetMarkerColor(gin->GetLineColor());

  return gout;


}
void makeMuVMassPlot(bool iUseWWType = false) { 
  SetStyle();
  TCanvas *lCan = new TCanvas("A","A",600,600);
  // lCan->SetGridx(1);
  //lCan->SetGridy(1);
  lCan->SetRightMargin(0.14);

  double *lTX1 = new double[2];
  double *lTX2 = new double[2];
  double lMinNLL = 1000;
  double lVMin = 0;
  double *lMin = new double[36];     
  if(!iUseWWType) for(int i0 = 0; i0 < 36; i0++) { lMin[i0] = getMinNLL(110+i0*1.); if(lMin[i0] < lVMin) {lVMin = lMin[i0]; lTX1[0] = 110+i0*1.;}}
  //lMin[17] = (lMin[16]+lMin[18])/2.;
  //lMin[21] = (lMin[20]+lMin[22])/2.;
  //lMin[29] = (lMin[28]+lMin[30])/2.;
  //lMin[34] = (lMin[33]+lMin[35])/2.;

  TFile *lFile = new TFile("/afs/cern.ch/user/p/pharris/public/massscan/cmb+.root");
  TTree *lTree = lFile->FindObjectAny("limit");
  TH2F *lH = new TH2F("2D","2D",36,109.5,145.5,50,-2.,3.);
  float  lNLL  = 0; lTree->SetBranchAddress("nll"     ,&lNLL);
  float  lMNLL = 0; lTree->SetBranchAddress("deltaNLL",&lMNLL);
  double lMH   = 0; lTree->SetBranchAddress("mh"      ,&lMH);
  float  lR    = 0; lTree->SetBranchAddress("r"       ,&lR);
  
  if(iUseWWType) { 
    for(int i0 = 0; i0 < lTree->GetEntries(); i0++) { 
      lTree->GetEntry(i0);
      if(lR < 0.1 && lR > 0)  lMin[int(lMH-110)] = -lMNLL;
    }
    lVMin = 10000;
    for(int i0 = 0; i0 < lTree->GetEntries(); i0++) { 
      lTree->GetEntry(i0);
      double pMin =  lMin[int(lMH-110)] + lMNLL;
      if(pMin < lVMin) lVMin = pMin;
    }
  }
  for(int i0 = 0; i0 < lTree->GetEntries(); i0++) { 
    lTree->GetEntry(i0);
    //if(lMH == 125) continue;
    lNLL = 0.; //lMin  = 0.;
    lH->SetBinContent(lH->GetXaxis()->FindBin(lMH),lH->GetYaxis()->FindBin(lR),(lMNLL+lMin[lH->GetXaxis()->FindBin(lMH)-1]-lVMin)); 
    if(lMH == lTX1[0] && lMNLL < lMinNLL) {lMinNLL = lMNLL; lTX2[0] = lR;}
  }
  TH2F* lHC = lH->Clone("2D_v2");
  double lCont[3];
  lCont[0] = 1.17; 
  lCont[1] = 3.0;
  lCont[2] = 9.0;
  lHC->SetContour(2,lCont);
  //lCan->SetLogz();
  lHC->Draw("cont z list");
  lCan->Update();
  lHC->Draw("colz");

  TObjArray *lContours = (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours");
  int lTotalConts = lContours->GetSize();
  double *lTX = new double[2]; lTX[0] = 110;  lTX[1] = 145; 
  double *lTY = new double[2]; lTY[0] = -0.5; lTY[1] = 2.5;
  TGraph *lFirst = new TGraph(2,lTX,lTY); lFirst->SetLineColor(kWhite);
  lFirst->GetXaxis()->SetRangeUser(110,148);
  lFirst->Draw("al"); lFirst->SetTitle("");
  lH->GetYaxis()->SetRangeUser(-0.5,2.5);
  lFirst->GetXaxis()->SetTitle("m_{H}[GeV]");
  lFirst->GetXaxis()->SetTitleOffset(1.0);
  lFirst->GetYaxis()->SetTitle("#mu_{best-fit}");
  lFirst->GetYaxis()->SetTitleOffset(1.2);

  lH->GetXaxis()->SetTitle("m_{H}[GeV]");
  lH->GetXaxis()->SetTitleOffset(1.0);
  lH->GetYaxis()->SetTitle("#mu_{best-fit}");
  lH->GetYaxis()->SetTitleOffset(1.2);

  lTX1[1] = lTX1[0]; lTX2[1] = lTX2[1]+0.001;
  TGraph *lSecond = new TGraph(1,lTX1,lTX2); lSecond->SetMarkerStyle(34); lSecond->SetMarkerSize(3.5);
  //lSecond->Draw("p");
  
  TLegend *lL = new TLegend(0.65,0.15,0.85,0.35); lL->SetBorderSize(0); lL->SetFillColor(0); lL->SetFillStyle(0); 
  for(i0 = 0; i0 < lTotalConts; i0++){
    pContLevel = (TList*)lContours->At(lTotalConts-1.-i0);
    // Get first graph from list on curves on this level
    std::vector<double> lX; 
    std::vector<double> lY; 
    pCurv = (TGraph*)pContLevel->First();
    for(int i1 = 0; i1 < pContLevel->GetSize(); i1++){
      for(int i2  = 0; i2 < pCurv->GetN(); i2++) {lX.push_back(pCurv->GetX()[i2]); lY.push_back(pCurv->GetY()[i2]);}
      //pCurv->GetPoint(0, x0, y0);
      pCurv->SetLineColor(kBlack);//kGreen+i0);
      pCCurv = (TGraph*)pCurv->Clone();
      if(i0 == 0) pCCurv->SetFillColor(0);
      if(i0 == 1) pCCurv->SetFillColor(0);
      //if(i0 == 1) pCCurv->SetLineStyle(kDashed);
      pCCurv->SetLineWidth(3);
      pCCurv->GetXaxis()->SetRangeUser(0,3.0);
      //if(i0 == 0) pCCurv->Draw("AL");
      //if(i0 != -10) pCCurv->Draw("LC");
      //l.DrawLatex(x0,y0,val);
      pCurv = (TGraph*)pContLevel->After(pCurv); // Get Next graph
    }
    TGraph *lTotal = new TGraph(lX.size(),&lX[0],&lY[0]);
    lTotal->SetLineWidth(3);
    lTotal->SetFillColor(kGreen+i0*2);
    lTotal->SetFillStyle(3001);
    //lTotal->Draw("lf");
    
    //if(i0 == 0) lTotal->Draw("alf");
    //if(i0 == 0) lTotal->Draw("alf");
    //for(int iX = 0; iX < lTotal->GetN(); iX++) cout << "===> " << lTotal->GetX()[iX] << " -- " << lTotal->GetY()[iX] << endl;
    //if(i0 != -10) lTotal->Draw("lfC");
    bool pSwitch = false;
    int  pSign   = -1.;   if(lTotal->GetX()[0] > lTotal->GetX()[1]) pSign = 1;
    double pXOld = lTotal->GetX()[lTotal->GetN()-1];
    std::vector<double> pXLeft;
    std::vector<double> pXRight;
    std::vector<double> pYLeft;
    std::vector<double> pYRight;
    for(int iX = 0; iX < lTotal->GetN(); iX++) { 
      double pX = lTotal->GetX()[iX];
      if(pSign*pX > pSign*pXOld ) {pSwitch = !pSwitch; pSign *= -1;}
      if(!pSwitch) {pXLeft.push_back(lTotal->GetX()[iX]); pYLeft.push_back(lTotal->GetY()[iX]); }
      if(pSwitch) {pXRight.push_back(lTotal->GetX()[iX]); pYRight.push_back(lTotal->GetY()[iX]); }
      pXOld = pX;
    }
    TGraph *lLeftTotal  = new TGraph(pXLeft.size() ,&pXLeft[0],&pYLeft[0]);
    TGraph *lRightTotal = new TGraph(pXRight.size(),&pXRight[0],&pYRight[0]);
    lLeftTotal->SetLineColor(kRed);
    lRightTotal->SetLineColor(kBlue);
    lLeftTotal->SetLineStyle(kDashed);
    lRightTotal->SetLineStyle(kDashed);
    //lLeftTotal->Draw("l");
    //lRightTotal->Draw("l");
    
    TGraphSmooth *lGS0 = new TGraphSmooth("normal");
    TGraphSmooth *lGS1 = new TGraphSmooth("normal");
    TGraph *lSmooth0 = lGS0->SmoothSuper(lRightTotal,"",0.,0.);
    TGraph *lSmooth1 = lGS1->SmoothSuper(lLeftTotal,"",0.,0.) ;
    lSmooth0->Draw("l");
    lSmooth1->Draw("l");
    std::vector<double> pXSmooth;
    std::vector<double> pYSmooth;
    std::vector<double> pXSmooth1;
    std::vector<double> pYSmooth1;
    cout << "==" << lSmooth0->GetN() << " -- " <<lSmooth1->GetN() << endl;
    for(int iX = 0; iX < lSmooth0->GetN(); iX++) {pXSmooth.push_back(lSmooth0->GetX()[iX]);                    pYSmooth.push_back(lSmooth0->GetY()[iX]);}
    for(int iX = 0; iX < lSmooth1->GetN(); iX++) {pXSmooth.push_back(lSmooth1->GetX()[lSmooth1->GetN()-iX-1]); pYSmooth.push_back(lSmooth1->GetY()[lSmooth1->GetN()-iX-1]);}

    for(int iX = 0; iX < lSmooth0->GetN(); iX++) {pXSmooth1.push_back(lSmooth0->GetX()[iX]);                    pYSmooth1.push_back(lSmooth0->GetY()[iX]);}
    for(int iX = 0; iX < lSmooth1->GetN(); iX++) {pXSmooth1.push_back(lSmooth1->GetX()[lSmooth1->GetN()-iX-1]); pYSmooth1.push_back(lSmooth1->GetY()[lSmooth1->GetN()-iX-1]);}
    //if(i0 == 1) {pXSmooth1.push_back(lSmooth1->GetX()[0]); pYSmooth1.push_back(lSmooth1->GetY()[0]);}
    TGraph *pSmoothShape  = new TGraph(pXSmooth.size() ,&pXSmooth [0],&pYSmooth [0]);
    TGraph *pSmoothShape1 = new TGraph(pXSmooth1.size(),&pXSmooth1[0],&pYSmooth1[0]);
    if(i0 == 1) {TLine  *lLine = new TLine(pXSmooth1[0],pYSmooth1[0],pXSmooth1[pXSmooth1.size()-1],pYSmooth1[pYSmooth1.size()-1]); lLine->Draw();}
    pSmoothShape1->SetLineColor(kBlack);
    pSmoothShape1->SetLineWidth(2);
    pSmoothShape->SetFillColor(kGreen+i0*2);
    pSmoothShape->SetFillStyle(3001);
    pSmoothShape->Draw("lf");
    pSmoothShape1->Draw("l");
    if(i0 == 0) lL->AddEntry(lTotal,"95% CL","lf");
    if(i0 == 1) lL->AddEntry(lTotal,"68% CL","lf");
  }
  lL->AddEntry(lSecond,"BestFit","p");
  lSecond->Draw("lp");
  lL->Draw();
  
  std::string masslabel = "m_{H}"; double mass = 125;
  TString label = TString::Format("%s = 135 GeV", masslabel.c_str());//, 125.);
  TPaveText* textlabel = new TPaveText(0.18, 0.81, 0.50, 0.90, "NDC");
  textlabel->SetBorderSize(   0 );
  textlabel->SetFillStyle (   0 );
  textlabel->SetTextAlign (  12 );
  textlabel->SetTextSize  (0.04 );
  textlabel->SetTextColor (   1 );
  textlabel->SetTextFont  (  62 );
  textlabel->AddText(label);
  //textlabel->Draw();
  CMSPrelim("Preliminary, H#rightarrow#tau#tau,L = 24.3 fb^{-1}", "", 0.145, 0.835);
  gPad->RedrawAxis();
  lCan->Update();

  lCan->SaveAs("cmb+_muvmass.png");
  lCan->SaveAs("cmb+_muvmass.pdf");
  lCan->SaveAs("cmb+_muvmass.eps");
}
Ejemplo n.º 17
0
void makeGMSBPlot( bool printplots = false ){

  //getUncertainties();
  /*
  // VZ+MET exclusion
  TFile *f       = TFile::Open("/tas/benhoob/home/LandS/VZMet_LandS/fullShapeAnalysis/cards/V00-02-08/observed_limit.root");
  TGraph* gul    = (TGraph*) f->Get("grobs");
  TGraph* gulexp = (TGraph*) f->Get("grexp");

  // Rutgers exclusion
  //TFile *frutgers = TFile::Open("20120411_UCSD_GMSB_datacard/observed_limit.root ");
  //TFile *frutgers = TFile::Open("20120419_UCSD_GMSB_datacard/observed_limit.root ");
  TFile *frutgers = TFile::Open("/tas/benhoob/home/LandS/VZMet_LandS/fullShapeAnalysis/cards/20120420_UCSD_GMSB_datacard/observed_limit.root ");
  TGraph* gul2    = (TGraph*) frutgers->Get("grobs");
  TGraph* gul2exp = (TGraph*) frutgers->Get("grexp");
*/

  // VZ+MET exclusion
  TFile *fc       = TFile::Open("/tas/benhoob/home/LandS_t3-06-00/VZMet_LandS_2012/fullShapeAnalysis/cards/V00-00-03/observed_limit.root");

  TGraph* gulc      = (TGraph*) fc->Get("grobs");
  TGraph* gulcexp   = (TGraph*) fc->Get("grexp");
  TGraph* gulcexpp1 = (TGraph*) fc->Get("grexpp1");
  TGraph* gulcexpm1 = (TGraph*) fc->Get("grexpm1");
  TGraph* gulcband  = uncertaintyBand( gulcexpp1 , gulcexpm1 );

  /*
  Double_t xp;
  Double_t yp;

  Double_t xp2;
  Double_t yp2;

  Double_t xpc;
  Double_t ypc;

  cout << setw(15) << "mass"        << setw(4) << "&"
       << setw(15) << "\\wzzmet"    << setw(4) << "&"
       << setw(15) << "mult-lepton" << setw(4) << "&"
       << setw(15) << "combined"    << setw(4) << "&"
       << setw(15) << "asdf"        << setw(4) << "\\\\" << endl;

  for( int i = 0 ; i < 15 ; ++i ){

    gulexp->GetPoint ((Int_t) i,xp,yp);
    gul2exp->GetPoint((Int_t) i,xp2,yp2);
    gulcexp->GetPoint((Int_t) i,xpc,ypc);
    float exp = 1.0 / sqrt( 1.0/(yp*yp) + 1.0/(yp2*yp2) ); 

    // gul->GetPoint ((Int_t) i,xp,yp);
    // gul2->GetPoint((Int_t) i,xp2,yp2);
    // gulc->GetPoint((Int_t) i,xpc,ypc);
    // float exp = 1.0 / sqrt( 1.0/(yp*yp) + 1.0/(yp2*yp2) ); 


    // gul->GetPoint ((Int_t) i,xp,yp);
    // gul2->GetPoint((Int_t) i,xp2,yp2);
    // gulc->GetPoint((Int_t) i,xpc,ypc);

    cout << setw(15) << xp               << setw(4) << "&"
	 << setw(15) << Form("%.0f",yp)  << setw(4) << "&"
	 << setw(15) << Form("%.0f",yp2) << setw(4) << "&"
	 << setw(15) << Form("%.0f",ypc) << setw(4) << "&"
	 << setw(15) << Form("%.0f",exp) << setw(4) << "\\\\" << endl;
    

    // cout << "mass    " << Form("%.0f",xp) << endl;
    // cout << "VZ+MET  " << Form("%.0f",yp) << endl;
    // cout << "4l      " << Form("%.0f",yp2) << endl;
    // cout << "combo   " << Form("%.0f",ypc) << endl;
    // cout << "exp     " << Form("%.0f",exp) << endl << endl;    
  }
  */

  const unsigned int n = 15;
  float x[n];
  float y[n];
  float yup[n];
  float ydn[n];

  float xerr[n];
  float yerr[n];

  float xband[30];
  float yband[30];

  float systerr = 0.06;

  x[0]  = 130;   y[0]  = 3.7640;   yerr[0]  = systerr * y[0];
  x[1]  = 150;   y[1]  = 2.1410;   yerr[1]  = systerr * y[1];
  x[2]  = 170;   y[2]  = 1.3040;   yerr[2]  = systerr * y[2];
  x[3]  = 190;   y[3]  = 0.8370;   yerr[3]  = systerr * y[3];
  x[4]  = 210;   y[4]  = 0.5580;   yerr[4]  = systerr * y[4];
  x[5]  = 230;   y[5]  = 0.3820;   yerr[5]  = systerr * y[5];
  x[6]  = 250;   y[6]  = 0.2710;   yerr[6]  = systerr * y[6];
  x[7]  = 270;   y[7]  = 0.1950;   yerr[7]  = systerr * y[7];
  x[8]  = 290;   y[8]  = 0.1420;   yerr[8]  = systerr * y[8];
  x[9]  = 310;   y[9]  = 0.1060;   yerr[9]  = systerr * y[9];
  x[10] = 330;   y[10] = 0.0798;   yerr[10] = systerr * y[10];
  x[11] = 350;   y[11] = 0.0608;   yerr[11] = systerr * y[11];   
  x[12] = 370;   y[12] = 0.0468;   yerr[12] = systerr * y[12];   
  x[13] = 390;   y[13] = 0.0366;   yerr[13] = systerr * y[13];   
  x[14] = 410;   y[14] = 0.0287;   yerr[14] = systerr * y[14];   

  for( int i = 0 ; i < 15; ++i ){
    xerr[i] = 0.0;
    yup[i]  = y[i] + yerr[i];
    ydn[i]  = y[i] - yerr[i];
  }

  for( int i = 0 ; i < 15; ++i ){
    xband[i] = x[i];
    yband[i] = y[i] + yerr[i];
  }

  for( int i = 0 ; i < 15; ++i ){
    xband[i+15] = x[14-i];
    yband[i+15] = y[14-i] - yerr[14-i];
  }
  
  // cout << endl << endl;
  // for( int i = 0 ; i < 30 ; ++i ){
  //   cout << xband[i] << " " << yband[i] << endl;
  // }
  // cout << endl << endl;

  TGraph* g     = new TGraph(n,x,y);
  TGraph* gup   = new TGraph(n,x,yup);
  TGraph* gdn   = new TGraph(n,x,ydn);
  TGraph* gband = new TGraph(30,xband,yband);

  // UP:   248
  // DOWN: 148

  //TGraphErrors* g  = new TGraphErrors(n,x,y,xerr,yerr);

  TCanvas *c1 = new TCanvas("c1","",600,600);
  gPad->SetTopMargin(0.1);
  gPad->SetRightMargin(0.05);
  //gPad->SetGridx();
  //gPad->SetGridy();

  float ymin = 0;
  if( logplot ) ymin = 0.03;

  //TH2F* hdummy = new TH2F("hdummy","",100,130,300,100,ymin,3000);
  TH2F* hdummy = new TH2F("hdummy","",100,130,400,100,ymin,5);
  hdummy->Draw();

  c1->cd();
  if( logplot ) gPad->SetLogy();

  g->SetLineColor(2);
  g->SetLineWidth(3);
  g->SetFillColor(5);
  gup->SetLineColor(2);
  gdn->SetLineColor(2);
  gup->SetLineStyle(2);
  gdn->SetLineStyle(2);
  gband->SetFillColor(5);

  /*
  //2l2j observed
  gul->SetLineColor(6);
  gul->SetLineWidth(3);
  gul->SetLineStyle(4);

  //2l2j expected
  gulexp->SetLineColor(2);
  gulexp->SetLineWidth(3);
  gulexp->SetLineStyle(2);

  //4l observed
  gul2->SetLineWidth(3);
  gul2->SetLineStyle(4);
  gul2->SetLineColor(kGreen+2);

  //4l expected
  gul2exp->SetLineWidth(3);
  gul2exp->SetLineStyle(2);
  */

  //combined observed
  gulc->SetLineWidth(5);
  gulc->SetLineColor(1);

  //combined expected
  gulcexp->SetLineWidth(5);
  gulcexp->SetLineColor(4);
  gulcexp->SetLineStyle(2);

  //clone TGraphs, with more points
  TGraph* gulc_line       = getGraph(gulc,10);
  TGraph* gulcexp_line    = getGraph(gulcexp,20);
  //TGraph* gul_line        = getGraph(gul,20);
  //TGraph* gul2_line       = getGraph(gul2,20);
  TGraph* gulcexpp1_line  = getGraph(gulcexpp1,20);
  TGraph* gulcexpm1_line  = getGraph(gulcexpm1,20);
  //TGraph* g_line          = getGraph(g,20);
  TGraph* gulcband_line   = uncertaintyBand( gulcexpp1_line , gulcexpm1_line );

  // gulexp->SetLineWidth(2);
  // gulexp->SetLineStyle(2);
  // gulexp->SetLineColor(2);  
  // gul2exp->SetLineWidth(2);
  // gul2exp->SetLineStyle(2);


  hdummy->GetXaxis()->SetTitle("#mu [GeV]");
  hdummy->GetYaxis()->SetTitle("#sigma [pb]");
  hdummy->GetYaxis()->SetLabelSize(0.04);
  hdummy->GetXaxis()->SetLabelSize(0.04);
  hdummy->GetYaxis()->SetTitleSize(0.05);
  hdummy->GetXaxis()->SetTitleSize(0.05);
  hdummy->GetXaxis()->SetTitleOffset(1.12);
  hdummy->GetYaxis()->SetTitleOffset(1.5);

  /*
  TBox* box = new TBox();
  //box->SetBorderStyle(2);
  //box->SetBorderSize(1);
  //box->SetFillColor(5);
  //box->SetFillStyle(3002);
  box->DrawBox(169,0,230,5000);
  TLine line;
  line.DrawLine(169,0,169,5000);
  line.DrawLine(230,0,230,5000);
  hdummy->Draw("axissame");
  */

  gband->Draw("samef");
  g->Draw("samel");

  // gulcband->SetFillStyle(3002);
  // gulcband->Draw("samef");

  gulcband_line->SetFillStyle(3002);
  gulcband_line->Draw("samef");

  gband->Draw("samef");
  g->Draw("samel");

  if( plotObserved ){
    if( !logInterpolate ){
      //gul->Draw("samel");
      //gul2->Draw("samel");
      gulc->Draw("samel");
      gulcexp->Draw("samel");
      //gulcexpp1->Draw("samel");
      //gulcexpm1->Draw("samel");
    }

    else{
      //gul_line->Draw("samel");
      //gul2_line->Draw("samel");
      gulc_line->Draw("samel");
      gulcexp_line->Draw("samel");
      //gulcexpp1_line->Draw("samel");
      //gulcexpm1_line->Draw("samel");
    }
  }

  // gulc_line->SetLineColor(2);
  // gulc_line->SetLineWidth(1);
  // gulc_line->SetMarkerColor(2);
  // gulc_line->Draw("samelp");

  if( plotExpected ){
    //gulexp->Draw("samel");
    //gul2exp->Draw("samel");
    gulcexp->Draw("samel");
  }




  //gband->Draw("samef");
  //g->Draw("samel");
  //gup->Draw("samel");
  //gdn->Draw("samel");

  //gulexp->Draw("samel");
  //gul2exp->Draw("samel");

  // g1->SetMinimum(0);
  // g1->SetMaximum(5000);
  // g1->Draw("samel");
  // g2->Draw("samel");

  //g1->Draw("Al");
  //g2->Draw("samel");
  
  float xmin = 165;
  float xmax = 239;

  TBox* box = new TBox();
  //box->SetBorderStyle(2);
  //box->SetBorderSize(1);
  //box->SetFillColor(5);
  //box->SetFillStyle(3002);
  //box->DrawBox(xmin,0,xmax,5000);

  TLine line;
  //line.DrawLine(xmin,0,xmin,5000);
  //line.DrawLine(xmax,0,xmax,5000);

  hdummy->Draw("axissame");
  // g->SetMinimum(0);
  // g->SetMaximum(3000);
  // g->Draw("samec");
  // gul->Draw("samel");
  // gul2->Draw("samel");

  //TLegend *leg = new TLegend(0.4,0.6,0.9,0.8);

  TH1F* hgexp = new TH1F("hgexp","",1,0,1);
  hgexp->SetLineColor(4);
  hgexp->SetLineWidth(5);
  hgexp->SetLineStyle(2);
  hgexp->SetFillColor(7);
  hgexp->SetFillStyle(3002);



  TLegend *leg = new TLegend(0.45,0.7,0.9,0.88);
  if( plotObserved ){
    leg->AddEntry(gulc    ,"Observed UL","l");
    //leg->AddEntry(gulc    ,"Combined observed UL","l");
    //leg->AddEntry(gulcexp ,"combined median expected UL","l");
    leg->AddEntry(hgexp   ,"Median expected UL (#pm1#sigma)","lf");
    //leg->AddEntry(gul     ,"2#font[12]{l}2j observed UL","l");
    //leg->AddEntry(gul2    ,"4#font[12]{l} observed UL","l");

  }
  if( plotExpected ){
    //leg->AddEntry(gulexp  ,"expected UL (VZ+E_{T}^{miss})","l");
    //leg->AddEntry(gul2exp ,"expected UL (multi-lepton)","l");
    //leg->AddEntry(gulcexp ,"expected UL (combined)","l");
    //leg->AddEntry(gulcexp ,"Expected UL","l");
  }



  TH1F* hg = new TH1F("h","",1,0,1);
  hg->SetLineColor(2);
  hg->SetLineWidth(3);
  hg->SetFillColor(5);

  //leg->AddEntry(g,  "theory","l");
  leg->AddEntry(hg,  "#sigma^{NLO} theory (#pm1#sigma)","lf");

  //leg->AddEntry(box,"excluded region","f");
  leg->SetBorderSize(0);
  leg->SetFillColor(0);
  leg->SetTextSize(0.03);
  leg->Draw();

  TLatex *t = new TLatex();
  t->SetNDC();								
  t->SetTextSize(0.04);
  //t->DrawLatex(0.18,0.92,"CMS Preliminary       #sqrt{s} = 7 TeV, #scale[0.6]{#int}Ldt = 4.98 fb^{-1}");
  //t->DrawLatex(0.18,0.93,"CMS Preliminary,  #sqrt{s}=7 TeV,  L_{int}=4.98 fb^{-1}");
  cmsPrelim(9.2,isPreliminary);
  t->SetTextSize(0.04);
  //t->DrawLatex(0.47,0.45,"");
  t->DrawLatex(0.57,0.63,"GMSB  ZZ + E_{T}^{miss}");

  t->DrawLatex(0.2,0.25,"tan #beta = 2");
  t->DrawLatex(0.2,0.2,"M_{1} = M_{2} = 1 TeV");

  if( printplots ){
    if( isPreliminary) c1->Print("GMSB_Fig12_prelim.pdf");
    else               c1->Print("GMSB_Fig12.pdf");

    c1->Print("Figure11.pdf");
    c1->Print("Figure11.png");

    // c1->Print("GMSB.png");
    // c1->Print("GMSB.eps");
    // gROOT->ProcessLine(".! ps2pdf GMSB.eps GMSB_ppt.pdf");
  }	   
}
void fitcomparingcuts_LM_optimized_DD1_sigregonly()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Fri May 13 23:29:18 2016) by ROOT version6.06/02
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(1075.63,-26.4,1149.704,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_5602550__1 = new TH1D("frame_5602550__1","",100,1086,1146);
   frame_5602550__1->SetBinContent(1,3.745406);
   frame_5602550__1->SetMinimum(-8.8);
   frame_5602550__1->SetMaximum(8.8);
   frame_5602550__1->SetEntries(1);
   frame_5602550__1->SetDirectory(0);
   frame_5602550__1->SetStats(0);
   frame_5602550__1->SetLineWidth(2);
   frame_5602550__1->SetMarkerStyle(20);
   frame_5602550__1->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_5602550__1->GetXaxis()->SetNdivisions(505);
   frame_5602550__1->GetXaxis()->SetLabelFont(132);
   frame_5602550__1->GetXaxis()->SetLabelOffset(0.01);
   frame_5602550__1->GetXaxis()->SetLabelSize(0.15);
   frame_5602550__1->GetXaxis()->SetTitleSize(0.2);
   frame_5602550__1->GetXaxis()->SetTitleOffset(1.1);
   frame_5602550__1->GetXaxis()->SetTitleFont(132);
   frame_5602550__1->GetYaxis()->SetTitle("Pull");
   frame_5602550__1->GetYaxis()->CenterTitle(true);
   frame_5602550__1->GetYaxis()->SetNdivisions(505);
   frame_5602550__1->GetYaxis()->SetLabelFont(132);
   frame_5602550__1->GetYaxis()->SetLabelOffset(0.01);
   frame_5602550__1->GetYaxis()->SetLabelSize(0.15);
   frame_5602550__1->GetYaxis()->SetTitleSize(0.15);
   frame_5602550__1->GetYaxis()->SetTitleOffset(0.45);
   frame_5602550__1->GetYaxis()->SetTitleFont(132);
   frame_5602550__1->GetZaxis()->SetLabelFont(132);
   frame_5602550__1->GetZaxis()->SetLabelSize(0.06);
   frame_5602550__1->GetZaxis()->SetTitleSize(0.072);
   frame_5602550__1->GetZaxis()->SetTitleOffset(1.2);
   frame_5602550__1->GetZaxis()->SetTitleFont(132);
   frame_5602550__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[24] = {
   1109.1,
   1109.7,
   1110.3,
   1110.9,
   1111.5,
   1112.1,
   1112.7,
   1113.3,
   1113.9,
   1114.5,
   1115.1,
   1115.7,
   1116.3,
   1116.9,
   1117.5,
   1118.1,
   1118.7,
   1119.3,
   1119.9,
   1120.5,
   1121.1,
   1121.7,
   1122.3,
   1122.9};
   Double_t pull_Hist_curvetot_fy3001[24] = {
   -0.3330637,
   -1.949993,
   -3.139195,
   -0.6971619,
   -1.655885,
   1.42007,
   1.006975,
   -0.1414765,
   -0.1440619,
   -0.3520065,
   0.8182724,
   1.900459,
   0.5393396,
   -1.447405,
   -1.879962,
   -1.916407,
   0.9788169,
   0.6653271,
   2.369949,
   0.4574603,
   2.123165,
   0.6650093,
   0.5132994,
   -1.11117};
   Double_t pull_Hist_curvetot_felx3001[24] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[24] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   Double_t pull_Hist_curvetot_fehx3001[24] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[24] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(24,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of data_plot__R_M and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of data_plot__R_M and Projection of totalPdf",100,1107.72,1124.28);
   Graph_pull_Hist_curvetot3001->SetMinimum(-4.890109);
   Graph_pull_Hist_curvetot3001->SetMaximum(4.120863);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_5602550__2 = new TH1D("frame_5602550__2","",100,1086,1146);
   frame_5602550__2->SetBinContent(1,3.745406);
   frame_5602550__2->SetMinimum(-8.8);
   frame_5602550__2->SetMaximum(8.8);
   frame_5602550__2->SetEntries(1);
   frame_5602550__2->SetDirectory(0);
   frame_5602550__2->SetStats(0);
   frame_5602550__2->SetLineWidth(2);
   frame_5602550__2->SetMarkerStyle(20);
   frame_5602550__2->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_5602550__2->GetXaxis()->SetNdivisions(505);
   frame_5602550__2->GetXaxis()->SetLabelFont(132);
   frame_5602550__2->GetXaxis()->SetLabelOffset(0.01);
   frame_5602550__2->GetXaxis()->SetLabelSize(0.15);
   frame_5602550__2->GetXaxis()->SetTitleSize(0.2);
   frame_5602550__2->GetXaxis()->SetTitleOffset(1.1);
   frame_5602550__2->GetXaxis()->SetTitleFont(132);
   frame_5602550__2->GetYaxis()->SetTitle("Pull");
   frame_5602550__2->GetYaxis()->CenterTitle(true);
   frame_5602550__2->GetYaxis()->SetNdivisions(505);
   frame_5602550__2->GetYaxis()->SetLabelFont(132);
   frame_5602550__2->GetYaxis()->SetLabelOffset(0.01);
   frame_5602550__2->GetYaxis()->SetLabelSize(0.15);
   frame_5602550__2->GetYaxis()->SetTitleSize(0.15);
   frame_5602550__2->GetYaxis()->SetTitleOffset(0.45);
   frame_5602550__2->GetYaxis()->SetTitleFont(132);
   frame_5602550__2->GetZaxis()->SetLabelFont(132);
   frame_5602550__2->GetZaxis()->SetLabelSize(0.06);
   frame_5602550__2->GetZaxis()->SetTitleSize(0.072);
   frame_5602550__2->GetZaxis()->SetTitleOffset(1.2);
   frame_5602550__2->GetZaxis()->SetTitleFont(132);
   frame_5602550__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(1075.63,0,1149.704,1077.436);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_5368230__3 = new TH1D("frame_5368230__3","A RooPlot of \"#Lambda mass\"",100,1086,1146);
   frame_5368230__3->SetBinContent(1,1012.789);
   frame_5368230__3->SetMaximum(1012.789);
   frame_5368230__3->SetEntries(1);
   frame_5368230__3->SetDirectory(0);
   frame_5368230__3->SetStats(0);
   frame_5368230__3->SetLineWidth(2);
   frame_5368230__3->SetMarkerStyle(20);
   frame_5368230__3->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_5368230__3->GetXaxis()->SetNdivisions(505);
   frame_5368230__3->GetXaxis()->SetLabelFont(132);
   frame_5368230__3->GetXaxis()->SetLabelOffset(0.01);
   frame_5368230__3->GetXaxis()->SetLabelSize(0.06);
   frame_5368230__3->GetXaxis()->SetTitleSize(0.072);
   frame_5368230__3->GetXaxis()->SetTitleOffset(0.95);
   frame_5368230__3->GetXaxis()->SetTitleFont(132);
   frame_5368230__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_5368230__3->GetYaxis()->SetLabelFont(132);
   frame_5368230__3->GetYaxis()->SetLabelOffset(0.01);
   frame_5368230__3->GetYaxis()->SetLabelSize(0.06);
   frame_5368230__3->GetYaxis()->SetTitleSize(0.072);
   frame_5368230__3->GetYaxis()->SetTitleOffset(0.95);
   frame_5368230__3->GetYaxis()->SetTitleFont(132);
   frame_5368230__3->GetZaxis()->SetLabelFont(132);
   frame_5368230__3->GetZaxis()->SetLabelSize(0.06);
   frame_5368230__3->GetZaxis()->SetTitleSize(0.072);
   frame_5368230__3->GetZaxis()->SetTitleOffset(1.2);
   frame_5368230__3->GetZaxis()->SetTitleFont(132);
   frame_5368230__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   1086.3,
   1086.9,
   1087.5,
   1088.1,
   1088.7,
   1089.3,
   1089.9,
   1090.5,
   1091.1,
   1091.7,
   1092.3,
   1092.9,
   1093.5,
   1094.1,
   1094.7,
   1095.3,
   1095.9,
   1096.5,
   1097.1,
   1097.7,
   1098.3,
   1098.9,
   1099.5,
   1100.1,
   1100.7,
   1101.3,
   1101.9,
   1102.5,
   1103.1,
   1103.7,
   1104.3,
   1104.9,
   1105.5,
   1106.1,
   1106.7,
   1107.3,
   1107.9,
   1108.5,
   1109.1,
   1109.7,
   1110.3,
   1110.9,
   1111.5,
   1112.1,
   1112.7,
   1113.3,
   1113.9,
   1114.5,
   1115.1,
   1115.7,
   1116.3,
   1116.9,
   1117.5,
   1118.1,
   1118.7,
   1119.3,
   1119.9,
   1120.5,
   1121.1,
   1121.7,
   1122.3,
   1122.9,
   1123.5,
   1124.1,
   1124.7,
   1125.3,
   1125.9,
   1126.5,
   1127.1,
   1127.7,
   1128.3,
   1128.9,
   1129.5,
   1130.1,
   1130.7,
   1131.3,
   1131.9,
   1132.5,
   1133.1,
   1133.7,
   1134.3,
   1134.9,
   1135.5,
   1136.1,
   1136.7,
   1137.3,
   1137.9,
   1138.5,
   1139.1,
   1139.7,
   1140.3,
   1140.9,
   1141.5,
   1142.1,
   1142.7,
   1143.3,
   1143.9,
   1144.5,
   1145.1,
   1145.7};
   Double_t Hist_fy3002[100] = {
   12,
   9,
   17,
   11,
   12,
   7,
   15,
   7,
   11,
   19,
   12,
   13,
   12,
   11,
   10,
   9,
   8,
   9,
   12,
   8,
   8,
   10,
   9,
   12,
   14,
   10,
   9,
   8,
   14,
   6,
   11,
   14,
   17,
   16,
   23,
   17,
   23,
   23,
   36,
   36,
   40,
   70,
   84,
   155,
   217,
   304,
   451,
   619,
   809,
   934,
   880,
   716,
   545,
   381,
   297,
   195,
   158,
   99,
   94,
   64,
   51,
   32,
   46,
   39,
   23,
   20,
   21,
   20,
   17,
   22,
   14,
   13,
   19,
   11,
   15,
   13,
   18,
   19,
   20,
   14,
   14,
   14,
   15,
   7,
   12,
   17,
   12,
   14,
   12,
   13,
   15,
   21,
   17,
   10,
   13,
   12,
   21,
   12,
   10,
   4};
   Double_t Hist_felx3002[100] = {
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3};
   Double_t Hist_fely3002[100] = {
   3.464102,
   3,
   4.123106,
   3.316625,
   3.464102,
   2.645751,
   3.872983,
   2.645751,
   3.316625,
   4.358899,
   3.464102,
   3.605551,
   3.464102,
   3.316625,
   3.162278,
   3,
   2.828427,
   3,
   3.464102,
   2.828427,
   2.828427,
   3.162278,
   3,
   3.464102,
   3.741657,
   3.162278,
   3,
   2.828427,
   3.741657,
   2.44949,
   3.316625,
   3.741657,
   4.123106,
   4,
   4.795832,
   4.123106,
   4.795832,
   4.795832,
   6,
   6,
   6.324555,
   8.3666,
   9.165151,
   12.4499,
   14.73092,
   17.4356,
   21.23676,
   24.87971,
   28.44293,
   30.56141,
   29.66479,
   26.75818,
   23.34524,
   19.51922,
   17.23369,
   13.96424,
   12.56981,
   9.949874,
   9.69536,
   8,
   7.141428,
   5.656854,
   6.78233,
   6.244998,
   4.795832,
   4.472136,
   4.582576,
   4.472136,
   4.123106,
   4.690416,
   3.741657,
   3.605551,
   4.358899,
   3.316625,
   3.872983,
   3.605551,
   4.242641,
   4.358899,
   4.472136,
   3.741657,
   3.741657,
   3.741657,
   3.872983,
   2.645751,
   3.464102,
   4.123106,
   3.464102,
   3.741657,
   3.464102,
   3.605551,
   3.872983,
   4.582576,
   4.123106,
   3.162278,
   3.605551,
   3.464102,
   4.582576,
   3.464102,
   3.162278,
   2};
   Double_t Hist_fehx3002[100] = {
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3};
   Double_t Hist_fehy3002[100] = {
   3.464102,
   3,
   4.123106,
   3.316625,
   3.464102,
   2.645751,
   3.872983,
   2.645751,
   3.316625,
   4.358899,
   3.464102,
   3.605551,
   3.464102,
   3.316625,
   3.162278,
   3,
   2.828427,
   3,
   3.464102,
   2.828427,
   2.828427,
   3.162278,
   3,
   3.464102,
   3.741657,
   3.162278,
   3,
   2.828427,
   3.741657,
   2.44949,
   3.316625,
   3.741657,
   4.123106,
   4,
   4.795832,
   4.123106,
   4.795832,
   4.795832,
   6,
   6,
   6.324555,
   8.3666,
   9.165151,
   12.4499,
   14.73092,
   17.4356,
   21.23676,
   24.87971,
   28.44293,
   30.56141,
   29.66479,
   26.75818,
   23.34524,
   19.51922,
   17.23369,
   13.96424,
   12.56981,
   9.949874,
   9.69536,
   8,
   7.141428,
   5.656854,
   6.78233,
   6.244998,
   4.795832,
   4.472136,
   4.582576,
   4.472136,
   4.123106,
   4.690416,
   3.741657,
   3.605551,
   4.358899,
   3.316625,
   3.872983,
   3.605551,
   4.242641,
   4.358899,
   4.472136,
   3.741657,
   3.741657,
   3.741657,
   3.872983,
   2.645751,
   3.464102,
   4.123106,
   3.464102,
   3.741657,
   3.464102,
   3.605551,
   3.872983,
   4.582576,
   4.123106,
   3.162278,
   3.605551,
   3.464102,
   4.582576,
   3.464102,
   3.162278,
   2};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of data_plot__R_M");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of data_plot__R_M",100,1080,1152);
   Graph_Hist3002->SetMinimum(0);
   Graph_Hist3002->SetMaximum(1060.818);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[102] = {
   1108.505,
   1108.653,
   1108.802,
   1108.95,
   1109.099,
   1109.247,
   1109.396,
   1109.544,
   1109.693,
   1109.842,
   1109.99,
   1110.139,
   1110.287,
   1110.436,
   1110.584,
   1110.733,
   1110.882,
   1111.03,
   1111.179,
   1111.327,
   1111.476,
   1111.624,
   1111.773,
   1111.922,
   1112.07,
   1112.219,
   1112.367,
   1112.516,
   1112.664,
   1112.813,
   1112.961,
   1113.11,
   1113.259,
   1113.407,
   1113.556,
   1113.704,
   1113.853,
   1114.001,
   1114.15,
   1114.299,
   1114.447,
   1114.596,
   1114.744,
   1114.893,
   1115.041,
   1115.19,
   1115.339,
   1115.487,
   1115.636,
   1115.784,
   1115.933,
   1116.081,
   1116.23,
   1116.378,
   1116.527,
   1116.676,
   1116.824,
   1116.973,
   1117.121,
   1117.27,
   1117.418,
   1117.567,
   1117.716,
   1117.864,
   1118.013,
   1118.161,
   1118.31,
   1118.458,
   1118.607,
   1118.756,
   1118.904,
   1119.053,
   1119.201,
   1119.35,
   1119.498,
   1119.647,
   1119.795,
   1119.944,
   1120.093,
   1120.241,
   1120.39,
   1120.538,
   1120.687,
   1120.835,
   1120.984,
   1121.133,
   1121.281,
   1121.43,
   1121.578,
   1121.727,
   1121.875,
   1122.024,
   1122.173,
   1122.321,
   1122.47,
   1122.618,
   1122.767,
   1122.915,
   1123.064,
   1123.212,
   1123.361,
   1123.361};
   Double_t curvetot_fy1[102] = {
   30.29978,
   32.0559,
   33.91896,
   35.89256,
   37.98048,
   40.18694,
   42.51682,
   44.97598,
   47.57177,
   50.31356,
   53.2135,
   56.28743,
   59.556,
   63.04591,
   66.79149,
   70.8363,
   75.23501,
   80.05526,
   85.37962,
   91.30726,
   97.95553,
   105.4609,
   113.9791,
   123.6849,
   134.7698,
   147.4391,
   161.9068,
   178.3894,
   197.097,
   218.2234,
   241.9346,
   268.3554,
   297.5564,
   329.54,
   364.228,
   401.45,
   440.935,
   482.3067,
   525.0822,
   568.6765,
   612.4121,
   655.5338,
   697.2294,
   736.6539,
   772.9585,
   805.3213,
   832.9784,
   855.2553,
   871.5944,
   881.5791,
   884.9519,
   881.6256,
   871.6873,
   855.3946,
   833.1642,
   805.5535,
   773.2371,
   736.9789,
   697.6009,
   655.9518,
   612.8765,
   569.1873,
   525.6395,
   482.9104,
   441.5852,
   402.1465,
   364.971,
   330.3295,
   298.3922,
   269.2377,
   242.8633,
   219.1986,
   198.1186,
   179.4575,
   163.0213,
   148.6,
   135.9772,
   124.9387,
   115.2793,
   106.8075,
   99.34864,
   92.74681,
   86.8656,
   81.58768,
   76.81386,
   72.46159,
   68.46322,
   64.76408,
   61.3206,
   58.09848,
   55.07098,
   52.21747,
   49.52212,
   46.97277,
   44.56004,
   42.27661,
   40.11658,
   38.0751,
   36.14794,
   34.33131,
   32.62163,
   32.62163};
   TGraph *graph = new TGraph(102,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",102,1107.019,1124.847);
   Graph_curvetot1->SetMinimum(0);
   Graph_curvetot1->SetMaximum(970.4171);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t bkg_fx2[102] = {
   1108.505,
   1108.653,
   1108.802,
   1108.95,
   1109.099,
   1109.247,
   1109.396,
   1109.544,
   1109.693,
   1109.842,
   1109.99,
   1110.139,
   1110.287,
   1110.436,
   1110.584,
   1110.733,
   1110.882,
   1111.03,
   1111.179,
   1111.327,
   1111.476,
   1111.624,
   1111.773,
   1111.922,
   1112.07,
   1112.219,
   1112.367,
   1112.516,
   1112.664,
   1112.813,
   1112.961,
   1113.11,
   1113.259,
   1113.407,
   1113.556,
   1113.704,
   1113.853,
   1114.001,
   1114.15,
   1114.299,
   1114.447,
   1114.596,
   1114.744,
   1114.893,
   1115.041,
   1115.19,
   1115.339,
   1115.487,
   1115.636,
   1115.784,
   1115.933,
   1116.081,
   1116.23,
   1116.378,
   1116.527,
   1116.676,
   1116.824,
   1116.973,
   1117.121,
   1117.27,
   1117.418,
   1117.567,
   1117.716,
   1117.864,
   1118.013,
   1118.161,
   1118.31,
   1118.458,
   1118.607,
   1118.756,
   1118.904,
   1119.053,
   1119.201,
   1119.35,
   1119.498,
   1119.647,
   1119.795,
   1119.944,
   1120.093,
   1120.241,
   1120.39,
   1120.538,
   1120.687,
   1120.835,
   1120.984,
   1121.133,
   1121.281,
   1121.43,
   1121.578,
   1121.727,
   1121.875,
   1122.024,
   1122.173,
   1122.321,
   1122.47,
   1122.618,
   1122.767,
   1122.915,
   1123.064,
   1123.212,
   1123.361,
   1123.361};
   Double_t bkg_fy2[102] = {
   9.168666,
   9.178623,
   9.188847,
   9.199339,
   9.2101,
   9.221128,
   9.232424,
   9.243988,
   9.25582,
   9.26792,
   9.280288,
   9.292923,
   9.305827,
   9.318999,
   9.332438,
   9.346145,
   9.360121,
   9.374364,
   9.388875,
   9.403654,
   9.418701,
   9.434016,
   9.449599,
   9.46545,
   9.481568,
   9.497955,
   9.514609,
   9.531532,
   9.548722,
   9.56618,
   9.583906,
   9.601901,
   9.620163,
   9.638692,
   9.65749,
   9.676556,
   9.69589,
   9.715491,
   9.735361,
   9.755498,
   9.775904,
   9.796577,
   9.817518,
   9.838727,
   9.860204,
   9.881949,
   9.903962,
   9.926243,
   9.948792,
   9.971608,
   9.994693,
   10.01805,
   10.04167,
   10.06555,
   10.08971,
   10.11413,
   10.13883,
   10.16379,
   10.18901,
   10.21451,
   10.24027,
   10.26631,
   10.2926,
   10.31917,
   10.34601,
   10.37311,
   10.40048,
   10.42812,
   10.45603,
   10.4842,
   10.51265,
   10.54136,
   10.57034,
   10.59958,
   10.6291,
   10.65888,
   10.68893,
   10.71925,
   10.74984,
   10.78069,
   10.81181,
   10.8432,
   10.87486,
   10.90679,
   10.93898,
   10.97144,
   11.00417,
   11.03717,
   11.07043,
   11.10397,
   11.13777,
   11.17184,
   11.20617,
   11.24078,
   11.27565,
   11.31079,
   11.3462,
   11.38188,
   11.41782,
   11.45404,
   11.49052,
   11.49052};
   graph = new TGraph(102,bkg_fx2,bkg_fy2);
   graph->SetName("bkg");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_bkg2 = new TH1F("Graph_bkg2","Projection of totalPdf",102,1107.019,1124.847);
   Graph_bkg2->SetMinimum(8.936481);
   Graph_bkg2->SetMaximum(11.7227);
   Graph_bkg2->SetDirectory(0);
   Graph_bkg2->SetStats(0);
   Graph_bkg2->SetLineWidth(2);
   Graph_bkg2->SetMarkerStyle(20);
   Graph_bkg2->GetXaxis()->SetNdivisions(505);
   Graph_bkg2->GetXaxis()->SetLabelFont(132);
   Graph_bkg2->GetXaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetXaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetXaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetXaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetXaxis()->SetTitleFont(132);
   Graph_bkg2->GetYaxis()->SetLabelFont(132);
   Graph_bkg2->GetYaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetYaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetYaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetYaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetYaxis()->SetTitleFont(132);
   Graph_bkg2->GetZaxis()->SetLabelFont(132);
   Graph_bkg2->GetZaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetZaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetZaxis()->SetTitleOffset(1.2);
   Graph_bkg2->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_bkg2);
   
   graph->Draw("l");
   
   Double_t sigLM_fx3[102] = {
   1108.505,
   1108.653,
   1108.802,
   1108.95,
   1109.099,
   1109.247,
   1109.396,
   1109.544,
   1109.693,
   1109.842,
   1109.99,
   1110.139,
   1110.287,
   1110.436,
   1110.584,
   1110.733,
   1110.882,
   1111.03,
   1111.179,
   1111.327,
   1111.476,
   1111.624,
   1111.773,
   1111.922,
   1112.07,
   1112.219,
   1112.367,
   1112.516,
   1112.664,
   1112.813,
   1112.961,
   1113.11,
   1113.259,
   1113.407,
   1113.556,
   1113.704,
   1113.853,
   1114.001,
   1114.15,
   1114.299,
   1114.447,
   1114.596,
   1114.744,
   1114.893,
   1115.041,
   1115.19,
   1115.339,
   1115.487,
   1115.636,
   1115.784,
   1115.933,
   1116.081,
   1116.23,
   1116.378,
   1116.527,
   1116.676,
   1116.824,
   1116.973,
   1117.121,
   1117.27,
   1117.418,
   1117.567,
   1117.716,
   1117.864,
   1118.013,
   1118.161,
   1118.31,
   1118.458,
   1118.607,
   1118.756,
   1118.904,
   1119.053,
   1119.201,
   1119.35,
   1119.498,
   1119.647,
   1119.795,
   1119.944,
   1120.093,
   1120.241,
   1120.39,
   1120.538,
   1120.687,
   1120.835,
   1120.984,
   1121.133,
   1121.281,
   1121.43,
   1121.578,
   1121.727,
   1121.875,
   1122.024,
   1122.173,
   1122.321,
   1122.47,
   1122.618,
   1122.767,
   1122.915,
   1123.064,
   1123.212,
   1123.361,
   1123.361};
   Double_t sigLM_fy3[102] = {
   21.13111,
   22.87727,
   24.73012,
   26.69322,
   28.77038,
   30.96581,
   33.28439,
   35.73199,
   38.31595,
   41.04564,
   43.93321,
   46.99451,
   50.25017,
   53.72691,
   57.45905,
   61.49015,
   65.87488,
   70.6809,
   75.99074,
   81.90361,
   88.53683,
   96.02684,
   104.5295,
   114.2194,
   125.2882,
   137.9411,
   152.3922,
   168.8579,
   187.5483,
   208.6573,
   232.3507,
   258.7535,
   287.9362,
   319.9013,
   354.5705,
   391.7734,
   431.2391,
   472.5913,
   515.3469,
   558.921,
   602.6362,
   645.7372,
   687.4118,
   726.8151,
   763.0983,
   795.4393,
   823.0745,
   845.3291,
   861.6456,
   871.6075,
   874.9572,
   871.6075,
   861.6456,
   845.3291,
   823.0745,
   795.4393,
   763.0983,
   726.8151,
   687.4118,
   645.7372,
   602.6362,
   558.921,
   515.3469,
   472.5913,
   431.2391,
   391.7734,
   354.5705,
   319.9013,
   287.9362,
   258.7535,
   232.3507,
   208.6573,
   187.5483,
   168.8579,
   152.3922,
   137.9411,
   125.2882,
   114.2194,
   104.5295,
   96.02684,
   88.53683,
   81.90361,
   75.99074,
   70.6809,
   65.87488,
   61.49015,
   57.45905,
   53.72691,
   50.25017,
   46.99451,
   43.93321,
   41.04564,
   38.31595,
   35.73199,
   33.28439,
   30.96581,
   28.77038,
   26.69322,
   24.73012,
   22.87727,
   21.13111,
   21.13111};
   graph = new TGraph(102,sigLM_fx3,sigLM_fy3);
   graph->SetName("sigLM");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(3);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_sigLM3 = new TH1F("Graph_sigLM3","Projection of totalPdf",102,1107.019,1124.847);
   Graph_sigLM3->SetMinimum(0);
   Graph_sigLM3->SetMaximum(960.3398);
   Graph_sigLM3->SetDirectory(0);
   Graph_sigLM3->SetStats(0);
   Graph_sigLM3->SetLineWidth(2);
   Graph_sigLM3->SetMarkerStyle(20);
   Graph_sigLM3->GetXaxis()->SetNdivisions(505);
   Graph_sigLM3->GetXaxis()->SetLabelFont(132);
   Graph_sigLM3->GetXaxis()->SetLabelOffset(0.01);
   Graph_sigLM3->GetXaxis()->SetLabelSize(0.06);
   Graph_sigLM3->GetXaxis()->SetTitleSize(0.072);
   Graph_sigLM3->GetXaxis()->SetTitleOffset(0.95);
   Graph_sigLM3->GetXaxis()->SetTitleFont(132);
   Graph_sigLM3->GetYaxis()->SetLabelFont(132);
   Graph_sigLM3->GetYaxis()->SetLabelOffset(0.01);
   Graph_sigLM3->GetYaxis()->SetLabelSize(0.06);
   Graph_sigLM3->GetYaxis()->SetTitleSize(0.072);
   Graph_sigLM3->GetYaxis()->SetTitleOffset(0.95);
   Graph_sigLM3->GetYaxis()->SetTitleFont(132);
   Graph_sigLM3->GetZaxis()->SetLabelFont(132);
   Graph_sigLM3->GetZaxis()->SetLabelSize(0.06);
   Graph_sigLM3->GetZaxis()->SetTitleSize(0.072);
   Graph_sigLM3->GetZaxis()->SetTitleOffset(1.2);
   Graph_sigLM3->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_sigLM3);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.75,0.5,1,0.9,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("bkg","Background","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("sigLM","#Lambda M (dbl Gaus)","l");
   entry->SetLineColor(3);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_5368230__4 = new TH1D("frame_5368230__4","A RooPlot of \"#Lambda mass\"",100,1086,1146);
   frame_5368230__4->SetBinContent(1,1012.789);
   frame_5368230__4->SetMaximum(1012.789);
   frame_5368230__4->SetEntries(1);
   frame_5368230__4->SetDirectory(0);
   frame_5368230__4->SetStats(0);
   frame_5368230__4->SetLineWidth(2);
   frame_5368230__4->SetMarkerStyle(20);
   frame_5368230__4->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_5368230__4->GetXaxis()->SetNdivisions(505);
   frame_5368230__4->GetXaxis()->SetLabelFont(132);
   frame_5368230__4->GetXaxis()->SetLabelOffset(0.01);
   frame_5368230__4->GetXaxis()->SetLabelSize(0.06);
   frame_5368230__4->GetXaxis()->SetTitleSize(0.072);
   frame_5368230__4->GetXaxis()->SetTitleOffset(0.95);
   frame_5368230__4->GetXaxis()->SetTitleFont(132);
   frame_5368230__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_5368230__4->GetYaxis()->SetLabelFont(132);
   frame_5368230__4->GetYaxis()->SetLabelOffset(0.01);
   frame_5368230__4->GetYaxis()->SetLabelSize(0.06);
   frame_5368230__4->GetYaxis()->SetTitleSize(0.072);
   frame_5368230__4->GetYaxis()->SetTitleOffset(0.95);
   frame_5368230__4->GetYaxis()->SetTitleFont(132);
   frame_5368230__4->GetZaxis()->SetLabelFont(132);
   frame_5368230__4->GetZaxis()->SetLabelSize(0.06);
   frame_5368230__4->GetZaxis()->SetTitleSize(0.072);
   frame_5368230__4->GetZaxis()->SetTitleOffset(1.2);
   frame_5368230__4->GetZaxis()->SetTitleFont(132);
   frame_5368230__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Ejemplo n.º 19
0
void buildFakeAngTree(const Char_t* outtag,
                      const Float_t timereso,     // ns
                      const UInt_t  simevts=1,
                      const Float_t thetaOpt=400, // deg
                      const Float_t phiOpt=400,   // deg
                      const Float_t coneOpt=400,  // deg
                      const UInt_t  rseed=23192,
                      const Float_t norm=100.0,   // mV
                      const Float_t noise=20.0,   // mV
                      const Char_t* outdir="/data/users/cjreed/work/simEvts",
                      const Char_t* infn="/w2/arianna/jtatar/nt.sigtemps.root",
                      const Char_t* geofn="/data/users/cjreed/work/"
                                          "BounceStudy/Stn10/"
                                          "CampSiteGeometry.root") {
   // if any of the angles (thetaOpt, phiOpt, coneOpt) > 360, a random
   // value will be used instead
   //
   // expect angles in the Templates tree to be in degrees
   //
   // expect the waveforms in the Templates tree to have amplitude 1
   
   TRandom3 rnd(rseed);
   
   
   geof = TFile::Open(geofn);
   gg = dynamic_cast<TGeoManager*>(geof->Get("CampSite2013"));
   site = dynamic_cast<const TSnGeoStnSite*>(gg->GetTopVolume());
   
   
   TVector3 pos[NSnConstants::kNchans], nvec[NSnConstants::kNchans];
   for (UChar_t ch=0; ch<NSnConstants::kNchans; ++ch) {
      site->SetLPDAPosition(ch, pos[ch]);
      site->SetLPDANormalVec(ch, nvec[ch]);
      Printf("pos ch%d:",ch);
      pos[ch].Print();
      Printf("normal ch%d:",ch);
      nvec[ch].Print();
   }
   
   TArrayD zeros(6);
   
   
   inf = TFile::Open(infn);
   nnt = dynamic_cast<TTree*>(inf->Get("Templates"));
   
   TString infns(infn);
   TString indir;
   Int_t fl(0);
   if (infns.Contains('/')) {
      fl = infns.Last('/') + 1;
      indir = infns(0, fl-1);
   }
   TString plaininfn = infns(fl, infns.Length()-fl);
   TString outfn = Form("%s/FakeEvts.%s.%s", outdir, outtag,
                        plaininfn.Data());
   outf = TFile::Open(outfn.Data(),"recreate");
   outf->cd();
   TParameter<Float_t> trp("TimeResolution", timereso);
   trp.Write();
   TParameter<Float_t> nmp("Normalization", norm);
   nmp.Write();
   TParameter<Float_t> nop("NoiseRMS", noise);
   nop.Write();
   TParameter<UInt_t> rsp("RandomSeed", rseed);
   rsp.Write();
   
   
   TSnCalWvData* wave = new TSnCalWvData;
   Float_t eang(0), hang(0), hpf(0), limiter(0), coneang(0);
   Bool_t bice(kFALSE);
   nnt->SetBranchAddress("wave.",&wave);
   nnt->SetBranchAddress("EAng",&eang);
   nnt->SetBranchAddress("HAng",&hang);
   nnt->SetBranchAddress("hpf",&hpf);
   nnt->SetBranchAddress("limiter",&limiter);
   nnt->SetBranchAddress("coneAng",&coneang);
   nnt->SetBranchAddress("bIce",&bice);
   // to look up waveform for EAng, HAng
   nnt->BuildIndex("EAng + (1000*HAng)","coneAng");
   // find the max angles
   Printf("finding allowed angles...");
   std::set<Float_t> Eangs, Hangs, Cangs;
   const Long64_t nnents = nnt->GetEntries();
   for (Long64_t i=0; i<nnents; ++i) {
      nnt->GetEntry(i);
      Eangs.insert(eang);
      Hangs.insert(hang);
      Cangs.insert(coneang);
   }
#ifdef DEBUG
   std::set<Float_t>::const_iterator ang, end = Eangs.end();
   Printf("EAngs:");
   for (ang=Eangs.begin(); ang!=end; ++ang) {
      Printf("%g",*ang);
   }
   Printf("HAngs:");
   for (ang=Hangs.begin(), end=Hangs.end(); ang!=end; ++ang) {
      Printf("%g",*ang);
   }
   Printf("ConeAngs:");
   for (ang=Cangs.begin(), end=Cangs.end(); ang!=end; ++ang) {
      Printf("%g",*ang);
   }
#endif
   
   Float_t theta(0), phi(0), cone(0);
   Float_t EAng[NSnConstants::kNchans], 
           HAng[NSnConstants::kNchans];
   Float_t CAng(0);
   TSnCalWvData* evdat = new TSnCalWvData;
   TSnEventMetadata* meta = new TSnEventMetadata;
   TSnEventHeader* hdr = new TSnEventHeader;
   //ot = nnt->CloneTree(0);
   //ot->SetName("SimTemplEvts");
   ot = new TTree("SimTemplEvts","simulated events from templates",1);
   ot->SetDirectory(outf);
   ot->Branch("EventMetadata.",&meta);
   ot->Branch("EventHeader.",&hdr);
   ot->Branch("EAng",&(EAng[0]),Form("EAng[%hhu]/F",NSnConstants::kNchans));
   ot->Branch("HAng",&(HAng[0]),Form("HAng[%hhu]/F",NSnConstants::kNchans));
   ot->Branch("CAng",&CAng,"CAng/F");
   ot->Branch("theta",&theta,"theta/F");
   ot->Branch("phi",&phi,"phi/F");
   ot->Branch("NuData.",&evdat);
   // some useful aliases
   TString an;
   for (UChar_t ch=0; ch<NSnConstants::kNchans; ++ch) {
      // to use as a cut for a particular channel:
      an = Form("Ch%d",ch);
      ot->SetAlias(an.Data(),
                   Form("(Iteration$>=(%hhu*%hhu)) && (Iteration$<(%hhu*%hhu))",
                        NSnConstants::kNsamps, ch,
                        NSnConstants::kNsamps,
                        static_cast<UChar_t>(ch+1)));
      // to use as a variable showing the sample number [0,127] for any chan
      an = Form("SmpCh%d",ch);
      ot->SetAlias(an.Data(),
                   Form("Iteration$-%u", static_cast<UInt_t>(ch)
                        *static_cast<UInt_t>(NSnConstants::kNsamps)));
      // e.g. Draw("RawData.fData:SmpCh2","EventHeader.fNum==21 && Ch2","l")
   }

   Printf("generating events...");
   TStopwatch timer;
   timer.Start();
   
   for (UInt_t i=0; i<simevts; ++i) {
      
      if ( (i%1000)==0 ) {
         fprintf(stderr,"Processing %u/%u ...            \r",i,simevts);
      }
      
      // choose angles
      theta = (thetaOpt>360.) ? TMath::ACos( rnd.Uniform(-1.0, 0.0) ) 
                              : thetaOpt * TMath::DegToRad();
      phi   = (phiOpt>360.) ? rnd.Uniform(0.0, TMath::TwoPi())
                            : phiOpt * TMath::DegToRad();
      cone  = (coneOpt>360.) 
         ? rnd.Uniform(*(Cangs.begin()), *(Cangs.rbegin()))
         : coneOpt; // leave this one in degrees (as in the tree)
      CAng = findNearestAllowedAngle(Cangs, cone);
      
#ifdef DEBUG
      Printf("--- theta=%g, phi=%g, cone=%g",
             theta*TMath::RadToDeg(), phi*TMath::RadToDeg(), cone);
#endif
      
      // calculate channel shifts
      TArrayD pwdt = NSnChanCorl::GetPlaneWaveOffsets(theta,
                                                      phi,
                                                      zeros,
                                                      pos,
                                                      kNgTopFirn);
      TVector3 dir;
      dir.SetMagThetaPhi(1.0, theta, phi);
      
#ifdef DEBUG
      TObjArray graphs;
      graphs.SetOwner(kTRUE);
      TCanvas* c1 = new TCanvas("c1","c1",800,700);
      c1->Divide(2,2);
#endif
      
      for (UChar_t ch=0; ch<NSnConstants::kNchans; ++ch) {
         
         // look up the EAng, fhang for this antenna
         Float_t feang(0), fhang(0);
         findEangHang(nvec[ch], dir, feang, fhang);
         feang  = TMath::Abs(TVector2::Phi_mpi_pi(feang));
         fhang  = TMath::Abs(TVector2::Phi_mpi_pi(fhang));
         feang *= TMath::RadToDeg();
         fhang *= TMath::RadToDeg();
         // find closest allowed angle
         EAng[ch] = findNearestAllowedAngle(Eangs, feang);
         HAng[ch] = findNearestAllowedAngle(Hangs, fhang);
         const Long64_t ni = 
            nnt->GetEntryNumberWithIndex(EAng[ch] + (1000*HAng[ch]), CAng);
#ifdef DEBUG
         Printf("EAng=%g (%g), HAng=%g (%g), CAng=%g, ni=%lld",
                EAng[ch],feang,HAng[ch],fhang,CAng,ni);
#endif
         if (ni>-1) {
            nnt->GetEntry(ni);
#ifdef DEBUG
            c1->cd(ch+1);
            TGraph* och = wave->NewGraphForChan(0, kTRUE);
            const Int_t ochnp = och->GetN();
            Double_t* ochy = och->GetY();
            for (Int_t k=0; k<ochnp; ++k, ++ochy) {
               *ochy *= norm;
            }
            graphs.Add(och);
            och->SetLineColor(kBlack);
            och->SetMarkerColor(kBlack);
            och->SetMarkerStyle(7);
            och->Draw("apl");
#endif
            
            // first calculate the shift between chans due to the angle
            // ch0 is always unshifted; other chans shifted w.r.t. ch0
            // jitter the shift by the specified timing resolution
            const Double_t shift = 
               rnd.Gaus( (ch==0) ? 0.0
                            : -pwdt.At( TSnRecoChanOffsets::IndexFor(ch, 0) ),
                         timereso);
            // get a graph of the waveform
            // data only in channel 0 of the template
            TGraph* gch = wave->NewGraphForChan(0, kTRUE);
            // "fit" the graph with an spline interpolation
            TSpline3* gsp = new TSpline3("stmp", gch);
            // evaluate the spline at the new sample positions
            // (shifted, but NOT wrapped)
            // and save that into the event data waveform
            Float_t* d = evdat->GetData(ch);
            const Float_t tstep = 1.0 / NSnConstants::kSampRate;
            const Float_t tlast = static_cast<Float_t>(NSnConstants::kNsamps-1)
               / NSnConstants::kSampRate;
            Float_t xloc = shift;
            for (UChar_t s=0; s<NSnConstants::kNsamps; ++s, ++d, xloc+=tstep) {
               if ( (xloc<0.0) || (xloc>=tlast) ) {
                  *d = 0.0;
               } else {
                  *d = gsp->Eval( xloc );
               }
            }
#ifdef DEBUG
            Printf("ch%hhu: shift=%g, dt=%g", ch, shift,
                   (ch==0) ? 0.0
                   : pwdt.At( TSnRecoChanOffsets::IndexFor(ch, 0) ));
            
            TGraph* fch = evdat->NewGraphForChan(ch, kTRUE);
            Double_t* y = gch->GetY();
            Double_t* fy = fch->GetY();
            for (UChar_t s=0; s<NSnConstants::kNsamps; ++s, ++y, ++fy) {
               *y *= norm;
               *fy *= norm;
            }
            
            gch->SetLineColor(kRed+1);
            gch->SetMarkerColor(kRed+1);
            gch->SetMarkerStyle(7);
            gch->Draw("pl");
            
            delete gsp;
            gsp = new TSpline3("stmp",gch);
            gsp->SetLineColor(kAzure-6);
            gsp->SetMarkerColor(kAzure-6);
            gsp->SetMarkerStyle(7);
            gsp->Draw("pl same");
            
            graphs.Add(fch);
            fch->SetLineColor(kOrange+7);
            fch->SetMarkerColor(kOrange+7);
            fch->SetMarkerStyle(7);
            fch->Draw("pl");
#endif


            d = evdat->GetData(ch);
            // finally add noise to the waveform
            for (UChar_t s=0; s<NSnConstants::kNsamps; ++s, ++d) {
               *d = rnd.Gaus( (*d) * norm, noise );
            }
            
#ifdef DEBUG
            TGraph* nch = evdat->NewGraphForChan(ch, kTRUE);
            graphs.Add(nch);
            nch->SetLineColor(kGreen+2);
            nch->SetMarkerColor(kGreen+2);
            nch->SetMarkerStyle(7);
            nch->Draw("pl");
#endif
            
            // cleanup
#ifdef DEBUG
            graphs.Add(gch);
            graphs.Add(gsp);
#else
            delete gch;
            delete gsp;
#endif
         }

      } // end channel loop

#ifdef DEBUG
      TObject* o(0);
      while ( (o=c1->WaitPrimitive())!=0 ) {
         gSystem->ProcessEvents();
      }
      delete c1;
#endif
         
         // save this event
         ot->Fill();
         
   } // end event loop

   fprintf(stderr,"\n");

   timer.Stop();
   Printf("Finished generating events in:");
   timer.Print();
   
   outf->Write();
   
   Printf("Wrote [%s]",outf->GetName());
   
   delete outf; outf=0; // close file
}
void fitLMC_c070116_LL1_floatsigmalfixmu_nobkg()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Wed Jul  6 19:50:47 2016) by ROOT version6.06/02
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(3754.321,-26.4,6223.457,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_47a6360__1 = new TH1D("frame_47a6360__1","",100,4100,6100);
   frame_47a6360__1->SetBinContent(1,11.22376);
   frame_47a6360__1->SetMinimum(-8.8);
   frame_47a6360__1->SetMaximum(8.8);
   frame_47a6360__1->SetEntries(1);
   frame_47a6360__1->SetDirectory(0);
   frame_47a6360__1->SetStats(0);
   frame_47a6360__1->SetLineWidth(2);
   frame_47a6360__1->SetMarkerStyle(20);
   frame_47a6360__1->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_47a6360__1->GetXaxis()->SetNdivisions(505);
   frame_47a6360__1->GetXaxis()->SetLabelFont(132);
   frame_47a6360__1->GetXaxis()->SetLabelOffset(0.01);
   frame_47a6360__1->GetXaxis()->SetLabelSize(0.15);
   frame_47a6360__1->GetXaxis()->SetTitleSize(0.2);
   frame_47a6360__1->GetXaxis()->SetTitleOffset(1.1);
   frame_47a6360__1->GetXaxis()->SetTitleFont(132);
   frame_47a6360__1->GetYaxis()->SetTitle("Pull");
   frame_47a6360__1->GetYaxis()->CenterTitle(true);
   frame_47a6360__1->GetYaxis()->SetNdivisions(505);
   frame_47a6360__1->GetYaxis()->SetLabelFont(132);
   frame_47a6360__1->GetYaxis()->SetLabelOffset(0.01);
   frame_47a6360__1->GetYaxis()->SetLabelSize(0.15);
   frame_47a6360__1->GetYaxis()->SetTitleSize(0.15);
   frame_47a6360__1->GetYaxis()->SetTitleOffset(0.45);
   frame_47a6360__1->GetYaxis()->SetTitleFont(132);
   frame_47a6360__1->GetZaxis()->SetLabelFont(132);
   frame_47a6360__1->GetZaxis()->SetLabelSize(0.06);
   frame_47a6360__1->GetZaxis()->SetTitleSize(0.072);
   frame_47a6360__1->GetZaxis()->SetTitleOffset(1.2);
   frame_47a6360__1->GetZaxis()->SetTitleFont(132);
   frame_47a6360__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[87] = {
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950,
   5970,
   5990,
   6010,
   6030};
   Double_t pull_Hist_curvetot_fy3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0.7803311,
   1.427949,
   0.06505515,
   9.054404,
   9.644772,
   0.7725062,
   0.8209224,
   0.8516202,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_felx3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehx3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(87,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr and Projection of totalPdf",100,4138,6202);
   Graph_pull_Hist_curvetot3001->SetMinimum(-2.092917);
   Graph_pull_Hist_curvetot3001->SetMaximum(11.80274);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_47a6360__2 = new TH1D("frame_47a6360__2","",100,4100,6100);
   frame_47a6360__2->SetBinContent(1,11.22376);
   frame_47a6360__2->SetMinimum(-8.8);
   frame_47a6360__2->SetMaximum(8.8);
   frame_47a6360__2->SetEntries(1);
   frame_47a6360__2->SetDirectory(0);
   frame_47a6360__2->SetStats(0);
   frame_47a6360__2->SetLineWidth(2);
   frame_47a6360__2->SetMarkerStyle(20);
   frame_47a6360__2->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_47a6360__2->GetXaxis()->SetNdivisions(505);
   frame_47a6360__2->GetXaxis()->SetLabelFont(132);
   frame_47a6360__2->GetXaxis()->SetLabelOffset(0.01);
   frame_47a6360__2->GetXaxis()->SetLabelSize(0.15);
   frame_47a6360__2->GetXaxis()->SetTitleSize(0.2);
   frame_47a6360__2->GetXaxis()->SetTitleOffset(1.1);
   frame_47a6360__2->GetXaxis()->SetTitleFont(132);
   frame_47a6360__2->GetYaxis()->SetTitle("Pull");
   frame_47a6360__2->GetYaxis()->CenterTitle(true);
   frame_47a6360__2->GetYaxis()->SetNdivisions(505);
   frame_47a6360__2->GetYaxis()->SetLabelFont(132);
   frame_47a6360__2->GetYaxis()->SetLabelOffset(0.01);
   frame_47a6360__2->GetYaxis()->SetLabelSize(0.15);
   frame_47a6360__2->GetYaxis()->SetTitleSize(0.15);
   frame_47a6360__2->GetYaxis()->SetTitleOffset(0.45);
   frame_47a6360__2->GetYaxis()->SetTitleFont(132);
   frame_47a6360__2->GetZaxis()->SetLabelFont(132);
   frame_47a6360__2->GetZaxis()->SetLabelSize(0.06);
   frame_47a6360__2->GetZaxis()->SetTitleSize(0.072);
   frame_47a6360__2->GetZaxis()->SetTitleOffset(1.2);
   frame_47a6360__2->GetZaxis()->SetTitleFont(132);
   frame_47a6360__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(0,0,1,1);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetLogy();
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_4645af0__3 = new TH1D("frame_4645af0__3","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_4645af0__3->SetBinContent(1,3310.288);
   frame_4645af0__3->SetMinimum(0);
   frame_4645af0__3->SetMaximum(7500);
   frame_4645af0__3->SetEntries(2);
   frame_4645af0__3->SetDirectory(0);
   frame_4645af0__3->SetStats(0);
   frame_4645af0__3->SetLineWidth(2);
   frame_4645af0__3->SetMarkerStyle(20);
   frame_4645af0__3->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_4645af0__3->GetXaxis()->SetNdivisions(505);
   frame_4645af0__3->GetXaxis()->SetLabelFont(132);
   frame_4645af0__3->GetXaxis()->SetLabelOffset(0.01);
   frame_4645af0__3->GetXaxis()->SetLabelSize(0.06);
   frame_4645af0__3->GetXaxis()->SetTitleSize(0.072);
   frame_4645af0__3->GetXaxis()->SetTitleOffset(0.95);
   frame_4645af0__3->GetXaxis()->SetTitleFont(132);
   frame_4645af0__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4645af0__3->GetYaxis()->SetLabelFont(132);
   frame_4645af0__3->GetYaxis()->SetLabelOffset(0.01);
   frame_4645af0__3->GetYaxis()->SetLabelSize(0.06);
   frame_4645af0__3->GetYaxis()->SetTitleSize(0.072);
   frame_4645af0__3->GetYaxis()->SetTitleOffset(0.95);
   frame_4645af0__3->GetYaxis()->SetTitleFont(132);
   frame_4645af0__3->GetZaxis()->SetLabelFont(132);
   frame_4645af0__3->GetZaxis()->SetLabelSize(0.06);
   frame_4645af0__3->GetZaxis()->SetTitleSize(0.072);
   frame_4645af0__3->GetZaxis()->SetTitleOffset(1.2);
   frame_4645af0__3->GetZaxis()->SetTitleFont(132);
   frame_4645af0__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   4110,
   4130,
   4150,
   4170,
   4190,
   4210,
   4230,
   4250,
   4270,
   4290,
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950,
   5970,
   5990,
   6010,
   6030,
   6050,
   6070,
   6090};
   Double_t Hist_fy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   5,
   30,
   1308,
   1283,
   36,
   7,
   2,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_felx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fely3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   2.236068,
   5.477226,
   36.16628,
   35.81899,
   6,
   2.645751,
   1.414214,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_fehx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fehy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   2.236068,
   5.477226,
   36.16628,
   35.81899,
   6,
   2.645751,
   1.414214,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr",100,3900,6300);
   Graph_Hist3002->SetMinimum(1.478583);
   Graph_Hist3002->SetMaximum(1478.583);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[128] = {
   4300,
   4317.4,
   4334.8,
   4352.2,
   4369.6,
   4387,
   4404.4,
   4421.8,
   4439.2,
   4456.6,
   4474,
   4491.4,
   4508.8,
   4526.2,
   4543.6,
   4561,
   4578.4,
   4595.8,
   4613.2,
   4630.6,
   4648,
   4665.4,
   4682.8,
   4700.2,
   4717.6,
   4735,
   4752.4,
   4769.8,
   4787.2,
   4804.6,
   4822,
   4839.4,
   4856.8,
   4874.2,
   4891.6,
   4909,
   4926.4,
   4943.8,
   4961.2,
   4978.6,
   4996,
   5013.4,
   5030.8,
   5048.2,
   5065.6,
   5083,
   5100.4,
   5117.8,
   5135.2,
   5152.6,
   5170,
   5187.4,
   5204.8,
   5222.2,
   5239.6,
   5257,
   5274.4,
   5291.8,
   5309.2,
   5326.6,
   5344,
   5361.4,
   5378.8,
   5396.2,
   5413.6,
   5431,
   5448.4,
   5465.8,
   5483.2,
   5500.6,
   5518,
   5535.4,
   5552.8,
   5570.2,
   5578.9,
   5587.6,
   5591.95,
   5594.125,
   5596.3,
   5598.475,
   5600.65,
   5602.825,
   5605,
   5607.175,
   5609.35,
   5611.525,
   5613.7,
   5615.875,
   5618.05,
   5620.225,
   5622.4,
   5624.575,
   5626.75,
   5628.925,
   5631.1,
   5633.275,
   5635.45,
   5637.625,
   5639.8,
   5641.975,
   5644.15,
   5646.325,
   5648.5,
   5652.85,
   5657.2,
   5674.6,
   5692,
   5709.4,
   5726.8,
   5744.2,
   5761.6,
   5779,
   5796.4,
   5813.8,
   5831.2,
   5848.6,
   5866,
   5883.4,
   5900.8,
   5918.2,
   5935.6,
   5953,
   5970.4,
   5987.8,
   6005.2,
   6022.6,
   6040,
   6040};
   Double_t curvetot_fy1[128] = {
   2.641671e-14,
   3.083583e-14,
   3.606647e-14,
   4.22713e-14,
   4.964839e-14,
   5.843959e-14,
   6.894096e-14,
   8.151596e-14,
   9.661198e-14,
   1.147814e-13,
   1.367083e-13,
   1.632422e-13,
   1.954419e-13,
   2.34631e-13,
   2.824697e-13,
   3.410475e-13,
   4.130042e-13,
   5.016864e-13,
   6.113531e-13,
   7.474463e-13,
   9.169469e-13,
   1.128848e-12,
   1.394785e-12,
   1.72988e-12,
   2.153878e-12,
   2.692683e-12,
   3.380449e-12,
   4.262445e-12,
   5.398991e-12,
   6.870912e-12,
   8.787139e-12,
   1.129537e-11,
   1.459713e-11,
   1.896921e-11,
   2.479432e-11,
   3.260552e-11,
   4.315072e-11,
   5.748756e-11,
   7.712394e-11,
   1.042282e-10,
   1.419463e-10,
   1.948863e-10,
   2.698652e-10,
   3.770732e-10,
   5.319131e-10,
   7.57939e-10,
   1.091619e-09,
   1.590156e-09,
   2.34454e-09,
   3.501654e-09,
   5.30238e-09,
   8.14847e-09,
   1.272218e-08,
   2.020476e-08,
   3.268456e-08,
   5.393757e-08,
   9.095971e-08,
   1.570604e-07,
   2.783015e-07,
   5.073559e-07,
   9.544428e-07,
   1.85923e-06,
   3.765582e-06,
   7.96795e-06,
   1.771712e-05,
   4.168914e-05,
   0.0001047096,
   0.000283768,
   0.0008411969,
   0.002776511,
   0.0104477,
   0.04629297,
   0.252919,
   1.825081,
   5.617464,
   19.40548,
   37.96221,
   53.87247,
   77.25328,
   112.0161,
   164.3475,
   244.1745,
   367.6418,
   559.4869,
   852.6256,
   1280.633,
   1850.024,
   2487.092,
   2999.567,
   3152.655,
   2862.992,
   2283.252,
   1652.74,
   1126.108,
   744.5742,
   488.1311,
   321.6216,
   214.6282,
   145.6341,
   100.639,
   70.84377,
   50.7748,
   37.01846,
   20.62332,
   12.14304,
   2.199217,
   0.6133427,
   0.2223733,
   0.09598214,
   0.04688729,
   0.02511773,
   0.01445048,
   0.008799079,
   0.005611409,
   0.003718549,
   0.002545241,
   0.001790992,
   0.001290737,
   0.0009498223,
   0.0007119077,
   0.0005423525,
   0.0004192375,
   0.0003283356,
   0.0002601995,
   0.0002084266,
   0.0001685961,
   0.0001376041,
   0.0001376041};
   TGraph *graph = new TGraph(128,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",128,4126,6214);
   Graph_curvetot1->SetMinimum(2.377504e-14);
   Graph_curvetot1->SetMaximum(3467.921);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t sigL_fx2[128] = {
   4300,
   4317.4,
   4334.8,
   4352.2,
   4369.6,
   4387,
   4404.4,
   4421.8,
   4439.2,
   4456.6,
   4474,
   4491.4,
   4508.8,
   4526.2,
   4543.6,
   4561,
   4578.4,
   4595.8,
   4613.2,
   4630.6,
   4648,
   4665.4,
   4682.8,
   4700.2,
   4717.6,
   4735,
   4752.4,
   4769.8,
   4787.2,
   4804.6,
   4822,
   4839.4,
   4856.8,
   4874.2,
   4891.6,
   4909,
   4926.4,
   4943.8,
   4961.2,
   4978.6,
   4996,
   5013.4,
   5030.8,
   5048.2,
   5065.6,
   5083,
   5100.4,
   5117.8,
   5135.2,
   5152.6,
   5170,
   5187.4,
   5204.8,
   5222.2,
   5239.6,
   5257,
   5274.4,
   5291.8,
   5309.2,
   5326.6,
   5344,
   5361.4,
   5378.8,
   5396.2,
   5413.6,
   5431,
   5448.4,
   5465.8,
   5483.2,
   5500.6,
   5518,
   5535.4,
   5552.8,
   5570.2,
   5578.9,
   5587.6,
   5591.95,
   5594.125,
   5596.3,
   5598.475,
   5600.65,
   5602.825,
   5605,
   5607.175,
   5609.35,
   5611.525,
   5613.7,
   5615.875,
   5618.05,
   5620.225,
   5622.4,
   5624.575,
   5626.75,
   5628.925,
   5631.1,
   5633.275,
   5635.45,
   5637.625,
   5639.8,
   5641.975,
   5644.15,
   5646.325,
   5648.5,
   5652.85,
   5657.2,
   5674.6,
   5692,
   5709.4,
   5726.8,
   5744.2,
   5761.6,
   5779,
   5796.4,
   5813.8,
   5831.2,
   5848.6,
   5866,
   5883.4,
   5900.8,
   5918.2,
   5935.6,
   5953,
   5970.4,
   5987.8,
   6005.2,
   6022.6,
   6040,
   6040};
   Double_t sigL_fy2[128] = {
   2.641671e-14,
   3.083583e-14,
   3.606647e-14,
   4.22713e-14,
   4.964839e-14,
   5.843959e-14,
   6.894096e-14,
   8.151596e-14,
   9.661198e-14,
   1.147814e-13,
   1.367083e-13,
   1.632422e-13,
   1.954419e-13,
   2.34631e-13,
   2.824697e-13,
   3.410475e-13,
   4.130042e-13,
   5.016864e-13,
   6.113531e-13,
   7.474463e-13,
   9.169469e-13,
   1.128848e-12,
   1.394785e-12,
   1.72988e-12,
   2.153878e-12,
   2.692683e-12,
   3.380449e-12,
   4.262445e-12,
   5.398991e-12,
   6.870912e-12,
   8.787139e-12,
   1.129537e-11,
   1.459713e-11,
   1.896921e-11,
   2.479432e-11,
   3.260552e-11,
   4.315072e-11,
   5.748756e-11,
   7.712394e-11,
   1.042282e-10,
   1.419463e-10,
   1.948863e-10,
   2.698652e-10,
   3.770732e-10,
   5.319131e-10,
   7.57939e-10,
   1.091619e-09,
   1.590156e-09,
   2.34454e-09,
   3.501654e-09,
   5.30238e-09,
   8.14847e-09,
   1.272218e-08,
   2.020476e-08,
   3.268456e-08,
   5.393757e-08,
   9.095971e-08,
   1.570604e-07,
   2.783015e-07,
   5.073559e-07,
   9.544428e-07,
   1.85923e-06,
   3.765582e-06,
   7.96795e-06,
   1.771712e-05,
   4.168914e-05,
   0.0001047096,
   0.000283768,
   0.0008411969,
   0.002776511,
   0.0104477,
   0.04629297,
   0.252919,
   1.825081,
   5.617464,
   19.40548,
   37.96221,
   53.87247,
   77.25328,
   112.0161,
   164.3475,
   244.1745,
   367.6418,
   559.4869,
   852.6256,
   1280.633,
   1850.024,
   2487.092,
   2999.567,
   3152.655,
   2862.992,
   2283.252,
   1652.74,
   1126.108,
   744.5742,
   488.1311,
   321.6216,
   214.6282,
   145.6341,
   100.639,
   70.84377,
   50.7748,
   37.01846,
   20.62332,
   12.14304,
   2.199217,
   0.6133427,
   0.2223733,
   0.09598214,
   0.04688729,
   0.02511773,
   0.01445048,
   0.008799079,
   0.005611409,
   0.003718549,
   0.002545241,
   0.001790992,
   0.001290737,
   0.0009498223,
   0.0007119077,
   0.0005423525,
   0.0004192375,
   0.0003283356,
   0.0002601995,
   0.0002084266,
   0.0001685961,
   0.0001376041,
   0.0001376041};
   graph = new TGraph(128,sigL_fx2,sigL_fy2);
   graph->SetName("sigL");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_sigL2 = new TH1F("Graph_sigL2","Projection of totalPdf",128,4126,6214);
   Graph_sigL2->SetMinimum(2.377504e-14);
   Graph_sigL2->SetMaximum(3467.921);
   Graph_sigL2->SetDirectory(0);
   Graph_sigL2->SetStats(0);
   Graph_sigL2->SetLineWidth(2);
   Graph_sigL2->SetMarkerStyle(20);
   Graph_sigL2->GetXaxis()->SetNdivisions(505);
   Graph_sigL2->GetXaxis()->SetLabelFont(132);
   Graph_sigL2->GetXaxis()->SetLabelOffset(0.01);
   Graph_sigL2->GetXaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetXaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetXaxis()->SetTitleOffset(0.95);
   Graph_sigL2->GetXaxis()->SetTitleFont(132);
   Graph_sigL2->GetYaxis()->SetLabelFont(132);
   Graph_sigL2->GetYaxis()->SetLabelOffset(0.01);
   Graph_sigL2->GetYaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetYaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetYaxis()->SetTitleOffset(0.95);
   Graph_sigL2->GetYaxis()->SetTitleFont(132);
   Graph_sigL2->GetZaxis()->SetLabelFont(132);
   Graph_sigL2->GetZaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetZaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetZaxis()->SetTitleOffset(1.2);
   Graph_sigL2->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_sigL2);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.2,0.02,0.4,0.42,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("sigL","#Lambda signal (hypatia)","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_4645af0__4 = new TH1D("frame_4645af0__4","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_4645af0__4->SetBinContent(1,3310.288);
   frame_4645af0__4->SetMinimum(0);
   frame_4645af0__4->SetMaximum(7500);
   frame_4645af0__4->SetEntries(2);
   frame_4645af0__4->SetDirectory(0);
   frame_4645af0__4->SetStats(0);
   frame_4645af0__4->SetLineWidth(2);
   frame_4645af0__4->SetMarkerStyle(20);
   frame_4645af0__4->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_4645af0__4->GetXaxis()->SetNdivisions(505);
   frame_4645af0__4->GetXaxis()->SetLabelFont(132);
   frame_4645af0__4->GetXaxis()->SetLabelOffset(0.01);
   frame_4645af0__4->GetXaxis()->SetLabelSize(0.06);
   frame_4645af0__4->GetXaxis()->SetTitleSize(0.072);
   frame_4645af0__4->GetXaxis()->SetTitleOffset(0.95);
   frame_4645af0__4->GetXaxis()->SetTitleFont(132);
   frame_4645af0__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4645af0__4->GetYaxis()->SetLabelFont(132);
   frame_4645af0__4->GetYaxis()->SetLabelOffset(0.01);
   frame_4645af0__4->GetYaxis()->SetLabelSize(0.06);
   frame_4645af0__4->GetYaxis()->SetTitleSize(0.072);
   frame_4645af0__4->GetYaxis()->SetTitleOffset(0.95);
   frame_4645af0__4->GetYaxis()->SetTitleFont(132);
   frame_4645af0__4->GetZaxis()->SetLabelFont(132);
   frame_4645af0__4->GetZaxis()->SetLabelSize(0.06);
   frame_4645af0__4->GetZaxis()->SetTitleSize(0.072);
   frame_4645af0__4->GetZaxis()->SetTitleOffset(1.2);
   frame_4645af0__4->GetZaxis()->SetTitleFont(132);
   frame_4645af0__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Ejemplo n.º 21
0
int main (int argc, char* argv[] )
{
	cout << endl << "Really, REALLY stupid plotter for producing comparative plots between Edinburgh fit outputs." << endl;
	cout << endl << "USAGE: merge_plot Output_1.root Output_2.root \"Title 1\" \"Title 2\" " << endl;
	gStyle->SetCanvasColor(0);
	gStyle->SetFillColor(0);
	gROOT->SetStyle("Plain");
	if( argc != 5) exit(-1);
	TCanvas* c3 = new TCanvas("throw2","throw");
	TFile* input_1 = new TFile( argv[1], "READ" );
	gDirectory->ls();
	TH2D* hist_1 = (TH2D*)gDirectory->Get("pllhist");//"Graph2D");//pllhist");//Graph2D_from_nllhist");
	TGraph2D* graph_1 = (TGraph2D*)gDirectory->Get("pllhist");//"Graph2D");//pllhist");//Graph2D_from_nllhist");
	graph_1->Draw();
	c3->Update();
	TFile* input_2 = new TFile( argv[2], "READ" );
	gDirectory->ls();
	TH2D* hist_2 = (TH2D*)gDirectory->Get("pllhist");//"fcnew");//pllhist");//lr_data");
	TGraph2D* graph_2 = (TGraph2D*)gDirectory->Get("pllhist");//"fcnew");//pllhist");//lr_data");
	graph_2->Draw();
	hist_2->Draw();
	c3->Update();

	TString Plot_Title_1( argv[3] );
	TString Plot_Title_2( argv[4] );

	TCanvas* c1 = new TCanvas("Output_Plot","Output_Plot",1680,1050);
	double pllconts[3] = {1.15,2.305,3.0};//,4.61};
	//double pll2[3] = {2.3,4.61,6};//,9.62};
	//double pll2[3] = {0.68,0.9,0.95};
	double confs[3] = {68.0,90.0,95.0};//,99.0};
	TList* contLevel = NULL;
	TGraph* curv     = NULL;
	TGraph* gc    = NULL;
	//gStyle->SetCanvasColor(0);
	//gStyle->SetPalette(1);
	//gROOT->SetStyle("Plain");
	//gROOT->ForceStyle();
//	gStyle->SetFrameBorderMode(0);
//	gStyle->SetCanvasBorderMode(0);
//	gStyle->SetPadBorderMode(0);
//	gStyle->SetPadColor(0);
//	gStyle->SetCanvasColor(0);
//	gStyle->SetStatColor(0);
//	gStyle->SetTitleFillColor(0);
//	gStyle->SetFillColor(0);
//	gStyle->SetFrameFillColor(0);
	//gStyle->SetFillStyle(0);
	//gROOT->ForceStyle();

	hist_1->SetContour(3,pllconts);
	hist_1->SetLineWidth(1);
	c1->cd();
	hist_1->Draw("cont2");
//	hist_1->GetXaxis()->SetRangeUser(-3.1,2);
	hist_1->SetContour(3,pllconts);
//	c1->cd();
	hist_1->Draw("cont2");
	//	StyleTH2D(hist_2);
//	c3->cd();
	hist_2->Draw();
//	hist_2->GetXaxis()->SetRangeUser(-3.1,2);
//	hist_2->Draw();
	hist_1->Draw("cont2");
//	hist_2->Draw("SAME");//cont2");
	hist_2->SetContour(3,pllconts);//pll2);//pllconts);//pll2);
	hist_2->SetLineColor(2);
	hist_2->SetLineWidth(1);
//	c3->cd();
	c1->Update();
//	hist_2->Draw("SAMEcont2");
//	hist_2->GetXaxis()->SetRangeUser(-3.1,1);
//	hist_2->SetContour(3,pll2);//pllconts);//pll2);
//	c1->cd();
//	hist_2->Draw("SAMEcont2");
//	c1->Update();

	TCanvas* c2 = new TCanvas( "Throw","Throw" );
	hist_1->Draw("CONT LIST");
	c2->Update();

	//addLHCbLabel("NLL Scan")->Draw();
	TObjArray *contObjArr = (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours");
	int TotalConts = contObjArr->GetSize();
	c1->cd();
	TLegend *leg = new TLegend(0.65,0.7,1.1,0.9);
	leg->SetHeader( Plot_Title_1 );
	leg->SetBorderSize(0);
	leg->SetFillStyle(0);
	for(int i = 0; i < TotalConts; i++){
		TString confname = "";
		double cl = confs[i];
		confname +=cl;
		confname += "% C.L.";
		contLevel = (TList*)contObjArr->At(i);
		for(int j =0; j<contLevel->GetSize(); j++){
			curv = (TGraph*)contLevel->At(j);
			gc = (TGraph*)curv->Clone();
			if( i!=3 ) gc->SetLineColor(Color_t(i+2));
			else gc->SetLineColor(Color_t(i+3));
			gc->Draw("L");
		}
		leg->AddEntry(gc,confname, "L");
	}
	c1->cd();
	TLegend *leg2 = new TLegend(0.13,0.7,0.5,0.9);
	leg2->SetHeader( Plot_Title_2 );
	leg2->SetBorderSize(0);
	leg2->SetFillStyle(0);

	c2->cd();
	hist_2->Draw("CONT LIST");
	c2->Update();
	contObjArr = (TObjArray*)gROOT->GetListOfSpecials()->FindObject("contours");
	TotalConts = contObjArr->GetSize();
	for(int i = 0; i < TotalConts; i++){
		TString confname = "";
		double cl = confs[i];
		confname +=cl;
		confname += "% C.L.";
		contLevel = (TList*)contObjArr->At(i);
		for(int j =0; j<contLevel->GetSize(); j++){
			curv = (TGraph*)contLevel->At(j);
			gc = (TGraph*)curv->Clone();
			if( i!=3 ) gc->SetLineColor(Color_t(i+2));
			else gc->SetLineColor(Color_t(i+3));
			gc->SetLineStyle(Style_t(i+2));
			c1->cd();
			gc->Draw("L");
			c2->cd();
		}
		leg2->AddEntry(gc,confname, "L");

	}
//	c1->cd();

//	Double_t X_min_1 = strtod( argv[3], NULL );
//	Double_t Y_min_1 = strtod( argv[4], NULL );
//	Double_t X_min_2 = strtod( argv[5], NULL );
//	Double_t Y_min_2 = strtod( argv[6], NULL );

//	c1->cd();
//	TMarker* new_mark = new TMarker( X_min_1, Y_min_1, 20 );
//	new_mark->SetMarkerSize(1);
//	new_mark->SetMarkerColor(8);
	//new_mark->Draw("SAME");
//	TMarker* new_mark2 = new TMarker( X_min_2, Y_min_2, 20 );
//	new_mark2->SetMarkerSize(1);
//	new_mark2->SetMarkerColor(9);
	//new_mark2->Draw("SAME");
//	c1->Update();

	c1->cd();
	leg->Draw();
	leg2->Draw();
	addLHCbLabel("NLL Contours")->Draw();
	c1->Update();
	c1->Print("Output.png");
	c1->Print("Output.pdf");

	input_1->Close();
	input_2->Close();
	return 0;
}
void fitLMC_c070116_LL1_floathypparamsfixmusigma_nobkg()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Wed Jul  6 21:29:11 2016) by ROOT version6.06/02
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(3754.321,-26.4,6223.457,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_3705430__1 = new TH1D("frame_3705430__1","",100,4100,6100);
   frame_3705430__1->SetBinContent(1,11.2676);
   frame_3705430__1->SetMinimum(-8.8);
   frame_3705430__1->SetMaximum(8.8);
   frame_3705430__1->SetEntries(1);
   frame_3705430__1->SetDirectory(0);
   frame_3705430__1->SetStats(0);
   frame_3705430__1->SetLineWidth(2);
   frame_3705430__1->SetMarkerStyle(20);
   frame_3705430__1->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_3705430__1->GetXaxis()->SetNdivisions(505);
   frame_3705430__1->GetXaxis()->SetLabelFont(132);
   frame_3705430__1->GetXaxis()->SetLabelOffset(0.01);
   frame_3705430__1->GetXaxis()->SetLabelSize(0.15);
   frame_3705430__1->GetXaxis()->SetTitleSize(0.2);
   frame_3705430__1->GetXaxis()->SetTitleOffset(1.1);
   frame_3705430__1->GetXaxis()->SetTitleFont(132);
   frame_3705430__1->GetYaxis()->SetTitle("Pull");
   frame_3705430__1->GetYaxis()->CenterTitle(true);
   frame_3705430__1->GetYaxis()->SetNdivisions(505);
   frame_3705430__1->GetYaxis()->SetLabelFont(132);
   frame_3705430__1->GetYaxis()->SetLabelOffset(0.01);
   frame_3705430__1->GetYaxis()->SetLabelSize(0.15);
   frame_3705430__1->GetYaxis()->SetTitleSize(0.15);
   frame_3705430__1->GetYaxis()->SetTitleOffset(0.45);
   frame_3705430__1->GetYaxis()->SetTitleFont(132);
   frame_3705430__1->GetZaxis()->SetLabelFont(132);
   frame_3705430__1->GetZaxis()->SetLabelSize(0.06);
   frame_3705430__1->GetZaxis()->SetTitleSize(0.072);
   frame_3705430__1->GetZaxis()->SetTitleOffset(1.2);
   frame_3705430__1->GetZaxis()->SetTitleFont(132);
   frame_3705430__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[87] = {
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950,
   5970,
   5990,
   6010,
   6030};
   Double_t pull_Hist_curvetot_fy3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0.6090808,
   1.134866,
   -0.2785807,
   9.080708,
   9.670166,
   0.777574,
   0.8226909,
   0.8521652,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_felx3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehx3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[87] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(87,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr and Projection of totalPdf",100,4138,6202);
   Graph_pull_Hist_curvetot3001->SetMinimum(-2.473455);
   Graph_pull_Hist_curvetot3001->SetMaximum(11.86504);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_3705430__2 = new TH1D("frame_3705430__2","",100,4100,6100);
   frame_3705430__2->SetBinContent(1,11.2676);
   frame_3705430__2->SetMinimum(-8.8);
   frame_3705430__2->SetMaximum(8.8);
   frame_3705430__2->SetEntries(1);
   frame_3705430__2->SetDirectory(0);
   frame_3705430__2->SetStats(0);
   frame_3705430__2->SetLineWidth(2);
   frame_3705430__2->SetMarkerStyle(20);
   frame_3705430__2->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_3705430__2->GetXaxis()->SetNdivisions(505);
   frame_3705430__2->GetXaxis()->SetLabelFont(132);
   frame_3705430__2->GetXaxis()->SetLabelOffset(0.01);
   frame_3705430__2->GetXaxis()->SetLabelSize(0.15);
   frame_3705430__2->GetXaxis()->SetTitleSize(0.2);
   frame_3705430__2->GetXaxis()->SetTitleOffset(1.1);
   frame_3705430__2->GetXaxis()->SetTitleFont(132);
   frame_3705430__2->GetYaxis()->SetTitle("Pull");
   frame_3705430__2->GetYaxis()->CenterTitle(true);
   frame_3705430__2->GetYaxis()->SetNdivisions(505);
   frame_3705430__2->GetYaxis()->SetLabelFont(132);
   frame_3705430__2->GetYaxis()->SetLabelOffset(0.01);
   frame_3705430__2->GetYaxis()->SetLabelSize(0.15);
   frame_3705430__2->GetYaxis()->SetTitleSize(0.15);
   frame_3705430__2->GetYaxis()->SetTitleOffset(0.45);
   frame_3705430__2->GetYaxis()->SetTitleFont(132);
   frame_3705430__2->GetZaxis()->SetLabelFont(132);
   frame_3705430__2->GetZaxis()->SetLabelSize(0.06);
   frame_3705430__2->GetZaxis()->SetTitleSize(0.072);
   frame_3705430__2->GetZaxis()->SetTitleOffset(1.2);
   frame_3705430__2->GetZaxis()->SetTitleFont(132);
   frame_3705430__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(0,0,1,1);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetLogy();
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_359de30__3 = new TH1D("frame_359de30__3","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_359de30__3->SetBinContent(1,3307.075);
   frame_359de30__3->SetMinimum(0);
   frame_359de30__3->SetMaximum(7500);
   frame_359de30__3->SetEntries(2);
   frame_359de30__3->SetDirectory(0);
   frame_359de30__3->SetStats(0);
   frame_359de30__3->SetLineWidth(2);
   frame_359de30__3->SetMarkerStyle(20);
   frame_359de30__3->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_359de30__3->GetXaxis()->SetNdivisions(505);
   frame_359de30__3->GetXaxis()->SetLabelFont(132);
   frame_359de30__3->GetXaxis()->SetLabelOffset(0.01);
   frame_359de30__3->GetXaxis()->SetLabelSize(0.06);
   frame_359de30__3->GetXaxis()->SetTitleSize(0.072);
   frame_359de30__3->GetXaxis()->SetTitleOffset(0.95);
   frame_359de30__3->GetXaxis()->SetTitleFont(132);
   frame_359de30__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_359de30__3->GetYaxis()->SetLabelFont(132);
   frame_359de30__3->GetYaxis()->SetLabelOffset(0.01);
   frame_359de30__3->GetYaxis()->SetLabelSize(0.06);
   frame_359de30__3->GetYaxis()->SetTitleSize(0.072);
   frame_359de30__3->GetYaxis()->SetTitleOffset(0.95);
   frame_359de30__3->GetYaxis()->SetTitleFont(132);
   frame_359de30__3->GetZaxis()->SetLabelFont(132);
   frame_359de30__3->GetZaxis()->SetLabelSize(0.06);
   frame_359de30__3->GetZaxis()->SetTitleSize(0.072);
   frame_359de30__3->GetZaxis()->SetTitleOffset(1.2);
   frame_359de30__3->GetZaxis()->SetTitleFont(132);
   frame_359de30__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   4110,
   4130,
   4150,
   4170,
   4190,
   4210,
   4230,
   4250,
   4270,
   4290,
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950,
   5970,
   5990,
   6010,
   6030,
   6050,
   6070,
   6090};
   Double_t Hist_fy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   5,
   30,
   1308,
   1283,
   36,
   7,
   2,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_felx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fely3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   2.236068,
   5.477226,
   36.16628,
   35.81899,
   6,
   2.645751,
   1.414214,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_fehx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fehy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   2.236068,
   5.477226,
   36.16628,
   35.81899,
   6,
   2.645751,
   1.414214,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of LMC_plot__Bs_LOKI_MASS_JpsiConstr",100,3900,6300);
   Graph_Hist3002->SetMinimum(1.478583);
   Graph_Hist3002->SetMaximum(1478.583);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[128] = {
   4300,
   4317.4,
   4334.8,
   4352.2,
   4369.6,
   4387,
   4404.4,
   4421.8,
   4439.2,
   4456.6,
   4474,
   4491.4,
   4508.8,
   4526.2,
   4543.6,
   4561,
   4578.4,
   4595.8,
   4613.2,
   4630.6,
   4648,
   4665.4,
   4682.8,
   4700.2,
   4717.6,
   4735,
   4752.4,
   4769.8,
   4787.2,
   4804.6,
   4822,
   4839.4,
   4856.8,
   4874.2,
   4891.6,
   4909,
   4926.4,
   4943.8,
   4961.2,
   4978.6,
   4996,
   5013.4,
   5030.8,
   5048.2,
   5065.6,
   5083,
   5100.4,
   5117.8,
   5135.2,
   5152.6,
   5170,
   5187.4,
   5204.8,
   5222.2,
   5239.6,
   5257,
   5274.4,
   5291.8,
   5309.2,
   5326.6,
   5344,
   5361.4,
   5378.8,
   5396.2,
   5413.6,
   5431,
   5448.4,
   5465.8,
   5483.2,
   5500.6,
   5518,
   5535.4,
   5552.8,
   5570.2,
   5578.9,
   5587.6,
   5591.95,
   5594.125,
   5596.3,
   5598.475,
   5600.65,
   5602.825,
   5605,
   5607.175,
   5609.35,
   5611.525,
   5613.7,
   5615.875,
   5618.05,
   5620.225,
   5622.4,
   5624.575,
   5626.75,
   5628.925,
   5631.1,
   5633.275,
   5635.45,
   5637.625,
   5639.8,
   5641.975,
   5644.15,
   5646.325,
   5648.5,
   5652.85,
   5657.2,
   5674.6,
   5692,
   5709.4,
   5726.8,
   5744.2,
   5761.6,
   5779,
   5796.4,
   5813.8,
   5831.2,
   5848.6,
   5866,
   5883.4,
   5900.8,
   5918.2,
   5935.6,
   5953,
   5970.4,
   5987.8,
   6005.2,
   6022.6,
   6040,
   6040};
   Double_t curvetot_fy1[128] = {
   5.097734e-11,
   5.706404e-11,
   6.397227e-11,
   7.182607e-11,
   8.077026e-11,
   9.097421e-11,
   1.026365e-10,
   1.159906e-10,
   1.313112e-10,
   1.489226e-10,
   1.692087e-10,
   1.926245e-10,
   2.197112e-10,
   2.511141e-10,
   2.876045e-10,
   3.301067e-10,
   3.797322e-10,
   4.378209e-10,
   5.059931e-10,
   5.862146e-10,
   6.808781e-10,
   7.92905e-10,
   9.25876e-10,
   1.084194e-09,
   1.273296e-09,
   1.499917e-09,
   1.772438e-09,
   2.101333e-09,
   2.49974e-09,
   2.984225e-09,
   3.575764e-09,
   4.30105e-09,
   5.194231e-09,
   6.299211e-09,
   7.672763e-09,
   9.388721e-09,
   1.154369e-08,
   1.426487e-08,
   1.772088e-08,
   2.213677e-08,
   2.781515e-08,
   3.516607e-08,
   4.474967e-08,
   5.733771e-08,
   7.400324e-08,
   9.625251e-08,
   1.262215e-07,
   1.66972e-07,
   2.229438e-07,
   3.006535e-07,
   4.097927e-07,
   5.649775e-07,
   7.885849e-07,
   1.115432e-06,
   1.600645e-06,
   2.333173e-06,
   3.459516e-06,
   5.226424e-06,
   8.059798e-06,
   1.271484e-05,
   2.057112e-05,
   3.423339e-05,
   5.880467e-05,
   0.0001047063,
   0.000194246,
   0.0003778152,
   0.0007765404,
   0.001703496,
   0.004040552,
   0.01054291,
   0.03098829,
   0.1061303,
   0.4455362,
   2.485815,
   6.801185,
   21.23333,
   39.88852,
   55.66596,
   78.72316,
   112.9447,
   164.5968,
   243.9531,
   367.2852,
   558.9441,
   851.7984,
   1279.391,
   1848.229,
   2484.678,
   2996.656,
   3149.596,
   2860.214,
   2281.036,
   1651.136,
   1125.016,
   743.8519,
   487.6576,
   321.3096,
   214.42,
   145.4929,
   100.5415,
   70.77508,
   50.72557,
   36.98257,
   20.60332,
   12.13127,
   2.197087,
   0.6127486,
   0.2221579,
   0.0958892,
   0.0468419,
   0.02509342,
   0.01443649,
   0.008790563,
   0.005605979,
   0.003714951,
   0.002542779,
   0.001789259,
   0.001289489,
   0.0009489036,
   0.0007112191,
   0.000541828,
   0.0004188321,
   0.000328018,
   0.0002599479,
   0.0002082251,
   0.0001684331,
   0.000137471,
   0.000137471};
   TGraph *graph = new TGraph(128,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",128,4126,6214);
   Graph_curvetot1->SetMinimum(4.58796e-11);
   Graph_curvetot1->SetMaximum(3464.555);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t sigL_fx2[128] = {
   4300,
   4317.4,
   4334.8,
   4352.2,
   4369.6,
   4387,
   4404.4,
   4421.8,
   4439.2,
   4456.6,
   4474,
   4491.4,
   4508.8,
   4526.2,
   4543.6,
   4561,
   4578.4,
   4595.8,
   4613.2,
   4630.6,
   4648,
   4665.4,
   4682.8,
   4700.2,
   4717.6,
   4735,
   4752.4,
   4769.8,
   4787.2,
   4804.6,
   4822,
   4839.4,
   4856.8,
   4874.2,
   4891.6,
   4909,
   4926.4,
   4943.8,
   4961.2,
   4978.6,
   4996,
   5013.4,
   5030.8,
   5048.2,
   5065.6,
   5083,
   5100.4,
   5117.8,
   5135.2,
   5152.6,
   5170,
   5187.4,
   5204.8,
   5222.2,
   5239.6,
   5257,
   5274.4,
   5291.8,
   5309.2,
   5326.6,
   5344,
   5361.4,
   5378.8,
   5396.2,
   5413.6,
   5431,
   5448.4,
   5465.8,
   5483.2,
   5500.6,
   5518,
   5535.4,
   5552.8,
   5570.2,
   5578.9,
   5587.6,
   5591.95,
   5594.125,
   5596.3,
   5598.475,
   5600.65,
   5602.825,
   5605,
   5607.175,
   5609.35,
   5611.525,
   5613.7,
   5615.875,
   5618.05,
   5620.225,
   5622.4,
   5624.575,
   5626.75,
   5628.925,
   5631.1,
   5633.275,
   5635.45,
   5637.625,
   5639.8,
   5641.975,
   5644.15,
   5646.325,
   5648.5,
   5652.85,
   5657.2,
   5674.6,
   5692,
   5709.4,
   5726.8,
   5744.2,
   5761.6,
   5779,
   5796.4,
   5813.8,
   5831.2,
   5848.6,
   5866,
   5883.4,
   5900.8,
   5918.2,
   5935.6,
   5953,
   5970.4,
   5987.8,
   6005.2,
   6022.6,
   6040,
   6040};
   Double_t sigL_fy2[128] = {
   5.097734e-11,
   5.706404e-11,
   6.397227e-11,
   7.182607e-11,
   8.077026e-11,
   9.097421e-11,
   1.026365e-10,
   1.159906e-10,
   1.313112e-10,
   1.489226e-10,
   1.692087e-10,
   1.926245e-10,
   2.197112e-10,
   2.511141e-10,
   2.876045e-10,
   3.301067e-10,
   3.797322e-10,
   4.378209e-10,
   5.059931e-10,
   5.862146e-10,
   6.808781e-10,
   7.92905e-10,
   9.25876e-10,
   1.084194e-09,
   1.273296e-09,
   1.499917e-09,
   1.772438e-09,
   2.101333e-09,
   2.49974e-09,
   2.984225e-09,
   3.575764e-09,
   4.30105e-09,
   5.194231e-09,
   6.299211e-09,
   7.672763e-09,
   9.388721e-09,
   1.154369e-08,
   1.426487e-08,
   1.772088e-08,
   2.213677e-08,
   2.781515e-08,
   3.516607e-08,
   4.474967e-08,
   5.733771e-08,
   7.400324e-08,
   9.625251e-08,
   1.262215e-07,
   1.66972e-07,
   2.229438e-07,
   3.006535e-07,
   4.097927e-07,
   5.649775e-07,
   7.885849e-07,
   1.115432e-06,
   1.600645e-06,
   2.333173e-06,
   3.459516e-06,
   5.226424e-06,
   8.059798e-06,
   1.271484e-05,
   2.057112e-05,
   3.423339e-05,
   5.880467e-05,
   0.0001047063,
   0.000194246,
   0.0003778152,
   0.0007765404,
   0.001703496,
   0.004040552,
   0.01054291,
   0.03098829,
   0.1061303,
   0.4455362,
   2.485815,
   6.801185,
   21.23333,
   39.88852,
   55.66596,
   78.72316,
   112.9447,
   164.5968,
   243.9531,
   367.2852,
   558.9441,
   851.7984,
   1279.391,
   1848.229,
   2484.678,
   2996.656,
   3149.596,
   2860.214,
   2281.036,
   1651.136,
   1125.016,
   743.8519,
   487.6576,
   321.3096,
   214.42,
   145.4929,
   100.5415,
   70.77508,
   50.72557,
   36.98257,
   20.60332,
   12.13127,
   2.197087,
   0.6127486,
   0.2221579,
   0.0958892,
   0.0468419,
   0.02509342,
   0.01443649,
   0.008790563,
   0.005605979,
   0.003714951,
   0.002542779,
   0.001789259,
   0.001289489,
   0.0009489036,
   0.0007112191,
   0.000541828,
   0.0004188321,
   0.000328018,
   0.0002599479,
   0.0002082251,
   0.0001684331,
   0.000137471,
   0.000137471};
   graph = new TGraph(128,sigL_fx2,sigL_fy2);
   graph->SetName("sigL");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_sigL2 = new TH1F("Graph_sigL2","Projection of totalPdf",128,4126,6214);
   Graph_sigL2->SetMinimum(4.58796e-11);
   Graph_sigL2->SetMaximum(3464.555);
   Graph_sigL2->SetDirectory(0);
   Graph_sigL2->SetStats(0);
   Graph_sigL2->SetLineWidth(2);
   Graph_sigL2->SetMarkerStyle(20);
   Graph_sigL2->GetXaxis()->SetNdivisions(505);
   Graph_sigL2->GetXaxis()->SetLabelFont(132);
   Graph_sigL2->GetXaxis()->SetLabelOffset(0.01);
   Graph_sigL2->GetXaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetXaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetXaxis()->SetTitleOffset(0.95);
   Graph_sigL2->GetXaxis()->SetTitleFont(132);
   Graph_sigL2->GetYaxis()->SetLabelFont(132);
   Graph_sigL2->GetYaxis()->SetLabelOffset(0.01);
   Graph_sigL2->GetYaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetYaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetYaxis()->SetTitleOffset(0.95);
   Graph_sigL2->GetYaxis()->SetTitleFont(132);
   Graph_sigL2->GetZaxis()->SetLabelFont(132);
   Graph_sigL2->GetZaxis()->SetLabelSize(0.06);
   Graph_sigL2->GetZaxis()->SetTitleSize(0.072);
   Graph_sigL2->GetZaxis()->SetTitleOffset(1.2);
   Graph_sigL2->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_sigL2);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.2,0.02,0.4,0.42,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("sigL","#Lambda signal (hypatia)","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_359de30__4 = new TH1D("frame_359de30__4","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_359de30__4->SetBinContent(1,3307.075);
   frame_359de30__4->SetMinimum(0);
   frame_359de30__4->SetMaximum(7500);
   frame_359de30__4->SetEntries(2);
   frame_359de30__4->SetDirectory(0);
   frame_359de30__4->SetStats(0);
   frame_359de30__4->SetLineWidth(2);
   frame_359de30__4->SetMarkerStyle(20);
   frame_359de30__4->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_359de30__4->GetXaxis()->SetNdivisions(505);
   frame_359de30__4->GetXaxis()->SetLabelFont(132);
   frame_359de30__4->GetXaxis()->SetLabelOffset(0.01);
   frame_359de30__4->GetXaxis()->SetLabelSize(0.06);
   frame_359de30__4->GetXaxis()->SetTitleSize(0.072);
   frame_359de30__4->GetXaxis()->SetTitleOffset(0.95);
   frame_359de30__4->GetXaxis()->SetTitleFont(132);
   frame_359de30__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_359de30__4->GetYaxis()->SetLabelFont(132);
   frame_359de30__4->GetYaxis()->SetLabelOffset(0.01);
   frame_359de30__4->GetYaxis()->SetLabelSize(0.06);
   frame_359de30__4->GetYaxis()->SetTitleSize(0.072);
   frame_359de30__4->GetYaxis()->SetTitleOffset(0.95);
   frame_359de30__4->GetYaxis()->SetTitleFont(132);
   frame_359de30__4->GetZaxis()->SetLabelFont(132);
   frame_359de30__4->GetZaxis()->SetLabelSize(0.06);
   frame_359de30__4->GetZaxis()->SetTitleSize(0.072);
   frame_359de30__4->GetZaxis()->SetTitleOffset(1.2);
   frame_359de30__4->GetZaxis()->SetTitleFont(132);
   frame_359de30__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Ejemplo n.º 23
0
TGraph* cdftanb5(){

  Float_t x[20];
  Float_t y[20];
  x[0]=1850;
  x[1]=1815;
  x[2]=x[1]-222;
  x[3]=x[2]-273;
  x[4]=x[3]-6; 
  x[5]=x[4]-116;
  x[6]=x[5]-104;
  x[7]=x[6]-12;
  x[8]=x[7]-140;
  x[9]=x[8]-25;
  x[10]=x[9]-155;
  x[11]=x[10]-67 ;
  x[12]=x[11]-44 ;
  x[13]=x[12]-20 ;
  x[14]=x[13]-60 ;
  x[15]=x[14]-79 ;
  x[16]=x[15]-265;
  x[17]=x[16]-151;
  x[18]=x[17]-76 ;
  x[19]=-30 ;

  y[0]=-40;
  y[1]=443;
  y[2]=y[1]-0;
  y[3]=y[2]+23;
  y[4]=y[3]+2;
  y[5]=y[4]+33;
  y[6]=y[5]+10; 
  y[7]=y[6]+4 ;
  y[8]=y[7]+47;
  y[9]=y[8]+6 ;
  y[10]=y[9]+25;
  y[11]=y[10]+15;
  y[12]=y[11]+35;
  y[13]=y[12]+12;
  y[14]=y[13]+47;
  y[15]=y[14]+32;
  y[16]=y[15]+60;
  y[17]=y[16]-12;
  y[18]=y[17]-24;
  y[19]=-40;
  Float_t scaleX = 600./1815;
  Float_t scaleY = 300./1404;

  for (int i=0;i<20;i++) x[i]=x[i]*scaleX;
  for (int i=0;i<20;i++) y[i]=y[i]*scaleY;
  TGraph* graph = new TGraph(20,x,y);
   // gr->Draw("a*");

  graph->SetLineColor(CombinationGlob::c_DarkGray);
  graph->SetLineWidth(1);

  graph->SetFillColor(CombinationGlob::c_DarkOrange);

/*
   TH1F *nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3 = new TH1F("nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3","Projection of nllWithCons",100,-10,610);
   nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3->SetMinimum(0);
   nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3->SetMaximum(250);
   nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3->SetDirectory(0);
   nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3->SetStats(0);
   graph->SetHistogram(nll_full_model_1m3j_data_set_1m3j_with_constr_Normmu1__3);
*/
   
//   graph->Draw("l");
  graph->Draw("FSAME");
  graph->Draw("LSAME");

  gPad->RedrawAxis();

  return graph;

}
Ejemplo n.º 24
0
void fitWMLL3testbkg()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Sat May  7 17:06:48 2016) by ROOT version6.06/02
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(230.8642,-26.4,724.6914,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_41aab90__1 = new TH1D("frame_41aab90__1","",100,300,700);
   frame_41aab90__1->SetBinContent(1,3.66042);
   frame_41aab90__1->SetMinimum(-8.8);
   frame_41aab90__1->SetMaximum(8.8);
   frame_41aab90__1->SetEntries(1);
   frame_41aab90__1->SetDirectory(0);
   frame_41aab90__1->SetStats(0);
   frame_41aab90__1->SetLineWidth(2);
   frame_41aab90__1->SetMarkerStyle(20);
   frame_41aab90__1->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_41aab90__1->GetXaxis()->SetNdivisions(505);
   frame_41aab90__1->GetXaxis()->SetLabelFont(132);
   frame_41aab90__1->GetXaxis()->SetLabelOffset(0.01);
   frame_41aab90__1->GetXaxis()->SetLabelSize(0.15);
   frame_41aab90__1->GetXaxis()->SetTitleSize(0.2);
   frame_41aab90__1->GetXaxis()->SetTitleOffset(1.1);
   frame_41aab90__1->GetXaxis()->SetTitleFont(132);
   frame_41aab90__1->GetYaxis()->SetTitle("Pull");
   frame_41aab90__1->GetYaxis()->CenterTitle(true);
   frame_41aab90__1->GetYaxis()->SetNdivisions(505);
   frame_41aab90__1->GetYaxis()->SetLabelFont(132);
   frame_41aab90__1->GetYaxis()->SetLabelOffset(0.01);
   frame_41aab90__1->GetYaxis()->SetLabelSize(0.15);
   frame_41aab90__1->GetYaxis()->SetTitleSize(0.15);
   frame_41aab90__1->GetYaxis()->SetTitleOffset(0.45);
   frame_41aab90__1->GetYaxis()->SetTitleFont(132);
   frame_41aab90__1->GetZaxis()->SetLabelFont(132);
   frame_41aab90__1->GetZaxis()->SetLabelSize(0.06);
   frame_41aab90__1->GetZaxis()->SetTitleSize(0.072);
   frame_41aab90__1->GetZaxis()->SetTitleOffset(1.2);
   frame_41aab90__1->GetZaxis()->SetTitleFont(132);
   frame_41aab90__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[35] = {
   322,
   326,
   330,
   334,
   338,
   342,
   346,
   350,
   354,
   358,
   362,
   366,
   370,
   374,
   378,
   382,
   386,
   390,
   394,
   398,
   402,
   406,
   410,
   414,
   418,
   422,
   426,
   430,
   434,
   438,
   442,
   446,
   450,
   454,
   458};
   Double_t pull_Hist_curvetot_fy3001[35] = {
   -4.216045,
   1.419055,
   1.630176,
   1.736171,
   1.401115,
   1.177832,
   0.6067655,
   0.3684632,
   -0.07689024,
   0.7649885,
   -0.8684489,
   -2.178691,
   -1.339307,
   -2.479915,
   -0.6142935,
   0.5270919,
   -0.1014516,
   -2.629158,
   0.2575233,
   -2.419091,
   0.2616838,
   1.094697,
   0.4024459,
   0.1552136,
   1.74456,
   0.3476207,
   -0.4683433,
   2.237731,
   0.864617,
   1.152684,
   -0.4685249,
   -1.907669,
   -2.145193,
   1.344497,
   -0.6773687};
   Double_t pull_Hist_curvetot_felx3001[35] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[35] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   Double_t pull_Hist_curvetot_fehx3001[35] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[35] = {
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(35,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of data_plot__R_WM and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of data_plot__R_WM and Projection of totalPdf",100,308.4,471.6);
   Graph_pull_Hist_curvetot3001->SetMinimum(-6.061422);
   Graph_pull_Hist_curvetot3001->SetMaximum(4.083108);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_41aab90__2 = new TH1D("frame_41aab90__2","",100,300,700);
   frame_41aab90__2->SetBinContent(1,3.66042);
   frame_41aab90__2->SetMinimum(-8.8);
   frame_41aab90__2->SetMaximum(8.8);
   frame_41aab90__2->SetEntries(1);
   frame_41aab90__2->SetDirectory(0);
   frame_41aab90__2->SetStats(0);
   frame_41aab90__2->SetLineWidth(2);
   frame_41aab90__2->SetMarkerStyle(20);
   frame_41aab90__2->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_41aab90__2->GetXaxis()->SetNdivisions(505);
   frame_41aab90__2->GetXaxis()->SetLabelFont(132);
   frame_41aab90__2->GetXaxis()->SetLabelOffset(0.01);
   frame_41aab90__2->GetXaxis()->SetLabelSize(0.15);
   frame_41aab90__2->GetXaxis()->SetTitleSize(0.2);
   frame_41aab90__2->GetXaxis()->SetTitleOffset(1.1);
   frame_41aab90__2->GetXaxis()->SetTitleFont(132);
   frame_41aab90__2->GetYaxis()->SetTitle("Pull");
   frame_41aab90__2->GetYaxis()->CenterTitle(true);
   frame_41aab90__2->GetYaxis()->SetNdivisions(505);
   frame_41aab90__2->GetYaxis()->SetLabelFont(132);
   frame_41aab90__2->GetYaxis()->SetLabelOffset(0.01);
   frame_41aab90__2->GetYaxis()->SetLabelSize(0.15);
   frame_41aab90__2->GetYaxis()->SetTitleSize(0.15);
   frame_41aab90__2->GetYaxis()->SetTitleOffset(0.45);
   frame_41aab90__2->GetYaxis()->SetTitleFont(132);
   frame_41aab90__2->GetZaxis()->SetLabelFont(132);
   frame_41aab90__2->GetZaxis()->SetLabelSize(0.06);
   frame_41aab90__2->GetZaxis()->SetTitleSize(0.072);
   frame_41aab90__2->GetZaxis()->SetTitleOffset(1.2);
   frame_41aab90__2->GetZaxis()->SetTitleFont(132);
   frame_41aab90__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(230.8642,0,724.6914,299.2215);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_4083450__3 = new TH1D("frame_4083450__3","A RooPlot of \"m(#pi p#rightarrow#pi)\"",100,300,700);
   frame_4083450__3->SetBinContent(1,281.2682);
   frame_4083450__3->SetMaximum(281.2682);
   frame_4083450__3->SetEntries(1);
   frame_4083450__3->SetDirectory(0);
   frame_4083450__3->SetStats(0);
   frame_4083450__3->SetLineWidth(2);
   frame_4083450__3->SetMarkerStyle(20);
   frame_4083450__3->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_4083450__3->GetXaxis()->SetNdivisions(505);
   frame_4083450__3->GetXaxis()->SetLabelFont(132);
   frame_4083450__3->GetXaxis()->SetLabelOffset(0.01);
   frame_4083450__3->GetXaxis()->SetLabelSize(0.06);
   frame_4083450__3->GetXaxis()->SetTitleSize(0.072);
   frame_4083450__3->GetXaxis()->SetTitleOffset(0.95);
   frame_4083450__3->GetXaxis()->SetTitleFont(132);
   frame_4083450__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4083450__3->GetYaxis()->SetLabelFont(132);
   frame_4083450__3->GetYaxis()->SetLabelOffset(0.01);
   frame_4083450__3->GetYaxis()->SetLabelSize(0.06);
   frame_4083450__3->GetYaxis()->SetTitleSize(0.072);
   frame_4083450__3->GetYaxis()->SetTitleOffset(0.95);
   frame_4083450__3->GetYaxis()->SetTitleFont(132);
   frame_4083450__3->GetZaxis()->SetLabelFont(132);
   frame_4083450__3->GetZaxis()->SetLabelSize(0.06);
   frame_4083450__3->GetZaxis()->SetTitleSize(0.072);
   frame_4083450__3->GetZaxis()->SetTitleOffset(1.2);
   frame_4083450__3->GetZaxis()->SetTitleFont(132);
   frame_4083450__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   302,
   306,
   310,
   314,
   318,
   322,
   326,
   330,
   334,
   338,
   342,
   346,
   350,
   354,
   358,
   362,
   366,
   370,
   374,
   378,
   382,
   386,
   390,
   394,
   398,
   402,
   406,
   410,
   414,
   418,
   422,
   426,
   430,
   434,
   438,
   442,
   446,
   450,
   454,
   458,
   462,
   466,
   470,
   474,
   478,
   482,
   486,
   490,
   494,
   498,
   502,
   506,
   510,
   514,
   518,
   522,
   526,
   530,
   534,
   538,
   542,
   546,
   550,
   554,
   558,
   562,
   566,
   570,
   574,
   578,
   582,
   586,
   590,
   594,
   598,
   602,
   606,
   610,
   614,
   618,
   622,
   626,
   630,
   634,
   638,
   642,
   646,
   650,
   654,
   658,
   662,
   666,
   670,
   674,
   678,
   682,
   686,
   690,
   694,
   698};
   Double_t Hist_fy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   10,
   54,
   76,
   95,
   107,
   118,
   123,
   130,
   133,
   150,
   136,
   126,
   138,
   128,
   150,
   165,
   157,
   128,
   160,
   128,
   157,
   166,
   155,
   150,
   169,
   149,
   138,
   172,
   153,
   157,
   138,
   124,
   124,
   169,
   148,
   137,
   138,
   130,
   129,
   126,
   141,
   150,
   153,
   164,
   252,
   181,
   107,
   119,
   108,
   95,
   83,
   80,
   76,
   74,
   44,
   66,
   39,
   31,
   24,
   20,
   13,
   11,
   5,
   4,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_felx3002[100] = {
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2};
   Double_t Hist_fely3002[100] = {
   0,
   0,
   0,
   0,
   0,
   3.162278,
   7.348469,
   8.717798,
   9.746794,
   10.34408,
   10.86278,
   11.09054,
   11.40175,
   11.53256,
   12.24745,
   11.6619,
   11.22497,
   11.74734,
   11.31371,
   12.24745,
   12.84523,
   12.52996,
   11.31371,
   12.64911,
   11.31371,
   12.52996,
   12.8841,
   12.4499,
   12.24745,
   13,
   12.20656,
   11.74734,
   13.11488,
   12.36932,
   12.52996,
   11.74734,
   11.13553,
   11.13553,
   13,
   12.16553,
   11.7047,
   11.74734,
   11.40175,
   11.35782,
   11.22497,
   11.87434,
   12.24745,
   12.36932,
   12.80625,
   15.87451,
   13.45362,
   10.34408,
   10.90871,
   10.3923,
   9.746794,
   9.110434,
   8.944272,
   8.717798,
   8.602325,
   6.63325,
   8.124038,
   6.244998,
   5.567764,
   4.898979,
   4.472136,
   3.605551,
   3.316625,
   2.236068,
   2,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_fehx3002[100] = {
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2,
   2};
   Double_t Hist_fehy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   3.162278,
   7.348469,
   8.717798,
   9.746794,
   10.34408,
   10.86278,
   11.09054,
   11.40175,
   11.53256,
   12.24745,
   11.6619,
   11.22497,
   11.74734,
   11.31371,
   12.24745,
   12.84523,
   12.52996,
   11.31371,
   12.64911,
   11.31371,
   12.52996,
   12.8841,
   12.4499,
   12.24745,
   13,
   12.20656,
   11.74734,
   13.11488,
   12.36932,
   12.52996,
   11.74734,
   11.13553,
   11.13553,
   13,
   12.16553,
   11.7047,
   11.74734,
   11.40175,
   11.35782,
   11.22497,
   11.87434,
   12.24745,
   12.36932,
   12.80625,
   15.87451,
   13.45362,
   10.34408,
   10.90871,
   10.3923,
   9.746794,
   9.110434,
   8.944272,
   8.717798,
   8.602325,
   6.63325,
   8.124038,
   6.244998,
   5.567764,
   4.898979,
   4.472136,
   3.605551,
   3.316625,
   2.236068,
   2,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of data_plot__R_WM");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of data_plot__R_WM",100,260,740);
   Graph_Hist3002->SetMinimum(0);
   Graph_Hist3002->SetMaximum(294.662);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[102] = {
   320,
   321.4,
   322.8,
   324.2,
   325.6,
   327,
   328.4,
   329.8,
   331.2,
   332.6,
   334,
   335.4,
   336.8,
   338.2,
   339.6,
   341,
   342.4,
   343.8,
   345.2,
   346.6,
   348,
   349.4,
   350.8,
   352.2,
   353.6,
   355,
   356.4,
   357.8,
   359.2,
   360.6,
   362,
   363.4,
   364.8,
   366.2,
   367.6,
   369,
   370.4,
   371.8,
   373.2,
   374.6,
   376,
   377.4,
   378.8,
   380.2,
   381.6,
   383,
   384.4,
   385.8,
   387.2,
   388.6,
   390,
   391.4,
   392.8,
   394.2,
   395.6,
   397,
   398.4,
   399.8,
   401.2,
   402.6,
   404,
   405.4,
   406.8,
   408.2,
   409.6,
   411,
   412.4,
   413.8,
   415.2,
   416.6,
   418,
   419.4,
   420.8,
   422.2,
   423.6,
   425,
   426.4,
   427.8,
   429.2,
   430.6,
   432,
   433.4,
   434.8,
   436.2,
   437.6,
   439,
   440.4,
   441.8,
   443.2,
   444.6,
   446,
   447.4,
   448.8,
   450.2,
   451.6,
   453,
   454.4,
   455.8,
   457.2,
   458.6,
   460,
   460};
   Double_t curvetot_fy1[102] = {
   12.45669,
   20.14825,
   27.5777,
   34.74921,
   41.66694,
   48.33508,
   54.75779,
   60.93926,
   66.88365,
   72.59514,
   78.0779,
   83.33611,
   88.37393,
   93.19555,
   97.80514,
   102.2069,
   106.4049,
   110.4034,
   114.2066,
   117.8187,
   121.2437,
   124.4859,
   127.5495,
   130.4386,
   133.1574,
   135.7101,
   138.1008,
   140.3338,
   142.4132,
   144.3431,
   146.1278,
   147.7714,
   149.2781,
   150.652,
   151.8974,
   153.0184,
   154.0192,
   154.904,
   155.6769,
   156.3421,
   156.9038,
   157.3662,
   157.7333,
   158.0095,
   158.1989,
   158.3056,
   158.3338,
   158.2878,
   158.1716,
   157.9895,
   157.7455,
   157.444,
   157.089,
   156.6848,
   156.2355,
   155.7453,
   155.2183,
   154.6588,
   154.0709,
   153.4588,
   152.8266,
   152.1786,
   151.5188,
   150.8516,
   150.181,
   149.5112,
   148.8464,
   148.1908,
   147.5485,
   146.9238,
   146.3207,
   145.7435,
   145.1964,
   144.6835,
   144.2089,
   143.777,
   143.3917,
   143.0574,
   142.7781,
   142.5582,
   142.4016,
   142.3126,
   142.2955,
   142.3542,
   142.4931,
   142.7163,
   143.028,
   143.4323,
   143.9335,
   144.5356,
   145.2429,
   146.0595,
   146.9897,
   148.0375,
   149.2073,
   150.503,
   151.929,
   153.4893,
   155.1882,
   157.0298,
   159.0183,
   159.0183};
   TGraph *graph = new TGraph(102,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",102,306,474);
   Graph_curvetot1->SetMinimum(0);
   Graph_curvetot1->SetMaximum(173.6745);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t bkg_fx2[102] = {
   320,
   321.4,
   322.8,
   324.2,
   325.6,
   327,
   328.4,
   329.8,
   331.2,
   332.6,
   334,
   335.4,
   336.8,
   338.2,
   339.6,
   341,
   342.4,
   343.8,
   345.2,
   346.6,
   348,
   349.4,
   350.8,
   352.2,
   353.6,
   355,
   356.4,
   357.8,
   359.2,
   360.6,
   362,
   363.4,
   364.8,
   366.2,
   367.6,
   369,
   370.4,
   371.8,
   373.2,
   374.6,
   376,
   377.4,
   378.8,
   380.2,
   381.6,
   383,
   384.4,
   385.8,
   387.2,
   388.6,
   390,
   391.4,
   392.8,
   394.2,
   395.6,
   397,
   398.4,
   399.8,
   401.2,
   402.6,
   404,
   405.4,
   406.8,
   408.2,
   409.6,
   411,
   412.4,
   413.8,
   415.2,
   416.6,
   418,
   419.4,
   420.8,
   422.2,
   423.6,
   425,
   426.4,
   427.8,
   429.2,
   430.6,
   432,
   433.4,
   434.8,
   436.2,
   437.6,
   439,
   440.4,
   441.8,
   443.2,
   444.6,
   446,
   447.4,
   448.8,
   450.2,
   451.6,
   453,
   454.4,
   455.8,
   457.2,
   458.6,
   460,
   460};
   Double_t bkg_fy2[102] = {
   12.45669,
   20.14825,
   27.5777,
   34.74921,
   41.66694,
   48.33508,
   54.75779,
   60.93926,
   66.88365,
   72.59514,
   78.0779,
   83.33611,
   88.37393,
   93.19555,
   97.80514,
   102.2069,
   106.4049,
   110.4034,
   114.2066,
   117.8187,
   121.2437,
   124.4859,
   127.5495,
   130.4386,
   133.1574,
   135.7101,
   138.1008,
   140.3338,
   142.4132,
   144.3431,
   146.1278,
   147.7714,
   149.2781,
   150.652,
   151.8974,
   153.0184,
   154.0192,
   154.904,
   155.6769,
   156.3421,
   156.9038,
   157.3662,
   157.7333,
   158.0095,
   158.1989,
   158.3056,
   158.3338,
   158.2878,
   158.1716,
   157.9895,
   157.7455,
   157.444,
   157.089,
   156.6848,
   156.2355,
   155.7453,
   155.2183,
   154.6588,
   154.0709,
   153.4588,
   152.8266,
   152.1786,
   151.5188,
   150.8516,
   150.181,
   149.5112,
   148.8464,
   148.1908,
   147.5485,
   146.9238,
   146.3207,
   145.7435,
   145.1964,
   144.6835,
   144.2089,
   143.777,
   143.3917,
   143.0574,
   142.7781,
   142.5582,
   142.4016,
   142.3126,
   142.2955,
   142.3542,
   142.4931,
   142.7163,
   143.028,
   143.4323,
   143.9335,
   144.5356,
   145.2429,
   146.0595,
   146.9897,
   148.0375,
   149.2073,
   150.503,
   151.929,
   153.4893,
   155.1882,
   157.0298,
   159.0183,
   159.0183};
   graph = new TGraph(102,bkg_fx2,bkg_fy2);
   graph->SetName("bkg");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_bkg2 = new TH1F("Graph_bkg2","Projection of totalPdf",102,306,474);
   Graph_bkg2->SetMinimum(0);
   Graph_bkg2->SetMaximum(173.6745);
   Graph_bkg2->SetDirectory(0);
   Graph_bkg2->SetStats(0);
   Graph_bkg2->SetLineWidth(2);
   Graph_bkg2->SetMarkerStyle(20);
   Graph_bkg2->GetXaxis()->SetNdivisions(505);
   Graph_bkg2->GetXaxis()->SetLabelFont(132);
   Graph_bkg2->GetXaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetXaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetXaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetXaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetXaxis()->SetTitleFont(132);
   Graph_bkg2->GetYaxis()->SetLabelFont(132);
   Graph_bkg2->GetYaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetYaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetYaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetYaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetYaxis()->SetTitleFont(132);
   Graph_bkg2->GetZaxis()->SetLabelFont(132);
   Graph_bkg2->GetZaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetZaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetZaxis()->SetTitleOffset(1.2);
   Graph_bkg2->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_bkg2);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.75,0.02,1,0.42,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("bkg","Background","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_4083450__4 = new TH1D("frame_4083450__4","A RooPlot of \"m(#pi p#rightarrow#pi)\"",100,300,700);
   frame_4083450__4->SetBinContent(1,281.2682);
   frame_4083450__4->SetMaximum(281.2682);
   frame_4083450__4->SetEntries(1);
   frame_4083450__4->SetDirectory(0);
   frame_4083450__4->SetStats(0);
   frame_4083450__4->SetLineWidth(2);
   frame_4083450__4->SetMarkerStyle(20);
   frame_4083450__4->GetXaxis()->SetTitle("m(#pi p#rightarrow#pi) (MeV)");
   frame_4083450__4->GetXaxis()->SetNdivisions(505);
   frame_4083450__4->GetXaxis()->SetLabelFont(132);
   frame_4083450__4->GetXaxis()->SetLabelOffset(0.01);
   frame_4083450__4->GetXaxis()->SetLabelSize(0.06);
   frame_4083450__4->GetXaxis()->SetTitleSize(0.072);
   frame_4083450__4->GetXaxis()->SetTitleOffset(0.95);
   frame_4083450__4->GetXaxis()->SetTitleFont(132);
   frame_4083450__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4083450__4->GetYaxis()->SetLabelFont(132);
   frame_4083450__4->GetYaxis()->SetLabelOffset(0.01);
   frame_4083450__4->GetYaxis()->SetLabelSize(0.06);
   frame_4083450__4->GetYaxis()->SetTitleSize(0.072);
   frame_4083450__4->GetYaxis()->SetTitleOffset(0.95);
   frame_4083450__4->GetYaxis()->SetTitleFont(132);
   frame_4083450__4->GetZaxis()->SetLabelFont(132);
   frame_4083450__4->GetZaxis()->SetLabelSize(0.06);
   frame_4083450__4->GetZaxis()->SetTitleSize(0.072);
   frame_4083450__4->GetZaxis()->SetTitleOffset(1.2);
   frame_4083450__4->GetZaxis()->SetTitleFont(132);
   frame_4083450__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Ejemplo n.º 25
0
void DeltaPlot::viewGMstar (Char_t const* title)
{
	FFactor GMS(12);
	GMS.LoadParameters(parametersFile);
	GMS.CheckParameters();
	//GMS.PrintParameters();

	const int nPoints = 2500;
	double qMin;
	double qMax;
	double qStep;
	double qA;

	double DX[nPoints], DY[nPoints], RY[nPoints];
	qMin = 0.004;
	qMax = 3.0;
	qStep = (qMax-qMin)/nPoints;
	qA = qMin;

	for (int i = 0; i < nPoints; i++) {
		qA = qMin + i*qStep;
		double qA2 = qA*qA;
		double gen = GMS.AbsGEN(-qA2);
		double gmn = GMS.AbsGMN(-qA2);
		double msq = massDi*massDi - massNucl*massNucl - qA2;
		double abq = sqrt((qA2 + msq*msq)/(4.*massDi*massDi));
		double jsc = (massDi+massNucl)/2./massNucl*(1.-qA2/4./massDi/massDi)*(1.-qA2/4./massNucl/massNucl);
		DX[i] = qA2;
		double mDip = 1. + qA2/0.71;
		double gD = 1./mDip/mDip;
		double gDmn = gD*(-muN);
		DY[i] = sqrt(2.)*2./3.*gDmn*jsc;
		double masst = qA2/(4.*massNucl*massNucl);
		double gmo = (GMS.ScalarOne(-qA2)-GMS.VectorOne(-qA2))/qA2+(GMS.ScalarTwo(-qA2)-GMS.VectorTwo(-qA2))/massN/massN/4.;
		RY[i] = sqrt(2.)*2./3.*gmn*jsc;
	}	
	
	c[k] = new TCanvas (uName("c",k), uName("Graph_",k), x0+k*s, y0+k*s, w, h);
	//c[k]->SetLogy(); // logarithmic scale

	TGraphErrors *g[5];
	TMultiGraph *mg = new TMultiGraph();
	Double_t EX0[100] = {0};

	// 1999-PRL-82-45_Frolov
	Double_t X1[] = {2.8, 4.0};
	Double_t Y1[] = {0.0859, 0.0402};
	Double_t U1[] = {0.0035, 0.0019};
	Double_t D1[] = {0.0035, 0.0019};
	g[1] = new TGraphErrors (2, X1, Y1, EX0, D1);
	g[1]->SetTitle("JLab/Hall C");
	g[1]->SetMarkerColor(2);
	g[1]->SetMarkerStyle(21);
	mg->Add(g[1]);

	// 2006-PRL-97-112003_Ungaro
	Double_t X2[] = {3.0, 3.5, 4.2, 5.0, 6.0};
	Double_t Y2[] = {0.0697, 0.0524, 0.0346, 0.0242, 0.0134};
	Double_t U2[] = {0.0010, 0.0011, 0.0012, 0.0014, 0.0014};
	Double_t D2[] = {0.0010, 0.0011, 0.0012, 0.0014, 0.0014};
	g[2] = new TGraphErrors (5, X2, Y2, EX0, D2);
	g[2]->SetTitle("JLaB/CLAS");
	g[2]->SetMarkerColor(4);
	g[2]->SetMarkerStyle(21);
	mg->Add(g[2]);

	// 1968-PL-28-148B_Bartel
	Double_t X3[] = {0.20, 0.30, 0.40, 0.47, 0.48, 0.50, 0.60, 0.63, 0.63, 0.77, 0.78, 0.79, 0.97, 0.98, 1.15, 1.34, 1.57, 2.34};
	Double_t Y3[] = {1.7700, 1.3800, 1.1700, 0.9780, 0.9610, 0.9640, 0.7660, 0.7350, 0.7190, 0.5700, 0.5720, 0.5530, 0.4460, 0.4460, 0.3260, 0.2690, 0.2090, 0.1020};
	Double_t U3[] = {0.0620, 0.0483, 0.0351, 0.0293, 0.0336, 0.0289, 0.0268, 0.0221, 0.0252, 0.0200, 0.0172, 0.0194, 0.0156, 0.0156, 0.0147, 0.0121, 0.0115, 0.0082};
	Double_t D3[] = {0.0620, 0.0483, 0.0351, 0.0293, 0.0336, 0.0289, 0.0268, 0.0221, 0.0252, 0.0200, 0.0172, 0.0194, 0.0156, 0.0156, 0.0147, 0.0121, 0.0115, 0.0082};
	g[3] = new TGraphErrors (18, X3, Y3, EX0, D3);
	g[3]->SetTitle("DESY");
	g[3]->SetMarkerColor(6);
	g[3]->SetMarkerStyle(22);
	mg->Add(g[3]);

	// 1975-PR-D12-1884_Stein
	Double_t X4[] = {0.09, 0.22, 0.46, 0.78, 1.17, 1.48, 1.82};
	Double_t Y4[] = {2.2448, 1.5824, 0.9147, 0.5007, 0.2708, 0.1728, 0.1122};
	Double_t U4[] = {0.0709, 0.0332, 0.0243, 0.0136, 0.0116, 0.0095, 0.0064};
	Double_t D4[] = {0.0709, 0.0332, 0.0243, 0.0136, 0.0116, 0.0095, 0.0064};
	g[4] = new TGraphErrors (7, X4, Y4, EX0, D4);
	g[4]->SetTitle("SLAC");
	g[4]->SetMarkerColor(4);
	g[4]->SetMarkerStyle(23);
	mg->Add(g[4]);

	for (int i=0; i<4; ++i)
	{
		g[i+1]->SetFillColor(0);
		//g[i+1]->SetLineColor(4);
		g[i+1]->SetMarkerSize(1.2);
	}

	// Formula D
	TGraph *gD = new TGraph (nPoints, DX, DY);
	gD->SetTitle("Dipole formulae");
	gD->SetFillColor(0);
	gD->SetLineWidth(3);
	gD->SetMarkerSize(0.3);
	gD->SetMarkerStyle(21);
	gD->SetMarkerColor(4);
	gD->SetLineColor(4);
	mg->Add(gD);
	
	// Formula A
	TGraph *gA = new TGraph (nPoints, DX, RY);
	gA->SetTitle("Our result");
	gA->SetFillColor(0);
	gA->SetLineWidth(3);
	gA->SetMarkerSize(0.3);
	gA->SetMarkerStyle(21);
	//gA->SetLineColor(3);
	mg->Add(gA);

	mg->Draw("AP");

	//TF1 *fg = new TF1 ("fg", "[1]*x + [0]");
	//mg->Fit("poly5","Fit"); // fg

	TAxis *aX = mg->GetXaxis();
	aX->SetTitle("Q^{2} [GeV^{2}]");
	//aX->SetLimits(0.,10.);
	aX->SetRangeUser(-0.01,7.0);
	aX->SetTitleOffset(1.2);
	aX->CenterTitle();

	TAxis *aY = mg->GetYaxis();
	aY->SetTitle("G_{M}^{*}");
	//aY->SetRangeUser(0.6,1.8);
	aY->SetTitleOffset(1.2);
	aY->CenterTitle();

	gPad->SetFillColor(kWhite);
	
	TLegend *leg = c[k]->BuildLegend();
	leg->SetFillStyle(0);

	c[k]->Modified();

	c[k]->SaveAs("imgGMstar.pdf");
	
	++k;	
}
Ejemplo n.º 26
0
void fit1()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Wed Mar  9 00:43:22 2016) by ROOT version6.06/00
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(3754.321,-26.4,6223.457,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_a63bf70__1 = new TH1D("frame_a63bf70__1","",100,4100,6100);
   frame_a63bf70__1->SetBinContent(1,269.9669);
   frame_a63bf70__1->SetMinimum(-8.8);
   frame_a63bf70__1->SetMaximum(8.8);
   frame_a63bf70__1->SetEntries(1);
   frame_a63bf70__1->SetDirectory(0);
   frame_a63bf70__1->SetStats(0);
   frame_a63bf70__1->SetLineWidth(2);
   frame_a63bf70__1->SetMarkerStyle(20);
   frame_a63bf70__1->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_a63bf70__1->GetXaxis()->SetNdivisions(505);
   frame_a63bf70__1->GetXaxis()->SetLabelFont(132);
   frame_a63bf70__1->GetXaxis()->SetLabelOffset(0.01);
   frame_a63bf70__1->GetXaxis()->SetLabelSize(0.15);
   frame_a63bf70__1->GetXaxis()->SetTitleSize(0.2);
   frame_a63bf70__1->GetXaxis()->SetTitleOffset(1.1);
   frame_a63bf70__1->GetXaxis()->SetTitleFont(132);
   frame_a63bf70__1->GetYaxis()->SetTitle("Pull");
   frame_a63bf70__1->GetYaxis()->CenterTitle(true);
   frame_a63bf70__1->GetYaxis()->SetNdivisions(505);
   frame_a63bf70__1->GetYaxis()->SetLabelFont(132);
   frame_a63bf70__1->GetYaxis()->SetLabelOffset(0.01);
   frame_a63bf70__1->GetYaxis()->SetLabelSize(0.15);
   frame_a63bf70__1->GetYaxis()->SetTitleSize(0.15);
   frame_a63bf70__1->GetYaxis()->SetTitleOffset(0.45);
   frame_a63bf70__1->GetYaxis()->SetTitleFont(132);
   frame_a63bf70__1->GetZaxis()->SetLabelFont(132);
   frame_a63bf70__1->GetZaxis()->SetLabelSize(0.06);
   frame_a63bf70__1->GetZaxis()->SetTitleSize(0.072);
   frame_a63bf70__1->GetZaxis()->SetTitleOffset(1.2);
   frame_a63bf70__1->GetZaxis()->SetTitleFont(132);
   frame_a63bf70__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[83] = {
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950};
   Double_t pull_Hist_curvetot_fy3001[83] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   256.1113,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_felx3001[83] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[83] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehx3001[83] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[83] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   1,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(83,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of data_plot__sqrt(pow(J_psi_1S_TRUEP_E+Lambda0_TRUEP_E,2)-pow(J_psi_1S_TRUEP_X+Lambda0_TRUEP_X,2)-pow(J_psi_1S_TRUEP_Y+Lambda0_TRUEP_Y,2)-pow(J_psi_1S_TRUEP_Z+Lambda0_TRUEP_Z,2)) and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of data_plot__sqrt(pow(J_psi_1S_TRUEP_E+Lambda0_TRUEP_E,2)-pow(J_psi_1S_TRUEP_X+Lambda0_TRUEP_X,2)-pow(J_psi_1S_TRUEP_Y+Lambda0_TRUEP_Y,2)-pow(J_psi_1S_TRUEP_Z+Lambda0_TRUEP_Z,2)) and Projection of totalPdf",100,4146,6114);
   Graph_pull_Hist_curvetot3001->SetMinimum(0);
   Graph_pull_Hist_curvetot3001->SetMaximum(282.8224);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_a63bf70__2 = new TH1D("frame_a63bf70__2","",100,4100,6100);
   frame_a63bf70__2->SetBinContent(1,269.9669);
   frame_a63bf70__2->SetMinimum(-8.8);
   frame_a63bf70__2->SetMaximum(8.8);
   frame_a63bf70__2->SetEntries(1);
   frame_a63bf70__2->SetDirectory(0);
   frame_a63bf70__2->SetStats(0);
   frame_a63bf70__2->SetLineWidth(2);
   frame_a63bf70__2->SetMarkerStyle(20);
   frame_a63bf70__2->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_a63bf70__2->GetXaxis()->SetNdivisions(505);
   frame_a63bf70__2->GetXaxis()->SetLabelFont(132);
   frame_a63bf70__2->GetXaxis()->SetLabelOffset(0.01);
   frame_a63bf70__2->GetXaxis()->SetLabelSize(0.15);
   frame_a63bf70__2->GetXaxis()->SetTitleSize(0.2);
   frame_a63bf70__2->GetXaxis()->SetTitleOffset(1.1);
   frame_a63bf70__2->GetXaxis()->SetTitleFont(132);
   frame_a63bf70__2->GetYaxis()->SetTitle("Pull");
   frame_a63bf70__2->GetYaxis()->CenterTitle(true);
   frame_a63bf70__2->GetYaxis()->SetNdivisions(505);
   frame_a63bf70__2->GetYaxis()->SetLabelFont(132);
   frame_a63bf70__2->GetYaxis()->SetLabelOffset(0.01);
   frame_a63bf70__2->GetYaxis()->SetLabelSize(0.15);
   frame_a63bf70__2->GetYaxis()->SetTitleSize(0.15);
   frame_a63bf70__2->GetYaxis()->SetTitleOffset(0.45);
   frame_a63bf70__2->GetYaxis()->SetTitleFont(132);
   frame_a63bf70__2->GetZaxis()->SetLabelFont(132);
   frame_a63bf70__2->GetZaxis()->SetLabelSize(0.06);
   frame_a63bf70__2->GetZaxis()->SetTitleSize(0.072);
   frame_a63bf70__2->GetZaxis()->SetTitleOffset(1.2);
   frame_a63bf70__2->GetZaxis()->SetTitleFont(132);
   frame_a63bf70__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(3754.321,0,6223.457,3.935074);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetLogy();
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_4618880__3 = new TH1D("frame_4618880__3","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_4618880__3->SetBinContent(1,69141.57);
   frame_4618880__3->SetMinimum(1);
   frame_4618880__3->SetMaximum(5000);
   frame_4618880__3->SetEntries(1);
   frame_4618880__3->SetDirectory(0);
   frame_4618880__3->SetStats(0);
   frame_4618880__3->SetLineWidth(2);
   frame_4618880__3->SetMarkerStyle(20);
   frame_4618880__3->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_4618880__3->GetXaxis()->SetNdivisions(505);
   frame_4618880__3->GetXaxis()->SetLabelFont(132);
   frame_4618880__3->GetXaxis()->SetLabelOffset(0.01);
   frame_4618880__3->GetXaxis()->SetLabelSize(0.06);
   frame_4618880__3->GetXaxis()->SetTitleSize(0.072);
   frame_4618880__3->GetXaxis()->SetTitleOffset(0.95);
   frame_4618880__3->GetXaxis()->SetTitleFont(132);
   frame_4618880__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4618880__3->GetYaxis()->SetLabelFont(132);
   frame_4618880__3->GetYaxis()->SetLabelOffset(0.01);
   frame_4618880__3->GetYaxis()->SetLabelSize(0.06);
   frame_4618880__3->GetYaxis()->SetTitleSize(0.072);
   frame_4618880__3->GetYaxis()->SetTitleOffset(0.95);
   frame_4618880__3->GetYaxis()->SetTitleFont(132);
   frame_4618880__3->GetZaxis()->SetLabelFont(132);
   frame_4618880__3->GetZaxis()->SetLabelSize(0.06);
   frame_4618880__3->GetZaxis()->SetTitleSize(0.072);
   frame_4618880__3->GetZaxis()->SetTitleOffset(1.2);
   frame_4618880__3->GetZaxis()->SetTitleFont(132);
   frame_4618880__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   4110,
   4130,
   4150,
   4170,
   4190,
   4210,
   4230,
   4250,
   4270,
   4290,
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950,
   5970,
   5990,
   6010,
   6030,
   6050,
   6070,
   6090};
   Double_t Hist_fy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   65593,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_felx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fely3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   256.1113,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Hist_fehx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fehy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   256.1113,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of data_plot__sqrt(pow(J_psi_1S_TRUEP_E+Lambda0_TRUEP_E,2)-pow(J_psi_1S_TRUEP_X+Lambda0_TRUEP_X,2)-pow(J_psi_1S_TRUEP_Y+Lambda0_TRUEP_Y,2)-pow(J_psi_1S_TRUEP_Z+Lambda0_TRUEP_Z,2))");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of data_plot__sqrt(pow(J_psi_1S_TRUEP_E+Lambda0_TRUEP_E,2)-pow(J_psi_1S_TRUEP_X+Lambda0_TRUEP_X,2)-pow(J_psi_1S_TRUEP_Y+Lambda0_TRUEP_Y,2)-pow(J_psi_1S_TRUEP_Z+Lambda0_TRUEP_Z,2))",100,3900,6300);
   Graph_Hist3002->SetMinimum(72.43402);
   Graph_Hist3002->SetMaximum(72434.02);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[102] = {
   4300,
   4316.5,
   4333,
   4349.5,
   4366,
   4382.5,
   4399,
   4415.5,
   4432,
   4448.5,
   4465,
   4481.5,
   4498,
   4514.5,
   4531,
   4547.5,
   4564,
   4580.5,
   4597,
   4613.5,
   4630,
   4646.5,
   4663,
   4679.5,
   4696,
   4712.5,
   4729,
   4745.5,
   4762,
   4778.5,
   4795,
   4811.5,
   4828,
   4844.5,
   4861,
   4877.5,
   4894,
   4910.5,
   4927,
   4943.5,
   4960,
   4976.5,
   4993,
   5009.5,
   5026,
   5042.5,
   5059,
   5075.5,
   5092,
   5108.5,
   5125,
   5141.5,
   5158,
   5174.5,
   5191,
   5207.5,
   5224,
   5240.5,
   5257,
   5273.5,
   5290,
   5306.5,
   5323,
   5339.5,
   5356,
   5372.5,
   5389,
   5405.5,
   5422,
   5438.5,
   5455,
   5471.5,
   5488,
   5504.5,
   5521,
   5537.5,
   5554,
   5570.5,
   5587,
   5603.5,
   5620,
   5636.5,
   5653,
   5669.5,
   5686,
   5702.5,
   5719,
   5735.5,
   5752,
   5768.5,
   5785,
   5801.5,
   5818,
   5834.5,
   5851,
   5867.5,
   5884,
   5900.5,
   5917,
   5933.5,
   5950,
   5950};
   Double_t curvetot_fy1[102] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   TGraph *graph = new TGraph(102,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",102,4135,6115);
   Graph_curvetot1->SetMinimum(0.0011);
   Graph_curvetot1->SetMaximum(1.1);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t CBLst1405_fx2[102] = {
   4300,
   4316.5,
   4333,
   4349.5,
   4366,
   4382.5,
   4399,
   4415.5,
   4432,
   4448.5,
   4465,
   4481.5,
   4498,
   4514.5,
   4531,
   4547.5,
   4564,
   4580.5,
   4597,
   4613.5,
   4630,
   4646.5,
   4663,
   4679.5,
   4696,
   4712.5,
   4729,
   4745.5,
   4762,
   4778.5,
   4795,
   4811.5,
   4828,
   4844.5,
   4861,
   4877.5,
   4894,
   4910.5,
   4927,
   4943.5,
   4960,
   4976.5,
   4993,
   5009.5,
   5026,
   5042.5,
   5059,
   5075.5,
   5092,
   5108.5,
   5125,
   5141.5,
   5158,
   5174.5,
   5191,
   5207.5,
   5224,
   5240.5,
   5257,
   5273.5,
   5290,
   5306.5,
   5323,
   5339.5,
   5356,
   5372.5,
   5389,
   5405.5,
   5422,
   5438.5,
   5455,
   5471.5,
   5488,
   5504.5,
   5521,
   5537.5,
   5554,
   5570.5,
   5587,
   5603.5,
   5620,
   5636.5,
   5653,
   5669.5,
   5686,
   5702.5,
   5719,
   5735.5,
   5752,
   5768.5,
   5785,
   5801.5,
   5818,
   5834.5,
   5851,
   5867.5,
   5884,
   5900.5,
   5917,
   5933.5,
   5950,
   5950};
   Double_t CBLst1405_fy2[102] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   graph = new TGraph(102,CBLst1405_fx2,CBLst1405_fy2);
   graph->SetName("CBLst1405");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_CBLst14052 = new TH1F("Graph_CBLst14052","Projection of totalPdf",102,4135,6115);
   Graph_CBLst14052->SetMinimum(0.0011);
   Graph_CBLst14052->SetMaximum(1.1);
   Graph_CBLst14052->SetDirectory(0);
   Graph_CBLst14052->SetStats(0);
   Graph_CBLst14052->SetLineWidth(2);
   Graph_CBLst14052->SetMarkerStyle(20);
   Graph_CBLst14052->GetXaxis()->SetNdivisions(505);
   Graph_CBLst14052->GetXaxis()->SetLabelFont(132);
   Graph_CBLst14052->GetXaxis()->SetLabelOffset(0.01);
   Graph_CBLst14052->GetXaxis()->SetLabelSize(0.06);
   Graph_CBLst14052->GetXaxis()->SetTitleSize(0.072);
   Graph_CBLst14052->GetXaxis()->SetTitleOffset(0.95);
   Graph_CBLst14052->GetXaxis()->SetTitleFont(132);
   Graph_CBLst14052->GetYaxis()->SetLabelFont(132);
   Graph_CBLst14052->GetYaxis()->SetLabelOffset(0.01);
   Graph_CBLst14052->GetYaxis()->SetLabelSize(0.06);
   Graph_CBLst14052->GetYaxis()->SetTitleSize(0.072);
   Graph_CBLst14052->GetYaxis()->SetTitleOffset(0.95);
   Graph_CBLst14052->GetYaxis()->SetTitleFont(132);
   Graph_CBLst14052->GetZaxis()->SetLabelFont(132);
   Graph_CBLst14052->GetZaxis()->SetLabelSize(0.06);
   Graph_CBLst14052->GetZaxis()->SetTitleSize(0.072);
   Graph_CBLst14052->GetZaxis()->SetTitleOffset(1.2);
   Graph_CBLst14052->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_CBLst14052);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.2,0.02,0.4,0.42,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("CBLst1405","#Lambda*(1405), CB","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_4618880__4 = new TH1D("frame_4618880__4","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_4618880__4->SetBinContent(1,69141.57);
   frame_4618880__4->SetMinimum(1);
   frame_4618880__4->SetMaximum(5000);
   frame_4618880__4->SetEntries(1);
   frame_4618880__4->SetDirectory(0);
   frame_4618880__4->SetStats(0);
   frame_4618880__4->SetLineWidth(2);
   frame_4618880__4->SetMarkerStyle(20);
   frame_4618880__4->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_4618880__4->GetXaxis()->SetNdivisions(505);
   frame_4618880__4->GetXaxis()->SetLabelFont(132);
   frame_4618880__4->GetXaxis()->SetLabelOffset(0.01);
   frame_4618880__4->GetXaxis()->SetLabelSize(0.06);
   frame_4618880__4->GetXaxis()->SetTitleSize(0.072);
   frame_4618880__4->GetXaxis()->SetTitleOffset(0.95);
   frame_4618880__4->GetXaxis()->SetTitleFont(132);
   frame_4618880__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4618880__4->GetYaxis()->SetLabelFont(132);
   frame_4618880__4->GetYaxis()->SetLabelOffset(0.01);
   frame_4618880__4->GetYaxis()->SetLabelSize(0.06);
   frame_4618880__4->GetYaxis()->SetTitleSize(0.072);
   frame_4618880__4->GetYaxis()->SetTitleOffset(0.95);
   frame_4618880__4->GetYaxis()->SetTitleFont(132);
   frame_4618880__4->GetZaxis()->SetLabelFont(132);
   frame_4618880__4->GetZaxis()->SetLabelSize(0.06);
   frame_4618880__4->GetZaxis()->SetTitleSize(0.072);
   frame_4618880__4->GetZaxis()->SetTitleOffset(1.2);
   frame_4618880__4->GetZaxis()->SetTitleFont(132);
   frame_4618880__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Ejemplo n.º 27
0
void integrated_lumi(Bool_t goodOnly=0){
  nGoodRuns+= nGoodRuns15f;
  nGoodRuns+= nGoodRuns15h;
  nGoodRuns+= nGoodRuns15i;
  nGoodRuns+= nGoodRuns15j;
  nGoodRuns+= nGoodRuns15l;
  Int_t j=0;
  for (Int_t i=0;i<nGoodRuns15f;i++) goodRuns[j++]=goodRuns15f[i];
  for (Int_t i=0;i<nGoodRuns15h;i++) goodRuns[j++]=goodRuns15h[i];
//  for (Int_t i=0;i<nGoodRuns15i_badIR;i++) goodRuns[j++]=goodRuns15i_badIR[i];
//  for (Int_t i=0;i<nGoodRuns15i_badSPD;i++) goodRuns[j++]=goodRuns15i_badSPD[i];
  for (Int_t i=0;i<nGoodRuns15i;i++) goodRuns[j++]=goodRuns15i[i];
  for (Int_t i=0;i<nGoodRuns15j;i++) goodRuns[j++]=goodRuns15j[i];
  for (Int_t i=0;i<nGoodRuns15l;i++) goodRuns[j++]=goodRuns15l[i];


  gStyle->SetPadTopMargin(0.01);
  gStyle->SetPadRightMargin(0.01);
  gStyle->SetPadBottomMargin(0.06);
  gStyle->SetPadLeftMargin(0.13);
  TGaxis::SetMaxDigits(3);
  
  gStyle->SetOptTitle(1);
  gStyle->SetTitleOffset(1.6,"Y");
  gStyle->SetOptStat(0);
  TLatex* latex = new TLatex();
  latex->SetTextSize(0.05);
  latex->SetTextFont(42);
  latex->SetTextAlign(11);
  latex->SetNDC();
  
  t = new TChain("trending");
  t->AddFile("trending.root");
  classes = new TObjArray();
  partition = new TObjString();
  lhcState = new TObjString();
  lhcPeriod = new TObjString();
  activeDetectors = new TObjString();
  
  t->SetBranchAddress("run",&run);
  t->SetBranchAddress("fill",&fill);
  t->SetBranchAddress("classes",&classes);
  t->SetBranchAddress("class_l2a",&class_l2a);
  t->SetBranchAddress("class_lumi",&class_lumi);
  t->SetBranchAddress("timeStart",&timeStart);
  t->SetBranchAddress("timeEnd",&timeEnd);
  t->SetBranchAddress("partition",&partition);
  t->SetBranchAddress("lhcState",&lhcState);
  t->SetBranchAddress("lhcPeriod",&lhcPeriod);
  t->SetBranchAddress("activeDetectors",&activeDetectors);
  TGraph* gINT = GetStat("CINT7-B-NOPF-CENT",1,goodOnly);
  TGraph* gMUL = GetStat("CMUL7-B-NOPF-MUFAST",1,goodOnly);
  TGraph* gV0M = GetStat("CVHMV0M-B-NOPF-CENTNOTRD",1,goodOnly);
  TGraph* gSH2 = GetStat("CVHMSH2-B-NOPF-CENTNOTRD",1,goodOnly);
  TGraph* gStatINT = GetStat("CINT7-B-NOPF-CENT",0,goodOnly);
  TGraph* gStatV0M = GetStat("CVHMV0M-B-NOPF-CENTNOTRD",0,goodOnly);
  TGraph* gStatSH2 = GetStat("CVHMSH2-B-NOPF-CENTNOTRD",0,goodOnly);
  TGraph* gStatEMC = GetStat("CEMC7-B-NOPF-CENTNOTRD",0,goodOnly,"PHYSICS_2");
  TGraph* gStatDMC = GetStat("CDMC7-B-NOPF-CENTNOTRD",0,goodOnly,"PHYSICS_2");
  gMUL->SetLineColor(kBlack);
  gINT->SetLineColor(kBlue);
  gV0M->SetLineColor(kMagenta);
  gSH2->SetLineColor(kRed);
  gStatV0M->SetLineColor(kMagenta);
  gStatSH2->SetLineColor(kRed);
  gStatEMC->SetLineColor(kGray);
  gStatDMC->SetLineColor(kGreen-2);

  TCanvas* c1 = new TCanvas("c1","",800,700);
  Double_t xminLumi   = gMUL->GetXaxis()->GetXmin();
  Double_t xmaxLumi   = gMUL->GetXaxis()->GetXmax();
  Double_t ymaxLumi   = gMUL->GetYaxis()->GetXmax()*1.1;
  TH1F* f1 = gPad->DrawFrame(xminLumi,0,xmaxLumi,ymaxLumi);
  SetFrame(f1);
  f1->GetYaxis()->SetTitle("Integrated luminosity, pb^{-1}");
  f1->GetXaxis()->SetTimeDisplay(1);
  f1->GetXaxis()->SetTimeFormat("%d %b");
  Double_t y = 0.94;
  latex->DrawLatex(0.18,0.94,"ALICE Performance, pp #sqrt{s} = 13 TeV");
  latex->SetTextColor(gINT->GetLineColor());
  latex->DrawLatex(0.18,y-=0.07,Form("MB triggers: L = %.3f pb^{-1}",gINT->GetY()[gINT->GetN()-1]));
  latex->SetTextColor(gV0M->GetLineColor());
  latex->DrawLatex(0.18,y-=0.07,Form("V0 HM triggers:  L = %.3f pb^{-1}",gV0M->GetY()[gV0M->GetN()-1]));
  latex->SetTextColor(gSH2->GetLineColor());
  latex->DrawLatex(0.18,y-=0.07,Form("SPD HM triggers: L = %.3f pb^{-1}",gSH2->GetY()[gSH2->GetN()-1]));
  latex->SetTextColor(gMUL->GetLineColor());
  latex->DrawLatex(0.18,y-=0.07,Form("Dimuon triggers: L = %.3f pb^{-1}",gMUL->GetY()[gMUL->GetN()-1]));
  gMUL->Draw();
  gINT->Draw();
  gV0M->Draw();
  gSH2->Draw();
  gPad->Print("lumi_dimuon_triggers.png");

  TCanvas* c2 = new TCanvas("c2","",800,700);
  Double_t xminEvents = gStatINT->GetXaxis()->GetXmin();
  Double_t xmaxEvents = gStatINT->GetXaxis()->GetXmax();
  Double_t ymaxEvents = gStatINT->GetYaxis()->GetXmax()*1.1;

  TH1F* f2 = gPad->DrawFrame(xminEvents,0,xmaxEvents,ymaxEvents);
  SetFrame(f2);
  f2->GetYaxis()->SetTitle("Recorded triggers, 10^{6}");
  f2->GetXaxis()->SetTimeDisplay(1);
  f2->GetXaxis()->SetTimeFormat("%d %b");
  gStatINT->Draw();
  gStatV0M->Draw();
  gStatSH2->Draw();
//  gStatDMC->Draw();
//  gStatEMC->Draw();
  latex->SetTextColor(1);
  latex->DrawLatex(0.18,0.94,"ALICE Performance, pp #sqrt{s} = 13 TeV");
  y = 0.94;
  latex->SetTextColor(gStatINT->GetLineColor());
  latex->DrawLatex(0.18,y-=0.07,Form("MB triggers: %.0fM",gStatINT->GetY()[gStatINT->GetN()-1]));
  latex->SetTextColor(gStatV0M->GetLineColor());
  latex->DrawLatex(0.18,y-=0.07,Form("V0 HM triggers:  %.0fM",gStatV0M->GetY()[gStatV0M->GetN()-1]));
  latex->SetTextColor(gStatSH2->GetLineColor());
  latex->DrawLatex(0.18,y-=0.07,Form("SPD HM triggers: %.0fM",gStatSH2->GetY()[gStatSH2->GetN()-1]));
//  latex->SetTextColor(gStatEMC->GetLineColor());
//  latex->DrawLatex(0.18,y-=0.07,Form("EMCAL triggers: %.0fM",gStatEMC->GetY()[gStatDMC->GetN()-1]));
//  latex->SetTextColor(gStatDMC->GetLineColor());
//  latex->DrawLatex(0.18,y-=0.07,Form("DCAL triggers: %.0fM",gStatDMC->GetY()[gStatDMC->GetN()-1]));
  gPad->Print("stat_mb_triggers.png");
}
void Final_av_Lambda_VarCoupling_40Percent()
{
//=========Macro generated from canvas: c/c
//=========  (Sat Feb 27 17:06:04 2016) by ROOT version6.04/06
   TCanvas *c = new TCanvas("c", "c",0,0,800,700);
   c->SetHighLightColor(2);
   c->Range(-0.4813593,1.36281,3.148656,6.672724);
   c->SetFillColor(0);
   c->SetBorderMode(0);
   c->SetBorderSize(2);
   c->SetLogx();
   c->SetLogy();
   c->SetTickx(1);
   c->SetTicky(1);
   c->SetLeftMargin(0.12);
   c->SetRightMargin(0.04);
   c->SetTopMargin(0.07);
   c->SetBottomMargin(0.12);
   c->SetFrameBorderMode(0);
   c->SetFrameBorderMode(0);
   
   TMultiGraph *multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle("");
   
   Double_t Graph_fx1[12] = {
   1,
   10,
   100,
   400,
   700,
   1000,
   1000,
   700,
   400,
   100,
   10,
   1};
   Double_t Graph_fy1[12] = {
   881.525,
   896.549,
   871.907,
   667.806,
   471.744,
   308.777,
   382.832,
   584.437,
   826.374,
   1079.16,
   1110.85,
   1092.23};
   TGraph *graph = new TGraph(12,Graph_fx1,Graph_fy1);
   graph->SetName("Graph");
   graph->SetTitle("");

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#ffcc00");
   graph->SetFillColor(ci);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph1 = new TH1F("Graph_Graph1","",100,0.9,1099.9);
   Graph_Graph1->SetMinimum(228.5697);
   Graph_Graph1->SetMaximum(1191.057);
   Graph_Graph1->SetDirectory(0);
   Graph_Graph1->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1->SetLineColor(ci);
   Graph_Graph1->GetXaxis()->SetLabelFont(42);
   Graph_Graph1->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetXaxis()->SetTitleFont(42);
   Graph_Graph1->GetYaxis()->SetLabelFont(42);
   Graph_Graph1->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetYaxis()->SetTitleFont(42);
   Graph_Graph1->GetZaxis()->SetLabelFont(42);
   Graph_Graph1->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph1);
   
   multigraph->Add(graph,"");
   multigraph->Draw("af");
   multigraph->GetXaxis()->SetTitle("M_{#chi} (GeV)");
   multigraph->GetXaxis()->SetRange(0,96);
   multigraph->GetXaxis()->SetLabelFont(42);
   multigraph->GetXaxis()->SetTitleSize(0.05);
   multigraph->GetXaxis()->SetTitleOffset(1.1);
   multigraph->GetXaxis()->SetTitleFont(42);
   multigraph->GetYaxis()->SetTitle("#Lambda (GeV)");
   multigraph->GetYaxis()->SetLabelFont(42);
   multigraph->GetYaxis()->SetTitleSize(0.05);
   multigraph->GetYaxis()->SetTitleOffset(1.05);
   multigraph->GetYaxis()->SetTitleFont(42);
   
   multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle("");
   
   Double_t Graph_fx2[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy2[6] = {
   1092.23,
   1110.85,
   1079.16,
   826.374,
   584.437,
   382.832};
   graph = new TGraph(6,Graph_fx2,Graph_fy2);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   
   TH1F *Graph_Graph2 = new TH1F("Graph_Graph2","Graph",100,0.9,1099.9);
   Graph_Graph2->SetMinimum(310.0302);
   Graph_Graph2->SetMaximum(1183.652);
   Graph_Graph2->SetDirectory(0);
   Graph_Graph2->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph2->SetLineColor(ci);
   Graph_Graph2->GetXaxis()->SetLabelFont(42);
   Graph_Graph2->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetXaxis()->SetTitleFont(42);
   Graph_Graph2->GetYaxis()->SetLabelFont(42);
   Graph_Graph2->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetYaxis()->SetTitleFont(42);
   Graph_Graph2->GetZaxis()->SetLabelFont(42);
   Graph_Graph2->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph2);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx3[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy3[6] = {
   980.038,
   996.742,
   968.943,
   742.067,
   524.44,
   343.371};
   graph = new TGraph(6,Graph_fx3,Graph_fy3);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph3 = new TH1F("Graph_Graph3","Graph",100,0.9,1099.9);
   Graph_Graph3->SetMinimum(278.0339);
   Graph_Graph3->SetMaximum(1062.079);
   Graph_Graph3->SetDirectory(0);
   Graph_Graph3->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph3->SetLineColor(ci);
   Graph_Graph3->GetXaxis()->SetLabelFont(42);
   Graph_Graph3->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetXaxis()->SetTitleFont(42);
   Graph_Graph3->GetYaxis()->SetLabelFont(42);
   Graph_Graph3->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetYaxis()->SetTitleFont(42);
   Graph_Graph3->GetZaxis()->SetLabelFont(42);
   Graph_Graph3->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph3);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx4[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy4[6] = {
   881.525,
   896.549,
   871.907,
   667.806,
   471.744,
   308.777};
   graph = new TGraph(6,Graph_fx4,Graph_fy4);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   
   TH1F *Graph_Graph4 = new TH1F("Graph_Graph4","Graph",100,0.9,1099.9);
   Graph_Graph4->SetMinimum(249.9998);
   Graph_Graph4->SetMaximum(955.3262);
   Graph_Graph4->SetDirectory(0);
   Graph_Graph4->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph4->SetLineColor(ci);
   Graph_Graph4->GetXaxis()->SetLabelFont(42);
   Graph_Graph4->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetXaxis()->SetTitleFont(42);
   Graph_Graph4->GetYaxis()->SetLabelFont(42);
   Graph_Graph4->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetYaxis()->SetTitleFont(42);
   Graph_Graph4->GetZaxis()->SetLabelFont(42);
   Graph_Graph4->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph4);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx5[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy5[6] = {
   1028.6,
   1012.32,
   1016.7,
   751.989,
   524.44,
   360.443};
   graph = new TGraph(6,Graph_fx5,Graph_fy5);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph5 = new TH1F("Graph_Graph5","Graph",100,0.9,1099.9);
   Graph_Graph5->SetMinimum(293.6273);
   Graph_Graph5->SetMaximum(1095.416);
   Graph_Graph5->SetDirectory(0);
   Graph_Graph5->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph5->SetLineColor(ci);
   Graph_Graph5->GetXaxis()->SetLabelFont(42);
   Graph_Graph5->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetXaxis()->SetTitleFont(42);
   Graph_Graph5->GetYaxis()->SetLabelFont(42);
   Graph_Graph5->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetYaxis()->SetTitleFont(42);
   Graph_Graph5->GetZaxis()->SetLabelFont(42);
   Graph_Graph5->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph5);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx6[35] = {
   3.981,
   4.365,
   4.786,
   5.248,
   5.754,
   6.31,
   6.918,
   7.586,
   8.318,
   9.12,
   10,
   10.965,
   12.023,
   13.183,
   14.454,
   15.849,
   17.378,
   19.055,
   20.893,
   22.909,
   25.119,
   31.623,
   39.811,
   50.119,
   63.096,
   79.433,
   100,
   125.893,
   158.489,
   199.526,
   251.189,
   316.228,
   1000,
   3162.278,
   10000};
   Double_t Graph_fy6[35] = {
   19.76533,
   32.58338,
   47.96959,
   63.10164,
   79.00995,
   95.55754,
   111.9766,
   129.0118,
   146.2376,
   163.5577,
   179.3658,
   194.9584,
   209.5672,
   223.2999,
   236.0683,
   247.7404,
   258.366,
   268.0662,
   277.1383,
   285.1146,
   292.3901,
   306.3527,
   314.441,
   317.1059,
   314.8684,
   308.9039,
   300.2537,
   289.8022,
   278.2241,
   266.1082,
   253.7422,
   241.4337,
   184.6404,
   139.2985,
   104.656};
   graph = new TGraph(35,Graph_fx6,Graph_fy6);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#6666ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(6);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph6 = new TH1F("Graph_Graph6","Graph",100,3.5829,10999.6);
   Graph_Graph6->SetMinimum(17.78879);
   Graph_Graph6->SetMaximum(346.84);
   Graph_Graph6->SetDirectory(0);
   Graph_Graph6->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph6->SetLineColor(ci);
   Graph_Graph6->GetXaxis()->SetLabelFont(42);
   Graph_Graph6->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetXaxis()->SetTitleFont(42);
   Graph_Graph6->GetYaxis()->SetLabelFont(42);
   Graph_Graph6->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetYaxis()->SetTitleFont(42);
   Graph_Graph6->GetZaxis()->SetLabelFont(42);
   Graph_Graph6->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph6);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx7[33] = {
   5.050109,
   5.570498,
   6.092375,
   6.79836,
   7.629504,
   8.933253,
   10.64203,
   12.05014,
   13.68495,
   14.93901,
   17.1131,
   19.54765,
   22.0792,
   25.65551,
   29.39341,
   34.84152,
   41.41884,
   48.68491,
   59.2071,
   75.34994,
   97.26741,
   131.0246,
   163.9459,
   202.8261,
   243.2248,
   309.5828,
   383.0166,
   473.8718,
   622.2993,
   833.6,
   1028.448,
   1283.339,
   2026.806};
   Double_t Graph_fy7[33] = {
   71.77067,
   88.82209,
   110.1401,
   130.7052,
   154.2557,
   185.7482,
   213.1504,
   232.735,
   248.5277,
   258.1632,
   268.4587,
   280.1818,
   286.5229,
   293.3758,
   296.7995,
   299.6924,
   299.6947,
   297.0875,
   293.2892,
   285.6511,
   275.8293,
   262.4571,
   252.7364,
   243.3346,
   234.001,
   222.0121,
   212.1495,
   202.5032,
   189.9106,
   177.908,
   168.9168,
   159.7122,
   142.9221};
   graph = new TGraph(33,Graph_fx7,Graph_fy7);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff9900");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph7 = new TH1F("Graph_Graph7","Graph",100,4.545098,2228.982);
   Graph_Graph7->SetMinimum(48.97827);
   Graph_Graph7->SetMaximum(322.4871);
   Graph_Graph7->SetDirectory(0);
   Graph_Graph7->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph7->SetLineColor(ci);
   Graph_Graph7->GetXaxis()->SetLabelFont(42);
   Graph_Graph7->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetXaxis()->SetTitleFont(42);
   Graph_Graph7->GetYaxis()->SetLabelFont(42);
   Graph_Graph7->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetYaxis()->SetTitleFont(42);
   Graph_Graph7->GetZaxis()->SetLabelFont(42);
   Graph_Graph7->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph7);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx8[90] = {
   18.74425,
   19.90368,
   20.73627,
   21.82644,
   23.00752,
   24.07546,
   25.0827,
   25.71454,
   26.71212,
   27.99356,
   28.53122,
   29.59491,
   30.69819,
   31.93543,
   33.71249,
   35.53626,
   36.69926,
   39.48566,
   41.74415,
   44.52103,
   47.27444,
   49.54151,
   51.99283,
   54.56543,
   56.59926,
   59.57426,
   61.97591,
   64.94736,
   67.7638,
   72.165,
   77.52983,
   78.67276,
   79.25885,
   79.50015,
   79.8577,
   79.98559,
   80.10781,
   80.93361,
   82.97299,
   85.0636,
   87.3346,
   89.6657,
   93.68976,
   97.60831,
   101.0972,
   103.4923,
   107.3498,
   111.0254,
   114.4909,
   118.2376,
   120.3333,
   131.3772,
   140.9375,
   145.9754,
   148.1289,
   150.9739,
   154.3249,
   158.6761,
   165.3121,
   170.7206,
   172.2259,
   173.4824,
   174.2374,
   175.2489,
   175.7591,
   179.6599,
   186.3538,
   196.4347,
   207.6675,
   217.3037,
   228.0541,
   241.4457,
   256.7473,
   271.0309,
   292.4573,
   319.2919,
   352.6953,
   387.3116,
   421.6106,
   459.6163,
   505.4719,
   563.2603,
   635.9718,
   692.2802,
   745.897,
   789.6904,
   831.1771,
   886.4295,
   950.901,
   983.4362};
   Double_t Graph_fy8[90] = {
   190.042,
   192.3104,
   192.9376,
   195.179,
   197.2136,
   198.0799,
   199.3876,
   199.4802,
   201.01,
   204.4632,
   204.529,
   206.7971,
   208.8441,
   208.9712,
   209.8662,
   210.2649,
   211.3333,
   212.7612,
   214.3898,
   216.0449,
   217.1898,
   218.8107,
   219.1693,
   219.524,
   220.873,
   221.9988,
   223.3628,
   223.7069,
   225.3419,
   225.4478,
   225.5616,
   225.584,
   239.8787,
   256.2561,
   271.2293,
   293.7999,
   304.8973,
   307.0445,
   308.5203,
   309.6434,
   310.7722,
   310.8221,
   310.5429,
   310.2559,
   309.9569,
   309.996,
   311.8566,
   313.3588,
   314.1336,
   315.2763,
   316.7668,
   317.2607,
   317.3559,
   317.4016,
   319.264,
   319.2881,
   319.6855,
   319.7195,
   318.6591,
   318.3273,
   317.9688,
   309.2591,
   300.7849,
   289.5104,
   286.1793,
   286.2011,
   285.5743,
   285.6238,
   285.3433,
   284.0635,
   283.1184,
   281.2031,
   278.656,
   277.7288,
   275.8579,
   273.0541,
   270.9095,
   265.6796,
   261.7535,
   256.9895,
   253.7797,
   247.4406,
   240.1473,
   234.4071,
   229.3303,
   226.7081,
   224.3734,
   220.2731,
   215.7486,
   213.7682};
   graph = new TGraph(90,Graph_fx8,Graph_fy8);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#cc33ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(6);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph8 = new TH1F("Graph_Graph8","Graph",100,16.86982,1079.905);
   Graph_Graph8->SetMinimum(177.0742);
   Graph_Graph8->SetMaximum(332.6873);
   Graph_Graph8->SetDirectory(0);
   Graph_Graph8->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph8->SetLineColor(ci);
   Graph_Graph8->GetXaxis()->SetLabelFont(42);
   Graph_Graph8->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetXaxis()->SetTitleFont(42);
   Graph_Graph8->GetYaxis()->SetLabelFont(42);
   Graph_Graph8->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetYaxis()->SetTitleFont(42);
   Graph_Graph8->GetZaxis()->SetLabelFont(42);
   Graph_Graph8->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph8);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx9[5] = {
   250,
   500,
   1000,
   3000,
   5000};
   Double_t Graph_fy9[5] = {
   597.2217,
   587.5585,
   450.4588,
   245.3363,
   177.6733};
   graph = new TGraph(5,Graph_fx9,Graph_fy9);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#3399ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(4);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph9 = new TH1F("Graph_Graph9","Graph",100,225,5475);
   Graph_Graph9->SetMinimum(135.7185);
   Graph_Graph9->SetMaximum(639.1765);
   Graph_Graph9->SetDirectory(0);
   Graph_Graph9->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph9->SetLineColor(ci);
   Graph_Graph9->GetXaxis()->SetLabelFont(42);
   Graph_Graph9->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetXaxis()->SetTitleFont(42);
   Graph_Graph9->GetYaxis()->SetLabelFont(42);
   Graph_Graph9->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetYaxis()->SetTitleFont(42);
   Graph_Graph9->GetZaxis()->SetLabelFont(42);
   Graph_Graph9->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph9);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx10[518] = {
   6.04,
   6.04,
   6.04,
   6.04,
   6.05,
   6.08,
   6.11,
   6.12,
   6.12,
   6.13,
   6.16,
   6.16,
   6.16,
   6.19,
   6.2,
   6.2,
   6.2,
   6.21,
   6.24,
   6.27,
   6.28,
   6.28,
   6.28,
   6.28,
   6.28,
   6.29,
   6.34,
   6.37,
   6.37,
   6.37,
   6.37,
   6.37,
   6.38,
   6.43,
   6.45,
   6.45,
   6.45,
   6.45,
   6.45,
   6.45,
   6.46,
   6.53,
   6.54,
   6.54,
   6.54,
   6.54,
   6.54,
   6.54,
   6.62,
   6.62,
   6.62,
   6.62,
   6.62,
   6.62,
   6.64,
   6.69,
   6.71,
   6.71,
   6.71,
   6.71,
   6.71,
   6.72,
   6.78,
   6.8,
   6.8,
   6.8,
   6.8,
   6.8,
   6.81,
   6.87,
   6.89,
   6.89,
   6.89,
   6.89,
   6.89,
   6.91,
   6.94,
   6.97,
   6.98,
   6.98,
   7,
   7.05,
   7.08,
   7.09,
   7.15,
   7.17,
   7.19,
   7.24,
   7.27,
   7.28,
   7.34,
   7.37,
   7.37,
   7.45,
   7.46,
   7.47,
   7.55,
   7.56,
   7.57,
   7.65,
   7.66,
   7.67,
   7.76,
   7.77,
   7.77,
   7.86,
   7.88,
   7.95,
   7.99,
   8.05,
   8.1,
   8.15,
   8.19,
   8.24,
   8.27,
   8.31,
   8.38,
   8.43,
   8.48,
   8.52,
   8.58,
   8.61,
   8.65,
   8.71,
   8.75,
   8.81,
   8.84,
   8.88,
   8.93,
   8.97,
   9,
   9.05,
   9.12,
   9.17,
   9.24,
   9.29,
   9.36,
   9.42,
   9.49,
   9.54,
   9.62,
   9.67,
   9.74,
   9.8,
   9.87,
   9.93,
   10,
   10.2,
   10.3,
   10.5,
   10.6,
   10.8,
   10.9,
   10.9,
   11,
   11.2,
   11.2,
   11.3,
   11.5,
   11.6,
   11.8,
   11.9,
   12.1,
   12.2,
   12.4,
   12.6,
   12.7,
   12.9,
   13.1,
   13.3,
   13.5,
   13.5,
   13.6,
   13.8,
   14,
   14.2,
   14.4,
   14.5,
   14.5,
   14.8,
   15,
   15.2,
   15.3,
   15.3,
   15.6,
   15.8,
   15.9,
   16,
   16.2,
   16.5,
   16.6,
   16.9,
   17.2,
   17.3,
   17.6,
   17.9,
   18,
   18.3,
   18.6,
   18.7,
   19,
   19.3,
   19.4,
   19.5,
   19.8,
   20.6,
   21.4,
   21.8,
   22,
   22.2,
   22.6,
   22.9,
   23.2,
   23.5,
   23.8,
   24.1,
   24.5,
   24.8,
   25.1,
   25.5,
   25.8,
   26.1,
   26.5,
   26.8,
   27.2,
   27.6,
   28.1,
   28.7,
   29.1,
   29.4,
   29.8,
   30.8,
   31.7,
   32.4,
   32.9,
   34.2,
   35.3,
   35.8,
   36.4,
   36.9,
   37.4,
   38.3,
   38.9,
   39.4,
   40.4,
   41,
   41.6,
   42.6,
   43.2,
   43.8,
   44.4,
   45,
   45.6,
   46.2,
   46.8,
   47.5,
   48.1,
   48.7,
   49.4,
   50.1,
   50.7,
   51.4,
   52.1,
   53.3,
   54.8,
   55.7,
   56.4,
   57.2,
   57.9,
   58.7,
   59.5,
   60.3,
   61.1,
   61.9,
   62.7,
   63.5,
   64.4,
   65.3,
   66.3,
   67.6,
   68.8,
   69.7,
   70.7,
   71.6,
   72.8,
   74.2,
   75.5,
   76.5,
   77.5,
   78.8,
   80.3,
   81.8,
   82.8,
   84,
   85.1,
   86.4,
   88.2,
   89.7,
   90.9,
   92.1,
   93.6,
   95.5,
   97.1,
   98.4,
   100,
   102,
   104,
   105,
   108,
   110,
   112,
   114,
   115,
   118,
   120,
   122,
   124,
   127,
   130,
   132,
   134,
   137,
   139,
   142,
   145,
   147,
   150,
   152,
   155,
   157,
   161,
   164,
   167,
   170,
   173,
   176,
   179,
   182,
   187,
   190,
   194,
   197,
   200,
   205,
   208,
   213,
   216,
   222,
   225,
   231,
   234,
   240,
   244,
   253,
   262,
   267,
   272,
   278,
   283,
   289,
   295,
   301,
   307,
   312,
   317,
   323,
   329,
   334,
   341,
   347,
   353,
   358,
   367,
   374,
   381,
   387,
   395,
   403,
   411,
   419,
   427,
   436,
   445,
   454,
   463,
   475,
   485,
   494,
   504,
   514,
   528,
   545,
   564,
   583,
   603,
   615,
   628,
   639,
   649,
   662,
   675,
   689,
   701,
   712,
   726,
   741,
   756,
   771,
   786,
   802,
   818,
   833,
   846,
   863,
   878,
   892,
   910,
   935,
   964,
   992,
   1030,
   1050,
   1070,
   1090,
   1110,
   1150,
   1190,
   1210,
   1230,
   1260,
   1280,
   1310,
   1340,
   1370,
   1400,
   1430,
   1460,
   1490,
   1520,
   1550,
   1600,
   1650,
   1690,
   1720,
   1750,
   1790,
   1850,
   1910,
   1950,
   1990,
   2030,
   2070,
   2130,
   2170,
   2210,
   2260,
   2300,
   2370,
   2410,
   2460,
   2540,
   2630,
   2680,
   2730,
   2820,
   2920,
   3020,
   3120,
   3190,
   3240,
   3320,
   3370,
   3490,
   3610,
   3690,
   3750,
   3880,
   4020,
   4100,
   4180,
   4270,
   4350,
   4440,
   4530,
   4620,
   4690,
   4810,
   4880,
   5000,
   5080,
   5200,
   5310,
   5420,
   5520,
   5640,
   5750,
   5860,
   5980,
   6100,
   6220,
   6330,
   6440,
   6560,
   6700,
   6830,
   7050,
   7300,
   7450,
   7590,
   7840,
   8110,
   8380,
   8670,
   8850,
   8990,
   9210,
   9390,
   9610};
   Double_t Graph_fy10[518] = {
   10.38676,
   10.50231,
   10.59957,
   10.7015,
   10.89364,
   11.07546,
   11.20647,
   11.30821,
   11.41342,
   11.62109,
   11.82995,
   11.96215,
   12.07818,
   12.17911,
   12.30743,
   12.414,
   12.52534,
   12.76538,
   12.97118,
   13.12865,
   13.25128,
   13.37442,
   13.49524,
   13.62174,
   13.74534,
   13.99711,
   14.24146,
   14.40622,
   14.54013,
   14.67427,
   14.8083,
   14.94868,
   15.22224,
   15.47959,
   15.6669,
   15.80805,
   15.95581,
   16.10083,
   16.2527,
   16.40114,
   16.65049,
   17.00656,
   17.18103,
   17.34867,
   17.50979,
   17.663,
   17.82315,
   18.09534,
   18.48112,
   18.68225,
   18.85134,
   19.02836,
   19.21403,
   19.38419,
   19.72512,
   20.07365,
   20.32073,
   20.51337,
   20.68111,
   20.89181,
   21.0759,
   21.47197,
   21.82747,
   22.10836,
   22.30316,
   22.50687,
   22.72023,
   22.88709,
   23.32871,
   23.73763,
   24.00677,
   24.23435,
   24.45738,
   24.68282,
   24.91041,
   25.36578,
   25.78503,
   26.09729,
   26.34398,
   26.58842,
   27.06598,
   27.53896,
   27.86668,
   28.37133,
   28.86478,
   29.20029,
   29.71859,
   30.24769,
   30.60227,
   31.15273,
   31.68307,
   32.06927,
   32.5362,
   33.23597,
   33.60661,
   34.0793,
   34.82676,
   35.19988,
   35.69491,
   36.46783,
   36.87798,
   37.44003,
   38.20997,
   38.65276,
   39.20006,
   40.07932,
   40.8414,
   41.55343,
   42.4036,
   43.14178,
   44.02907,
   44.76045,
   45.25133,
   46.05417,
   46.59723,
   47.07559,
   47.84267,
   48.80958,
   49.64402,
   50.16063,
   51.06094,
   51.65136,
   52.17979,
   52.98822,
   53.58735,
   54.51024,
   55.15295,
   55.7454,
   56.61769,
   57.29215,
   57.83828,
   58.59123,
   59.58957,
   60.25911,
   61.2608,
   61.9507,
   63.01658,
   63.72388,
   64.8542,
   65.56339,
   66.64773,
   67.45883,
   68.57788,
   69.38042,
   70.52167,
   71.44279,
   73.10832,
   74.86664,
   76.70132,
   78.48531,
   80.39639,
   82.27539,
   83.96915,
   84.81317,
   86.19446,
   88.02168,
   88.90821,
   90.11315,
   92.12023,
   94.32802,
   96.50886,
   98.84577,
   100.8332,
   102.8086,
   104.7116,
   106.793,
   108.8109,
   110.7898,
   112.9515,
   115.1677,
   117.0762,
   118.1521,
   119.1161,
   120.7506,
   122.937,
   125.5722,
   127.4196,
   128.5312,
   129.6638,
   131.542,
   134.0308,
   136.1693,
   137.3979,
   138.4952,
   140.691,
   142.7079,
   144.0108,
   145.2215,
   146.8251,
   149.5702,
   150.7827,
   152.4733,
   155.2857,
   156.5944,
   158.387,
   161.2726,
   162.6707,
   164.4505,
   167.5191,
   168.8856,
   170.7937,
   172.6887,
   174.1507,
   175.4199,
   177.3078,
   182.9573,
   187.7626,
   189.8365,
   190.4369,
   191.0454,
   193.294,
   195.0114,
   196.8028,
   198.6746,
   200.6337,
   202.4317,
   204.8624,
   205.4538,
   206.0518,
   208.4005,
   210.5569,
   212.4997,
   214.5452,
   216.3183,
   218.547,
   220.4993,
   222.5493,
   224.7033,
   226.9325,
   229.2592,
   231.2259,
   233.3437,
   236.0739,
   236.692,
   237.8515,
   240.2765,
   242.669,
   242.8986,
   243.7,
   244.4396,
   245.1237,
   245.324,
   246.1552,
   246.9239,
   247.738,
   248.6028,
   249.34,
   250.183,
   251.0113,
   251.7779,
   252.4054,
   252.4402,
   252.4741,
   252.5072,
   252.5394,
   252.576,
   252.6065,
   251.8236,
   251.565,
   251.5977,
   251.9175,
   252.7618,
   252.7922,
   253.0667,
   254.0334,
   254.1442,
   254.1704,
   254.1995,
   254.2243,
   254.2519,
   254.2788,
   254.305,
   254.3305,
   254.3554,
   254.3796,
   254.4032,
   254.4291,
   254.4543,
   254.2526,
   253.4561,
   253.3367,
   253.3588,
   252.5675,
   252.295,
   252.1031,
   251.2675,
   251.223,
   250.3929,
   250.0624,
   249.8782,
   249.0786,
   249.0366,
   248.174,
   247.9263,
   247.944,
   247.6981,
   246.9351,
   246.8915,
   246.9084,
   246.0196,
   245.5296,
   244.7362,
   244.6935,
   243.8445,
   243.6187,
   242.4377,
   241.8683,
   241.295,
   240.1783,
   239.0772,
   238.001,
   237.4805,
   236.957,
   236.4553,
   236.9969,
   237.012,
   234.4527,
   232.994,
   232.0529,
   231.124,
   230.6725,
   229.7764,
   228.8918,
   227.5962,
   226.7575,
   226.3463,
   225.53,
   224.7235,
   224.3345,
   223.5489,
   222.4,
   221.6514,
   220.9151,
   220.5568,
   219.4781,
   218.4252,
   218.4349,
   217.4066,
   216.4078,
   215.7535,
   214.7888,
   214.4764,
   213.537,
   212.6227,
   211.7229,
   210.5545,
   209.6973,
   208.5851,
   207.767,
   206.7044,
   205.9222,
   204.9054,
   204.1581,
   202.7048,
   200.6119,
   199.4946,
   198.6241,
   197.7734,
   196.9394,
   195.9209,
   195.126,
   194.1531,
   193.393,
   192.6467,
   192.2811,
   191.5566,
   190.8456,
   190.4965,
   189.8054,
   189.1259,
   188.7928,
   187.9657,
   186.9986,
   186.3681,
   185.748,
   185.29,
   184.688,
   183.8008,
   183.0782,
   182.0883,
   181.3984,
   180.4531,
   179.6626,
   178.8891,
   178.132,
   176.4223,
   175.5989,
   174.7941,
   174.0077,
   173.2387,
   171.644,
   170.3208,
   168.5686,
   167.267,
   165.4898,
   164.7208,
   163.9695,
   163.8889,
   163.1556,
   162.5181,
   161.6606,
   160.976,
   160.9779,
   160.2332,
   159.5059,
   158.7245,
   158.0995,
   157.2843,
   156.6211,
   155.8431,
   155.2095,
   155.1483,
   154.4668,
   153.8004,
   153.7418,
   153.0319,
   152.3957,
   150.9962,
   149.8166,
   148.4291,
   146.8649,
   146.1595,
   145.5618,
   144.8424,
   144.2273,
   143.077,
   141.5716,
   140.9059,
   140.2935,
   139.6204,
   138.999,
   138.3208,
   137.7278,
   136.5779,
   135.9239,
   135.2852,
   134.6612,
   134.0513,
   133.455,
   132.8717,
   131.7421,
   130.3946,
   129.6185,
   129.1138,
   128.6188,
   127.8935,
   126.9576,
   125.6149,
   124.9697,
   124.5488,
   123.9302,
   123.3267,
   122.1621,
   121.6,
   121.0507,
   120.5136,
   119.9882,
   118.9705,
   118.3154,
   117.8359,
   116.905,
   115.7187,
   115.1476,
   114.5904,
   113.7792,
   112.4881,
   111.6267,
   110.4508,
   109.8856,
   109.4437,
   108.7971,
   108.3764,
   107.6595,
   106.4832,
   106.0117,
   105.4593,
   104.657,
   103.6329,
   103.0581,
   102.6571,
   102.1086,
   101.7257,
   101.2013,
   100.7625,
   100.2622,
   99.77413,
   99.29779,
   98.89833,
   98.37802,
   97.9966,
   97.43805,
   97.13459,
   96.65859,
   96.25151,
   95.79658,
   95.35219,
   94.91791,
   94.49337,
   94.02686,
   93.6217,
   93.27425,
   93.07861,
   92.78892,
   92.31587,
   91.94598,
   91.2278,
   90.24254,
   89.78968,
   89.42747,
   88.72436,
   87.79184,
   87.11485,
   86.19591,
   85.77034,
   85.35504,
   84.91885,
   84.61402,
   84.25532};
   graph = new TGraph(518,Graph_fx10,Graph_fy10);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#66ccff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(5);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph10 = new TH1F("Graph_Graph10","Graph",518,5.436,10570.4);
   Graph_Graph10->SetMinimum(9.348083);
   Graph_Graph10->SetMaximum(278.861);
   Graph_Graph10->SetDirectory(0);
   Graph_Graph10->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph10->SetLineColor(ci);
   Graph_Graph10->GetXaxis()->SetLabelFont(42);
   Graph_Graph10->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetXaxis()->SetTitleFont(42);
   Graph_Graph10->GetYaxis()->SetLabelFont(42);
   Graph_Graph10->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetYaxis()->SetTitleFont(42);
   Graph_Graph10->GetZaxis()->SetLabelFont(42);
   Graph_Graph10->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph10);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx11[35] = {
   3.98,
   4.37,
   4.79,
   5.25,
   5.75,
   6.31,
   6.92,
   7.59,
   8.32,
   9.12,
   10,
   10.96,
   12.02,
   13.18,
   14.45,
   15.85,
   17.38,
   19.05,
   20.89,
   22.91,
   25.12,
   31.62,
   39.81,
   50.12,
   63.1,
   79.43,
   100,
   125.89,
   158.49,
   199.53,
   251.19,
   316.23,
   1000,
   3162.3,
   10000};
   Double_t Graph_fy11[35] = {
   64.47703,
   92.96188,
   120.9916,
   144.7661,
   171.1873,
   194.8983,
   219.9867,
   244.5213,
   267.5613,
   289.6608,
   311.7509,
   330.2783,
   345.9273,
   362.605,
   376.5173,
   387.5872,
   398.0475,
   406.9399,
   414.3522,
   421.5604,
   426.3119,
   433.1181,
   435.0014,
   429.503,
   421.4079,
   411.5566,
   398.3919,
   383.7713,
   369.2768,
   352.1727,
   335.9504,
   319.8066,
   245.9105,
   185.1913,
   139.1868};
   graph = new TGraph(35,Graph_fx11,Graph_fy11);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#66cc66");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph11 = new TH1F("Graph_Graph11","Graph",100,3.582,10999.6);
   Graph_Graph11->SetMinimum(27.4246);
   Graph_Graph11->SetMaximum(472.0538);
   Graph_Graph11->SetDirectory(0);
   Graph_Graph11->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph11->SetLineColor(ci);
   Graph_Graph11->GetXaxis()->SetLabelFont(42);
   Graph_Graph11->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetXaxis()->SetTitleFont(42);
   Graph_Graph11->GetYaxis()->SetLabelFont(42);
   Graph_Graph11->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetYaxis()->SetTitleFont(42);
   Graph_Graph11->GetZaxis()->SetLabelFont(42);
   Graph_Graph11->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph11);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx12[35] = {
   4,
   5,
   6,
   7,
   8,
   9,
   10,
   12,
   14,
   16,
   18,
   20,
   24,
   28,
   32,
   36,
   40,
   44,
   48,
   52,
   56,
   60,
   65,
   70,
   75,
   80,
   85,
   90,
   95,
   100,
   150,
   200,
   300,
   400,
   500};
   Double_t Graph_fy12[35] = {
   91.75045,
   115.9467,
   132.4599,
   144.0692,
   152.856,
   159.9043,
   165.4462,
   172.653,
   177.2831,
   179.5654,
   180.8904,
   181.5836,
   181.5776,
   181.2419,
   178.737,
   176.8406,
   175.2212,
   173.4303,
   171.2294,
   169.3498,
   167.5194,
   165.3283,
   163.1921,
   161.2337,
   159.198,
   157.2876,
   155.7156,
   153.813,
   152.3262,
   150.9621,
   138.5165,
   129.9907,
   118.4184,
   110.7202,
   104.9163};
   graph = new TGraph(35,Graph_fx12,Graph_fy12);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#333399");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph12 = new TH1F("Graph_Graph12","Graph",100,3.6,549.6);
   Graph_Graph12->SetMinimum(82.76714);
   Graph_Graph12->SetMaximum(190.5669);
   Graph_Graph12->SetDirectory(0);
   Graph_Graph12->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph12->SetLineColor(ci);
   Graph_Graph12->GetXaxis()->SetLabelFont(42);
   Graph_Graph12->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetXaxis()->SetTitleFont(42);
   Graph_Graph12->GetYaxis()->SetLabelFont(42);
   Graph_Graph12->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetYaxis()->SetTitleFont(42);
   Graph_Graph12->GetZaxis()->SetLabelFont(42);
   Graph_Graph12->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph12);
   
   multigraph->Add(graph,"");
   multigraph->Draw("L");
   
   TLegend *leg = new TLegend(0.16,0.61,0.5,0.85,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.03);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("NULL","Razor-0#mu 90% CL limit: AV EFT operator","h");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Expected limit, with uncertainty","lf");

   ci = TColor::GetColor("#ffcc00");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);

   ci = TColor::GetColor("#ff6666");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Observed limit","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   
   leg = new TLegend(0.67,0.61,0.92,0.9,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.03);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("Graph","IceCube W^{+}W^{-}","l");

   ci = TColor::GetColor("#3399ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(4);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","COUPP 2012","l");

   ci = TColor::GetColor("#6666ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(6);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","SIMPLE 2012","l");

   ci = TColor::GetColor("#ff9900");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Super-K W^{+}W^{-}","l");

   ci = TColor::GetColor("#cc33ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(6);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","XENON 100","l");

   ci = TColor::GetColor("#66ccff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(5);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","PICO","l");

   ci = TColor::GetColor("#66cc66");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","PICASSO","l");

   ci = TColor::GetColor("#333399");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   TLatex *   tex = new TLatex(0.955,0.945,"18.8 fb^{-1} (8 TeV)");
tex->SetNDC();
   tex->SetTextAlign(31);
   tex->SetTextFont(42);
   tex->SetTextSize(0.045);
   tex->SetLineWidth(2);
   tex->Draw();
      tex = new TLatex(0.245,0.865,"CMS");
tex->SetNDC();
   tex->SetTextAlign(31);
   tex->SetTextFont(61);
   tex->SetTextSize(0.045);
   tex->SetLineWidth(2);
   tex->Draw();
   
   TH1F *_copy__1 = new TH1F("_copy__1","",100,0.9,1049.95);
   _copy__1->SetMinimum(100);
   _copy__1->SetMaximum(2000000);
   _copy__1->SetDirectory(0);
   _copy__1->SetStats(0);

   ci = TColor::GetColor("#000099");
   _copy__1->SetLineColor(ci);
   _copy__1->GetXaxis()->SetTitle("M_{#chi} (GeV)");
   _copy__1->GetXaxis()->SetRange(0,96);
   _copy__1->GetXaxis()->SetLabelFont(42);
   _copy__1->GetXaxis()->SetTitleSize(0.05);
   _copy__1->GetXaxis()->SetTitleOffset(1.1);
   _copy__1->GetXaxis()->SetTitleFont(42);
   _copy__1->GetYaxis()->SetTitle("#Lambda (GeV)");
   _copy__1->GetYaxis()->SetLabelFont(42);
   _copy__1->GetYaxis()->SetTitleSize(0.05);
   _copy__1->GetYaxis()->SetTitleOffset(1.05);
   _copy__1->GetYaxis()->SetTitleFont(42);
   _copy__1->GetZaxis()->SetLabelFont(42);
   _copy__1->GetZaxis()->SetLabelSize(0.035);
   _copy__1->GetZaxis()->SetTitleSize(0.035);
   _copy__1->GetZaxis()->SetTitleFont(42);
   _copy__1->Draw("sameaxis");
   c->Modified();
   c->cd();
   c->SetSelected(c);
}
Ejemplo n.º 29
0
void fit7_testbkg_withtail()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Thu Mar 10 20:15:02 2016) by ROOT version6.06/00
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(3754.321,-26.4,6223.457,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_49a73f0__1 = new TH1D("frame_49a73f0__1","",100,4100,6100);
   frame_49a73f0__1->SetBinContent(1,1.814401);
   frame_49a73f0__1->SetMinimum(-8.8);
   frame_49a73f0__1->SetMaximum(8.8);
   frame_49a73f0__1->SetEntries(1);
   frame_49a73f0__1->SetDirectory(0);
   frame_49a73f0__1->SetStats(0);
   frame_49a73f0__1->SetLineWidth(2);
   frame_49a73f0__1->SetMarkerStyle(20);
   frame_49a73f0__1->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_49a73f0__1->GetXaxis()->SetNdivisions(505);
   frame_49a73f0__1->GetXaxis()->SetLabelFont(132);
   frame_49a73f0__1->GetXaxis()->SetLabelOffset(0.01);
   frame_49a73f0__1->GetXaxis()->SetLabelSize(0.15);
   frame_49a73f0__1->GetXaxis()->SetTitleSize(0.2);
   frame_49a73f0__1->GetXaxis()->SetTitleOffset(1.1);
   frame_49a73f0__1->GetXaxis()->SetTitleFont(132);
   frame_49a73f0__1->GetYaxis()->SetTitle("Pull");
   frame_49a73f0__1->GetYaxis()->CenterTitle(true);
   frame_49a73f0__1->GetYaxis()->SetNdivisions(505);
   frame_49a73f0__1->GetYaxis()->SetLabelFont(132);
   frame_49a73f0__1->GetYaxis()->SetLabelOffset(0.01);
   frame_49a73f0__1->GetYaxis()->SetLabelSize(0.15);
   frame_49a73f0__1->GetYaxis()->SetTitleSize(0.15);
   frame_49a73f0__1->GetYaxis()->SetTitleOffset(0.45);
   frame_49a73f0__1->GetYaxis()->SetTitleFont(132);
   frame_49a73f0__1->GetZaxis()->SetLabelFont(132);
   frame_49a73f0__1->GetZaxis()->SetLabelSize(0.06);
   frame_49a73f0__1->GetZaxis()->SetTitleSize(0.072);
   frame_49a73f0__1->GetZaxis()->SetTitleOffset(1.2);
   frame_49a73f0__1->GetZaxis()->SetTitleFont(132);
   frame_49a73f0__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[5] = {
   5950,
   5970,
   5990,
   6010,
   6030};
   Double_t pull_Hist_curvetot_fy3001[5] = {
   -0.7070745,
   0.407049,
   0.6467117,
   -0.3394017,
   -0.6307982};
   Double_t pull_Hist_curvetot_felx3001[5] = {
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[5] = {
   1,
   1,
   1,
   1,
   1};
   Double_t pull_Hist_curvetot_fehx3001[5] = {
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[5] = {
   1,
   1,
   1,
   1,
   1};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(5,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of data_plot__Bs_LOKI_MASS_JpsiConstr and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of data_plot__Bs_LOKI_MASS_JpsiConstr and Projection of totalPdf",100,5942,6038);
   Graph_pull_Hist_curvetot3001->SetMinimum(-2.042453);
   Graph_pull_Hist_curvetot3001->SetMaximum(1.98209);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_49a73f0__2 = new TH1D("frame_49a73f0__2","",100,4100,6100);
   frame_49a73f0__2->SetBinContent(1,1.814401);
   frame_49a73f0__2->SetMinimum(-8.8);
   frame_49a73f0__2->SetMaximum(8.8);
   frame_49a73f0__2->SetEntries(1);
   frame_49a73f0__2->SetDirectory(0);
   frame_49a73f0__2->SetStats(0);
   frame_49a73f0__2->SetLineWidth(2);
   frame_49a73f0__2->SetMarkerStyle(20);
   frame_49a73f0__2->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_49a73f0__2->GetXaxis()->SetNdivisions(505);
   frame_49a73f0__2->GetXaxis()->SetLabelFont(132);
   frame_49a73f0__2->GetXaxis()->SetLabelOffset(0.01);
   frame_49a73f0__2->GetXaxis()->SetLabelSize(0.15);
   frame_49a73f0__2->GetXaxis()->SetTitleSize(0.2);
   frame_49a73f0__2->GetXaxis()->SetTitleOffset(1.1);
   frame_49a73f0__2->GetXaxis()->SetTitleFont(132);
   frame_49a73f0__2->GetYaxis()->SetTitle("Pull");
   frame_49a73f0__2->GetYaxis()->CenterTitle(true);
   frame_49a73f0__2->GetYaxis()->SetNdivisions(505);
   frame_49a73f0__2->GetYaxis()->SetLabelFont(132);
   frame_49a73f0__2->GetYaxis()->SetLabelOffset(0.01);
   frame_49a73f0__2->GetYaxis()->SetLabelSize(0.15);
   frame_49a73f0__2->GetYaxis()->SetTitleSize(0.15);
   frame_49a73f0__2->GetYaxis()->SetTitleOffset(0.45);
   frame_49a73f0__2->GetYaxis()->SetTitleFont(132);
   frame_49a73f0__2->GetZaxis()->SetLabelFont(132);
   frame_49a73f0__2->GetZaxis()->SetLabelSize(0.06);
   frame_49a73f0__2->GetZaxis()->SetTitleSize(0.072);
   frame_49a73f0__2->GetZaxis()->SetTitleOffset(1.2);
   frame_49a73f0__2->GetZaxis()->SetTitleFont(132);
   frame_49a73f0__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(3754.321,0,6223.457,3.935074);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetLogy();
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_4a4d3a0__3 = new TH1D("frame_4a4d3a0__3","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_4a4d3a0__3->SetBinContent(1,2612.806);
   frame_4a4d3a0__3->SetMinimum(1);
   frame_4a4d3a0__3->SetMaximum(5000);
   frame_4a4d3a0__3->SetEntries(1);
   frame_4a4d3a0__3->SetDirectory(0);
   frame_4a4d3a0__3->SetStats(0);
   frame_4a4d3a0__3->SetLineWidth(2);
   frame_4a4d3a0__3->SetMarkerStyle(20);
   frame_4a4d3a0__3->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_4a4d3a0__3->GetXaxis()->SetNdivisions(505);
   frame_4a4d3a0__3->GetXaxis()->SetLabelFont(132);
   frame_4a4d3a0__3->GetXaxis()->SetLabelOffset(0.01);
   frame_4a4d3a0__3->GetXaxis()->SetLabelSize(0.06);
   frame_4a4d3a0__3->GetXaxis()->SetTitleSize(0.072);
   frame_4a4d3a0__3->GetXaxis()->SetTitleOffset(0.95);
   frame_4a4d3a0__3->GetXaxis()->SetTitleFont(132);
   frame_4a4d3a0__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4a4d3a0__3->GetYaxis()->SetLabelFont(132);
   frame_4a4d3a0__3->GetYaxis()->SetLabelOffset(0.01);
   frame_4a4d3a0__3->GetYaxis()->SetLabelSize(0.06);
   frame_4a4d3a0__3->GetYaxis()->SetTitleSize(0.072);
   frame_4a4d3a0__3->GetYaxis()->SetTitleOffset(0.95);
   frame_4a4d3a0__3->GetYaxis()->SetTitleFont(132);
   frame_4a4d3a0__3->GetZaxis()->SetLabelFont(132);
   frame_4a4d3a0__3->GetZaxis()->SetLabelSize(0.06);
   frame_4a4d3a0__3->GetZaxis()->SetTitleSize(0.072);
   frame_4a4d3a0__3->GetZaxis()->SetTitleOffset(1.2);
   frame_4a4d3a0__3->GetZaxis()->SetTitleFont(132);
   frame_4a4d3a0__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   4110,
   4130,
   4150,
   4170,
   4190,
   4210,
   4230,
   4250,
   4270,
   4290,
   4310,
   4330,
   4350,
   4370,
   4390,
   4410,
   4430,
   4450,
   4470,
   4490,
   4510,
   4530,
   4550,
   4570,
   4590,
   4610,
   4630,
   4650,
   4670,
   4690,
   4710,
   4730,
   4750,
   4770,
   4790,
   4810,
   4830,
   4850,
   4870,
   4890,
   4910,
   4930,
   4950,
   4970,
   4990,
   5010,
   5030,
   5050,
   5070,
   5090,
   5110,
   5130,
   5150,
   5170,
   5190,
   5210,
   5230,
   5250,
   5270,
   5290,
   5310,
   5330,
   5350,
   5370,
   5390,
   5410,
   5430,
   5450,
   5470,
   5490,
   5510,
   5530,
   5550,
   5570,
   5590,
   5610,
   5630,
   5650,
   5670,
   5690,
   5710,
   5730,
   5750,
   5770,
   5790,
   5810,
   5830,
   5850,
   5870,
   5890,
   5910,
   5930,
   5950,
   5970,
   5990,
   6010,
   6030,
   6050,
   6070,
   6090};
   Double_t Hist_fy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   25,
   123,
   153,
   163,
   161,
   157,
   176,
   121,
   130,
   136,
   136,
   130,
   106,
   122,
   105,
   107,
   104,
   100,
   107,
   105,
   92,
   93,
   88,
   115,
   88,
   88,
   108,
   101,
   116,
   85,
   109,
   95,
   68,
   99,
   102,
   127,
   137,
   141,
   166,
   163,
   184,
   182,
   166,
   137,
   112,
   116,
   87,
   92,
   82,
   81,
   118,
   84,
   82,
   81,
   83,
   79,
   62,
   60,
   30,
   27,
   40,
   28,
   31,
   33,
   24,
   26,
   36,
   46,
   69,
   157,
   1925,
   2439,
   191,
   42,
   24,
   14,
   16,
   9,
   11,
   19,
   9,
   11,
   12,
   7,
   12,
   10,
   7,
   5,
   7,
   7,
   4,
   3,
   0,
   0,
   0};
   Double_t Hist_felx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fely3002[100] = {
   0,
   0,
   0,
   0,
   0,
   5,
   11.09054,
   12.36932,
   12.76715,
   12.68858,
   12.52996,
   13.2665,
   11,
   11.40175,
   11.6619,
   11.6619,
   11.40175,
   10.29563,
   11.04536,
   10.24695,
   10.34408,
   10.19804,
   10,
   10.34408,
   10.24695,
   9.591663,
   9.643651,
   9.380832,
   10.72381,
   9.380832,
   9.380832,
   10.3923,
   10.04988,
   10.77033,
   9.219544,
   10.44031,
   9.746794,
   8.246211,
   9.949874,
   10.0995,
   11.26943,
   11.7047,
   11.87434,
   12.8841,
   12.76715,
   13.56466,
   13.49074,
   12.8841,
   11.7047,
   10.58301,
   10.77033,
   9.327379,
   9.591663,
   9.055385,
   9,
   10.86278,
   9.165151,
   9.055385,
   9,
   9.110434,
   8.888194,
   7.874008,
   7.745967,
   5.477226,
   5.196152,
   6.324555,
   5.291503,
   5.567764,
   5.744563,
   4.898979,
   5.09902,
   6,
   6.78233,
   8.306624,
   12.52996,
   43.87482,
   49.38623,
   13.82027,
   6.480741,
   4.898979,
   3.741657,
   4,
   3,
   3.316625,
   4.358899,
   3,
   3.316625,
   3.464102,
   2.645751,
   3.464102,
   3.162278,
   2.645751,
   2.236068,
   2.645751,
   2.645751,
   2,
   1.732051,
   0,
   0,
   0};
   Double_t Hist_fehx3002[100] = {
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10,
   10};
   Double_t Hist_fehy3002[100] = {
   0,
   0,
   0,
   0,
   0,
   5,
   11.09054,
   12.36932,
   12.76715,
   12.68858,
   12.52996,
   13.2665,
   11,
   11.40175,
   11.6619,
   11.6619,
   11.40175,
   10.29563,
   11.04536,
   10.24695,
   10.34408,
   10.19804,
   10,
   10.34408,
   10.24695,
   9.591663,
   9.643651,
   9.380832,
   10.72381,
   9.380832,
   9.380832,
   10.3923,
   10.04988,
   10.77033,
   9.219544,
   10.44031,
   9.746794,
   8.246211,
   9.949874,
   10.0995,
   11.26943,
   11.7047,
   11.87434,
   12.8841,
   12.76715,
   13.56466,
   13.49074,
   12.8841,
   11.7047,
   10.58301,
   10.77033,
   9.327379,
   9.591663,
   9.055385,
   9,
   10.86278,
   9.165151,
   9.055385,
   9,
   9.110434,
   8.888194,
   7.874008,
   7.745967,
   5.477226,
   5.196152,
   6.324555,
   5.291503,
   5.567764,
   5.744563,
   4.898979,
   5.09902,
   6,
   6.78233,
   8.306624,
   12.52996,
   43.87482,
   49.38623,
   13.82027,
   6.480741,
   4.898979,
   3.741657,
   4,
   3,
   3.316625,
   4.358899,
   3,
   3.316625,
   3.464102,
   2.645751,
   3.464102,
   3.162278,
   2.645751,
   2.236068,
   2.645751,
   2.645751,
   2,
   1.732051,
   0,
   0,
   0};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of data_plot__Bs_LOKI_MASS_JpsiConstr");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of data_plot__Bs_LOKI_MASS_JpsiConstr",100,3900,6300);
   Graph_Hist3002->SetMinimum(2.737225);
   Graph_Hist3002->SetMaximum(2737.225);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[102] = {
   4300,
   4305,
   4310,
   4315,
   4320,
   4325,
   4330,
   4335,
   4340,
   4345,
   4350,
   4355,
   4360,
   4365,
   4370,
   4375,
   4380,
   4385,
   4390,
   4395,
   4400,
   4405,
   4410,
   4415,
   4420,
   4425,
   4430,
   4435,
   4440,
   4445,
   4450,
   4455,
   4460,
   4465,
   4470,
   4475,
   4480,
   4485,
   4490,
   4495,
   4500,
   4505,
   4510,
   4515,
   4520,
   4525,
   4530,
   4535,
   4540,
   4545,
   4550,
   4555,
   4560,
   4565,
   4570,
   4575,
   4580,
   4585,
   4590,
   4595,
   4600,
   4605,
   4610,
   4615,
   4620,
   4625,
   4630,
   4635,
   4640,
   4645,
   4650,
   4655,
   4660,
   4665,
   4670,
   4675,
   4680,
   4685,
   4690,
   4695,
   4700,
   4705,
   4710,
   4715,
   4720,
   4725,
   4730,
   4735,
   4740,
   4745,
   4750,
   4755,
   4760,
   4765,
   4770,
   4775,
   4780,
   4785,
   4790,
   4795,
   4800,
   4800};
   Double_t curvetot_fy1[102] = {
   143.298,
   142.6376,
   141.9788,
   141.3214,
   140.6656,
   140.0112,
   139.3584,
   138.707,
   138.0571,
   137.4088,
   136.7619,
   136.1165,
   135.4726,
   134.8302,
   134.1893,
   133.5499,
   132.912,
   132.2756,
   131.6407,
   131.0072,
   130.3753,
   129.7449,
   129.116,
   128.4885,
   127.8626,
   127.2381,
   126.6152,
   125.9937,
   125.3738,
   124.7553,
   124.1384,
   123.5229,
   122.9089,
   122.2964,
   121.6854,
   121.076,
   120.468,
   119.8615,
   119.2565,
   118.653,
   118.051,
   117.4504,
   116.8514,
   116.2539,
   115.6579,
   115.0633,
   114.4703,
   113.8788,
   113.2887,
   112.7002,
   112.1131,
   111.5276,
   110.9435,
   110.361,
   109.7799,
   109.2003,
   108.6222,
   108.0457,
   107.4706,
   106.897,
   106.3249,
   105.7543,
   105.1852,
   104.6176,
   104.0515,
   103.4868,
   102.9237,
   102.3621,
   101.802,
   101.2433,
   100.6862,
   100.1306,
   99.57642,
   99.02377,
   98.47262,
   97.92296,
   97.3748,
   96.82813,
   96.28296,
   95.73929,
   95.19711,
   94.65642,
   94.11724,
   93.57954,
   93.04335,
   92.50865,
   91.97544,
   91.44373,
   90.91352,
   90.3848,
   89.85758,
   89.33185,
   88.80762,
   88.28489,
   87.76365,
   87.2439,
   86.72566,
   86.20891,
   85.69365,
   85.17989,
   84.66762,
   84.66762};
   TGraph *graph = new TGraph(102,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",102,4250,4850);
   Graph_curvetot1->SetMinimum(78.80459);
   Graph_curvetot1->SetMaximum(149.161);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t curvetot_fx2[102] = {
   5700,
   5702.5,
   5705,
   5707.5,
   5710,
   5712.5,
   5715,
   5717.5,
   5720,
   5722.5,
   5725,
   5727.5,
   5730,
   5732.5,
   5735,
   5737.5,
   5740,
   5742.5,
   5745,
   5747.5,
   5750,
   5752.5,
   5755,
   5757.5,
   5760,
   5762.5,
   5765,
   5767.5,
   5770,
   5772.5,
   5775,
   5777.5,
   5780,
   5782.5,
   5785,
   5787.5,
   5790,
   5792.5,
   5795,
   5797.5,
   5800,
   5802.5,
   5805,
   5807.5,
   5810,
   5812.5,
   5815,
   5817.5,
   5820,
   5822.5,
   5825,
   5827.5,
   5830,
   5832.5,
   5835,
   5837.5,
   5840,
   5842.5,
   5845,
   5847.5,
   5850,
   5852.5,
   5855,
   5857.5,
   5860,
   5862.5,
   5865,
   5867.5,
   5870,
   5872.5,
   5875,
   5877.5,
   5880,
   5882.5,
   5885,
   5887.5,
   5890,
   5892.5,
   5895,
   5897.5,
   5900,
   5902.5,
   5905,
   5907.5,
   5910,
   5912.5,
   5915,
   5917.5,
   5920,
   5922.5,
   5925,
   5927.5,
   5930,
   5932.5,
   5935,
   5937.5,
   5940,
   5942.5,
   5945,
   5947.5,
   5950,
   5950};
   Double_t curvetot_fy2[102] = {
   16.82558,
   16.70463,
   16.58405,
   16.46384,
   16.34401,
   16.22455,
   16.10546,
   15.98675,
   15.86841,
   15.75045,
   15.63286,
   15.51564,
   15.3988,
   15.28233,
   15.16624,
   15.05052,
   14.93517,
   14.8202,
   14.7056,
   14.59138,
   14.47753,
   14.36405,
   14.25095,
   14.13822,
   14.02587,
   13.91389,
   13.80228,
   13.69105,
   13.58019,
   13.46971,
   13.3596,
   13.24986,
   13.1405,
   13.03151,
   12.92289,
   12.81465,
   12.70678,
   12.59929,
   12.49217,
   12.38543,
   12.27905,
   12.17306,
   12.06743,
   11.96218,
   11.85731,
   11.75281,
   11.64868,
   11.54492,
   11.44154,
   11.33854,
   11.23591,
   11.13365,
   11.03176,
   10.93025,
   10.82912,
   10.72835,
   10.62797,
   10.52795,
   10.42831,
   10.32904,
   10.23015,
   10.13163,
   10.03349,
   9.935716,
   9.838319,
   9.741296,
   9.644647,
   9.548372,
   9.45247,
   9.356943,
   9.26179,
   9.16701,
   9.072605,
   8.978573,
   8.884915,
   8.791632,
   8.698722,
   8.606186,
   8.514024,
   8.422236,
   8.330822,
   8.239782,
   8.149116,
   8.058823,
   7.968905,
   7.879361,
   7.79019,
   7.701394,
   7.612971,
   7.524922,
   7.437248,
   7.349947,
   7.26302,
   7.176467,
   7.090288,
   7.004483,
   6.919052,
   6.833995,
   6.749311,
   6.665002,
   6.581067,
   6.581067};
   graph = new TGraph(102,curvetot_fx2,curvetot_fy2);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot2 = new TH1F("Graph_curvetot2","Projection of totalPdf",102,5675,5975);
   Graph_curvetot2->SetMinimum(5.556615);
   Graph_curvetot2->SetMaximum(17.85003);
   Graph_curvetot2->SetDirectory(0);
   Graph_curvetot2->SetStats(0);
   Graph_curvetot2->SetLineWidth(2);
   Graph_curvetot2->SetMarkerStyle(20);
   Graph_curvetot2->GetXaxis()->SetNdivisions(505);
   Graph_curvetot2->GetXaxis()->SetLabelFont(132);
   Graph_curvetot2->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot2->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot2->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot2->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot2->GetXaxis()->SetTitleFont(132);
   Graph_curvetot2->GetYaxis()->SetLabelFont(132);
   Graph_curvetot2->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot2->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot2->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot2->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot2->GetYaxis()->SetTitleFont(132);
   Graph_curvetot2->GetZaxis()->SetLabelFont(132);
   Graph_curvetot2->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot2->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot2->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot2->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot2);
   
   graph->Draw("l");
   
   Double_t curvetot_fx3[102] = {
   5950,
   5950.9,
   5951.8,
   5952.7,
   5953.6,
   5954.5,
   5955.4,
   5956.3,
   5957.2,
   5958.1,
   5959,
   5959.9,
   5960.8,
   5961.7,
   5962.6,
   5963.5,
   5964.4,
   5965.3,
   5966.2,
   5967.1,
   5968,
   5968.9,
   5969.8,
   5970.7,
   5971.6,
   5972.5,
   5973.4,
   5974.3,
   5975.2,
   5976.1,
   5977,
   5977.9,
   5978.8,
   5979.7,
   5980.6,
   5981.5,
   5982.4,
   5983.3,
   5984.2,
   5985.1,
   5986,
   5986.9,
   5987.8,
   5988.7,
   5989.6,
   5990.5,
   5991.4,
   5992.3,
   5993.2,
   5994.1,
   5995,
   5995.9,
   5996.8,
   5997.7,
   5998.6,
   5999.5,
   6000.4,
   6001.3,
   6002.2,
   6003.1,
   6004,
   6004.9,
   6005.8,
   6006.7,
   6007.6,
   6008.5,
   6009.4,
   6010.3,
   6011.2,
   6012.1,
   6013,
   6013.9,
   6014.8,
   6015.7,
   6016.6,
   6017.5,
   6018.4,
   6019.3,
   6020.2,
   6021.1,
   6022,
   6022.9,
   6023.8,
   6024.7,
   6025.6,
   6026.5,
   6027.4,
   6028.3,
   6029.2,
   6030.1,
   6031,
   6031.9,
   6032.8,
   6033.7,
   6034.6,
   6035.5,
   6036.4,
   6037.3,
   6038.2,
   6039.1,
   6040,
   6040};
   Double_t curvetot_fy3[102] = {
   6.581067,
   6.550942,
   6.520865,
   6.490837,
   6.460857,
   6.430925,
   6.401042,
   6.371208,
   6.341422,
   6.311685,
   6.281996,
   6.252355,
   6.222763,
   6.193219,
   6.163724,
   6.134277,
   6.104879,
   6.075529,
   6.046228,
   6.016975,
   5.987771,
   5.958615,
   5.929507,
   5.900448,
   5.871437,
   5.842475,
   5.813562,
   5.784697,
   5.75588,
   5.727112,
   5.698392,
   5.66972,
   5.641098,
   5.612523,
   5.583997,
   5.55552,
   5.527091,
   5.49871,
   5.470378,
   5.442094,
   5.413859,
   5.385672,
   5.357534,
   5.329444,
   5.301403,
   5.27341,
   5.245466,
   5.21757,
   5.189722,
   5.161923,
   5.134173,
   5.106471,
   5.078817,
   5.051212,
   5.023655,
   4.996147,
   4.968687,
   4.941276,
   4.913913,
   4.886598,
   4.859333,
   4.832115,
   4.804946,
   4.777825,
   4.750753,
   4.72373,
   4.696755,
   4.669828,
   4.64295,
   4.61612,
   4.589339,
   4.562606,
   4.535921,
   4.509285,
   4.482698,
   4.456159,
   4.429668,
   4.403226,
   4.376833,
   4.350487,
   4.324191,
   4.297942,
   4.271743,
   4.245591,
   4.219488,
   4.193434,
   4.167428,
   4.141471,
   4.115562,
   4.089701,
   4.063889,
   4.038125,
   4.01241,
   3.986744,
   3.961125,
   3.935556,
   3.910034,
   3.884561,
   3.859137,
   3.833761,
   3.808434,
   3.808434};
   graph = new TGraph(102,curvetot_fx3,curvetot_fy3);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot3 = new TH1F("Graph_curvetot3","Projection of totalPdf",102,5941,6049);
   Graph_curvetot3->SetMinimum(3.53117);
   Graph_curvetot3->SetMaximum(6.85833);
   Graph_curvetot3->SetDirectory(0);
   Graph_curvetot3->SetStats(0);
   Graph_curvetot3->SetLineWidth(2);
   Graph_curvetot3->SetMarkerStyle(20);
   Graph_curvetot3->GetXaxis()->SetNdivisions(505);
   Graph_curvetot3->GetXaxis()->SetLabelFont(132);
   Graph_curvetot3->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot3->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot3->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot3->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot3->GetXaxis()->SetTitleFont(132);
   Graph_curvetot3->GetYaxis()->SetLabelFont(132);
   Graph_curvetot3->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot3->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot3->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot3->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot3->GetYaxis()->SetTitleFont(132);
   Graph_curvetot3->GetZaxis()->SetLabelFont(132);
   Graph_curvetot3->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot3->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot3->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot3->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot3);
   
   graph->Draw("l");
   
   Double_t bkg_fx4[102] = {
   4300,
   4305,
   4310,
   4315,
   4320,
   4325,
   4330,
   4335,
   4340,
   4345,
   4350,
   4355,
   4360,
   4365,
   4370,
   4375,
   4380,
   4385,
   4390,
   4395,
   4400,
   4405,
   4410,
   4415,
   4420,
   4425,
   4430,
   4435,
   4440,
   4445,
   4450,
   4455,
   4460,
   4465,
   4470,
   4475,
   4480,
   4485,
   4490,
   4495,
   4500,
   4505,
   4510,
   4515,
   4520,
   4525,
   4530,
   4535,
   4540,
   4545,
   4550,
   4555,
   4560,
   4565,
   4570,
   4575,
   4580,
   4585,
   4590,
   4595,
   4600,
   4605,
   4610,
   4615,
   4620,
   4625,
   4630,
   4635,
   4640,
   4645,
   4650,
   4655,
   4660,
   4665,
   4670,
   4675,
   4680,
   4685,
   4690,
   4695,
   4700,
   4705,
   4710,
   4715,
   4720,
   4725,
   4730,
   4735,
   4740,
   4745,
   4750,
   4755,
   4760,
   4765,
   4770,
   4775,
   4780,
   4785,
   4790,
   4795,
   4800,
   4800};
   Double_t bkg_fy4[102] = {
   143.298,
   142.6376,
   141.9788,
   141.3214,
   140.6656,
   140.0112,
   139.3584,
   138.707,
   138.0571,
   137.4088,
   136.7619,
   136.1165,
   135.4726,
   134.8302,
   134.1893,
   133.5499,
   132.912,
   132.2756,
   131.6407,
   131.0072,
   130.3753,
   129.7449,
   129.116,
   128.4885,
   127.8626,
   127.2381,
   126.6152,
   125.9937,
   125.3738,
   124.7553,
   124.1384,
   123.5229,
   122.9089,
   122.2964,
   121.6854,
   121.076,
   120.468,
   119.8615,
   119.2565,
   118.653,
   118.051,
   117.4504,
   116.8514,
   116.2539,
   115.6579,
   115.0633,
   114.4703,
   113.8788,
   113.2887,
   112.7002,
   112.1131,
   111.5276,
   110.9435,
   110.361,
   109.7799,
   109.2003,
   108.6222,
   108.0457,
   107.4706,
   106.897,
   106.3249,
   105.7543,
   105.1852,
   104.6176,
   104.0515,
   103.4868,
   102.9237,
   102.3621,
   101.802,
   101.2433,
   100.6862,
   100.1306,
   99.57642,
   99.02377,
   98.47262,
   97.92296,
   97.3748,
   96.82813,
   96.28296,
   95.73929,
   95.19711,
   94.65642,
   94.11724,
   93.57954,
   93.04335,
   92.50865,
   91.97544,
   91.44373,
   90.91352,
   90.3848,
   89.85758,
   89.33185,
   88.80762,
   88.28489,
   87.76365,
   87.2439,
   86.72566,
   86.20891,
   85.69365,
   85.17989,
   84.66762,
   84.66762};
   graph = new TGraph(102,bkg_fx4,bkg_fy4);
   graph->SetName("bkg");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_bkg4 = new TH1F("Graph_bkg4","Projection of totalPdf",102,4250,4850);
   Graph_bkg4->SetMinimum(78.80459);
   Graph_bkg4->SetMaximum(149.161);
   Graph_bkg4->SetDirectory(0);
   Graph_bkg4->SetStats(0);
   Graph_bkg4->SetLineWidth(2);
   Graph_bkg4->SetMarkerStyle(20);
   Graph_bkg4->GetXaxis()->SetNdivisions(505);
   Graph_bkg4->GetXaxis()->SetLabelFont(132);
   Graph_bkg4->GetXaxis()->SetLabelOffset(0.01);
   Graph_bkg4->GetXaxis()->SetLabelSize(0.06);
   Graph_bkg4->GetXaxis()->SetTitleSize(0.072);
   Graph_bkg4->GetXaxis()->SetTitleOffset(0.95);
   Graph_bkg4->GetXaxis()->SetTitleFont(132);
   Graph_bkg4->GetYaxis()->SetLabelFont(132);
   Graph_bkg4->GetYaxis()->SetLabelOffset(0.01);
   Graph_bkg4->GetYaxis()->SetLabelSize(0.06);
   Graph_bkg4->GetYaxis()->SetTitleSize(0.072);
   Graph_bkg4->GetYaxis()->SetTitleOffset(0.95);
   Graph_bkg4->GetYaxis()->SetTitleFont(132);
   Graph_bkg4->GetZaxis()->SetLabelFont(132);
   Graph_bkg4->GetZaxis()->SetLabelSize(0.06);
   Graph_bkg4->GetZaxis()->SetTitleSize(0.072);
   Graph_bkg4->GetZaxis()->SetTitleOffset(1.2);
   Graph_bkg4->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_bkg4);
   
   graph->Draw("l");
   
   Double_t bkg_fx5[102] = {
   5700,
   5702.5,
   5705,
   5707.5,
   5710,
   5712.5,
   5715,
   5717.5,
   5720,
   5722.5,
   5725,
   5727.5,
   5730,
   5732.5,
   5735,
   5737.5,
   5740,
   5742.5,
   5745,
   5747.5,
   5750,
   5752.5,
   5755,
   5757.5,
   5760,
   5762.5,
   5765,
   5767.5,
   5770,
   5772.5,
   5775,
   5777.5,
   5780,
   5782.5,
   5785,
   5787.5,
   5790,
   5792.5,
   5795,
   5797.5,
   5800,
   5802.5,
   5805,
   5807.5,
   5810,
   5812.5,
   5815,
   5817.5,
   5820,
   5822.5,
   5825,
   5827.5,
   5830,
   5832.5,
   5835,
   5837.5,
   5840,
   5842.5,
   5845,
   5847.5,
   5850,
   5852.5,
   5855,
   5857.5,
   5860,
   5862.5,
   5865,
   5867.5,
   5870,
   5872.5,
   5875,
   5877.5,
   5880,
   5882.5,
   5885,
   5887.5,
   5890,
   5892.5,
   5895,
   5897.5,
   5900,
   5902.5,
   5905,
   5907.5,
   5910,
   5912.5,
   5915,
   5917.5,
   5920,
   5922.5,
   5925,
   5927.5,
   5930,
   5932.5,
   5935,
   5937.5,
   5940,
   5942.5,
   5945,
   5947.5,
   5950,
   5950};
   Double_t bkg_fy5[102] = {
   16.82558,
   16.70463,
   16.58405,
   16.46384,
   16.34401,
   16.22455,
   16.10546,
   15.98675,
   15.86841,
   15.75045,
   15.63286,
   15.51564,
   15.3988,
   15.28233,
   15.16624,
   15.05052,
   14.93517,
   14.8202,
   14.7056,
   14.59138,
   14.47753,
   14.36405,
   14.25095,
   14.13822,
   14.02587,
   13.91389,
   13.80228,
   13.69105,
   13.58019,
   13.46971,
   13.3596,
   13.24986,
   13.1405,
   13.03151,
   12.92289,
   12.81465,
   12.70678,
   12.59929,
   12.49217,
   12.38543,
   12.27905,
   12.17306,
   12.06743,
   11.96218,
   11.85731,
   11.75281,
   11.64868,
   11.54492,
   11.44154,
   11.33854,
   11.23591,
   11.13365,
   11.03176,
   10.93025,
   10.82912,
   10.72835,
   10.62797,
   10.52795,
   10.42831,
   10.32904,
   10.23015,
   10.13163,
   10.03349,
   9.935716,
   9.838319,
   9.741296,
   9.644647,
   9.548372,
   9.45247,
   9.356943,
   9.26179,
   9.16701,
   9.072605,
   8.978573,
   8.884915,
   8.791632,
   8.698722,
   8.606186,
   8.514024,
   8.422236,
   8.330822,
   8.239782,
   8.149116,
   8.058823,
   7.968905,
   7.879361,
   7.79019,
   7.701394,
   7.612971,
   7.524922,
   7.437248,
   7.349947,
   7.26302,
   7.176467,
   7.090288,
   7.004483,
   6.919052,
   6.833995,
   6.749311,
   6.665002,
   6.581067,
   6.581067};
   graph = new TGraph(102,bkg_fx5,bkg_fy5);
   graph->SetName("bkg");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_bkg5 = new TH1F("Graph_bkg5","Projection of totalPdf",102,5675,5975);
   Graph_bkg5->SetMinimum(5.556615);
   Graph_bkg5->SetMaximum(17.85003);
   Graph_bkg5->SetDirectory(0);
   Graph_bkg5->SetStats(0);
   Graph_bkg5->SetLineWidth(2);
   Graph_bkg5->SetMarkerStyle(20);
   Graph_bkg5->GetXaxis()->SetNdivisions(505);
   Graph_bkg5->GetXaxis()->SetLabelFont(132);
   Graph_bkg5->GetXaxis()->SetLabelOffset(0.01);
   Graph_bkg5->GetXaxis()->SetLabelSize(0.06);
   Graph_bkg5->GetXaxis()->SetTitleSize(0.072);
   Graph_bkg5->GetXaxis()->SetTitleOffset(0.95);
   Graph_bkg5->GetXaxis()->SetTitleFont(132);
   Graph_bkg5->GetYaxis()->SetLabelFont(132);
   Graph_bkg5->GetYaxis()->SetLabelOffset(0.01);
   Graph_bkg5->GetYaxis()->SetLabelSize(0.06);
   Graph_bkg5->GetYaxis()->SetTitleSize(0.072);
   Graph_bkg5->GetYaxis()->SetTitleOffset(0.95);
   Graph_bkg5->GetYaxis()->SetTitleFont(132);
   Graph_bkg5->GetZaxis()->SetLabelFont(132);
   Graph_bkg5->GetZaxis()->SetLabelSize(0.06);
   Graph_bkg5->GetZaxis()->SetTitleSize(0.072);
   Graph_bkg5->GetZaxis()->SetTitleOffset(1.2);
   Graph_bkg5->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_bkg5);
   
   graph->Draw("l");
   
   Double_t bkg_fx6[102] = {
   5950,
   5950.9,
   5951.8,
   5952.7,
   5953.6,
   5954.5,
   5955.4,
   5956.3,
   5957.2,
   5958.1,
   5959,
   5959.9,
   5960.8,
   5961.7,
   5962.6,
   5963.5,
   5964.4,
   5965.3,
   5966.2,
   5967.1,
   5968,
   5968.9,
   5969.8,
   5970.7,
   5971.6,
   5972.5,
   5973.4,
   5974.3,
   5975.2,
   5976.1,
   5977,
   5977.9,
   5978.8,
   5979.7,
   5980.6,
   5981.5,
   5982.4,
   5983.3,
   5984.2,
   5985.1,
   5986,
   5986.9,
   5987.8,
   5988.7,
   5989.6,
   5990.5,
   5991.4,
   5992.3,
   5993.2,
   5994.1,
   5995,
   5995.9,
   5996.8,
   5997.7,
   5998.6,
   5999.5,
   6000.4,
   6001.3,
   6002.2,
   6003.1,
   6004,
   6004.9,
   6005.8,
   6006.7,
   6007.6,
   6008.5,
   6009.4,
   6010.3,
   6011.2,
   6012.1,
   6013,
   6013.9,
   6014.8,
   6015.7,
   6016.6,
   6017.5,
   6018.4,
   6019.3,
   6020.2,
   6021.1,
   6022,
   6022.9,
   6023.8,
   6024.7,
   6025.6,
   6026.5,
   6027.4,
   6028.3,
   6029.2,
   6030.1,
   6031,
   6031.9,
   6032.8,
   6033.7,
   6034.6,
   6035.5,
   6036.4,
   6037.3,
   6038.2,
   6039.1,
   6040,
   6040};
   Double_t bkg_fy6[102] = {
   6.581067,
   6.550942,
   6.520865,
   6.490837,
   6.460857,
   6.430925,
   6.401042,
   6.371208,
   6.341422,
   6.311685,
   6.281996,
   6.252355,
   6.222763,
   6.193219,
   6.163724,
   6.134277,
   6.104879,
   6.075529,
   6.046228,
   6.016975,
   5.987771,
   5.958615,
   5.929507,
   5.900448,
   5.871437,
   5.842475,
   5.813562,
   5.784697,
   5.75588,
   5.727112,
   5.698392,
   5.66972,
   5.641098,
   5.612523,
   5.583997,
   5.55552,
   5.527091,
   5.49871,
   5.470378,
   5.442094,
   5.413859,
   5.385672,
   5.357534,
   5.329444,
   5.301403,
   5.27341,
   5.245466,
   5.21757,
   5.189722,
   5.161923,
   5.134173,
   5.106471,
   5.078817,
   5.051212,
   5.023655,
   4.996147,
   4.968687,
   4.941276,
   4.913913,
   4.886598,
   4.859333,
   4.832115,
   4.804946,
   4.777825,
   4.750753,
   4.72373,
   4.696755,
   4.669828,
   4.64295,
   4.61612,
   4.589339,
   4.562606,
   4.535921,
   4.509285,
   4.482698,
   4.456159,
   4.429668,
   4.403226,
   4.376833,
   4.350487,
   4.324191,
   4.297942,
   4.271743,
   4.245591,
   4.219488,
   4.193434,
   4.167428,
   4.141471,
   4.115562,
   4.089701,
   4.063889,
   4.038125,
   4.01241,
   3.986744,
   3.961125,
   3.935556,
   3.910034,
   3.884561,
   3.859137,
   3.833761,
   3.808434,
   3.808434};
   graph = new TGraph(102,bkg_fx6,bkg_fy6);
   graph->SetName("bkg");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_bkg6 = new TH1F("Graph_bkg6","Projection of totalPdf",102,5941,6049);
   Graph_bkg6->SetMinimum(3.53117);
   Graph_bkg6->SetMaximum(6.85833);
   Graph_bkg6->SetDirectory(0);
   Graph_bkg6->SetStats(0);
   Graph_bkg6->SetLineWidth(2);
   Graph_bkg6->SetMarkerStyle(20);
   Graph_bkg6->GetXaxis()->SetNdivisions(505);
   Graph_bkg6->GetXaxis()->SetLabelFont(132);
   Graph_bkg6->GetXaxis()->SetLabelOffset(0.01);
   Graph_bkg6->GetXaxis()->SetLabelSize(0.06);
   Graph_bkg6->GetXaxis()->SetTitleSize(0.072);
   Graph_bkg6->GetXaxis()->SetTitleOffset(0.95);
   Graph_bkg6->GetXaxis()->SetTitleFont(132);
   Graph_bkg6->GetYaxis()->SetLabelFont(132);
   Graph_bkg6->GetYaxis()->SetLabelOffset(0.01);
   Graph_bkg6->GetYaxis()->SetLabelSize(0.06);
   Graph_bkg6->GetYaxis()->SetTitleSize(0.072);
   Graph_bkg6->GetYaxis()->SetTitleOffset(0.95);
   Graph_bkg6->GetYaxis()->SetTitleFont(132);
   Graph_bkg6->GetZaxis()->SetLabelFont(132);
   Graph_bkg6->GetZaxis()->SetLabelSize(0.06);
   Graph_bkg6->GetZaxis()->SetTitleSize(0.072);
   Graph_bkg6->GetZaxis()->SetTitleOffset(1.2);
   Graph_bkg6->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_bkg6);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.2,0.02,0.4,0.42,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("bkg","Background","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_4a4d3a0__4 = new TH1D("frame_4a4d3a0__4","A RooPlot of \"m(J/#psi #Lambda)\"",100,4100,6100);
   frame_4a4d3a0__4->SetBinContent(1,2612.806);
   frame_4a4d3a0__4->SetMinimum(1);
   frame_4a4d3a0__4->SetMaximum(5000);
   frame_4a4d3a0__4->SetEntries(1);
   frame_4a4d3a0__4->SetDirectory(0);
   frame_4a4d3a0__4->SetStats(0);
   frame_4a4d3a0__4->SetLineWidth(2);
   frame_4a4d3a0__4->SetMarkerStyle(20);
   frame_4a4d3a0__4->GetXaxis()->SetTitle("m(J/#psi #Lambda) (MeV)");
   frame_4a4d3a0__4->GetXaxis()->SetNdivisions(505);
   frame_4a4d3a0__4->GetXaxis()->SetLabelFont(132);
   frame_4a4d3a0__4->GetXaxis()->SetLabelOffset(0.01);
   frame_4a4d3a0__4->GetXaxis()->SetLabelSize(0.06);
   frame_4a4d3a0__4->GetXaxis()->SetTitleSize(0.072);
   frame_4a4d3a0__4->GetXaxis()->SetTitleOffset(0.95);
   frame_4a4d3a0__4->GetXaxis()->SetTitleFont(132);
   frame_4a4d3a0__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4a4d3a0__4->GetYaxis()->SetLabelFont(132);
   frame_4a4d3a0__4->GetYaxis()->SetLabelOffset(0.01);
   frame_4a4d3a0__4->GetYaxis()->SetLabelSize(0.06);
   frame_4a4d3a0__4->GetYaxis()->SetTitleSize(0.072);
   frame_4a4d3a0__4->GetYaxis()->SetTitleOffset(0.95);
   frame_4a4d3a0__4->GetYaxis()->SetTitleFont(132);
   frame_4a4d3a0__4->GetZaxis()->SetLabelFont(132);
   frame_4a4d3a0__4->GetZaxis()->SetLabelSize(0.06);
   frame_4a4d3a0__4->GetZaxis()->SetTitleSize(0.072);
   frame_4a4d3a0__4->GetZaxis()->SetTitleOffset(1.2);
   frame_4a4d3a0__4->GetZaxis()->SetTitleFont(132);
   frame_4a4d3a0__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}
Ejemplo n.º 30
0
void fitLMLL1()
{
//=========Macro generated from canvas: c1/data fits
//=========  (Fri May 20 20:55:56 2016) by ROOT version6.06/02
   TCanvas *c1 = new TCanvas("c1", "data fits",0,0,1200,800);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1->Range(0,0,1,1);
   c1->SetFillColor(0);
   c1->SetBorderMode(0);
   c1->SetBorderSize(2);
   c1->SetTickx(1);
   c1->SetTicky(1);
   c1->SetLeftMargin(0.14);
   c1->SetRightMargin(0.05);
   c1->SetTopMargin(0.05);
   c1->SetBottomMargin(0.16);
   c1->SetFrameLineWidth(2);
   c1->SetFrameBorderMode(0);
  
// ------------>Primitives in pad: pad2
   TPad *pad2 = new TPad("pad2", "pad2",0,0,1,0.3);
   pad2->Draw();
   pad2->cd();
   pad2->Range(1075.63,-26.4,1149.704,8.8);
   pad2->SetFillColor(0);
   pad2->SetBorderMode(0);
   pad2->SetBorderSize(2);
   pad2->SetTickx(1);
   pad2->SetTicky(1);
   pad2->SetLeftMargin(0.14);
   pad2->SetRightMargin(0.05);
   pad2->SetTopMargin(0);
   pad2->SetBottomMargin(0.5);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   pad2->SetFrameLineWidth(2);
   pad2->SetFrameBorderMode(0);
   
   TH1D *frame_47d69a0__1 = new TH1D("frame_47d69a0__1","",100,1086,1146);
   frame_47d69a0__1->SetBinContent(1,3.731864);
   frame_47d69a0__1->SetMinimum(-8.8);
   frame_47d69a0__1->SetMaximum(8.8);
   frame_47d69a0__1->SetEntries(1);
   frame_47d69a0__1->SetDirectory(0);
   frame_47d69a0__1->SetStats(0);
   frame_47d69a0__1->SetLineWidth(2);
   frame_47d69a0__1->SetMarkerStyle(20);
   frame_47d69a0__1->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_47d69a0__1->GetXaxis()->SetNdivisions(505);
   frame_47d69a0__1->GetXaxis()->SetLabelFont(132);
   frame_47d69a0__1->GetXaxis()->SetLabelOffset(0.01);
   frame_47d69a0__1->GetXaxis()->SetLabelSize(0.15);
   frame_47d69a0__1->GetXaxis()->SetTitleSize(0.2);
   frame_47d69a0__1->GetXaxis()->SetTitleOffset(1.1);
   frame_47d69a0__1->GetXaxis()->SetTitleFont(132);
   frame_47d69a0__1->GetYaxis()->SetTitle("Pull");
   frame_47d69a0__1->GetYaxis()->CenterTitle(true);
   frame_47d69a0__1->GetYaxis()->SetNdivisions(505);
   frame_47d69a0__1->GetYaxis()->SetLabelFont(132);
   frame_47d69a0__1->GetYaxis()->SetLabelOffset(0.01);
   frame_47d69a0__1->GetYaxis()->SetLabelSize(0.15);
   frame_47d69a0__1->GetYaxis()->SetTitleSize(0.15);
   frame_47d69a0__1->GetYaxis()->SetTitleOffset(0.45);
   frame_47d69a0__1->GetYaxis()->SetTitleFont(132);
   frame_47d69a0__1->GetZaxis()->SetLabelFont(132);
   frame_47d69a0__1->GetZaxis()->SetLabelSize(0.06);
   frame_47d69a0__1->GetZaxis()->SetTitleSize(0.072);
   frame_47d69a0__1->GetZaxis()->SetTitleOffset(1.2);
   frame_47d69a0__1->GetZaxis()->SetTitleFont(132);
   frame_47d69a0__1->Draw("FUNC");
   
   Double_t pull_Hist_curvetot_fx3001[76] = {
   1090.5,
   1091.1,
   1091.7,
   1092.3,
   1092.9,
   1093.5,
   1094.1,
   1094.7,
   1095.3,
   1095.9,
   1096.5,
   1097.1,
   1097.7,
   1098.3,
   1098.9,
   1099.5,
   1100.1,
   1100.7,
   1101.3,
   1101.9,
   1102.5,
   1103.1,
   1103.7,
   1104.3,
   1104.9,
   1105.5,
   1106.1,
   1106.7,
   1107.3,
   1107.9,
   1108.5,
   1109.1,
   1109.7,
   1110.3,
   1110.9,
   1111.5,
   1112.1,
   1112.7,
   1113.3,
   1113.9,
   1114.5,
   1115.1,
   1115.7,
   1116.3,
   1116.9,
   1117.5,
   1118.1,
   1118.7,
   1119.3,
   1119.9,
   1120.5,
   1121.1,
   1121.7,
   1122.3,
   1122.9,
   1123.5,
   1124.1,
   1124.7,
   1125.3,
   1125.9,
   1126.5,
   1127.1,
   1127.7,
   1128.3,
   1128.9,
   1129.5,
   1130.1,
   1130.7,
   1131.3,
   1131.9,
   1132.5,
   1133.1,
   1133.7,
   1134.3,
   1134.9,
   1135.5};
   Double_t pull_Hist_curvetot_fy3001[76] = {
   0.2825898,
   0.1632924,
   0.04605264,
   -0.06912945,
   0,
   0.5002483,
   0,
   -0.507446,
   -0.6115613,
   0,
   1.093274,
   -0.9110049,
   0.9967499,
   -0.07062737,
   -1.190873,
   -1.279806,
   0,
   -0.3190221,
   -1.533536,
   -0.4340571,
   -0.4892357,
   -0.5428453,
   -1.841478,
   -0.6457166,
   -1.982958,
   1.749399,
   -0.07079971,
   -0.1187623,
   -0.1862919,
   1.011584,
   -1.38142,
   -1.074144,
   1.767467,
   0.5636543,
   -2.411339,
   -1.891138,
   -3.132081,
   -0.0262515,
   -2.353588,
   0.3563425,
   -0.06199501,
   0.9583815,
   0.8134596,
   -1.460186,
   -1.438016,
   0.8612511,
   1.045139,
   1.943663,
   2.35739,
   -0.2693911,
   -1.029633,
   -1.245932,
   1.922657,
   1.719505,
   0.4383432,
   0.9841481,
   -1.539579,
   0.7778159,
   -0.02978785,
   0.428204,
   -0.01532467,
   1.407629,
   0.4449068,
   0.8207871,
   0.01412646,
   0.02402242,
   -0.5368696,
   0.8550387,
   0.06038003,
   -0.4911632,
   -0.4733484,
   -2.78695,
   0.1240109,
   -1.212377,
   -0.3897599,
   0};
   Double_t pull_Hist_curvetot_felx3001[76] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fely3001[76] = {
   1,
   1,
   1,
   1,
   0,
   1,
   0,
   1,
   1,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   0};
   Double_t pull_Hist_curvetot_fehx3001[76] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t pull_Hist_curvetot_fehy3001[76] = {
   1,
   1,
   1,
   1,
   0,
   1,
   0,
   1,
   1,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   0,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   1,
   0};
   TGraphAsymmErrors *grae = new TGraphAsymmErrors(76,pull_Hist_curvetot_fx3001,pull_Hist_curvetot_fy3001,pull_Hist_curvetot_felx3001,pull_Hist_curvetot_fehx3001,pull_Hist_curvetot_fely3001,pull_Hist_curvetot_fehy3001);
   grae->SetName("pull_Hist_curvetot");
   grae->SetTitle("Pull of Histogram of data_plot__R_M and Projection of totalPdf");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_pull_Hist_curvetot3001 = new TH1F("Graph_pull_Hist_curvetot3001","Pull of Histogram of data_plot__R_M and Projection of totalPdf",100,1086,1140);
   Graph_pull_Hist_curvetot3001->SetMinimum(-4.881029);
   Graph_pull_Hist_curvetot3001->SetMaximum(4.106337);
   Graph_pull_Hist_curvetot3001->SetDirectory(0);
   Graph_pull_Hist_curvetot3001->SetStats(0);
   Graph_pull_Hist_curvetot3001->SetLineWidth(2);
   Graph_pull_Hist_curvetot3001->SetMarkerStyle(20);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetNdivisions(505);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetXaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelOffset(0.01);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleOffset(0.95);
   Graph_pull_Hist_curvetot3001->GetYaxis()->SetTitleFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelFont(132);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetLabelSize(0.06);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleSize(0.072);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleOffset(1.2);
   Graph_pull_Hist_curvetot3001->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_pull_Hist_curvetot3001);
   
   grae->Draw("p");
   
   TH1D *frame_47d69a0__2 = new TH1D("frame_47d69a0__2","",100,1086,1146);
   frame_47d69a0__2->SetBinContent(1,3.731864);
   frame_47d69a0__2->SetMinimum(-8.8);
   frame_47d69a0__2->SetMaximum(8.8);
   frame_47d69a0__2->SetEntries(1);
   frame_47d69a0__2->SetDirectory(0);
   frame_47d69a0__2->SetStats(0);
   frame_47d69a0__2->SetLineWidth(2);
   frame_47d69a0__2->SetMarkerStyle(20);
   frame_47d69a0__2->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_47d69a0__2->GetXaxis()->SetNdivisions(505);
   frame_47d69a0__2->GetXaxis()->SetLabelFont(132);
   frame_47d69a0__2->GetXaxis()->SetLabelOffset(0.01);
   frame_47d69a0__2->GetXaxis()->SetLabelSize(0.15);
   frame_47d69a0__2->GetXaxis()->SetTitleSize(0.2);
   frame_47d69a0__2->GetXaxis()->SetTitleOffset(1.1);
   frame_47d69a0__2->GetXaxis()->SetTitleFont(132);
   frame_47d69a0__2->GetYaxis()->SetTitle("Pull");
   frame_47d69a0__2->GetYaxis()->CenterTitle(true);
   frame_47d69a0__2->GetYaxis()->SetNdivisions(505);
   frame_47d69a0__2->GetYaxis()->SetLabelFont(132);
   frame_47d69a0__2->GetYaxis()->SetLabelOffset(0.01);
   frame_47d69a0__2->GetYaxis()->SetLabelSize(0.15);
   frame_47d69a0__2->GetYaxis()->SetTitleSize(0.15);
   frame_47d69a0__2->GetYaxis()->SetTitleOffset(0.45);
   frame_47d69a0__2->GetYaxis()->SetTitleFont(132);
   frame_47d69a0__2->GetZaxis()->SetLabelFont(132);
   frame_47d69a0__2->GetZaxis()->SetLabelSize(0.06);
   frame_47d69a0__2->GetZaxis()->SetTitleSize(0.072);
   frame_47d69a0__2->GetZaxis()->SetTitleOffset(1.2);
   frame_47d69a0__2->GetZaxis()->SetTitleFont(132);
   frame_47d69a0__2->Draw("AXISSAME");
   pad2->Modified();
   c1->cd();
  
// ------------>Primitives in pad: pad1
   TPad *pad1 = new TPad("pad1", "pad1",0,0.3,1,1);
   pad1->Draw();
   pad1->cd();
   pad1->Range(1075.63,0,1149.704,1194.322);
   pad1->SetFillColor(0);
   pad1->SetBorderMode(0);
   pad1->SetBorderSize(2);
   pad1->SetTickx(1);
   pad1->SetTicky(1);
   pad1->SetLeftMargin(0.14);
   pad1->SetRightMargin(0.05);
   pad1->SetTopMargin(0.06);
   pad1->SetBottomMargin(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   pad1->SetFrameLineWidth(2);
   pad1->SetFrameBorderMode(0);
   
   TH1D *frame_4ac28d0__3 = new TH1D("frame_4ac28d0__3","A RooPlot of \"#Lambda mass\"",100,1086,1146);
   frame_4ac28d0__3->SetBinContent(1,1122.663);
   frame_4ac28d0__3->SetMaximum(1122.663);
   frame_4ac28d0__3->SetEntries(1);
   frame_4ac28d0__3->SetDirectory(0);
   frame_4ac28d0__3->SetStats(0);
   frame_4ac28d0__3->SetLineWidth(2);
   frame_4ac28d0__3->SetMarkerStyle(20);
   frame_4ac28d0__3->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_4ac28d0__3->GetXaxis()->SetNdivisions(505);
   frame_4ac28d0__3->GetXaxis()->SetLabelFont(132);
   frame_4ac28d0__3->GetXaxis()->SetLabelOffset(0.01);
   frame_4ac28d0__3->GetXaxis()->SetLabelSize(0.06);
   frame_4ac28d0__3->GetXaxis()->SetTitleSize(0.072);
   frame_4ac28d0__3->GetXaxis()->SetTitleOffset(0.95);
   frame_4ac28d0__3->GetXaxis()->SetTitleFont(132);
   frame_4ac28d0__3->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4ac28d0__3->GetYaxis()->SetLabelFont(132);
   frame_4ac28d0__3->GetYaxis()->SetLabelOffset(0.01);
   frame_4ac28d0__3->GetYaxis()->SetLabelSize(0.06);
   frame_4ac28d0__3->GetYaxis()->SetTitleSize(0.072);
   frame_4ac28d0__3->GetYaxis()->SetTitleOffset(0.95);
   frame_4ac28d0__3->GetYaxis()->SetTitleFont(132);
   frame_4ac28d0__3->GetZaxis()->SetLabelFont(132);
   frame_4ac28d0__3->GetZaxis()->SetLabelSize(0.06);
   frame_4ac28d0__3->GetZaxis()->SetTitleSize(0.072);
   frame_4ac28d0__3->GetZaxis()->SetTitleOffset(1.2);
   frame_4ac28d0__3->GetZaxis()->SetTitleFont(132);
   frame_4ac28d0__3->Draw("FUNC");
   
   Double_t Hist_fx3002[100] = {
   1086.3,
   1086.9,
   1087.5,
   1088.1,
   1088.7,
   1089.3,
   1089.9,
   1090.5,
   1091.1,
   1091.7,
   1092.3,
   1092.9,
   1093.5,
   1094.1,
   1094.7,
   1095.3,
   1095.9,
   1096.5,
   1097.1,
   1097.7,
   1098.3,
   1098.9,
   1099.5,
   1100.1,
   1100.7,
   1101.3,
   1101.9,
   1102.5,
   1103.1,
   1103.7,
   1104.3,
   1104.9,
   1105.5,
   1106.1,
   1106.7,
   1107.3,
   1107.9,
   1108.5,
   1109.1,
   1109.7,
   1110.3,
   1110.9,
   1111.5,
   1112.1,
   1112.7,
   1113.3,
   1113.9,
   1114.5,
   1115.1,
   1115.7,
   1116.3,
   1116.9,
   1117.5,
   1118.1,
   1118.7,
   1119.3,
   1119.9,
   1120.5,
   1121.1,
   1121.7,
   1122.3,
   1122.9,
   1123.5,
   1124.1,
   1124.7,
   1125.3,
   1125.9,
   1126.5,
   1127.1,
   1127.7,
   1128.3,
   1128.9,
   1129.5,
   1130.1,
   1130.7,
   1131.3,
   1131.9,
   1132.5,
   1133.1,
   1133.7,
   1134.3,
   1134.9,
   1135.5,
   1136.1,
   1136.7,
   1137.3,
   1137.9,
   1138.5,
   1139.1,
   1139.7,
   1140.3,
   1140.9,
   1141.5,
   1142.1,
   1142.7,
   1143.3,
   1143.9,
   1144.5,
   1145.1,
   1145.7};
   Double_t Hist_fy3002[100] = {
   3,
   2,
   1,
   2,
   1,
   1,
   3,
   1,
   1,
   1,
   1,
   0,
   2,
   0,
   1,
   1,
   0,
   4,
   1,
   4,
   2,
   1,
   1,
   0,
   2,
   1,
   2,
   2,
   2,
   1,
   2,
   1,
   8,
   3,
   3,
   3,
   6,
   2,
   3,
   13,
   12,
   9,
   18,
   25,
   63,
   84,
   216,
   444,
   813,
   1037,
   865,
   546,
   303,
   150,
   96,
   69,
   30,
   16,
   9,
   16,
   12,
   6,
   7,
   2,
   6,
   4,
   5,
   4,
   8,
   5,
   6,
   4,
   4,
   3,
   6,
   4,
   3,
   3,
   1,
   4,
   2,
   3,
   0,
   1,
   4,
   2,
   0,
   2,
   2,
   3,
   3,
   4,
   1,
   1,
   2,
   1,
   2,
   3,
   4,
   1};
   Double_t Hist_felx3002[100] = {
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3};
   Double_t Hist_fely3002[100] = {
   1.732051,
   1.414214,
   1,
   1.414214,
   1,
   1,
   1.732051,
   1,
   1,
   1,
   1,
   0,
   1.414214,
   0,
   1,
   1,
   0,
   2,
   1,
   2,
   1.414214,
   1,
   1,
   0,
   1.414214,
   1,
   1.414214,
   1.414214,
   1.414214,
   1,
   1.414214,
   1,
   2.828427,
   1.732051,
   1.732051,
   1.732051,
   2.44949,
   1.414214,
   1.732051,
   3.605551,
   3.464102,
   3,
   4.242641,
   5,
   7.937254,
   9.165151,
   14.69694,
   21.07131,
   28.51315,
   32.20248,
   29.41088,
   23.36664,
   17.4069,
   12.24745,
   9.797959,
   8.306624,
   5.477226,
   4,
   3,
   4,
   3.464102,
   2.44949,
   2.645751,
   1.414214,
   2.44949,
   2,
   2.236068,
   2,
   2.828427,
   2.236068,
   2.44949,
   2,
   2,
   1.732051,
   2.44949,
   2,
   1.732051,
   1.732051,
   1,
   2,
   1.414214,
   1.732051,
   0,
   1,
   2,
   1.414214,
   0,
   1.414214,
   1.414214,
   1.732051,
   1.732051,
   2,
   1,
   1,
   1.414214,
   1,
   1.414214,
   1.732051,
   2,
   1};
   Double_t Hist_fehx3002[100] = {
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3,
   0.3};
   Double_t Hist_fehy3002[100] = {
   1.732051,
   1.414214,
   1,
   1.414214,
   1,
   1,
   1.732051,
   1,
   1,
   1,
   1,
   0,
   1.414214,
   0,
   1,
   1,
   0,
   2,
   1,
   2,
   1.414214,
   1,
   1,
   0,
   1.414214,
   1,
   1.414214,
   1.414214,
   1.414214,
   1,
   1.414214,
   1,
   2.828427,
   1.732051,
   1.732051,
   1.732051,
   2.44949,
   1.414214,
   1.732051,
   3.605551,
   3.464102,
   3,
   4.242641,
   5,
   7.937254,
   9.165151,
   14.69694,
   21.07131,
   28.51315,
   32.20248,
   29.41088,
   23.36664,
   17.4069,
   12.24745,
   9.797959,
   8.306624,
   5.477226,
   4,
   3,
   4,
   3.464102,
   2.44949,
   2.645751,
   1.414214,
   2.44949,
   2,
   2.236068,
   2,
   2.828427,
   2.236068,
   2.44949,
   2,
   2,
   1.732051,
   2.44949,
   2,
   1.732051,
   1.732051,
   1,
   2,
   1.414214,
   1.732051,
   0,
   1,
   2,
   1.414214,
   0,
   1.414214,
   1.414214,
   1.732051,
   1.732051,
   2,
   1,
   1,
   1.414214,
   1,
   1.414214,
   1.732051,
   2,
   1};
   grae = new TGraphAsymmErrors(100,Hist_fx3002,Hist_fy3002,Hist_felx3002,Hist_fehx3002,Hist_fely3002,Hist_fehy3002);
   grae->SetName("Hist");
   grae->SetTitle("Histogram of data_plot__R_M");
   grae->SetFillColor(1);
   grae->SetLineWidth(2);
   grae->SetMarkerStyle(8);
   
   TH1F *Graph_Hist3002 = new TH1F("Graph_Hist3002","Histogram of data_plot__R_M",100,1080,1152);
   Graph_Hist3002->SetMinimum(0);
   Graph_Hist3002->SetMaximum(1176.123);
   Graph_Hist3002->SetDirectory(0);
   Graph_Hist3002->SetStats(0);
   Graph_Hist3002->SetLineWidth(2);
   Graph_Hist3002->SetMarkerStyle(20);
   Graph_Hist3002->GetXaxis()->SetNdivisions(505);
   Graph_Hist3002->GetXaxis()->SetLabelFont(132);
   Graph_Hist3002->GetXaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetXaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetXaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetXaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetXaxis()->SetTitleFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelFont(132);
   Graph_Hist3002->GetYaxis()->SetLabelOffset(0.01);
   Graph_Hist3002->GetYaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetYaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetYaxis()->SetTitleOffset(0.95);
   Graph_Hist3002->GetYaxis()->SetTitleFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelFont(132);
   Graph_Hist3002->GetZaxis()->SetLabelSize(0.06);
   Graph_Hist3002->GetZaxis()->SetTitleSize(0.072);
   Graph_Hist3002->GetZaxis()->SetTitleOffset(1.2);
   Graph_Hist3002->GetZaxis()->SetTitleFont(132);
   grae->SetHistogram(Graph_Hist3002);
   
   grae->Draw("p");
   
   Double_t curvetot_fx1[145] = {
   1090,
   1090.46,
   1090.92,
   1091.38,
   1091.84,
   1092.3,
   1092.76,
   1093.22,
   1093.68,
   1094.14,
   1094.6,
   1095.06,
   1095.52,
   1095.98,
   1096.44,
   1096.9,
   1097.36,
   1097.82,
   1098.28,
   1098.74,
   1099.2,
   1099.66,
   1100.12,
   1100.58,
   1101.04,
   1101.5,
   1101.96,
   1102.42,
   1102.88,
   1103.34,
   1103.8,
   1104.26,
   1104.72,
   1105.18,
   1105.64,
   1106.1,
   1106.56,
   1107.02,
   1107.48,
   1107.94,
   1108.4,
   1108.86,
   1109.32,
   1109.78,
   1110.24,
   1110.7,
   1111.16,
   1111.62,
   1112.08,
   1112.54,
   1112.77,
   1113,
   1113.23,
   1113.345,
   1113.46,
   1113.575,
   1113.69,
   1113.805,
   1113.92,
   1114.035,
   1114.15,
   1114.265,
   1114.38,
   1114.495,
   1114.61,
   1114.725,
   1114.84,
   1115.07,
   1115.185,
   1115.3,
   1115.358,
   1115.415,
   1115.472,
   1115.53,
   1115.588,
   1115.645,
   1115.702,
   1115.76,
   1115.818,
   1115.875,
   1115.932,
   1115.99,
   1116.048,
   1116.105,
   1116.162,
   1116.22,
   1116.278,
   1116.335,
   1116.45,
   1116.565,
   1116.68,
   1116.91,
   1117.025,
   1117.14,
   1117.255,
   1117.37,
   1117.485,
   1117.6,
   1117.715,
   1117.83,
   1117.945,
   1118.06,
   1118.175,
   1118.29,
   1118.52,
   1118.75,
   1118.98,
   1119.44,
   1119.9,
   1120.36,
   1120.82,
   1121.28,
   1121.74,
   1122.2,
   1122.66,
   1123.12,
   1123.58,
   1124.04,
   1124.5,
   1124.96,
   1125.42,
   1125.88,
   1126.34,
   1126.8,
   1127.26,
   1127.72,
   1128.18,
   1128.64,
   1129.1,
   1129.56,
   1130.02,
   1130.48,
   1130.94,
   1131.4,
   1131.86,
   1132.32,
   1132.78,
   1133.24,
   1133.7,
   1134.16,
   1134.62,
   1135.08,
   1135.54,
   1136,
   1136};
   Double_t curvetot_fy1[145] = {
   0.6162995,
   0.7094237,
   0.8012687,
   0.8918347,
   0.9811216,
   1.069129,
   1.155858,
   1.241308,
   1.325478,
   1.40837,
   1.489982,
   1.570316,
   1.64937,
   1.727145,
   1.803641,
   1.878858,
   1.952796,
   2.025455,
   2.096834,
   2.166935,
   2.235756,
   2.303299,
   2.369562,
   2.434547,
   2.498252,
   2.560678,
   2.621825,
   2.681694,
   2.740286,
   2.797605,
   2.853666,
   2.908508,
   2.962246,
   3.015176,
   3.068044,
   3.122629,
   3.182958,
   3.257688,
   3.364439,
   3.537153,
   3.837566,
   4.371427,
   5.308762,
   6.904893,
   9.515393,
   13.59445,
   19.66545,
   28.26741,
   39.96843,
   55.88398,
   66.41278,
   79.948,
   98.34625,
   110.2155,
   124.449,
   141.5616,
   162.1126,
   186.6815,
   215.8326,
   250.0694,
   289.7804,
   335.1788,
   386.2409,
   442.6498,
   503.7498,
   568.5203,
   635.5744,
   769.3585,
   831.8995,
   888.5554,
   913.9864,
   937.1387,
   957.7731,
   975.6716,
   990.6423,
   1002.522,
   1011.181,
   1016.522,
   1018.487,
   1017.053,
   1012.236,
   1004.09,
   992.7055,
   978.208,
   960.7556,
   940.536,
   917.7631,
   892.6734,
   836.576,
   774.4204,
   708.4614,
   573.7443,
   508.7543,
   447.3406,
   390.5523,
   339.0726,
   293.2432,
   253.1087,
   218.4718,
   188.9556,
   164.0632,
   143.2334,
   125.8865,
   111.4605,
   89.35499,
   73.51192,
   61.56412,
   44.10414,
   31.47552,
   22.14433,
   15.48813,
   10.96972,
   8.056004,
   6.269921,
   5.228203,
   4.649523,
   4.342855,
   4.187251,
   4.110912,
   4.073735,
   4.054578,
   4.042905,
   4.03374,
   4.024854,
   4.015301,
   4.004697,
   3.992896,
   3.979843,
   3.96552,
   3.94992,
   3.933043,
   3.914887,
   3.895451,
   3.874737,
   3.852743,
   3.829471,
   3.804919,
   3.779088,
   3.751978,
   3.723589,
   3.693921,
   3.662974,
   3.630748,
   3.597243,
   3.597243};
   TGraph *graph = new TGraph(145,curvetot_fx1,curvetot_fy1);
   graph->SetName("curvetot");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_curvetot1 = new TH1F("Graph_curvetot1","Projection of totalPdf",145,1085.4,1140.6);
   Graph_curvetot1->SetMinimum(0);
   Graph_curvetot1->SetMaximum(1120.274);
   Graph_curvetot1->SetDirectory(0);
   Graph_curvetot1->SetStats(0);
   Graph_curvetot1->SetLineWidth(2);
   Graph_curvetot1->SetMarkerStyle(20);
   Graph_curvetot1->GetXaxis()->SetNdivisions(505);
   Graph_curvetot1->GetXaxis()->SetLabelFont(132);
   Graph_curvetot1->GetXaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetXaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetXaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetXaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetXaxis()->SetTitleFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelFont(132);
   Graph_curvetot1->GetYaxis()->SetLabelOffset(0.01);
   Graph_curvetot1->GetYaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetYaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetYaxis()->SetTitleOffset(0.95);
   Graph_curvetot1->GetYaxis()->SetTitleFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelFont(132);
   Graph_curvetot1->GetZaxis()->SetLabelSize(0.06);
   Graph_curvetot1->GetZaxis()->SetTitleSize(0.072);
   Graph_curvetot1->GetZaxis()->SetTitleOffset(1.2);
   Graph_curvetot1->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_curvetot1);
   
   graph->Draw("l");
   
   Double_t bkg_fx2[102] = {
   1090,
   1090.46,
   1090.92,
   1091.38,
   1091.84,
   1092.3,
   1092.76,
   1093.22,
   1093.68,
   1094.14,
   1094.6,
   1095.06,
   1095.52,
   1095.98,
   1096.44,
   1096.9,
   1097.36,
   1097.82,
   1098.28,
   1098.74,
   1099.2,
   1099.66,
   1100.12,
   1100.58,
   1101.04,
   1101.5,
   1101.96,
   1102.42,
   1102.88,
   1103.34,
   1103.8,
   1104.26,
   1104.72,
   1105.18,
   1105.64,
   1106.1,
   1106.56,
   1107.02,
   1107.48,
   1107.94,
   1108.4,
   1108.86,
   1109.32,
   1109.78,
   1110.24,
   1110.7,
   1111.16,
   1111.62,
   1112.08,
   1112.54,
   1113,
   1113.46,
   1113.92,
   1114.38,
   1114.84,
   1115.3,
   1115.76,
   1116.22,
   1116.68,
   1117.14,
   1117.6,
   1118.06,
   1118.52,
   1118.98,
   1119.44,
   1119.9,
   1120.36,
   1120.82,
   1121.28,
   1121.74,
   1122.2,
   1122.66,
   1123.12,
   1123.58,
   1124.04,
   1124.5,
   1124.96,
   1125.42,
   1125.88,
   1126.34,
   1126.8,
   1127.26,
   1127.72,
   1128.18,
   1128.64,
   1129.1,
   1129.56,
   1130.02,
   1130.48,
   1130.94,
   1131.4,
   1131.86,
   1132.32,
   1132.78,
   1133.24,
   1133.7,
   1134.16,
   1134.62,
   1135.08,
   1135.54,
   1136,
   1136};
   Double_t bkg_fy2[102] = {
   0.6162995,
   0.7094237,
   0.8012687,
   0.8918347,
   0.9811216,
   1.069129,
   1.155858,
   1.241308,
   1.325478,
   1.40837,
   1.489982,
   1.570316,
   1.64937,
   1.727145,
   1.803641,
   1.878858,
   1.952796,
   2.025455,
   2.096834,
   2.166935,
   2.235756,
   2.303299,
   2.369562,
   2.434547,
   2.498252,
   2.560678,
   2.621825,
   2.681693,
   2.740282,
   2.797591,
   2.853622,
   2.908374,
   2.961846,
   3.01404,
   3.064954,
   3.114589,
   3.162945,
   3.210023,
   3.255821,
   3.300339,
   3.343579,
   3.38554,
   3.426222,
   3.465624,
   3.503748,
   3.540592,
   3.576157,
   3.610444,
   3.643451,
   3.675179,
   3.705628,
   3.734798,
   3.762689,
   3.7893,
   3.814633,
   3.838686,
   3.861461,
   3.882956,
   3.903173,
   3.92211,
   3.939768,
   3.956147,
   3.971247,
   3.985068,
   3.99761,
   4.008872,
   4.018856,
   4.02756,
   4.034986,
   4.041132,
   4.045999,
   4.049588,
   4.051897,
   4.052927,
   4.052678,
   4.051149,
   4.048342,
   4.044256,
   4.03889,
   4.032246,
   4.024322,
   4.01512,
   4.004638,
   3.992877,
   3.979837,
   3.965518,
   3.94992,
   3.933043,
   3.914887,
   3.895451,
   3.874737,
   3.852743,
   3.829471,
   3.804919,
   3.779088,
   3.751978,
   3.723589,
   3.693921,
   3.662974,
   3.630748,
   3.597243,
   3.597243};
   graph = new TGraph(102,bkg_fx2,bkg_fy2);
   graph->SetName("bkg");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(2);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_bkg2 = new TH1F("Graph_bkg2","Projection of totalPdf",102,1085.4,1140.6);
   Graph_bkg2->SetMinimum(0.2726368);
   Graph_bkg2->SetMaximum(4.396589);
   Graph_bkg2->SetDirectory(0);
   Graph_bkg2->SetStats(0);
   Graph_bkg2->SetLineWidth(2);
   Graph_bkg2->SetMarkerStyle(20);
   Graph_bkg2->GetXaxis()->SetNdivisions(505);
   Graph_bkg2->GetXaxis()->SetLabelFont(132);
   Graph_bkg2->GetXaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetXaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetXaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetXaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetXaxis()->SetTitleFont(132);
   Graph_bkg2->GetYaxis()->SetLabelFont(132);
   Graph_bkg2->GetYaxis()->SetLabelOffset(0.01);
   Graph_bkg2->GetYaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetYaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetYaxis()->SetTitleOffset(0.95);
   Graph_bkg2->GetYaxis()->SetTitleFont(132);
   Graph_bkg2->GetZaxis()->SetLabelFont(132);
   Graph_bkg2->GetZaxis()->SetLabelSize(0.06);
   Graph_bkg2->GetZaxis()->SetTitleSize(0.072);
   Graph_bkg2->GetZaxis()->SetTitleOffset(1.2);
   Graph_bkg2->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_bkg2);
   
   graph->Draw("l");
   
   Double_t sigLM_fx3[145] = {
   1090,
   1090.46,
   1090.92,
   1091.38,
   1091.84,
   1092.3,
   1092.76,
   1093.22,
   1093.68,
   1094.14,
   1094.6,
   1095.06,
   1095.52,
   1095.98,
   1096.44,
   1096.9,
   1097.36,
   1097.82,
   1098.28,
   1098.74,
   1099.2,
   1099.66,
   1100.12,
   1100.58,
   1101.04,
   1101.5,
   1101.96,
   1102.42,
   1102.88,
   1103.34,
   1103.8,
   1104.26,
   1104.72,
   1105.18,
   1105.64,
   1106.1,
   1106.56,
   1107.02,
   1107.48,
   1107.94,
   1108.4,
   1108.86,
   1109.32,
   1109.78,
   1110.24,
   1110.7,
   1111.16,
   1111.62,
   1112.08,
   1112.54,
   1112.77,
   1113,
   1113.23,
   1113.345,
   1113.46,
   1113.575,
   1113.69,
   1113.805,
   1113.92,
   1114.035,
   1114.15,
   1114.265,
   1114.38,
   1114.495,
   1114.61,
   1114.725,
   1114.84,
   1115.07,
   1115.185,
   1115.3,
   1115.358,
   1115.415,
   1115.472,
   1115.53,
   1115.588,
   1115.645,
   1115.702,
   1115.76,
   1115.818,
   1115.875,
   1115.932,
   1115.99,
   1116.048,
   1116.105,
   1116.162,
   1116.22,
   1116.278,
   1116.335,
   1116.45,
   1116.565,
   1116.68,
   1116.91,
   1117.025,
   1117.14,
   1117.255,
   1117.37,
   1117.485,
   1117.6,
   1117.715,
   1117.83,
   1117.945,
   1118.06,
   1118.175,
   1118.29,
   1118.52,
   1118.75,
   1118.98,
   1119.44,
   1119.9,
   1120.36,
   1120.82,
   1121.28,
   1121.74,
   1122.2,
   1122.66,
   1123.12,
   1123.58,
   1124.04,
   1124.5,
   1124.96,
   1125.42,
   1125.88,
   1126.34,
   1126.8,
   1127.26,
   1127.72,
   1128.18,
   1128.64,
   1129.1,
   1129.56,
   1130.02,
   1130.48,
   1130.94,
   1131.4,
   1131.86,
   1132.32,
   1132.78,
   1133.24,
   1133.7,
   1134.16,
   1134.62,
   1135.08,
   1135.54,
   1136,
   1136};
   Double_t sigLM_fy3[145] = {
   8.893075e-29,
   1.039866e-27,
   1.163342e-26,
   1.245209e-25,
   1.27521e-24,
   1.24947e-23,
   1.171318e-22,
   1.050578e-21,
   9.015427e-21,
   7.402001e-20,
   5.814557e-19,
   4.370074e-18,
   3.14243e-17,
   2.161958e-16,
   1.423093e-15,
   8.962398e-15,
   5.400324e-14,
   3.113293e-13,
   1.717216e-12,
   9.062217e-12,
   4.575607e-11,
   2.210383e-10,
   1.021624e-09,
   4.517721e-09,
   1.911404e-08,
   7.73731e-08,
   2.996624e-07,
   1.110399e-06,
   3.936687e-06,
   1.335326e-05,
   4.333593e-05,
   0.0001345593,
   0.000399746,
   0.001136211,
   0.00308986,
   0.00803939,
   0.020013,
   0.04766568,
   0.1086186,
   0.2368139,
   0.4939863,
   0.9858873,
   1.882541,
   3.439269,
   6.011646,
   10.05386,
   16.08929,
   24.65696,
   36.32498,
   52.2088,
   62.72222,
   76.24238,
   94.62588,
   106.4878,
   120.7142,
   137.8197,
   158.3637,
   182.9257,
   212.0699,
   246.3,
   286.0043,
   331.396,
   382.4516,
   438.854,
   499.9476,
   564.7118,
   631.7598,
   765.5317,
   828.0667,
   884.7167,
   910.1448,
   933.2942,
   953.9257,
   971.8214,
   986.7893,
   998.6665,
   1007.322,
   1012.661,
   1014.623,
   1013.186,
   1008.366,
   1000.217,
   988.8304,
   974.3303,
   956.8753,
   936.653,
   913.8775,
   888.7852,
   832.6828,
   770.5221,
   704.5583,
   569.8315,
   504.8368,
   443.4185,
   386.6256,
   335.1415,
   289.3078,
   249.1689,
   214.5278,
   185.0075,
   160.1111,
   139.2773,
   121.9265,
   107.4966,
   85.38374,
   69.53361,
   57.57905,
   40.10653,
   27.46664,
   18.12548,
   11.46057,
   6.934737,
   4.014872,
   2.223922,
   1.178615,
   0.5976258,
   0.2899288,
   0.134573,
   0.05976256,
   0.02539248,
   0.01032252,
   0.004014866,
   0.001494036,
   0.0005319315,
   0.0001811987,
   5.905533e-05,
   1.841483e-05,
   5.493905e-06,
   1.568192e-06,
   4.282741e-07,
   1.119049e-07,
   2.797572e-08,
   6.691415e-09,
   1.531297e-09,
   3.352783e-10,
   7.023542e-11,
   1.407705e-11,
   2.699428e-12,
   4.952636e-13,
   8.693725e-14,
   1.460091e-14,
   2.346166e-15,
   3.606968e-16,
   5.30555e-17,
   5.30555e-17};
   graph = new TGraph(145,sigLM_fx3,sigLM_fy3);
   graph->SetName("sigLM");
   graph->SetTitle("Projection of totalPdf");
   graph->SetFillColor(1);
   graph->SetLineColor(3);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   graph->SetMarkerStyle(20);
   
   TH1F *Graph_sigLM3 = new TH1F("Graph_sigLM3","Projection of totalPdf",145,1085.4,1140.6);
   Graph_sigLM3->SetMinimum(0);
   Graph_sigLM3->SetMaximum(1116.085);
   Graph_sigLM3->SetDirectory(0);
   Graph_sigLM3->SetStats(0);
   Graph_sigLM3->SetLineWidth(2);
   Graph_sigLM3->SetMarkerStyle(20);
   Graph_sigLM3->GetXaxis()->SetNdivisions(505);
   Graph_sigLM3->GetXaxis()->SetLabelFont(132);
   Graph_sigLM3->GetXaxis()->SetLabelOffset(0.01);
   Graph_sigLM3->GetXaxis()->SetLabelSize(0.06);
   Graph_sigLM3->GetXaxis()->SetTitleSize(0.072);
   Graph_sigLM3->GetXaxis()->SetTitleOffset(0.95);
   Graph_sigLM3->GetXaxis()->SetTitleFont(132);
   Graph_sigLM3->GetYaxis()->SetLabelFont(132);
   Graph_sigLM3->GetYaxis()->SetLabelOffset(0.01);
   Graph_sigLM3->GetYaxis()->SetLabelSize(0.06);
   Graph_sigLM3->GetYaxis()->SetTitleSize(0.072);
   Graph_sigLM3->GetYaxis()->SetTitleOffset(0.95);
   Graph_sigLM3->GetYaxis()->SetTitleFont(132);
   Graph_sigLM3->GetZaxis()->SetLabelFont(132);
   Graph_sigLM3->GetZaxis()->SetLabelSize(0.06);
   Graph_sigLM3->GetZaxis()->SetTitleSize(0.072);
   Graph_sigLM3->GetZaxis()->SetTitleOffset(1.2);
   Graph_sigLM3->GetZaxis()->SetTitleFont(132);
   graph->SetHistogram(Graph_sigLM3);
   
   graph->Draw("l");
   
   TLegend *leg = new TLegend(0.2,0.02,0.4,0.42,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(132);
   leg->SetTextSize(0.06);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("curvetot","Total PDF","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("bkg","Background","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   entry=leg->AddEntry("sigLM","#Lambda M (dbl Gaus)","l");
   entry->SetLineColor(3);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(132);
   leg->Draw();
   
   TH1D *frame_4ac28d0__4 = new TH1D("frame_4ac28d0__4","A RooPlot of \"#Lambda mass\"",100,1086,1146);
   frame_4ac28d0__4->SetBinContent(1,1122.663);
   frame_4ac28d0__4->SetMaximum(1122.663);
   frame_4ac28d0__4->SetEntries(1);
   frame_4ac28d0__4->SetDirectory(0);
   frame_4ac28d0__4->SetStats(0);
   frame_4ac28d0__4->SetLineWidth(2);
   frame_4ac28d0__4->SetMarkerStyle(20);
   frame_4ac28d0__4->GetXaxis()->SetTitle("#Lambda mass (MeV)");
   frame_4ac28d0__4->GetXaxis()->SetNdivisions(505);
   frame_4ac28d0__4->GetXaxis()->SetLabelFont(132);
   frame_4ac28d0__4->GetXaxis()->SetLabelOffset(0.01);
   frame_4ac28d0__4->GetXaxis()->SetLabelSize(0.06);
   frame_4ac28d0__4->GetXaxis()->SetTitleSize(0.072);
   frame_4ac28d0__4->GetXaxis()->SetTitleOffset(0.95);
   frame_4ac28d0__4->GetXaxis()->SetTitleFont(132);
   frame_4ac28d0__4->GetYaxis()->SetTitle("Events/(5 MeV)");
   frame_4ac28d0__4->GetYaxis()->SetLabelFont(132);
   frame_4ac28d0__4->GetYaxis()->SetLabelOffset(0.01);
   frame_4ac28d0__4->GetYaxis()->SetLabelSize(0.06);
   frame_4ac28d0__4->GetYaxis()->SetTitleSize(0.072);
   frame_4ac28d0__4->GetYaxis()->SetTitleOffset(0.95);
   frame_4ac28d0__4->GetYaxis()->SetTitleFont(132);
   frame_4ac28d0__4->GetZaxis()->SetLabelFont(132);
   frame_4ac28d0__4->GetZaxis()->SetLabelSize(0.06);
   frame_4ac28d0__4->GetZaxis()->SetTitleSize(0.072);
   frame_4ac28d0__4->GetZaxis()->SetTitleOffset(1.2);
   frame_4ac28d0__4->GetZaxis()->SetTitleFont(132);
   frame_4ac28d0__4->Draw("AXISSAME");
   pad1->Modified();
   c1->cd();
   c1->Modified();
   c1->cd();
   c1->SetSelected(c1);
}