本文整理汇总了C#中QueriableDummy.Plot方法的典型用法代码示例。如果您正苦于以下问题:C# QueriableDummy.Plot方法的具体用法?C# QueriableDummy.Plot怎么用?C# QueriableDummy.Plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueriableDummy
的用法示例。
在下文中一共展示了QueriableDummy.Plot方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestPlotFromTemplateWithWeight
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!");
}
示例2: TestCachingOfSimpleHistoWithNameTitleChange
public void TestCachingOfSimpleHistoWithNameTitleChange()
{
/// Do two identical queries. Make sure only one causes an actual run!
var rootFile = TestUtils.CreateFileOfInt(5);
///
/// Generate a proxy .h file that we can use
///
var proxyFile = TestUtils.GenerateROOTProxy(rootFile, "dude");
///
/// Ok, now we can actually see if we can make it "go".
///
ntuple._gProxyFile = proxyFile.FullName;
var exe = new TTreeQueryExecutor(new[] { rootFile }, "dude", typeof(ntuple), typeof(TestNtupe));
Assert.AreEqual(0, exe.CountExecutionRuns, "exe runs initialization");
Assert.AreEqual(0, exe.CountCacheHits, "cache hits initialization");
///
/// Get a simple query we can "play" with
///
var q = new QueriableDummy<TestNtupe>();
var dude = q.Plot("hi", "there", 10, 0.0, 20.0, d => d.run);
var query = DummyQueryExectuor.LastQueryModel;
DummyQueryExectuor.FinalResult.DumpCodeToConsole();
var result = exe.ExecuteScalar<ROOTNET.Interface.NTH1>(query);
Assert.AreEqual(1, exe.CountExecutionRuns, "after exe run");
Assert.AreEqual(0, exe.CountCacheHits, "after exe run");
///
/// Re-run a slightly different query. Should still be cached.
///
var dude2 = q.Plot("there", "high", 10, 0.0, 20.0, d => d.run);
var query2 = DummyQueryExectuor.LastQueryModel;
var result2 = exe.ExecuteScalar<ROOTNET.Interface.NTH1>(query2);
Assert.AreEqual(1, exe.CountExecutionRuns, "after exe and cache run");
Assert.AreEqual(1, exe.CountCacheHits, "after exe and cache run");
}
示例3: TestFromTemplateWithStraightSequenceDefinition
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!");
}
示例4: TestPlotFromTemplateFromTypeNothing
public void TestPlotFromTemplateFromTypeNothing()
{
// Create the plot.
var pRaw1 = PlottingUtils.MakePlotterSpec<double>(10, 0.0, 10.0, v => v, "dude", "fork");
var pRaw2 = pRaw1.FromType();
var pRaw = pRaw2.FromType((TTreeQueryExecutorTest.TestNtupeArrJets j) => j.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().All(l => !l.Contains("0.5")), "no line contains the proper size call!");
}
示例5: TestPlotFromTemplateNullNameAndDescrip
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: DealwithTwoEmptySubsAndKeepSpacesCorrectly
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);
}
示例7: RemoveSpacesFromNames
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);
}