Commit in slic/src on MAIN
TrajectoryManager.cc+216-1561.47 -> 1.48
make sure stored tracks are over threshold; cleanup

slic/src
TrajectoryManager.cc 1.47 -> 1.48
diff -u -r1.47 -r1.48
--- TrajectoryManager.cc	26 Aug 2008 23:15:31 -0000	1.47
+++ TrajectoryManager.cc	15 Oct 2009 00:06:54 -0000	1.48
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/TrajectoryManager.cc,v 1.47 2008/08/26 23:15:31 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/TrajectoryManager.cc,v 1.48 2009/10/15 00:06:54 jeremy Exp $
 
 // slic
 #include "TrajectoryManager.hh"
@@ -29,22 +29,25 @@
 
 #ifdef SLIC_LOG
         log() << LOG::verbose 
+              << "-------------------------------" << LOG::endl
               << "TrajectoryManager::preTracking()" << LOG::endl
-              << "trackID <" << aTrack->GetTrackID() << ">" << LOG::endl
-              << "particle <" << aTrack->GetDefinition()->GetParticleName() << ">" << LOG::endl
-              << "volume <" << aTrack->GetVolume()->GetName() << ">" 
+              << "    trackID <" << aTrack->GetTrackID() << ">" << LOG::endl
+              << "    particle <" << aTrack->GetDefinition()->GetParticleName() << ">" << LOG::endl
+              << "    volume <" << aTrack->GetVolume()->GetName() << ">" 
               << LOG::done;
-        printStatusFlags(aTrack);
+        //printStatusFlags(aTrack);
 #endif
 
         // default trajectory storage to OFF
         m_trackingManager->SetStoreTrajectory( false );
 
         // handle primary or secondary track
