Пример #1
0
        public void DealwithTwoEmptySubsAndKeepSpacesCorrectly()
        {
            // Create the plot
            var p = PlottingUtils.MakePlotterSpec <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents>(10, 0.0, 10.0, evt => evt.jets.Select(j => j.myvectorofint).First(), "dude{0}{1}abides", "fork {0}{1} this over");

            // Create the query. We aren't very intersted in the result, but rather the result.
            var q = new QueriableDummy <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents>();
            var r = q.Plot(p, "", "hi");

            var resultVar = DummyQueryExectuor.FinalResult.ResultValue as DeclarableParameter;
            var rootObj   = resultVar.InitialValue as ROOTObjectStaticHolder;

            Assert.AreEqual("dudehiabides", rootObj.OriginalName);
            Assert.AreEqual("fork hi this over", rootObj.OriginalTitle);
        }
Пример #2
0
        public void RemoveSpacesFromNames()
        {
            // Create the plot
            var p = PlottingUtils.MakePlotterSpec <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents>(10, 0.0, 10.0, evt => evt.jets.Select(j => j.myvectorofint).First(), "dude{0}", "fork {0}");

            // Create the query. We aren't very intersted in the result, but rather the result.
            var q = new QueriableDummy <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents>();
            var r = q.Plot(p, " is hell");

            var resultVar = DummyQueryExectuor.FinalResult.ResultValue as DeclarableParameter;
            var rootObj   = resultVar.InitialValue as ROOTObjectStaticHolder;

            Assert.AreEqual("dudeishell", rootObj.OriginalName);
            Assert.AreEqual("fork  is hell", rootObj.OriginalTitle);
        }
Пример #3
0
        public void TestPlotFromTemplateWithWeight()
        {
            // Create the plot

            var p = PlottingUtils.MakePlotterSpec <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupe>(10, 0.0, 10.0, evt => evt.run, "dude", "fork", weight: evt => 0.5);

            ///
            /// Get a simple query we can "play" with
            ///

            var q = new QueriableDummy <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupe>();
            var r = q.Plot(p, "fork");

            DummyQueryExectuor.FinalResult.DumpCodeToConsole();

            Assert.IsTrue(DummyQueryExectuor.FinalResult.CodeBody.CodeItUp().Where(l => l.Contains("Fill(((double)(*this).run),0.5*1.0)")).Any(), "no line contains the proper size call!");
        }
Пример #4
0
        public void TestFromTemplateWithStraightSequenceDefinition()
        {
            // Create the plot

            var p = PlottingUtils.MakePlotterSpec <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents>(10, 0.0, 10.0, evt => evt.jets.Select(j => (double)j.myvectorofint), "dude", "fork");

            ///
            /// Get a simple query we can "play" with
            ///

            var q = new QueriableDummy <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents>();
            var r = q.Plot(p, "fork");

            DummyQueryExectuor.FinalResult.DumpCodeToConsole();

            Assert.IsTrue(DummyQueryExectuor.FinalResult.DumpCode().Where(l => l.Contains("(*(*this).myvectorofint).size()")).Any(), "no line contains the proper size call!");
        }
Пример #5
0
        public void TestPlotFromTemplateNullNameAndDescrip()
        {
            // Create the plot.
            var pRaw   = PlottingUtils.MakePlotterSpec <TTreeQueryExecutorTest.TestNtupeArrJets>(10, 0.0, 10.0, v => v.myvectorofint);
            var pEvent = pRaw.FromManyOfType((LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents evt) => evt.jets, "more jets");

            ///
            /// Get a simple query we can "play" with
            ///

            var q = new QueriableDummy <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents>();
            var r = q.Plot(pEvent, "fork");

            DummyQueryExectuor.FinalResult.DumpCodeToConsole();

            Assert.IsTrue(DummyQueryExectuor.FinalResult.CodeBody.CodeItUp().Where(l => l.Contains("(*(*this).myvectorofint).size()")).Any(), "no line contains the proper size call!");
        }
Пример #6
0
        public void TestPlotFromTemplateForTranslated()
        {
            // Create the plot

            var p = PlottingUtils.MakePlotterSpec <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents>(10, 0.0, 10.0, evt => evt.jets.Select(j => j.myvectorofint).First(), "dude", "fork");

            ///
            /// Get a simple query we can "play" with
            ///

            var q = new QueriableDummy <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents>();
            var r = q.Plot(p, "fork");

            DummyQueryExectuor.FinalResult.DumpCodeToConsole();

            Assert.IsTrue(DummyQueryExectuor.FinalResult.CodeBody.CodeItUp().Concat(DummyQueryExectuor.FinalResult.QMFunctions.SelectMany(qmf => qmf.StatementBlock.CodeItUp())).Where(l => l.Contains("(*(*this).myvectorofint).size()")).Any(), "no line contains the proper size call!");
        }
Пример #7
0
        public void TestPlotFromTemplateFromTypeConvertAndWeight()
        {
            // Create the plot.
            var pRaw1  = PlottingUtils.MakePlotterSpec <double>(10, 0.0, 10.0, v => v, "dude", "fork");
            var pRaw   = pRaw1.FromType((TTreeQueryExecutorTest.TestNtupeArrJets j) => j.myvectorofint, weight: j => 0.5);
            var pEvent = pRaw.FromManyOfType((LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents evt) => evt.jets, "more jets");

            ///
            /// Get a simple query we can "play" with
            ///

            var q = new QueriableDummy <LINQToTTreeLib.TTreeQueryExecutorTest.TestNtupeArrEvents>();
            var r = q.Plot(pEvent, "fork");

            DummyQueryExectuor.FinalResult.DumpCodeToConsole();

            Assert.IsTrue(DummyQueryExectuor.FinalResult.CodeBody.CodeItUp().Where(l => l.Contains("0.5")).Any(), "no line contains the proper size call!");
        }