lcdd/src
diff -N G4StepReadout.cc
--- G4StepReadout.cc 30 Jul 2005 01:21:00 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,201 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/Attic/G4StepReadout.cc,v 1.3 2005/07/30 01:21:00 jeremy Exp $
-#include "G4StepReadout.hh"
-
-// LCDD
-#include "ReadoutUtil.hh"
-#include "TrackInformation.hh"
-
-// G4
-#include "G4Step.hh"
-#include "G4StepPoint.hh"
-#include "G4Track.hh"
-#include "G4VSolid.hh"
-#include "G4VPhysicalVolume.hh"
-#include "G4VSensitiveDetector.hh"
-#include "G4TouchableHandle.hh"
-#include "G4Region.hh"
-#include "G4Material.hh"
-#include "G4LogicalVolume.hh"
-
-G4StepReadout::G4StepReadout()
- : m_step(0)
-{}
-
-G4StepReadout::~G4StepReadout()
-{}
-
-void G4StepReadout::setStep(G4Step* s)
-{
- m_step = s;
-}
-
-G4Step* G4StepReadout::step() const
-{
- return m_step;
-}
-
-bool G4StepReadout::hasStep() const
-{
- return ( 0 != m_step );
-}
-
-G4StepPoint* G4StepReadout::pre() const
-{
- return step()->GetPreStepPoint();
-}
-
-G4StepPoint* G4StepReadout::post() const
-{
- return step()->GetPostStepPoint();
-}
-
-G4VPhysicalVolume* G4StepReadout::prePV() const
-{
- return preTouchableHandle()->GetVolume();
-}
-
-G4VPhysicalVolume* G4StepReadout::postPV() const
-{
- return postTouchableHandle()->GetVolume();
-}
-
-G4VSolid* G4StepReadout::preSolid() const
-{
- return preLV()->GetSolid();
-}
-
-G4VSolid* G4StepReadout::postSolid() const
-{
- return postLV()->GetSolid();
-}
-
-G4LogicalVolume* G4StepReadout::preLV() const
-{
- return prePV()->GetLogicalVolume();
-}
-
-G4LogicalVolume* G4StepReadout::postLV() const
-{
- return postPV()->GetLogicalVolume();
-}
-
-G4Material* G4StepReadout::preMaterial() const
-{
- return pre()->GetMaterial();
-}
-
-G4Material* G4StepReadout::postMaterial() const
-{
- return post()->GetMaterial();
-}
-
-G4VSensitiveDetector* G4StepReadout::preSD() const
-{
- return ((G4StepPoint*)pre())->GetSensitiveDetector();
-}
-
-G4VSensitiveDetector* G4StepReadout::postSD() const
-{
- return ((G4StepPoint*)post())->GetSensitiveDetector();
-}
-
-bool G4StepReadout::hasSameSD() const
-{
- bool r = false;
-
- // post vol has an SD
- if ( 0 != postSD() ) {
-
- // post SD same as pre SD
- if ( preSD() == postSD() ) {
- r = true;
- }
- }
-
- return r;
-}
-
-G4ThreeVector G4StepReadout::volumePosition(G4TouchableHandle theTouchable) const
-{
- return theTouchable->GetHistory()->GetTopTransform().Inverse().TransformPoint( m_origin );
-}
-
-G4ThreeVector G4StepReadout::preVolumePosition() const
-{
- return volumePosition( preTouchableHandle() );
-}
-
-G4ThreeVector G4StepReadout::postVolumePosition() const
-{
- return volumePosition( postTouchableHandle() );
-}
-
-double G4StepReadout::edep() const
-{
- return step()->GetTotalEnergyDeposit();
-}
-
-G4Track* G4StepReadout::track() const
-{
- return step()->GetTrack();
-}
-
-double G4StepReadout::globalTime() const
-{
- return track()->GetGlobalTime();
-}
-
-int G4StepReadout::trackID() const
-{
- return track()->GetTrackID();
-}
-
-G4ThreeVector G4StepReadout::momentum() const
-{
- return track()->GetMomentum();
-}
-
-TrackInformation* G4StepReadout::trackInformation() const
-{
- return TrackInformation::getTrackInformation( track() );
-}
-
-G4ThreeVector G4StepReadout::prePosition() const
-{
- return pre()->GetPosition();
-}
-
-G4ThreeVector G4StepReadout::midPosition() const
-{
- return ReadoutUtil::computeThreeVectorMean( prePosition(), postPosition() );
-}
-
-G4ThreeVector G4StepReadout::postPosition() const
-{
- return post()->GetPosition();
-}
-
-G4ThreeVector G4StepReadout::preMomentum() const
-{
- return pre()->GetMomentum();
-}
-
-G4ThreeVector G4StepReadout::postMomentum() const
-{
- return post()->GetMomentum();
-}
-
-G4ThreeVector G4StepReadout::meanMomentum() const
-{
- return ReadoutUtil::computeThreeVectorMean( preMomentum(), postMomentum() );
-}
-
-G4TouchableHandle G4StepReadout::preTouchableHandle() const
-{
- return pre()->GetTouchableHandle();
-}
-
-G4TouchableHandle G4StepReadout::postTouchableHandle() const
-{
- return post()->GetTouchableHandle();
-}
lcdd/include
diff -N G4StepReadout.hh
--- G4StepReadout.hh 5 Sep 2006 23:25:20 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,116 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/Attic/G4StepReadout.hh,v 1.3 2006/09/05 23:25:20 jeremy Exp $
-#ifndef G4STEPREADOUT_HH
-#define G4STEPREADOUT_HH 1
-
-// G4
-#include "G4ThreeVector.hh"
-#include "G4TouchableHandle.hh"
-
-// std
-#include <vector>
-
-// G4
-class G4VPhysicalVolume;
-class G4VSensitiveDetector;
-class G4Step;
-class G4StepPoint;
-class G4Region;
-class G4Material;
-class G4LogicalVolume;
-class G4VSolid;
-class G4Track;
-
-// LCDD
-class TrackInformation;
-class G4UserRegionInformation;
-
-/**
- * @class G4StepReadout
- * @brief Utility functions to return commonly used pointers and data values from a G4Step object.
- * @note The only cached data is the step pointer.
-*/
-class G4StepReadout
-{
-public:
- G4StepReadout();
- virtual ~G4StepReadout();
-
-public:
-
- // step
- void setStep(G4Step* s);
- G4Step* step() const;
- bool hasStep() const;
-
- // step points
- G4StepPoint* pre() const;
- G4StepPoint* post() const;
-
- // PV from pre and post
- G4VPhysicalVolume* prePV() const;
- G4VPhysicalVolume* postPV() const;
-
- // solid from pre and post
- G4VSolid* preSolid() const;
- G4VSolid* postSolid() const;
-
- // LV from pre and post
- G4LogicalVolume* preLV() const;
- G4LogicalVolume* postLV() const;
-
- // material from pre and post
- G4Material* preMaterial() const;
- G4Material* postMaterial() const;
-
- // region from pre and post
- G4Region* preRegion() const;
- G4Region* postRegion() const;
-
- // pre and post position of PV
- G4ThreeVector volumePosition(G4TouchableHandle theTouchable) const;
- G4ThreeVector preVolumePosition() const;
- G4ThreeVector postVolumePosition() const;
-
- // SD from pre and post
- G4VSensitiveDetector* preSD() const;
- G4VSensitiveDetector* postSD() const;
-
- // are pre and post SD the same?
- bool hasSameSD() const;
-
- // edep from step
- double edep() const;
-
- // track
- G4Track* track() const;
-
- // data from track
- double globalTime() const;
- int trackID() const;
- G4ThreeVector momentum() const;
- TrackInformation* trackInformation() const;
-
- // pre, mid and post positions
- G4ThreeVector prePosition() const;
- G4ThreeVector midPosition() const;
- G4ThreeVector postPosition() const;
-
- // pre, post and mean momentum
- G4ThreeVector preMomentum() const;
- G4ThreeVector postMomentum() const;
- G4ThreeVector meanMomentum() const;
-
- // pre and post handles
- G4TouchableHandle preTouchableHandle() const;
- G4TouchableHandle postTouchableHandle() const;
-
-protected:
-
- // cached step
- G4Step* m_step;
-
- // vector = [0,0,0]
- const G4ThreeVector m_origin;
-};
-
-#endif