Commit in lcdd on MAIN
include/G4OpticalCalorimeterSD.hh+1-11.3 -> 1.4
src/G4OpticalCalorimeter.cc+11-931.3 -> 1.4
+12-94
2 modified files
avoid code duplication and call method in inherited class

lcdd/include
G4OpticalCalorimeterSD.hh 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- G4OpticalCalorimeterSD.hh	12 Dec 2007 03:19:00 -0000	1.3
+++ G4OpticalCalorimeterSD.hh	18 Feb 2008 20:57:01 -0000	1.4
@@ -16,7 +16,7 @@
 
     public: 
         //enum for the two Hit Collections (cerenkov and edep):
-        enum HCType { eCerenkov=0, eEdep=1};
+  enum HCType { eEdep=0, eCerenkov=1};
         
         G4OpticalCalorimeterSD(G4String sdName,
                                G4String hcName,

lcdd/src
G4OpticalCalorimeter.cc 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- G4OpticalCalorimeter.cc	12 Dec 2007 03:19:01 -0000	1.3
+++ G4OpticalCalorimeter.cc	18 Feb 2008 20:57:01 -0000	1.4
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/G4OpticalCalorimeter.cc,v 1.3 2007/12/12 03:19:01 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/G4OpticalCalorimeter.cc,v 1.4 2008/02/18 20:57:01 wenzel Exp $
 
 #include "G4OpticalCalorimeterSD.hh"
 
@@ -52,10 +52,10 @@
 G4OpticalCalorimeterSD::~G4OpticalCalorimeterSD()
 {}
 
-G4bool G4OpticalCalorimeterSD::ProcessHits(G4Step* aStep, G4TouchableHistory*)
+G4bool G4OpticalCalorimeterSD::ProcessHits(G4Step* aStep, G4TouchableHistory* tahis)
 {
     // set cached step
-    G4SensitiveDetector::ProcessHits(aStep, 0);
+//    G4SensitiveDetector::ProcessHits(aStep, 0);
     G4Track * aTrack =  aStep->GetTrack();
 
          
@@ -65,8 +65,15 @@
     }
       
     // check that particle is optical photon:
-    if(aTrack->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition()) 
+    if(aTrack->GetDefinition() != G4OpticalPhoton::OpticalPhotonDefinition())
+      {
+        G4String processname = aTrack->GetCreatorProcess()->G4VProcess::GetProcessName();
+	 // G4cout << "Process Name :  "<<processname<<G4endl;
+	return G4CalorimeterSD::ProcessHits(aStep, tahis);
+      }
+    else 
     {
+      G4SensitiveDetector::ProcessHits(aStep, 0);
         if(aTrack->GetParentID()==0) {       
             // particle is primary 
             aTrack->SetTrackStatus(fStopAndKill);
@@ -82,7 +89,6 @@
             aTrack->SetTrackStatus(fStopAndKill);
             return false;
         }
-
         G4ThreeVector myPoint = aStep->GetPreStepPoint()->GetPosition();
         G4Navigator* theNavigator   = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking();
         G4VPhysicalVolume* myVolume = theNavigator->LocateGlobalPointAndSetup(myPoint); 
@@ -143,93 +149,5 @@
 
         return true;
     }  // end optical photon treatment 
-    else if ( getNumberOfHitsCollections() > 1)
-    {
-        // here we deal with everything but the optical photon. 
-        // get the edep
-
-        G4double theEdep = edep();
-
-        // This needs to be a <= comparison for cutting on 0.  
-        // Allow passthrough of geantinos w/ 0 edep.
-        if ( theEdep <= getEcut() && !isGeantino() ) {
-#ifdef G4VERBOSE
-            if ( getVerbose() > 2 ) {
-                std::cout << "G4CalorimeterSD::ProcessHits - cut on edep " << theEdep << std::endl;
-            }
-#endif
-            return false;
-        }
-
-        // get global cell pos from seg
-        G4ThreeVector globalCellPos = m_segmentation->getGlobalHitPos( aStep );
-
-        // reset the seg bins
-        m_segmentation->resetBins();
-
-        // set the seg bins
-        m_segmentation->setBins( aStep );
-
-        // create id and pack into 64
-        Id64bit id64 = makeId();
-
-        // DEBUG: Compute step midpoint and compare to the cell pos
-#ifdef G4VERBOSE
-        if ( getVerbose() > 2 ) {
-            G4ThreeVector globalMidPos = midPosition();
-            std::cout << "globalMidPos " << globalMidPos << std::endl;
-            std::cout << "globalCellPos - globalMidPos = " << globalCellPos - globalMidPos << std::endl;
-        }
-#endif
-
-        // find hit by simple lkp of new hit with above info
-        G4CalorimeterHit* thisHit = new G4CalorimeterHit(theEdep, globalCellPos);
-        thisHit->setId64bit( id64.getId0(), id64.getId1() );
-        G4CalorimeterHit* fndHit  = 0;
-
-        // hit is not found?
-        if ( !( fndHit = findHit( thisHit,eEdep ) ) ) 
-        {
-
-#ifdef G4VERBOSE
-            if ( getVerbose() > 1 ) {
-                std::cout << "G4CalorimeterSD::ProcessHits - new hit" << std::endl;
-            }
-#endif
-
-            // add it to lkp map    
-            hits_vector[eEdep].push_back(thisHit);
-
-            // add to the HC
-            m_hitsCollections[eEdep]->insert(thisHit);   
-        }
-        // found a hit
-        else 
-        {
-
-#ifdef G4VERBOSE
-            if ( getVerbose() > 2 ) {
-                std::cout << "G4CalorimeterSD::ProcessHits - existing hit" << std::endl;
-            }
-#endif
 
-            // don't need to insert thisHit, so delete it
-            delete thisHit;
-            thisHit = 0;
-
-            // incr total edep of the hit
-            fndHit->incrEdep(theEdep);
-
-            // for setting contrib
-            thisHit = fndHit;
-        }
-
-        // add McpHitContrib to this hit, setting info from step info
-        thisHit->addMcpHitContrib( McpHitContrib( aStep ) );
-        return true;
-    }
-    else
-    {
-        return false;
-    }
 }
CVSspam 0.2.8