public void TestSetBogusPropertyName() { var tlz = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var dtlz = (dynamic)tlz; dtlz.XYBogus = 10.0; }
public void TestDoubleTimes() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var a3 = a1 * a1; Assert.AreEqual(16.0 - 1.0 - 4.0 - 9.0, a3, "magnitude"); }
public static ROOTNET.NTLorentzVector CreateTLZNoResult(double pt, double eta, double phi, double E) { throw new NotImplementedException("This should never get called!"); var tlz = new ROOTNET.NTLorentzVector(); tlz.SetPtEtaPhiE(pt, eta, phi, E); return(tlz); }
public void TestUnary() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var a3 = -a1; Assert.AreEqual(-1.0, a3.X(), "X"); Assert.AreEqual(-2.0, a3.Y(), "Y"); Assert.AreEqual(-3.0, a3.Z(), "Z"); Assert.AreEqual(-4.0, a3.T(), "T"); }
public static ROOTNET.NTLorentzVector CreateTLZ(double pt, double eta, double phi) { throw new NotImplementedException("This should never get called!"); #if false var tlz = new ROOTNET.NTLorentzVector(); tlz.SetPtEtaPhiM(pt, eta, phi, 139.6); return(tlz); #endif }
public static ROOTNET.NTLorentzVector CreateTLZPxPyPzM(double px, double py, double pz, double M) { throw new NotImplementedException("This should never get called!"); #if false var tlz = new ROOTNET.NTLorentzVector(); tlz.SetXYZM(px, py, pz, M); return(tlz); #endif }
public static double DeltaR2(this ROOTNET.NTLorentzVector v1, ROOTNET.NTLorentzVector v2) { throw new NotImplementedException("this should never get called"); #if false double deta = v1.Eta() - v2.Eta(); double deltaphi = ROOTNET.NTVector2.Phi_mpi_pi(v1.Phi() - v2.Phi()); return(deta * deta + deltaphi * deltaphi); #endif }
public void TestScaling() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var a3 = 2.0 * a1; Assert.AreEqual(2.0, a3.X(), "X"); Assert.AreEqual(4.0, a3.Y(), "Y"); Assert.AreEqual(6.0, a3.Z(), "Z"); Assert.AreEqual(8.0, a3.T(), "T"); }
public void TestUnary() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var a3 = -a1; Assert.AreEqual(-1.0, a3.X(), "X"); Assert.AreEqual(-2.0, a3.Y(), "Y"); Assert.AreEqual(-3.0, a3.Z(), "Z"); Assert.AreEqual(-4.0, a3.T(), "T"); }
public void TestSubtraction2() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var a2 = new ROOTNET.NTLorentzVector(0.5, 0.5, 0.5, 0.5); var a3 = a2 - a1; Assert.AreEqual(-0.5, a3.X(), "X"); Assert.AreEqual(-1.5, a3.Y(), "Y"); Assert.AreEqual(-2.5, a3.Z(), "Z"); Assert.AreEqual(-3.5, a3.T(), "T"); }
public void TestAdditionWithObjectInterfaces1() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); ROOTNET.Interface.NTLorentzVector a2 = (new ROOTNET.NTLorentzVector(0.5, 0.5, 0.5, 0.5)); var a3 = a1 + a2; Assert.AreEqual(1.5, a3.X(), "X"); Assert.AreEqual(2.5, a3.Y(), "Y"); Assert.AreEqual(3.5, a3.Z(), "Z"); Assert.AreEqual(4.5, a3.T(), "T"); }
public void TestAdditionWithObjects2() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var a2 = new ROOTNET.NTLorentzVector(0.5, 0.5, 0.5, 0.5); var a3 = a2 + a1; Assert.AreEqual(1.5, a3.X(), "X"); Assert.AreEqual(2.5, a3.Y(), "Y"); Assert.AreEqual(3.5, a3.Z(), "Z"); Assert.AreEqual(4.5, a3.T(), "T"); }
public void TestAdditionWithObjects2() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var a2 = new ROOTNET.NTLorentzVector(0.5, 0.5, 0.5, 0.5); var a3 = a2 + a1; Assert.AreEqual(1.5, a3.X(), "X"); Assert.AreEqual(2.5, a3.Y(), "Y"); Assert.AreEqual(3.5, a3.Z(), "Z"); Assert.AreEqual(4.5, a3.T(), "T"); }
public void TestSubtraction2() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var a2 = new ROOTNET.NTLorentzVector(0.5, 0.5, 0.5, 0.5); var a3 = a2 - a1; Assert.AreEqual(-0.5, a3.X(), "X"); Assert.AreEqual(-1.5, a3.Y(), "Y"); Assert.AreEqual(-2.5, a3.Z(), "Z"); Assert.AreEqual(-3.5, a3.T(), "T"); }
public void TestAdditionWithObjectInterfaces1() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); ROOTNET.Interface.NTLorentzVector a2 = (new ROOTNET.NTLorentzVector(0.5, 0.5, 0.5, 0.5)); var a3 = a1 + a2; Assert.AreEqual(1.5, a3.X(), "X"); Assert.AreEqual(2.5, a3.Y(), "Y"); Assert.AreEqual(3.5, a3.Z(), "Z"); Assert.AreEqual(4.5, a3.T(), "T"); }
public void TestTParameterArgument() { var tlz = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); // // Make sure to create the TParameter guy. // NOTE: this program must be run in an environment that knows where cl.exe is! // var interp = ROOTNET.NTInterpreter.Instance(); var gSystem = ROOTNET.NTSystem.gSystem; using (var output = File.CreateText("tlzemitter.h")) { output.WriteLine("#include \"TLorentzVector.h\""); output.WriteLine("ostream& operator << (ostream &os, const TLorentzVector &v) {"); output.WriteLine(" os << \"TLZ\";"); output.WriteLine(" return os;"); output.WriteLine("}"); output.WriteLine("TLorentzVector operator*= (const TLorentzVector &v1, const TLorentzVector &v2) {"); output.WriteLine("return TLorentzVector();"); output.WriteLine("}"); } interp.GenerateDictionary("TParameter<TLorentzVector>", "tlzemitter.h;TParameter.h;TLorentzVector.h"); // // Now that dict is created, can we use dynamic crap to actually go after it? :-) // var c = ROOTNET.NTClass.GetClass("TParameter<TLorentzVector>"); Assert.IsNotNull(c, "not tclass got defined"); dynamic param = ROOTNET.Utility.ROOTCreator.CreateByName("TParameter<TLorentzVector>", new object[] { "Dude", tlz }); Assert.IsNotNull(param, "Unable to create TParameter"); Assert.AreEqual("Dude", param.Name, "Name of param"); var tlzback = param.Val; Assert.AreEqual(2.0, tlzback.Y, "Y value of tlz we stashed in teh parameter"); }
public async Task TestForNonTObjectCaching() { var f = MakeRootFile("TestForNonTObjectCaching"); var query = MakeQuery(0); /// Cache a result var h = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var q = new QueryResultCache(); await q.CacheItem(q.GetKey(new Uri[] { f }, "test", null, null, query, dateChecker: u => File.GetLastWriteTime(u.LocalPath)), new NTObject[] { h }.AsRunInfoArray()); /// And make sure the lookup gets back the same object! var r = await Lookup <NTLorentzVector>(q, f, "test", null, null, query, new DummyHistoSaver()); Assert.IsTrue(r.Item1, "SHould get back the same object"); Assert.IsNotNull(r.Item2, "tlz should not be null"); Assert.AreEqual(1.0, r.Item2.X(), "x value"); Assert.AreEqual(2.0, r.Item2.Y(), "y value"); Assert.AreEqual(4.0, r.Item2.T(), "t value"); }
public void TestDoubleTimes() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var a3 = a1*a1; Assert.AreEqual(16.0 - 1.0 - 4.0 - 9.0, a3, "magnitude"); }
public static ROOTNET.NTLorentzVector CreateTLZNoResult(double pt, double eta, double phi, double E) { throw new NotImplementedException("This should never get called!"); var tlz = new ROOTNET.NTLorentzVector(); tlz.SetPtEtaPhiE(pt, eta, phi, E); return tlz; }
public void TestSetBogusPropertyName() { var tlz = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var dtlz = (dynamic)tlz; dtlz.XYBogus = 10.0; }
public static ROOTNET.NTLorentzVector CreateTLZ(double pt, double eta, double phi, double E) { throw new NotImplementedException("This should never get called!"); #pragma warning disable 0162 var tlz = new ROOTNET.NTLorentzVector(); tlz.SetPtEtaPhiE(pt, eta, phi, E); return tlz; #pragma warning disable 0162 }
public void TestScaling() { var a1 = new ROOTNET.NTLorentzVector(1.0, 2.0, 3.0, 4.0); var a3 = 2.0 * a1; Assert.AreEqual(2.0, a3.X(), "X"); Assert.AreEqual(4.0, a3.Y(), "Y"); Assert.AreEqual(6.0, a3.Z(), "Z"); Assert.AreEqual(8.0, a3.T(), "T"); }