/// <summary> /// Specific options for ABCDExplorer. /// </summary> //class Options : CommandLineUtils.CommonOptions //{ //} /// <summary> /// Loop through a set of ABCD methods and try to dump /// some generic and dense info on what it is like. /// </summary> /// <param name="args"></param> static void Main(string[] args) { //Options opt = CommandLineUtils.ParseOptions<Options>(args); // Setup which pairs of variables we will look at. var abcdPairs = new[] { Tuple.Create("SumCalR_Sum2JTrackPt", JetEventTypeSumCalRPlot, JetEventTypeSum2JTrackPt), Tuple.Create("SumCalR_DRToTrackSum", JetEventTypeSumCalRPlot, JetEventDRToTrackSum), }; // Get the background along with the variables we are going to look at for each event. var backgrounds = CommandLineUtils.GetRequestedBackground() .AsEventStream(); // Do a background using (var output = new FutureTFile("ABCDExplorer.root")) { foreach (var vPair in abcdPairs) { var dir = output.mkdir(vPair.Item1); // Do something like the sum of logR and the NTrack variable Something dumb... var explorer = new ABCDCutExplorer <EventType>(vPair.Item2, vPair.Item3); // Do the uncorrelated version of the exploration. var info = DoABCDExploration(explorer, backgrounds, dir.mkdir("correlated")); // Next, get the uncorrelated version var unCorVars = UncorrelateVariables(info.CoVar, JetEventTypeSumCalRPlot, JetEventTypeSum2JTrackPt); var exploreUnCor = new ABCDCutExplorer <EventType>(unCorVars.Item1, unCorVars.Item2); DoABCDExploration(exploreUnCor, backgrounds, dir.mkdir("uncorrelated")); } } }
public void FutureFileEmptyInUsing() { var f = new FileInfo("FutureFileWriteHisto.root"); if (f.Exists) { f.Delete(); } using (var ftf = new FutureTFile(f)) { } f.Refresh(); Assert.IsTrue(f.Exists); }
public void FutureFileEmpty() { // Create an empty TFile, make sure that is good! var f = new FileInfo("FutureFileEmpty.root"); if (f.Exists) { f.Delete(); } var ftf = new FutureTFile(f); ftf.Write(); ftf.Close(); f.Refresh(); Assert.IsTrue(f.Exists); }
static void Main(string[] args) { // Get the input file from the command line. if (args.Length != 1) { throw new ArgumentException("Usage: PlotLLP <input-filename>"); } var f = new FileInfo(args[0]); if (!f.Exists) { throw new ArgumentException($"Unable to find file {f.FullName}."); } // Get the query guy we want to plot var q = LLPInfo.QueryableextrapTree.CreateQueriable(f); // And the output file. var rootFilename = Path.GetFileNameWithoutExtension(f.Name); var outputFile = new FileInfo($"info-{rootFilename}.root"); using (var of = new FutureTFile(outputFile)) { // Do a few generic plots on the whole thing q .GenericPlots(of, "all"); // Right around the center where there are some real differences in Lxy q .GenericPlotsInSquare(2000, 3500, of); q .GenericPlotsInSquare(2500, 3000, of); q .Where(evt => evt.RegionA) .GenericPlots(of, "regionA"); q .Where(evt => evt.RegionA) .GenericPlotsInSquare(2000, 3500, of, "A"); q .Where(evt => evt.RegionA) .GenericPlotsInSquare(2500, 3000, of, "A"); } }
static void Main(string[] args) { var t = new NTStopwatch(); t.Start(); var filename = @"C:\Users\gordo\Documents\GRIDDS\user.emma.mc15_13TeV.361023.Pythia8EvtGen_A14NNPDF23LO_jetjet_JZ3W.merge.DAOD_EXOT15.e3668_s2576_s2132_r7773_r7676_p2952.v201\copied\ntuples_QCD_JZ3__0_addFullEtaMLP.root"; var tree = ROOTData.QueryablerecoTree.CreateQueriable(new FileInfo(filename)); tree.IgnoreQueryCache = true; using (var f = new FutureTFile(new FileInfo("../../../../01.root"))) { tree .Select(e => e.event_HTMiss) .Plot("met", "MET; Missing H_{T} [GeV]", 100, 0.0, 500.0) .Save(f); } t.Stop(); t.Print(); WriteLine("done"); }
public void FutureFileWriteWithClose() { var f = new FileInfo("FutureFileWriteWithClose.root"); if (f.Exists) { f.Delete(); } while (f.Exists) { f.Refresh(); } using (var ftf = new FutureTFile(f)) { ftf.Close(); } f.Refresh(); Assert.IsTrue(f.Exists); }
public void DoNotHoldRootLock() { var fl = new FileInfo("CommandLineCommonExecutor.root"); using (var f = new FutureTFile(fl)) { var h = new LockingFutureValue() as IFutureValue <NTObject>; h.Save(f); } // Make sure it was written out! var fr = ROOTNET.NTFile.Open(fl.FullName, "READ"); try { var myh = fr.Get("hi") as NTH1F; Assert.IsNotNull(myh); Assert.AreEqual(1, (int)myh.GetEntries()); } finally { fr.Close(); } }