LISTSERV mailing list manager LISTSERV 16.5

Help for LCDET-SVN Archives


LCDET-SVN Archives

LCDET-SVN Archives


LCDET-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

LCDET-SVN Home

LCDET-SVN Home

LCDET-SVN  November 2015

LCDET-SVN November 2015

Subject:

r3689 - in /projects/lcdd/trunk: include/lcdd/detectors/ src/lcdd/detectors/

From:

[log in to unmask]

Reply-To:

Notification of commits to the lcdet svn repository <[log in to unmask]>

Date:

Thu, 5 Nov 2015 23:52:11 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (209 lines)

Author: [log in to unmask]
Date: Thu Nov  5 15:52:08 2015
New Revision: 3689

Log:
[SLIC-253] Fix problem with hits not being written from scoring plane by activating processor reset hook; includes other minor code cleanup.

Modified:
    projects/lcdd/trunk/include/lcdd/detectors/CurrentTrackState.hh
    projects/lcdd/trunk/include/lcdd/detectors/HitProcessor.hh
    projects/lcdd/trunk/include/lcdd/detectors/ScoringTrackerHitProcessor.hh
    projects/lcdd/trunk/src/lcdd/detectors/BasicTrackerHitProcessor.cc
    projects/lcdd/trunk/src/lcdd/detectors/CurrentTrackState.cc
    projects/lcdd/trunk/src/lcdd/detectors/HitProcessorManager.cc
    projects/lcdd/trunk/src/lcdd/detectors/ScoringTrackerHitProcessor.cc
    projects/lcdd/trunk/src/lcdd/detectors/SensitiveDetector.cc

Modified: projects/lcdd/trunk/include/lcdd/detectors/CurrentTrackState.hh
 =============================================================================
--- projects/lcdd/trunk/include/lcdd/detectors/CurrentTrackState.hh	(original)
+++ projects/lcdd/trunk/include/lcdd/detectors/CurrentTrackState.hh	Thu Nov  5 15:52:08 2015
@@ -21,17 +21,9 @@
 		_currentTrackID = trackID;
 	}
 
-	//static void setCurrentPrimaryID(G4int trackID) {
-	//	_currentPrimaryID = trackID;
-	//}
-
 	static G4int getCurrentTrackID() {
 		return _currentTrackID;
 	}
-
-	//static G4int getCurrentPrimaryID() {
-	//	return _currentPrimaryID;
-	//}
 
 public:
 

Modified: projects/lcdd/trunk/include/lcdd/detectors/HitProcessor.hh
 =============================================================================
--- projects/lcdd/trunk/include/lcdd/detectors/HitProcessor.hh	(original)
+++ projects/lcdd/trunk/include/lcdd/detectors/HitProcessor.hh	Thu Nov  5 15:52:08 2015
@@ -73,6 +73,9 @@
         return _collectionIndex;
     }
 
+    virtual void reset() {
+    }
+
 protected:
 
     SensitiveDetector* _detector;

Modified: projects/lcdd/trunk/include/lcdd/detectors/ScoringTrackerHitProcessor.hh
 =============================================================================
--- projects/lcdd/trunk/include/lcdd/detectors/ScoringTrackerHitProcessor.hh	(original)
+++ projects/lcdd/trunk/include/lcdd/detectors/ScoringTrackerHitProcessor.hh	Thu Nov  5 15:52:08 2015
@@ -30,6 +30,13 @@
      */
     bool processHits(G4Step* step);
 
+    /**
+     * Reset state of hit processor.
+     */
+    void reset() {
+        _currentTrackId = -1;
+    }
+
 private:
 
     int _currentTrackId;

Modified: projects/lcdd/trunk/src/lcdd/detectors/BasicTrackerHitProcessor.cc
 =============================================================================
