Print

Print


Commit in trf++/test/gtrfit on MAIN
BiGTrackFitter_t.cpp+50added 1.1
GTrackResidual_t.cpp+50added 1.1
GTrackSmoothingRefitter2_t.cpp+78added 1.1
GTrackSmoothingRefitter_t.cpp+79added 1.1
+257
4 added files
component tests. Need work

trf++/test/gtrfit
BiGTrackFitter_t.cpp added at 1.1
diff -N BiGTrackFitter_t.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ BiGTrackFitter_t.cpp	15 Aug 2011 17:29:12 -0000	1.1
@@ -0,0 +1,50 @@
+// BiGTrackFitter_t.cpp
+
+#include "gtrfit/BiGTrackFitter.hpp"
+#include <iostream>
+#include <string>
+#include <cassert>
+#include "trfbase/PropDirectedTest.h"
+
+using std::cout;
+using std::cerr;
+using std::endl;
+using std::string;
+using namespace trf;
+
+//**********************************************************************
+
+int main( ) {
+
+  string component = "BiGTrackFitter";
+  string ok_prefix = component + " (I): ";
+  string error_prefix = component + " test (E): ";
+
+  cout << ok_prefix
+       << "---------- Testing component " + component
+          + ". ----------" << endl;
+
+  // Make sure assert is enabled.
+  bool assert_flag = false;
+  assert ( ( assert_flag = true, assert_flag ) );
+  if ( ! assert_flag ) {
+    cerr << "Assert is disabled" << endl;
+    return 1;
+  }
+
+  //********************************************************************
+
+  cout << "Construct." << endl;
+  PropagatorPtr pprop(new PropTest);
+  BiGTrackFitter fit(pprop, 200.);
+
+  //********************************************************************
+
+  cout << ok_prefix
+       << "------------- All tests passed. -------------" << endl;
+  return 0;
+
+  //********************************************************************
+
+}
+

trf++/test/gtrfit
GTrackResidual_t.cpp added at 1.1
diff -N GTrackResidual_t.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ GTrackResidual_t.cpp	15 Aug 2011 17:29:12 -0000	1.1
@@ -0,0 +1,50 @@
+// GTrackResidual_t.cpp
+
+#include "gtrfit/GTrackResidual.hpp"
+#include <iostream>
+#include <string>
+#include <cassert>
+#include "trfbase/PropagatorPtr.h"
+#include "trfbase/PropDirectedTest.h"
+
+using std::cout;
+using std::cerr;
+using std::endl;
+using std::string;
+using trf::PropagatorPtr;
+
+//**********************************************************************
+
+int main( ) {
+
+  string component = "GTrackResidual";
+  string ok_prefix = component + " (I): ";
+  string error_prefix = component + " test (E): ";
+
+  cout << ok_prefix
+       << "---------- Testing component " + component
+          + ". ----------" << endl;
+
+  // Make sure assert is enabled.
+  bool assert_flag = false;
+  assert ( ( assert_flag = true, assert_flag ) );
+  if ( ! assert_flag ) {
+    cerr << "Assert is disabled" << endl;
+    return 1;
+  }
+
+  //********************************************************************
+
+  PropagatorPtr pprop(new PropTest);
+  GTrackResidual res(pprop);
+
+  //********************************************************************
+
+  cout << ok_prefix
+       << "------------- All tests passed. -------------" << endl;
+  return 0;
+
+  //********************************************************************
+
+}
+

