8 modified files
lcdd/include
diff -u -r1.8 -r1.9
--- G4TrackerHit.hh 7 Apr 2005 21:53:17 -0000 1.8
+++ G4TrackerHit.hh 10 Mar 2006 07:40:34 -0000 1.9
@@ -16,7 +16,7 @@
{
public:
G4TrackerHit();
-
+
virtual ~G4TrackerHit();
inline void *operator new(size_t);
@@ -36,6 +36,7 @@
inline void setMomentum(const G4ThreeVector& mom) { m_mom = mom; }
inline void setTrackID(const G4int trkID) { m_trkID = trkID; }
inline void setPDG(const G4int pdg) { m_PDG = pdg; }
+ inline void setLength(const G4double l) { m_length = l; }
inline G4double getTdep() { return m_tdep; }
inline G4double getEdep() { return m_edep; }
@@ -43,8 +44,9 @@
inline G4ThreeVector getMomentum() { return m_mom; }
inline G4int getTrackID() { return m_trkID; }
inline G4int getPDG() { return m_PDG; }
+ inline G4double getLength() { return m_length; }
- void setId( Id64bit::ElementType id1 )
+ void setId( Id64bit::ElementType id1 )
{
m_id64.setId1( id1 );
}
@@ -62,6 +64,7 @@
G4ThreeVector m_mom;
G4int m_trkID;
G4int m_PDG;
+ G4double m_length;
// TODO: make this a 32-bit, as only first 32-bits are used
Id64bit m_id64;
lcdd/include
diff -u -r1.10 -r1.11
--- G4TrackerSD.hh 5 Jul 2005 20:35:52 -0000 1.10
+++ G4TrackerSD.hh 10 Mar 2006 07:40:34 -0000 1.11
@@ -3,6 +3,7 @@
#include "G4SensitiveDetector.hh"
#include "G4TrackerHit.hh"
+#include "ReadoutUtil.hh" // for cc file and subclasses
/**
@class G4TrackerSD
lcdd/include
diff -u -r1.12 -r1.13
--- ReadoutUtil.hh 19 Jul 2005 02:11:47 -0000 1.12
+++ ReadoutUtil.hh 10 Mar 2006 07:40:34 -0000 1.13
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/ReadoutUtil.hh,v 1.12 2005/07/19 02:11:47 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/ReadoutUtil.hh,v 1.13 2006/03/10 07:40:34 jeremy Exp $
#ifndef ReadoutUtil_hh
#define ReadoutUtil_hh 1
@@ -39,13 +39,18 @@
static G4ThreeVector computeMidPos(const G4Step* aStep);
+ static G4double computeDistance(const G4ThreeVector& vec1,
+ const G4ThreeVector& vec2);
+
+ static G4double computeDistance(const G4Step* aStep);
+
static G4VSolid* getSolidFromStepPoint(const G4StepPoint* aStepPoint);
static G4TouchableHandle getTouchableFromStep(const G4Step* aStep);
static G4ThreeVector getVolumeGlobalPosition(const G4StepPoint* aStepPoint,
- const G4ThreeVector& pnt );
+ const G4ThreeVector& pnt );
static G4ThreeVector getVolumeGlobalPosition(const G4StepPoint* aStepPoint);
@@ -59,10 +64,10 @@
static double getTubsThickness(const G4Tubs* tubs);
static G4ThreeVector transformLocalToGlobal(const G4Step* aStep,
- const G4ThreeVector& localPos);
+ const G4ThreeVector& localPos);
static G4ThreeVector transformGlobalToLocal(const G4Step* aStep,
- const G4ThreeVector& globalPos);
+ const G4ThreeVector& globalPos);
static int getVolumeNumber(G4TouchableHandle theTouchable, int historyDepth = -1);
lcdd/src
diff -u -r1.2 -r1.3
--- G4ScorerSD.cc 1 Sep 2005 18:24:37 -0000 1.2
+++ G4ScorerSD.cc 10 Mar 2006 07:40:34 -0000 1.3
@@ -83,6 +83,7 @@
trkHit->setMomentum(meanmom);
trkHit->setTdep(tdep);
trkHit->setId( id64.getId0() );
+ trkHit->setLength(ReadoutUtil::computeDistance(aStep));
// add to HC
m_HC->insert(trkHit);
lcdd/src
diff -u -r1.4 -r1.5
--- G4TrackerCombineSD.cc 20 Aug 2005 20:09:01 -0000 1.4
+++ G4TrackerCombineSD.cc 10 Mar 2006 07:40:34 -0000 1.5
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/G4TrackerCombineSD.cc,v 1.4 2005/08/20 20:09:01 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/G4TrackerCombineSD.cc,v 1.5 2006/03/10 07:40:34 jeremy Exp $
#include "G4TrackerCombineSD.hh"
// LCDD
@@ -27,7 +27,7 @@
}
G4bool G4TrackerCombineSD::ProcessHits(G4Step* aStep, G4TouchableHistory*)
-{
+{
// set cached step
G4SensitiveDetector::ProcessHits( aStep, 0 );
@@ -35,7 +35,7 @@
// started a hit?
if ( !m_startedHit ) {
-
+
// start new hit on preStep
startHit( pre() );
}
@@ -45,10 +45,10 @@
// this step's trackID != cached trackID?
if ( trackID() != m_currentTrackID ) {
-
+
// insert the hit
- r = insertHit();
-
+ r = insertHit();
+
// start new hit on preStep
startHit( pre() );
}
@@ -76,7 +76,7 @@
}
}
- return r;
+ return r;
}
void G4TrackerCombineSD::updateHit()
@@ -93,7 +93,7 @@
}
// exit point and momentum
- m_exitPoint = postPosition();
+ m_exitPoint = postPosition();
m_exitMomentum = postMomentum();
}
}
@@ -115,18 +115,21 @@
}
// total energy below cut
- if ( m_edepTotal <= getEcut() ) {
+ if ( m_edepTotal <= getEcut() ) {
return false;
}
// compute mid point
- G4ThreeVector midPoint =
+ G4ThreeVector midPoint =
ReadoutUtil::computeThreeVectorMean(m_entryPoint, m_exitPoint);
// compute mean momentum
- G4ThreeVector meanMom =
+ G4ThreeVector meanMom =
ReadoutUtil::computeThreeVectorMean(m_entryMomentum, m_exitMomentum);
+ // compute distance from start to entry
+ G4double pathlength = ReadoutUtil::computeDistance(m_entryPoint, m_exitPoint);
+
#ifdef G4VERBOSE
if ( m_verbose > 1 ) {
std::cout << "inserting hit..." << std::endl;
@@ -137,6 +140,7 @@
std::cout << "midPoint " << midPoint << std::endl;
std::cout << "midPoint radius = " << midPoint.mag() << std::endl;
std::cout << "meanMom " << meanMom << std::endl;
+ std::cout << "length " << pathlength << std::endl;
}
#endif
@@ -147,6 +151,7 @@
trkhit->setPos(midPoint);
trkhit->setMomentum(meanMom);
trkhit->setTrackID(m_currentTrackID);
+ trkhit->setLength(pathlength);
// set id
Id64bit id64 = makeId();
@@ -157,7 +162,7 @@
// clear cached data
clear();
-#ifdef G4VERBOSE
+#ifdef G4VERBOSE
if ( m_verbose ) {
std::cout << std::endl;
}
lcdd/src
diff -u -r1.6 -r1.7
--- G4TrackerHit.cc 3 Feb 2005 21:54:23 -0000 1.6
+++ G4TrackerHit.cc 10 Mar 2006 07:40:34 -0000 1.7
@@ -15,9 +15,10 @@
: G4VHit(),
m_edep(0),
m_tdep(0),
- m_trkID(-1)
+ m_trkID(-1),
+ m_length(0)
{}
-
+
G4TrackerHit::~G4TrackerHit()
{}
@@ -34,7 +35,7 @@
chit.SetFillStyle(G4Circle::filled);
G4Colour col(1.0, 0.0, 1.0);
-
+
chit.SetVisAttributes(G4VisAttributes( col ) );
pVVisManager->Draw( chit );
}
lcdd/src
diff -u -r1.26 -r1.27
--- G4TrackerSD.cc 5 Jul 2005 20:35:54 -0000 1.26
+++ G4TrackerSD.cc 10 Mar 2006 07:40:34 -0000 1.27
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/G4TrackerSD.cc,v 1.26 2005/07/05 20:35:54 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/G4TrackerSD.cc,v 1.27 2006/03/10 07:40:34 jeremy Exp $
// LCDD
#include "IdManager.hh"
@@ -115,6 +115,7 @@
trkHit->setMomentum(meanmom);
trkHit->setTdep(tdep);
trkHit->setId( id64.getId0() );
+ trkHit->setLength(ReadoutUtil::computeDistance(aStep));
// add to HC
m_HC->insert(trkHit);
lcdd/src
diff -u -r1.9 -r1.10
--- ReadoutUtil.cc 19 Jul 2005 02:11:48 -0000 1.9
+++ ReadoutUtil.cc 10 Mar 2006 07:40:35 -0000 1.10
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/ReadoutUtil.cc,v 1.9 2005/07/19 02:11:48 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/ReadoutUtil.cc,v 1.10 2006/03/10 07:40:35 jeremy Exp $
#include "ReadoutUtil.hh"
#include <cmath>
@@ -11,6 +11,17 @@
return (0.5 * (vec1 + vec2 ) );
}
+G4double ReadoutUtil::computeDistance(const G4ThreeVector& vec1,
+ const G4ThreeVector& vec2)
+{
+ return (sqrt(pow(vec1.x() - vec2.x(), 2) + pow(vec1.y() - vec2.y(), 2) + pow(vec1.z() - vec2.z(), 2)));
+}
+
+G4double ReadoutUtil::computeDistance(const G4Step* aStep)
+{
+ return computeDistance(aStep->GetPreStepPoint()->GetPosition(), aStep->GetPostStepPoint()->GetPosition());
+}
+
G4ThreeVector ReadoutUtil::computeMidPos(const G4Step* aStep)
{
return computeThreeVectorMean( aStep->GetPreStepPoint()->GetPosition(),
@@ -71,10 +82,7 @@
double ReadoutUtil::getTubsThickness(const G4Tubs* tubs)
{
- double irad = tubs->GetInnerRadius();
- double orad = tubs->GetOuterRadius();
- double thickness = orad - irad;
- return thickness;
+ return tubs->GetOuterRadius() - tubs->GetInnerRadius();
}
G4ThreeVector ReadoutUtil::transformLocalToGlobal(const G4Step* aStep,
CVSspam 0.2.8