--- projects/lcdd/trunk/src/lcdd/detectors/BasicTrackerHitProcessor.cc	(original)
+++ projects/lcdd/trunk/src/lcdd/detectors/BasicTrackerHitProcessor.cc	Thu Nov  5 15:52:08 2015
@@ -16,8 +16,6 @@
 }
 
 bool BasicTrackerHitProcessor::processHits(G4Step* step) {
-
-    //G4cout << "BasicTrackerHitProcessor::processHits" << G4endl;
 
     TrackerSD* tracker = getTracker();
 
@@ -38,8 +36,6 @@
 
     // Get the track.
     G4Track* track = step->GetTrack();
-
-    //G4cout << "  trackID: " << track->GetTrackID() << G4endl;
 
     // Get the pre-step point.
     G4StepPoint* pre = step->GetPreStepPoint();
@@ -70,7 +66,6 @@
     G4ThreeVector momentum = (end - start);
 
     // If the momentum is > 0 then set to average momentum.
-    // FIXME: Not sure I understand this!!!
     if (momentum.mag() > 0) {
         momentum.setMag(averageMomentum);
     }
@@ -86,10 +81,6 @@
 
     VUserTrackInformation* trackInformation =
             dynamic_cast<VUserTrackInformation*>(step->GetTrack()->GetUserInformation());
-
-    // If there is a user track info object, then flag it as having a hit.
-    //if (trackInformation)
-    //        trackInformation->setHasTrackerHit();
 
     // Set the hit information from above.
     if (trackInformation != NULL) {
@@ -111,11 +102,6 @@
     // Add the hit to the TrackerSD.
     tracker->addHit(hit, _collectionIndex);
 
-    //G4cout << "  CurrentTrackState::getCurrentTrackID: "
-    //        << CurrentTrackState::getCurrentTrackID() << G4endl;
-    //else
-    //	G4Exception("BasicTrackerHitProcessor::processHits", "", FatalException, "Missing required VUserTrackInformation.");
-
     // Return true because created new hit.
     return true;
 }

Modified: projects/lcdd/trunk/src/lcdd/detectors/CurrentTrackState.cc
 =============================================================================
--- projects/lcdd/trunk/src/lcdd/detectors/CurrentTrackState.cc	(original)
+++ projects/lcdd/trunk/src/lcdd/detectors/CurrentTrackState.cc	Thu Nov  5 15:52:08 2015
@@ -1,4 +1,3 @@
 #include "lcdd/detectors/CurrentTrackState.hh"
 
 int CurrentTrackState::_currentTrackID = -1;
-//int CurrentTrackState::_currentPrimaryID = -1;

Modified: projects/lcdd/trunk/src/lcdd/detectors/HitProcessorManager.cc
 =============================================================================
--- projects/lcdd/trunk/src/lcdd/detectors/HitProcessorManager.cc	(original)
+++ projects/lcdd/trunk/src/lcdd/detectors/HitProcessorManager.cc	Thu Nov  5 15:52:08 2015
@@ -26,7 +26,6 @@
     registerFactory(new BasicCalorimeterHitProcessorFactory());
     registerFactory(new ScoringTrackerHitProcessorFactory());
     registerFactory(new BasicTrackerHitProcessorFactory());
-
     registerFactory(new DDSegmentationCalorimeterHitProcessorFactory());
 }
 

Modified: projects/lcdd/trunk/src/lcdd/detectors/ScoringTrackerHitProcessor.cc
 =============================================================================
--- projects/lcdd/trunk/src/lcdd/detectors/ScoringTrackerHitProcessor.cc	(original)
+++ projects/lcdd/trunk/src/lcdd/detectors/ScoringTrackerHitProcessor.cc	Thu Nov  5 15:52:08 2015
@@ -15,6 +15,7 @@
 }
 
 bool ScoringTrackerHitProcessor::processHits(G4Step* step) {
+
     bool sameTrack = false;
 
     int trackId = step->GetTrack()->GetTrackID();
@@ -70,13 +71,6 @@
         newHit->setId(id64.getId0());
         newHit->setLength(length);
 
-        // Get the TrackInformation and flag track as having a tracker hit.
-
-        //if (trackInformation)
-        //    trackInformation->setHasTrackerHit();
-        //else
-        //    G4Exception("ScoringTrackerHitProcessor::processHits", "", FatalException, "Missing required VUserTrackInformation.");
-
         // Add hit to detector.
         getTracker()->addHit(newHit, getCollectionIndex());
     }

Modified: projects/lcdd/trunk/src/lcdd/detectors/SensitiveDetector.cc
 =============================================================================
--- projects/lcdd/trunk/src/lcdd/detectors/SensitiveDetector.cc	(original)
+++ projects/lcdd/trunk/src/lcdd/detectors/SensitiveDetector.cc	Thu Nov  5 15:52:08 2015
@@ -28,8 +28,8 @@
 SensitiveDetector::SensitiveDetector(G4String name, G4String theCollectionName, EType detectorType) :
         G4VSensitiveDetector(name),
         _idspec(NULL),
+        _verbose(false),
         _type(detectorType),
-        _verbose(false),
         _endcap(false),
         _ecut(0) {
 
@@ -78,6 +78,9 @@
 }
 
 void SensitiveDetector::EndOfEvent(G4HCofThisEvent*) {
+    for (HitProcessors::iterator it = _hitProcessors.begin(); it != _hitProcessors.end(); it++) {
+        (*it)->reset();
+    }
 }
 
 G4bool SensitiveDetector::ProcessHits(G4Step* aStep, G4TouchableHistory*) {

########################################################################
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

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use