trf++/test/gtrfit
GTrackSmoothingRefitter2_t.cpp added at 1.1
diff -N GTrackSmoothingRefitter2_t.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ GTrackSmoothingRefitter2_t.cpp	15 Aug 2011 17:29:12 -0000	1.1
@@ -0,0 +1,78 @@
+// GTrackSmoothingRefitter2_t.cpp
+
+#include "gtrfit/GTrackSmoothingRefitter2.hpp"
+#include "gtrbase/GTrackTest.hpp"
+#include "trfcyl/PropCyl.h"
+#include <iostream>
+#include <string>
+#include <cassert>
+
+using std::cout;
+using std::cerr;
+using std::endl;
+using std::string;
+using std::vector;
+using namespace trf;
+
+//**********************************************************************
+
+int main( ) {
+
+  string component = "GTrackSmoothingRefitter2";
+  string ok_prefix = component + " (I): ";
+  string error_prefix = component + " test (E): ";
+
+  cout << ok_prefix
+       << "---------- Testing component " + component
+          + ". ----------" << endl;
+
+  // Make sure assert is enabled.
+  bool assert_flag = false;
+  assert ( ( assert_flag = true, assert_flag ) );
+  if ( ! assert_flag ) {
+    cerr << "Assert is disabled" << endl;
+    return 1;
+  }
+
+  //********************************************************************
+
+  GTrackTest test(ok_prefix);
+  int nclus = test.nclus;
+  int nmiss = test.nmiss;
+  int nstate = nclus + nmiss;
+  const vector<double>& ss = test.ss;
+  const vector<SurfacePtr>& surfs = test.surfs;
+  const GTrack::StateList& states = test.stateset;
+  const GTrack& gtr0 = test.gtr;
+  assert( gtr0.get_states().size() == nstate );
+  cout << "Starting GTrack: " << endl << gtr0 << endl;
+ 
+  //test constructor
+  cout << "Testing Constructor " << endl;
+  //Specify the order...
+  int order = 1;
+  //Build a propagator...
+  double bfield = 2.0;
+  PropagatorPtr pcylcyl( new PropCyl(ObjDoublePtr(new ObjDouble(bfield))));
+
+  GTrackSmoothingRefitter2 gtf(pcylcyl, 200.);
+
+  // test the fitter
+  // We skip this because we cannot handle cluster indices without
+  // a chunk and an event.
+  //cout << "Fitting the Gtrack... " << endl;
+  //GTrack gtr1 = gtr0;
+  //gtf.fit(gtr1);
+  //cout << "Refit GTrack: " << endl << gtr1 << endl;
+  //assert( gtr0.get_states().size() == nstate );
+
+  //********************************************************************
+
+  cout << ok_prefix
+       << "------------- All tests passed. -------------" << endl;
+  return 0;
+
+  //********************************************************************
+
+}
+

trf++/test/gtrfit
GTrackSmoothingRefitter_t.cpp added at 1.1
diff -N GTrackSmoothingRefitter_t.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ GTrackSmoothingRefitter_t.cpp	15 Aug 2011 17:29:12 -0000	1.1
@@ -0,0 +1,79 @@
+// GTrackSmoothingRefitter_t.cpp
+
+#include "gtrfit/GTrackSmoothingRefitter.hpp"
+#include "gtrbase/GTrackTest.hpp"
+#include "trfcyl/PropCyl.h"
+#include <iostream>
+#include <string>
+#include <cassert>
+
+using std::cout;
+using std::cerr;
+using std::endl;
+using std::string;
+using std::vector;
+using namespace trf;
+
+//**********************************************************************
+
+int main( ) {
+
+  string component = "GTrackSmoothingRefitter";
+  string ok_prefix = component + " (I): ";
+  string error_prefix = component + " test (E): ";
+
+  cout << ok_prefix
+       << "---------- Testing component " + component
+          + ". ----------" << endl;
+
+  // Make sure assert is enabled.
+  bool assert_flag = false;
+  assert ( ( assert_flag = true, assert_flag ) );
+  if ( ! assert_flag ) {
+    cerr << "Assert is disabled" << endl;
+    return 1;
+  }
+
+  //********************************************************************
+
+  GTrackTest test(ok_prefix);
+  int nclus = test.nclus;
+  int nmiss = test.nmiss;
+  int nstate = nclus + nmiss;
+  const vector<double>& ss = test.ss;
+  const vector<SurfacePtr>& surfs = test.surfs;
+  const GTrack::StateList& states = test.stateset;
+  const GTrack& gtr0 = test.gtr;
+  assert( gtr0.get_states().size() == nstate );
+  cout << "Starting GTrack: " << endl << gtr0 << endl;
+ 
+  //test constructor
+  cout << "Testing Constructor " << endl;
+  //Specify the order...
+  int order = 1;
+  //Build a propagator...
+  double bfield = 2.0;
+  PropagatorPtr pcylcyl( new PropCyl(ObjDoublePtr(new ObjDouble(bfield))));
+
+  GTrackSmoothingRefitter gtf(pcylcyl, GTrackSmoothingRefitter::IN_OUT, 
+			      200.);
+
+  // test the fitter
+  // We skip this because we cannot handle cluster indices without
+  // a chunk and an event.
+  //cout << "Fitting the Gtrack... " << endl;
+  //GTrack gtr1 = gtr0;
+  //gtf.fit(gtr1);
+  //cout << "Refit GTrack: " << endl << gtr1 << endl;
+  //assert( gtr0.get_states().size() == nstate );
+
+  //********************************************************************
+
+  cout << ok_prefix
+       << "------------- All tests passed. -------------" << endl;
+  return 0;
+
+  //********************************************************************
+
+}
+
CVSspam 0.2.8