Print

Print


Commit in slic on MAIN
macros/cleanup.mac+11.1 -> 1.2
      /debug.mac+11.1 -> 1.2
scripts/gdb.sh+11.1 -> 1.2
src/StdHepToLcioConvertor.cc+19-81.26 -> 1.27
+22-8
4 modified files
Added additional loop to StdHepToLcioConverter for adding parents only after all particles have been created.

slic/macros
cleanup.mac 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- cleanup.mac	22 Sep 2005 22:05:59 -0000	1.1
+++ cleanup.mac	12 Oct 2005 19:31:29 -0000	1.2
@@ -2,3 +2,4 @@
 /mcp/printInitialCollection false
 /mcp/printFinalCollection false
 /tracking/verbose 0
+/mcp/verbose 0

slic/macros
debug.mac 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- debug.mac	22 Sep 2005 22:05:59 -0000	1.1
+++ debug.mac	12 Oct 2005 19:31:29 -0000	1.2
@@ -1,4 +1,5 @@
 /event/enableEventTimer
+/mcp/verbose 4
 /mcp/printInitialCollection
 /mcp/printFinalCollection
 /tracking/verbose 2

slic/scripts
gdb.sh 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- gdb.sh	15 Jul 2005 05:57:21 -0000	1.1
+++ gdb.sh	12 Oct 2005 19:31:29 -0000	1.2
@@ -1 +1,2 @@
+source $SLIC_BASE/scripts/ld-path.sh
 gdb $SLIC_BASE/bin/Linux-g++/slic -command=gdb.cmd

slic/src
StdHepToLcioConvertor.cc 1.26 -> 1.27
diff -u -r1.26 -r1.27
--- StdHepToLcioConvertor.cc	12 Oct 2005 17:22:39 -0000	1.26
+++ StdHepToLcioConvertor.cc	12 Oct 2005 19:31:29 -0000	1.27
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/StdHepToLcioConvertor.cc,v 1.26 2005/10/12 17:22:39 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/StdHepToLcioConvertor.cc,v 1.27 2005/10/12 19:31:29 jeremy Exp $
 #include "StdHepToLcioConvertor.hh"
 
 // slic
@@ -72,7 +72,7 @@
     }
 #endif
 
-    // first loop over records to create MCP and set parent links
+    /* Loop #1 : Create MCParticles with no parentage or daughter links. */
     int ntracks = m_reader->nTracks();
     for ( int ihep = 0;
 	  ihep < ntracks;
@@ -88,9 +88,20 @@
     }
 #endif
 
-    // FIXME: First loop should not set parentage.  Add additional loop to do this.
+    /* Loop #2 : Set the MCParticle parentage. */
+    for ( int ihep = 0;
+	  ihep < ntracks;
+	  ihep++ ) {
+
+      MCParticleImpl* mcp =
+	dynamic_cast<MCParticleImpl*> ( m_currentMcpColl->getElementAt(ihep) );
 
-    // second loop to set daughter links
+      if ( mcp ) {
+	setupParents( ihep, mcp, m_reader, m_currentMcpColl );
+      }
+    }
+
+    /* Loop #3 : Setup the daughters. */
     for ( int ihep = 0;
 	  ihep < ntracks;
 	  ihep++ ) {
@@ -114,7 +125,10 @@
 #endif
   }
 
-  // create based on args
+  /*
+   * Create an MCParticle from a single StdHep particle record.
+   * NOTE: Does not setup parentage or daughters.
+   */
   IMPL::MCParticleImpl* StdHepToLcioConvertor::createMcpFromStdHep( int ihep, lStdHep* rdr, EVENT::LCCollection* mcpColl )
   {
     assert(mcpColl);
@@ -197,9 +211,6 @@
     // add to mcpColl
     mcpColl->addElement( mcp );
 
-    // setup parentage
-    setupParents( ihep, mcp, rdr, mcpColl );
-
 #ifdef SLIC_VERBOSE
     if ( verbose() > 1 ) {
       cout << "done with ihep <" << ihep << ">" << endl;
CVSspam 0.2.8