Commit in projects/slic/branches/v04-00-00-pre on MAIN
include/TrackSummary.hh+13132 -> 3133
src/TrackSummary.cc+21-23132 -> 3133
+22-2
2 modified files
Fix SLIC-235 where time was not set in new MCParticle handling code.

projects/slic/branches/v04-00-00-pre/include
TrackSummary.hh 3132 -> 3133
--- projects/slic/branches/v04-00-00-pre/include/TrackSummary.hh	2014-05-20 21:45:08 UTC (rev 3132)
+++ projects/slic/branches/v04-00-00-pre/include/TrackSummary.hh	2014-05-20 21:59:25 UTC (rev 3133)
@@ -249,6 +249,7 @@
     TrackSummary* _parent;
     G4int _PDG;
     G4ThreeVector _vertex;
+    G4double _globalTime;
 
     G4bool _toBeSaved;
 

projects/slic/branches/v04-00-00-pre/src
TrackSummary.cc 3132 -> 3133
--- projects/slic/branches/v04-00-00-pre/src/TrackSummary.cc	2014-05-20 21:45:08 UTC (rev 3132)
+++ projects/slic/branches/v04-00-00-pre/src/TrackSummary.cc	2014-05-20 21:59:25 UTC (rev 3133)
@@ -36,12 +36,27 @@
     /* The momentum appears to be set correctly before tracking occurs so set here along with energy. */
     _momentum = track->GetMomentum();
     _energy = track->GetTotalEnergy();
+
+    /* Assign track time. */
+    // G4cout << "setting track time to " << track->GetGlobalTime() << G4endl;
+    _globalTime = track->GetGlobalTime();
 }
 
 void TrackSummary::update(const G4Track* track) {
 
     //G4cout << "updating track " << this->_trackID << " from track " << track->GetTrackID() << G4endl;
 
+    // TODO: Status flags to check; x means verified
+    // x BITCreatedInSimulation
+    // x BITBackscatter
+    // x BITEndpoint (seems to be always turned on for sim particles)
+    // x BITDecayedInTracker
+    // x BITLeftDetector
+    // x BITStopped
+    // BITDecayedInCalorimeter (this is the default!)
+    // BITVertexIsNotEndpointOfParent
+    // BITOverlay
+
     /* Set the vertex position. */
     _vertex = track->GetVertexPosition();
 
@@ -64,8 +79,7 @@
     /* Initialize sim status. */
     _simstatus = 0;
 
-    // Setting the simulator status as for LCIO, by the moment by hand
-    // just adapting the beta LCIO code.
+    /* This indicates the particle has an endpoint. */
     _simstatus[MCParticle::BITEndpoint] = 1;
 
     /*
@@ -107,6 +121,7 @@
 
     // BITVertexIsNotEndpointOfParent
     TrackSummary* myParent = findParent();
+    // TODO: Check if parent is EVER available here.
     if (myParent)
         if (myParent->getEndPoint().isNear(getVertex()))
             _simstatus[MCParticle::BITVertexIsNotEndpointOfParent] = 1;
@@ -159,6 +174,7 @@
     // if we have an MCParticle already we just need to update it
     // otherwise we need to create one ...
     if (_mcparticle == 0) {
+
         _mcparticle = new MCParticleImpl;
         _simstatus[MCParticle::BITCreatedInSimulation] = 1;    // created in simulation
         _mcparticle->setGeneratorStatus(getHepEvtStatus());
@@ -196,6 +212,9 @@
     vertex[2] = getVertex()(2);
     _mcparticle->setVertex(vertex);
 
+    /* Set global time. */
+    _mcparticle->setTime(_globalTime);
+
     /* Set up to date. */
     _mcParticleIsUpToDate = true;
 }
SVNspam 0.1


Use REPLY-ALL to reply to list

To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1