20 modified files
lcdd
diff -u -r1.10 -r1.11
--- aclocal.m4 31 Mar 2006 01:08:57 -0000 1.10
+++ aclocal.m4 12 Jul 2007 18:09:00 -0000 1.11
@@ -1,4 +1,4 @@
-dnl $Header: /cvs/lcd/lcdd/aclocal.m4,v 1.10 2006/03/31 01:08:57 jeremy Exp $
+dnl $Header: /cvs/lcd/lcdd/aclocal.m4,v 1.11 2007/07/12 18:09:00 jeremy Exp $
dnl
dnl local m4 macros for SLIC autoconf
dnl
@@ -46,6 +46,63 @@
])
+dnl Macro to check whether NIST is supported by the current Geant4 version
+AC_DEFUN(AC_HAVE_G4NIST, [
+
+AC_MSG_CHECKING(whether to enable Geant4 NIST service)
+
+if test -e $G4INSTALL/source/materials/include/G4NistManager.hh; then
+ AC_DEFINE(HAVE_G4NIST)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+])
+
+dnl Macro to check whether G4PVPlacement::CheckOverlaps is supported.
+AC_DEFUN(AC_HAVE_G4PVPLACEMENT_CHECKOVERLAPS, [
+
+AC_MSG_CHECKING(whether G4PVPlacement::CheckOverlaps is supported)
+
+if test "X$(grep CheckOverlaps $G4INSTALL/source/geometry/volumes/include/G4PVPlacement.hh)" != "X"; then
+ AC_DEFINE(HAVE_G4PVPLACEMENT_CHECKOVERLAPS)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+])
+
+dnl Macro to check whether G4Region::SetUserLimits is supported.
+AC_DEFUN(AC_HAVE_G4REGION_SETUSERLIMITS, [
+
+AC_MSG_CHECKING(whether G4Region::SetUserLimits is supported)
+
+if test "X$(grep SetUserLimits $G4INSTALL/source/geometry/management/include/G4Region.hh)" != "X"; then
+ AC_DEFINE(HAVE_G4REGION_SETUSERLIMITS)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+])
+
+
+dnl Macro to check whether G4PVPlacement::GetMass is supported.
+AC_DEFUN(AC_HAVE_G4LOGICALVOLUME_GETMASS, [
+
+AC_MSG_CHECKING(whether G4LogicalVolume::GetMass is supported)
+
+if test "X$(grep GetMass $G4INSTALL/source/geometry/management/include/G4LogicalVolume.hh)" != "X"; then
+ AC_DEFINE(HAVE_G4LOGICALVOLUME_GETMASS)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+])
+
dnl macro to setup Geant4
AC_DEFUN(SIM_SETUP_G4, [
lcdd/include
diff -u -r1.10 -r1.11
--- G4CalorimeterSD.hh 18 Dec 2006 22:49:01 -0000 1.10
+++ G4CalorimeterSD.hh 12 Jul 2007 18:09:00 -0000 1.11
@@ -41,11 +41,11 @@
G4CalorimeterHit* findHit(G4CalorimeterHit* aHit) const;
- std::ostream& printHits(std::ostream& os) const;
+ std::ostream& printHits(std::ostream& os);
- void clearHits();
+ void clearHits();
- virtual std::ostream& printBasicInfo(std::ostream& os) const;
+ virtual std::ostream& printBasicInfo(std::ostream& os);
virtual double getEdep() const;
lcdd/include
diff -u -r1.16 -r1.17
--- G4SensitiveDetector.hh 8 Jan 2007 22:59:30 -0000 1.16
+++ G4SensitiveDetector.hh 12 Jul 2007 18:09:00 -0000 1.17
@@ -59,7 +59,7 @@
virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*);
public:
-
+
/**
* Return the type of this detector encoded as an int.
*/
@@ -181,27 +181,27 @@
/**
* Print basic information about this detector to the output stream.
*/
- virtual std::ostream& printBasicInfo(std::ostream& os) const;
+ virtual std::ostream& printBasicInfo(std::ostream& os);
/**
* Print the number of hits to the output stream.
*/
- virtual std::ostream& printNumberOfHits(std::ostream& os) const;
+ virtual std::ostream& printNumberOfHits(std::ostream& os);
/**
* Print the number of hits to the output stream.
*/
- virtual std::ostream& printEdep(std::ostream& os) const;
+ virtual std::ostream& printEdep(std::ostream& os);
/**
* Print the names of volumes associated to this detector.
*/
- virtual std::ostream& printVolumes(std::ostream& os) const;
+ virtual std::ostream& printVolumes(std::ostream& os);
/**
* Print the list of hits. Subclasses must implement this.
*/
- virtual std::ostream& printHits(std::ostream& os) const { return os; }
+ virtual std::ostream& printHits(std::ostream& os) { return os; }
/**
* Retrieve the hits collection associated with this detector,
lcdd/include
diff -u -r1.15 -r1.16
--- G4TrackerSD.hh 18 Dec 2006 22:49:01 -0000 1.15
+++ G4TrackerSD.hh 12 Jul 2007 18:09:00 -0000 1.16
@@ -25,7 +25,7 @@
public:
virtual void Initialize(G4HCofThisEvent *);
virtual void EndOfEvent(G4HCofThisEvent *);
- std::ostream& printHits(std::ostream& os) const;
+ std::ostream& printHits(std::ostream& os);
double getEdep() const;
lcdd/include
diff -u -r1.11 -r1.12
--- GeometryManager.hh 18 Dec 2006 22:49:01 -0000 1.11
+++ GeometryManager.hh 12 Jul 2007 18:09:00 -0000 1.12
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/GeometryManager.hh,v 1.11 2006/12/18 22:49:01 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/GeometryManager.hh,v 1.12 2007/07/12 18:09:00 jeremy Exp $
#ifndef LCDD_GEOMETRYMANAGER_HH
#define LCDD_GEOMETRYMANAGER_HH 1
@@ -43,6 +43,8 @@
*/
void setupWorldRegionInformation();
+#ifdef HAVE_G4PVPLACEMENT_CHECKOVERLAPS
+
/**
* Check overlaps starting with the world volume
* and recursing to daughters.
@@ -62,6 +64,8 @@
*/
void checkOverlaps(const G4String&, bool recurse=true) const;
+#endif
+
private:
static GeometryManager* m_instance;
lcdd/include
diff -u -r1.5 -r1.6
--- LCDDMessenger.hh 16 Feb 2007 02:04:47 -0000 1.5
+++ LCDDMessenger.hh 12 Jul 2007 18:09:00 -0000 1.6
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/LCDDMessenger.hh,v 1.5 2007/02/16 02:04:47 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/LCDDMessenger.hh,v 1.6 2007/07/12 18:09:00 jeremy Exp $
#ifndef LCDD_LCDDMESSENGER_HH
#define LCDD_LCDDMESSENGER_HH 1
@@ -37,7 +37,9 @@
G4UIcommand* m_setURICmd;
G4UIcommand* m_setSetupNameCmd;
G4UIcommand* m_setVersionCmd;
+#ifdef HAVE_G4PVPLACEMENT_CHECKOVERLAPS
G4UIcommand* m_checkOverlapsCmd;
G4UIcommand* m_checkOverlapsRecurseCmd;
+#endif
}; // class
#endif
lcdd/include
diff -u -r1.1 -r1.2
--- NistWriter.hh 9 Jan 2007 00:42:10 -0000 1.1
+++ NistWriter.hh 12 Jul 2007 18:09:00 -0000 1.2
@@ -1,6 +1,8 @@
#ifndef NISTWRITER_HH
#define NISTWRITER_HH 1
+#ifdef HAVE_G4NIST
+
#include <string>
class NistWriter
@@ -19,3 +21,5 @@
};
#endif
+
+#endif
lcdd/include
diff -u -r1.1 -r1.2
--- NistWriterMessenger.hh 9 Jan 2007 00:42:10 -0000 1.1
+++ NistWriterMessenger.hh 12 Jul 2007 18:09:00 -0000 1.2
@@ -1,6 +1,8 @@
#ifndef NISTWRITERMESSENGER_HH
#define NISTWRITERMESSENGER_HH 1
+#ifdef HAVE_G4NIST
+
#include "G4UImessenger.hh"
#include "G4UIcmdWithAString.hh"
@@ -26,3 +28,5 @@
};
#endif
+
+#endif
lcdd/include
diff -u -r1.2 -r1.3
--- StepReadout.hh 18 Dec 2006 22:49:02 -0000 1.2
+++ StepReadout.hh 12 Jul 2007 18:09:00 -0000 1.3
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/StepReadout.hh,v 1.2 2006/12/18 22:49:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/StepReadout.hh,v 1.3 2007/07/12 18:09:00 jeremy Exp $
#ifndef LCDD_LCDD_STEPREADOUT_HH
#define LCDD_LCDD_STEPREADOUT_HH 1
@@ -74,6 +74,7 @@
// SD from pre and post
G4VSensitiveDetector* preSD() const;
G4VSensitiveDetector* postSD() const;
+ G4VSensitiveDetector* getSD(G4StepPoint*) const;
// are pre and post SD the same?
bool hasSameSD() const;
lcdd/include
diff -u -r1.9 -r1.10
--- StoreInspector.hh 16 Feb 2007 02:04:47 -0000 1.9
+++ StoreInspector.hh 12 Jul 2007 18:09:00 -0000 1.10
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/StoreInspector.hh,v 1.9 2007/02/16 02:04:47 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/StoreInspector.hh,v 1.10 2007/07/12 18:09:00 jeremy Exp $
#ifndef LCDD_STOREINSPECTOR_HH
#define LCDD_STOREINSPECTOR_HH 1
@@ -242,7 +242,11 @@
{
os << "solid: " << lv.GetSolid()->GetName() << endl;
os << "material: " << lv.GetMaterial()->GetName() << endl;
+
+#ifdef HAVE_G4LOGICALVOLUME_GETMASS
os << "mass: " << G4BestUnit(lv.GetMass(), "Mass") << endl;
+#endif
+
os << "daughters: " << lv.GetNoDaughters() << endl;
G4UserLimits* lim = lv.GetUserLimits();
lcdd/src
diff -u -r1.30 -r1.31
--- G4CalorimeterSD.cc 7 Feb 2007 05:17:12 -0000 1.30
+++ G4CalorimeterSD.cc 12 Jul 2007 18:09:01 -0000 1.31
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/G4CalorimeterSD.cc,v 1.30 2007/02/07 05:17:12 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/G4CalorimeterSD.cc,v 1.31 2007/07/12 18:09:01 jeremy Exp $
#include "G4CalorimeterSD.hh"
// lcdd
@@ -177,7 +177,7 @@
return fndHit;
}
-std::ostream& G4CalorimeterSD::printHits(std::ostream& os) const
+std::ostream& G4CalorimeterSD::printHits(std::ostream& os)
{
for (G4CalorimeterHitList::const_iterator iter = m_hits.begin();
iter != m_hits.end();
@@ -203,7 +203,7 @@
#endif
}
-std::ostream& G4CalorimeterSD::printBasicInfo(std::ostream& os) const
+std::ostream& G4CalorimeterSD::printBasicInfo(std::ostream& os)
{
G4SensitiveDetector::printBasicInfo( os );
lcdd/src
diff -u -r1.12 -r1.13
--- G4SensitiveDetector.cc 20 Dec 2006 00:13:10 -0000 1.12
+++ G4SensitiveDetector.cc 12 Jul 2007 18:09:01 -0000 1.13
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/G4SensitiveDetector.cc,v 1.12 2006/12/20 00:13:10 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/G4SensitiveDetector.cc,v 1.13 2007/07/12 18:09:01 jeremy Exp $
#include "G4SensitiveDetector.hh"
@@ -76,9 +76,9 @@
return noneStr;
}
-std::ostream& G4SensitiveDetector::printBasicInfo(std::ostream& os) const
+std::ostream& G4SensitiveDetector::printBasicInfo(std::ostream& os)
{
- os << "name: " << this->GetName() << std::endl;
+ os << "name: " << GetName() << std::endl;
os << "type: " << m_type << std::endl;
os << "hits collection: " << this->getHCName() << std::endl;
os << "hits collection ID: " << m_HCID << std::endl;
@@ -128,13 +128,13 @@
return hc;
}
-std::ostream& G4SensitiveDetector::printNumberOfHits(std::ostream& os) const
+std::ostream& G4SensitiveDetector::printNumberOfHits(std::ostream& os)
{
os << "number of hits: " << this->getNumberOfHits() << std::endl;
return os;
}
-std::ostream& G4SensitiveDetector::printEdep(std::ostream& os) const
+std::ostream& G4SensitiveDetector::printEdep(std::ostream& os)
{
os << "total edep: " << G4BestUnit( this->getEdep(), "Energy" ) << std::endl;
return os;
@@ -153,7 +153,7 @@
return volumes;
}
-std::ostream& G4SensitiveDetector::printVolumes(std::ostream& os) const
+std::ostream& G4SensitiveDetector::printVolumes(std::ostream& os)
{
std::vector<G4LogicalVolume*> volumes = this->getLogicalVolumes();
lcdd/src
diff -u -r1.30 -r1.31
--- G4TrackerSD.cc 19 Dec 2006 21:27:18 -0000 1.30
+++ G4TrackerSD.cc 12 Jul 2007 18:09:01 -0000 1.31
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/G4TrackerSD.cc,v 1.30 2006/12/19 21:27:18 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/G4TrackerSD.cc,v 1.31 2007/07/12 18:09:01 jeremy Exp $
// LCDD
#include "IdManager.hh"
@@ -90,7 +90,7 @@
return true;
}
-std::ostream& G4TrackerSD::printHits(std::ostream& os) const
+std::ostream& G4TrackerSD::printHits(std::ostream& os)
{
for (G4TrackerHitList::const_iterator iter = m_hits.begin();
iter != m_hits.end();
lcdd/src
diff -u -r1.11 -r1.12
--- GeometryManager.cc 22 Nov 2006 02:24:53 -0000 1.11
+++ GeometryManager.cc 12 Jul 2007 18:09:01 -0000 1.12
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/GeometryManager.cc,v 1.11 2006/11/22 02:24:53 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/GeometryManager.cc,v 1.12 2007/07/12 18:09:01 jeremy Exp $
#include "GeometryManager.hh"
// LCDD
@@ -70,6 +70,8 @@
m_worldRegionIsSetup = true;
}
+#ifdef HAVE_G4PVPLACEMENT_CHECKOVERLAPS
+
void GeometryManager::checkOverlaps() const
{
checkOverlaps(getWorldLogicalVolume(), true);
@@ -114,3 +116,5 @@
}
}
+#endif
+
lcdd/src
diff -u -r1.7 -r1.8
--- LCDDMessenger.cc 22 Nov 2006 02:24:53 -0000 1.7
+++ LCDDMessenger.cc 12 Jul 2007 18:09:01 -0000 1.8
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/LCDDMessenger.cc,v 1.7 2006/11/22 02:24:53 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/LCDDMessenger.cc,v 1.8 2007/07/12 18:09:01 jeremy Exp $
// LCDD
#include "LCDDMessenger.hh"
@@ -56,6 +56,7 @@
parser->setSetupName(setup);
parser->setVersion(version);
}
+#ifdef HAVE_G4PVPLACEMENT_CHECKOVERLAPS
else if ( cmd == m_checkOverlapsCmd || cmd == m_checkOverlapsRecurseCmd ) {
bool recurse=false;
@@ -79,6 +80,7 @@
GeometryManager::instance()->checkOverlaps();
}
}
+#endif
else {
G4cerr << "WARNING: Unknown cmd to LCDDMessenger - " << cmd << G4endl;
}
@@ -136,6 +138,7 @@
p = new G4UIparameter("Version",'s',true);
m_setupCmd->SetParameter(p);
+#ifdef HAVE_G4PVPLACEMENT_CHECKOVERLAPS
// Check overlaps.
m_checkOverlapsCmd = new G4UIcommand("/lcdd/checkOverlaps",this);
m_checkOverlapsCmd->SetGuidance("Call CheckOverlaps on a given volume or the world volume (no arguments).");
@@ -151,4 +154,5 @@
p = new G4UIparameter("Volume",'s',true);
p->SetDefaultValue("");
m_checkOverlapsRecurseCmd->SetParameter(p);
+#endif
}
lcdd/src
diff -u -r1.1 -r1.2
--- NistWriter.cc 9 Jan 2007 00:42:10 -0000 1.1
+++ NistWriter.cc 12 Jul 2007 18:09:01 -0000 1.2
@@ -1,5 +1,7 @@
#include "NistWriter.hh"
+#ifdef HAVE_G4NIST
+
#include "G4NistManager.hh"
#include "G4Material.hh"
@@ -71,3 +73,5 @@
GDMLWriter::writeCurrentGeometry(path);
}
+
+#endif
lcdd/src
diff -u -r1.1 -r1.2
--- NistWriterMessenger.cc 9 Jan 2007 00:42:10 -0000 1.1
+++ NistWriterMessenger.cc 12 Jul 2007 18:09:01 -0000 1.2
@@ -1,5 +1,7 @@
#include "NistWriterMessenger.hh"
+#ifdef HAVE_G4NIST
+
// lcdd
#include "NistWriter.hh"
@@ -32,8 +34,6 @@
m_dumpNistMaterialsCmd->SetGuidance("Dump GEANT4's NIST materials database to an output file.");
m_dumpNistMaterialsCmd->SetParameterName("materialsFile",true);
m_dumpNistMaterialsCmd->SetDefaultValue("NistMaterials.gdml");
-
-// G4NistManager* mgr = G4NistManager::Instance();
-// mgr->SetVerbose(4);
-// new G4NistMessenger(mgr);
}
+
+#endif
lcdd/src
diff -u -r1.1 -r1.2
--- SensitiveDetectorMessenger.cc 18 Dec 2006 21:20:08 -0000 1.1
+++ SensitiveDetectorMessenger.cc 12 Jul 2007 18:09:01 -0000 1.2
@@ -1,4 +1,4 @@
-// $Id: SensitiveDetectorMessenger.cc,v 1.1 2006/12/18 21:20:08 jeremy Exp $
+// $Id: SensitiveDetectorMessenger.cc,v 1.2 2007/07/12 18:09:01 jeremy Exp $
#include "SensitiveDetectorMessenger.hh"
// geant4
@@ -11,7 +11,7 @@
G4UIdirectory* SensitiveDetectorMessenger::m_detectorsDir = 0;
-SensitiveDetectorMessenger::SensitiveDetectorMessenger(G4SensitiveDetector* detector)
+SensitiveDetectorMessenger::SensitiveDetectorMessenger(G4SensitiveDetector* detector)
: m_detector(detector)
{
if ( m_detectorsDir == 0 ) {
@@ -44,13 +44,13 @@
m_detector->printHits( std::cout );
}
else if ( cmd == m_verboseCmd ) {
- m_detector->setVerbose( G4UIcmdWithAnInteger::GetNewIntValue( newVals ) );
+ m_detector->setVerbose( m_verboseCmd->GetNewIntValue( newVals ) );
}
else if ( cmd == m_activateCmd ) {
- m_detector->Activate( G4UIcmdWithABool::GetNewBoolValue( newVals ) );
+ m_detector->Activate( m_activateCmd->GetNewBoolValue( newVals ) );
}
else if ( cmd == m_ecutCmd ) {
- m_detector->setEcut( G4UIcmdWithADoubleAndUnit::GetNewDoubleValue( newVals ) );
+ m_detector->setEcut( m_ecutCmd->GetNewDoubleValue( newVals ) );
}
}
lcdd/src
diff -u -r1.1 -r1.2
--- StepReadout.cc 18 Dec 2006 21:19:12 -0000 1.1
+++ StepReadout.cc 12 Jul 2007 18:09:01 -0000 1.2
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/StepReadout.cc,v 1.1 2006/12/18 21:19:12 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/StepReadout.cc,v 1.2 2007/07/12 18:09:01 jeremy Exp $
#include "StepReadout.hh"
// LCDD
@@ -91,12 +91,17 @@
G4VSensitiveDetector* StepReadout::preSD() const
{
- return ((G4StepPoint*)pre())->GetSensitiveDetector();
+ return getSD(pre());
}
G4VSensitiveDetector* StepReadout::postSD() const
{
- return ((G4StepPoint*)post())->GetSensitiveDetector();
+ return getSD(post());
+}
+
+G4VSensitiveDetector* StepReadout::getSD(G4StepPoint* stepPoint) const
+{
+ return stepPoint->GetPhysicalVolume()->GetLogicalVolume()->GetSensitiveDetector();
}
bool StepReadout::hasSameSD() const
lcdd/src
diff -u -r1.12 -r1.13
--- regionSubscriber.cc 30 Mar 2006 19:43:58 -0000 1.12
+++ regionSubscriber.cc 12 Jul 2007 18:09:01 -0000 1.13
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/regionSubscriber.cc,v 1.12 2006/03/30 19:43:58 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/regionSubscriber.cc,v 1.13 2007/07/12 18:09:01 jeremy Exp $
// GDML
#include "Saxana/SAXSubscriber.h"
@@ -99,8 +99,12 @@
dynamic_cast<G4LimitSet*> ( proc->getLimitSet( limitsetref->get_ref() ) );
if ( ulim ) {
+#ifdef HAVE_G4REGION_SETUSERLIMITS
reg->SetUserLimits( ulim );
std::cout << "Set user limits <" << limitsetref->get_ref() << "> on region <" << name << ">" << std::endl;
+#else
+ std::cerr << "WARNING: Ignoring limitsetref on region. The method G4Region::SetUserLimits is not supported by your Geant4 version." << std::endl;
+#endif
}
else {
std::cerr << "FATAL ERROR: limit element not found - " << limitsetref->get_ref() << std::endl;
CVSspam 0.2.8