lcdd/src
diff -u -r1.8 -r1.9
--- G4TrackerCombineSD.cc 20 Jul 2006 00:49:20 -0000 1.8
+++ G4TrackerCombineSD.cc 4 Dec 2006 22:48:13 -0000 1.9
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/G4TrackerCombineSD.cc,v 1.8 2006/07/20 00:49:20 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/G4TrackerCombineSD.cc,v 1.9 2006/12/04 22:48:13 jeremy Exp $
#include "G4TrackerCombineSD.hh"
// LCDD
@@ -31,19 +31,25 @@
// set cached step
G4SensitiveDetector::ProcessHits( aStep, 0 );
+#ifdef G4VERBOSE
+ if (getVerbose() > 0) {
+ G4cout << "G4TrackerCombineSD::ProcessHits - " << GetName() << G4endl;
+ G4cout << "pre-physvol=" << aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() << G4endl;
+ G4cout << "post-physvol=" << aStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName() << G4endl;
+ if ( prePV() != postPV() ) {
+ G4cout << "post-pv != pre-pv" << G4endl;
+ }
+ }
+#endif
+
// edep
G4double e = edep();
- // check edep < cut
- if ( e <= getEcut() ) {
- return false;
- }
-
bool r = false;
// started a hit?
if ( !m_startedHit ) {
-
+
// start new hit on preStep
startHit( pre() );
}
@@ -54,6 +60,12 @@
// this step's trackID != cached trackID?
if ( trackID() != m_currentTrackID ) {
+#ifdef G4VERBOSE
+ if ( getVerbose() > 0 ) {
+ G4cout << "new track ID" << G4endl;
+ }
+#endif
+
// insert the hit
r = insertHit();
@@ -73,6 +85,12 @@
// entering new PV on this step?
if ( prePV() != postPV() ) {
+#ifdef G4VERBOSE
+ if ( getVerbose() > 0 ) {
+ G4cerr << "new physvol this step!" << G4endl;
+ }
+#endif
+
// insert current hit
r = insertHit();
@@ -89,6 +107,13 @@
void G4TrackerCombineSD::updateHit()
{
+
+#ifdef G4VERBOSE
+ if ( getVerbose() > 1 ) {
+ G4cout << "updateHit" << G4endl;
+ }
+#endif
+
// can only update if started hit
if (m_startedHit) {
@@ -108,6 +133,12 @@
void G4TrackerCombineSD::clear()
{
+#ifdef G4VERBOSE
+ if ( getVerbose() > 1 ) {
+ G4cout << "clear" << G4endl;
+ }
+#endif
+
m_minTime = 0;
m_edepTotal = 0;
m_currentPV = 0;
@@ -117,18 +148,26 @@
bool G4TrackerCombineSD::insertHit()
{
+#ifdef G4VERBOSE
+ if ( getVerbose() > 1 ) {
+ G4cout << "insertHit" << G4endl;
+ }
+#endif
+
// never started another hit after clearing
if ( !m_startedHit ) {
+ G4cerr << "never started hit!" << G4endl;
return false;
}
// total energy below cut
if ( m_edepTotal <= getEcut() ) {
#ifdef G4VERBOSE
- if ( m_verbose > 2 ) {
+ if ( getVerbose() > 2 ) {
std::cout << GetName() << " : cut this edep " << m_edepTotal << std::endl;
}
#endif
+ clear();
return false;
}
@@ -157,7 +196,7 @@
trkhit->setId(id64.getId0());
#ifdef G4VERBOSE
- if ( m_verbose > 1 ) {
+ if ( getVerbose() > 1 ) {
std::cout << GetName() << " : inserting new tracker hit" << std::endl;
std::cout << *trkhit << std::endl;
std::cout << "entryPoint = " << m_entryPoint << std::endl;
@@ -176,11 +215,23 @@
// clear cached data
clear();
+#ifdef G4VERBOSE
+ if ( getVerbose() > 0 ) {
+ G4cout << G4endl;
+ }
+#endif
+
return true;
}
void G4TrackerCombineSD::startHit(G4StepPoint* aStepPoint)
{
+#ifdef G4VERBOSE
+ if ( getVerbose() > 0 ) {
+ G4cout << "startHit" << G4endl;
+ }
+#endif
+
m_currentPV = aStepPoint->GetPhysicalVolume();
m_entryPoint = m_exitPoint = aStepPoint->GetPosition();
m_entryMomentum = m_exitMomentum = aStepPoint->GetMomentum();
@@ -201,6 +252,8 @@
// set hit flag in trk info
trkInfo->setHasTrackerHit( true );
+
+
}