-        if ( isPrimaryTrack(aTrack) ) {
+        if ( isPrimaryTrack(aTrack) ) 
+        {
             handlePrimaryTrack( aTrack );
         }
-        else {
+        else 
+        {
             handleSecondaryTrack( aTrack );
         }
     }
@@ -57,14 +60,15 @@
 
     void TrajectoryManager::printStatusFlags(TrackInformation* trkInfo)
     {
-        if ( trkInfo ) {
+        if ( trkInfo ) 
+        {
             log() << LOG::verbose 
-                  << "tracking status <" << TrackInformation::getTrackingStatusString( trkInfo->getTrackingStatus() ) << ">" << LOG::endl
-                  << "orig tracking status <" << TrackInformation::getTrackingStatusString( trkInfo->getOriginalTrackingStatus() ) << ">" << LOG::endl
-                  << "backscatter flag <" << trkInfo->getBackscatter() << ">" << LOG::endl
-                  << "belowThreshold flag <" << trkInfo->getBelowThreshold() << ">" << LOG::endl
-                  << "tracker hit flag <" << trkInfo->hasTrackerHit() << ">" << LOG::endl
-                  << "vtxnotendp flag <" << trkInfo->getVertexIsNotEndpointOfParent() << ">" 
+                  << "    orig tkr status <" << TrackInformation::getTrackingStatusString( trkInfo->getOriginalTrackingStatus() ) << ">" << LOG::endl
+                  << "    curr tkr status <" << TrackInformation::getTrackingStatusString( trkInfo->getTrackingStatus() ) << ">" << LOG::endl
+                  << "    backscatter <" << trkInfo->getBackscatter() << ">" << LOG::endl
+                  << "    belowThreshold <" << trkInfo->getBelowThreshold() << ">" << LOG::endl
+                  << "    has tracker hit <" << trkInfo->hasTrackerHit() << ">" << LOG::endl
+                  << "    vtxnotendp <" << trkInfo->getVertexIsNotEndpointOfParent() << ">" << LOG::endl
                   << LOG::done;
         }
 #ifdef SLIC_LOG
@@ -77,15 +81,15 @@
     void TrajectoryManager::printTrajectory(const Trajectory* trj)
     {
         log() << LOG::debug
-              << "trajectory info" << LOG::endl
-              << "trackID <" << trj->GetTrackID() << ">" << LOG::endl
-              << "final status: " << trj->getFinalStatusString() << LOG::endl
-              << "endp dau: " << trj->getHasEndpointDaughters() << LOG::endl
-              << "backscatter: " << trj->getBackscatter() << LOG::endl
-              << "vtxnotendp: " << trj->getVertexIsNotEndpointOfParent() << LOG::endl
-              << "created in sim: " << trj->getCreatedInSimulation() << LOG::endl
-              << "vtx: " << trj->GetPoint(0)->GetPosition() << LOG::endl
-              << "endp: " << trj->GetPoint(trj->GetPointEntries() - 1)->GetPosition() << LOG::endl
+              << "    trajectory info" << LOG::endl
+              << "    trackID <" << trj->GetTrackID() << ">" << LOG::endl
+              << "    final status: " << trj->getFinalStatusString() << LOG::endl
+              << "    endp dau: " << trj->getHasEndpointDaughters() << LOG::endl
+              << "    backscatter: " << trj->getBackscatter() << LOG::endl
+              << "    vtxnotendp: " << trj->getVertexIsNotEndpointOfParent() << LOG::endl
+              << "    created in sim: " << trj->getCreatedInSimulation() << LOG::endl
+              << "    vtx: " << trj->GetPoint(0)->GetPosition() << LOG::endl
+              << "    endp: " << trj->GetPoint(trj->GetPointEntries() - 1)->GetPosition() << LOG::endl
               << LOG::done;
     }
 
@@ -95,48 +99,50 @@
         log() << LOG::verbose << "TrajectoryManager::postTracking()" << LOG::endl;
 #endif
 
-        // check if needs manual setup
-        if ( needsManualTrajectorySetup( aTrack ) ) {
+        // Check if needs manual setup.  This can happen if the track is flagged as 
+        // non-tracking status but then makes some tracker hits.
+        if ( needsManualTrajectorySetup( aTrack ) ) 
+        {
 
 #ifdef SLIC_LOG
-            log() << LOG::verbose << "needs manual trajectory setup" << LOG::done;
+            log() << LOG::verbose << "    needs manual trajectory setup" << LOG::done;
 #endif
 
-            // setup trajectory in default way
+            // Setup trajectory in default way.
             Trajectory* trj = createTrajectoryFromTrack( aTrack );
 
-            // do additional, manual setup using this track
+            // Do additional, manual setup using this track.
             trj->setupManuallyFromTrack( aTrack );
         }
 
-        // trk info to secondaries
+        // Copy track info to secondaries.
         copySecondaryTrackInformationFromParent( aTrack );
 
-        // set final status codes in current trajectory
+        // Set the final status codes in the current trajectory.
         setTrajectoryFinalStatus( aTrack );
 
-        // print if store traj on/off
 #ifdef SLIC_LOG
-        log() << LOG::verbose << "store trajectory <" << m_trackingManager->GetStoreTrajectory() << ">" << LOG::done;
+        printStatusFlags(aTrack);
 #endif
 
-        // print status flags
 #ifdef SLIC_LOG
-        printStatusFlags(aTrack);
+        log() << LOG::verbose << "    store trajectory <" << m_trackingManager->GetStoreTrajectory() << ">" << LOG::done;
 #endif
 
-        Trajectory* trj = static_cast<Trajectory*>(m_trackingManager->GimmeTrajectory());
-        if ( 0 != trj ) {
+        // Store endpoint energy.
+        Trajectory* trj = static_cast<Trajectory*>( m_trackingManager->GimmeTrajectory() );
+        if ( 0 != trj ) 
+        {
             trj->setEndpointEnergy( aTrack->GetTotalEnergy() );
         }
     }
 
     void TrajectoryManager::handlePrimaryTrack(const G4Track* aTrack)
     {
-        // set track info
+        // Set the track info.
         setPrimaryTrackInformation(aTrack);
 
-        // create the trajectory
+        // Create a trajectory for this track.
         createTrajectoryFromTrack( aTrack );
     }
 
@@ -163,10 +169,12 @@
 
     void TrajectoryManager::setTrackingFlagFromRegionInformation(TrackInformation* trk_info, G4UserRegionInformation* reg_info)
     {
-        if ( reg_info->getStoreSecondaries() == true ) {
+        if ( reg_info->getStoreSecondaries() == true ) 
+        {
             trk_info->setTrackingStatus(TrackInformation::eInTrackingRegion);
         }
-        else {
+        else 
+        {
             trk_info->setTrackingStatus(TrackInformation::eInNontrackingRegion);
         }
     }
@@ -178,6 +186,10 @@
     */
     void TrajectoryManager::handleSecondaryTrack(const G4Track* aTrack)
     {
+#ifdef SLIC_LOG
+        log() << LOG::verbose << "handleSecondaryTrack <" << aTrack->GetTrackID() << ">" << LOG::endl;
+#endif        
+
         // get track information
         TrackInformation* trkInfo = TrackInformation::getTrackInformation( aTrack );
 
@@ -185,75 +197,70 @@
         G4UserRegionInformation* regInfo = G4UserRegionInformation::getRegionInformation ( aTrack );
 
         // must have track and region info to proceed
-        if ( regInfo && trkInfo ) {
+        if ( regInfo && trkInfo ) 
+        {
 
-            // check if in tracking region
-            if ( regInfo->getStoreSecondaries() ) {
+            // Store trajectories if in tracking region.
+            if ( regInfo->getStoreSecondaries() ) 
+            {
 
                 // check if backscatter
-                if ( isBackscatter( aTrack ) ) {
+                if ( isBackscatter( aTrack ) ) 
+                {
+#ifdef SLIC_LOG
+                    log() << LOG::verbose << "    backscatter in tracking" << LOG::endl;
+#endif        
                     trkInfo->setBackscatter( true );
                 }
 
-                /*
-                  Check if below threshold and continuous process creation,
-                  i.e. not an endp dau.
-                */
+                // Check if below threshold and continuous process creation, i.e. not an endp dau.
                 else if ( isBelowThreshold( aTrack ) &&
-                          trkInfo->getVertexIsNotEndpointOfParent() ) {
+                          trkInfo->getVertexIsNotEndpointOfParent() ) 
+                {
+#ifdef SLIC_LOG
+                    log() << LOG::verbose << "    backscatter + vtxnotendp in tracking" << LOG::endl;
+#endif        
                     trkInfo->setBelowThreshold( true );
                 }
-
-                /*
-                  Process of elimination: above threshold and not backscatter,
-                  so requires a new trajectory and trkInfo.
-                */
-                else {
-
+                // Above threshold and not backscatter, so requires a new trajectory and trkInfo.               
+                else if ( !isBelowThreshold( aTrack ))
+                {
+#ifdef SLIC_LOG
+                    log() << LOG::verbose << "    setup up trajectory in tracking" << LOG::endl;
+#endif        
                     // setup secondary track info
                     setupSecondaryTrackInformation( aTrack );
 
                     // create the secondary trajectory
                     createSecondaryTrajectory( aTrack );
                 }
+                else
+                {
+                    log() << LOG::verbose << "   below threshold in tracking" << LOG::endl;
+                }
 
-
-                /*
-                // DEBUG
-                if ( trkInfo != TrackInformation::getTrackInformation( aTrack ) ) {
-                log() << "WARNING: track info was reset" << LOG::endl;
-
-                log() << LOG::endl;
-                log() << "old flags" << LOG::endl;
-                printStatusFlags( trkInfo );
-                log() << LOG::endl;
-
-                log() << "new flags" << LOG::endl;
-                printStatusFlags( TrackInformation::getTrackInformation( aTrack ) );
-                log() << LOG::endl;
-                }
-                */
-
-                /*
-                  Set flag for in tracking region, re-getting track info,
-                  because may have been recreated above.
-                */
-                TrackInformation::getTrackInformation( aTrack )
-                    ->setTrackingStatus( TrackInformation::eInTrackingRegion );
+                // Set flag for type of region.  Need to get track info again, because it may have been recreated above.
+                TrackInformation::getTrackInformation( aTrack )->setTrackingStatus( TrackInformation::eInTrackingRegion );
             }
-            // in calorimeter, i.e. non-tracking
-            else {
-
-                // set non tracking status
+            // Track starts in a non-tracking region and will not be stored.
+            else 
+            {
+#ifdef SLIC_LOG
+                log() << LOG::verbose << "    non-tracking and no trj" << LOG::endl;
+#endif          
+                // Set status to non-tracking.
                 trkInfo->setTrackingStatus( TrackInformation::eInNontrackingRegion );
                 trkInfo->setOriginalTrackingStatus( TrackInformation::eInNontrackingRegion );
             }
         }
-        // fatal error: regInfo or trkInfo were null
-        else {
-            log() << LOG::fatal << "FATAL ERROR: region info or track info were null in handleSecondaryTrack()." << LOG::endl
+        // Fatal error: region info or track info was null.
+        else 
+        {
+#ifdef SLIC_LOG
+            log() << LOG::fatal << "FATAL ERROR: Region info or track info were null in handleSecondaryTrack()." << LOG::endl
                   << "region info <" << regInfo << ">" << LOG::endl
                   << "track info <" << trkInfo << ">" << LOG::done;
+#endif
             G4Exception("Track info or region info was null.");
         }
     }
@@ -313,9 +320,11 @@
         G4TrackVector* secondaries = m_trackingManager->GimmeSecondaries();
 
         // loop over secondaries to 1) create trk info and 2) set vertexIsNotEndpointOfParent flag
-        if ( secondaries ) {
+        if ( secondaries ) 
+        {
             size_t nseco = secondaries->size();
-            for ( size_t i = 0; i < nseco; i++ ) {
+            for ( size_t i = 0; i < nseco; i++ ) 
+            {
 
                 // set current seco track ptr
                 G4Track* seco = (*secondaries)[i];
@@ -324,28 +333,30 @@
                 TrackInformation* secoTrkInfo = new TrackInformation( parTrkInfo );
                 seco->SetUserInformation( secoTrkInfo );
 
-                // set vtxnotendp flag in trk info
-                if ( parTrj ) {
+                // Set vtxnotendp flag in track info.
+                if ( parTrj ) 
+                {
 
-                    // get parent's endpoint
+                    // Get parent's endpoint.
                     G4ThreeVector parEndpoint = getTrajectoryEndpoint( parTrj );
 
-                    // check if direct parent (flag always on if not) OR endp not near
+                    // Check if direct parent (flag always on if not) OR endp not near.
                     if ( secoTrkInfo->getOriginalTrackID() != aTrack->GetTrackID() ||
-                         vertexIsNotEndpointOfParent( parEndpoint, seco ) ) {
-
-                        // set vertexIsNotEndpointOfParent flag in trk info
+                         vertexIsNotEndpointOfParent( parEndpoint, seco ) ) 
+                    {
+                        // Set vertexIsNotEndpointOfParent flag in trk info.
                         secoTrkInfo->setVertexIsNotEndpointOfParent( true );
                     }
                 }
-                // vtxnotendp always set, because parent is not stored
-                else {
+                // In this case, vtxnotendp is always set, because parent was not stored.
+                else 
+                {
                     secoTrkInfo->setVertexIsNotEndpointOfParent( true );
                 }
             }
 
 #ifdef SLIC_LOG
-            log() << LOG::verbose << "track info passed to <" << nseco << "> secondaries" << LOG::endl;
+            log() << LOG::verbose << "    track info passed to <" << nseco << "> secondaries" << LOG::endl;
 #endif
         }
     }
@@ -353,8 +364,7 @@
     bool TrajectoryManager::needsManualTrajectorySetup(const G4Track* aTrack)
     {
         // store != ON and has a corresponding tracker hit
-        return ( !m_trackingManager->GetStoreTrajectory() ) &&
-            ( TrackInformation::getTrackInformation( aTrack )->hasTrackerHit() );
+        return ( !m_trackingManager->GetStoreTrajectory() ) && ( TrackInformation::getTrackInformation( aTrack )->hasTrackerHit() );
     }
 
     void TrajectoryManager::stepping(const G4Step* aStep)
@@ -362,7 +372,8 @@
         const G4Track* theTrack = aStep->GetTrack();
 
         // step has a live track
-        if ( isAlive( aStep ) ) {
+        if ( isAlive( aStep ) ) 
+        {
 
             TrackInformation* trkInfo = TrackInformation::getTrackInformation( theTrack );
 
@@ -370,18 +381,22 @@
             G4UserRegionInformation* postReg = G4UserRegionInformation::getRegionInformation( aStep->GetPostStepPoint() );
 
             // set tracking status based on region info
-            if ( preReg && postReg ) {
+            if ( preReg && postReg ) 
+            {
 
                 // tracking to non-tracking
-                if ( preReg->getStoreSecondaries() && ( !postReg->getStoreSecondaries() ) ) {
+                if ( preReg->getStoreSecondaries() && ( !postReg->getStoreSecondaries() ) ) 
+                {
                     trkInfo->setTrackingStatus( TrackInformation::eInNontrackingRegion );
                 }
                 // non-tracking to tracking
-                else if ( !preReg->getStoreSecondaries() && postReg->getStoreSecondaries() ) {
+                else if ( !preReg->getStoreSecondaries() && postReg->getStoreSecondaries() ) 
+                {
                     TrackInformation::ETrackingStatus origStatus = trkInfo->getOriginalTrackingStatus();
 
                     // if looped like tracking -> nontracking -> tracking without dying
-                    if ( ! ( origStatus == TrackInformation::eInTrackingRegion ) ) {
+                    if ( ! ( origStatus == TrackInformation::eInTrackingRegion ) ) 
+                    {
                         trkInfo->setBackscatter(true);
                     }
 
@@ -398,8 +413,8 @@
         Trajectory* trj = getCurrentTrajectory();
 
         // must have trajectory to set status
-        if ( trj ) {
-
+        if ( trj ) 
+        {
             G4StepPoint* postStep = aTrack->GetStep()->GetPostStepPoint();
 
             // get track info
@@ -408,7 +423,8 @@
 
             // has endpoint daughters
             G4int nSecoAtEnd = getNumberOfSecondariesAtEnd( aTrack );
-            if ( nSecoAtEnd > 0 ) {
+            if ( nSecoAtEnd > 0 ) 
+            {
                 trj->setHasEndpointDaughters( true );
             }
 
@@ -419,92 +435,125 @@
             trj->setBackscatter( trkInfo->getBackscatter() );
 
             // vertexIsNotEndpointOfParent
-            if ( trkInfo->getVertexIsNotEndpointOfParent() ) {
+            if ( trkInfo->getVertexIsNotEndpointOfParent() ) 
+            {
                 trj->setVertexIsNotEndpointOfParent( true );
             }
 
             // no decay -> no secondaries at end
-            if ( nSecoAtEnd <= 0 ) {
+            if ( nSecoAtEnd <= 0 ) 
+            {
                 // left detector
-                if ( !postStep->GetMaterial() ) {
+                if ( !postStep->GetMaterial() ) 
+                {
+#ifdef SLIC_LOG
+                    log() << LOG::debug << "    left detector" << LOG::done;
+#endif                    
                     finalStatus = Trajectory::eLeftDetector;
                 }
 
                 // stopped
-                else if ( aTrack->GetKineticEnergy() <= 0. ) {
+                else if ( aTrack->GetKineticEnergy() <= 0. ) 
+                {
+#ifdef SLIC_LOG
+                    log() << LOG::debug << "    stopped" << LOG::done;
+#endif                    
                     finalStatus = Trajectory::eStopped;
                 }
                 // unflagged loopers killed by G4 
 #ifdef SLIC_DEBUG
-                else {
-                    log() << LOG::debug << "Unknown decay case (probably a looper)." << LOG::done;
+                else 
+                {
+                    log() << LOG::debug << "    unknown decay case (probably a looper)" << LOG::done;
                 }
 #endif
             }
             // decayed
-            else {
-
+            else 
+            {
                 // decayed in tracker
-                if ( trkInfo->getTrackingStatus() == TrackInformation::eInTrackingRegion ) {
+                if ( trkInfo->getTrackingStatus() == TrackInformation::eInTrackingRegion ) 
+                {
+#ifdef SLIC_LOG
+                    log() << LOG::debug << "    decayed in tracker" << LOG::done;
+#endif                    
                     finalStatus = Trajectory::eDecayedInTracker;
                 }
                 // process of elimination: decayed in calorimeter
-                else {
+                else 
+                {
+#ifdef SLIC_LOG
+                    log() << LOG::debug << "    decayed in calorimeter" << LOG::done;
+#endif                    
                     finalStatus = Trajectory::eDecayedInCalorimeter;
                 }
             }
 
             // set final status in trajectory
             trj->setFinalStatus( finalStatus );
+
+#ifdef SLIC_LOG
+            printTrack( aTrack, true );
+#endif
         }
     }
 
     void TrajectoryManager::printTrack(const G4Track* trk, bool isSecondary)
     {
-        log() << LOG::endl;
-        log() << "track ptr <" << trk << ">" << LOG::endl;
-        log() << "trackID <" << trk->GetTrackID() << ">" << LOG::endl;
-        log() << "parent trackID <" << trk->GetParentID() << ">" << LOG::endl;
-        log() << "PDG <" << trk->GetDefinition()->GetPDGEncoding() << ">" << LOG::endl;
-        log() << "position <" << trk->GetPosition() << ">" << LOG::endl;
+        log() << LOG::debug << LOG::endl;
+        log() << LOG::debug 
+              << "track ptr <" << trk << ">" << LOG::endl
+              << "trackID <" << trk->GetTrackID() << ">" << LOG::endl
+              << "parent trackID <" << trk->GetParentID() << ">" << LOG::endl
+              << "PDG <" << trk->GetDefinition()->GetPDGEncoding() << ">" << LOG::endl
+              << "position <" << trk->GetPosition() << ">" << LOG::endl;
 
-        if ( !isSecondary ) {
-            if ( trk->GetMaterial() ) {
-                log() << "material <" << trk->GetMaterial()->GetName() << ">" << LOG::endl;
+        if ( !isSecondary ) 
+        {
+            if ( trk->GetMaterial() ) 
+            {
+                log() << LOG::debug << "material <" << trk->GetMaterial()->GetName() << ">" << LOG::endl;
             }
-            else {
-                log() << "NO material" << LOG::endl;
+            else 
+            {
+                log() << LOG::debug << "NO material" << LOG::endl;
             }
 
-            if ( trk->GetVolume() ) {
-                log() << "volume <" << trk->GetVolume()->GetName() << ">" << LOG::endl;
+            if ( trk->GetVolume() ) 
+            {
+                log() << LOG::debug << "volume <" << trk->GetVolume()->GetName() << ">" << LOG::endl;
             }
-            else {
-                log() << "NO volume" << LOG::endl;
+            else 
+            {
+                log() << LOG::debug << "NO volume" << LOG::endl;
             }
         }
 
-        if ( !isSecondary ) {
-            log() << "numSecoAtEnd <" << getNumberOfSecondariesAtEnd(trk) << ">" << LOG::endl;
+        if ( !isSecondary ) 
+        {
+            log() << LOG::debug << "numSecoAtEnd <" << getNumberOfSecondariesAtEnd(trk) << ">" << LOG::endl;
         }
 
-        log() << "kE <" << trk->GetKineticEnergy() << ">" << LOG::endl;
-        log() << "mom <" << trk->GetMomentum() << ">" << LOG::endl;
+        log() << LOG::debug << "kE <" << trk->GetKineticEnergy() << ">" << LOG::endl
+              << "mom <" << trk->GetMomentum() << ">" << LOG::endl;
 
         printStatusFlags(trk);
 
-        log() << LOG::endl;
+        log() << LOG::debug << LOG::endl;
     }
 
     void TrajectoryManager::printPhysVolDbg(G4StepPoint* stepPnt)
     {
-        if ( stepPnt ) {
+        if ( stepPnt ) 
+        {
             G4VPhysicalVolume* pv = stepPnt->GetPhysicalVolume();
 
-            if ( pv ) {
+            if ( pv ) 
+            {
                 log() << LOG::debug << "PV name <" << pv->GetName() << ">" << LOG::endl;
             }
-            else {
+            else 
+            {
                 log() << LOG::debug << "PV is NULL!" << LOG::endl;
             }
         }
@@ -517,17 +566,19 @@
         G4TrackVector* seco = m_trackingManager->GimmeSecondaries();
         G4ThreeVector endPnt = aTrack->GetPosition();
 
-        if ( seco ) {
+        if ( seco ) 
+        {
             size_t numSeco = seco->size();
 
 #ifdef SLIC_LOG
-            log() << LOG::debug << "numSeco <" << numSeco << ">" << LOG::endl;
+            log() << LOG::debug << "    numSeco <" << numSeco << ">" << LOG::endl;
 #endif
 
             for( size_t i = 0;
                  i < numSeco;
-                 i++ ) {
-                // if seco endpoint near track's endpoint
+                 i++ ) 
+            {
+                // If seco's endpoint is near track's endpoint, increment counter.
                 if ( (*seco)[i]->GetPosition().isNear( endPnt ) ) {
                     ++numSecoAtEnd;
                 }
@@ -544,32 +595,38 @@
 
     void TrajectoryManager::fillTrackIDToTrajectoryMap( const G4Event* anEvent, bool clearIt)
     {
-        if ( clearIt ) {
+        if ( clearIt ) 
+        {
             clearTrackIDToTrajectoryMap();
         }
 
         G4TrajectoryContainer* trajCont = anEvent->GetTrajectoryContainer();
 
-        if ( trajCont ) {
+        if ( trajCont ) 
+        {
             G4int n_traj = trajCont->entries();
 
             Trajectory* trj = 0;
-            for ( int i=0; i < n_traj; i++ ) {
+            for ( int i=0; i < n_traj; i++ ) 
+            {
                 trj = static_cast<Trajectory*> ( (*trajCont)[i] );          
                 addTrackIDToTrajectoryLink( trj );
             }
         }
-        else {
+        else 
+        {
             log() << LOG::error << "Cannot fill map without a trajectory container!" << LOG::endl;
         }
     }
 
     void TrajectoryManager::addTrackIDToTrajectoryLink( Trajectory* trj)
     {
-        if ( trj ) {
+        if ( trj ) 
+        {
             m_trackIDToTrajectory[ trj->GetTrackID() ] = trj;
         }
-        else {
+        else 
+        {
             log() << LOG::error << "Trajectory is null!" << LOG::endl;
         }
     }
@@ -584,8 +641,8 @@
 
         G4TrackVector* secondaries = m_trackingManager->GimmeSecondaries();
         size_t nseco = secondaries->size();
-        for ( size_t i = 0; i < nseco; i++ ) {
-
+        for ( size_t i = 0; i < nseco; i++ ) 
+        {
             // set current seco track ptr
             G4Track* seco = (*secondaries)[i];
             log() << LOG::debug << "secondary track <" << i << ">" << LOG::endl;
@@ -605,15 +662,18 @@
 
         iter = m_trackIDToTrajectory.find( trkID );
 
-        if ( iter != m_trackIDToTrajectory.end() ) {
+        if ( iter != m_trackIDToTrajectory.end() ) 
+        {
             trj = iter->second;
         }
 
 #ifdef SLIC_LOG
-        if ( trj ) {
+        if ( trj ) 
+        {
             log() << LOG::debug << "found trajectory" << LOG::endl;
         }
-        else {
+        else 
+        {
             log() << LOG::debug << "no trajectory found" << LOG::endl;
         }
 #endif
CVSspam 0.2.8