rename classes to remove G4 prepend; normalize include header strings
diff -N BoxDipole.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ BoxDipole.hh 1 Jul 2013 21:00:40 -0000 1.1 @@ -0,0 +1,40 @@
+#ifndef LCDD_BFIELD_BOXDIPOLE_HH +#define LCDD_BFIELD_BOXDIPOLE_HH 1 + +// Geant4 +#include "G4MagneticField.hh" + +class BoxDipole: public G4MagneticField +{ +public: + + BoxDipole(double x, double y, double z, double dx, double dy, double dz, double bx, double by, double bz); + + virtual ~BoxDipole() + { + ; + } + + void GetFieldValue(const double point[3], double *bfield) const; + +private: + + double _x; + double _y; + double _z; + double _dx; + double _dy; + double _dz; + double _bx; + double _by; + double _bz; + + double _maxx; + double _maxy; + double _maxz; + double _minx; + double _miny; + double _minz; +}; + +#endif
diff -N Dipole.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Dipole.hh 1 Jul 2013 21:00:40 -0000 1.1 @@ -0,0 +1,57 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Dipole.hh,v 1.1 2013/07/01 21:00:40 jeremy Exp $ + +#ifndef LCDD_BFIELD_DIPOLE_HH +#define LCDD_BFIELD_DIPOLE_HH 1 + +// Geant4 +#include "G4MagneticField.hh" + +// STL +#include <vector> + +/** + * @brief The Geant4 binding for the dipole element. + */ +class Dipole: public G4MagneticField +{ +public: + + Dipole() + { + } + + virtual ~Dipole() + { + } + +public: + void GetFieldValue(const double Point[3], double *Bfield) const; + + void setZMax(double zmax); + double getZMax(); + + void setRMax(double rmax); + double getRMax(); + + void setZMin(double zmin); + double getZMin(); + + void addCoeff(double coeff); + const std::vector<double>& getCoeffs(); + + void setFieldUnit(double unit); + double getFieldUnit(); + + void setLengthUnit(double unit); + double getLengthUnit(); + +private: + double m_zmin; + double m_zmax; + double m_rmax; + double m_lunit; + double m_funit; + std::vector<double> m_coeffs; +}; + +#endif
diff -N FieldManager.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ FieldManager.hh 1 Jul 2013 21:00:40 -0000 1.1 @@ -0,0 +1,47 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/FieldManager.hh,v 1.1 2013/07/01 21:00:40 jeremy Exp $ +#ifndef LCDD_BFIELD_FIELDMANAGER_HH +#define LCDD_BFIELD_FIELDMANAGER_HH 1 + +// LCDD +#include "lcdd/bfield/MagneticFieldOverlay.hh" + +// Geant4 +#include "G4FieldManager.hh" +#include "G4TransportationManager.hh" + +class LCDDProcessor; + +class FieldManager +{ + +public: + + virtual ~FieldManager(); + + static FieldManager* instance(); + + MagneticFieldOverlay* makeOverlay(std::vector<G4MagneticField*> fields); + + void setup(); + + G4MagneticField* setup(std::vector<G4MagneticField*> fields); + + void initialize(G4MagneticField* field); + + void addGlobalField(G4MagneticField* f); + + void addField(G4MagneticField* f); + +private: + + FieldManager(); + +private: + + std::vector<G4MagneticField*> m_globalfields; + std::vector<G4MagneticField*> m_allfields; + + static FieldManager* m_instance; +}; + +#endif
diff -N RZFieldMap.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ RZFieldMap.hh 1 Jul 2013 21:00:40 -0000 1.1 @@ -0,0 +1,54 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/RZFieldMap.hh,v 1.1 2013/07/01 21:00:40 jeremy Exp $ + +#ifndef LCDD_BFIELD_RZFIELDMAP_HH +#define LCDD_BFIELD_RZFIELDMAP_HH 1 + +// Geant4 +#include "G4MagneticField.hh" + +// LCDD +#include "RZBData.hh" + +#include <iostream> +#include <vector> + +/** + * @brief Magnetic field defined by rows of r, z, Br and Bz values. + */ +class RZFieldMap: public G4MagneticField +{ + +public: + + RZFieldMap(int numBinsR, int numBinsZ, double gridSizeR, double gridSizeZ, std::vector<RZBData> fieldData); + + virtual ~RZFieldMap(); + +public: + void GetFieldValue(const double Point[3], double *Bfield) const; + +private: + void initializeArrays(); + void fillArrays(std::vector<RZBData> fieldData); + void deleteArrays(); + +private: + + void computeNumBins(); + +private: + + int m_numBinsR; + int m_numBinsZ; + + double m_gridSizeR; + double m_gridSizeZ; + + double m_maxR; + double m_maxZ; + + double** m_BrArray; + double** m_BzArray; +}; + +#endif
diff -N Solenoid.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Solenoid.hh 1 Jul 2013 21:00:40 -0000 1.1 @@ -0,0 +1,97 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Solenoid.hh,v 1.1 2013/07/01 21:00:40 jeremy Exp $ + +#ifndef LCDD_BFIELD_SOLENOID_HH +#define LCDD_BFIELD_SOLENOID_HH 1 + +// Geant4 +#include "G4MagneticField.hh" + +// STL +#include <iostream> + +/** + * @brief Simulation class for a simple magnetic solenoid. + */ +class Solenoid: public G4MagneticField +{ + +public: + Solenoid(); + virtual ~Solenoid(); + +public: + + void GetFieldValue(const double Point[3], double *Bfield) const; + + void setInnerField(double d) + { + _innerField = d; + } + + void setOuterField(double d) + { + _outerField = d; + } + + void setInnerR(double d) + { + _innerR = d; + } + + void setOuterR(double d) + { + _outerR = d; + } + + void setInnerZ(double d) + { + _innerZ = d; + } + + void setOuterZ(double d) + { + _outerZ = d; + } + + double getInnerField() const + { + return _innerField; + } + + double getOuterField() const + { + return _outerField; + } + + double getInnerR() const + { + return _innerR; + } + + double getOuterR() const + { + return _outerR; + } + + double getInnerZ() const + { + return _innerZ; + } + + double getOuterZ() const + { + return _outerZ; + } + + void printOut(std::ostream &os); + +private: + double _innerField; + double _outerField; + double _innerR; + double _outerR; + double _innerZ; + double _outerZ; +}; + +#endif
diff -u -r1.1 -r1.2 --- Cartesian3DMagneticFieldMap.hh 26 Jun 2013 01:32:44 -0000 1.1 +++ Cartesian3DMagneticFieldMap.hh 1 Jul 2013 21:00:40 -0000 1.2 @@ -1,4 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Cartesian3DMagneticFieldMap.hh,v 1.1 2013/06/26 01:32:44 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Cartesian3DMagneticFieldMap.hh,v 1.2 2013/07/01 21:00:40 jeremy Exp $
+
+#ifndef LCDD_BFIELD_CARTESIAN3DMAGNETICFIELDMAP_HH
+#define LCDD_BFIELD_CARTESIAN3DMAGNETICFIELDMAP_HH 1
// Geant4 #include "G4MagneticField.hh"
@@ -44,3 +47,4 @@
void GetFieldValue(const double Point[4], double* Bfield) const; };
+#endif
diff -u -r1.1 -r1.2 --- MagneticFieldOverlay.hh 26 Jun 2013 01:32:44 -0000 1.1 +++ MagneticFieldOverlay.hh 1 Jul 2013 21:00:40 -0000 1.2 @@ -1,6 +1,6 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/MagneticFieldOverlay.hh,v 1.1 2013/06/26 01:32:44 jeremy Exp $ -#ifndef LCDD_MAGNETICFIELDOVERLAY_HH -#define LCDD_MAGNETICFIELDOVERLAY_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/MagneticFieldOverlay.hh,v 1.2 2013/07/01 21:00:40 jeremy Exp $ +#ifndef LCDD_BFIELD_MAGNETICFIELDOVERLAY_HH +#define LCDD_BFIELD_MAGNETICFIELDOVERLAY_HH 1
#include "G4MagneticField.hh"
diff -u -r1.1 -r1.2 --- RZBData.hh 26 Jun 2013 01:32:44 -0000 1.1 +++ RZBData.hh 1 Jul 2013 21:00:40 -0000 1.2 @@ -1,6 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/RZBData.hh,v 1.1 2013/06/26 01:32:44 jeremy Exp $ -#ifndef LCDD_RZBDATA_HH -#define LCDD_RZBDATA_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/RZBData.hh,v 1.2 2013/07/01 21:00:40 jeremy Exp $ + +#ifndef LCDD_BFIELD_RZBDATA_HH +#define LCDD_BFIELD_RZBDATA_HH 1
/** * @class RZBData
diff -N G4BoxDipole.hh --- G4BoxDipole.hh 26 Jun 2013 01:32:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,39 +0,0 @@
-#ifndef LCDD_G4BOXDIPOLE_HH -#define LCDD_G4BOXDIPOLE_HH 1 - -#include "G4MagneticField.hh" - -class G4BoxDipole: public G4MagneticField -{ -public: - - G4BoxDipole(double x, double y, double z, double dx, double dy, double dz, double bx, double by, double bz); - - virtual ~G4BoxDipole() - { - ; - } - - void GetFieldValue(const double point[3], double *bfield) const; - -private: - - double _x; - double _y; - double _z; - double _dx; - double _dy; - double _dz; - double _bx; - double _by; - double _bz; - - double _maxx; - double _maxy; - double _maxz; - double _minx; - double _miny; - double _minz; -}; - -#endif
diff -N G4BoxField.hh --- G4BoxField.hh 27 Jun 2013 23:42:24 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,5 +0,0 @@
-// FIXME: remove this class??? -class G4BoxField -{ - -};
diff -N G4Dipole.hh --- G4Dipole.hh 26 Jun 2013 01:32:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,54 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Attic/G4Dipole.hh,v 1.1 2013/06/26 01:32:44 jeremy Exp $ - -#ifndef LCDD_G4DIPOLE_HH -#define LCDD_G4DIPOLE_HH 1 - -#include "G4MagneticField.hh" - -#include <vector> - -/** - * @class G4Dipole - * @brief The Geant4 binding for the dipole element. - */ -class G4Dipole: public G4MagneticField -{ -public: - G4Dipole() - { - } - virtual ~G4Dipole() - { - } - -public: - void GetFieldValue(const double Point[3], double *Bfield) const; - - void setZMax(double zmax); - double getZMax(); - - void setRMax(double rmax); - double getRMax(); - - void setZMin(double zmin); - double getZMin(); - - void addCoeff(double coeff); - const std::vector<double>& getCoeffs(); - - void setFieldUnit(double unit); - double getFieldUnit(); - - void setLengthUnit(double unit); - double getLengthUnit(); - -private: - double m_zmin; - double m_zmax; - double m_rmax; - double m_lunit; - double m_funit; - std::vector<double> m_coeffs; -}; - -#endif
diff -N G4RZFieldMap.hh --- G4RZFieldMap.hh 26 Jun 2013 01:32:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,54 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Attic/G4RZFieldMap.hh,v 1.1 2013/06/26 01:32:44 jeremy Exp $ - -#ifndef LCDD_G4RZFIELDMAP_HH -#define LCDD_G4RZFIELDMAP_HH 1 - -#include "G4MagneticField.hh" - -// LCDD -#include "RZBData.hh" - -#include <iostream> -#include <vector> - -/** - * @class G4RZFieldMap - * @brief Magnetic field defined by rows of r, z, Br and Bz values. - */ -class G4RZFieldMap: public G4MagneticField -{ - -public: - - G4RZFieldMap(int numBinsR, int numBinsZ, double gridSizeR, double gridSizeZ, std::vector<RZBData> fieldData); - - virtual ~G4RZFieldMap(); - -public: - void GetFieldValue(const double Point[3], double *Bfield) const; - -private: - void initializeArrays(); - void fillArrays(std::vector<RZBData> fieldData); - void deleteArrays(); - -private: - - void computeNumBins(); - -private: - - int m_numBinsR; - int m_numBinsZ; - - double m_gridSizeR; - double m_gridSizeZ; - - double m_maxR; - double m_maxZ; - - double** m_BrArray; - double** m_BzArray; -}; - -#endif
diff -N G4Solenoid.hh --- G4Solenoid.hh 26 Jun 2013 01:32:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,96 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Attic/G4Solenoid.hh,v 1.1 2013/06/26 01:32:44 jeremy Exp $ - -#ifndef LCDD_G4SOLENOID_HH -#define LCDD_G4SOLENOID_HH 1 - -#include "G4MagneticField.hh" - -#include <iostream> - -/** - @class G4Solenoid - @brief Simulation class for a simple magnetic solenoid. - */ -class G4Solenoid: public G4MagneticField -{ - -public: - G4Solenoid(); - virtual ~G4Solenoid(); - -public: - - void GetFieldValue(const double Point[3], double *Bfield) const; - - void setInnerField(double d) - { - _innerField = d; - } - - void setOuterField(double d) - { - _outerField = d; - } - - void setInnerR(double d) - { - _innerR = d; - } - - void setOuterR(double d) - { - _outerR = d; - } - - void setInnerZ(double d) - { - _innerZ = d; - } - - void setOuterZ(double d) - { - _outerZ = d; - } - - double getInnerField() const - { - return _innerField; - } - - double getOuterField() const - { - return _outerField; - } - - double getInnerR() const - { - return _innerR; - } - - double getOuterR() const - { - return _outerR; - } - - double getInnerZ() const - { - return _innerZ; - } - - double getOuterZ() const - { - return _outerZ; - } - - void printOut(std::ostream &os); - -private: - double _innerField; - double _outerField; - double _innerR; - double _outerR; - double _innerZ; - double _outerZ; -}; - -#endif
diff -N LCDDFieldManager.hh --- LCDDFieldManager.hh 26 Jun 2013 01:32:44 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,47 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Attic/LCDDFieldManager.hh,v 1.1 2013/06/26 01:32:44 jeremy Exp $ -#ifndef LCDD_LCDDFIELDMANAGER_HH -#define LCDD_LCDDFIELDMANAGER_HH 1 - -// LCDD -#include "lcdd/bfield/MagneticFieldOverlay.hh" - -// Geant4 -#include "G4FieldManager.hh" -#include "G4TransportationManager.hh" - -class LCDDProcessor; - -class LCDDFieldManager -{ - -public: - - virtual ~LCDDFieldManager(); - - static LCDDFieldManager* instance(); - - MagneticFieldOverlay* makeOverlay(std::vector<G4MagneticField*> fields); - - void setup(); - - G4MagneticField* setup(std::vector<G4MagneticField*> fields); - - void initialize(G4MagneticField* field); - - void addGlobalField(G4MagneticField* f); - - void addField(G4MagneticField* f); - -private: - - LCDDFieldManager(); - -private: - - std::vector<G4MagneticField*> m_globalfields; - std::vector<G4MagneticField*> m_allfields; - - static LCDDFieldManager* m_instance; -}; - -#endif
diff -u -r1.1 -r1.2 --- LCDDDetectorConstruction.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ LCDDDetectorConstruction.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,6 +1,6 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDDetectorConstruction.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef lcdd_LCDDDetectorConstruction_hh -#define lcdd_LCDDDetectorConstruction_hh 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDDetectorConstruction.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_CORE_LCDDDETECTORCONSTRUCTION_HH +#define LCDD_CORE_LCDDDETECTORCONSTRUCTION_HH 1
// Geant4 #include "G4VUserDetectorConstruction.hh"
diff -u -r1.1 -r1.2 --- LCDDMessenger.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ LCDDMessenger.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,7 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDMessenger.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDMessenger.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $
-#ifndef LCDD_LCDDMESSENGER_HH -#define LCDD_LCDDMESSENGER_HH 1
+#ifndef LCDD_CORE_LCDDMESSENGER_HH +#define LCDD_CORE_LCDDMESSENGER_HH 1
#include "G4UImessenger.hh"
diff -u -r1.2 -r1.3 --- LCDDObjectStoreInspector.hh 27 Jun 2013 23:42:24 -0000 1.2 +++ LCDDObjectStoreInspector.hh 1 Jul 2013 21:00:41 -0000 1.3 @@ -1,6 +1,6 @@
-// $Id: LCDDObjectStoreInspector.hh,v 1.2 2013/06/27 23:42:24 jeremy Exp $ -#ifndef LCDD_LCDDOBJECTSTOREINSPECTOR_HH -#define LCDD_LCDDOBJECTSTOREINSPECTOR_HH 1
+// $Id: LCDDObjectStoreInspector.hh,v 1.3 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_CORE_LCDDOBJECTSTOREINSPECTOR_HH +#define LCDD_CORE_LCDDOBJECTSTOREINSPECTOR_HH 1
// LCDD #include "lcdd/util/StoreInspector.hh"
diff -u -r1.1 -r1.2 --- LCDDParser.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ LCDDParser.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,8 +1,9 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDParser.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDParser.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $
-#ifndef LCDDParser_h -#define LCDDParser_h 1
+#ifndef LCDD_CORE_LCDDPARSER_HH +#define LCDD_CORE_LCDDPARSER_HH 1
+// GDML
#include "Saxana/SAXProcessor.h" #include "Saxana/ProcessingConfigurator.h"
diff -u -r1.1 -r1.2 --- LCDDProcessor.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ LCDDProcessor.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,5 +1,7 @@
-#ifndef LCDD_LCDDPROCESSOR_HH -#define LCDD_LCDDPROCESSOR_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/core/LCDDProcessor.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_CORE_LCDDPROCESSOR_HH +#define LCDD_CORE_LCDDPROCESSOR_HH 1
// Geant4 #include "G4MagneticField.hh"
@@ -7,8 +9,8 @@
#include "G4VisAttributes.hh" // LCDD
-#include "lcdd/detectors/G4SensitiveDetector.hh" -#include "lcdd/geant4/G4LimitSet.hh"
+#include "lcdd/detectors/SensitiveDetector.hh" +#include "lcdd/geant4/PhysicsLimitSet.hh"
#include "lcdd/geant4/LCDDHeaderRecord.hh" #include <string>
@@ -32,11 +34,11 @@
static LCDDProcessor* instance(); public:
- typedef std::map<std::string, G4SensitiveDetector*> SensitiveDetectors;
+ typedef std::map<std::string, SensitiveDetector*> SensitiveDetectors;
typedef std::map<std::string, G4MagneticField*> MagneticFields; typedef std::map<std::string, G4Region*> Regions; typedef std::map<std::string, G4VisAttributes*> VisAttributes;
- typedef std::map<std::string, G4LimitSet*> LimitSets;
+ typedef std::map<std::string, PhysicsLimitSet*> LimitSets;
public:
@@ -48,10 +50,10 @@
std::string getDetectorName() const; // Sensitive Detectors
- void addSensitiveDetector(std::string& name, G4SensitiveDetector* sd);
+ void addSensitiveDetector(std::string& name, SensitiveDetector* sd);
- G4SensitiveDetector* getSensitiveDetector(const std::string& name); - G4SensitiveDetector* getSensitiveDetector(const char* name);
+ SensitiveDetector* getSensitiveDetector(const std::string& name); + SensitiveDetector* getSensitiveDetector(const char* name);
LCDDProcessor::SensitiveDetectors::const_iterator getSensitiveDetectorsBegin(); LCDDProcessor::SensitiveDetectors::const_iterator getSensitiveDetectorsEnd();
@@ -77,9 +79,9 @@
LCDDProcessor::Regions::const_iterator getRegionsEnd(); // user limit set
- void addLimitSet(std::string& name, G4LimitSet* lim); - G4LimitSet* getLimitSet(const std::string& name); - G4LimitSet* getLimitSet(const char* name);
+ void addLimitSet(std::string& name, PhysicsLimitSet* lim); + PhysicsLimitSet* getLimitSet(const std::string& name); + PhysicsLimitSet* getLimitSet(const char* name);
LCDDProcessor::LimitSets::const_iterator getLimitSetsBegin(); LCDDProcessor::LimitSets::const_iterator getLimitSetsEnd();
diff -N G4StoreManager.hh --- G4StoreManager.hh 27 Jun 2013 23:42:24 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,32 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/core/Attic/G4StoreManager.hh,v 1.2 2013/06/27 23:42:24 jeremy Exp $ - -#ifndef LCDD_G4STOREMANAGER_HH -#define LCDD_G4STOREMANAGER_HH 1 - -// FIXME: This class actually needs to do something besides just creating "/stores/" cmd dir. Probably it can -// be removed and the command directory creation moved elsewhere. - -/** - @brief Singleton manager class for retrieval of G4 solids, LV, PV and regions from stores. - @note Can also dumps/clear G4 stores. - */ -class G4StoreManager -{ - -protected: - G4StoreManager(); - -public: - - virtual ~G4StoreManager(); - -public: - - // get singleton instance - static G4StoreManager* instance(); - -private: - static G4StoreManager *_instance; -}; - -#endif
diff -N CalorimeterSD.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ CalorimeterSD.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,65 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/CalorimeterSD.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_DETECTORS_CALORIMETERSD_HH +#define LCDD_DETECTORS_CALORIMETERSD_HH 1 + +// Geant4 +#include "lcdd/detectors/SensitiveDetector.hh" +#include "lcdd/detectors/HitComparator.hh" +#include "lcdd/hits/CalorimeterHit.hh" +#include "lcdd/detectors/Segmentation.hh" + +/** + * @brief Simulator implementation of calorimeter-type SD. + */ +class CalorimeterSD: public SensitiveDetector +{ + +public: + + typedef std::vector<CalorimeterHit*> G4CalorimeterHitList; + +public: + CalorimeterSD(G4String sdName, G4String hcName, Segmentation* sdSeg, HitComparator* compare = 0); + + CalorimeterSD(G4String sdName, const std::vector<G4String>& hcNames, Segmentation* sdSeg, HitComparator* compare = 0); + + virtual ~CalorimeterSD(); + +public: + + virtual bool isValidVolume(G4LogicalVolume* lv); + + virtual void Initialize(G4HCofThisEvent *); + virtual void EndOfEvent(G4HCofThisEvent *); + + Segmentation* getSegmentation() const; + + CalorimeterHit* findHit(CalorimeterHit* aHit) const; + CalorimeterHit* findHit(CalorimeterHit* aHit, G4int nHC) const; + + std::ostream& printHits(std::ostream& os); + + void clearHits(); + + virtual std::ostream& printBasicInfo(std::ostream& os); + + virtual double getEdep() const; + virtual double getEdep(G4int nHC) const; + + G4CalorimeterHitList getCalorimeterHitList(); + G4CalorimeterHitList getCalorimeterHitList(G4int nHC); + +protected: + virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); + +protected: + Segmentation* m_segmentation; + G4CalorimeterHitsCollection* m_collection; + std::vector<G4CalorimeterHitsCollection*> m_hitsCollections; + G4CalorimeterHitList m_hits; + std::vector<G4CalorimeterHitList> hits_vector; + HitComparator* m_hitCompare; +}; + +#endif
diff -N GlobalGridXYSegmentation.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ GlobalGridXYSegmentation.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,59 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/GlobalGridXYSegmentation.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_DETECTORS_GLOBALGRIDXYSEGMENTATION_HH +#define LCDD_DETECTORS_GLOBALGRIDXYSEGMENTATION_HH 1 + +// LCDD +#include "Segmentation.hh" + +// Geant4 +#include "globals.hh" + +/** + * @brief Uniform 3D grid segmentation class. + * @note Version of grid segmentation with binning on global coordinates, not local. + */ +class GlobalGridXYSegmentation: public Segmentation +{ + +public: + + GlobalGridXYSegmentation(double gridSizeX, double gridSizeY); + + virtual ~GlobalGridXYSegmentation(); + +public: + + // from par class + virtual G4ThreeVector getGlobalHitPos(const G4Step* aStep); + + // hit position from step position + G4ThreeVector getLocalHitPos(const G4ThreeVector& localStepPos); + + virtual void setBins(const G4Step* aStep); + + virtual void setBinNames() + { + addBinName("x"); + addBinName("y"); + } + +protected: + + // compute signed int bin values with base at local origin + int computeBinX(const G4ThreeVector& localStepPos); + int computeBinY(const G4ThreeVector& localStepPos); + int computeBinZ(const G4ThreeVector& localStepPos); + + // individual position dim from bin + double computeDimX(int bin); + double computeDimY(int bin); + double computeDimZ(int bin); + +private: + + double m_gridSizeX; + double m_gridSizeY; + double m_gridSizeZ; +}; + +#endif
diff -N GridXYZSegmentation.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ GridXYZSegmentation.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,63 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/GridXYZSegmentation.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_DETECTORS_G4GRIDXYZSEGMENTATION_HH +#define LCDD_DETECTORS_G4GRIDXYZSEGMENTATION_HH 1 + +// LCDD +#include "Segmentation.hh" + +// Geant4 +#include "globals.hh" + +/** + * @brief Uniform 3D grid segmentation class. + * @note This class performs calculations to divide a box-like volume into a uniform, 3D grid with square cells. + */ +class GridXYZSegmentation: public Segmentation +{ + +public: + + GridXYZSegmentation(double gridSizeX, double gridSizeY, double gridSizeZ); + + virtual ~GridXYZSegmentation(); + +public: + + // from par class + virtual G4ThreeVector getGlobalHitPos(const G4Step* aStep); + + virtual void setBins(const G4Step* aStep); + + // DEPRECATED + virtual G4ThreeVector getGlobalHitPosPreStep(const G4StepPoint* aPreStepPoint); + + // DEPRECATED + virtual G4ThreeVector getLocalHitPos(const G4ThreeVector& localStepPos); + + virtual void setBinNames() + { + addBinName("x"); + addBinName("y"); + addBinName("z"); + } + +protected: + + // compute signed int bin values with base at local origin + int computeBinX(const G4ThreeVector& localStepPos); + int computeBinY(const G4ThreeVector& localStepPos); + int computeBinZ(const G4ThreeVector& localStepPos); + + // individual position dim from bin + double computeDimX(int bin); + double computeDimY(int bin); + double computeDimZ(int bin); + +private: + + double m_gridSizeX; + double m_gridSizeY; + double m_gridSizeZ; +}; + +#endif
diff -N NonprojectiveCylinderSegmentation.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ NonprojectiveCylinderSegmentation.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,47 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/NonprojectiveCylinderSegmentation.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_DETECTORS_G4NONPROJECTIVECYLINDERSEGMENTATION +#define LCDD_DETECTORS_G4NONPROJECTIVECYLINDERSEGMENTATION 1 + +// LCDD +#include "Segmentation.hh" + +/** + * @brief Segmentation using a nonprojective cylinder. + */ +class NonprojectiveCylinderSegmentation: public Segmentation +{ +public: + NonprojectiveCylinderSegmentation(double gridSizePhi, double gridSizeZ); + virtual ~NonprojectiveCylinderSegmentation(); + +public: + + virtual G4ThreeVector getGlobalHitPos(const G4Step* aStep); + virtual G4ThreeVector getGlobalHitPos(const G4StepPoint* aPreStepPoint); + virtual void setBins(const G4Step* aStep); + virtual void setBins(const G4StepPoint* aPreStepPoint); + virtual void setBinNames() + { + addBinName("phi"); + addBinName("z"); + } + + G4ThreeVector getLocalHitPos(const G4Step* aStep); + G4ThreeVector getLocalHitPos(const G4StepPoint* aPreStepPoint); + virtual bool isValidSolid(G4VSolid*); + +private: + + double computeDeltaPhi(const G4Step* aStep); + double computeDeltaPhi(const G4StepPoint* aPreStepPoint); + int computeBinPhi(const G4Step* aStep); + int computeBinPhi(const G4StepPoint* aPreStepPoint); + int computeBinZ(const G4ThreeVector& localStepPos); + +private: + + double m_gridSizePhi; + double m_gridSizeZ; +}; + +#endif
diff -N OpticalCalorimeterSD.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ OpticalCalorimeterSD.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,36 @@
+#ifndef LCDD_DETECTORS_OPTICALCALORIMETERSD_HH +#define LCDD_DETECTORS_OPTICALCALORIMETERSD_HH + +// SLIC +#include "lcdd/detectors/CalorimeterSD.hh" + +// STL +#include <vector> + +class Cerenkov; + +/** + * @brief Simulator implementation of a calorimeter SD that is sensitive to optical photons. + */ +class OpticalCalorimeterSD: public CalorimeterSD +{ +private: + Cerenkov* CerenGenerator; +public: + //enum for the two Hit Collections (cerenkov and edep): + enum HCType + { + eEdep = 0, eCerenkov = 1 + }; + + OpticalCalorimeterSD(G4String sdName, G4String hcName, Segmentation* sdSeg, HitComparator* compare = 0); + + OpticalCalorimeterSD(G4String sdName, const std::vector<G4String>& hcNames, Segmentation* sdSeg, HitComparator* compare = 0); + + virtual ~OpticalCalorimeterSD(); + +protected: + virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); +}; + +#endif
diff -N ProjectiveCylinderSegmentation.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ProjectiveCylinderSegmentation.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,32 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/ProjectiveCylinderSegmentation.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_DETECTORS_G4PROJECTIVECYLINDERSEGMENTATION_HH +#define LCDD_DETECTORS_G4PROJECTIVECYLINDERSEGMENTATION_HH 1 + +// LCDD +#include "lcdd/detectors/ProjectiveSegmentation.hh" + +// Geant4 +#include "globals.hh" + +/** + * @brief Simulation class for projective cylinder segmentation. + */ +class ProjectiveCylinderSegmentation: public ProjectiveSegmentation +{ + +public: + ProjectiveCylinderSegmentation(G4int ntheta, G4int nphi); + + virtual ~ProjectiveCylinderSegmentation(); + + virtual bool isValidSolid(G4VSolid* s); + +protected: + + virtual double getRadius(const G4Step* aStep); + virtual double getZ(const G4Step* aStep); + virtual double getRadius(const G4StepPoint* aPreStepPoint); + virtual double getZ(const G4StepPoint* aPreStepPoint); +}; + +#endif
diff -N ProjectiveSegmentation.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ProjectiveSegmentation.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,71 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/ProjectiveSegmentation.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_DETECTORS_PROJECTIVESEGMENTATION_HH +#define LCDD_DETECTORS_PROJECTIVESEGMENTATION_HH 1 + +#include "Segmentation.hh" + +#include "globals.hh" + +/** + * @brief Generic projective segmentation class. + */ +class ProjectiveSegmentation: public Segmentation +{ + +public: + ProjectiveSegmentation(int ntheta, int nphi); + + virtual ~ProjectiveSegmentation(); + +public: + + // virtuals from G4Segmentation; should not be overridden + // in subclasses + G4ThreeVector getGlobalHitPos(const G4Step* aStep); + G4ThreeVector getGlobalHitPos(const G4StepPoint* aPreStepPoint); + void setBins(const G4Step* aStep); + void setBins(const G4StepPoint* aPreStepPoint); + virtual void setBinNames() + { + addBinName("theta"); + addBinName("phi"); + } + +protected: + + int getNtheta() const; + int getNphi() const; + + // bins from 3vect pos + int getThetaBin(const G4ThreeVector& globalStepPos); + int getPhiBin(const G4ThreeVector& globalStepPos); + + // dim from bin + double getThetaDim(const int &thetaBin) const; + double getPhiDim(const int &phiBin) const; + + // dim from step + double getThetaDim(const G4Step* aStep); + // dim from prestep + double getThetaDim(const G4StepPoint* aPreStepPoint); + + double getPhiDim(const G4Step* aStep); + // dim from prestep point: + double getPhiDim(const G4StepPoint* aPreStepPoint); + + // These should be overridden in subclasses + // for a specific shape or orientation. + virtual double getRadius(const G4Step* aStep); + virtual double getZ(const G4Step* aStep); + virtual double getRadius(const G4StepPoint* aPreStepPoint); + virtual double getZ(const G4StepPoint* aPreStepPoint); +private: + + void computeDivisions(); + +private: + int m_ntheta, m_nphi; + double m_divTheta, m_divPhi; +}; + +#endif
diff -N ProjectiveZPlaneSegmentation.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ProjectiveZPlaneSegmentation.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,31 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/ProjectiveZPlaneSegmentation.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_DETECTORS_PROJECTIVEZPLANESEGMENTATION_HH +#define LCDD_DETECTORS_PROJECTIVEZPLANESEGMENTATION_HH 1 + +// LCDD +#include "ProjectiveSegmentation.hh" + +// Geant4 +#include "globals.hh" + +/** + * @brief Projective segmentation using Z. + * @note This class uses Z from current volume rather than the cylindrical radius. + */ +class ProjectiveZPlaneSegmentation: public ProjectiveSegmentation +{ + +public: + ProjectiveZPlaneSegmentation(int ntheta, int nphi); + + virtual ~ProjectiveZPlaneSegmentation(); + +protected: + + virtual double getRadius(const G4Step* aStep); + virtual double getZ(const G4Step* aStep); + virtual double getRadius(const G4StepPoint* aPreStepPoint); + virtual double getZ(const G4StepPoint* aPreStepPoint); +}; + +#endif
diff -N ScorerSD.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ScorerSD.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,24 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/ScorerSD.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_DETECTORS_SCORERSD_HH +#define LCDD_DETECTORS_SCORERSD_HH 1 + +// LCDD +#include "TrackerSD.hh" + +/** + * @brief Scoring plane sensitive detector. + */ +class ScorerSD: public TrackerSD +{ +public: + ScorerSD(G4String sdName, G4String hcName); + +protected: + virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); + +protected: + int m_currentTrackID; +}; + +#endif
diff -N Segmentation.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Segmentation.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,145 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Segmentation.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_DETECTORS_SEGMENTATION_HH +#define LCDD_DETECTORS_SEGMENTATION_HH 1 + +// Geant4 +#include "G4ThreeVector.hh" +#include "G4Step.hh" + +// STL +#include <iostream> +#include <vector> + +/** + * @brief Segmentation base class. + * @todo Add method setVolume(G4LogicalVolume*) for setting up segmentation with current step volume. + */ +class Segmentation +{ +public: + enum EType + { + eProjective = 1, eNonprojective + }; + typedef std::vector<std::string> BinNames; + +public: + Segmentation(EType segType, int nbins = 2); + virtual ~Segmentation(); + +public: + + /** + * Compute the global hit position from a step. + */ + virtual G4ThreeVector getGlobalHitPos(const G4Step* aStep); + + /** + * Set the identifier bin values from a step. + */ + virtual void setBins(const G4Step*) = 0; + + /** + * Add valid bin names to this segmentation. + */ + virtual void setBinNames() = 0; + + /** + * Compute the bin given a coordinate in one dimension. + */ + static int computeBin(double localDim, double gridDim) + { + return int(floor(localDim / gridDim)); + + } + + /** + * Compute the coordinate in one dimension given a bin value. + */ + static double computeDim(const int &bin, const double &incr) + { + return (double(bin) + .5) * incr; + } + + // DEPRECATED + // Used by G4OpticalCalorimeter only. + virtual G4ThreeVector getGlobalHitPosPreStep(const G4StepPoint* aPreStepPoint); + + // DEPRECATED + // Used by G4OpticalCalorimeter only. + G4ThreeVector getLocalHitPos(const G4ThreeVector& localStepPos); + + void resetBins(); + + EType getType(); + + inline const G4String& getTypeString() + { + static G4String typestr; + if (m_type == eProjective) { + typestr = "Projective"; + } else if (m_type == eNonprojective) { + typestr = "Nonprojective"; + } else { + typestr = "Unknown"; + } + + return typestr; + } + + inline int getBin(int idx) + { + return m_bins.at(idx); + } + + inline const std::string& getBinName(int idx) + { + return m_binNames.at(idx); + } + + inline void addBinName(const std::string& binName) + { + m_binNames.push_back(binName); + } + + void setBin(int binIdx, int binVal); + + int getNumberOfBins(); + + const std::vector<int>& getBins(); + + const std::vector<std::string>& getBinNames() + { + return m_binNames; + } + + // Print the bins. + void printOutBins(std::ostream& os) + { + printOutBins(os, m_bins); + } + + static void printOutBins(std::ostream& os, const std::vector<int>& bins); + + /* + * Check whether the solid is valid for this segmentation. + */ + virtual bool isValidSolid(G4VSolid*); + +private: + + // bin values + std::vector<int> m_bins; + + // bin names + BinNames m_binNames; + + // number of numbers + int m_numBins; + + // type of segmentation + EType m_type; +}; + +#endif
diff -N SegmentationFactory.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ SegmentationFactory.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,29 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/SegmentationFactory.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_DETECTORS_SEGMENTATIONFACTORY_HH +#define LCDD_DETECTORS_SEGMENTATIONFACTORY_HH 1 + +class Segmentation; +class SAXObject; + +// STL +#include <string> + +/** + * @brief Returns a concrete segmentation object depending on input tag. + * @note Includes a single, static method. + */ +class SegmentationFactory +{ +private: + + // should not be instantiated + SegmentationFactory() + { + } + +public: + static Segmentation* createSegmentation(SAXObject* obj, const std::string& tag); +}; + +#endif
diff -N SensitiveDetector.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ SensitiveDetector.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,305 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/SensitiveDetector.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_DETECTORS_SENSITIVEDETECTOR_HH +#define LCDD_DETECTORS_SENSITIVEDETECTOR_HH 1 + +// Geant4 +#include "G4VSensitiveDetector.hh" +#include "G4UnitsTable.hh" + +// LCDD +#include "lcdd/detectors/StepReadout.hh" +#include "lcdd/id/IdSpec.hh" +#include "lcdd/id/Id64bit.hh" + +class G4UImessenger; +class G4VHitsCollection; + +/** + * @brief Basic implementation of G4VSensitiveDetector. + * @note Primary attributes include verbosity, energy cut, + * IdSpec,and hits collections. + */ +class SensitiveDetector: public G4VSensitiveDetector, protected StepReadout +{ +public: + + /** + * EType indicates the basic type of detector, e.g. tracker or calorimeter. + */ + enum EType + { + eNone = 0, eTracker = 1, eCalorimeter = 2 + }; + + static const std::string& trackerStr; + static const std::string& calorimeterStr; + static const std::string& noneStr; + +public: + + SensitiveDetector(G4String sdName, G4String hcName, EType sdType); + + SensitiveDetector(G4String sdName, const std::vector<G4String>& hcNames, EType sdType); + + virtual ~SensitiveDetector(); + +public: + + /** + * Geant4 initialization function called at beginning of event. + */ + virtual void Initialize(G4HCofThisEvent *); + + /** + * Geant4 EndOfEvent hook. + */ + virtual void EndOfEvent(G4HCofThisEvent *); + +protected: + + /** + * Geant4 function to make hits from the step. + */ + virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); + +public: + + /** + * Return the type of this detector encoded as an int. + */ + inline SensitiveDetector::EType getType() const + { + return m_type; + } + + /** + * Return the type of this detector encoded as a string. + */ + inline const std::string& getTypeString() const; + + /** + * Return the hits collection ID associated with this detector. + */ + inline G4int getHCID() const + { + return m_hcids[0]; + } + + inline G4int getHCID(G4int nHC) const + { + if (nHC > getNumberOfHitsCollections() + 1 || nHC < 0) { + G4cerr << "The index " << nHC << " is not valid for SD " << this->GetName() << "." << G4endl; + G4Exception("", "", FatalException, "Invalid index."); + } + return m_hcids[nHC]; + } + + /** + * Check whether the G4LogicalVolume can be readout by this detector. + * Base function just returns if the volume was assigned to this detector. + */ + inline virtual bool isValidVolume(G4LogicalVolume* lv) + { + return lv != 0; + } + + /** + * Return the hits collection name associated with this detector. + */ + inline const std::string& getHCName() const + { + return collectionName[0]; + } + + inline const std::string& getHCName(G4int nHC) const + { + return collectionName[nHC]; + } + + /** + * Set the verbosity level of this detector. + */ + inline void setVerbose(unsigned int v) + { + m_verbose = v; + } + + /** + * Get the verbosity level of this detector. + */ + inline unsigned int getVerbose() const + { + return m_verbose; + } + + /** + * Return the hit energy cut of this detector. + */ + inline G4double getEcut() + { + return m_ecut; + } + + /** + * Set the hit energy cut of this detector. + */ + inline void setEcut(G4double ecut) + { + m_ecut = ecut; + } + + /** + * Set the identifier specification for this detector. + */ + inline void setIdSpec(IdSpec* idspec) + { + m_idspec = idspec; + } + + /** + * Return the identifier specification for this detector. + */ + inline IdSpec* getIdSpec() const + { + return m_idspec; + } + + /** + * Returns whether or not this detector has an associated identifier specification. + */ + inline bool hasIdSpec() const + { + return m_idspec != 0; + } + + /** + * Create a 64-bit identifier based on the current step information. + */ + Id64bit makeId() const; + + /** + * Set the endcap flag. + */ + inline void setEndcapFlag( bool ec = true ) + { + m_endcap = ec; + } + + /** + * Return the endcap flag. + */ + inline bool getEndcapFlag() + { + return m_endcap; + } + + /** + * Print basic information about this detector to the output stream. + */ + virtual std::ostream& printBasicInfo(std::ostream& os); + + /** + * Print the number of hits to the output stream. + */ + virtual std::ostream& printNumberOfHits(std::ostream& os); + + /** + * Print the number of hits to the output stream. + */ + virtual std::ostream& printEdep(std::ostream& os); + + /** + * Print the names of volumes associated to this detector. + */ + virtual std::ostream& printVolumes(std::ostream& os); + + /** + * Print the list of hits. Subclasses must implement this. + */ + virtual std::ostream& printHits(std::ostream& os) {return os;} + + /** + * Get single (first) HC associated with this detector. + */ + G4VHitsCollection* getHitsCollection() const; + + /** + * Retrieve the hits collection associated with this detector, + * using the hits collection ID (HCID). + */ + G4VHitsCollection* getHitsCollection(G4int) const; + + /** + * Get the number of hits collections in this SD. + */ + inline int getNumberOfHitsCollections() const {return m_hcids.size();} + + /** + * Return the total energy deposition from the hits of this detector. + * Requires access to concrete hit types, so this function must be + * implemented by subclasses. + */ + virtual double getEdep() const {return 0.0;} + + /** + * Return a list of G4LogicalVolume objects that have been assigned + * this sensitive detector. + */ + std::vector<G4LogicalVolume*> getLogicalVolumes() const; + + /** + * Subclasses need to implement this method. + */ + virtual void clearHits() {;} + +protected: + + /** + * Set the Hits Collection ID for a single collection. + */ + inline void setHCID(G4int hcid) + { + m_hcids[0] = hcid; + } + + /** + * Set the Hits Collection ID for a given collection. + */ + inline void setHCID(G4int hcid, G4int nHC) + { + if ( nHC > getNumberOfHitsCollections() + 1 || nHC < 0) + { + G4cerr << this->GetName() << "setHCID Nr of HC"<< nHC << "not valid"<< G4endl; + G4Exception("", "", FatalException, "Bad HC index."); + } + m_hcids[nHC] = hcid; + } + +protected: + + // vector containing Hit Collection ID's + std::vector<G4int> m_hcids; + + // verbosity + unsigned int m_verbose; + + // endcap flag for LCIO's CHBIT_BARREL bit + bool m_endcap; + + // energy cut + double m_ecut; + + // identifier field description + IdSpec* m_idspec; + + private: + + // type = calorimeter or tracker + EType m_type; + + // The Geant4 command messenger associated with this detector. + G4UImessenger* m_messenger; + }; + +#endif
diff -N TrackerCombineSD.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ TrackerCombineSD.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,47 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/TrackerCombineSD.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_DETECTORS_TRACKERCOMBINESD_HH +#define LCDD_DETECTORS_TRACKERCOMBINESD_HH 1 + +#include "TrackerSD.hh" + +/** + * @brief Tracker subclass to combine multiple hits in the same tracker layer + * into a single hit having the mean momentum and position. + * @note The logic in this class is based on a refactoring of Mokka's TRKSD00. + */ +class TrackerCombineSD: public TrackerSD +{ +public: + TrackerCombineSD(G4String sdName, G4String hcName); + + virtual ~TrackerCombineSD(); + +public: + virtual void EndOfEvent(G4HCofThisEvent *); + +protected: + virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); + +private: + + void startHit(G4StepPoint* aStepPoint); + void updateHit(); + bool insertHit(); + void clear(); + +private: + + bool m_combineHits; + int m_currentTrackID; + G4VPhysicalVolume* m_currentPV; + G4ThreeVector m_entryPoint; + G4ThreeVector m_exitPoint; + G4ThreeVector m_entryMomentum; + G4ThreeVector m_exitMomentum; + G4double m_edepTotal; + G4double m_minTime; + bool m_startedHit; + G4Track* m_currentTrack; +}; + +#endif
diff -N TrackerSD.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ TrackerSD.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,43 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/TrackerSD.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_DETECTORS_TRACKERSD_HH +#define LCDD_DETECTORS_TRACKERSD_HH 1 + +// LCDD +#include "lcdd/detectors/SensitiveDetector.hh" +#include "lcdd/hits/TrackerHit.hh" + +/** + * @brief Geant4 binding for a tracker-type SD. + */ +class TrackerSD: public SensitiveDetector +{ +public: + + typedef std::vector<TrackerHit*> G4TrackerHitList; + +public: + TrackerSD(G4String sdName, G4String hcName); + + virtual ~TrackerSD(); + +public: + virtual void Initialize(G4HCofThisEvent *); + virtual void EndOfEvent(G4HCofThisEvent *); + std::ostream& printHits(std::ostream& os); + + double getEdep() const; + + void clearHits(); + + G4TrackerHitList getTrackerHitList(); + +protected: + virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); + +protected: + G4TrackerHitsCollection* m_HC; + G4TrackerHitList m_hits; +}; + +#endif
diff -N UnsegmentedCalorimeterSD.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ UnsegmentedCalorimeterSD.hh 1 Jul 2013 21:00:41 -0000 1.1 @@ -0,0 +1,24 @@
+// $Id: UnsegmentedCalorimeterSD.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_DETECTORS_UNSEGMENTEDCALORIMETERSD_HH +#define LCDD_DETECTORS_UNSEGMENTEDCALORIMETERSD_HH 1 + +// LCDD +#include "CalorimeterSD.hh" + +/** + * @brief A sensitive detector that writes out a CalorimeterHit for + * each step. It does not have any segmentation. + */ +class UnsegmentedCalorimeterSD: public CalorimeterSD +{ +public: + + UnsegmentedCalorimeterSD(G4String sdName, G4String hcName, Segmentation* seg); + +protected: + + virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); +}; + +#endif /* G4UNSEGMENTEDCALORIMETERSD_HH_ */
diff -u -r1.1 -r1.2 --- CalorimeterHitProcessor.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ CalorimeterHitProcessor.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,5 +1,7 @@
-#ifndef lcdd_CalorimeterHitProcessor_hh -#define lcdd_CalorimeterHitProcessor_hh 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/CalorimeterHitProcessor.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_DETECTORS_CALORIMETERHITPROCESSOR_HH +#define LCDD_DETECTORS_CALORIMETERHITPROCESSOR_HH 1
// Geant4 #include "G4Step.hh"
diff -u -r1.1 -r1.2 --- CellReadout.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ CellReadout.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,6 +1,9 @@
-#ifndef lcdd_CellReadout_hh -#define lcdd_CellReadout_hh 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/CellReadout.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $
+#ifndef LCDD_DETECTORS_CELLREADOUT_HH +#define LCDD_DETECTORS_CELLREADOUT_HH 1 + +// STL
#include <vector> #include <map> #include <string>
diff -u -r1.1 -r1.2 --- CellReadout2D.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ CellReadout2D.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,5 +1,7 @@
-#ifndef lcdd_CellReadout2D_hh -#define lcdd_CellReadout2D_hh 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/CellReadout2D.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_DETECTORS_CELLREADOUT2D_HH +#define LCDD_DETECTORS_CELLREADOUT2D_HH 1
// LCDD #include "CellReadout.hh"
diff -u -r1.1 -r1.2 --- CellReadout2DSegmentation.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ CellReadout2DSegmentation.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,8 +1,8 @@
-#ifndef lcdd_CellReadout2DSegmentation_hh -#define lcdd_CellReadout2DSegmentation_hh 1
+#ifndef LCDD_CELLREADOUT2DSEGMENTATION_HH +#define LCDD_CELLREADOUT2DSEGMENTATION_HH 1
// LCDD
-#include "G4Segmentation.hh"
+#include "Segmentation.hh"
#include "CellReadout2D.hh" // Geant4
@@ -13,7 +13,7 @@
/** * Adapt a CellReadout2D to the LCDD Segmentation interface. */
-class CellReadout2DSegmentation: public G4Segmentation
+class CellReadout2DSegmentation: public Segmentation
{ public:
diff -u -r1.1 -r1.2 --- Cerenkov.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ Cerenkov.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,3 +1,5 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Cerenkov.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $ +
/* ------------------------------------------------------------------------ |\___/| ) (
@@ -13,14 +15,17 @@
(_( -------------------------------------------------------------------------*/ //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-#ifndef Cerenkov_h -#define Cerenkov_h 1
+#ifndef LCDD_DETECTORS_CERENKOV_HH +#define LCDD_DETECTORS_CERENKOV_HH 1
-#include <vector>
+// Geant4
#include "G4PhysicsOrderedFreeVector.hh" #include "G4Material.hh" #include "G4MaterialPropertyVector.hh"
+// STL +#include <vector> +
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... class Cerenkov
diff -u -r1.1 -r1.2 --- HitComparator.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ HitComparator.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,8 +1,9 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/HitComparator.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_HITCOMPARATOR_HH -#define LCDD_HITCOMPARATOR_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/HitComparator.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_DETECTORS_HITCOMPARATOR_HH +#define LCDD_DETECTORS_HITCOMPARATOR_HH 1
-#include "lcdd/hits/G4CalorimeterHit.hh"
+// LCDD +#include "lcdd/hits/CalorimeterHit.hh"
class HitComparator {
@@ -12,7 +13,7 @@
} public:
- virtual bool compare(const G4CalorimeterHit&, const G4CalorimeterHit&) = 0;
+ virtual bool compare(const CalorimeterHit&, const CalorimeterHit&) = 0;
}; #endif
diff -u -r1.1 -r1.2 --- PositionComparator.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ PositionComparator.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,7 +1,8 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/PositionComparator.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_POSITIONCOMPARATOR_HH -#define LCDD_POSITIONCOMPARATOR_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/PositionComparator.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_DETECTORS_POSITIONCOMPARATOR_HH +#define LCDD_DETECTORS_POSITIONCOMPARATOR_HH 1
+// LCDD
#include "HitComparator.hh" class PositionComparator: public HitComparator
@@ -15,7 +16,7 @@
public:
- virtual bool compare(const G4CalorimeterHit& hit1, const G4CalorimeterHit& hit2)
+ virtual bool compare(const CalorimeterHit& hit1, const CalorimeterHit& hit2)
{ // std::cout << "POS --> hit1 " << hit1.getPos() << " == hit2 " << hit2.getPos() << std::endl; // if ( hit1.getPos() == hit2.getPos() ) {
diff -u -r1.1 -r1.2 --- ReadoutUtil.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ ReadoutUtil.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,6 +1,6 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/ReadoutUtil.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_READOUTUTIL_HH -#define LCDD_READOUTUTIL_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/ReadoutUtil.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $ +#ifndef LCDD_DETECTORS_READOUTUTIL_HH +#define LCDD_DETECTORS_READOUTUTIL_HH 1
// LCDD #include "lcdd/core/LCDDProcessor.hh"
@@ -17,7 +17,6 @@
#include <vector> /**
- * @class ReadoutUtil
* @brief Static readout helper methods. * @note The readout utility functions should take * either G4Step or G4StepPoint as an argument
diff -u -r1.1 -r1.2 --- SensitiveDetectorFactory.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ SensitiveDetectorFactory.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,4 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/SensitiveDetectorFactory.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/SensitiveDetectorFactory.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $
+
+#ifndef LCDD_DETECTORS_SENSITIVEDETECTORFACTORY_HH
+#define LCDD_DETECTORS_SENSITIVEDETECTORFACTORY_HH 1
// LCDD #include "lcdd/core/LCDDProcessor.hh"
@@ -8,8 +11,8 @@
#include "lcdd/schema/tracker.hh" #include "lcdd/schema/scorer.hh" #include "lcdd/schema/IdSpecType.hh"
-#include "lcdd/detectors/G4SensitiveDetector.hh" -#include "lcdd/detectors/G4SegmentationFactory.hh"
+#include "lcdd/detectors/SensitiveDetector.hh" +#include "lcdd/detectors/SegmentationFactory.hh"
#include "lcdd/id/IdManager.hh" #include "lcdd/id/IdSpec.hh"
@@ -20,9 +23,9 @@
#include "Saxana/SAXObject.h"
-class G4TrackerSD; -class G4ScorerSD; -class G4CalorimeterSD;
+class TrackerSD; +class ScorerSD; +class CalorimeterSD;
/** @class SensitiveDetectorFactory
@@ -45,15 +48,15 @@
// all static functions public:
- static G4SensitiveDetector* createSensitiveDetector(const SAXObject* object);
+ static SensitiveDetector* createSensitiveDetector(const SAXObject* object);
private:
- static G4CalorimeterSD* createCalorimeterSD(const SAXObject* object);
+ static CalorimeterSD* createCalorimeterSD(const SAXObject* object);
- static G4TrackerSD* createTrackerSD(const SAXObject* object);
+ static TrackerSD* createTrackerSD(const SAXObject* object);
- static G4ScorerSD* createScorerSD(const SAXObject* object);
+ static ScorerSD* createScorerSD(const SAXObject* object);
/** * Lookup the IdSpec of a detector SAX object based on the idspecref.
@@ -62,7 +65,7 @@
*/ static IdSpec* findIdSpec(const SensitiveDetectorType* sdt);
- static void setBaseSensitiveDetectorAttributes(G4SensitiveDetector* sd, const SensitiveDetectorType* sdt);
+ static void setBaseSensitiveDetectorAttributes(SensitiveDetector* sd, const SensitiveDetectorType* sdt);
static double computeEcut(const SensitiveDetectorType* sdt);
@@ -72,3 +75,5 @@
static bool checkHCName(const std::string& s); };
+ +#endif
diff -u -r1.2 -r1.3 --- SensitiveDetectorMessenger.hh 27 Jun 2013 23:42:24 -0000 1.2 +++ SensitiveDetectorMessenger.hh 1 Jul 2013 21:00:41 -0000 1.3 @@ -1,11 +1,13 @@
-#ifndef LCDD_LCDD_SENSITIVEDETECTORMESSENGER_HH -#define LCDD_LCDD_SENSITIVEDETECTORMESSENGER_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/SensitiveDetectorMessenger.hh,v 1.3 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_DETECTORS_SENSITIVEDETECTORMESSENGER_HH +#define LCDD_DETECTORS_SENSITIVEDETECTORMESSENGER_HH 1
// Geant4 #include "G4UImessenger.hh" // LCDD
-#include "G4SensitiveDetector.hh"
+#include "SensitiveDetector.hh"
class G4UIcommand; class G4UIcmdWithABool;
@@ -20,7 +22,7 @@
class SensitiveDetectorMessenger: public G4UImessenger { public:
- SensitiveDetectorMessenger(G4SensitiveDetector* detector);
+ SensitiveDetectorMessenger(SensitiveDetector* detector);
virtual ~SensitiveDetectorMessenger();
@@ -34,7 +36,7 @@
private:
- G4SensitiveDetector* m_detector;
+ SensitiveDetector* m_detector;
static G4UIdirectory* m_detectorsDir; G4UIdirectory* m_detectorDir;
diff -u -r1.1 -r1.2 --- StepReadout.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ StepReadout.hh 1 Jul 2013 21:00:41 -0000 1.2 @@ -1,6 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/StepReadout.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_LCDD_STEPREADOUT_HH -#define LCDD_LCDD_STEPREADOUT_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/StepReadout.hh,v 1.2 2013/07/01 21:00:41 jeremy Exp $ + +#ifndef LCDD_DETECTORS_STEPREADOUT_HH +#define LCDD_DETECTORS_STEPREADOUT_HH 1
// geant4 #include "G4ThreeVector.hh"
@@ -9,7 +10,7 @@
// stl #include <vector>
-// geant4
+// Geant4
class G4VPhysicalVolume; class G4VSensitiveDetector; class G4Step;
@@ -20,12 +21,11 @@
class G4VSolid; class G4Track;
-// lcdd
+// LCDD
class TrackInformation;
-class G4UserRegionInformation;
+class UserRegionInformation;
/**
- * @class StepReadout
* @brief Utility functions to return information about a G4Step object. * @note The only cached data member is the step pointer. */
diff -N G4CalorimeterSD.hh --- G4CalorimeterSD.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,67 +0,0 @@
-// $Id: G4CalorimeterSD.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_G4CALORIMETERSD_HH -#define LCDD_G4CALORIMETERSD_HH 1 - -// Geant4 -#include "lcdd/detectors/G4SensitiveDetector.hh" -#include "lcdd/detectors/HitComparator.hh" -#include "lcdd/hits/G4CalorimeterHit.hh" -#include "lcdd/detectors/G4Segmentation.hh" - -// class G4Segmentation - -/** - @class G4CalorimeterSD - @brief Simulator implementation of calorimeter-type SD. - */ -class G4CalorimeterSD: public G4SensitiveDetector -{ - -public: - - typedef std::vector<G4CalorimeterHit*> G4CalorimeterHitList; - -public: - G4CalorimeterSD(G4String sdName, G4String hcName, G4Segmentation* sdSeg, HitComparator* compare = 0); - - G4CalorimeterSD(G4String sdName, const std::vector<G4String>& hcNames, G4Segmentation* sdSeg, HitComparator* compare = 0); - - virtual ~G4CalorimeterSD(); - -public: - - virtual bool isValidVolume(G4LogicalVolume* lv); - - virtual void Initialize(G4HCofThisEvent *); - virtual void EndOfEvent(G4HCofThisEvent *); - - G4Segmentation* getSegmentation() const; - - G4CalorimeterHit* findHit(G4CalorimeterHit* aHit) const; - G4CalorimeterHit* findHit(G4CalorimeterHit* aHit, G4int nHC) const; - - std::ostream& printHits(std::ostream& os); - - void clearHits(); - - virtual std::ostream& printBasicInfo(std::ostream& os); - - virtual double getEdep() const; - virtual double getEdep(G4int nHC) const; - - G4CalorimeterHitList getCalorimeterHitList(); - G4CalorimeterHitList getCalorimeterHitList(G4int nHC); - -protected: - virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); - -protected: - G4Segmentation* m_segmentation; - G4CalorimeterHitsCollection* m_collection; - std::vector<G4CalorimeterHitsCollection*> m_hitsCollections; - G4CalorimeterHitList m_hits; - std::vector<G4CalorimeterHitList> hits_vector; - HitComparator* m_hitCompare; -}; - -#endif
diff -N G4GlobalGridXYSegmentation.hh --- G4GlobalGridXYSegmentation.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,58 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Attic/G4GlobalGridXYSegmentation.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_G4GLOBALGRIDXYSEGMENTATION_HH -#define LCDD_G4GLOBALGRIDXYSEGMENTATION_HH 1 - -#include "G4Segmentation.hh" - -#include "globals.hh" - -/** - * @class G4GridXYSegmentation - * @brief Uniform 3D grid segmentation class. - * @note Version of grid segmentation with binning on global coordinates, not local. - */ -class G4GlobalGridXYSegmentation: public G4Segmentation -{ - -public: - - G4GlobalGridXYSegmentation(double gridSizeX, double gridSizeY); - - virtual ~G4GlobalGridXYSegmentation(); - -public: - - // from par class - virtual G4ThreeVector getGlobalHitPos(const G4Step* aStep); - - // hit position from step position - G4ThreeVector getLocalHitPos(const G4ThreeVector& localStepPos); - - virtual void setBins(const G4Step* aStep); - - virtual void setBinNames() - { - addBinName("x"); - addBinName("y"); - } - -protected: - - // compute signed int bin values with base at local origin - int computeBinX(const G4ThreeVector& localStepPos); - int computeBinY(const G4ThreeVector& localStepPos); - int computeBinZ(const G4ThreeVector& localStepPos); - - // individual position dim from bin - double computeDimX(int bin); - double computeDimY(int bin); - double computeDimZ(int bin); - -private: - - double m_gridSizeX; - double m_gridSizeY; - double m_gridSizeZ; -}; - -#endif
diff -N G4GridXYZSegmentation.hh --- G4GridXYZSegmentation.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,63 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Attic/G4GridXYZSegmentation.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_G4GRIDXYZSEGMENTATION_HH -#define LCDD_G4GRIDXYZSEGMENTATION_HH 1 - -#include "G4Segmentation.hh" - -#include "globals.hh" - -/** - * @class G4GridXYZSegmentation - * @brief Uniform 3D grid segmentation class. - * @note This class performs calculations to divide a box-like - * volume into a uniform, 3D grid with square cells. - */ -class G4GridXYZSegmentation: public G4Segmentation -{ - -public: - - G4GridXYZSegmentation(double gridSizeX, double gridSizeY, double gridSizeZ); - - virtual ~G4GridXYZSegmentation(); - -public: - - // from par class - virtual G4ThreeVector getGlobalHitPos(const G4Step* aStep); - - virtual void setBins(const G4Step* aStep); - - // DEPRECATED - virtual G4ThreeVector getGlobalHitPosPreStep(const G4StepPoint* aPreStepPoint); - - // DEPRECATED - virtual G4ThreeVector getLocalHitPos(const G4ThreeVector& localStepPos); - - virtual void setBinNames() - { - addBinName("x"); - addBinName("y"); - addBinName("z"); - } - -protected: - - // compute signed int bin values with base at local origin - int computeBinX(const G4ThreeVector& localStepPos); - int computeBinY(const G4ThreeVector& localStepPos); - int computeBinZ(const G4ThreeVector& localStepPos); - - // individual position dim from bin - double computeDimX(int bin); - double computeDimY(int bin); - double computeDimZ(int bin); - -private: - - double m_gridSizeX; - double m_gridSizeY; - double m_gridSizeZ; -}; - -#endif
diff -N G4NonprojectiveCylinderSegmentation.hh --- G4NonprojectiveCylinderSegmentation.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,47 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Attic/G4NonprojectiveCylinderSegmentation.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_G4NONPROJECTIVECYLINDERSEGMENTATION -#define LCDD_G4NONPROJECTIVECYLINDERSEGMENTATION 1 - -#include "G4Segmentation.hh" - -/** - @class G4NonprojectiveCylinderSegmentation - @brief Segmentation using a nonprojective cylinder. - */ -class G4NonprojectiveCylinderSegmentation: public G4Segmentation -{ -public: - G4NonprojectiveCylinderSegmentation(double gridSizePhi, double gridSizeZ); - virtual ~G4NonprojectiveCylinderSegmentation(); - -public: - - virtual G4ThreeVector getGlobalHitPos(const G4Step* aStep); - virtual G4ThreeVector getGlobalHitPos(const G4StepPoint* aPreStepPoint); - virtual void setBins(const G4Step* aStep); - virtual void setBins(const G4StepPoint* aPreStepPoint); - virtual void setBinNames() - { - addBinName("phi"); - addBinName("z"); - } - - G4ThreeVector getLocalHitPos(const G4Step* aStep); - G4ThreeVector getLocalHitPos(const G4StepPoint* aPreStepPoint); - virtual bool isValidSolid(G4VSolid*); - -private: - - double computeDeltaPhi(const G4Step* aStep); - double computeDeltaPhi(const G4StepPoint* aPreStepPoint); - int computeBinPhi(const G4Step* aStep); - int computeBinPhi(const G4StepPoint* aPreStepPoint); - int computeBinZ(const G4ThreeVector& localStepPos); - -private: - - double m_gridSizePhi; - double m_gridSizeZ; -}; - -#endif
diff -N G4OpticalCalorimeterSD.hh --- G4OpticalCalorimeterSD.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,36 +0,0 @@
-#ifndef LCDD_G4OPTICALCALORIMETERSD_HH -#define LCDD_G4OPTICALCALORIMETERSD_HH - -// slic -#include "G4CalorimeterSD.hh" - -// stl -#include <vector> -class Cerenkov; - -/** - @class G4OpticalCalorimeterSD - @brief Simulator implementation of a calorimeter SD that is sensitive to optical photons. - */ -class G4OpticalCalorimeterSD: public G4CalorimeterSD -{ -private: - Cerenkov* CerenGenerator; -public: - //enum for the two Hit Collections (cerenkov and edep): - enum HCType - { - eEdep = 0, eCerenkov = 1 - }; - - G4OpticalCalorimeterSD(G4String sdName, G4String hcName, G4Segmentation* sdSeg, HitComparator* compare = 0); - - G4OpticalCalorimeterSD(G4String sdName, const std::vector<G4String>& hcNames, G4Segmentation* sdSeg, HitComparator* compare = 0); - - virtual ~G4OpticalCalorimeterSD(); - -protected: - virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); -}; - -#endif
diff -N G4ProjectiveCylinderSegmentation.hh --- G4ProjectiveCylinderSegmentation.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,31 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Attic/G4ProjectiveCylinderSegmentation.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_G4PROJECTIVECYLINDERSEGMENTATION_HH -#define LCDD_G4PROJECTIVECYLINDERSEGMENTATION_HH 1 - -#include "G4ProjectiveSegmentation.hh" - -#include "globals.hh" - -/** - @class G4ProjectiveCylinderSegmentation - @brief Simulation class for projective cylinder segmentation. - */ -class G4ProjectiveCylinderSegmentation: public G4ProjectiveSegmentation -{ - -public: - G4ProjectiveCylinderSegmentation(G4int ntheta, G4int nphi); - - virtual ~G4ProjectiveCylinderSegmentation(); - - virtual bool isValidSolid(G4VSolid* s); - -protected: - - virtual double getRadius(const G4Step* aStep); - virtual double getZ(const G4Step* aStep); - virtual double getRadius(const G4StepPoint* aPreStepPoint); - virtual double getZ(const G4StepPoint* aPreStepPoint); -}; - -#endif
diff -N G4ProjectiveSegmentation.hh --- G4ProjectiveSegmentation.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,72 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Attic/G4ProjectiveSegmentation.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_G4PROJECTIVESEGMENTATION_HH -#define LCDD_G4PROJECTIVESEGMENTATION_HH 1 - -#include "G4Segmentation.hh" - -#include "globals.hh" - -/** - @class G4ProjectiveSegmentation - @brief Generic projective segmentation class. - */ -class G4ProjectiveSegmentation: public G4Segmentation -{ - -public: - G4ProjectiveSegmentation(int ntheta, int nphi); - - virtual ~G4ProjectiveSegmentation(); - -public: - - // virtuals from G4Segmentation; should not be overridden - // in subclasses - G4ThreeVector getGlobalHitPos(const G4Step* aStep); - G4ThreeVector getGlobalHitPos(const G4StepPoint* aPreStepPoint); - void setBins(const G4Step* aStep); - void setBins(const G4StepPoint* aPreStepPoint); - virtual void setBinNames() - { - addBinName("theta"); - addBinName("phi"); - } - -protected: - - int getNtheta() const; - int getNphi() const; - - // bins from 3vect pos - int getThetaBin(const G4ThreeVector& globalStepPos); - int getPhiBin(const G4ThreeVector& globalStepPos); - - // dim from bin - double getThetaDim(const int &thetaBin) const; - double getPhiDim(const int &phiBin) const; - - // dim from step - double getThetaDim(const G4Step* aStep); - // dim from prestep - double getThetaDim(const G4StepPoint* aPreStepPoint); - - double getPhiDim(const G4Step* aStep); - // dim from prestep point: - double getPhiDim(const G4StepPoint* aPreStepPoint); - - // These should be overridden in subclasses - // for a specific shape or orientation. - virtual double getRadius(const G4Step* aStep); - virtual double getZ(const G4Step* aStep); - virtual double getRadius(const G4StepPoint* aPreStepPoint); - virtual double getZ(const G4StepPoint* aPreStepPoint); -private: - - void computeDivisions(); - -private: - int m_ntheta, m_nphi; - double m_divTheta, m_divPhi; -}; - -#endif
diff -N G4ProjectiveZPlaneSegmentation.hh --- G4ProjectiveZPlaneSegmentation.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,31 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Attic/G4ProjectiveZPlaneSegmentation.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_G4PROJECTIVEZPLANESEGMENTATION_HH -#define LCDD_G4PROJECTIVEZPLANESEGMENTATION_HH 1 - -#include "G4ProjectiveSegmentation.hh" - -#include "globals.hh" - -/** - @class G4ProjectiveZPlaneSegmentation - @brief Projective segmentation using Z. - @note This class uses Z from current volume - rather than the cylindrical radius. - */ -class G4ProjectiveZPlaneSegmentation: public G4ProjectiveSegmentation -{ - -public: - G4ProjectiveZPlaneSegmentation(int ntheta, int nphi); - - virtual ~G4ProjectiveZPlaneSegmentation(); - -protected: - - virtual double getRadius(const G4Step* aStep); - virtual double getZ(const G4Step* aStep); - virtual double getRadius(const G4StepPoint* aPreStepPoint); - virtual double getZ(const G4StepPoint* aPreStepPoint); -}; - -#endif
diff -N G4ScorerSD.hh --- G4ScorerSD.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,22 +0,0 @@
-#ifndef LCDD_G4SCORERSD_HH -#define LCDD_G4SCORERSD_HH 1 - -#include "G4TrackerSD.hh" - -/** - * @class G4ScorerSD - * @brief Scoring plane sensitive detector. - */ -class G4ScorerSD: public G4TrackerSD -{ -public: - G4ScorerSD(G4String sdName, G4String hcName); - -protected: - virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); - -protected: - int m_currentTrackID; -}; - -#endif
diff -N G4Segmentation.hh --- G4Segmentation.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,144 +0,0 @@
-#ifndef LCDD_G4SEGMENTATION_HH -#define LCDD_G4SEGMENTATION_HH 1 - -// G4 -#include "G4ThreeVector.hh" -#include "G4Step.hh" - -// std -#include <iostream> -#include <vector> - -/** - * @class G4Segmentation - * @brief Segmentation base class. - * @todo Add method setVolume(G4LogicalVolume*) for setting up segmentation with current step volume. - */ -class G4Segmentation -{ -public: - enum EType - { - eProjective = 1, eNonprojective - }; - typedef std::vector<std::string> BinNames; - -public: - G4Segmentation(EType segType, int nbins = 2); - virtual ~G4Segmentation(); - -public: - - /** - * Compute the global hit position from a step. - */ - virtual G4ThreeVector getGlobalHitPos(const G4Step* aStep); - - /** - * Set the identifier bin values from a step. - */ - virtual void setBins(const G4Step*) = 0; - - /** - * Add valid bin names to this segmentation. - */ - virtual void setBinNames() = 0; - - /** - * Compute the bin given a coordinate in one dimension. - */ - static int computeBin(double localDim, double gridDim) - { - return int(floor(localDim / gridDim)); - - } - - /** - * Compute the coordinate in one dimension given a bin value. - */ - static double computeDim(const int &bin, const double &incr) - { - return (double(bin) + .5) * incr; - } - - // DEPRECATED - // Used by G4OpticalCalorimeter only. - virtual G4ThreeVector getGlobalHitPosPreStep(const G4StepPoint* aPreStepPoint); - - // DEPRECATED - // Used by G4OpticalCalorimeter only. - G4ThreeVector getLocalHitPos(const G4ThreeVector& localStepPos); - - void resetBins(); - - EType getType(); - - inline const G4String& getTypeString() - { - static G4String typestr; - if (m_type == eProjective) { - typestr = "Projective"; - } else if (m_type == eNonprojective) { - typestr = "Nonprojective"; - } else { - typestr = "Unknown"; - } - - return typestr; - } - - inline int getBin(int idx) - { - return m_bins.at(idx); - } - - inline const std::string& getBinName(int idx) - { - return m_binNames.at(idx); - } - - inline void addBinName(const std::string& binName) - { - m_binNames.push_back(binName); - } - - void setBin(int binIdx, int binVal); - - int getNumberOfBins(); - - const std::vector<int>& getBins(); - - const std::vector<std::string>& getBinNames() - { - return m_binNames; - } - - // Print the bins. - void printOutBins(std::ostream& os) - { - printOutBins(os, m_bins); - } - - static void printOutBins(std::ostream& os, const std::vector<int>& bins); - - /* - * Check whether the solid is valid for this segmentation. - */ - virtual bool isValidSolid(G4VSolid*); - -private: - - // bin values - std::vector<int> m_bins; - - // bin names - BinNames m_binNames; - - // number of numbers - int m_numBins; - - // type of segmentation - EType m_type; -}; - -#endif
diff -N G4SegmentationFactory.hh --- G4SegmentationFactory.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,29 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Attic/G4SegmentationFactory.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_G4SEGMENTATIONFACTORY_HH -#define LCDD_G4SEGMENTATIONFACTORY_HH 1 - -class G4Segmentation; -class SAXObject; - -// std -#include <string> - -/** - @class G4SegmentationFactory - @brief Returns a concrete segmentation object depending on input tag. - @note Includes a single, static method. - */ -class G4SegmentationFactory -{ -private: - - // should not be instantiated - G4SegmentationFactory() - { - } - -public: - static G4Segmentation* createSegmentation(SAXObject* obj, const std::string& tag); -}; - -#endif
diff -N G4SensitiveDetector.hh --- G4SensitiveDetector.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,303 +0,0 @@
-#ifndef LCDD_G4SENSITIVEDETECTOR_HH -#define LCDD_G4SENSITIVEDETECTOR_HH 1 - -// Geant4 -#include "G4VSensitiveDetector.hh" -#include "G4UnitsTable.hh" - -// LCDD -#include "lcdd/detectors/StepReadout.hh" -#include "lcdd/id/IdSpec.hh" -#include "lcdd/id/Id64bit.hh" - -class G4UImessenger; -class G4VHitsCollection; - -/** - * @brief Basic implementation of G4VSensitiveDetector. - * @note Primary attributes include verbosity, energy cut, - * IdSpec,and hits collections. - */ -class G4SensitiveDetector: public G4VSensitiveDetector, protected StepReadout -{ -public: - - /** - * EType indicates the basic type of detector, e.g. tracker or calorimeter. - */ - enum EType - { - eNone = 0, eTracker = 1, eCalorimeter = 2 - }; - - static const std::string& trackerStr; - static const std::string& calorimeterStr; - static const std::string& noneStr; - -public: - - G4SensitiveDetector(G4String sdName, G4String hcName, EType sdType); - - G4SensitiveDetector(G4String sdName, const std::vector<G4String>& hcNames, EType sdType); - - virtual ~G4SensitiveDetector(); - -public: - - /** - * Geant4 initialization function called at beginning of event. - */ - virtual void Initialize(G4HCofThisEvent *); - - /** - * Geant4 EndOfEvent hook. - */ - virtual void EndOfEvent(G4HCofThisEvent *); - -protected: - - /** - * Geant4 function to make hits from the step. - */ - virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); - -public: - - /** - * Return the type of this detector encoded as an int. - */ - inline G4SensitiveDetector::EType getType() const - { - return m_type; - } - - /** - * Return the type of this detector encoded as a string. - */ - inline const std::string& getTypeString() const; - - /** - * Return the hits collection ID associated with this detector. - */ - inline G4int getHCID() const - { - return m_hcids[0]; - } - - inline G4int getHCID(G4int nHC) const - { - if (nHC > getNumberOfHitsCollections() + 1 || nHC < 0) { - G4cerr << "The index " << nHC << " is not valid for SD " << this->GetName() << "." << G4endl; - G4Exception("", "", FatalException, "Invalid index."); - } - return m_hcids[nHC]; - } - - /** - * Check whether the G4LogicalVolume can be readout by this detector. - * Base function just returns if the volume was assigned to this detector. - */ - inline virtual bool isValidVolume(G4LogicalVolume* lv) - { - return lv != 0; - } - - /** - * Return the hits collection name associated with this detector. - */ - inline const std::string& getHCName() const - { - return collectionName[0]; - } - - inline const std::string& getHCName(G4int nHC) const - { - return collectionName[nHC]; - } - - /** - * Set the verbosity level of this detector. - */ - inline void setVerbose(unsigned int v) - { - m_verbose = v; - } - - /** - * Get the verbosity level of this detector. - */ - inline unsigned int getVerbose() const - { - return m_verbose; - } - - /** - * Return the hit energy cut of this detector. - */ - inline G4double getEcut() - { - return m_ecut; - } - - /** - * Set the hit energy cut of this detector. - */ - inline void setEcut(G4double ecut) - { - m_ecut = ecut; - } - - /** - * Set the identifier specification for this detector. - */ - inline void setIdSpec(IdSpec* idspec) - { - m_idspec = idspec; - } - - /** - * Return the identifier specification for this detector. - */ - inline IdSpec* getIdSpec() const - { - return m_idspec; - } - - /** - * Returns whether or not this detector has an associated identifier specification. - */ - inline bool hasIdSpec() const - { - return m_idspec != 0; - } - - /** - * Create a 64-bit identifier based on the current step information. - */ - Id64bit makeId() const; - - /** - * Set the endcap flag. - */ - inline void setEndcapFlag( bool ec = true ) - { - m_endcap = ec; - } - - /** - * Return the endcap flag. - */ - inline bool getEndcapFlag() - { - return m_endcap; - } - - /** - * Print basic information about this detector to the output stream. - */ - virtual std::ostream& printBasicInfo(std::ostream& os); - - /** - * Print the number of hits to the output stream. - */ - virtual std::ostream& printNumberOfHits(std::ostream& os); - - /** - * Print the number of hits to the output stream. - */ - virtual std::ostream& printEdep(std::ostream& os); - - /** - * Print the names of volumes associated to this detector. - */ - virtual std::ostream& printVolumes(std::ostream& os); - - /** - * Print the list of hits. Subclasses must implement this. - */ - virtual std::ostream& printHits(std::ostream& os) {return os;} - - /** - * Get single (first) HC associated with this detector. - */ - G4VHitsCollection* getHitsCollection() const; - - /** - * Retrieve the hits collection associated with this detector, - * using the hits collection ID (HCID). - */ - G4VHitsCollection* getHitsCollection(G4int) const; - - /** - * Get the number of hits collections in this SD. - */ - inline int getNumberOfHitsCollections() const {return m_hcids.size();} - - /** - * Return the total energy deposition from the hits of this detector. - * Requires access to concrete hit types, so this function must be - * implemented by subclasses. - */ - virtual double getEdep() const {return 0.0;} - - /** - * Return a list of G4LogicalVolume objects that have been assigned - * this sensitive detector. - */ - std::vector<G4LogicalVolume*> getLogicalVolumes() const; - - /** - * Subclasses need to implement this method. - */ - virtual void clearHits() {;} - -protected: - - /** - * Set the Hits Collection ID for a single collection. - */ - inline void setHCID(G4int hcid) - { - m_hcids[0] = hcid; - } - - /** - * Set the Hits Collection ID for a given collection. - */ - inline void setHCID(G4int hcid, G4int nHC) - { - if ( nHC > getNumberOfHitsCollections() + 1 || nHC < 0) - { - G4cerr << this->GetName() << "setHCID Nr of HC"<< nHC << "not valid"<< G4endl; - G4Exception("", "", FatalException, "Bad HC index."); - } - m_hcids[nHC] = hcid; - } - -protected: - - // vector containing Hit Collection ID's - std::vector<G4int> m_hcids; - - // verbosity - unsigned int m_verbose; - - // endcap flag for LCIO's CHBIT_BARREL bit - bool m_endcap; - - // energy cut - double m_ecut; - - // identifier field description - IdSpec* m_idspec; - - private: - - // type = calorimeter or tracker - EType m_type; - - // The Geant4 command messenger associated with this detector. - G4UImessenger* m_messenger; - }; - -#endif
diff -N G4TrackerCombineSD.hh --- G4TrackerCombineSD.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,48 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Attic/G4TrackerCombineSD.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_G4TRACKERCOMBINESD_HH -#define LCDD_G4TRACKERCOMBINESD_HH 1 - -#include "G4TrackerSD.hh" - -/** - * @class G4TrackerCombineSD - * @brief Tracker subclass to combine multiple hits in the same tracker layer - * into a single hit having the mean momentum and position. - * @note The logic in this class is based on a refactoring of Mokka's TRKSD00. - */ -class G4TrackerCombineSD: public G4TrackerSD -{ -public: - G4TrackerCombineSD(G4String sdName, G4String hcName); - - virtual ~G4TrackerCombineSD(); - -public: - virtual void EndOfEvent(G4HCofThisEvent *); - -protected: - virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); - -private: - - void startHit(G4StepPoint* aStepPoint); - void updateHit(); - bool insertHit(); - void clear(); - -private: - - bool m_combineHits; - int m_currentTrackID; - G4VPhysicalVolume* m_currentPV; - G4ThreeVector m_entryPoint; - G4ThreeVector m_exitPoint; - G4ThreeVector m_entryMomentum; - G4ThreeVector m_exitMomentum; - G4double m_edepTotal; - G4double m_minTime; - bool m_startedHit; - G4Track* m_currentTrack; -}; - -#endif
diff -N G4TrackerSD.hh --- G4TrackerSD.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,41 +0,0 @@
-#ifndef LCDD_G4TRACKERSD_HH -#define LCDD_G4TRACKERSD_HH 1 - -// LCDD -#include "lcdd/detectors/G4SensitiveDetector.hh" -#include "lcdd/hits/G4TrackerHit.hh" - -/** - * @brief Geant4 binding for a tracker-type SD. - */ -class G4TrackerSD: public G4SensitiveDetector -{ -public: - - typedef std::vector<G4TrackerHit*> G4TrackerHitList; - -public: - G4TrackerSD(G4String sdName, G4String hcName); - - virtual ~G4TrackerSD(); - -public: - virtual void Initialize(G4HCofThisEvent *); - virtual void EndOfEvent(G4HCofThisEvent *); - std::ostream& printHits(std::ostream& os); - - double getEdep() const; - - void clearHits(); - - G4TrackerHitList getTrackerHitList(); - -protected: - virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); - -protected: - G4TrackerHitsCollection* m_HC; - G4TrackerHitList m_hits; -}; - -#endif
diff -N G4UnsegmentedCalorimeterSD.hh --- G4UnsegmentedCalorimeterSD.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,24 +0,0 @@
-// $Id: G4UnsegmentedCalorimeterSD.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ - -#ifndef G4UNSEGMENTEDCALORIMETERSD_HH_ -#define G4UNSEGMENTEDCALORIMETERSD_HH_ - -#include "G4CalorimeterSD.hh" - -/** - * @class UnsegmentedCalorimeterSD - * @brief A sensitive detector that writes out a CalorimeterHit for - * each step. It does not have any segmentation. - */ -class G4UnsegmentedCalorimeterSD: public G4CalorimeterSD -{ -public: - - G4UnsegmentedCalorimeterSD(G4String sdName, G4String hcName, G4Segmentation* seg); - -protected: - - virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*); -}; - -#endif /* G4UNSEGMENTEDCALORIMETERSD_HH_ */
diff -N PhysicsLimitSet.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ PhysicsLimitSet.hh 1 Jul 2013 21:00:42 -0000 1.1 @@ -0,0 +1,89 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/geant4/PhysicsLimitSet.hh,v 1.1 2013/07/01 21:00:42 jeremy Exp $ + +#ifndef LCDD_GEANT4_LIMITSET_HH +#define LCDD_GEANT4_LIMITSET_HH 1 + +// Geant4 +#include "G4UserLimits.hh" +#include "globals.hh" + +// STL +#include <map> +#include <string> + +/** + * @brief Looks up physics limits by particle type from the G4Track. + */ + +class PhysicsLimitSet: public G4UserLimits +{ +public: + typedef G4String ParticleType; + typedef G4String LimitNameType; + typedef G4double LimitValueType; + typedef std::map<ParticleType, LimitValueType> LimitMap; + typedef std::map<LimitNameType, LimitMap> LimitSetMap; + typedef const G4String& LimitNameKeyType; + + static const ParticleType ANY_PARTICLE; + + static const LimitValueType LIMIT_NOT_SET; + + static const LimitNameKeyType STEP_LENGTH_MAX_KEY; + static const LimitNameKeyType TRACK_LENGTH_MAX_KEY; + static const LimitNameKeyType TIME_MAX_KEY; + static const LimitNameKeyType EKIN_MIN_KEY; + static const LimitNameKeyType RANGE_MIN_KEY; + + static const LimitValueType STEP_LENGTH_MAX_DEFAULT; + static const LimitValueType TRACK_LENGTH_MAX_DEFAULT; + static const LimitValueType TIME_MAX_DEFAULT; + static const LimitValueType EKIN_MIN_DEFAULT; + static const LimitValueType RANGE_MIN_DEFAULT; + +public: + PhysicsLimitSet(const G4String& name); + virtual ~PhysicsLimitSet(); + +public: + + const LimitSetMap& getLimitSetMap() const + { + return m_limitsMap; + } + + virtual G4double GetMaxAllowedStep(const G4Track&); + virtual G4double GetUserMaxTrackLength(const G4Track&); + virtual G4double GetUserMaxTime(const G4Track&); + virtual G4double GetUserMinEkine(const G4Track&); + virtual G4double GetUserMinRange(const G4Track&); + + /* Set limits by particle type. */ + void setLimitForParticle(LimitNameType limitName, ParticleType particleType, LimitValueType limitValue); + + void setName(const G4String& n); + G4String& getName(); + +private: + + /** + * Get the limit value for a particular particle type. + * @param limitName The name of the limit type (1 of 5 valid types). + * @param particleType Type, e.g. name, of the Geant4 particle. + * @return Value of the limit or LIMIT_NOT_SET if no key exists and ANY_PARTICLE is also not set. + */ + LimitValueType getLimitForParticle(LimitNameType limitName, ParticleType particleType = ANY_PARTICLE); + + LimitValueType getLimitForParticle(LimitNameType limitName, const G4Track&); + + const ParticleType getParticleType(const G4Track&); + +protected: + + /* Map of ( limitName -> particleName -> limitValue ). */ + LimitSetMap m_limitsMap; + + G4String m_name; +}; + +#endif
diff -N UserRegionInformation.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ UserRegionInformation.hh 1 Jul 2013 21:00:42 -0000 1.1 @@ -0,0 +1,88 @@
+//$Header: /cvs/lcd/lcdd/include/lcdd/geant4/UserRegionInformation.hh,v 1.1 2013/07/01 21:00:42 jeremy Exp $ + +#ifndef LCDD_GEANT4_USERREGIONINFORMATION_HH +#define LCDD_GEANT4_USERREGIONINFORMATION_HH 1 + +// Geant4 +#include "G4VUserRegionInformation.hh" +#include "G4Track.hh" +#include "G4StepPoint.hh" +#include "globals.hh" + +// STL +#include <string> + +/** + * @brief Implementation of G4VUserRegionInformation. + */ +class UserRegionInformation: public G4VUserRegionInformation +{ + +public: + + UserRegionInformation() : + _storeSecondaries(false), _killTracks(false) + { + } + + virtual ~UserRegionInformation() + { + } + +public: + + void setStoreSecondaries(bool b) + { + _storeSecondaries = b; + } + + bool getStoreSecondaries() const + { + return _storeSecondaries; + } + + void setKillTracks(bool killTracks) + { + _killTracks = killTracks; + } + + bool getKillTracks() const + { + return _killTracks; + } + + void setThreshold(G4double t) + { + _threshold = t; + } + + G4double getThreshold() const + { + return _threshold; + } + + // region info from track + static inline UserRegionInformation* getRegionInformation(const G4Track* aTrack) + { + return static_cast<UserRegionInformation*>(aTrack->GetLogicalVolumeAtVertex()->GetRegion()->GetUserInformation()); + } + + // region info from step point + static UserRegionInformation* getRegionInformation(const G4StepPoint* aStepPoint) + { + return static_cast<UserRegionInformation*>(aStepPoint->GetPhysicalVolume()->GetLogicalVolume()->GetRegion()->GetUserInformation()); + } + + void Print() const + { + } + +private: + + bool _storeSecondaries; + bool _killTracks; + + G4double _threshold; +}; + +#endif
diff -u -r1.1 -r1.2 --- LCDDHeaderRecord.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ LCDDHeaderRecord.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,11 +1,10 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/geant4/LCDDHeaderRecord.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/geant4/LCDDHeaderRecord.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_LCDDHEADERRECORD_HH -#define LCDD_LCDDHEADERRECORD_HH 1
+#ifndef LCDD_GEANT4_LCDDHEADERRECORD_HH +#define LCDD_GEANT4_LCDDHEADERRECORD_HH 1
/**
- @class LCDDHeaderRecord - @brief Header record of detector info.
+ * @brief Header record of detector info.
*/ class LCDDHeaderRecord {
diff -u -r1.1 -r1.2 --- PhysVolId.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ PhysVolId.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,13 +1,13 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/geant4/PhysVolId.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/geant4/PhysVolId.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_PHYSVOLID_HH -#define LCDD_PHYSVOLID_HH 1
+#ifndef LCDD_GEANT4_PHYSVOLID_HH +#define LCDD_GEANT4_PHYSVOLID_HH 1
+// STL
#include <vector> /**
- @class PhysVolId - @brief Simulator class for physical volume IDs.
+ * @brief Simulator class for physical volume IDs.
*/ class PhysVolId {
diff -u -r1.1 -r1.2 --- PhysVolIdMap.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ PhysVolIdMap.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,6 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/geant4/PhysVolIdMap.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ -#ifndef LCDD_PHYSVOLTOIDMAP_HH -#define LCDD_PHYSVOLTOIDMAP_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/geant4/PhysVolIdMap.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ + +#ifndef LCDD_GEANT4_PHYSVOLTOIDMAP_HH +#define LCDD_GEANT4_PHYSVOLTOIDMAP_HH 1
// LCDD #include "PhysVolId.hh"
@@ -13,14 +14,8 @@
#include <map> /**
- - @class PhysVolIdMap - - @brief Maps G4 physical volume ptrs to a vector of associated - ints for IDing. -
+ * @brief Maps G4 physical volume ptrs to a vector of associated ints for IDing.
*/
-
typedef std::map<G4VPhysicalVolume*, PhysVolId::PhysVolIds> PhysVolIdMapType; class PhysVolIdMap: private PhysVolIdMapType
diff -N G4LimitSet.hh --- G4LimitSet.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,86 +0,0 @@
-#ifndef LCDD_G4LIMITSET_HH -#define LCDD_G4LIMITSET_HH 1 - -#include "G4UserLimits.hh" -#include "globals.hh" - -#include <map> -#include <string> - -/** - * @class G4LimitSet - * @brief Looks up physics limits by particle type from the G4Track. - */ - -class G4LimitSet: public G4UserLimits -{ -public: - typedef G4String ParticleType; - typedef G4String LimitNameType; - typedef G4double LimitValueType; - typedef std::map<ParticleType, LimitValueType> LimitMap; - typedef std::map<LimitNameType, LimitMap> LimitSetMap; - typedef const G4String& LimitNameKeyType; - - static const ParticleType ANY_PARTICLE; - - static const LimitValueType LIMIT_NOT_SET; - - static const LimitNameKeyType STEP_LENGTH_MAX_KEY; - static const LimitNameKeyType TRACK_LENGTH_MAX_KEY; - static const LimitNameKeyType TIME_MAX_KEY; - static const LimitNameKeyType EKIN_MIN_KEY; - static const LimitNameKeyType RANGE_MIN_KEY; - - static const LimitValueType STEP_LENGTH_MAX_DEFAULT; - static const LimitValueType TRACK_LENGTH_MAX_DEFAULT; - static const LimitValueType TIME_MAX_DEFAULT; - static const LimitValueType EKIN_MIN_DEFAULT; - static const LimitValueType RANGE_MIN_DEFAULT; - -public: - G4LimitSet(const G4String& name); - virtual ~G4LimitSet(); - -public: - - const LimitSetMap& getLimitSetMap() const - { - return m_limitsMap; - } - - virtual G4double GetMaxAllowedStep(const G4Track&); - virtual G4double GetUserMaxTrackLength(const G4Track&); - virtual G4double GetUserMaxTime(const G4Track&); - virtual G4double GetUserMinEkine(const G4Track&); - virtual G4double GetUserMinRange(const G4Track&); - - /* Set limits by particle type. */ - void setLimitForParticle(LimitNameType limitName, ParticleType particleType, LimitValueType limitValue); - - void setName(const G4String& n); - G4String& getName(); - -private: - - /** - * Get the limit value for a particular particle type. - * @param limitName The name of the limit type (1 of 5 valid types). - * @param particleType Type, e.g. name, of the Geant4 particle. - * @return Value of the limit or LIMIT_NOT_SET if no key exists and ANY_PARTICLE is also not set. - */ - LimitValueType getLimitForParticle(LimitNameType limitName, ParticleType particleType = ANY_PARTICLE); - - LimitValueType getLimitForParticle(LimitNameType limitName, const G4Track&); - - const ParticleType getParticleType(const G4Track&); - -protected: - - /* Map of ( limitName -> particleName -> limitValue ). */ - LimitSetMap m_limitsMap; - - G4String m_name; -}; - -#endif
diff -N G4UserRegionInformation.hh --- G4UserRegionInformation.hh 26 Jun 2013 01:32:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,87 +0,0 @@
-//$Header: /cvs/lcd/lcdd/include/lcdd/geant4/Attic/G4UserRegionInformation.hh,v 1.1 2013/06/26 01:32:45 jeremy Exp $ - -#ifndef LCDD_G4USERREGIONINFORMATION_HH -#define LCDD_G4USERREGIONINFORMATION_HH 1 - -#include "G4VUserRegionInformation.hh" -#include "G4Track.hh" -#include "G4StepPoint.hh" -#include "globals.hh" - -#include <string> - -/** - @class G4UserRegionInformation - @brief Implementation of G4VUserRegionInformation. - */ -class G4UserRegionInformation: public G4VUserRegionInformation -{ - -public: - - G4UserRegionInformation() : - _storeSecondaries(false), _killTracks(false) - { - } - - virtual ~G4UserRegionInformation() - { - } - -public: - - void setStoreSecondaries(bool b) - { - _storeSecondaries = b; - } - - bool getStoreSecondaries() const - { - return _storeSecondaries; - } - - void setKillTracks(bool killTracks) - { - _killTracks = killTracks; - } - - bool getKillTracks() const - { - return _killTracks; - } - - void setThreshold(G4double t) - { - _threshold = t; - } - - G4double getThreshold() const - { - return _threshold; - } - - // region info from track - static inline G4UserRegionInformation* getRegionInformation(const G4Track* aTrack) - { - return static_cast<G4UserRegionInformation*>(aTrack->GetLogicalVolumeAtVertex()->GetRegion()->GetUserInformation()); - } - - // region info from step point - static G4UserRegionInformation* getRegionInformation(const G4StepPoint* aStepPoint) - { - return static_cast<G4UserRegionInformation*>(aStepPoint->GetPhysicalVolume()->GetLogicalVolume()->GetRegion()->GetUserInformation()); - } - - void Print() const - { - } - -private: - - bool _storeSecondaries; - bool _killTracks; - - G4double _threshold; -}; - -#endif
diff -N CalorimeterHit.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ CalorimeterHit.hh 1 Jul 2013 21:00:42 -0000 1.1 @@ -0,0 +1,143 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/hits/CalorimeterHit.hh,v 1.1 2013/07/01 21:00:42 jeremy Exp $ + +#ifndef LCDD_HITS_CALORIMETERHIT_HH +#define LCDD_HITS_CALORIMETERHIT_HH 1 + +// LCDD +#include "lcdd/id/Id64bit.hh" +#include "lcdd/hits/HitContribution.hh" + +// Geant4 +#include "G4VHit.hh" +#include "G4THitsCollection.hh" +#include "G4Allocator.hh" +#include "G4ThreeVector.hh" +#include "G4UnitsTable.hh" + +// STL +#include <iostream> + +/** + * @brief Implementation of G4VHit for calorimeter-type hits. + */ +class CalorimeterHit: public G4VHit +{ + +public: + + CalorimeterHit(); + CalorimeterHit(const CalorimeterHit &right); + CalorimeterHit(G4double edep, G4ThreeVector globalCellPos); + virtual ~CalorimeterHit(); + + const CalorimeterHit& operator=(const CalorimeterHit &right); + bool operator==(const CalorimeterHit &right); + inline void *operator new(size_t); + inline void operator delete(void *aHit); + +#ifdef G4VIS_USE + void Draw(); +#endif + + void printMcpHitContribs(std::ostream&); + void printMcpHitContribsHeader(std::ostream&); + + void Print(); + +public: + + friend std::ostream& operator<<(std::ostream &os, const CalorimeterHit& hit); + + void setPos(const G4ThreeVector& posXYZ) + { + m_pos = posXYZ; + } + + void setEdep(const G4double ed) + { + m_edep = ed; + } + + void incrEdep(const G4double edincr) + { + m_edep += edincr; + } + + G4ThreeVector getPos() const + { + return m_pos; + } + + G4double getEdep() const + { + return m_edep; + } + + void addMcpHitContrib(HitContribution contrib) + { + m_particleList.push_back(contrib); + } + + const McpHitContribList& getMcpHitContribList() const + { + return m_particleList; + } + + // set value of 64 bit id + void setId64bit(Id64bit::ElementType id0, Id64bit::ElementType id1) + { + m_id64.setId0(id0); + m_id64.setId1(id1); + } + + // get 64 bit id + const Id64bit& getId64bit() const + { + return m_id64; + } + + void setEndcapFlag(bool ec = true) + { + m_endcap = ec; + } + + bool getEndcapFlag() + { + return m_endcap; + } + +private: + + // 64-bit id. + Id64bit m_id64; + + // Energy deposition. + G4double m_edep; + + // Position. + G4ThreeVector m_pos; + + // Endcap flag. + bool m_endcap; + + // List of contributions by MCParticle. + McpHitContribList m_particleList; +}; + +typedef G4THitsCollection<CalorimeterHit> (G4CalorimeterHitsCollection); + +extern G4Allocator<CalorimeterHit> G4CalorimeterHitAllocator; + +inline void* CalorimeterHit::operator new(size_t) +{ + void* aHit; + aHit = (void *) G4CalorimeterHitAllocator.MallocSingle(); + return aHit; +} + +inline void CalorimeterHit::operator delete(void *aHit) +{ + G4CalorimeterHitAllocator.FreeSingle((CalorimeterHit*) aHit); +} + +#endif
diff -N HitContribution.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ HitContribution.hh 1 Jul 2013 21:00:42 -0000 1.1 @@ -0,0 +1,90 @@
+// $Header: /cvs/lcd/lcdd/include/lcdd/hits/HitContribution.hh,v 1.1 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_HITS_HITCONTRIBUTION_HH +#define LCDD_HITS_HITCONTRIBUTION_HH 1 + +// Geant4 +#include "globals.hh" +#include "G4ThreeVector.hh" + +// STL +#include <vector> +#include <iostream> + +// SLIC +class CalorimeterHit; + +// Geant4 +class G4Step; + +/** + * @brief Contribution of an MCParticle to a hit. + */ +class HitContribution +{ +public: + friend class CalorimeterHit; + +public: + + // no parameters + HitContribution(); + + // all parameters + HitContribution(G4int trackID, G4double edep, G4int PDGID, G4double globalTime); + + // parameters from step + HitContribution(const G4Step* aStep); + + virtual ~HitContribution(); + + inline G4int getTrackID() const + { + return m_trackID; + } + + inline G4double getEdep() const + { + return m_edep; + } + + inline void incrEdep(G4double incr) + { + m_edep += incr; + } + + inline G4int getPDGID() const + { + return m_PdgId; + } + + inline G4double getGlobalTime() const + { + return m_globalTime; + } + + inline void setMinTime(G4double new_time) + { + if (new_time < m_globalTime) { + m_globalTime = new_time; + } + } + + inline const float* getPosition() const + { + return m_position; + } + + void printOut(std::ostream&); + +private: + + G4int m_trackID; + G4double m_edep; + G4int m_PdgId; + G4double m_globalTime; + float m_position[3]; +}; + +typedef std::vector<HitContribution> McpHitContribList; + +#endif
diff -N TrackerHit.hh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ TrackerHit.hh 1 Jul 2013 21:00:42 -0000 1.1 @@ -0,0 +1,135 @@
+#ifndef LCDD_HITS_TRACKERHIT_HH +#define LCDD_HITS_TRACKERHIT_HH 1 + +// LCDD +#include "lcdd/id/Id64bit.hh" + +// Geant4 +#include "G4VHit.hh" +#include "G4THitsCollection.hh" +#include "G4Allocator.hh" +#include "G4ThreeVector.hh" +#include "G4UnitsTable.hh" + +/** + * @brief Simulation class for a tracker-type hit. + */ +class TrackerHit: public G4VHit +{ +public: + TrackerHit(); + + virtual ~TrackerHit(); + + inline void *operator new(size_t); + inline void operator delete(void *aHit); + +#ifdef G4VIS_USE + void Draw(); +#endif + + void Print(); + +public: + + friend std::ostream& operator<<(std::ostream &os, const TrackerHit& hit); + + void setTdep(const G4double tdep) + { + m_tdep = tdep; + } + void setEdep(const G4double edep) + { + m_edep = edep; + } + void setPos(const G4ThreeVector& posXYZ) + { + m_pos = posXYZ; + } + void setMomentum(const G4ThreeVector& mom) + { + m_mom = mom; + } + void setTrackID(const G4int trkID) + { + m_trkID = trkID; + } + void setPDG(const G4int pdg) + { + m_PDG = pdg; + } + void setLength(const G4double l) + { + m_length = l; + } + + G4double getTdep() const + { + return m_tdep; + } + G4double getEdep() const + { + return m_edep; + } + G4ThreeVector getPos() const + { + return m_pos; + } + G4ThreeVector getMomentum() const + { + return m_mom; + } + G4int getTrackID() const + { + return m_trkID; + } + G4int getPDG() const + { + return m_PDG; + } + G4double getLength() const + { + return m_length; + } + + void setId(Id64bit::ElementType id1) + { + m_id64.setId1(id1); + } + + int getId() + { + return m_id64.getId1(); + } + +public: + + G4double m_edep; + G4double m_tdep; + G4ThreeVector m_pos; + 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; +}; + +typedef G4THitsCollection<TrackerHit> (G4TrackerHitsCollection); + +extern G4Allocator<TrackerHit> G4TrackerHitAllocator; + +inline void* TrackerHit::operator new(size_t) +{ + void* aHit; + aHit = (void *) G4TrackerHitAllocator.MallocSingle(); + return aHit; +} + +inline void TrackerHit::operator delete(void *aHit) +{ + G4TrackerHitAllocator.FreeSingle((TrackerHit*) aHit); +} + +#endif
diff -u -r1.1 -r1.2 --- TrackInformation.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ TrackInformation.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,15 +1,14 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/hits/TrackInformation.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_TRACKINFORMATION_HH -#define LCDD_TRACKINFORMATION_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/hits/TrackInformation.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_HITS_TRACKINFORMATION_HH +#define LCDD_HITS_TRACKINFORMATION_HH 1
+// Geant4
#include "G4Track.hh" #include "G4Step.hh" #include "G4Allocator.hh" /**
- @class TrackInformation - @brief Implements G4VUserTrackInformation. - @note In LCDD package, because used by SDs.
+ * @brief Implements G4VUserTrackInformation.
*/ class TrackInformation: public G4VUserTrackInformation {
diff -N G4CalorimeterHit.hh --- G4CalorimeterHit.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,143 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/hits/Attic/G4CalorimeterHit.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_G4CALORIMETERHIT_HH -#define LCDD_G4CALORIMETERHIT_HH 1 - -// LCDD -#include "lcdd/id/Id64bit.hh" -#include "lcdd/hits/McpHitContrib.hh" - -// Geant4 -#include "G4VHit.hh" -#include "G4THitsCollection.hh" -#include "G4Allocator.hh" -#include "G4ThreeVector.hh" -#include "G4UnitsTable.hh" - -// STL -#include <iostream> - -/** - * @class G4CalorimeterHit - * @brief Implementation of G4VHit for calorimeter-type hits. - */ -class G4CalorimeterHit: public G4VHit -{ - -public: - - G4CalorimeterHit(); - G4CalorimeterHit(const G4CalorimeterHit &right); - G4CalorimeterHit(G4double edep, G4ThreeVector globalCellPos); - virtual ~G4CalorimeterHit(); - - const G4CalorimeterHit& operator=(const G4CalorimeterHit &right); - bool operator==(const G4CalorimeterHit &right); - inline void *operator new(size_t); - inline void operator delete(void *aHit); - -#ifdef G4VIS_USE - void Draw(); -#endif - - void printMcpHitContribs(std::ostream&); - void printMcpHitContribsHeader(std::ostream&); - - void Print(); - -public: - - friend std::ostream& operator<<(std::ostream &os, const G4CalorimeterHit& hit); - - void setPos(const G4ThreeVector& posXYZ) - { - m_pos = posXYZ; - } - - void setEdep(const G4double ed) - { - m_edep = ed; - } - - void incrEdep(const G4double edincr) - { - m_edep += edincr; - } - - G4ThreeVector getPos() const - { - return m_pos; - } - - G4double getEdep() const - { - return m_edep; - } - - void addMcpHitContrib(McpHitContrib contrib) - { - m_particleList.push_back(contrib); - } - - const McpHitContribList& getMcpHitContribList() const - { - return m_particleList; - } - - // set value of 64 bit id - void setId64bit(Id64bit::ElementType id0, Id64bit::ElementType id1) - { - m_id64.setId0(id0); - m_id64.setId1(id1); - } - - // get 64 bit id - const Id64bit& getId64bit() const - { - return m_id64; - } - - void setEndcapFlag(bool ec = true) - { - m_endcap = ec; - } - - bool getEndcapFlag() - { - return m_endcap; - } - -private: - - // 64-bit id. - Id64bit m_id64; - - // Energy deposition. - G4double m_edep; - - // Position. - G4ThreeVector m_pos; - - // Endcap flag. - bool m_endcap; - - // List of contributions by MCParticle. - McpHitContribList m_particleList; -}; - -typedef G4THitsCollection<G4CalorimeterHit> (G4CalorimeterHitsCollection); - -extern G4Allocator<G4CalorimeterHit> G4CalorimeterHitAllocator; - -inline void* G4CalorimeterHit::operator new(size_t) -{ - void* aHit; - aHit = (void *) G4CalorimeterHitAllocator.MallocSingle(); - return aHit; -} - -inline void G4CalorimeterHit::operator delete(void *aHit) -{ - G4CalorimeterHitAllocator.FreeSingle((G4CalorimeterHit*) aHit); -} - -#endif
diff -N G4TrackerHit.hh --- G4TrackerHit.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,136 +0,0 @@
-#ifndef LCDD_G4TRACKERHIT_HH -#define LCDD_G4TRACKERHIT_HH 1 - -// LCDD -#include "lcdd/id/Id64bit.hh" - -// Geant4 -#include "G4VHit.hh" -#include "G4THitsCollection.hh" -#include "G4Allocator.hh" -#include "G4ThreeVector.hh" -#include "G4UnitsTable.hh" - -/** - @class G4TrackerHit - @brief Simulation class for a tracker-type hit. - */ -class G4TrackerHit: public G4VHit -{ -public: - G4TrackerHit(); - - virtual ~G4TrackerHit(); - - inline void *operator new(size_t); - inline void operator delete(void *aHit); - -#ifdef G4VIS_USE - void Draw(); -#endif - - void Print(); - -public: - - friend std::ostream& operator<<(std::ostream &os, const G4TrackerHit& hit); - - void setTdep(const G4double tdep) - { - m_tdep = tdep; - } - void setEdep(const G4double edep) - { - m_edep = edep; - } - void setPos(const G4ThreeVector& posXYZ) - { - m_pos = posXYZ; - } - void setMomentum(const G4ThreeVector& mom) - { - m_mom = mom; - } - void setTrackID(const G4int trkID) - { - m_trkID = trkID; - } - void setPDG(const G4int pdg) - { - m_PDG = pdg; - } - void setLength(const G4double l) - { - m_length = l; - } - - G4double getTdep() const - { - return m_tdep; - } - G4double getEdep() const - { - return m_edep; - } - G4ThreeVector getPos() const - { - return m_pos; - } - G4ThreeVector getMomentum() const - { - return m_mom; - } - G4int getTrackID() const - { - return m_trkID; - } - G4int getPDG() const - { - return m_PDG; - } - G4double getLength() const - { - return m_length; - } - - void setId(Id64bit::ElementType id1) - { - m_id64.setId1(id1); - } - - int getId() - { - return m_id64.getId1(); - } - -public: - - G4double m_edep; - G4double m_tdep; - G4ThreeVector m_pos; - 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; -}; - -typedef G4THitsCollection<G4TrackerHit> (G4TrackerHitsCollection); - -extern G4Allocator<G4TrackerHit> G4TrackerHitAllocator; - -inline void* G4TrackerHit::operator new(size_t) -{ - void* aHit; - aHit = (void *) G4TrackerHitAllocator.MallocSingle(); - return aHit; -} - -inline void G4TrackerHit::operator delete(void *aHit) -{ - G4TrackerHitAllocator.FreeSingle((G4TrackerHit*) aHit); -} - -#endif
diff -N McpHitContrib.hh --- McpHitContrib.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,91 +0,0 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/hits/Attic/McpHitContrib.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_MCPHITCONTRIB_HH -#define LCDD_MCPHITCONTRIB_HH 1 - -// G4 -#include "globals.hh" -#include "G4ThreeVector.hh" - -// std -#include <vector> -#include <iostream> - -// SLIC -class G4CalorimeterHit; - -// G4 -class G4Step; - -/** - * @class McpHitContrib - * @brief Contribution of an MCParticle to a hit. - */ -class McpHitContrib -{ -public: - friend class G4CalorimeterHit; - -public: - - // no parameters - McpHitContrib(); - - // all parameters - McpHitContrib(G4int trackID, G4double edep, G4int PDGID, G4double globalTime); - - // parameters from step - McpHitContrib(const G4Step* aStep); - - virtual ~McpHitContrib(); - - inline G4int getTrackID() const - { - return m_trackID; - } - - inline G4double getEdep() const - { - return m_edep; - } - - inline void incrEdep(G4double incr) - { - m_edep += incr; - } - - inline G4int getPDGID() const - { - return m_PdgId; - } - - inline G4double getGlobalTime() const - { - return m_globalTime; - } - - inline void setMinTime(G4double new_time) - { - if (new_time < m_globalTime) { - m_globalTime = new_time; - } - } - - inline const float* getPosition() const - { - return m_position; - } - - void printOut(std::ostream&); - -private: - - G4int m_trackID; - G4double m_edep; - G4int m_PdgId; - G4double m_globalTime; - float m_position[3]; -}; - -typedef std::vector<McpHitContrib> McpHitContribList; - -#endif
diff -u -r1.1 -r1.2 --- IdComparator.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ IdComparator.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/id/IdComparator.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/id/IdComparator.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
#ifndef LCDD_IDCOMPARATOR_HH #define LCDD_IDCOMPARATOR_HH 1
@@ -14,7 +14,7 @@
public:
- virtual bool compare(const G4CalorimeterHit& hit1, const G4CalorimeterHit& hit2)
+ virtual bool compare(const CalorimeterHit& hit1, const CalorimeterHit& hit2)
{ return (hit1.getId64bit() == hit2.getId64bit()); }
diff -u -r1.1 -r1.2 --- IdFactory.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ IdFactory.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/id/IdFactory.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/id/IdFactory.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
#ifndef LCDD_IDFACTORY_HH #define LCDD_IDFACTORY_HH 1
@@ -11,14 +11,14 @@
#include <vector> // LCDD
-class G4Segmentation;
+class Segmentation;
// G4 class G4Step; class G4VPhysicalVolume; // LCDD
-class G4SensitiveDetector;
+class SensitiveDetector;
/** @class IdFactory
@@ -65,10 +65,10 @@
static inline Bits checkOverflow(Id64bit::ElementType field_val, Bits mask); // create IdVec ordered by this SD's idspec, or empty vec if sd does not have an idspec
- static IdVec createOrderedIdVec(G4Step* aStep, const G4SensitiveDetector* sd);
+ static IdVec createOrderedIdVec(G4Step* aStep, const SensitiveDetector* sd);
/* lkp bin value by field name in segmentation */
- static int findFieldIdxInSegmentation(G4Segmentation*, const std::string& field_name);
+ static int findFieldIdxInSegmentation(Segmentation*, const std::string& field_name);
/* Check if PV list has PVid with given label. */ static bool hasPhysVolId(const std::vector<G4VPhysicalVolume*>& pvs, const std::string& field_name);
diff -u -r1.1 -r1.2 --- FieldMapTypeProcess.hh 27 Jun 2013 00:05:57 -0000 1.1 +++ FieldMapTypeProcess.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,7 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/processes/FieldMapTypeProcess.hh,v 1.1 2013/06/27 00:05:57 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/processes/FieldMapTypeProcess.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_FIELDMAPTYPEPROCESS_HH -#define LCDD_FIELDMAPTYPEPROCESS_HH 1
+#ifndef LCDD_PROCESSES_FIELDMAPTYPEPROCESS_HH +#define LCDD_PROCESSES_FIELDMAPTYPEPROCESS_HH 1
// GDML #include "Saxana/ProcessingConfigurator.h"
diff -u -r1.1 -r1.2 --- FieldTypeProcess.hh 27 Jun 2013 00:05:57 -0000 1.1 +++ FieldTypeProcess.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,6 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/processes/FieldTypeProcess.hh,v 1.1 2013/06/27 00:05:57 jeremy Exp $ -#ifndef LCDD_FIELDTYPEPROCESS_HH -#define LCDD_FIELDTYPEPROCESS_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/processes/FieldTypeProcess.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ + +#ifndef LCDD_PROCESSES_FIELDTYPEPROCESS_HH +#define LCDD_PROCESSES_FIELDTYPEPROCESS_HH 1
// GDML #include "Saxana/ProcessingConfigurator.h"
diff -u -r1.1 -r1.2 --- SensitiveDetectorTypeProcess.hh 27 Jun 2013 00:05:57 -0000 1.1 +++ SensitiveDetectorTypeProcess.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,7 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/processes/SensitiveDetectorTypeProcess.hh,v 1.1 2013/06/27 00:05:57 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/processes/SensitiveDetectorTypeProcess.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_SENSITIVEDETECTORTYPEPROCESS_HH -#define LCDD_SENSITIVEDETECTORTYPEPROCESS_HH 1
+#ifndef LCDD_PROCESSES_SENSITIVEDETECTORTYPEPROCESS_HH +#define LCDD_PROCESSES_SENSITIVEDETECTORTYPEPROCESS_HH 1
// LCDD #include "lcdd/schema/SensitiveDetectorType.hh"
diff -u -r1.1 -r1.2 --- calorimeterProcess.hh 27 Jun 2013 00:05:57 -0000 1.1 +++ calorimeterProcess.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,6 +1,6 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/processes/calorimeterProcess.hh,v 1.1 2013/06/27 00:05:57 jeremy Exp $ -#ifndef LCDD_CALORIMETERPROCESS_HH -#define LCDD_CALORIMETERPROCESS_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/processes/calorimeterProcess.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_PROCESSES_CALORIMETERPROCESS_HH +#define LCDD_PROCESSES_CALORIMETERPROCESS_HH 1
// GDML #include "Saxana/ProcessingConfigurator.h"
diff -u -r1.1 -r1.2 --- AuthorType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ AuthorType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,13 +1,13 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/AuthorType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/AuthorType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_AUTHORTYPE_HH -#define LCDD_AUTHORTYPE_HH 1
+#ifndef LCDD_SCHEMA_AUTHORTYPE_HH +#define LCDD_SCHEMA_AUTHORTYPE_HH 1
+// STL
#include <string> /**
- @class AuthorType - @brief AuthorType from schema.
+ * @brief AuthorType from schema.
*/ class AuthorType {
diff -u -r1.1 -r1.2 --- BoxDipoleType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ BoxDipoleType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,10 +1,12 @@
-#ifndef LCDD_BOXDIPOLETYPE_HH -#define LCDD_BOXDIPOLETYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/BoxDipoleType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
+#ifndef LCDD_SCHEMA_BOXDIPOLETYPE_HH +#define LCDD_SCHEMA_BOXDIPOLETYPE_HH 1 + +// LCDD
#include "FieldType.hh" /**
- * @class BoxDipoleType
* @brief This is a representation of the BoxDipoleType from the LCDD schema. */ class BoxDipoleType: public FieldType
diff -u -r1.1 -r1.2 --- CalorimeterType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ CalorimeterType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,14 +1,18 @@
-#ifndef LCDD_CALORIMETERTYPE_HH -#define LCDD_CALORIMETERTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/CalorimeterType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
+#ifndef LCDD_SCHEMA_CALORIMETERTYPE_HH +#define LCDD_SCHEMA_CALORIMETERTYPE_HH 1 + +// GDML
#include "Schema/ContentGroup.h"
+// LCDD
#include "SensitiveDetectorType.hh"
+// STL
#include <iostream> /**
- * @class CalorimeterType
* @brief CalorimeterType from schema. */ class CalorimeterType: public SensitiveDetectorType
diff -u -r1.1 -r1.2 --- CellReadout2DSegmentationType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ CellReadout2DSegmentationType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,10 +1,12 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/CellReadout2DSegmentationType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/CellReadout2DSegmentationType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef lcdd_CellReadout2DSegmentationType_hh -#define lcdd_CellReadout2DSegmentationType_hh 1
+#ifndef LCDD_CELLREADOUT2DSEGMENTATIONTYPE_HH +#define LCDD_CELLREADOUT2DSEGMENTATIONTYPE_HH 1
+// LCDD
#include "SegmentationType.hh"
+// STL
#include <string> class CellReadout2DSegmentationType: public SegmentationType
diff -u -r1.1 -r1.2 --- ColorType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ ColorType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,13 +1,13 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/ColorType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/ColorType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_COLORTYPE_HH -#define LCDD_COLORTYPE_HH 1
+#ifndef LCDD_SCHEMA_COLORTYPE_HH +#define LCDD_SCHEMA_COLORTYPE_HH 1
+// STL
#include <string> /**
- @class ColorType - @brief ColorType from schema.
+ * @brief ColorType from schema.
*/ class ColorType {
diff -u -r1.1 -r1.2 --- CommentType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ CommentType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,13 +1,13 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/CommentType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/CommentType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_COMMENTTYPE_HH -#define LCDD_COMMENTTYPE_HH 1
+#ifndef LCDD_SCHEMA_COMMENTTYPE_HH +#define LCDD_SCHEMA_COMMENTTYPE_HH 1
+// STL
#include <string> /**
- @class CommentType - @brief CommentType from schema.
+ * @brief CommentType from schema.
*/ class CommentType {
diff -u -r1.1 -r1.2 --- DetectorType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ DetectorType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,13 +1,13 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/DetectorType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/DetectorType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_DETECTORTYPE_HH -#define LCDD_DETECTORTYPE_HH 1
+#ifndef LCDD_SCHEMA_DETECTORTYPE_HH +#define LCDD_SCHEMA_DETECTORTYPE_HH 1
+// STL
#include <string> /**
- @class DetectorType - @brief DetectorType from schema.
+ * @brief DetectorType from schema.
*/ class DetectorType {
diff -u -r1.1 -r1.2 --- DipoleCoeffType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ DipoleCoeffType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,11 +1,11 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/DipoleCoeffType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_DIPOLECOEFFTYPE_HH -#define LCDD_DIPOLECOEFFTYPE_HH
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/DipoleCoeffType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_SCHEMA_DIPOLECOEFFTYPE_HH +#define LCDD_SCHEMA_DIPOLECOEFFTYPE_HH
+// STL
#include <string> /**
- * @class DipoleCoeffType
* @brief The DipoleCoeffType from the lcdd_fields.xsd schema. */ class DipoleCoeffType
diff -u -r1.1 -r1.2 --- DipoleType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ DipoleType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,17 +1,18 @@
-#ifndef LCDD_DIPOLETYPE_HH -#define LCDD_DIPOLETYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/DipoleType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-// parent class
+#ifndef LCDD_SCHEMA_DIPOLETYPE_HH +#define LCDD_SCHEMA_DIPOLETYPE_HH 1 + +// LCDD
#include "FieldType.hh"
-// gdml
+// GDML
#include "Schema/ContentGroup.h"
-// std
+// STL
#include <string> /**
- * @class DipoleType
* @brief DipoleType from lcdd_fields.xsd schema. */ class DipoleType: public FieldType
diff -u -r1.1 -r1.2 --- FieldMap3DType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ FieldMap3DType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,14 +1,15 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/FieldMap3DType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_FIELDMAP3DTYPE_HH -#define LCDD_FIELDMAP3DTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/FieldMap3DType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_SCHEMA_FIELDMAP3DTYPE_HH +#define LCDD_SCHEMA_FIELDMAP3DTYPE_HH 1
+// LCDD
#include "FieldMapType.hh"
+// STL
#include <string> /**
- * @class - * @brief
+ * @brief The FieldMapType from the XML schema.
*/ class FieldMap3DType: public FieldMapType {
diff -u -r1.1 -r1.2 --- FieldMapType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ FieldMapType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,7 +1,8 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/FieldMapType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_FIELDMAPTYPE_HH -#define LCDD_FIELDMAPTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/FieldMapType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_SCHEMA_FIELDMAPTYPE_HH +#define LCDD_SCHEMA_FIELDMAPTYPE_HH 1
+// LCDD
#include "FieldType.hh" // GDML
diff -u -r1.1 -r1.2 --- FieldType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ FieldType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,6 +1,6 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/FieldType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_FIELDTYPE_HH -#define LCDD_FIELDTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/FieldType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_SCHEMA_FIELDTYPE_HH +#define LCDD_SCHEMA_FIELDTYPE_HH 1
// GDML #include "Schema/ReferenceType.h"
diff -u -r1.1 -r1.2 --- GeneratorType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ GeneratorType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,13 +1,13 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/GeneratorType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/GeneratorType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_GENERATORTYPE_HH -#define LCDD_GENERATORTYPE_HH 1
+#ifndef LCDD_SCHEMA_GENERATORTYPE_HH +#define LCDD_SCHEMA_GENERATORTYPE_HH 1
+// STL
#include <string> /**
- @class GeneratorType - @brief GeneratorType from schema.
+ * @brief GeneratorType from schema.
*/ class GeneratorType {
diff -u -r1.1 -r1.2 --- GlobalFieldType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ GlobalFieldType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,10 +1,12 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/GlobalFieldType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_GLOBALFIELDTYPE_HH -#define LCDD_GLOBALFIELDTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/GlobalFieldType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
+#ifndef LCDD_SCHEMA_GLOBALFIELDTYPE_HH +#define LCDD_SCHEMA_GLOBALFIELDTYPE_HH 1 + +// GDML
#include "Schema/ContentGroup.h"
+
/**
- * @class GlobalFieldType
* @brief GlobalFieldType from schema. */ class GlobalFieldType
diff -u -r1.1 -r1.2 --- GlobalGridXYSegmentationType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ GlobalGridXYSegmentationType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,16 +1,18 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/GlobalGridXYSegmentationType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/GlobalGridXYSegmentationType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_GLOBALGRIDXYSEGMENTATIONTYPE_HH -#define LCDD_GLOBALGRIDXYSEGMENTATIONTYPE_HH 1
+#ifndef LCDD_SCHEMA_GLOBALGRIDXYSEGMENTATIONTYPE_HH +#define LCDD_SCHEMA_GLOBALGRIDXYSEGMENTATIONTYPE_HH 1
+// LCDD
#include "SegmentationType.hh"
-#include <string> -
+// GDML
#include "Saxana/SAXObject.h"
+// STL +#include <string> +
/**
- * @class GlobalGridXYSegmentationType
* @brief GlobalGridXYSegmentation from schema. */ class GlobalGridXYSegmentationType: public SegmentationType
diff -u -r1.1 -r1.2 --- HeaderType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ HeaderType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/HeaderType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/HeaderType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_HEADERTYPE_HH -#define LCDD_HEADERTYPE_HH 1
+#ifndef LCDD_SCHEMA_HEADERTYPE_HH +#define LCDD_SCHEMA_HEADERTYPE_HH 1
+// GDML
#include "Schema/ContentGroup.h"
+// STL
#include <string> /**
- @class HeaderType - @brief HeaderType from schema.
+ * @brief HeaderType from schema.
*/ class HeaderType {
diff -u -r1.1 -r1.2 --- IdFieldType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ IdFieldType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,12 +1,13 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/IdFieldType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_IDFIELDTYPE_HH -#define LCDD_IDFIELDTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/IdFieldType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
+#ifndef LCDD_SCHEMA_IDFIELDTYPE_HH +#define LCDD_SCHEMA_IDFIELDTYPE_HH 1 + +// STL
#include <string> /**
- @class IdFieldType - @brief IdFieldType from schema.
+ * @brief IdFieldType from schema.
*/ class IdFieldType {
diff -u -r1.1 -r1.2 --- IdSpecType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ IdSpecType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,17 +1,17 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/IdSpecType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/IdSpecType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_IDSPECTYPE_HH -#define LCDD_IDSPECTYPE_HH
+#ifndef LCDD_SCHEMA_IDSPECTYPE_HH +#define LCDD_SCHEMA_IDSPECTYPE_HH 1
// GDML #include "Processes/ReferenceTypeProcess.h" #include "Schema/ContentGroup.h"
+// STL
#include <string> /**
- @class IdSpecType - @brief IdSpecType from schema.
+ * @brief IdSpecType from schema.
*/ class IdSpecType {
diff -u -r1.1 -r1.2 --- LimitParamType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ LimitParamType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,12 +1,12 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/LimitParamType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_LIMITPARAMTYPE_HH -#define LCDD_LIMITPARAMTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/LimitParamType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_SCHEMA_LIMITPARAMTYPE_HH +#define LCDD_SCHEMA_LIMITPARAMTYPE_HH 1
+// STL
#include <string> #include <vector> /**
- * @class LimitParamType
* @brief The LimitParamType from the lcdd_limits.lcdd subschema. */ class LimitParamType
diff -u -r1.1 -r1.2 --- LimitSetType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ LimitSetType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,6 +1,6 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/LimitSetType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_LIMITSETTYPE_HH -#define LCDD_LIMITSETTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/LimitSetType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_SCHEMA_LIMITSETTYPE_HH +#define LCDD_SCHEMA_LIMITSETTYPE_HH 1
// GDML #include "Schema/ContentGroup.h"
@@ -10,7 +10,6 @@
#include <string> /**
- * @class LimitSetType
* @brief The LimitSetType type from lcdd_limits.lcdd subschema. */ class LimitSetType
diff -u -r1.1 -r1.2 --- LimitType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ LimitType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,6 +1,6 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/LimitType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_LIMITTYPE_HH -#define LCDD_LIMITTYPE_HH
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/LimitType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_SCHEMA_LIMITTYPE_HH +#define LCDD_SCHEMA_LIMITTYPE_HH
// GDML #include "Schema/ReferenceType.h"
@@ -9,8 +9,7 @@
#include <string> /**
- * @class LimitType - * @brief LimitType from schema.
+ * @brief LimitType from schema.
*/ class LimitType {
diff -u -r1.1 -r1.2 --- NonprojectiveCylinderSegmentationType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ NonprojectiveCylinderSegmentationType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/NonprojectiveCylinderSegmentationType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/NonprojectiveCylinderSegmentationType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_NONPROJECTIVECYLINDERSEGMENTATIONTYPE_HH -#define LCDD_NONPROJECTIVECYLINDERSEGMENTATIONTYPE_HH 1
+#ifndef LCDD_SCHEMA_NONPROJECTIVECYLINDERSEGMENTATIONTYPE_HH +#define LCDD_SCHEMA_NONPROJECTIVECYLINDERSEGMENTATIONTYPE_HH 1
+// LCDD
#include "SegmentationType.hh"
+// STL
#include <string> /**
- @class NonprojectiveCylinderSegmentationType - @brief NonprojectiveCylinderSegmentationType from schema.
+ * @brief NonprojectiveCylinderSegmentationType from schema.
*/ class NonprojectiveCylinderSegmentationType: public SegmentationType {
diff -u -r1.1 -r1.2 --- NonprojectiveSegmentationType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ NonprojectiveSegmentationType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/NonprojectiveSegmentationType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/NonprojectiveSegmentationType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_NONPROJECTIVESEGMENTATIONTYPE_HH -#define LCDD_NONPROJECTIVESEGMENTATIONTYPE_HH 1
+#ifndef LCDD_SCHEMA_NONPROJECTIVESEGMENTATIONTYPE_HH +#define LCDD_SCHEMA_NONPROJECTIVESEGMENTATIONTYPE_HH 1
+// LCDD
#include "SegmentationType.hh"
+// STL
#include <string> /**
- @class NonprojectiveSegmentationType - @brief NonprojectiveSegmentationType from schema.
+ * @brief NonprojectiveSegmentationType from schema.
*/ class NonprojectiveSegmentationType: public SegmentationType {
diff -u -r1.1 -r1.2 --- OpticalCalorimeterType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ OpticalCalorimeterType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,14 +1,18 @@
-#ifndef LCDD_OPTICALCALORIMETERTYPE_HH -#define LCDD_OPTICALCALORIMETERTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/OpticalCalorimeterType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
+#ifndef LCDD_SCHEMA_OPTICALCALORIMETERTYPE_HH +#define LCDD_SCHEMA_OPTICALCALORIMETERTYPE_HH 1 + +// GDML
#include "Schema/ContentGroup.h"
+// LCDD
#include "CalorimeterType.hh"
+// STL
#include <iostream> /**
- * @class CalorimeterType
* @brief CalorimeterType from schema. */ class OpticalCalorimeterType: public CalorimeterType
diff -u -r1.1 -r1.2 --- PhysVolIdType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ PhysVolIdType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,13 +1,13 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/PhysVolIdType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/PhysVolIdType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_PHYSVOLIDTYPE_HH -#define LCDD_PHYSVOLIDTYPE_HH
+#ifndef LCDD_SCHEMA_PHYSVOLIDTYPE_HH +#define LCDD_SCHEMA_PHYSVOLIDTYPE_HH 1
+// STL
#include <string> /**
- @class PhysVolIdType - @brief PhysVolIdType from schema.
+ * @brief PhysVolIdType from schema.
*/ class PhysVolIdType {
diff -u -r1.1 -r1.2 --- ProjectiveCylinderSegmentationType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ ProjectiveCylinderSegmentationType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/ProjectiveCylinderSegmentationType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/ProjectiveCylinderSegmentationType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_PROJECTIVECYLINDERSEGMENTATIONTYPE_HH -#define LCDD_PROJECTIVECYLINDERSEGMENTATIONTYPE_HH 1
+#ifndef LCDD_SCHEMA_PROJECTIVECYLINDERSEGMENTATIONTYPE_HH +#define LCDD_SCHEMA_PROJECTIVECYLINDERSEGMENTATIONTYPE_HH 1
+// LCDD
#include "SegmentationType.hh"
+// STL
#include <string> /**
- @class ProjectiveCylinderSegmentationType - @brief ProjectiveCylinderSegmentationType from schema.
+ * @brief ProjectiveCylinderSegmentationType from schema.
*/ class ProjectiveCylinderSegmentationType: public SegmentationType {
diff -u -r1.1 -r1.2 --- ProjectiveZPlaneSegmentationType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ ProjectiveZPlaneSegmentationType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/ProjectiveZPlaneSegmentationType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/ProjectiveZPlaneSegmentationType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_PROJECTIVEZPLANESEGMENTATIONTYPE_HH -#define LCDD_PROJECTIVEZPLANESEGMENTATIONTYPE_HH 1
+#ifndef LCDD_SCHEMA_PROJECTIVEZPLANESEGMENTATIONTYPE_HH +#define LCDD_SCHEMA_PROJECTIVEZPLANESEGMENTATIONTYPE_HH 1
+// LCDD
#include "SegmentationType.hh"
+// STL
#include <string> /**
- @class ProjectiveZPlaneSegmentationType - @brief ProjectiveZPlaneSegmentationType from schema.
+ * @brief ProjectiveZPlaneSegmentationType from schema.
*/ class ProjectiveZPlaneSegmentationType: public SegmentationType {
diff -u -r1.1 -r1.2 --- RZBType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ RZBType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,11 +1,11 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/RZBType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_RZBTYPE_HH -#define LCDD_RZBTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/RZBType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_SCHEMA_RZBTYPE_HH +#define LCDD_SCHEMA_RZBTYPE_HH 1
+// STL
#include <string> /**
- * @class RZBType
* @brief The RZBType from lcdd_fields.xsd subschema. */ class RZBType
diff -u -r1.1 -r1.2 --- RZFieldMapType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ RZFieldMapType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,11 +1,11 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/RZFieldMapType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_RZFIELDMAPTYPE_HH -#define LCDD_RZFIELDMAPTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/RZFieldMapType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ +#ifndef LCDD_SCHEMA_RZFIELDMAPTYPE_HH +#define LCDD_SCHEMA_RZFIELDMAPTYPE_HH 1
+// LCDD
#include "FieldMapType.hh" /**
- * @class RZFieldMapType
* @brief The RZFieldMapType from the lcdd_fields.lcdd subschema. */ class RZFieldMapType: public FieldMapType
diff -u -r1.1 -r1.2 --- RegionType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ RegionType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,7 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/RegionType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/RegionType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_REGIONTYPE_HH -#define LCDD_REGIONTYPE_HH 1
+#ifndef LCDD_SCHEMA_REGIONTYPE_HH +#define LCDD_SCHEMA_REGIONTYPE_HH 1
// GDML #include "Saxana/SAXObject.h"
@@ -10,8 +10,7 @@
#include "Schema/ReferenceType.h" /**
- @class RegionType - @brief RegionType from schema.
+ * @brief RegionType from schema.
*/ class RegionType {
@@ -19,7 +18,6 @@
public: /**
- * @class RegionType::regionref
* @brief Reference to a region element. */ class regionref: public SAXObject, public ReferenceType
diff -u -r1.1 -r1.2 --- ScorerType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ ScorerType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,10 +1,12 @@
-#ifndef LCDD_SCORERTYPE_HH -#define LCDD_SCORERTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/ScorerType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
+#ifndef LCDD_SCHEMA_SCORERTYPE_HH +#define LCDD_SCHEMA_SCORERTYPE_HH 1 + +// LCDD
#include "SensitiveDetectorType.hh" /**
- * @class ScorerType
* @brief ScorerType from schema. */ class ScorerType: public SensitiveDetectorType
diff -u -r1.1 -r1.2 --- SegmentationType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ SegmentationType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,13 +1,13 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/SegmentationType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/SegmentationType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_SEGMENTATIONTYPE_HH -#define LCDD_SEGMENTATIONTYPE_HH 1
+#ifndef LCDD_SCHEMA_SEGMENTATIONTYPE_HH +#define LCDD_SCHEMA_SEGMENTATIONTYPE_HH 1
+// STL
#include <string> /**
- @class SegmentationType - @brief SegmentationType from schema.
+ * @brief SegmentationType from schema.
*/ class SegmentationType {
diff -u -r1.1 -r1.2 --- SensitiveDetectorType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ SensitiveDetectorType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,7 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/SensitiveDetectorType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/SensitiveDetectorType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_SENSITIVEDETECTORTYPE_HH -#define LCDD_SENSITIVEDETECTORTYPE_HH 1
+#ifndef LCDD_SCHEMA_SENSITIVEDETECTORTYPE_HH +#define LCDD_SCHEMA_SENSITIVEDETECTORTYPE_HH 1
// GDML #include "Schema/ContentGroup.h"
@@ -11,7 +11,6 @@
#include <string> /**
- * @class SensitiveDetectorType
* @brief SensitiveDetectorType from schema. */ class SensitiveDetectorType
diff -u -r1.1 -r1.2 --- SolenoidType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ SolenoidType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,11 +1,13 @@
-#ifndef LCDD_SOLENOIDTYPE_HH -#define LCDD_SOLENOIDTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/SolenoidType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
+#ifndef LCDD_SCHEMA_SOLENOIDTYPE_HH +#define LCDD_SCHEMA_SOLENOIDTYPE_HH 1 + +// LCDD
#include "FieldType.hh" /**
- @class SolenoidType - @brief SolenoidType from schema.
+ * @brief SolenoidType from schema.
*/ class SolenoidType: public FieldType {
diff -u -r1.1 -r1.2 --- TrackerType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ TrackerType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,13 +1,16 @@
-#ifndef LCDD_TRACKERTYPE_HH -#define LCDD_TRACKERTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/TrackerType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
+#ifndef LCDD_SCHEMA_TRACKERTYPE_HH +#define LCDD_SCHEMA_TRACKERTYPE_HH 1 + +// LCDD
#include "SensitiveDetectorType.hh"
+// STL
#include <iostream> /**
- @class TrackerType - @brief TrackerType from schema.
+ * @brief TrackerType from schema.
*/ class TrackerType: public SensitiveDetectorType {
diff -u -r1.1 -r1.2 --- UnsegmentedCalorimeterType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ UnsegmentedCalorimeterType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,5 +1,7 @@
-#ifndef LCDD_UNSEGMENTEDCALORIMETERTYPE_HH -#define LCDD_UNSEGMENTEDCALORIMETERTYPE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/UnsegmentedCalorimeterType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $ + +#ifndef LCDD_SCHEMA_UNSEGMENTEDCALORIMETERTYPE_HH +#define LCDD_SCHEMA_UNSEGMENTEDCALORIMETERTYPE_HH 1
// GDML #include "Schema/ContentGroup.h"
@@ -11,7 +13,6 @@
#include <iostream> /**
- * @class UnsegmentedCalorimeterType
* @brief UnsegmentedCalorimeterType from schema. */ class UnsegmentedCalorimeterType: public CalorimeterType
diff -u -r1.1 -r1.2 --- VisType.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ VisType.hh 1 Jul 2013 21:00:42 -0000 1.2 @@ -1,7 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/VisType.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/VisType.hh,v 1.2 2013/07/01 21:00:42 jeremy Exp $
-#ifndef LCDD_VISTYPE_HH -#define LCDD_VISTYPE_HH 1
+#ifndef LCDD_SCHEMA_VISTYPE_HH +#define LCDD_SCHEMA_VISTYPE_HH 1
// GDML #include "Schema/ContentGroup.h"
@@ -11,7 +11,6 @@
#include <string> /**
- * @class VisType
* @brief VisType from schema. */ class VisType
diff -u -r1.1 -r1.2 --- author.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ author.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,7 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/author.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/author.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef LCDD_AUTHOR_HH -#define LCDD_AUTHOR_HH 1
+#ifndef LCDD_SCHEMA_AUTHOR_HH +#define LCDD_SCHEMA_AUTHOR_HH 1
#include "Saxana/SAXObject.h"
diff -u -r1.1 -r1.2 --- box_dipole.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ box_dipole.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,6 +1,7 @@
-// $Id: box_dipole.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_BOX_DIPOLE_HH -#define LCDD_BOX_DIPOLE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/box_dipole.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ + +#ifndef LCDD_SCHEMA_BOX_DIPOLE_HH +#define LCDD_SCHEMA_BOX_DIPOLE_HH 1
// LCDD #include "BoxDipoleType.hh"
diff -u -r1.1 -r1.2 --- calorimeter.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ calorimeter.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,14 +1,15 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/calorimeter.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_CALORIMETER_HH -#define LCDD_CALORIMETER_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/calorimeter.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ +#ifndef LCDD_SCHEMA_CALORIMETER_HH +#define LCDD_SCHEMA_CALORIMETER_HH 1
+// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "CalorimeterType.hh" /**
- @class calorimeter - @brief calorimeter element from schema.
+ * @brief calorimeter element from schema.
*/ class calorimeter: public SAXObject, public CalorimeterType {
diff -u -r1.1 -r1.2 --- cell_readout_2d.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ cell_readout_2d.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,7 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/cell_readout_2d.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/cell_readout_2d.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef lcdd_cell_readout_2d_hh -#define lcdd_cell_readout_2d_hh 1
+#ifndef LCDD_SCHEMA_CELL_READOUT_2D_HH +#define LCDD_SCHEMA_CELL_READOUT_2D_HH 1
// LCDD #include "CellReadout2DSegmentationType.hh"
diff -u -r1.1 -r1.2 --- color.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ color.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,6 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/color.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_COLOR_HH -#define LCDD_COLOR_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/color.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ + +#ifndef LCDD_SCHEMA_COLOR_HH +#define LCDD_SCHEMA_COLOR_HH 1
// GDML #include "Saxana/SAXObject.h"
@@ -9,8 +10,7 @@
#include "ColorType.hh" /**
- @class color - @brief color element from schema.
+ * @brief color element from schema.
*/ class color: public SAXObject, public ColorType {
diff -u -r1.1 -r1.2 --- comment.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ comment.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/comment.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/comment.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef LCDD_COMMENT_HH -#define LCDD_COMMENT_HH 1
+#ifndef LCDD_SCHEMA_COMMENT_HH +#define LCDD_SCHEMA_COMMENT_HH 1
+// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "CommentType.hh" /**
- @class comment - @brief comment element from schema.
+ * @brief comment element from schema.
*/ class comment: public SAXObject, public CommentType {
diff -u -r1.1 -r1.2 --- detector.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ detector.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,15 +1,16 @@
-// $Detector$
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/detector.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef LCDD_DETECTOR_HH -#define LCDD_DETECTOR_HH 1
+#ifndef LCDD_SCHEMA_DETECTOR_HH +#define LCDD_SCHEMA_DETECTOR_HH 1
+// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "DetectorType.hh" /**
- @class detector - @brief detector element from schema (in header).
+ * @brief detector element from schema (in header).
*/ class detector: public SAXObject, public DetectorType {
diff -u -r1.1 -r1.2 --- dipole.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ dipole.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,14 +1,15 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/dipole.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_DIPOLE_HH -#define LCDD_DIPOLE_HH
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/dipole.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ +#ifndef LCDD_SCHEMA_DIPOLE_HH +#define LCDD_SCHEMA_DIPOLE_HH
+// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "DipoleType.hh" /**
- * @class dipole - * @class The dipole element from the lcdd_fields.xsd schema.
+ * @brief The dipole element from the lcdd_fields.xsd schema.
*/ class dipole: public SAXObject, public DipoleType {
diff -u -r1.1 -r1.2 --- dipole_coeff.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ dipole_coeff.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,11 +1,11 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/dipole_coeff.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_DIPOLE_COEFF_HH -#define LCDD_DIPOLE_COEFF_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/dipole_coeff.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ +#ifndef LCDD_SCHEMA_DIPOLE_COEFF_HH +#define LCDD_SCHEMA_DIPOLE_COEFF_HH 1
+// LCDD
#include "DipoleCoeffType.hh" /**
- * @class dipole_coeff
* @brief The dipole_coeff element from the lcdd_fields.xsd schema. */ class dipole_coeff: public SAXObject, public DipoleCoeffType
diff -u -r1.1 -r1.2 --- field.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ field.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,13 +1,16 @@
-#ifndef LCDD_FIELD_HH -#define LCDD_FIELD_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/field.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
+#ifndef LCDD_SCHEMA_FIELD_HH +#define LCDD_SCHEMA_FIELD_HH 1 + +// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "FieldType.hh" /**
- @class field - @brief field element from schema.
+ * @brief field element from schema.
*/ class field: public SAXObject, public FieldType {
diff -u -r1.1 -r1.2 --- field_map_3d.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ field_map_3d.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,12 +1,12 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/field_map_3d.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_FIELD_MAP_3D_HH -#define LCDD_FIELD_MAP_3D_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/field_map_3d.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ +#ifndef LCDD_SCHEMA_FIELD_MAP_3D_HH +#define LCDD_SCHEMA_FIELD_MAP_3D_HH 1
+// LCDD
#include "FieldMap3DType.hh" /**
- * @class - * @brief
+ * @brief SAX binding for FieldMap3D class.
*/ class field_map_3d: public SAXObject, public FieldMap3DType {
diff -u -r1.1 -r1.2 --- generator.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ generator.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/generator.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/generator.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef LCDD_GENERATOR_HH -#define LCDD_GENERATOR_HH 1
+#ifndef LCDD_SCHEMA_GENERATOR_HH +#define LCDD_SCHEMA_GENERATOR_HH 1
+// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "GeneratorType.hh" /**
- @class generator - @brief generator element from schema.
+ * @brief generator element from schema.
*/ class generator: public SAXObject, public GeneratorType {
diff -u -r1.1 -r1.2 --- global_field.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ global_field.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/global_field.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/global_field.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef LCDD_GLOBAL_FIELD_HH -#define LCDD_GLOBAL_FIELD_HH 1
+#ifndef LCDD_SCHEMA_GLOBAL_FIELD_HH +#define LCDD_SCHEMA_GLOBAL_FIELD_HH 1
+// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "GlobalFieldType.hh" /**
- @class global_field - @brief global_field element from schema.
+ * @brief global_field element from schema.
*/ class global_field: public SAXObject, public GlobalFieldType {
diff -u -r1.1 -r1.2 --- global_grid_xy.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ global_grid_xy.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,16 +1,18 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/global_grid_xy.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $ -#ifndef LCDD_GLOBAL_GRID_XY_HH -#define LCDD_GLOBAL_GRID_XY_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/global_grid_xy.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ +#ifndef LCDD_SCHEMA_GLOBAL_GRID_XY_HH +#define LCDD_SCHEMA_GLOBAL_GRID_XY_HH 1
+// LCDD
#include "GlobalGridXYSegmentationType.hh"
-#include <string> -
+// GDML
#include "Saxana/SAXObject.h"
+// STL +#include <string> +
/**
- @class GlobalGridXYSegmentationType - @brief GlobalGridXYSegmentation from schema.
+ * @brief GlobalGridXYSegmentation from schema.
*/ class global_grid_xy: public SAXObject, public GlobalGridXYSegmentationType {
diff -u -r1.1 -r1.2 --- grid_xyz.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ grid_xyz.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/grid_xyz.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/grid_xyz.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef LCDD_GRID_XYZ_HH -#define LCDD_GRID_XYZ_HH 1
+#ifndef LCDD_SCHEMA_GRID_XYZ_HH +#define LCDD_SCHEMA_GRID_XYZ_HH 1
+// LCDD
#include "NonprojectiveSegmentationType.hh"
+// GDML
#include "Saxana/SAXObject.h" /**
- @class grid_xyz - @brief grid_xyz element from schema.
+ * @brief grid_xyz element from schema.
*/ class grid_xyz: public SAXObject, public NonprojectiveSegmentationType {
diff -u -r1.1 -r1.2 --- header.hh 26 Jun 2013 01:32:46 -0000 1.1 +++ header.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/header.hh,v 1.1 2013/06/26 01:32:46 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/header.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef LCDD_HEADER_HH -#define LCDD_HEADER_HH 1 - -#include "Saxana/SAXObject.h"
+#ifndef LCDD_SCHEMA_HEADER_HH +#define LCDD_SCHEMA_HEADER_HH 1
+// LCDD
#include "HeaderType.hh"
+// GDML +#include "Saxana/SAXObject.h" +
/**
- @class header - @brief header element from schema.
+ * @brief header element from schema.
*/ class header: public SAXObject, public HeaderType {
diff -u -r1.1 -r1.2 --- idfieldElem.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ idfieldElem.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,14 +1,15 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/idfieldElem.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $ -#ifndef LCDD_IDFIELDELEM_HH -#define LCDD_IDFIELDELEM_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/idfieldElem.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ +#ifndef LCDD_SCHEMA_IDFIELDELEM_HH +#define LCDD_SCHEMA_IDFIELDELEM_HH 1
+// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "IdFieldType.hh" /**
- @class idfieldElem - @brief idfield element from schema.
+ * @brief idfield element from schema.
*/ class idfieldElem: public SAXObject, public IdFieldType {
diff -u -r1.1 -r1.2 --- idspecElem.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ idspecElem.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,14 +1,15 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/idspecElem.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $ -#ifndef LCDD_IDSPECELEM_HH -#define LCDD_IDSPECELEM_HH - -#include "Saxana/SAXObject.h"
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/idspecElem.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ +#ifndef LCDD_SCHEMA_IDSPECELEM_HH +#define LCDD_SCHEMA_IDSPECELEM_HH
+// LCDD
#include "IdSpecType.hh"
+// GDML +#include "Saxana/SAXObject.h" +
/**
- @class idspecElem - @brief idspec element class.
+ * @brief idspec element class.
*/ class idspecElem: public SAXObject, public IdSpecType {
diff -u -r1.1 -r1.2 --- limit.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ limit.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,13 +1,14 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/limit.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $ -#ifndef LCDD_LIMIT_HH -#define LCDD_LIMIT_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/limit.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ +#ifndef LCDD_SCHEMA_LIMIT_HH +#define LCDD_SCHEMA_LIMIT_HH 1
+// LCDD
#include "LimitParamType.hh"
+// GDML
#include "Saxana/SAXObject.h" /**
- * @class limit
* @brief Element limit from the lcdd_limits.lcdd subschema. */ class limit: public SAXObject, public LimitParamType
diff -u -r1.1 -r1.2 --- limitset.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ limitset.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,13 +1,14 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/limitset.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $ -#ifndef LCDD_LIMITSET_HH -#define LCDD_LIMITSET_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/limitset.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ +#ifndef LCDD_SCHEMA_LIMITSET_HH +#define LCDD_SCHEMA_LIMITSET_HH 1
+// LCDD
#include "LimitSetType.hh"
+// GDML
#include "Saxana/SAXObject.h" /**
- * @class limitset
* @brief Element limitset from the lcdd_limits.lcdd subschema. */ class limitset: public SAXObject, public LimitSetType
diff -u -r1.1 -r1.2 --- nonprojective_cylinder.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ nonprojective_cylinder.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/nonprojective_cylinder.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/nonprojective_cylinder.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef LCDD_NONPROJECTIVE_CYLINDER_HH -#define LCDD_NONPROJECTIVE_CYLINDER_HH 1
+#ifndef LCDD_SCHEMA_NONPROJECTIVE_CYLINDER_HH +#define LCDD_SCHEMA_NONPROJECTIVE_CYLINDER_HH 1
+// LCDD
#include "NonprojectiveCylinderSegmentationType.hh"
+// GDML
#include "Saxana/SAXObject.h" /**
- @class nonprojective_cylinder - @brief nonprojective_cylinder element from schema.
+ * @brief nonprojective_cylinder element from schema.
*/ class nonprojective_cylinder: public SAXObject, public NonprojectiveCylinderSegmentationType {
diff -u -r1.1 -r1.2 --- optical_calorimeter.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ optical_calorimeter.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/optical_calorimeter.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $ -#ifndef LCDD_OPTICAL_CALORIMETER_HH -#define LCDD_OPTICAL_CALORIMETER_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/optical_calorimeter.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
+#ifndef LCDD_SCHEMA_OPTICAL_CALORIMETER_HH +#define LCDD_SCHEMA_OPTICAL_CALORIMETER_HH 1 + +// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "OpticalCalorimeterType.hh" /**
- - @class optical_calorimeter - @brief optical_calorimeter element from schema.
+ * @brief optical_calorimeter element from schema.
*/ class optical_calorimeter: public SAXObject, public OpticalCalorimeterType {
diff -u -r1.1 -r1.2 --- physvolidElem.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ physvolidElem.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,14 +1,15 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/physvolidElem.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $ -#ifndef physvolid_hh -#define physvolid_hh 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/physvolidElem.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ +#ifndef LCDD_SCHEMA_PHYSVOLID_HH +#define LCDD_SCHEMA_PHYSVOLID_HH 1
+// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "PhysVolIdType.hh" /**
- @class physvolidElem - @brief physvolid element from schema.
+ * @brief physvolid element from schema.
*/ class physvolidElem: public SAXObject, public PhysVolIdType {
diff -u -r1.1 -r1.2 --- projective_cylinder.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ projective_cylinder.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/projective_cylinder.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/projective_cylinder.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef LCDD_PROJECTIVE_CYLINDER_HH -#define LCDD_PROJECTIVE_CYLINDER_HH 1
+#ifndef LCDD_SCHEMA_PROJECTIVE_CYLINDER_HH +#define LCDD_SCHEMA_PROJECTIVE_CYLINDER_HH 1
+// LCDD
#include "ProjectiveCylinderSegmentationType.hh"
+// GDML
#include "Saxana/SAXObject.h" /**
- @class projective_cylinder - @brief projective_cylinder element from schema.
+ * @brief projective_cylinder element from schema.
*/ class projective_cylinder: public SAXObject, public ProjectiveCylinderSegmentationType {
diff -u -r1.1 -r1.2 --- projective_zplane.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ projective_zplane.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/projective_zplane.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/projective_zplane.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef LCDD_PROJECTIVE_ZPLANE_HH -#define LCDD_PROJECTIVE_ZPLANE_HH 1
+#ifndef LCDD_SCHEMA_PROJECTIVE_ZPLANE_HH +#define LCDD_SCHEMA_PROJECTIVE_ZPLANE_HH 1
+// LCDD
#include "ProjectiveZPlaneSegmentationType.hh"
+// GDML
#include "Saxana/SAXObject.h" /**
- @class projective_zplane - @brief projective_zplane element from schema.
+ * @brief projective_zplane element from schema.
*/ class projective_zplane: public SAXObject, public ProjectiveZPlaneSegmentationType {
diff -u -r1.1 -r1.2 --- region.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ region.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,13 +1,16 @@
-#ifndef LCDD_REGION_HH -#define LCDD_REGION_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/region.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
+#ifndef LCDD_SCHEMA_REGION_HH +#define LCDD_SCHEMA_REGION_HH 1 + +// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "RegionType.hh" /**
- @class region - @brief region element from schema.
+ * @brief region element from schema.
*/ class region: public SAXObject, public RegionType {
diff -u -r1.1 -r1.2 --- rz_field_map.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ rz_field_map.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,11 +1,12 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/rz_field_map.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $ -#ifndef LCDD_RZ_FIELD_MAP_HH -#define LCDD_RZ_FIELD_MAP_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/rz_field_map.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
+#ifndef LCDD_SCHEMA_RZ_FIELD_MAP_HH +#define LCDD_SCHEMA_RZ_FIELD_MAP_HH 1 + +// LCDD
#include "RZFieldMapType.hh" /**
- * @class rz_field_map
* @brief The rz_field_map element from lcdd_fields.xsd subschema. */ class rz_field_map: public SAXObject, public RZFieldMapType
diff -u -r1.1 -r1.2 --- rzb.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ rzb.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,13 +1,14 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/rzb.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $ -#ifndef LCDD_RZB_HH -#define LCDD_RZB_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/rzb.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ +#ifndef LCDD_SCHEMA_RZB_HH +#define LCDD_SCHEMA_RZB_HH 1
+// LCDD
#include "RZBType.hh"
+// GDML
#include "Saxana/SAXObject.h" /**
- * @class rzb
* @brief The rzB element from lcdd_fields.xsd subschema. */ class rzb: public SAXObject, public RZBType
diff -u -r1.1 -r1.2 --- scorer.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ scorer.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,5 +1,7 @@
-#ifndef LCDD_SCORER_HH -#define LCDD_SCORER_HH
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/scorer.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ + +#ifndef LCDD_SCHEMA_SCORER_HH +#define LCDD_SCHEMA_SCORER_HH 1
#include "ScorerType.hh"
diff -u -r1.1 -r1.2 --- sensitive_detector.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ sensitive_detector.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,13 +1,16 @@
-#ifndef LCDD_SENSITIVE_DETECTOR_HH -#define LCDD_SENSITIVE_DETECTOR_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/sensitive_detector.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#include "Saxana/SAXObject.h"
+#ifndef LCDD_SCHEMA_SENSITIVE_DETECTOR_HH +#define LCDD_SCHEMA_SENSITIVE_DETECTOR_HH 1
+// LCDD
#include "SensitiveDetectorType.hh"
+// GDML +#include "Saxana/SAXObject.h" +
/**
- @class sensitive_detector - @brief sensitive_detector element from schema.
+ * @brief sensitive_detector element from schema.
*/ class sensitive_detector: public SAXObject, public SensitiveDetectorType {
diff -u -r1.1 -r1.2 --- solenoid.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ solenoid.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,16 +1,17 @@
-// $Id: solenoid.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $
+// $Id: solenoid.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
-#ifndef LCDD_SOLENOID_HH -#define LCDD_SOLENOID_HH
+#ifndef LCDD_SCHEMA_SOLENOID_HH +#define LCDD_SCHEMA_SOLENOID_HH
+// LCDD
#include "SolenoidType.hh"
+// GDML
#include "Saxana/SAXObject.h"
+
/**
- @class solenoid - @brief solenoid element from schema.
+ * @brief solenoid element from schema.
*/
-
class solenoid: public SAXObject, public SolenoidType { public:
diff -u -r1.1 -r1.2 --- tracker.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ tracker.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,13 +1,16 @@
-#ifndef LCDD_TRACKER_HH -#define LCDD_TRACKER_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/tracker.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
+#ifndef LCDD_SCHEMA_TRACKER_HH +#define LCDD_SCHEMA_TRACKER_HH 1 + +// LCDD
#include "TrackerType.hh"
+// GDML
#include "Saxana/SAXObject.h" #include "SensitiveDetectorType.hh" /**
- * @class tracker
* @brief tracker element from schema. */ class tracker: public SAXObject, public TrackerType
diff -u -r1.1 -r1.2 --- unsegmented_calorimeter.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ unsegmented_calorimeter.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,15 +1,16 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/unsegmented_calorimeter.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $ -#ifndef LCDD_UNSEGMENTEDCALORIMETER_HH -#define LCDD_UNSEGMENTEDCALORIMETER_HH
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/unsegmented_calorimeter.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $
+#ifndef LCDD_SCHEMA_UNSEGMENTEDCALORIMETER_HH +#define LCDD_SCHEMA_UNSEGMENTEDCALORIMETER_HH + +// GDML
#include "Saxana/SAXObject.h"
+// LCDD
#include "UnsegmentedCalorimeterType.hh" /**
- - @class unsegmented_calorimeter - @brief unsegmented_calorimeter element from LCDD schema.
+ * @brief unsegmented_calorimeter element from LCDD schema.
*/ class unsegmented_calorimeter: public SAXObject, public UnsegmentedCalorimeterType {
diff -u -r1.1 -r1.2 --- vis.hh 26 Jun 2013 01:32:47 -0000 1.1 +++ vis.hh 1 Jul 2013 21:00:43 -0000 1.2 @@ -1,6 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/schema/vis.hh,v 1.1 2013/06/26 01:32:47 jeremy Exp $ -#ifndef LCDD_VIS_HH -#define LCDD_VIS_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/schema/vis.hh,v 1.2 2013/07/01 21:00:43 jeremy Exp $ + +#ifndef LCDD_SCHEMA_VIS_HH +#define LCDD_SCHEMA_VIS_HH 1
// GDML #include "Saxana/SAXObject.h"
@@ -8,8 +9,7 @@
// LCDD #include "VisType.hh" /**
- @class vis - @brief vis element from schema.
+ * @brief vis element from schema.
*/ class vis: public SAXObject, public VisType {
diff -u -r1.1 -r1.2 --- volumeExtendedSubscriber.hh 26 Jun 2013 01:32:48 -0000 1.1 +++ volumeExtendedSubscriber.hh 1 Jul 2013 21:00:44 -0000 1.2 @@ -1,4 +1,7 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/subscribers/volumeExtendedSubscriber.hh,v 1.1 2013/06/26 01:32:48 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/subscribers/volumeExtendedSubscriber.hh,v 1.2 2013/07/01 21:00:44 jeremy Exp $
+
+#ifndef LCDD_SUBSCRIBERS_VOLUMEEXTENDEDSUBSCRIBER_HH
+#define LCDD_SUBSCRIBERS_VOLUMEEXTENDEDSUBSCRIBER_HH 1
// GDML #include "Saxana/SAXSubscriber.h"
@@ -10,8 +13,8 @@
// LCDD #include "lcdd/core/LCDDProcessor.hh" #include "lcdd/id/IdManager.hh"
-#include "lcdd/detectors/G4SensitiveDetector.hh" -#include "lcdd/geant4/G4LimitSet.hh"
+#include "lcdd/detectors/SensitiveDetector.hh" +#include "lcdd/geant4/PhysicsLimitSet.hh"
#include "lcdd/schema/sensitive_detector.hh" #include "lcdd/schema/RegionType.hh" #include "lcdd/schema/physvolidElem.hh"
@@ -28,9 +31,8 @@
#include <iostream> /**
- @class volumeExtendedSubscriber - @brief SAX subscriber to handle extra LCDD tags on volume element. - @note This is the major subscriber extension class for the LCDD package.
+ * @brief SAX subscriber to handle extra LCDD tags on volume element. + * @note This is the major subscriber extension class for the LCDD package.
*/ class volumeExtendedSubscriber: virtual public SAXSubscriber {
@@ -45,4 +47,4 @@
virtual void Activate(const SAXObject* object); };
-//DECLARE_SUBSCRIBER_FACTORY(volumeExtendedSubscriber)
+#endif
diff -u -r1.1 -r1.2 --- GDMLWriter.hh 26 Jun 2013 01:32:48 -0000 1.1 +++ GDMLWriter.hh 1 Jul 2013 21:00:44 -0000 1.2 @@ -1,8 +1,8 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/util/GDMLWriter.hh,v 1.1 2013/06/26 01:32:48 jeremy Exp $ -#ifndef LCDD_GDMLWRITER_HH -#define LCDD_GDMLWRITER_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/util/GDMLWriter.hh,v 1.2 2013/07/01 21:00:44 jeremy Exp $ +#ifndef LCDD_UTIL_GDMLWRITER_HH +#define LCDD_UTIL_GDMLWRITER_HH 1
-// stl
+// STL
#include <string> #include <vector>
diff -u -r1.1 -r1.2 --- GDMLWriterMessenger.hh 26 Jun 2013 01:32:48 -0000 1.1 +++ GDMLWriterMessenger.hh 1 Jul 2013 21:00:44 -0000 1.2 @@ -1,14 +1,14 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/util/GDMLWriterMessenger.hh,v 1.1 2013/06/26 01:32:48 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/util/GDMLWriterMessenger.hh,v 1.2 2013/07/01 21:00:44 jeremy Exp $
-#ifndef GDMLWriterMessenger_h -#define GDMLWriterMessenger_h 1
+#ifndef LCDD_UTIL_GDMLWRITERMESSENGER_HH +#define LCDD_UTIL_GDMLWRITERMESSENGER_HH 1
+// Geant4
#include "G4UImessenger.hh" class G4UIcommand; /**
- * @class GDMLWriterMessenger
* @brief Messenger for GDMLWriter */ class GDMLWriterMessenger: public G4UImessenger
diff -u -r1.1 -r1.2 --- NistElementsDump.hh 26 Jun 2013 01:32:48 -0000 1.1 +++ NistElementsDump.hh 1 Jul 2013 21:00:44 -0000 1.2 @@ -1,7 +1,9 @@
-// $Id: NistElementsDump.hh,v 1.1 2013/06/26 01:32:48 jeremy Exp $ -#ifndef MATERIALPROPERTYDUMP_HH -#define MATERIALPROPERTYDUMP_HH 1
+// $Id: NistElementsDump.hh,v 1.2 2013/07/01 21:00:44 jeremy Exp $
+#ifndef LCDD_UTIL_NISTELEMENTSDUMP_HH +#define LCDD_UTIL_NISTELEMENTSDUMP_HH 1 + +// STL
#include <iostream> #include <string>
diff -u -r1.2 -r1.3 --- StoreInspector.hh 27 Jun 2013 23:42:24 -0000 1.2 +++ StoreInspector.hh 1 Jul 2013 21:00:44 -0000 1.3 @@ -1,13 +1,13 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/util/StoreInspector.hh,v 1.2 2013/06/27 23:42:24 jeremy Exp $ -#ifndef LCDD_STOREINSPECTOR_HH -#define LCDD_STOREINSPECTOR_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/util/StoreInspector.hh,v 1.3 2013/07/01 21:00:44 jeremy Exp $ +#ifndef LCDD_UTIL_STOREINSPECTOR_HH +#define LCDD_UTIL_STOREINSPECTOR_HH 1
// LCDD #include "lcdd/core/LCDDProcessor.hh" #include "lcdd/id/IdManager.hh"
-#include "lcdd/detectors/G4SensitiveDetector.hh" -#include "lcdd/geant4/G4LimitSet.hh" -#include "lcdd/geant4/G4UserRegionInformation.hh"
+#include "lcdd/detectors/SensitiveDetector.hh" +#include "lcdd/geant4/PhysicsLimitSet.hh" +#include "lcdd/geant4/UserRegionInformation.hh"
// Geant4 #include "G4UIcmdWithAString.hh"
@@ -187,22 +187,22 @@
*/ typedef StoreInspector<G4Material, G4MaterialTable> G4MaterialStoreInspector; typedef StoreInspector<G4VSolid, G4SolidStore> G4SolidStoreInspector;
-typedef StoreInspector<G4LimitSet, LCDDProcessor::LimitSets> G4LimitSetInspector;
+typedef StoreInspector<PhysicsLimitSet, LCDDProcessor::LimitSets> G4LimitSetInspector;
typedef StoreInspector<G4LogicalVolume, G4LogicalVolumeStore> G4LogicalVolumeStoreInspector; typedef StoreInspector<G4VPhysicalVolume, G4PhysicalVolumeStore> G4PhysicalVolumeStoreInspector; typedef StoreInspector<IdSpec, IdManager::IdSpecs> IdSpecInspector; typedef StoreInspector<G4VisAttributes, LCDDProcessor::VisAttributes> G4VisAttributeInspector; G4VisAttributeInspector visInspector("G4VisAttributes", LCDDProcessor::instance()->getVisAttributesStore()); typedef StoreInspector<G4Region, G4RegionStore> G4RegionStoreInspector;
-typedef StoreInspector<G4SensitiveDetector, LCDDProcessor::SensitiveDetectors> G4SensitiveDetectorInspector;
+typedef StoreInspector<SensitiveDetector, LCDDProcessor::SensitiveDetectors> G4SensitiveDetectorInspector;
typedef StoreInspector<G4MagneticField, LCDDProcessor::MagneticFields> G4MagneticFieldInspector;
-std::ostream& operator<<(std::ostream& os, G4LimitSet& limset)
+std::ostream& operator<<(std::ostream& os, PhysicsLimitSet& limset)
{ os << endl;
- for (G4LimitSet::LimitSetMap::const_iterator it = limset.getLimitSetMap().begin(); it != limset.getLimitSetMap().end(); it++) {
+ for (PhysicsLimitSet::LimitSetMap::const_iterator it = limset.getLimitSetMap().begin(); it != limset.getLimitSetMap().end(); it++) {
- const G4LimitSet::LimitNameType& name = it->first;
+ const PhysicsLimitSet::LimitNameType& name = it->first;
os << name << endl; std::string unit = "";
@@ -219,8 +219,8 @@
} if (unit != "") {
- const G4LimitSet::LimitMap& limmap = it->second; - for (G4LimitSet::LimitMap::const_iterator iit = limmap.begin(); iit != limmap.end(); iit++) {
+ const PhysicsLimitSet::LimitMap& limmap = it->second; + for (PhysicsLimitSet::LimitMap::const_iterator iit = limmap.begin(); iit != limmap.end(); iit++) {
os << '\t' << iit->first << '\t' << G4BestUnit(iit->second, unit) << endl; }
@@ -310,7 +310,7 @@
return os; }
-std::ostream& operator<<(std::ostream& os, G4SensitiveDetector& sd)
+std::ostream& operator<<(std::ostream& os, SensitiveDetector& sd)
{ os << "fullPath: " << sd.GetFullPathName() << endl; os << "HC: " << sd.getHCName() << endl;
@@ -327,7 +327,7 @@
std::ostream& operator<<(std::ostream &os, G4Region ®) { os << "prod cut: " << reg.GetProductionCuts()->GetProductionCut(0) << endl;
- G4UserRegionInformation* regInfo = static_cast<G4UserRegionInformation*>(reg.GetUserInformation());
+ UserRegionInformation* regInfo = static_cast<UserRegionInformation*>(reg.GetUserInformation());
if (0 != regInfo) { os << "store secondaries: " << regInfo->getStoreSecondaries() << endl; os << "energy threshold: " << regInfo->getThreshold() << endl;
diff -u -r1.1 -r1.2 --- StringUtil.hh 26 Jun 2013 01:32:48 -0000 1.1 +++ StringUtil.hh 1 Jul 2013 21:00:44 -0000 1.2 @@ -1,8 +1,9 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/util/StringUtil.hh,v 1.1 2013/06/26 01:32:48 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/util/StringUtil.hh,v 1.2 2013/07/01 21:00:44 jeremy Exp $
-#ifndef LCDD_STRINGUTIL_HH -#define LCDD_STRINGUTIL_HH 1
+#ifndef LCDD_UTIL_STRINGUTIL_HH +#define LCDD_UTIL_STRINGUTIL_HH 1
+// STL
#include <string> #include <sstream> #include <vector>
diff -u -r1.1 -r1.2 --- Verbose.hh 26 Jun 2013 01:32:48 -0000 1.1 +++ Verbose.hh 1 Jul 2013 21:00:44 -0000 1.2 @@ -1,9 +1,9 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/util/Verbose.hh,v 1.1 2013/06/26 01:32:48 jeremy Exp $ -#ifndef LCDD_VERBOSE_HH -#define LCDD_VERBOSE_HH 1
+// $Header: /cvs/lcd/lcdd/include/lcdd/util/Verbose.hh,v 1.2 2013/07/01 21:00:44 jeremy Exp $ + +#ifndef LCDD_UTIL_VERBOSE_HH +#define LCDD_UTIL_VERBOSE_HH 1
/**
- * @class Verbose
* @brief Mixin class for setting and retrieving verbosity level. */ class Verbose
diff -N BoxDipole.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ BoxDipole.cc 1 Jul 2013 21:00:44 -0000 1.1 @@ -0,0 +1,32 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/BoxDipole.cc,v 1.1 2013/07/01 21:00:44 jeremy Exp $ + +// LCDD +#include "lcdd/bfield/BoxDipole.hh" + +BoxDipole::BoxDipole(double x, double y, double z, double dx, double dy, double dz, double bx, double by, double bz) : + _x(x), _y(y), _z(z), _dx(dx), _dy(dy), _dz(dz), _bx(bx), _by(by), _bz(bz) +{ + _maxx = x + dx; + _maxy = y + dy; + _maxz = z + dz; + + _minx = x - dx; + _miny = y - dy; + _minz = z - dz; +} + +void BoxDipole::GetFieldValue(const double point[3], double* bfield) const +{ + if (point[0] < _minx || point[0] > _maxx) + return; + if (point[1] < _miny || point[1] > _maxy) + return; + if (point[2] < _minz || point[2] > _maxz) + return; + + bfield[0] += _bx; + bfield[1] += _by; + bfield[2] += _bz; + + //std::cout << point[0] << ", " << point[1] << ", " << point[2] << " --> " << bfield[0] << ", " << bfield[1] << ", " << bfield[2] << std::endl; +}
diff -N Dipole.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Dipole.cc 1 Jul 2013 21:00:44 -0000 1.1 @@ -0,0 +1,114 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/Dipole.cc,v 1.1 2013/07/01 21:00:44 jeremy Exp $ + +// LCDD +#include "lcdd/bfield/Dipole.hh" + +// STL +#include <iostream> +#include <cmath> + +/** + * Apply polynomial fit of dipole field, with variable number of coefficients + * read from the input XML file. + */ +void Dipole::GetFieldValue(const double Point[3], double* Bfield) const +{ + //std::cout << "G4Dipole::GetFieldValue" << std::endl; + + //std::cout << "point = " << Point[0] << " " << Point[1] << " " << Point[2] << std::endl; + //std::cout << "BEFORE --> bfield = " << Bfield[0] << " " << Bfield[1] << " " << Bfield[2] << std::endl; + + double bx = 0; + double z = Point[2]; + double r = sqrt(Point[0] * Point[0] + Point[1] * Point[1]); + + // Check if z coordinate is within dipole z bounds. + if (z > m_zmin && z < m_zmax && r < m_rmax) { + + // Convert to absolute value z and apply specified length unit. + double zc = fabs(z) / m_lunit; + + //std::cout << "zc = " << zc << std::endl; + + // Apply all coefficients to this z coordinate. + for (size_t i = 0; i < m_coeffs.size(); ++i) { + bx += m_coeffs[i] * pow(zc, i); + } + + // Convert to specified field unit. + bx *= m_funit; + + // Flip sign for negative z. + if (z < 0) { + bx = -bx; + } + + // Add Bx to the input Bfield. + Bfield[0] += bx; + } + + //std::cout << "AFTER --> bfield = " << Bfield[0] << " " << Bfield[1] << " " << Bfield[2] << std::endl << std::endl; + //std::cout << Point[2] << " " << Bfield[0] << std::endl; + + return; +} + +void Dipole::setZMax(double zmax) +{ + m_zmax = zmax; +} + +double Dipole::getZMax() +{ + return m_zmax; +} + +void Dipole::setZMin(double zmin) +{ + m_zmin = zmin; +} + +double Dipole::getZMin() +{ + return m_zmin; +} + +void Dipole::setRMax(double rmax) +{ + m_rmax = rmax; +} + +double Dipole::getRMax() +{ + return m_rmax; +} + +void Dipole::addCoeff(double coeff) +{ + m_coeffs.push_back(coeff); +} + +const std::vector<double>& Dipole::getCoeffs() +{ + return m_coeffs; +} + +void Dipole::setFieldUnit(double unit) +{ + m_funit = unit; +} + +double Dipole::getFieldUnit() +{ + return m_funit; +} + +void Dipole::setLengthUnit(double unit) +{ + m_lunit = unit; +} + +double Dipole::getLengthUnit() +{ + return m_lunit; +}
diff -N FieldManager.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ FieldManager.cc 1 Jul 2013 21:00:44 -0000 1.1 @@ -0,0 +1,95 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/FieldManager.cc,v 1.1 2013/07/01 21:00:44 jeremy Exp $ + +// LCDD +#include "lcdd/bfield/FieldManager.hh" +#include "lcdd/core/LCDDProcessor.hh" + +FieldManager* FieldManager::m_instance = 0; + +FieldManager::~FieldManager() +{ +} + +FieldManager* FieldManager::instance() +{ + if (m_instance == 0) { + m_instance = new FieldManager(); + } + return m_instance; +} + +MagneticFieldOverlay* FieldManager::makeOverlay(std::vector<G4MagneticField*> fields) +{ + MagneticFieldOverlay* overlay = new MagneticFieldOverlay(); + for (std::vector<G4MagneticField*>::const_iterator iter = fields.begin(); iter != fields.end(); iter++) { + overlay->addMagneticField(*iter); + } + return overlay; +} + +void FieldManager::setup() +{ + // Pointer to the field which will be passed to Geant4. + G4MagneticField* field = 0; + + // Setup only the global fields specified in global_field. + if (m_globalfields.size() != 0) { + // Use specific list of global fields registered with LCDDFieldManager. + field = setup(m_globalfields); + } + // No global fields, so treat all fields registered with LCDDProcessor + // as global. + else { + + // Build a list of fields that were registered with the LCDDProcessor. + std::vector<G4MagneticField*> fields; + LCDDProcessor* proc = LCDDProcessor::instance(); + for (LCDDProcessor::MagneticFields::const_iterator iter = proc->getMagneticFieldsBegin(); iter != proc->getMagneticFieldsEnd(); iter++) { + fields.push_back(iter->second); + } + + // Setup fields from LCDDProcessor. + field = setup(fields); + } + + // Initialize the single or overlay field with Geant4. + initialize(field); +} + +G4MagneticField* FieldManager::setup(std::vector<G4MagneticField*> fields) +{ + G4MagneticField* field = 0; + //if (fields.size() == 0) { + // G4cerr << "LCDDFieldManager - No magnetic fields to setup." << G4endl; + //} + //else if (fields.size() == 1) { + // field = fields[0]; + //} + //else { + field = makeOverlay(fields); + //} + return field; +} + +void FieldManager::initialize(G4MagneticField* field) +{ + if (field != 0) { + G4FieldManager* fieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager(); + fieldMgr->SetDetectorField(field); + fieldMgr->CreateChordFinder(field); + } +} + +void FieldManager::addGlobalField(G4MagneticField* f) +{ + m_globalfields.push_back(f); +} + +void FieldManager::addField(G4MagneticField* f) +{ + m_allfields.push_back(f); +} + +FieldManager::FieldManager() +{ +}
diff -N RZFieldMap.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ RZFieldMap.cc 1 Jul 2013 21:00:44 -0000 1.1 @@ -0,0 +1,273 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/RZFieldMap.cc,v 1.1 2013/07/01 21:00:44 jeremy Exp $ + +// LCDD +#include "lcdd/bfield/RZFieldMap.hh" + +// Geant4 +#include "globals.hh" + +// STL +#include <cmath> + +// Set this preprocessor symbol for lots of debugging output. +//#define FIELD_MAP_DEBUG 1 + +#ifdef FIELD_MAP_DEBUG +#include <iostream> +using std::cout; +using std::endl; +#endif + +RZFieldMap::RZFieldMap(int numBinsR, int numBinsZ, double gridSizeR, double gridSizeZ, std::vector<RZBData> fieldData) : + m_numBinsR(numBinsR), m_numBinsZ(numBinsZ), m_gridSizeR(gridSizeR), m_gridSizeZ(gridSizeZ), m_BrArray(0), m_BzArray(0) +{ + +#ifdef FIELD_MAP_DEBUG + cout << "numBinsR=" << numBinsR << endl; + cout << "numBinsZ=" << numBinsZ << endl; + cout << "gridSizeR=" << gridSizeR << endl; + cout << "gridSizeZ=" << gridSizeZ << endl; +#endif + + if (numBinsR < 2) { + G4Exception("", "", FatalException, "numBinsR must be >= 2"); + } + + if (numBinsZ < 2) { + G4Exception("", "", FatalException, "numBinsZ must be >= 2"); + } + + if (gridSizeR <= 0) { + G4Exception("", "", FatalException, "gridSizeR must be >= 0"); + } + + if (gridSizeZ <= 0) { + G4Exception("", "", FatalException, "gridSizeZ must be >= 0"); + } + + m_maxR = (numBinsR - 1) * m_gridSizeR; + m_maxZ = (numBinsZ - 1) * m_gridSizeZ; + + initializeArrays(); + fillArrays(fieldData); +} + +void RZFieldMap::initializeArrays() +{ + // Make two 2D arrays of numBinsZ x numBinsR + m_BrArray = new double*[m_numBinsZ]; + m_BzArray = new double*[m_numBinsZ]; + + for (int i = 0; i < m_numBinsZ; i++) { + m_BrArray[i] = new double[m_numBinsR]; + m_BzArray[i] = new double[m_numBinsR]; + } + + // Initialize arrays to all 0's. + for (int i = 0; i < m_numBinsZ; i++) { + for (int j = 0; j < m_numBinsR; j++) { + m_BrArray[i][j] = 0; + m_BzArray[i][j] = 0; + } + } +} + +void RZFieldMap::fillArrays(std::vector<RZBData> fieldData) +{ + for (std::vector<RZBData>::iterator iter = fieldData.begin(); iter != fieldData.end(); iter++) { + RZBData rzb = *iter; + + int iz = (int) ((rzb.z() + 0.0001) / m_gridSizeZ); + int ir = (int) ((rzb.r() + 0.0001) / m_gridSizeR); + + m_BzArray[iz][ir] = rzb.Bz(); + m_BrArray[iz][ir] = rzb.Br(); + +#ifdef FIELD_MAP_DEBUG + cout << "ir iz = " << ir << " " << iz << endl; + cout << "Br Bz = " << m_BrArray[iz][ir] << " " << m_BzArray[iz][ir] << endl; + cout << endl; +#endif + } +} + +RZFieldMap::~RZFieldMap() +{ + deleteArrays(); +} + +void RZFieldMap::deleteArrays() +{ + for (int i = 0; i < m_numBinsZ; i++) { + delete[] m_BrArray[i]; + delete[] m_BzArray[i]; + } + delete[] m_BrArray; + delete[] m_BzArray; +} + +/** + * Compute B field at given point using the arrays of Br and Bz field strengths. + * + * This function is based on Takashi's FORTRAN code at + * + * /afs/slac/www/accel/nlc/local/systems/beamdelivery/geant/SDNEW/solenoid.f + * + * via the RZBFieldProvider.cpp test code provided by Norman. + * + */ +void RZFieldMap::GetFieldValue(const double Point[3], double *Bfield) const +{ +#ifdef FIELD_MAP_DEBUG + cout << "Point = " << Point[0] << " " << Point[1] << " " << Point[2] << endl; +#endif + + double r = sqrt((Point[0] * Point[0]) + (Point[1] * Point[1])); + double z = Point[2]; + + double hz = 0; + double hr = 0; + + // Check for z or r out of range. + if (fabs(z) >= m_maxZ || r >= m_maxR) { +#ifdef FIELD_MAP_DEBUG + cout << "OUT OF RANGE: z r = " << fabs(z) << " " << r << endl; + cout << "MAX: maxZ maxR " << m_maxZ << " " << m_maxR << endl; +#endif + return; + } + + // Compute z bin. + int iz = (int) ((fabs(z) + 0.001) / m_gridSizeZ); + + // Compute r bin. + int ir = (int) ((r + 0.001) / m_gridSizeR); + + // Adjust for iz out of range. +// int izfar = 0; +// if( iz >= m_numBinsZ-1 ) { +// izfar = 1; +// iz = m_numBinsZ - 1; +// } + +// Check for iz < 0. + if (iz < 0) { +#ifdef FIELD_MAP_DEBUG + cout << "ERROR: iz < 0" << endl; + cout << "iz=" << iz << endl; + cout << "returning" << endl; +#endif + } + +// Check for Z overflow on iz+1. + if (iz + 1 >= m_numBinsZ) { +#ifdef FIELD_MAP_DEBUG + cout << "ERROR: iz overflow" << endl; + cout << "iz=" << iz << endl; + cout << "returning" << endl; +#endif + return; + } + + // Check for R overflow on ir+1. + if (ir + 1 >= m_numBinsR) { +#ifdef FIELD_MAP_DEBUG + cout << "ERROR: ir overflow" << endl; + cout << "ir=" << ir << endl; + cout << "returning" << endl; +#endif + return; + } + +#ifdef FIELD_MAP_DEBUG + cout << "dz " << m_gridSizeZ << " dr " << m_gridSizeR << endl; + cout << "z " << z << " r " << r << endl; + cout << "iz " << iz << " ir " << ir << endl; +#endif + + double bz0 = m_BzArray[iz][ir]; + double br0 = m_BrArray[iz][ir]; + +#ifdef FIELD_MAP_DEBUG + cout << "bz0 " << bz0 << " br0 " << br0 << endl; +#endif + + double delz = 0.; + double delr = 0.; + + double brdz = 0.; + double brdr = 0.; + + if (r > 0.0) { + delr = r - float(ir) * m_gridSizeR; + +#ifdef FIELD_MAP_DEBUG + if ( iz+1 == m_gridSizeZ-1 ) { + cout << "WARNING: iz+1 == gridSizeZ-1" << endl; + } + + if ( ir+1 == m_gridSizeR-1 ) { + cout << "WARNING: ir+1 == gridSizeR-1" << endl; + } +#endif + +#ifdef FIELD_MAP_DEBUG + cout << "checking brarray access ..." << endl; + cout << "iz+1=" << iz+1 << endl; + cout << "ir=" << ir << endl; + cout << m_BrArray[iz+1][ir] << endl; + cout << "m_BrArray[iz+1][ir] is ok" << endl; + cout << "iz=" << iz << endl; + cout << "ir+1=" << ir+1 << endl; + cout << m_BrArray[iz][ir+1] << endl; + cout << "m_BrArray[iz][ir+1] is ok" << endl; + cout << "done" << endl; +#endif + + brdz = (m_BrArray[iz + 1][ir] - br0) / m_gridSizeZ; + brdr = (m_BrArray[iz][ir + 1] - br0) / m_gridSizeR; +#ifdef FIELD_MAP_DEBUG + cout << "br= " << m_BrArray[iz+1][ir] << " " << m_BrArray[iz][ir+1] << endl; +#endif + } + + delz = fabs(z) - float(iz) * m_gridSizeZ; + +#ifdef FIELD_MAP_DEBUG + cout << " z " << z << " abs(z) " << fabs(z) << " iz " << iz << endl; + cout << " float(iz-1) " << float(iz-1) << " dz " << m_gridSizeZ << endl; + cout << " delz " << delz << endl; +#endif + + double bzdz = (m_BzArray[iz + 1][ir] - bz0) / m_gridSizeZ; + double bzdr = (m_BzArray[iz][ir + 1] - bz0) / m_gridSizeR; + +#ifdef FIELD_MAP_DEBUG + cout << "bz= " << m_BzArray[iz+1][ir] << " " << m_BzArray[iz][ir+1] << endl; +#endif + +// if(izfar==1) { +// hz = bz0+bzdr*delr; +// hr = br0+brdr*delr; +// } +// else { + hz = bz0 + bzdz * delz + bzdr * delr; + hr = br0 + brdz * delz + brdr * delr; +// } + + if (z < 0.0) + hr = -hr; + + double theta = atan2(Point[1], Point[0]); + double hx = hr * cos(theta); + double hy = hr * sin(theta); + + Bfield[0] += hx; + Bfield[1] += hy; + Bfield[2] += hz; + +#ifdef FIELD_MAP_DEBUG + cout << "Bfield XYZ = " << Bfield[0] << " " << Bfield[1] << " " << Bfield[2] << endl; + cout << endl; +#endif +}
diff -N Solenoid.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Solenoid.cc 1 Jul 2013 21:00:44 -0000 1.1 @@ -0,0 +1,49 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/Solenoid.cc,v 1.1 2013/07/01 21:00:44 jeremy Exp $ + +// LCDD +#include "lcdd/bfield/Solenoid.hh" + +// Geant4 +#include "globals.hh" + +Solenoid::Solenoid() : + _innerField(0), _outerField(0), _innerR(0), _outerR(0), _innerZ(0), _outerZ(0) +{ +} + +Solenoid::~Solenoid() +{ +} + +/** + * Apply simple solenoid magnetic field to the given Point. + */ +// TODO: use inner/outer Z +void Solenoid::GetFieldValue(const double Point[3], double* Bfield) const +{ + //std::cout << "G4Solenoid::GetFieldValue" << std::endl; + //std::cout << "point: " << Point[0] << " " << Point[1] << " " << Point[2] << std::endl; + //std::cout << "BEFORE --> bfield " << Bfield[0] << " " << Bfield[1] << " " << Bfield[2] << std::endl; + + double this_radius = sqrt(Point[0] * Point[0] + Point[1] * Point[1]); + + if (this_radius < _innerR) { + Bfield[2] += _innerField; + } else if (this_radius < _outerR) { + Bfield[2] += _outerField; + } + + //std::cout << "AFTER --> bfield = " << Bfield[0] << " " << Bfield[1] << " " << Bfield[2] << std::endl << std::endl; + + return; +} + +void Solenoid::printOut(std::ostream& os) +{ + os << "innerField <" << _innerField << ">" << std::endl; + os << "outerField <" << _outerField << ">" << std::endl; + os << "outerR <" << _outerR << ">" << std::endl; + os << "innerZ <" << _innerZ << ">" << std::endl; + os << "outerZ <" << _outerZ << ">" << std::endl; + os << std::endl; +}
diff -N G4BoxDipole.cc --- G4BoxDipole.cc 26 Jun 2013 23:50:59 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,32 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/Attic/G4BoxDipole.cc,v 1.1 2013/06/26 23:50:59 jeremy Exp $ - -// LCDD -#include "lcdd/bfield/G4BoxDipole.hh" - -G4BoxDipole::G4BoxDipole(double x, double y, double z, double dx, double dy, double dz, double bx, double by, double bz) : - _x(x), _y(y), _z(z), _dx(dx), _dy(dy), _dz(dz), _bx(bx), _by(by), _bz(bz) -{ - _maxx = x + dx; - _maxy = y + dy; - _maxz = z + dz; - - _minx = x - dx; - _miny = y - dy; - _minz = z - dz; -} - -void G4BoxDipole::GetFieldValue(const double point[3], double* bfield) const -{ - if (point[0] < _minx || point[0] > _maxx) - return; - if (point[1] < _miny || point[1] > _maxy) - return; - if (point[2] < _minz || point[2] > _maxz) - return; - - bfield[0] += _bx; - bfield[1] += _by; - bfield[2] += _bz; - - //std::cout << point[0] << ", " << point[1] << ", " << point[2] << " --> " << bfield[0] << ", " << bfield[1] << ", " << bfield[2] << std::endl; -}
diff -N G4Dipole.cc --- G4Dipole.cc 26 Jun 2013 23:50:59 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,114 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/Attic/G4Dipole.cc,v 1.1 2013/06/26 23:50:59 jeremy Exp $ - -// LCDD -#include "lcdd/bfield/G4Dipole.hh" - -// STL -#include <iostream> -#include <cmath> - -/** - * Apply polynomial fit of dipole field, with variable number of coefficients - * read from the input XML file. - */ -void G4Dipole::GetFieldValue(const double Point[3], double* Bfield) const -{ - //std::cout << "G4Dipole::GetFieldValue" << std::endl; - - //std::cout << "point = " << Point[0] << " " << Point[1] << " " << Point[2] << std::endl; - //std::cout << "BEFORE --> bfield = " << Bfield[0] << " " << Bfield[1] << " " << Bfield[2] << std::endl; - - double bx = 0; - double z = Point[2]; - double r = sqrt(Point[0] * Point[0] + Point[1] * Point[1]); - - // Check if z coordinate is within dipole z bounds. - if (z > m_zmin && z < m_zmax && r < m_rmax) { - - // Convert to absolute value z and apply specified length unit. - double zc = fabs(z) / m_lunit; - - //std::cout << "zc = " << zc << std::endl; - - // Apply all coefficients to this z coordinate. - for (size_t i = 0; i < m_coeffs.size(); ++i) { - bx += m_coeffs[i] * pow(zc, i); - } - - // Convert to specified field unit. - bx *= m_funit; - - // Flip sign for negative z. - if (z < 0) { - bx = -bx; - } - - // Add Bx to the input Bfield. - Bfield[0] += bx; - } - - //std::cout << "AFTER --> bfield = " << Bfield[0] << " " << Bfield[1] << " " << Bfield[2] << std::endl << std::endl; - //std::cout << Point[2] << " " << Bfield[0] << std::endl; - - return; -} - -void G4Dipole::setZMax(double zmax) -{ - m_zmax = zmax; -} - -double G4Dipole::getZMax() -{ - return m_zmax; -} - -void G4Dipole::setZMin(double zmin) -{ - m_zmin = zmin; -} - -double G4Dipole::getZMin() -{ - return m_zmin; -} - -void G4Dipole::setRMax(double rmax) -{ - m_rmax = rmax; -} - -double G4Dipole::getRMax() -{ - return m_rmax; -} - -void G4Dipole::addCoeff(double coeff) -{ - m_coeffs.push_back(coeff); -} - -const std::vector<double>& G4Dipole::getCoeffs() -{ - return m_coeffs; -} - -void G4Dipole::setFieldUnit(double unit) -{ - m_funit = unit; -} - -double G4Dipole::getFieldUnit() -{ - return m_funit; -} - -void G4Dipole::setLengthUnit(double unit) -{ - m_lunit = unit; -} - -double G4Dipole::getLengthUnit() -{ - return m_lunit; -}
diff -N G4RZFieldMap.cc --- G4RZFieldMap.cc 26 Jun 2013 23:50:59 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,275 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/Attic/G4RZFieldMap.cc,v 1.1 2013/06/26 23:50:59 jeremy Exp $ - -// LCDD -#include "lcdd/bfield/G4RZFieldMap.hh" - -// Geant4 -#include "globals.hh" - -// STL -#include <cmath> - -// Set this preprocessor symbol for lots of debugging output. -//#define FIELD_MAP_DEBUG 1 - -#ifdef FIELD_MAP_DEBUG -#include <iostream> -using std::cout; -using std::endl; -#endif - -G4RZFieldMap::G4RZFieldMap(int numBinsR, int numBinsZ, double gridSizeR, double gridSizeZ, std::vector<RZBData> fieldData) : - m_numBinsR(numBinsR), m_numBinsZ(numBinsZ), m_gridSizeR(gridSizeR), m_gridSizeZ(gridSizeZ), m_BrArray(0), m_BzArray(0) -{ - -#ifdef FIELD_MAP_DEBUG - cout << "numBinsR=" << numBinsR << endl; - cout << "numBinsZ=" << numBinsZ << endl; - cout << "gridSizeR=" << gridSizeR << endl; - cout << "gridSizeZ=" << gridSizeZ << endl; -#endif - - if (numBinsR < 2) { - G4Exception("", "", FatalException, "numBinsR must be >= 2"); - } - - if (numBinsZ < 2) { - G4Exception("", "", FatalException, "numBinsZ must be >= 2"); - } - - if (gridSizeR <= 0) { - G4Exception("", "", FatalException, "gridSizeR must be >= 0"); - } - - if (gridSizeZ <= 0) { - G4Exception("", "", FatalException, "gridSizeZ must be >= 0"); - } - - m_maxR = (numBinsR - 1) * m_gridSizeR; - m_maxZ = (numBinsZ - 1) * m_gridSizeZ; - - initializeArrays(); - fillArrays(fieldData); -} - -void G4RZFieldMap::initializeArrays() -{ - // Make two 2D arrays of numBinsZ x numBinsR - m_BrArray = new double*[m_numBinsZ]; - m_BzArray = new double*[m_numBinsZ]; - - for (int i = 0; i < m_numBinsZ; i++) { - m_BrArray[i] = new double[m_numBinsR]; - m_BzArray[i] = new double[m_numBinsR]; - } - - // Initialize arrays to all 0's. - for (int i = 0; i < m_numBinsZ; i++) { - for (int j = 0; j < m_numBinsR; j++) { - m_BrArray[i][j] = 0; - m_BzArray[i][j] = 0; - } - } -} - -void G4RZFieldMap::fillArrays(std::vector<RZBData> fieldData) -{ - for (std::vector<RZBData>::iterator iter = fieldData.begin(); iter != fieldData.end(); iter++) { - RZBData rzb = *iter; - - int iz = (int) ((rzb.z() + 0.0001) / m_gridSizeZ); - iz = iz; - int ir = (int) ((rzb.r() + 0.0001) / m_gridSizeR); - ir = ir; - - m_BzArray[iz][ir] = rzb.Bz(); - m_BrArray[iz][ir] = rzb.Br(); - -#ifdef FIELD_MAP_DEBUG - cout << "ir iz = " << ir << " " << iz << endl; - cout << "Br Bz = " << m_BrArray[iz][ir] << " " << m_BzArray[iz][ir] << endl; - cout << endl; -#endif - } -} - -G4RZFieldMap::~G4RZFieldMap() -{ - deleteArrays(); -} - -void G4RZFieldMap::deleteArrays() -{ - for (int i = 0; i < m_numBinsZ; i++) { - delete[] m_BrArray[i]; - delete[] m_BzArray[i]; - } - delete[] m_BrArray; - delete[] m_BzArray; -} - -/** - * Compute B field at given point using the arrays of Br and Bz field strengths. - * - * This function is based on Takashi's FORTRAN code at - * - * /afs/slac/www/accel/nlc/local/systems/beamdelivery/geant/SDNEW/solenoid.f - * - * via the RZBFieldProvider.cpp test code provided by Norman. - * - */ -void G4RZFieldMap::GetFieldValue(const double Point[3], double *Bfield) const -{ -#ifdef FIELD_MAP_DEBUG - cout << "Point = " << Point[0] << " " << Point[1] << " " << Point[2] << endl; -#endif - - double r = sqrt((Point[0] * Point[0]) + (Point[1] * Point[1])); - double z = Point[2]; - - double hz = 0; - double hr = 0; - - // Check for z or r out of range. - if (fabs(z) >= m_maxZ || r >= m_maxR) { -#ifdef FIELD_MAP_DEBUG - cout << "OUT OF RANGE: z r = " << fabs(z) << " " << r << endl; - cout << "MAX: maxZ maxR " << m_maxZ << " " << m_maxR << endl; -#endif - return; - } - - // Compute z bin. - int iz = (int) ((fabs(z) + 0.001) / m_gridSizeZ); - - // Compute r bin. - int ir = (int) ((r + 0.001) / m_gridSizeR); - - // Adjust for iz out of range. -// int izfar = 0; -// if( iz >= m_numBinsZ-1 ) { -// izfar = 1; -// iz = m_numBinsZ - 1; -// } - -// Check for iz < 0. - if (iz < 0) { -#ifdef FIELD_MAP_DEBUG - cout << "ERROR: iz < 0" << endl; - cout << "iz=" << iz << endl; - cout << "returning" << endl; -#endif - } - -// Check for Z overflow on iz+1. - if (iz + 1 >= m_numBinsZ) { -#ifdef FIELD_MAP_DEBUG - cout << "ERROR: iz overflow" << endl; - cout << "iz=" << iz << endl; - cout << "returning" << endl; -#endif - return; - } - - // Check for R overflow on ir+1. - if (ir + 1 >= m_numBinsR) { -#ifdef FIELD_MAP_DEBUG - cout << "ERROR: ir overflow" << endl; - cout << "ir=" << ir << endl; - cout << "returning" << endl; -#endif - return; - } - -#ifdef FIELD_MAP_DEBUG - cout << "dz " << m_gridSizeZ << " dr " << m_gridSizeR << endl; - cout << "z " << z << " r " << r << endl; - cout << "iz " << iz << " ir " << ir << endl; -#endif - - double bz0 = m_BzArray[iz][ir]; - double br0 = m_BrArray[iz][ir]; - -#ifdef FIELD_MAP_DEBUG - cout << "bz0 " << bz0 << " br0 " << br0 << endl; -#endif - - double delz = 0.; - double delr = 0.; - - double brdz = 0.; - double brdr = 0.; - - if (r > 0.0) { - delr = r - float(ir) * m_gridSizeR; - -#ifdef FIELD_MAP_DEBUG - if ( iz+1 == m_gridSizeZ-1 ) { - cout << "WARNING: iz+1 == gridSizeZ-1" << endl; - } - - if ( ir+1 == m_gridSizeR-1 ) { - cout << "WARNING: ir+1 == gridSizeR-1" << endl; - } -#endif - -#ifdef FIELD_MAP_DEBUG - cout << "checking brarray access ..." << endl; - cout << "iz+1=" << iz+1 << endl; - cout << "ir=" << ir << endl; - cout << m_BrArray[iz+1][ir] << endl; - cout << "m_BrArray[iz+1][ir] is ok" << endl; - cout << "iz=" << iz << endl; - cout << "ir+1=" << ir+1 << endl; - cout << m_BrArray[iz][ir+1] << endl; - cout << "m_BrArray[iz][ir+1] is ok" << endl; - cout << "done" << endl; -#endif - - brdz = (m_BrArray[iz + 1][ir] - br0) / m_gridSizeZ; - brdr = (m_BrArray[iz][ir + 1] - br0) / m_gridSizeR; -#ifdef FIELD_MAP_DEBUG - cout << "br= " << m_BrArray[iz+1][ir] << " " << m_BrArray[iz][ir+1] << endl; -#endif - } - - delz = fabs(z) - float(iz) * m_gridSizeZ; - -#ifdef FIELD_MAP_DEBUG - cout << " z " << z << " abs(z) " << fabs(z) << " iz " << iz << endl; - cout << " float(iz-1) " << float(iz-1) << " dz " << m_gridSizeZ << endl; - cout << " delz " << delz << endl; -#endif - - double bzdz = (m_BzArray[iz + 1][ir] - bz0) / m_gridSizeZ; - double bzdr = (m_BzArray[iz][ir + 1] - bz0) / m_gridSizeR; - -#ifdef FIELD_MAP_DEBUG - cout << "bz= " << m_BzArray[iz+1][ir] << " " << m_BzArray[iz][ir+1] << endl; -#endif - -// if(izfar==1) { -// hz = bz0+bzdr*delr; -// hr = br0+brdr*delr; -// } -// else { - hz = bz0 + bzdz * delz + bzdr * delr; - hr = br0 + brdz * delz + brdr * delr; -// } - - if (z < 0.0) - hr = -hr; - - double theta = atan2(Point[1], Point[0]); - double hx = hr * cos(theta); - double hy = hr * sin(theta); - - Bfield[0] += hx; - Bfield[1] += hy; - Bfield[2] += hz; - -#ifdef FIELD_MAP_DEBUG - cout << "Bfield XYZ = " << Bfield[0] << " " << Bfield[1] << " " << Bfield[2] << endl; - cout << endl; -#endif -}
diff -N G4Solenoid.cc --- G4Solenoid.cc 26 Jun 2013 23:50:59 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,49 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/Attic/G4Solenoid.cc,v 1.1 2013/06/26 23:50:59 jeremy Exp $ - -// LCDD -#include "lcdd/bfield/G4Solenoid.hh" - -// Geant4 -#include "globals.hh" - -G4Solenoid::G4Solenoid() : - _innerField(0), _outerField(0), _innerR(0), _outerR(0), _innerZ(0), _outerZ(0) -{ -} - -G4Solenoid::~G4Solenoid() -{ -} - -/** - * Apply simple solenoid magnetic field to the given Point. - */ -// TODO: use inner/outer Z -void G4Solenoid::GetFieldValue(const double Point[3], double* Bfield) const -{ - //std::cout << "G4Solenoid::GetFieldValue" << std::endl; - //std::cout << "point: " << Point[0] << " " << Point[1] << " " << Point[2] << std::endl; - //std::cout << "BEFORE --> bfield " << Bfield[0] << " " << Bfield[1] << " " << Bfield[2] << std::endl; - - double this_radius = sqrt(Point[0] * Point[0] + Point[1] * Point[1]); - - if (this_radius < _innerR) { - Bfield[2] += _innerField; - } else if (this_radius < _outerR) { - Bfield[2] += _outerField; - } - - //std::cout << "AFTER --> bfield = " << Bfield[0] << " " << Bfield[1] << " " << Bfield[2] << std::endl << std::endl; - - return; -} - -void G4Solenoid::printOut(std::ostream& os) -{ - os << "innerField <" << _innerField << ">" << std::endl; - os << "outerField <" << _outerField << ">" << std::endl; - os << "outerR <" << _outerR << ">" << std::endl; - os << "innerZ <" << _innerZ << ">" << std::endl; - os << "outerZ <" << _outerZ << ">" << std::endl; - os << std::endl; -}
diff -N LCDDFieldManager.cc --- LCDDFieldManager.cc 26 Jun 2013 23:50:59 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,95 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/bfield/Attic/LCDDFieldManager.cc,v 1.1 2013/06/26 23:50:59 jeremy Exp $ - -// LCDD -#include "lcdd/bfield/LCDDFieldManager.hh" -#include "lcdd/core/LCDDProcessor.hh" - -LCDDFieldManager* LCDDFieldManager::m_instance = 0; - -LCDDFieldManager::~LCDDFieldManager() -{ -} - -LCDDFieldManager* LCDDFieldManager::instance() -{ - if (m_instance == 0) { - m_instance = new LCDDFieldManager(); - } - return m_instance; -} - -MagneticFieldOverlay* LCDDFieldManager::makeOverlay(std::vector<G4MagneticField*> fields) -{ - MagneticFieldOverlay* overlay = new MagneticFieldOverlay(); - for (std::vector<G4MagneticField*>::const_iterator iter = fields.begin(); iter != fields.end(); iter++) { - overlay->addMagneticField(*iter); - } - return overlay; -} - -void LCDDFieldManager::setup() -{ - // Pointer to the field which will be passed to Geant4. - G4MagneticField* field = 0; - - // Setup only the global fields specified in global_field. - if (m_globalfields.size() != 0) { - // Use specific list of global fields registered with LCDDFieldManager. - field = setup(m_globalfields); - } - // No global fields, so treat all fields registered with LCDDProcessor - // as global. - else { - - // Build a list of fields that were registered with the LCDDProcessor. - std::vector<G4MagneticField*> fields; - LCDDProcessor* proc = LCDDProcessor::instance(); - for (LCDDProcessor::MagneticFields::const_iterator iter = proc->getMagneticFieldsBegin(); iter != proc->getMagneticFieldsEnd(); iter++) { - fields.push_back(iter->second); - } - - // Setup fields from LCDDProcessor. - field = setup(fields); - } - - // Initialize the single or overlay field with Geant4. - initialize(field); -} - -G4MagneticField* LCDDFieldManager::setup(std::vector<G4MagneticField*> fields) -{ - G4MagneticField* field = 0; - //if (fields.size() == 0) { - // G4cerr << "LCDDFieldManager - No magnetic fields to setup." << G4endl; - //} - //else if (fields.size() == 1) { - // field = fields[0]; - //} - //else { - field = makeOverlay(fields); - //} - return field; -} - -void LCDDFieldManager::initialize(G4MagneticField* field) -{ - if (field != 0) { - G4FieldManager* fieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager(); - fieldMgr->SetDetectorField(field); - fieldMgr->CreateChordFinder(field); - } -} - -void LCDDFieldManager::addGlobalField(G4MagneticField* f) -{ - m_globalfields.push_back(f); -} - -void LCDDFieldManager::addField(G4MagneticField* f) -{ - m_allfields.push_back(f); -} - -LCDDFieldManager::LCDDFieldManager() -{ -}
diff -u -r1.1 -r1.2 --- GeometryManager.cc 26 Jun 2013 23:50:59 -0000 1.1 +++ GeometryManager.cc 1 Jul 2013 21:00:44 -0000 1.2 @@ -1,11 +1,11 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/core/GeometryManager.cc,v 1.1 2013/06/26 23:50:59 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/core/GeometryManager.cc,v 1.2 2013/07/01 21:00:44 jeremy Exp $
// LCDD #include "lcdd/core/GeometryManager.hh" // LCDD
-#include "lcdd/geant4/G4UserRegionInformation.hh" -#include "lcdd/core/G4StoreManager.hh"
+#include "lcdd/geant4/UserRegionInformation.hh" +//#include "lcdd/core/G4StoreManager.hh"
// GDML #include "G4Processor/GDMLProcessor.h"
@@ -24,7 +24,7 @@
GeometryManager::GeometryManager() : m_worldRegionIsSetup(false) {
- G4StoreManager::instance();
+ //G4StoreManager::instance();
} GeometryManager::~GeometryManager()
@@ -65,7 +65,7 @@
assert(worldLV);
- G4UserRegionInformation* regInfo = new G4UserRegionInformation();
+ UserRegionInformation* regInfo = new UserRegionInformation();
regInfo->setStoreSecondaries(false); regInfo->setThreshold(0.0);
diff -u -r1.1 -r1.2 --- LCDDParser.cc 26 Jun 2013 23:50:59 -0000 1.1 +++ LCDDParser.cc 1 Jul 2013 21:00:44 -0000 1.2 @@ -1,8 +1,8 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/core/LCDDParser.cc,v 1.1 2013/06/26 23:50:59 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/core/LCDDParser.cc,v 1.2 2013/07/01 21:00:44 jeremy Exp $
// LCDD #include "lcdd/core/LCDDParser.hh"
-#include "lcdd/bfield/LCDDFieldManager.hh"
+#include "lcdd/bfield/FieldManager.hh"
#include "lcdd/subscribers/volumeExtendedSubscriber.hh" // GDML
@@ -99,7 +99,7 @@
} // Setup magnetic field.
- LCDDFieldManager::instance()->setup();
+ FieldManager::instance()->setup();
// This method should only be called once. m_constructed = true;
diff -u -r1.1 -r1.2 --- LCDDProcessor.cc 26 Jun 2013 23:50:59 -0000 1.1 +++ LCDDProcessor.cc 1 Jul 2013 21:00:44 -0000 1.2 @@ -1,8 +1,8 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/core/LCDDProcessor.cc,v 1.1 2013/06/26 23:50:59 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/core/LCDDProcessor.cc,v 1.2 2013/07/01 21:00:44 jeremy Exp $
// LCDD #include "lcdd/core/LCDDProcessor.hh"
-#include "lcdd/bfield/LCDDFieldManager.hh"
+#include "lcdd/bfield/FieldManager.hh"
#include "lcdd/bfield/MagneticFieldOverlay.hh" // Geant4
@@ -36,18 +36,18 @@
return sInstance; }
-void LCDDProcessor::addSensitiveDetector(std::string& name, G4SensitiveDetector* sd)
+void LCDDProcessor::addSensitiveDetector(std::string& name, SensitiveDetector* sd)
{ //std::cout << "adding SD: " << name << std::endl; m_sensitiveDetectors[name] = sd; }
-G4SensitiveDetector* LCDDProcessor::getSensitiveDetector(const std::string& name)
+SensitiveDetector* LCDDProcessor::getSensitiveDetector(const std::string& name)
{ return m_sensitiveDetectors[name]; }
-G4SensitiveDetector* LCDDProcessor::getSensitiveDetector(const char* name)
+SensitiveDetector* LCDDProcessor::getSensitiveDetector(const char* name)
{ std::string key = name; return getSensitiveDetector(key);
@@ -70,7 +70,7 @@
void LCDDProcessor::addGlobalField(G4MagneticField* mag) {
- LCDDFieldManager::instance()->addGlobalField(mag);
+ FieldManager::instance()->addGlobalField(mag);
} G4MagneticField* LCDDProcessor::getMagneticField(const std::string& name)
@@ -146,17 +146,17 @@
return m_visAttributes.end(); }
-void LCDDProcessor::addLimitSet(std::string& name, G4LimitSet* lim)
+void LCDDProcessor::addLimitSet(std::string& name, PhysicsLimitSet* lim)
{ m_limitSets[name] = lim; }
-G4LimitSet* LCDDProcessor::getLimitSet(const std::string& name)
+PhysicsLimitSet* LCDDProcessor::getLimitSet(const std::string& name)
{ return m_limitSets[name]; }
-G4LimitSet* LCDDProcessor::getLimitSet(const char* name)
+PhysicsLimitSet* LCDDProcessor::getLimitSet(const char* name)
{ std::string key = name; return getLimitSet(key);
diff -N G4StoreManager.cc --- G4StoreManager.cc 26 Jun 2013 23:50:59 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,31 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/core/Attic/G4StoreManager.cc,v 1.1 2013/06/26 23:50:59 jeremy Exp $ - -// LCDD -#include "lcdd/core/G4StoreManager.hh" - -// Geant4 -#include "G4UIdirectory.hh" - -G4StoreManager *G4StoreManager::_instance = 0; - -G4StoreManager::G4StoreManager() -{ - G4UIdirectory* m_storesDir; - m_storesDir = new G4UIdirectory("/stores/"); - m_storesDir->SetGuidance("Commands to inspect the Geant4 object stores. [LCDD]"); -} - -G4StoreManager::~G4StoreManager() -{ -} - -G4StoreManager* G4StoreManager::instance() -{ - static G4StoreManager mgr; - - if (!_instance) { - _instance = &mgr; - } - - return _instance; -}
diff -N CalorimeterSD.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ CalorimeterSD.cc 1 Jul 2013 21:00:44 -0000 1.1 @@ -0,0 +1,278 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/CalorimeterSD.cc,v 1.1 2013/07/01 21:00:44 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/CalorimeterSD.hh" +#include "lcdd/detectors/Segmentation.hh" +#include "lcdd/detectors/ReadoutUtil.hh" +#include "lcdd/detectors/PositionComparator.hh" +#include "lcdd/hits/HitContribution.hh" +#include "lcdd/id/IdFactory.hh" +#include "lcdd/id/IdManager.hh" + +// Geant4 +#include "G4Track.hh" +#include "G4StepPoint.hh" +#include "G4Timer.hh" +#include "G4Geantino.hh" + +// STL +#include <iostream> +#include <string> +#include <vector> + +using std::vector; + +CalorimeterSD::CalorimeterSD(G4String sdName, G4String hcName, Segmentation* sdSeg, HitComparator* compare) : + SensitiveDetector(sdName, hcName, SensitiveDetector::eCalorimeter), m_segmentation(sdSeg) +{ + m_hitsCollections.push_back(m_collection); + m_hits.clear(); + hits_vector.clear(); + hits_vector.push_back(m_hits); + if (compare == 0) + m_hitCompare = new PositionComparator(); + else + m_hitCompare = compare; +} + +CalorimeterSD::CalorimeterSD(G4String sdName, const vector<G4String>& hcNames, Segmentation* sdSeg, HitComparator* compare) : + SensitiveDetector(sdName, hcNames, SensitiveDetector::eCalorimeter), m_segmentation(sdSeg) +{ + m_hits.clear(); + hits_vector.clear(); + hits_vector.push_back(m_hits); + for (int i = 0; i < (int) hcNames.size(); i++) { + hits_vector.push_back(m_hits); + hits_vector[i].clear(); + m_hitsCollections.push_back(m_collection); + } + + if (compare == 0) { + m_hitCompare = new PositionComparator(); + } else { + m_hitCompare = compare; + } +} + +CalorimeterSD::~CalorimeterSD() +{ +} + +bool CalorimeterSD::isValidVolume(G4LogicalVolume* lv) +{ + bool valid = SensitiveDetector::isValidVolume(lv); + + if (valid && m_segmentation != 0) { + valid = m_segmentation->isValidSolid(lv->GetSolid()); + } + + return valid; +} + +void CalorimeterSD::Initialize(G4HCofThisEvent *HCE) +{ + clearHits(); + + // new cal hits collection + for (int i = 0; i < getNumberOfHitsCollections(); i++) { + m_hitsCollections[i] = new G4CalorimeterHitsCollection(GetName(), collectionName[i]); + + // set HCID + if (getHCID(i) < 0) { + setHCID(GetCollectionID(i), i); + } + + // add collection to HC of event + HCE->AddHitsCollection(getHCID(i), m_hitsCollections[i]); + } +} + +Segmentation* CalorimeterSD::getSegmentation() const +{ + return m_segmentation; +} + +G4bool CalorimeterSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) +{ +#ifdef G4VERBOSE + if (getVerbose() > 0) + { + std::cout << "G4CalorimeterSD::ProcessHits - " << this->GetName() << std::endl; + } +#endif + + // set cached step + SensitiveDetector::ProcessHits(aStep, 0); + + // get the edep + G4double theEdep = edep(); + + // This needs to be a <= comparison for cutting on 0, + // Geantinos, which always have 0 edep, are allowed. + 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 segmentation. + G4ThreeVector globalCellPos = m_segmentation->getGlobalHitPos(aStep); + + // Reset the segmentation bin values. + m_segmentation->resetBins(); + + // Set the segmentation bin values from the step. + m_segmentation->setBins(aStep); + + // Create a 64-bit ID. + 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 + CalorimeterHit* thisHit = new CalorimeterHit(theEdep, globalCellPos); + thisHit->setId64bit(id64.getId0(), id64.getId1()); + CalorimeterHit* fndHit = 0; + + // hit is not found? + if (!(fndHit = findHit(thisHit))) { + +#ifdef G4VERBOSE + if (getVerbose() > 1) { + std::cout << "G4CalorimeterSD::ProcessHits - new hit" << std::endl; + } +#endif + // add it to lkp map + hits_vector[0].push_back(thisHit); + + // add to the HC + m_hitsCollections[0]->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(HitContribution(aStep)); + + return true; +} + +CalorimeterHit* CalorimeterSD::findHit(CalorimeterHit* aHit) const +{ + CalorimeterHit* fndHit = 0; + for (G4CalorimeterHitList::const_iterator iter = hits_vector[0].begin(); iter != hits_vector[0].end(); iter++) { + if (m_hitCompare->compare(**iter, *aHit)) { + fndHit = *iter; + break; + } + } + return fndHit; +} + +CalorimeterHit* CalorimeterSD::findHit(CalorimeterHit* aHit, G4int nHC) const +{ + CalorimeterHit* fndHit = 0; + for (G4CalorimeterHitList::const_iterator iter = hits_vector[nHC].begin(); iter != hits_vector[nHC].end(); iter++) { + if (m_hitCompare->compare(**iter, *aHit)) { + fndHit = *iter; + break; + } + } + return fndHit; +} + +std::ostream& CalorimeterSD::printHits(std::ostream& os) +{ + for (int i = 0; i < getNumberOfHitsCollections(); i++) { + os << getHitsCollection(i)->GetName() << std::endl; + for (G4CalorimeterHitList::const_iterator iter = hits_vector[i].begin(); iter != hits_vector[i].end(); iter++) { + os << " " << **iter; + } + } + os << std::endl; + return os; +} + +void CalorimeterSD::EndOfEvent(G4HCofThisEvent *) +{ +#ifdef G4VERBOSE + if ( getVerbose() > 1 ) { + printHits( std::cout ); + } +#endif +} + +std::ostream& CalorimeterSD::printBasicInfo(std::ostream& os) +{ + SensitiveDetector::printBasicInfo(os); + os << "segmentation type: " << m_segmentation->getTypeString() << std::endl; + os << "segmentation bins:"; + for (std::vector<std::string>::const_iterator it = m_segmentation->getBinNames().begin(); it != m_segmentation->getBinNames().end(); it++) { + os << " " << *it; + } + os << std::endl; + return os; +} + +double CalorimeterSD::getEdep() const +{ + double edep = 0.0; + for (G4CalorimeterHitList::const_iterator it = hits_vector[0].begin(); it != hits_vector[0].end(); it++) { + edep += (*it)->getEdep(); + } + return edep; +} + +double CalorimeterSD::getEdep(G4int nHC) const +{ + double edep = 0.0; + for (G4CalorimeterHitList::const_iterator it = hits_vector[nHC].begin(); it != hits_vector[nHC].end(); it++) { + edep += (*it)->getEdep(); + } + return edep; +} + +void CalorimeterSD::clearHits() +{ + for (int i = 0; i < getNumberOfHitsCollections(); i++) { + hits_vector[i].clear(); + } +} + +CalorimeterSD::G4CalorimeterHitList CalorimeterSD::getCalorimeterHitList() +{ + return hits_vector[0]; +} + +CalorimeterSD::G4CalorimeterHitList CalorimeterSD::getCalorimeterHitList(G4int nHC) +{ + return hits_vector[nHC]; +} +
diff -N GlobalGridXYSegmentation.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ GlobalGridXYSegmentation.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,71 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/GlobalGridXYSegmentation.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/GlobalGridXYSegmentation.hh" +#include "lcdd/detectors/ReadoutUtil.hh" + +// Geant4 +#include "G4NavigationHistory.hh" + +GlobalGridXYSegmentation::GlobalGridXYSegmentation(double gridSizeX, double gridSizeY) : + Segmentation(Segmentation::eNonprojective), m_gridSizeX(gridSizeX), m_gridSizeY(gridSizeY) +{ + setBinNames(); +} + +GlobalGridXYSegmentation::~GlobalGridXYSegmentation() +{ +} + +G4ThreeVector GlobalGridXYSegmentation::getGlobalHitPos(const G4Step* aStep) +{ + // Compute the midpoint of the global step. + G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); + + // Create 3vec for cell position. + G4ThreeVector globalCellPos; + + // Set binned coordinates of cell position. + globalCellPos.setX(computeDimX(computeBinX(globalStepPos))); + globalCellPos.setY(computeDimY(computeBinY(globalStepPos))); + + // Set Z coordinate of cell position from the volume's Z center position. + G4ThreeVector vpos = ReadoutUtil::getVolumeGlobalPosition(aStep->GetPreStepPoint()); + globalCellPos.setZ(vpos.z()); + + return globalCellPos; +} + +void GlobalGridXYSegmentation::setBins(const G4Step* aStep) +{ + // Compute the midpoint of the step. + G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); + + // Compute the bin values. + int binX = computeBinX(globalStepPos); + int binY = computeBinY(globalStepPos); + + // Set the bin values. + setBin(0, binX); + setBin(1, binY); +} + +int GlobalGridXYSegmentation::computeBinX(const G4ThreeVector& stepPos) +{ + return Segmentation::computeBin(stepPos.x(), m_gridSizeX); +} + +int GlobalGridXYSegmentation::computeBinY(const G4ThreeVector& stepPos) +{ + return Segmentation::computeBin(stepPos.y(), m_gridSizeY); +} + +double GlobalGridXYSegmentation::computeDimX(int bin) +{ + return Segmentation::computeDim(bin, m_gridSizeX); +} + +double GlobalGridXYSegmentation::computeDimY(int bin) +{ + return Segmentation::computeDim(bin, m_gridSizeY); +}
diff -N GridXYZSegmentation.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ GridXYZSegmentation.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,144 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/GridXYZSegmentation.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/GridXYZSegmentation.hh" +#include "lcdd/detectors/ReadoutUtil.hh" + +// Geant4 +#include "G4NavigationHistory.hh" + +GridXYZSegmentation::GridXYZSegmentation(double gridSizeX, double gridSizeY, double gridSizeZ) : + Segmentation(Segmentation::eNonprojective), m_gridSizeX(gridSizeX), m_gridSizeY(gridSizeY), m_gridSizeZ(gridSizeZ) +{ + setBinNames(); +} + +GridXYZSegmentation::~GridXYZSegmentation() +{ +} + +G4ThreeVector GridXYZSegmentation::getGlobalHitPos(const G4Step* aStep) +{ + // compute midpoint + G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); + + // figure local step pos using touchable and global midpoint + G4ThreeVector localStepPos = ReadoutUtil::transformGlobalToLocal(aStep, globalStepPos); + + // local cell pos + G4ThreeVector localCellPos = this->getLocalHitPos(localStepPos); + + // global cell pos + G4ThreeVector globalCellPos = ReadoutUtil::transformLocalToGlobal(aStep, localCellPos); + + return globalCellPos; +} + +void GridXYZSegmentation::setBins(const G4Step* aStep) +{ + // Compute the midpoint of the step. + G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); + + // Transform from global coordinate system to local coordinate system of volume pointed to by this step. + G4ThreeVector localStepPos = ReadoutUtil::transformGlobalToLocal(aStep, globalStepPos); + + // Compute the bin values. + int binX = computeBinX(localStepPos); + int binY = computeBinY(localStepPos); + int binZ = computeBinZ(localStepPos); + + // Set the bins. + int idx = 0; + + setBin(idx, binX); + ++idx; + + setBin(idx, binY); + ++idx; + + setBin(idx, binZ); + ++idx; +} + +int GridXYZSegmentation::computeBinX(const G4ThreeVector& localStepPos) +{ + int ret; + if (m_gridSizeX != 0) { + ret = Segmentation::computeBin(localStepPos.x(), m_gridSizeX); + } else { + ret = 0; + } + return ret; +} + +int GridXYZSegmentation::computeBinY(const G4ThreeVector& localStepPos) +{ + int ret; + if (m_gridSizeY != 0) { + ret = Segmentation::computeBin(localStepPos.y(), m_gridSizeY); + } else { + ret = 0; + } + return ret; +} + +int GridXYZSegmentation::computeBinZ(const G4ThreeVector& localStepPos) +{ + int ret; + if (m_gridSizeZ != 0) { + ret = Segmentation::computeBin(localStepPos.z(), m_gridSizeZ); + } else { + ret = 0; + } + return ret; +} + +double GridXYZSegmentation::computeDimX(int bin) +{ + return Segmentation::computeDim(bin, m_gridSizeX); +} + +double GridXYZSegmentation::computeDimY(int bin) +{ + return Segmentation::computeDim(bin, m_gridSizeY); +} + +double GridXYZSegmentation::computeDimZ(int bin) +{ + return Segmentation::computeDim(bin, m_gridSizeZ); +} + +G4ThreeVector GridXYZSegmentation::getGlobalHitPosPreStep(const G4StepPoint* aPreStepPoint) +{ + G4ThreeVector globalStepPos = aPreStepPoint->GetPosition(); + + // Figure out local step pos using touchable and global midpoint. + G4ThreeVector localStepPos = ReadoutUtil::transformGlobalToLocal(aPreStepPoint, globalStepPos); + + // Compute local cell pos. + G4ThreeVector localCellPos = this->getLocalHitPos(localStepPos); + + // Compute global cell pos. + G4ThreeVector globalCellPos = ReadoutUtil::transformLocalToGlobal(aPreStepPoint, localCellPos); + + return globalCellPos; +} + +G4ThreeVector GridXYZSegmentation::getLocalHitPos(const G4ThreeVector& localStepPos) +{ + G4ThreeVector localHitPos; + + if (m_gridSizeX > 0) { + localHitPos.setX(computeDimX(computeBinX(localStepPos))); + } + + if (m_gridSizeY > 0) { + localHitPos.setY(computeDimY(computeBinY(localStepPos))); + } + + if (m_gridSizeZ > 0) { + localHitPos.setZ(computeDimZ(computeBinZ(localStepPos))); + } + + return localHitPos; +}
diff -N NonprojectiveCylinderSegmentation.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ NonprojectiveCylinderSegmentation.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,260 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/NonprojectiveCylinderSegmentation.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/NonprojectiveCylinderSegmentation.hh" +#include "lcdd/detectors/ReadoutUtil.hh" + +// Geant4 +#include "G4Tubs.hh" + +// STL +#include <cmath> + +NonprojectiveCylinderSegmentation::NonprojectiveCylinderSegmentation(double gridSizePhi, double gridSizeZ) : + Segmentation(Segmentation::eNonprojective), m_gridSizePhi(gridSizePhi), m_gridSizeZ(gridSizeZ) + +{ + setBinNames(); +} + +NonprojectiveCylinderSegmentation::~NonprojectiveCylinderSegmentation() +{ +} + +G4ThreeVector NonprojectiveCylinderSegmentation::getGlobalHitPos(const G4Step* aStep) +{ + // local cell pos + G4ThreeVector localCellPos = getLocalHitPos(aStep); + + // global cell pos + G4ThreeVector globalCellPos = ReadoutUtil::transformLocalToGlobal(aStep, localCellPos); + + // DEBUG: print local, global cell pos + //G4cout << "localCellPos " << localCellPos << G4endl; + //G4cout << "globalCellPos " << globalCellPos << G4endl; + // + + return localCellPos; +} +G4ThreeVector NonprojectiveCylinderSegmentation::getGlobalHitPos(const G4StepPoint* aPreStepPoint) +{ + // local cell pos + G4ThreeVector localCellPos = getLocalHitPos(aPreStepPoint); + + // global cell pos + G4ThreeVector globalCellPos = ReadoutUtil::transformLocalToGlobal(aPreStepPoint, localCellPos); + + // DEBUG: print local, global cell pos + //G4cout << "localCellPos " << localCellPos << G4endl; + //G4cout << "globalCellPos " << globalCellPos << G4endl; + // + + return localCellPos; +} +G4ThreeVector NonprojectiveCylinderSegmentation::getLocalHitPos(const G4Step* aStep) +{ + G4ThreeVector globalMidPos = ReadoutUtil::computeMidPos(aStep); + + // retrieve G4Tubs + const G4Tubs* tubs = ReadoutUtil::getTubs(aStep); + + assert(tubs); + + // rcyl of cell = mid rad of current tubs + double rcyl = ReadoutUtil::computeTubsMidRadius(tubs); + + // compute single delta phi in degrees + double deltaPhi = computeDeltaPhi(aStep); + + // phi index + int iphi = computeBinPhi(aStep); + + // z index in local + int iz = computeBinZ(ReadoutUtil::transformGlobalToLocal(aStep, globalMidPos)); + + // compute cell Z, phi + double cellPhi = computeDim(iphi, deltaPhi); + double cellZ = computeDim(iz, m_gridSizeZ); + + // compute X, Y + double cellX = rcyl * cos(cellPhi); + double cellY = rcyl * sin(cellPhi); + + G4ThreeVector cellCenter(cellX, cellY, cellZ); + + // DEBUG: print all + //G4cout << G4endl; + //G4cout << "rcyl <" << rcyl << ">" << G4endl; + //G4cout << "deltaPhi <" << deltaPhi << ">" << G4endl; + //G4cout << "iphi <" << iphi << ">" << G4endl; + //G4cout << "iz <" << iz << ">" << G4endl; + //G4cout << "cellPhi <" << cellPhi << ">" << G4endl; + //G4cout << "cellCenter " << cellCenter << G4endl; + //G4cout << G4endl; + // + + return cellCenter; +} +G4ThreeVector NonprojectiveCylinderSegmentation::getLocalHitPos(const G4StepPoint* aPreStepPoint) +{ + G4ThreeVector globalPos = aPreStepPoint->GetPosition(); + + // retrieve G4Tubs + const G4Tubs* tubs = ReadoutUtil::getTubs(aPreStepPoint); + + assert(tubs); + + // rcyl of cell = mid rad of current tubs + double rcyl = ReadoutUtil::computeTubsMidRadius(tubs); + + // compute single delta phi in degrees + double deltaPhi = computeDeltaPhi(aPreStepPoint); + + // phi index + int iphi = computeBinPhi(aPreStepPoint); + + // z index in local + int iz = computeBinZ(ReadoutUtil::transformGlobalToLocal(aPreStepPoint, globalPos)); + + // compute cell Z, phi + double cellPhi = computeDim(iphi, deltaPhi); + double cellZ = computeDim(iz, m_gridSizeZ); + + // compute X, Y + double cellX = rcyl * cos(cellPhi); + double cellY = rcyl * sin(cellPhi); + + G4ThreeVector cellCenter(cellX, cellY, cellZ); + + // DEBUG: print all + //G4cout << G4endl; + //G4cout << "rcyl <" << rcyl << ">" << G4endl; + //G4cout << "deltaPhi <" << deltaPhi << ">" << G4endl; + //G4cout << "iphi <" << iphi << ">" << G4endl; + //G4cout << "iz <" << iz << ">" << G4endl; + //G4cout << "cellPhi <" << cellPhi << ">" << G4endl; + //G4cout << "cellCenter " << cellCenter << G4endl; + //G4cout << G4endl; + // + + return cellCenter; +} + +double NonprojectiveCylinderSegmentation::computeDeltaPhi(const G4Step* aStep) +{ + // mid radius of current tubs + double mid_rad_layer = ReadoutUtil::computeTubsMidRadius(aStep); + + // circumference of current tubs + double circ = 2.0 * ReadoutUtil::PI * mid_rad_layer; + + // number of cells along phi in curr layer + int nphi = (int) floor(circ / m_gridSizePhi); + + // single phi division in degrees + double deltaPhi = (360.0 * deg) / nphi; + + return deltaPhi; +} +double NonprojectiveCylinderSegmentation::computeDeltaPhi(const G4StepPoint* aPreStepPoint) +{ + // mid radius of current tubs + double mid_rad_layer = ReadoutUtil::computeTubsMidRadius(aPreStepPoint); + + // circumference of current tubs + double circ = 2.0 * ReadoutUtil::PI * mid_rad_layer; + + // number of cells along phi in curr layer + int nphi = (int) floor(circ / m_gridSizePhi); + + // single phi division in degrees + double deltaPhi = (360.0 * deg) / nphi; + + return deltaPhi; +} +void NonprojectiveCylinderSegmentation::setBins(const G4Step* aStep) +{ + //G4cout << "G4NonprojectiveCylinderSegmentation::setBins()" << G4endl; + + G4ThreeVector globalMidPos = ReadoutUtil::computeMidPos(aStep); + + int bphi = computeBinPhi(aStep); + int bz = computeBinZ(globalMidPos); + + setBin(0, bphi); + setBin(1, bz); +} +void NonprojectiveCylinderSegmentation::setBins(const G4StepPoint* aPreStepPoint) +{ + //G4cout << "G4NonprojectiveCylinderSegmentation::setBins()" << G4endl; + + G4ThreeVector globalPos = aPreStepPoint->GetPosition(); + + int bphi = computeBinPhi(aPreStepPoint); + int bz = computeBinZ(globalPos); + + setBin(0, bphi); + setBin(1, bz); +} +int NonprojectiveCylinderSegmentation::computeBinPhi(const G4Step* aStep) +{ + G4ThreeVector globalMidPos = ReadoutUtil::computeMidPos(aStep); + + const G4Tubs* tubs = ReadoutUtil::getTubs(aStep); + assert(tubs); + + // compute single delta phi in degrees + double deltaPhi = computeDeltaPhi(aStep); + + // step phi + double stepPhi = globalMidPos.phi(); + + if (stepPhi < 0) { + stepPhi += 2.0 * ReadoutUtil::PI; + } + + // phi index + return computeBin(stepPhi, deltaPhi / radian); +} + +int NonprojectiveCylinderSegmentation::computeBinPhi(const G4StepPoint* aPreStepPoint) +{ + G4ThreeVector globalPos = aPreStepPoint->GetPosition(); + + const G4Tubs* tubs = ReadoutUtil::getTubs(aPreStepPoint); + assert(tubs); + + // compute single delta phi in degrees + double deltaPhi = computeDeltaPhi(aPreStepPoint); + + // step phi + double stepPhi = globalPos.phi(); + + if (stepPhi < 0) { + stepPhi += 2.0 * ReadoutUtil::PI; + } + + // phi index + return computeBin(stepPhi, deltaPhi / radian); +} + +int NonprojectiveCylinderSegmentation::computeBinZ(const G4ThreeVector& localStepPos) +{ + //G4cout << "localStepPos.z() <" << localStepPos.z() << ">" << G4endl; + //G4cout << "m_gridSizeZ <" << m_gridSizeZ << ">" << G4endl; + + return computeBin(localStepPos.z(), m_gridSizeZ); +} + +bool NonprojectiveCylinderSegmentation::isValidSolid(G4VSolid* s) +{ + bool valid = Segmentation::isValidSolid(s); + + if (valid) { + if (s->GetEntityType() != "G4Tubs") { + valid = false; + } + } + + return valid; +}
diff -N OpticalCalorimeter.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ OpticalCalorimeter.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,116 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/OpticalCalorimeter.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/OpticalCalorimeterSD.hh" +#include "lcdd/detectors/Segmentation.hh" +#include "lcdd/detectors/Cerenkov.hh" + +// Geant4 +#include "G4OpticalPhoton.hh" +#include "G4TransportationManager.hh" +#include "G4VProcess.hh" +#include "G4Poisson.hh" + +using std::vector; + +/** + * Constructor for the case only one Hit Collection is given. + * In this case the only the energy deposited by aborbed Cerenkov + * photons is stored. Probably this will be dropped in the + * near future. + */ +OpticalCalorimeterSD::OpticalCalorimeterSD(G4String sdName, G4String hcName, Segmentation* sdSeg, HitComparator* compare) : + CalorimeterSD(sdName, hcName, sdSeg, compare) +{ + CerenGenerator = 0; +} + +/** + * Constructor for multiple Hit Collections. + * + * The current implementation uses the first Hit Collection for the + * Cerenkov Photons and the second Collection to store the ionization losses. + * If more than 2 collections are given the additional Hit collections will + * be ignored. + */ +OpticalCalorimeterSD::OpticalCalorimeterSD(G4String sdName, const vector<G4String>& hcNames, Segmentation* sdSeg, HitComparator* compare) : + CalorimeterSD(sdName, hcNames, sdSeg, compare) +{ + CerenGenerator = 0; +} + +OpticalCalorimeterSD::~OpticalCalorimeterSD() +{ +} + +G4bool OpticalCalorimeterSD::ProcessHits(G4Step* aStep, G4TouchableHistory* tahis) +{ + if (!CerenGenerator) + CerenGenerator = new Cerenkov(); + G4int NCerenPhotons = 0; + G4Track* theTrack = aStep->GetTrack(); + const G4double charge = theTrack->GetDefinition()->GetPDGCharge(); + G4StepPoint* pPreStepPoint = aStep->GetPreStepPoint(); + G4StepPoint* pPostStepPoint = aStep->GetPostStepPoint(); + G4double beta = 0.5 * (pPreStepPoint->GetBeta() + pPostStepPoint->GetBeta()); + const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable(); + G4String thematerial = touch->GetVolume()->GetLogicalVolume()->GetMaterial()->GetName(); + G4double MeanNumberOfPhotons = CerenGenerator->GetAverageNumberOfPhotons(charge, beta, thematerial); + if (MeanNumberOfPhotons > 0.0) { + G4double step_length = aStep->GetStepLength(); + MeanNumberOfPhotons = MeanNumberOfPhotons * step_length; + NCerenPhotons = (G4int) G4Poisson(MeanNumberOfPhotons); + } else { + NCerenPhotons = 0; + } + + if (NCerenPhotons <= 0) { + return CalorimeterSD::ProcessHits(aStep, tahis); + } else { + SensitiveDetector::ProcessHits(aStep, 0); + G4ThreeVector myPoint = aStep->GetPreStepPoint()->GetPosition(); + G4StepPoint* apreStepPoint = aStep->GetPreStepPoint(); + G4Navigator* theNavigator = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking(); + G4VPhysicalVolume* myVolume = theNavigator->LocateGlobalPointAndSetup(myPoint); + if (getVerbose() > 2) { + G4cout << "Physical volume = " << myVolume->GetName() << G4endl; + G4cout << "Point of interaction = " << myPoint<< G4endl; + G4cout << "sdname " << GetName() << " hcname " <<collectionName[0]<< G4endl; + } + // total photon energy + // G4double theEdep = aTrack->GetTotalEnergy(); + G4double theEdep = double(NCerenPhotons); + // get global cell pos from seg + G4ThreeVector globalCellPos = m_segmentation->getGlobalHitPosPreStep(apreStepPoint); + // reset the seg bins + m_segmentation->resetBins(); + // set the seg bins + m_segmentation->setBins(aStep); + // create id and pack into 64 + Id64bit id64 = makeId(); + // find hit by simple lkp of new hit with above info + CalorimeterHit* thisHit = new CalorimeterHit(theEdep, globalCellPos); + thisHit->setId64bit(id64.getId0(), id64.getId1()); + CalorimeterHit* fndHit = 0; + // hit is not found? + if (!(fndHit = findHit(thisHit, eCerenkov))) { + // add it to lkp map + hits_vector[eCerenkov].push_back(thisHit); + // add to the HC + m_hitsCollections[eCerenkov]->insert(thisHit); + } else { + // found a hit + // 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(HitContribution(aStep)); + // aTrack->SetTrackStatus(fStopAndKill); // don't step photon any further + return true; + } // end Cerenkov photon treatment +}
diff -N ProjectiveCylinderSegmentation.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ProjectiveCylinderSegmentation.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,68 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/ProjectiveCylinderSegmentation.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/ProjectiveCylinderSegmentation.hh" +#include "lcdd/detectors/ReadoutUtil.hh" + +// Geant4 +#include "G4StepPoint.hh" +#include "G4NavigationHistory.hh" +#include "G4VPhysicalVolume.hh" +#include "G4LogicalVolume.hh" +#include "G4Tubs.hh" + +ProjectiveCylinderSegmentation::ProjectiveCylinderSegmentation(G4int ntheta, G4int nphi) : + ProjectiveSegmentation(ntheta, nphi) +{ +} + +ProjectiveCylinderSegmentation::~ProjectiveCylinderSegmentation() +{ +} + +double ProjectiveCylinderSegmentation::getRadius(const G4Step* aStep) +{ + return ReadoutUtil::computeTubsMidRadius(ReadoutUtil::getTubs(aStep)); +} +double ProjectiveCylinderSegmentation::getRadius(const G4StepPoint* aPreStepPoint) +{ + return ReadoutUtil::computeTubsMidRadius(ReadoutUtil::getTubs(aPreStepPoint)); +} +double ProjectiveCylinderSegmentation::getZ(const G4Step* aStep) +{ + double rcyl = getRadius(aStep); + + double ctheta = getThetaDim(aStep); + + // ctheta in 0 to pi ... + // ctheta < pi/2 should be negative + + double zcell = rcyl / tan(ctheta); + + return zcell; +} +double ProjectiveCylinderSegmentation::getZ(const G4StepPoint* aPreStepPoint) +{ + double rcyl = getRadius(aPreStepPoint); + + double ctheta = getThetaDim(aPreStepPoint); + + // ctheta in 0 to pi ... + // ctheta < pi/2 should be negative + + double zcell = rcyl / tan(ctheta); + + return zcell; +} +bool ProjectiveCylinderSegmentation::isValidSolid(G4VSolid* s) +{ + bool valid = Segmentation::isValidSolid(s); + + if (valid) { + if (s->GetEntityType() != "G4Tubs") { + valid = false; + } + } + + return valid; +}
diff -N ProjectiveSegmentation.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ProjectiveSegmentation.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,238 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/ProjectiveSegmentation.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/ProjectiveSegmentation.hh" +#include "lcdd/detectors/ReadoutUtil.hh" + +// Geant4 +#include "G4StepPoint.hh" +#include "G4NavigationHistory.hh" +#include "G4VPhysicalVolume.hh" +#include "G4LogicalVolume.hh" +#include "G4Tubs.hh" + +ProjectiveSegmentation::ProjectiveSegmentation(G4int ntheta, G4int nphi) : + Segmentation(Segmentation::eProjective), m_ntheta(ntheta), m_nphi(nphi) +{ + //G4cout << "G4ProjectiveSegmentation" << G4endl; + //G4cout << "ntheta, nphi: " << ntheta << ", " << nphi << G4endl; + + computeDivisions(); + + setBinNames(); +} + +ProjectiveSegmentation::~ProjectiveSegmentation() +{ +} + +G4ThreeVector ProjectiveSegmentation::getGlobalHitPos(const G4Step* aStep) +{ + // DEBUG + //G4cout << "G4ProjectiveSegmentation::getGlobalHitPos()" << G4endl; + // + + // divide entire theta, phi range into bins; bins always positive + // theta, phi coord of step midpoint + // compute bin numbers + // get dim from bins + + // get radius, z components (probably from subclass function) + double rcyl = getRadius(aStep); + double zcell = getZ(aStep); + + // get phi component + double cphi = getPhiDim(aStep); + + // compute x, y cells + double xcell = rcyl * cos(cphi); + double ycell = rcyl * sin(cphi); + + G4ThreeVector pos(xcell, ycell, zcell); + + //G4ThreeVector midPos = ReadoutUtil::computeMidPos( aStep ); + + // DEBUG: print all + //G4cout << "sphi <" << midPos.phi() << ">" << G4endl; + //G4cout << "cphi <" << cphi << ">" << G4endl; + //G4cout << "sphi - cphi = " << midPos.phi() - cphi << G4endl; + + //G4cout << "stheta <" << midPos.theta() << ">" << G4endl; + //G4cout << "ctheta <" << getThetaDim( aStep ) << ">" << G4endl; + //G4cout << "stheta - ctheta = " << midPos.theta() - getThetaDim( aStep ) << G4endl; + + //G4cout << "rcyl <" << rcyl << ">" << G4endl; + //G4cout << "zcell <" << zcell << ">" << G4endl; + //G4cout << "globalCellPos <" << pos << ">" << G4endl; + // + + return pos; +} +G4ThreeVector ProjectiveSegmentation::getGlobalHitPos(const G4StepPoint* aPreStepPoint) +{ + // DEBUG + //G4cout << "G4ProjectiveSegmentation::getGlobalHitPos()" << G4endl; + // + + // divide entire theta, phi range into bins; bins always positive + // theta, phi coord of step midpoint + // compute bin numbers + // get dim from bins + + // get radius, z components (probably from subclass function) + double rcyl = getRadius(aPreStepPoint); + double zcell = getZ(aPreStepPoint); + + // get phi component + double cphi = getPhiDim(aPreStepPoint); + + // compute x, y cells + double xcell = rcyl * cos(cphi); + double ycell = rcyl * sin(cphi); + + G4ThreeVector pos(xcell, ycell, zcell); + + //G4ThreeVector midPos = ReadoutUtil::computeMidPos( aStep ); + + // DEBUG: print all + //G4cout << "sphi <" << midPos.phi() << ">" << G4endl; + //G4cout << "cphi <" << cphi << ">" << G4endl; + //G4cout << "sphi - cphi = " << midPos.phi() - cphi << G4endl; + + //G4cout << "stheta <" << midPos.theta() << ">" << G4endl; + //G4cout << "ctheta <" << getThetaDim( aStep ) << ">" << G4endl; + //G4cout << "stheta - ctheta = " << midPos.theta() - getThetaDim( aStep ) << G4endl; + + //G4cout << "rcyl <" << rcyl << ">" << G4endl; + //G4cout << "zcell <" << zcell << ">" << G4endl; + //G4cout << "globalCellPos <" << pos << ">" << G4endl; + // + + return pos; +} +void ProjectiveSegmentation::setBins(const G4Step* aStep) +{ + G4ThreeVector globalMidPos = ReadoutUtil::computeMidPos(aStep); + + setBin(0, getThetaBin(globalMidPos)); + setBin(1, getPhiBin(globalMidPos)); +} + +void ProjectiveSegmentation::setBins(const G4StepPoint* aPreStepPoint) +{ + G4ThreeVector globalPos = aPreStepPoint->GetPosition(); + + setBin(0, getThetaBin(globalPos)); + setBin(1, getPhiBin(globalPos)); +} + +G4int ProjectiveSegmentation::getNtheta() const +{ + return m_ntheta; +} + +G4int ProjectiveSegmentation::getNphi() const +{ + return m_nphi; +} + +void ProjectiveSegmentation::computeDivisions() +{ + m_divTheta = (180.0 * deg) / m_ntheta; + m_divPhi = (360.0 * deg) / m_nphi; +} + +int ProjectiveSegmentation::getThetaBin(const G4ThreeVector& globalStepPos) +{ + // theta needs to be in range 0 - PI + return Segmentation::computeBin(globalStepPos.theta(), m_divTheta / radian); +} + +int ProjectiveSegmentation::getPhiBin(const G4ThreeVector& globalStepPos) +{ + + // adjust phi for < 0 + double sphi = globalStepPos.phi(); + + if (sphi < 0.0) { + sphi += 360.0 * deg; + } + + // needs more checks, for phi in range 0 - TWOPI + // if > TWOPI, then subtract TWOPI + // + // OR use X, Y for phi calc + + // compute and return bin + return Segmentation::computeBin(sphi, m_divPhi / radian); +} + +// default impl. returns mag of pos +double ProjectiveSegmentation::getRadius(const G4Step* aStep) +{ + //G4cout << "G4ProjectiveSegmentation::getRadius()" << G4endl; + + return ReadoutUtil::computeMidPos(aStep).mag(); +} +double ProjectiveSegmentation::getRadius(const G4StepPoint* aPreStepPoint) +{ + //G4cout << "G4ProjectiveSegmentation::getRadius()" << G4endl; + return aPreStepPoint->GetPosition().mag(); +} + +// default impl. returns z of pos +double ProjectiveSegmentation::getZ(const G4Step* aStep) +{ + //G4cout << "G4ProjectiveSegmentation::getZ()" << G4endl; + return ReadoutUtil::computeMidPos(aStep).z(); +} + +double ProjectiveSegmentation::getZ(const G4StepPoint* aPreStepPoint) +{ + //G4cout << "G4ProjectiveSegmentation::getZ()" << G4endl; + return aPreStepPoint->GetPosition().z(); +} + +double ProjectiveSegmentation::getThetaDim(const int &thetaBin) const +{ + return Segmentation::computeDim(thetaBin, m_divTheta); +} + +double ProjectiveSegmentation::getPhiDim(const int &phiBin) const +{ + return Segmentation::computeDim(phiBin, m_divPhi); +} + +double ProjectiveSegmentation::getThetaDim(const G4Step* aStep) +{ + //G4cout << "G4ProjectiveSegmentation::getThetaDim(G4Step*)" << G4endl; + G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); + double ctheta = getThetaDim(getThetaBin(globalStepPos)); + return ctheta; +} + +double ProjectiveSegmentation::getThetaDim(const G4StepPoint* aPreStepPoint) +{ + //G4cout << "G4ProjectiveSegmentation::getThetaDim(G4Step*)" << G4endl; + G4ThreeVector globalStepPos = aPreStepPoint->GetPosition(); + double ctheta = getThetaDim(getThetaBin(globalStepPos)); + return ctheta; +} + +double ProjectiveSegmentation::getPhiDim(const G4Step* aStep) +{ + //G4cout << "G4ProjectiveSegmentation::getPhiDim(G4Step*)" << G4endl; + + G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); + double cphi = getPhiDim(getPhiBin(globalStepPos)); + return cphi; +} +double ProjectiveSegmentation::getPhiDim(const G4StepPoint* aPreStepPoint) +{ + //G4cout << "G4ProjectiveSegmentation::getPhiDim(G4Step*)" << G4endl; + + G4ThreeVector globalStepPos = aPreStepPoint->GetPosition(); + double cphi = getPhiDim(getPhiBin(globalStepPos)); + return cphi; +} +
diff -N ProjectiveZPlaneSegmentation.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ProjectiveZPlaneSegmentation.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,41 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/ProjectiveZPlaneSegmentation.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/ProjectiveZPlaneSegmentation.hh" +#include "lcdd/detectors/ReadoutUtil.hh" + +ProjectiveZPlaneSegmentation::ProjectiveZPlaneSegmentation(G4int ntheta, G4int nphi) : + ProjectiveSegmentation(ntheta, nphi) +{ +} + +ProjectiveZPlaneSegmentation::~ProjectiveZPlaneSegmentation() +{ +} + +double ProjectiveZPlaneSegmentation::getRadius(const G4Step* aStep) +{ + double zcell = getZ(aStep); + double ctheta = ProjectiveSegmentation::getThetaDim(aStep); + double rcyl = zcell * tan(ctheta); + return rcyl; +} +double ProjectiveZPlaneSegmentation::getRadius(const G4StepPoint* aPreStepPoint) +{ + double zcell = getZ(aPreStepPoint); + double ctheta = ProjectiveSegmentation::getThetaDim(aPreStepPoint); + double rcyl = zcell * tan(ctheta); + return rcyl; +} + +double ProjectiveZPlaneSegmentation::getZ(const G4Step* aStep) +{ + G4ThreeVector gpos = ReadoutUtil::getVolumeGlobalPosition(aStep->GetPreStepPoint(), G4ThreeVector()); + return gpos.z(); +} + +double ProjectiveZPlaneSegmentation::getZ(const G4StepPoint* aPreStepPoint) +{ + G4ThreeVector gpos = ReadoutUtil::getVolumeGlobalPosition(aPreStepPoint, G4ThreeVector()); + return gpos.z(); +}
diff -N ScorerSD.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ScorerSD.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,98 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/ScorerSD.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/ScorerSD.hh" +#include "lcdd/detectors/ReadoutUtil.hh" +#include "lcdd/hits/TrackInformation.hh" + +ScorerSD::ScorerSD(G4String sdName, G4String hcName) : + TrackerSD(sdName, hcName), m_currentTrackID(-1) +{ +} + +G4bool ScorerSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) +{ +#ifdef G4VERBOSE + if ( m_verbose > 1 ) { + std::cout << "G4ScorerSD::ProcessHits() - " << this->GetName() << std::endl; + } +#endif + + SensitiveDetector::ProcessHits(aStep, 0); + + bool sameTrack = false; + +#ifdef G4VERBOSE + if ( m_verbose > 3 ) { + std::cout << "current trackID <" << m_currentTrackID << ">" << std::endl; + } +#endif + + if ((m_currentTrackID == -1) || (m_currentTrackID != trackID())) { + +#ifdef G4VERBOSE + if ( m_verbose > 2 ) { + std::cout << "new track <" << trackID() << ">" << std::endl; + } +#endif + + m_currentTrackID = trackID(); + } else { +#ifdef G4VERBOSE + if ( m_verbose > 2 ) { + std::cout << "old track <" << trackID() << ">" << std::endl; + } +#endif + + sameTrack = true; + } + + if (!sameTrack) { + +#ifdef G4VERBOSE + if ( m_verbose > 2 ) { + std::cout << "writing hit" << std::endl; + } +#endif + + // edep + G4double e = edep(); + + // get track information + TrackInformation* trkInfo = trackInformation(); + + // set hit flag in trk info + trkInfo->setHasTrackerHit(true); + + // hit data + G4int trkID = trackID(); + G4double tdep = globalTime(); + G4ThreeVector prepos = prePosition(); + G4ThreeVector meanmom = meanMomentum(); + + // create hit + TrackerHit* trkHit = new TrackerHit(); + + // create id vector + Id64bit id64 = makeId(); + + // set track hit info + trkHit->setTrackID(trkID); + trkHit->setEdep(e); + trkHit->setPos(prepos); + trkHit->setMomentum(meanmom); + trkHit->setTdep(tdep); + trkHit->setId(id64.getId0()); + trkHit->setLength(ReadoutUtil::computeDistance(aStep)); + + // add to HC + m_HC->insert(trkHit); + } else { +#ifdef G4VERBOSE + if ( m_verbose > 0 ) { + std::cout << "Skipping hit from track <" << m_currentTrackID << ">." << std::endl; + } +#endif + } + return true; +}
diff -N Segmentation.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Segmentation.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,75 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Segmentation.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/Segmentation.hh" +#include "lcdd/detectors/ReadoutUtil.hh" + +Segmentation::Segmentation(EType segType, int nbins) : + m_numBins(nbins), m_type(segType) +{ + // reserve nbins + m_bins.reserve(m_numBins); + + // fill in 0 vals + resetBins(); +} + +Segmentation::~Segmentation() +{ +} + +void Segmentation::setBin(int binIdx, int binVal) +{ + m_bins.insert(m_bins.begin() + binIdx, binVal); +} + +int Segmentation::getNumberOfBins() +{ + return m_numBins; +} + +const std::vector<int>& Segmentation::getBins() +{ + return m_bins; +} + +Segmentation::EType Segmentation::getType() +{ + return m_type; +} + +G4ThreeVector Segmentation::getGlobalHitPos(const G4Step* aStep) +{ + return ReadoutUtil::computeMidPos(aStep); +} + +G4ThreeVector Segmentation::getGlobalHitPosPreStep(const G4StepPoint* aPreStepPoint) +{ + //G4Exception("Do not use this method!"); + return aPreStepPoint->GetPosition(); +} + +void Segmentation::resetBins() +{ + m_bins.clear(); +} + +void Segmentation::printOutBins(std::ostream& os, const std::vector<int>& bins) +{ + os << "segmentationBins <" << bins.size() << "> :: "; + for (std::vector<int>::const_iterator iter = bins.begin(); iter != bins.end(); iter++) { + os << *iter << " "; + } + os << std::endl; +} + +bool Segmentation::isValidSolid(G4VSolid* s) +{ + bool valid = true; + + if (0 == s) { + valid = false; + } + + return valid; +}
diff -N SegmentationFactory.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ SegmentationFactory.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,172 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/SegmentationFactory.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/SegmentationFactory.hh" +#include "lcdd/schema/grid_xyz.hh" +#include "lcdd/schema/global_grid_xy.hh" +#include "lcdd/schema/nonprojective_cylinder.hh" +#include "lcdd/schema/projective_cylinder.hh" +#include "lcdd/schema/projective_zplane.hh" +#include "lcdd/schema/cell_readout_2d.hh" +#include "lcdd/detectors/Segmentation.hh" +#include "lcdd/detectors/GridXYZSegmentation.hh" +#include "lcdd/detectors/GlobalGridXYSegmentation.hh" +#include "lcdd/detectors/ProjectiveCylinderSegmentation.hh" +#include "lcdd/detectors/ProjectiveZPlaneSegmentation.hh" +#include "lcdd/detectors/NonprojectiveCylinderSegmentation.hh" +#include "lcdd/detectors/CellReadout2DSegmentation.hh" + +// GDML +#include "Saxana/SAXObject.h" +#include "G4Processor/GDMLProcessor.h" +#include "G4Evaluator/GDMLExpressionEvaluator.h" + +// STL +#include <iostream> + +Segmentation* SegmentationFactory::createSegmentation(SAXObject* obj, const std::string& tag) +{ + Segmentation* seg = 0; + GDMLExpressionEvaluator* calc = GDMLProcessor::GetInstance()->GetEvaluator(); + + if (tag == "projective_cylinder") { + projective_cylinder* prj = dynamic_cast<projective_cylinder*>(obj); + if (prj) { + int ntheta, nphi; + std::string sval = prj->get_ntheta(); + ntheta = (int) calc->Eval(sval); + sval = prj->get_nphi(); + nphi = (int) calc->Eval(sval); + seg = new ProjectiveCylinderSegmentation(ntheta, nphi); + } else { + std::cerr << "Failed cast to projective_cylinder!" << std::endl; + } + + } else if (tag == "grid_xyz") { + // GridXYZ + grid_xyz* np = dynamic_cast<grid_xyz*>(obj); + if (np) { + double gsx, gsy, gsz; + gsx = gsy = gsz = 0.; + std::string lunit = np->get_lunit(); + + std::string sval = np->get_gridSizeX(); + sval += "*" + lunit; + gsx = calc->Eval(sval); + + sval = np->get_gridSizeY(); + sval += "*" + lunit; + gsy = calc->Eval(sval); + + sval = np->get_gridSizeZ(); + sval += "*" + lunit; + gsz = calc->Eval(sval); + + //std::cout << "grid x, y, z: " << gsx << ", " << gsy << ", " << gsz << std::endl; + + seg = new GridXYZSegmentation(gsx, gsy, gsz); + } else { + std::cerr << "Failed cast to grid_xyz!" << std::endl; + } + } + // GlobalGridXY + else if (tag == "global_grid_xy") { + global_grid_xy* gridxy = dynamic_cast<global_grid_xy*>(obj); + if (gridxy) { + double gsx, gsy; + gsx = gsy = 0.; + std::string lunit = gridxy->get_lunit(); + + std::string sval = gridxy->get_gridSizeX(); + sval += "*" + lunit; + gsx = calc->Eval(sval); + + sval = gridxy->get_gridSizeY(); + sval += "*" + lunit; + gsy = calc->Eval(sval); + + seg = new GlobalGridXYSegmentation(gsx, gsy); + } else { + std::cerr << "Failed cast to global_grid_xy!" << std::endl; + } + } else if (tag == "nonprojective_cylinder") { + // handle NP cylinder + + //std::cout << "add nonprojective_cylinder here" << std::endl; + + nonprojective_cylinder* np = dynamic_cast<nonprojective_cylinder*>(obj); + if (np) { + + double gsp = 0; + double gsz = 0; + + std::string lunit = np->get_lunit(); + + std::string sval = np->get_gridSizePhi(); + sval += "*" + lunit; + gsp = calc->Eval(sval); + + sval = np->get_gridSizeZ(); + sval += "*" + lunit; + gsz = calc->Eval(sval); + + seg = new NonprojectiveCylinderSegmentation(gsp, gsz); + } else { + std::cerr << "Failed cast to nonprojective_cylinder!" << std::endl; + } + } else if (tag == "projective_zplane") { + // handle projective_zplane + + //std::cout << "add projective_zplane here" << std::endl; + + projective_zplane* prj = dynamic_cast<projective_zplane*>(obj); + + if (prj) { + + int ntheta, nphi; + std::string sval = prj->get_ntheta(); + ntheta = (int) calc->Eval(sval); + sval = prj->get_nphi(); + nphi = (int) calc->Eval(sval); + + //std::cout << "ntheta, nphi : " + // << ntheta << ", " + // << nphi << std::endl; + + seg = new ProjectiveZPlaneSegmentation(ntheta, nphi); + } else { + std::cerr << "Failed cast to projective_zplane!" << std::endl; + } // prj no exist + } else if (tag == "cell_readout_2d") { + + //std::cout << "building cell_readout_2d" << std::endl; + + cell_readout_2d* elem = dynamic_cast<cell_readout_2d*>(obj); + if (0 != elem) { + double cellSizeX, cellSizeY; + cellSizeX = cellSizeY = 0; + std::string lengthUnit = elem->getLengthUnit(); + + std::string val = elem->getCellSizeX(); + val += "*" + lengthUnit; + cellSizeX = calc->Eval(val); + + val = elem->getCellSizeY(); + val += "*" + lengthUnit; + cellSizeY = calc->Eval(val); + + //std::cout << "G4SegmentationFactory creating CellReadout2DSegmentation(x,y): " << cellSizeX << " " << cellSizeY << std::endl; + + seg = new CellReadout2DSegmentation(cellSizeX, cellSizeY); + } + } else { + // bad segmentation tag + std::cerr << "Unknown child tag for calorimeter: " << tag << "." << std::endl; + } + + if (seg == 0) { + G4Exception("", "", FatalException, "Failed to create segmentation."); + } + + return seg; +}
diff -N SensitiveDetector.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ SensitiveDetector.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,186 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/SensitiveDetector.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/SensitiveDetector.hh" +#include "lcdd/id/IdManager.hh" +#include "lcdd/id/IdFactory.hh" +#include "lcdd/detectors/SensitiveDetectorMessenger.hh" +#include "lcdd/hits/TrackInformation.hh" + +// Geant4 +#include "G4EventManager.hh" +#include "G4Event.hh" +#include "G4SDManager.hh" +#include "G4UImessenger.hh" +#include "G4VHitsCollection.hh" +#include "G4LogicalVolumeStore.hh" +#include "G4UnitsTable.hh" + +// STL +#include <iostream> +#include <vector> + +using std::vector; + +const std::string& SensitiveDetector::trackerStr = "tracker"; +const std::string& SensitiveDetector::calorimeterStr = "calorimeter"; +const std::string& SensitiveDetector::noneStr = "none"; + +SensitiveDetector::SensitiveDetector(G4String sdName, G4String hcName, EType sdType) : + G4VSensitiveDetector(sdName), m_idspec(0), m_type(sdType) +{ + // insert hits collection name into SD's name vector + collectionName.insert(hcName); + + // register detector with G4SDManager + G4SDManager::GetSDMpointer()->AddNewDetector(this); + + // Create the command messenger. + m_messenger = new SensitiveDetectorMessenger(this); + + // Only one HC + m_hcids.clear(); + m_hcids.push_back(-1); +} + +SensitiveDetector::SensitiveDetector(G4String sdName, const vector<G4String>& hcNames, EType sdType) : + G4VSensitiveDetector(sdName), m_idspec(0), m_type(sdType) +{ + m_hcids.clear(); + + for (int i = 0; i < (int) hcNames.size(); i++) { + // insert hits collection name into SD's name vector + collectionName.insert(hcNames[i]); + m_hcids.push_back(-1); + } + + // register detector with G4SDManager + G4SDManager::GetSDMpointer()->AddNewDetector(this); + + // Create the command messenger. + m_messenger = new SensitiveDetectorMessenger(this); +} + +SensitiveDetector::~SensitiveDetector() +{ +} + +void SensitiveDetector::Initialize(G4HCofThisEvent *) +{ + // no-op +} + +void SensitiveDetector::EndOfEvent(G4HCofThisEvent *) +{ + // no-op +} + +G4bool SensitiveDetector::ProcessHits(G4Step* aStep, G4TouchableHistory*) +{ + // set cached step + setStep(aStep); + + // doesn't write a hit + return false; +} + +const std::string& SensitiveDetector::getTypeString() const +{ + if (m_type == eTracker) { + return trackerStr; + } else if (m_type == eCalorimeter) { + return calorimeterStr; + } + return noneStr; +} + +std::ostream& SensitiveDetector::printBasicInfo(std::ostream& os) +{ + os << "name: " << GetName() << std::endl; + os << "type: " << m_type << std::endl; + os << "hits collection: " << this->getHCName() << std::endl; + os << "hits collection ID: " << m_hcids[0] << std::endl; + os << "energy cut: " << G4BestUnit(m_ecut, "Energy") << std::endl; + os << "endcap flag: " << m_endcap << std::endl; + os << "verbose level: " << m_verbose << std::endl; + + if (m_idspec != 0) { + os << "id spec: " << m_idspec->getName() << std::endl; + os << "id fields:"; + for (IdSpec::IdFields::const_iterator it = m_idspec->IdFieldsBegin(); it != m_idspec->IdFieldsEnd(); it++) { + os << " " << (*it)->getLabel(); + } + os << std::endl; + } else { + os << "idspec points to null!" << std::endl; + } + + return os; +} + +Id64bit SensitiveDetector::makeId() const +{ + Id64bit id64; + if (hasIdSpec()) { + + // get idvec ordered by this idspec + const IdVec ids = IdFactory::createOrderedIdVec(step(), this); + + // pack into 64 bit cell id + id64 = IdFactory::createId64bit(ids, getIdSpec()); + } + return id64; +} + +G4VHitsCollection* SensitiveDetector::getHitsCollection() const +{ + G4VHitsCollection* hc = 0; + if (this->getHCID() != -1) { + hc = G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetHCofThisEvent()->GetHC(this->getHCID()); + } + return hc; +} + +G4VHitsCollection* SensitiveDetector::getHitsCollection(G4int nHC) const +{ + G4VHitsCollection* hc = 0; + if (this->getHCID(nHC) != -1) { + hc = G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetHCofThisEvent()->GetHC(this->getHCID(nHC)); + } + return hc; +} + +std::ostream& SensitiveDetector::printNumberOfHits(std::ostream& os) +{ + for (int i = 0; i < getNumberOfHitsCollections(); i++) { + os << getHitsCollection(i)->GetName() << " " << getHitsCollection(i)->GetSize() << std::endl; + } + return os; +} + +std::ostream& SensitiveDetector::printEdep(std::ostream& os) +{ + os << "total edep: " << G4BestUnit(this->getEdep(), "Energy") << std::endl; + return os; +} + +std::vector<G4LogicalVolume*> SensitiveDetector::getLogicalVolumes() const +{ + std::vector<G4LogicalVolume*> volumes; + for (G4LogicalVolumeStore::const_iterator it = G4LogicalVolumeStore::GetInstance()->begin(); it != G4LogicalVolumeStore::GetInstance()->end(); it++) { + if ((*it)->GetSensitiveDetector() == this) { + volumes.push_back(*it); + } + } + return volumes; +} + +std::ostream& SensitiveDetector::printVolumes(std::ostream& os) +{ + std::vector<G4LogicalVolume*> volumes = this->getLogicalVolumes(); + + for (std::vector<G4LogicalVolume*>::const_iterator it = volumes.begin(); it != volumes.end(); it++) { + std::cout << (*it)->GetName() << std::endl; + } + return os; +}
diff -N TrackerCombineSD.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ TrackerCombineSD.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,260 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/TrackerCombineSD.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/TrackerCombineSD.hh" +#include "lcdd/detectors/ReadoutUtil.hh" +#include "lcdd/hits/TrackInformation.hh" + +TrackerCombineSD::TrackerCombineSD(G4String sdName, G4String hcName) : + TrackerSD(sdName, hcName), m_combineHits(false), m_currentTrackID(-1), m_currentPV(0), m_edepTotal(0), m_minTime(0), m_startedHit(false), m_currentTrack(false) +{ +} + +TrackerCombineSD::~TrackerCombineSD() +{ +} + +void TrackerCombineSD::EndOfEvent(G4HCofThisEvent *hce) +{ + TrackerSD::EndOfEvent(hce); + clear(); +} + +G4bool TrackerCombineSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) +{ + // set cached step + SensitiveDetector::ProcessHits(aStep, 0); + +#ifdef G4VERBOSE + if (getVerbose() > 0) { + G4cout << "G4TrackerCombineSD::ProcessHits - " << GetName() << G4endl; + G4cout << "trackID - " << trackID() << G4endl; + G4cout << "particle - " << track()->GetDefinition()->GetParticleName() << G4endl; + G4cout << "edep - " << step()->GetTotalEnergyDeposit() << 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 + + // Return value indicating whether a hit was inserted. + bool r = false; + + // Started a hit already? + if (!m_startedHit) { + + // If no hit, then start a new hit on the pre-step. + startHit(pre()); + } + + // Check if the cached trackID is valid. + if (m_currentTrackID != -1) { + + // Is this step's trackID different from the cached trackID? + if (trackID() != m_currentTrackID) { + +#ifdef G4VERBOSE + if ( getVerbose() > 0 ) { + G4cout << "new track ID this step!" << G4endl; + } +#endif + + // Insert the hit on the old track. + r = insertHit(); + + // Start a new hit on the pre-step. + startHit(pre()); + } + } +#ifdef G4DEBUG + else { + std::cout << GetName() << "::WARNING : current TrackID == -1" << std::endl; + } +#endif + + // Update the hit, checking if the call to this function is applicable. + updateHit(); + + // Entering a new PV on this step? + if (prePV() != postPV()) { + +#ifdef G4VERBOSE + if ( getVerbose() > 0 ) { + G4cerr << "new physvol this step!" << G4endl; + } +#endif + + // Insert the current hit. + r = insertHit(); + + // Check if pre and post steps have the same detector. + if (hasSameSD()) { + + // Start a new hit for the adjacent tracker layer. + startHit(post()); + } + } + // Special case where the track status is StopAndKill. + // If so, we won't see it again, so need to insert the hit. + else if (m_currentTrack->GetTrackStatus() == fStopAndKill) { + r = insertHit(); + } + +#ifdef G4VERBOSE + if ( getVerbose() > 0 ) { + G4cerr << "----" << G4endl; + } +#endif + + return r; +} + +void TrackerCombineSD::updateHit() +{ + +#ifdef G4VERBOSE + if ( getVerbose() > 1 ) { + G4cout << "updateHit" << G4endl; + } +#endif + + // can only update if started hit + if (m_startedHit) { + + // incr edep + m_edepTotal += edep(); + + // first time only + if (m_minTime == 0) { + m_minTime = globalTime(); + } + + // exit point and momentum + m_exitPoint = postPosition(); + m_exitMomentum = postMomentum(); + } +} + +void TrackerCombineSD::clear() +{ +#ifdef G4VERBOSE + if ( getVerbose() > 1 ) { + G4cout << "clear" << G4endl; + } +#endif + + m_minTime = 0; + m_edepTotal = 0; + m_currentPV = 0; + m_currentTrackID = -1; + m_startedHit = false; +} + +bool TrackerCombineSD::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() && !isGeantino() ) { +#ifdef G4VERBOSE + if ( getVerbose() > 0 ) { + std::cout << GetName() << " : cut this edep " << m_edepTotal << std::endl; + } + +#endif + clear(); + return false; + } + + // compute mid point + G4ThreeVector midPoint = + ReadoutUtil::computeThreeVectorMean(m_entryPoint, m_exitPoint); + + // compute mean momentum + G4ThreeVector meanMom = + ReadoutUtil::computeThreeVectorMean(m_entryMomentum, m_exitMomentum); + + // compute distance from start to entry + G4double pathlength = ReadoutUtil::computeDistance(m_entryPoint, m_exitPoint); + + // hit data + TrackerHit* trkhit = new TrackerHit(); + trkhit->setTdep(m_minTime); + trkhit->setEdep(m_edepTotal); + trkhit->setPos(midPoint); + trkhit->setMomentum(meanMom); + trkhit->setTrackID(m_currentTrackID); + trkhit->setLength(pathlength); + + // set id + Id64bit id64 = makeId(); + trkhit->setId(id64.getId0()); + +#ifdef G4VERBOSE + if ( getVerbose() > 1 ) { + std::cout << GetName() << " : inserting new tracker hit" << std::endl; + std::cout << *trkhit << std::endl; + std::cout << "entryPoint = " << m_entryPoint << std::endl; + std::cout << "entryPointR = " << m_entryPoint.mag() << std::endl; + std::cout << "midPoint = " << midPoint << std::endl; + std::cout << "midPointR = " << midPoint.mag() << std::endl; + std::cout << "exitPoint = " << m_exitPoint << std::endl; + std::cout << "exitPointR = " << m_exitPoint.mag() << std::endl; + std::cout << "(exitPointR - entryPointR) / 2 = " << (m_exitPoint.mag() - m_entryPoint.mag()) / 2 << std::endl; + std::cout << std::endl; + } +#endif + + m_HC->insert(trkhit); + + TrackInformation::getTrackInformation( m_currentTrack )->setHasTrackerHit( true ); + + // clear cached data + clear(); + +#ifdef G4VERBOSE + if ( getVerbose() > 0 ) { + G4cout << G4endl; + } +#endif + + return true; + } + +void TrackerCombineSD::startHit(G4StepPoint* aStepPoint) +{ +#ifdef G4VERBOSE + if ( getVerbose() > 0 ) { + G4cout << "startHit" << G4endl; + } +#endif + + m_currentTrack = step()->GetTrack(); + m_currentPV = aStepPoint->GetPhysicalVolume(); + m_entryPoint = m_exitPoint = aStepPoint->GetPosition(); + m_entryMomentum = m_exitMomentum = aStepPoint->GetMomentum(); + m_currentTrackID = trackID(); + m_startedHit = true; + +#ifdef G4VERBOSE + if ( getVerbose() > 2 ) { + std::cout << GetName() << " : starting new hit" << std::endl; + std::cout << "volume = " << m_currentPV->GetName() << std::endl; + std::cout << "trackID = " << m_currentTrackID << std::endl; + std::cout << "entry point = " << m_entryPoint << std::endl; + } +#endif +} +
diff -N TrackerSD.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ TrackerSD.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,141 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/TrackerSD.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/id/IdManager.hh" +#include "lcdd/id/IdFactory.hh" +#include "lcdd/id/IdVec.hh" +#include "lcdd/detectors/TrackerSD.hh" +#include "lcdd/detectors/ReadoutUtil.hh" +#include "lcdd/hits/TrackerHit.hh" +#include "lcdd/hits/TrackInformation.hh" + +// Geant4 +#include "G4Geantino.hh" + +// STL +#include <iostream> + +TrackerSD::TrackerSD(G4String sdName, G4String hcName) : + SensitiveDetector(sdName, hcName, SensitiveDetector::eTracker), m_HC(0) +{ + m_hits.clear(); +} + +TrackerSD::~TrackerSD() +{ +} + +void TrackerSD::Initialize(G4HCofThisEvent *HCE) +{ + clearHits(); + + // create tracker hits coll + m_HC = new G4TrackerHitsCollection(GetName(), collectionName[0]); + + // set HCID + if (getHCID() < 0) { + setHCID(GetCollectionID(0)); + } + + // add collection to HC of event + HCE->AddHitsCollection(getHCID(), m_HC); +} + +G4bool TrackerSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) +{ + // set cached step + SensitiveDetector::ProcessHits(aStep, 0); + + // edep + G4double e = edep(); + + // check edep < cut + if (e <= getEcut() && !isGeantino()) { + return false; + } + + // get track information + TrackInformation* trkInfo = trackInformation(); + + // set hit flag in trk info + trkInfo->setHasTrackerHit(true); + + // hit data + G4int trkID = trackID(); + G4double tdep = globalTime(); + G4ThreeVector midPos = midPosition(); + G4ThreeVector prePos = aStep->GetPreStepPoint()->GetPosition(); + G4ThreeVector postPos = aStep->GetPostStepPoint()->GetPosition(); + double avgMom = (pre()->GetMomentum().mag() + post()->GetMomentum().mag()) / 2; + G4ThreeVector mom = (postPos - prePos); + if (mom.mag() > 0) { + mom.setMag(avgMom); + } else { + std::cerr << "prePos - postPos = 0 --> " << prePos << " | " << postPos << std::endl; + } + + G4double pathLength = ReadoutUtil::computeDistance(aStep); + + // create hit + TrackerHit* trkHit = new TrackerHit(); + + // create id vector + Id64bit id64 = makeId(); + + // set track hit info + trkHit->setTrackID(trkID); + trkHit->setEdep(e); + trkHit->setPos(midPos); + trkHit->setMomentum(mom); + trkHit->setTdep(tdep); + trkHit->setId(id64.getId0()); + trkHit->setLength(pathLength); + + // add to HC + m_HC->insert(trkHit); + + m_hits.push_back(trkHit); + + return true; +} + +std::ostream& TrackerSD::printHits(std::ostream& os) +{ + for (G4TrackerHitList::const_iterator iter = m_hits.begin(); iter != m_hits.end(); iter++) { + os << (*(const_cast<const TrackerHit*>(*iter))); + } + os << std::endl; + return os; +} + +void TrackerSD::EndOfEvent(G4HCofThisEvent *) +{ +#ifdef G4VERBOSE + if ( getVerbose() > 0 ) { + std::cout << GetName() << " has " << m_HC->GetSize() << " hits." << std::endl; + } + + if ( getVerbose() > 1 ) { + printHits ( std::cout ); + } +#endif +} + +double TrackerSD::getEdep() const +{ + double edep = 0.0; + for (G4TrackerHitList::const_iterator it = m_hits.begin(); it != m_hits.end(); it++) { + edep += (*it)->getEdep(); + } + return edep; +} + +void TrackerSD::clearHits() +{ + m_hits.clear(); +} + +TrackerSD::G4TrackerHitList TrackerSD::getTrackerHitList() +{ + return m_hits; +}
diff -N UnsegmentedCalorimeterSD.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ UnsegmentedCalorimeterSD.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,69 @@
+// $Id: UnsegmentedCalorimeterSD.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/detectors/UnsegmentedCalorimeterSD.hh" + +UnsegmentedCalorimeterSD::UnsegmentedCalorimeterSD(G4String sdName, G4String hcName, Segmentation* seg) : + CalorimeterSD(sdName, hcName, seg) +{ +} + +G4bool UnsegmentedCalorimeterSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) +{ +#ifdef G4VERBOSE + if ( getVerbose() > 0 ) + { + std::cout << "G4UnsegmentedCalorimeterSD::ProcessHits - " << this->GetName() << std::endl; + } +#endif + + /* Cache the step information. */ + SensitiveDetector::ProcessHits(aStep, 0); + + /* Get the energy deposition. */ + G4double theEdep = edep(); + + /* + * This needs to be a <= comparison for cutting on 0, + * but it allows geantinos, which always have 0 edep. + */ + if (theEdep <= getEcut() && !isGeantino()) { +#ifdef G4VERBOSE + if ( getVerbose() > 2 ) + { + std::cout << "G4UnsegmentedCalorimeterSD::ProcessHits - cut on edep " << theEdep << std::endl; + } +#endif + return false; + } + + /* Get the step mid position. */ + G4ThreeVector hitPos = midPosition(); + + //std::cout << "hit at " << hitPos << std::endl; + + /* Reset the segmentation bins. */ + //m_segmentation->resetBins(); + /* Set the segmentation bins. */ + //m_segmentation->setBins( aStep ); + /* Create a 64-bit ID. */ + Id64bit id64 = makeId(); + + /* Create a new hit. */ + CalorimeterHit* thisHit = new CalorimeterHit(theEdep, hitPos); + + /* Set the 64-bit ID. */ + thisHit->setId64bit(id64.getId0(), id64.getId1()); + + /* Add hit to lookup map. */ + hits_vector[0].push_back(thisHit); + + /* Add hit to the HC. */ + m_hitsCollections[0]->insert(thisHit); + + /* Add an MCParticle contribution for this hit. */ + thisHit->addMcpHitContrib(HitContribution(aStep)); + + /* Success. */ + return true; +}
diff -u -r1.1 -r1.2 --- CellReadout2DSegmentation.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ CellReadout2DSegmentation.cc 1 Jul 2013 21:00:44 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/CellReadout2DSegmentation.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/CellReadout2DSegmentation.cc,v 1.2 2013/07/01 21:00:44 jeremy Exp $
// LCDD #include "lcdd/detectors/CellReadout2DSegmentation.hh"
@@ -12,7 +12,7 @@
#include <cmath> CellReadout2DSegmentation::CellReadout2DSegmentation(double cellSizeX, double cellSizeY) :
- G4Segmentation(G4Segmentation::eNonprojective, 2)
+ Segmentation(Segmentation::eNonprojective, 2)
{ m_readout = new CellReadout2D(cellSizeX, cellSizeY); setBinNames();
diff -u -r1.1 -r1.2 --- SensitiveDetectorFactory.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ SensitiveDetectorFactory.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,21 +1,21 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/SensitiveDetectorFactory.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/SensitiveDetectorFactory.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// LCDD #include "lcdd/detectors/SensitiveDetectorFactory.hh"
-#include "lcdd/detectors/G4TrackerCombineSD.hh" -#include "lcdd/detectors/G4ScorerSD.hh" -#include "lcdd/detectors/G4TrackerSD.hh" -#include "lcdd/detectors/G4OpticalCalorimeterSD.hh" -#include "lcdd/detectors/G4UnsegmentedCalorimeterSD.hh"
+#include "lcdd/detectors/TrackerCombineSD.hh" +#include "lcdd/detectors/ScorerSD.hh" +#include "lcdd/detectors/TrackerSD.hh" +#include "lcdd/detectors/OpticalCalorimeterSD.hh" +#include "lcdd/detectors/UnsegmentedCalorimeterSD.hh"
#include "lcdd/detectors/PositionComparator.hh" #include "lcdd/id/IdComparator.hh" #include "lcdd/util/StringUtil.hh"
-G4SensitiveDetector* SensitiveDetectorFactory::createSensitiveDetector(const SAXObject* object)
+SensitiveDetector* SensitiveDetectorFactory::createSensitiveDetector(const SAXObject* object)
{ //std::cout << "create SD" << std::endl;
- G4SensitiveDetector* sd = 0;
+ SensitiveDetector* sd = 0;
const SensitiveDetectorType* sdt = dynamic_cast<const SensitiveDetectorType*>(object);
@@ -63,10 +63,10 @@
return sd; }
-G4CalorimeterSD* SensitiveDetectorFactory::createCalorimeterSD(const SAXObject* object)
+CalorimeterSD* SensitiveDetectorFactory::createCalorimeterSD(const SAXObject* object)
{
- G4CalorimeterSD* sd = 0; - G4Segmentation* seg = 0;
+ CalorimeterSD* sd = 0; + Segmentation* seg = 0;
const SensitiveDetectorType* sdt = dynamic_cast<const SensitiveDetectorType*>(object);
@@ -84,7 +84,7 @@
// Create segmentation using factory. if (isSegmentationTag(child_tag)) {
- seg = G4SegmentationFactory::createSegmentation(segitem.object, segitem.tag);
+ seg = SegmentationFactory::createSegmentation(segitem.object, segitem.tag);
fnd_seg = true; break; }
@@ -122,7 +122,7 @@
} if (sd_type == "calorimeter") {
- sd = new G4CalorimeterSD(sdt->get_name(), sdt->get_hitsCollectionName(), seg, hitCompare);
+ sd = new CalorimeterSD(sdt->get_name(), sdt->get_hitsCollectionName(), seg, hitCompare);
} else if (sd_type == "optical_calorimeter") { // // in case of optical alorimeter there are 2 hit collections
@@ -133,10 +133,10 @@
hcnames.push_back("Edep_" + sdt->get_hitsCollectionName()); hcnames.push_back("Ceren_" + sdt->get_hitsCollectionName()); //std::cout<< " now creating optical calorimeter"<<std::endl;
- sd = new G4OpticalCalorimeterSD(sdt->get_name(), hcnames, seg, hitCompare);
+ sd = new OpticalCalorimeterSD(sdt->get_name(), hcnames, seg, hitCompare);
} else if (sd_type == "unsegmented_calorimeter") { // Segmentation could be null but that is fine for this type of calorimeter.
- sd = new G4UnsegmentedCalorimeterSD(sdt->get_name(), sdt->get_hitsCollectionName(), seg);
+ sd = new UnsegmentedCalorimeterSD(sdt->get_name(), sdt->get_hitsCollectionName(), seg);
} else { G4cerr << "Unknown sensitive detector type: " << sd_type << G4endl; G4Exception("SensitiveDetectorFactory", "", FatalException, "Unknown sensitive detector type.");
@@ -145,13 +145,13 @@
return sd; }
-G4TrackerSD* SensitiveDetectorFactory::createTrackerSD(const SAXObject* object)
+TrackerSD* SensitiveDetectorFactory::createTrackerSD(const SAXObject* object)
{ const tracker* trk = dynamic_cast<const tracker*>(object); bool combineHits = StringUtil::toBool(trk->get_combine_hits());
- G4TrackerSD* sd = 0;
+ TrackerSD* sd = 0;
std::string nm = trk->get_name(); std::string hc = trk->get_hitsCollectionName();
@@ -162,20 +162,20 @@
/* tracker that aggregates hits */ if (combineHits) {
- sd = new G4TrackerCombineSD(nm, hc);
+ sd = new TrackerCombineSD(nm, hc);
} else { /* regular tracker */
- sd = new G4TrackerSD(nm, hc);
+ sd = new TrackerSD(nm, hc);
} return sd; }
-G4ScorerSD* SensitiveDetectorFactory::createScorerSD(const SAXObject* object)
+ScorerSD* SensitiveDetectorFactory::createScorerSD(const SAXObject* object)
{ const scorer * scr = dynamic_cast<const scorer*>(object);
- G4ScorerSD* sd = 0;
+ ScorerSD* sd = 0;
std::string nm = scr->get_name(); std::string hc = scr->get_hitsCollectionName();
@@ -184,7 +184,7 @@
G4Exception("SensitiveDetectorFactory", "", FatalException, "Name of the hits collections is invalid."); }
- sd = new G4ScorerSD(nm, hc);
+ sd = new ScorerSD(nm, hc);
return sd; }
@@ -214,7 +214,7 @@
return idspec; }
-void SensitiveDetectorFactory::setBaseSensitiveDetectorAttributes(G4SensitiveDetector* sd, const SensitiveDetectorType* sdt)
+void SensitiveDetectorFactory::setBaseSensitiveDetectorAttributes(SensitiveDetector* sd, const SensitiveDetectorType* sdt)
{ sd->setEcut(SensitiveDetectorFactory::computeEcut(sdt)); sd->setVerbose(SensitiveDetectorFactory::convertVerbose(sdt));
diff -u -r1.1 -r1.2 --- SensitiveDetectorMessenger.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ SensitiveDetectorMessenger.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,4 +1,4 @@
-// $Id: SensitiveDetectorMessenger.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $
+// $Id: SensitiveDetectorMessenger.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// LCDD #include "lcdd/detectors/SensitiveDetectorMessenger.hh"
@@ -13,7 +13,7 @@
G4UIdirectory* SensitiveDetectorMessenger::m_detectorsDir = 0;
-SensitiveDetectorMessenger::SensitiveDetectorMessenger(G4SensitiveDetector* detector) :
+SensitiveDetectorMessenger::SensitiveDetectorMessenger(SensitiveDetector* detector) :
m_detector(detector) { if (m_detectorsDir == 0) {
diff -N G4CalorimeterSD.cc --- G4CalorimeterSD.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,278 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4CalorimeterSD.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4CalorimeterSD.hh" -#include "lcdd/detectors/G4Segmentation.hh" -#include "lcdd/detectors/ReadoutUtil.hh" -#include "lcdd/detectors/PositionComparator.hh" -#include "lcdd/hits/McpHitContrib.hh" -#include "lcdd/id/IdFactory.hh" -#include "lcdd/id/IdManager.hh" - -// Geant4 -#include "G4Track.hh" -#include "G4StepPoint.hh" -#include "G4Timer.hh" -#include "G4Geantino.hh" - -// STL -#include <iostream> -#include <string> -#include <vector> - -using std::vector; - -G4CalorimeterSD::G4CalorimeterSD(G4String sdName, G4String hcName, G4Segmentation* sdSeg, HitComparator* compare) : - G4SensitiveDetector(sdName, hcName, G4SensitiveDetector::eCalorimeter), m_segmentation(sdSeg) -{ - m_hitsCollections.push_back(m_collection); - m_hits.clear(); - hits_vector.clear(); - hits_vector.push_back(m_hits); - if (compare == 0) - m_hitCompare = new PositionComparator(); - else - m_hitCompare = compare; -} - -G4CalorimeterSD::G4CalorimeterSD(G4String sdName, const vector<G4String>& hcNames, G4Segmentation* sdSeg, HitComparator* compare) : - G4SensitiveDetector(sdName, hcNames, G4SensitiveDetector::eCalorimeter), m_segmentation(sdSeg) -{ - m_hits.clear(); - hits_vector.clear(); - hits_vector.push_back(m_hits); - for (int i = 0; i < (int) hcNames.size(); i++) { - hits_vector.push_back(m_hits); - hits_vector[i].clear(); - m_hitsCollections.push_back(m_collection); - } - - if (compare == 0) { - m_hitCompare = new PositionComparator(); - } else { - m_hitCompare = compare; - } -} - -G4CalorimeterSD::~G4CalorimeterSD() -{ -} - -bool G4CalorimeterSD::isValidVolume(G4LogicalVolume* lv) -{ - bool valid = G4SensitiveDetector::isValidVolume(lv); - - if (valid && m_segmentation != 0) { - valid = m_segmentation->isValidSolid(lv->GetSolid()); - } - - return valid; -} - -void G4CalorimeterSD::Initialize(G4HCofThisEvent *HCE) -{ - clearHits(); - - // new cal hits collection - for (int i = 0; i < getNumberOfHitsCollections(); i++) { - m_hitsCollections[i] = new G4CalorimeterHitsCollection(GetName(), collectionName[i]); - - // set HCID - if (getHCID(i) < 0) { - setHCID(GetCollectionID(i), i); - } - - // add collection to HC of event - HCE->AddHitsCollection(getHCID(i), m_hitsCollections[i]); - } -} - -G4Segmentation* G4CalorimeterSD::getSegmentation() const -{ - return m_segmentation; -} - -G4bool G4CalorimeterSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) -{ -#ifdef G4VERBOSE - if (getVerbose() > 0) - { - std::cout << "G4CalorimeterSD::ProcessHits - " << this->GetName() << std::endl; - } -#endif - - // set cached step - G4SensitiveDetector::ProcessHits(aStep, 0); - - // get the edep - G4double theEdep = edep(); - - // This needs to be a <= comparison for cutting on 0, - // Geantinos, which always have 0 edep, are allowed. - 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 segmentation. - G4ThreeVector globalCellPos = m_segmentation->getGlobalHitPos(aStep); - - // Reset the segmentation bin values. - m_segmentation->resetBins(); - - // Set the segmentation bin values from the step. - m_segmentation->setBins(aStep); - - // Create a 64-bit ID. - 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))) { - -#ifdef G4VERBOSE - if (getVerbose() > 1) { - std::cout << "G4CalorimeterSD::ProcessHits - new hit" << std::endl; - } -#endif - // add it to lkp map - hits_vector[0].push_back(thisHit); - - // add to the HC - m_hitsCollections[0]->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; -} - -G4CalorimeterHit* G4CalorimeterSD::findHit(G4CalorimeterHit* aHit) const -{ - G4CalorimeterHit* fndHit = 0; - for (G4CalorimeterHitList::const_iterator iter = hits_vector[0].begin(); iter != hits_vector[0].end(); iter++) { - if (m_hitCompare->compare(**iter, *aHit)) { - fndHit = *iter; - break; - } - } - return fndHit; -} - -G4CalorimeterHit* G4CalorimeterSD::findHit(G4CalorimeterHit* aHit, G4int nHC) const -{ - G4CalorimeterHit* fndHit = 0; - for (G4CalorimeterHitList::const_iterator iter = hits_vector[nHC].begin(); iter != hits_vector[nHC].end(); iter++) { - if (m_hitCompare->compare(**iter, *aHit)) { - fndHit = *iter; - break; - } - } - return fndHit; -} - -std::ostream& G4CalorimeterSD::printHits(std::ostream& os) -{ - for (int i = 0; i < getNumberOfHitsCollections(); i++) { - os << getHitsCollection(i)->GetName() << std::endl; - for (G4CalorimeterHitList::const_iterator iter = hits_vector[i].begin(); iter != hits_vector[i].end(); iter++) { - os << " " << **iter; - } - } - os << std::endl; - return os; -} - -void G4CalorimeterSD::EndOfEvent(G4HCofThisEvent *) -{ -#ifdef G4VERBOSE - if ( getVerbose() > 1 ) { - printHits( std::cout ); - } -#endif -} - -std::ostream& G4CalorimeterSD::printBasicInfo(std::ostream& os) -{ - G4SensitiveDetector::printBasicInfo(os); - os << "segmentation type: " << m_segmentation->getTypeString() << std::endl; - os << "segmentation bins:"; - for (std::vector<std::string>::const_iterator it = m_segmentation->getBinNames().begin(); it != m_segmentation->getBinNames().end(); it++) { - os << " " << *it; - } - os << std::endl; - return os; -} - -double G4CalorimeterSD::getEdep() const -{ - double edep = 0.0; - for (G4CalorimeterHitList::const_iterator it = hits_vector[0].begin(); it != hits_vector[0].end(); it++) { - edep += (*it)->getEdep(); - } - return edep; -} - -double G4CalorimeterSD::getEdep(G4int nHC) const -{ - double edep = 0.0; - for (G4CalorimeterHitList::const_iterator it = hits_vector[nHC].begin(); it != hits_vector[nHC].end(); it++) { - edep += (*it)->getEdep(); - } - return edep; -} - -void G4CalorimeterSD::clearHits() -{ - for (int i = 0; i < getNumberOfHitsCollections(); i++) { - hits_vector[i].clear(); - } -} - -G4CalorimeterSD::G4CalorimeterHitList G4CalorimeterSD::getCalorimeterHitList() -{ - return hits_vector[0]; -} - -G4CalorimeterSD::G4CalorimeterHitList G4CalorimeterSD::getCalorimeterHitList(G4int nHC) -{ - return hits_vector[nHC]; -} -
diff -N G4GlobalGridXYSegmentation.cc --- G4GlobalGridXYSegmentation.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,71 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4GlobalGridXYSegmentation.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4GlobalGridXYSegmentation.hh" -#include "lcdd/detectors/ReadoutUtil.hh" - -// Geant4 -#include "G4NavigationHistory.hh" - -G4GlobalGridXYSegmentation::G4GlobalGridXYSegmentation(double gridSizeX, double gridSizeY) : - G4Segmentation(G4Segmentation::eNonprojective), m_gridSizeX(gridSizeX), m_gridSizeY(gridSizeY) -{ - setBinNames(); -} - -G4GlobalGridXYSegmentation::~G4GlobalGridXYSegmentation() -{ -} - -G4ThreeVector G4GlobalGridXYSegmentation::getGlobalHitPos(const G4Step* aStep) -{ - // Compute the midpoint of the global step. - G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); - - // Create 3vec for cell position. - G4ThreeVector globalCellPos; - - // Set binned coordinates of cell position. - globalCellPos.setX(computeDimX(computeBinX(globalStepPos))); - globalCellPos.setY(computeDimY(computeBinY(globalStepPos))); - - // Set Z coordinate of cell position from the volume's Z center position. - G4ThreeVector vpos = ReadoutUtil::getVolumeGlobalPosition(aStep->GetPreStepPoint()); - globalCellPos.setZ(vpos.z()); - - return globalCellPos; -} - -void G4GlobalGridXYSegmentation::setBins(const G4Step* aStep) -{ - // Compute the midpoint of the step. - G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); - - // Compute the bin values. - int binX = computeBinX(globalStepPos); - int binY = computeBinY(globalStepPos); - - // Set the bin values. - setBin(0, binX); - setBin(1, binY); -} - -int G4GlobalGridXYSegmentation::computeBinX(const G4ThreeVector& stepPos) -{ - return G4Segmentation::computeBin(stepPos.x(), m_gridSizeX); -} - -int G4GlobalGridXYSegmentation::computeBinY(const G4ThreeVector& stepPos) -{ - return G4Segmentation::computeBin(stepPos.y(), m_gridSizeY); -} - -double G4GlobalGridXYSegmentation::computeDimX(int bin) -{ - return G4Segmentation::computeDim(bin, m_gridSizeX); -} - -double G4GlobalGridXYSegmentation::computeDimY(int bin) -{ - return G4Segmentation::computeDim(bin, m_gridSizeY); -}
diff -N G4GridXYZSegmentation.cc --- G4GridXYZSegmentation.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,144 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4GridXYZSegmentation.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4GridXYZSegmentation.hh" -#include "lcdd/detectors/ReadoutUtil.hh" - -// Geant4 -#include "G4NavigationHistory.hh" - -G4GridXYZSegmentation::G4GridXYZSegmentation(double gridSizeX, double gridSizeY, double gridSizeZ) : - G4Segmentation(G4Segmentation::eNonprojective), m_gridSizeX(gridSizeX), m_gridSizeY(gridSizeY), m_gridSizeZ(gridSizeZ) -{ - setBinNames(); -} - -G4GridXYZSegmentation::~G4GridXYZSegmentation() -{ -} - -G4ThreeVector G4GridXYZSegmentation::getGlobalHitPos(const G4Step* aStep) -{ - // compute midpoint - G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); - - // figure local step pos using touchable and global midpoint - G4ThreeVector localStepPos = ReadoutUtil::transformGlobalToLocal(aStep, globalStepPos); - - // local cell pos - G4ThreeVector localCellPos = this->getLocalHitPos(localStepPos); - - // global cell pos - G4ThreeVector globalCellPos = ReadoutUtil::transformLocalToGlobal(aStep, localCellPos); - - return globalCellPos; -} - -void G4GridXYZSegmentation::setBins(const G4Step* aStep) -{ - // Compute the midpoint of the step. - G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); - - // Transform from global coordinate system to local coordinate system of volume pointed to by this step. - G4ThreeVector localStepPos = ReadoutUtil::transformGlobalToLocal(aStep, globalStepPos); - - // Compute the bin values. - int binX = computeBinX(localStepPos); - int binY = computeBinY(localStepPos); - int binZ = computeBinZ(localStepPos); - - // Set the bins. - int idx = 0; - - setBin(idx, binX); - ++idx; - - setBin(idx, binY); - ++idx; - - setBin(idx, binZ); - ++idx; -} - -int G4GridXYZSegmentation::computeBinX(const G4ThreeVector& localStepPos) -{ - int ret; - if (m_gridSizeX != 0) { - ret = G4Segmentation::computeBin(localStepPos.x(), m_gridSizeX); - } else { - ret = 0; - } - return ret; -} - -int G4GridXYZSegmentation::computeBinY(const G4ThreeVector& localStepPos) -{ - int ret; - if (m_gridSizeY != 0) { - ret = G4Segmentation::computeBin(localStepPos.y(), m_gridSizeY); - } else { - ret = 0; - } - return ret; -} - -int G4GridXYZSegmentation::computeBinZ(const G4ThreeVector& localStepPos) -{ - int ret; - if (m_gridSizeZ != 0) { - ret = G4Segmentation::computeBin(localStepPos.z(), m_gridSizeZ); - } else { - ret = 0; - } - return ret; -} - -double G4GridXYZSegmentation::computeDimX(int bin) -{ - return G4Segmentation::computeDim(bin, m_gridSizeX); -} - -double G4GridXYZSegmentation::computeDimY(int bin) -{ - return G4Segmentation::computeDim(bin, m_gridSizeY); -} - -double G4GridXYZSegmentation::computeDimZ(int bin) -{ - return G4Segmentation::computeDim(bin, m_gridSizeZ); -} - -G4ThreeVector G4GridXYZSegmentation::getGlobalHitPosPreStep(const G4StepPoint* aPreStepPoint) -{ - G4ThreeVector globalStepPos = aPreStepPoint->GetPosition(); - - // Figure out local step pos using touchable and global midpoint. - G4ThreeVector localStepPos = ReadoutUtil::transformGlobalToLocal(aPreStepPoint, globalStepPos); - - // Compute local cell pos. - G4ThreeVector localCellPos = this->getLocalHitPos(localStepPos); - - // Compute global cell pos. - G4ThreeVector globalCellPos = ReadoutUtil::transformLocalToGlobal(aPreStepPoint, localCellPos); - - return globalCellPos; -} - -G4ThreeVector G4GridXYZSegmentation::getLocalHitPos(const G4ThreeVector& localStepPos) -{ - G4ThreeVector localHitPos; - - if (m_gridSizeX > 0) { - localHitPos.setX(computeDimX(computeBinX(localStepPos))); - } - - if (m_gridSizeY > 0) { - localHitPos.setY(computeDimY(computeBinY(localStepPos))); - } - - if (m_gridSizeZ > 0) { - localHitPos.setZ(computeDimZ(computeBinZ(localStepPos))); - } - - return localHitPos; -}
diff -N G4NonprojectiveCylinderSegmentation.cc --- G4NonprojectiveCylinderSegmentation.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,260 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4NonprojectiveCylinderSegmentation.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4NonprojectiveCylinderSegmentation.hh" -#include "lcdd/detectors/ReadoutUtil.hh" - -// Geant4 -#include "G4Tubs.hh" - -// STL -#include <cmath> - -G4NonprojectiveCylinderSegmentation::G4NonprojectiveCylinderSegmentation(double gridSizePhi, double gridSizeZ) : - G4Segmentation(G4Segmentation::eNonprojective), m_gridSizePhi(gridSizePhi), m_gridSizeZ(gridSizeZ) - -{ - setBinNames(); -} - -G4NonprojectiveCylinderSegmentation::~G4NonprojectiveCylinderSegmentation() -{ -} - -G4ThreeVector G4NonprojectiveCylinderSegmentation::getGlobalHitPos(const G4Step* aStep) -{ - // local cell pos - G4ThreeVector localCellPos = getLocalHitPos(aStep); - - // global cell pos - G4ThreeVector globalCellPos = ReadoutUtil::transformLocalToGlobal(aStep, localCellPos); - - // DEBUG: print local, global cell pos - //G4cout << "localCellPos " << localCellPos << G4endl; - //G4cout << "globalCellPos " << globalCellPos << G4endl; - // - - return localCellPos; -} -G4ThreeVector G4NonprojectiveCylinderSegmentation::getGlobalHitPos(const G4StepPoint* aPreStepPoint) -{ - // local cell pos - G4ThreeVector localCellPos = getLocalHitPos(aPreStepPoint); - - // global cell pos - G4ThreeVector globalCellPos = ReadoutUtil::transformLocalToGlobal(aPreStepPoint, localCellPos); - - // DEBUG: print local, global cell pos - //G4cout << "localCellPos " << localCellPos << G4endl; - //G4cout << "globalCellPos " << globalCellPos << G4endl; - // - - return localCellPos; -} -G4ThreeVector G4NonprojectiveCylinderSegmentation::getLocalHitPos(const G4Step* aStep) -{ - G4ThreeVector globalMidPos = ReadoutUtil::computeMidPos(aStep); - - // retrieve G4Tubs - const G4Tubs* tubs = ReadoutUtil::getTubs(aStep); - - assert(tubs); - - // rcyl of cell = mid rad of current tubs - double rcyl = ReadoutUtil::computeTubsMidRadius(tubs); - - // compute single delta phi in degrees - double deltaPhi = computeDeltaPhi(aStep); - - // phi index - int iphi = computeBinPhi(aStep); - - // z index in local - int iz = computeBinZ(ReadoutUtil::transformGlobalToLocal(aStep, globalMidPos)); - - // compute cell Z, phi - double cellPhi = computeDim(iphi, deltaPhi); - double cellZ = computeDim(iz, m_gridSizeZ); - - // compute X, Y - double cellX = rcyl * cos(cellPhi); - double cellY = rcyl * sin(cellPhi); - - G4ThreeVector cellCenter(cellX, cellY, cellZ); - - // DEBUG: print all - //G4cout << G4endl; - //G4cout << "rcyl <" << rcyl << ">" << G4endl; - //G4cout << "deltaPhi <" << deltaPhi << ">" << G4endl; - //G4cout << "iphi <" << iphi << ">" << G4endl; - //G4cout << "iz <" << iz << ">" << G4endl; - //G4cout << "cellPhi <" << cellPhi << ">" << G4endl; - //G4cout << "cellCenter " << cellCenter << G4endl; - //G4cout << G4endl; - // - - return cellCenter; -} -G4ThreeVector G4NonprojectiveCylinderSegmentation::getLocalHitPos(const G4StepPoint* aPreStepPoint) -{ - G4ThreeVector globalPos = aPreStepPoint->GetPosition(); - - // retrieve G4Tubs - const G4Tubs* tubs = ReadoutUtil::getTubs(aPreStepPoint); - - assert(tubs); - - // rcyl of cell = mid rad of current tubs - double rcyl = ReadoutUtil::computeTubsMidRadius(tubs); - - // compute single delta phi in degrees - double deltaPhi = computeDeltaPhi(aPreStepPoint); - - // phi index - int iphi = computeBinPhi(aPreStepPoint); - - // z index in local - int iz = computeBinZ(ReadoutUtil::transformGlobalToLocal(aPreStepPoint, globalPos)); - - // compute cell Z, phi - double cellPhi = computeDim(iphi, deltaPhi); - double cellZ = computeDim(iz, m_gridSizeZ); - - // compute X, Y - double cellX = rcyl * cos(cellPhi); - double cellY = rcyl * sin(cellPhi); - - G4ThreeVector cellCenter(cellX, cellY, cellZ); - - // DEBUG: print all - //G4cout << G4endl; - //G4cout << "rcyl <" << rcyl << ">" << G4endl; - //G4cout << "deltaPhi <" << deltaPhi << ">" << G4endl; - //G4cout << "iphi <" << iphi << ">" << G4endl; - //G4cout << "iz <" << iz << ">" << G4endl; - //G4cout << "cellPhi <" << cellPhi << ">" << G4endl; - //G4cout << "cellCenter " << cellCenter << G4endl; - //G4cout << G4endl; - // - - return cellCenter; -} - -double G4NonprojectiveCylinderSegmentation::computeDeltaPhi(const G4Step* aStep) -{ - // mid radius of current tubs - double mid_rad_layer = ReadoutUtil::computeTubsMidRadius(aStep); - - // circumference of current tubs - double circ = 2.0 * ReadoutUtil::PI * mid_rad_layer; - - // number of cells along phi in curr layer - int nphi = (int) floor(circ / m_gridSizePhi); - - // single phi division in degrees - double deltaPhi = (360.0 * deg) / nphi; - - return deltaPhi; -} -double G4NonprojectiveCylinderSegmentation::computeDeltaPhi(const G4StepPoint* aPreStepPoint) -{ - // mid radius of current tubs - double mid_rad_layer = ReadoutUtil::computeTubsMidRadius(aPreStepPoint); - - // circumference of current tubs - double circ = 2.0 * ReadoutUtil::PI * mid_rad_layer; - - // number of cells along phi in curr layer - int nphi = (int) floor(circ / m_gridSizePhi); - - // single phi division in degrees - double deltaPhi = (360.0 * deg) / nphi; - - return deltaPhi; -} -void G4NonprojectiveCylinderSegmentation::setBins(const G4Step* aStep) -{ - //G4cout << "G4NonprojectiveCylinderSegmentation::setBins()" << G4endl; - - G4ThreeVector globalMidPos = ReadoutUtil::computeMidPos(aStep); - - int bphi = computeBinPhi(aStep); - int bz = computeBinZ(globalMidPos); - - setBin(0, bphi); - setBin(1, bz); -} -void G4NonprojectiveCylinderSegmentation::setBins(const G4StepPoint* aPreStepPoint) -{ - //G4cout << "G4NonprojectiveCylinderSegmentation::setBins()" << G4endl; - - G4ThreeVector globalPos = aPreStepPoint->GetPosition(); - - int bphi = computeBinPhi(aPreStepPoint); - int bz = computeBinZ(globalPos); - - setBin(0, bphi); - setBin(1, bz); -} -int G4NonprojectiveCylinderSegmentation::computeBinPhi(const G4Step* aStep) -{ - G4ThreeVector globalMidPos = ReadoutUtil::computeMidPos(aStep); - - const G4Tubs* tubs = ReadoutUtil::getTubs(aStep); - assert(tubs); - - // compute single delta phi in degrees - double deltaPhi = computeDeltaPhi(aStep); - - // step phi - double stepPhi = globalMidPos.phi(); - - if (stepPhi < 0) { - stepPhi += 2.0 * ReadoutUtil::PI; - } - - // phi index - return computeBin(stepPhi, deltaPhi / radian); -} - -int G4NonprojectiveCylinderSegmentation::computeBinPhi(const G4StepPoint* aPreStepPoint) -{ - G4ThreeVector globalPos = aPreStepPoint->GetPosition(); - - const G4Tubs* tubs = ReadoutUtil::getTubs(aPreStepPoint); - assert(tubs); - - // compute single delta phi in degrees - double deltaPhi = computeDeltaPhi(aPreStepPoint); - - // step phi - double stepPhi = globalPos.phi(); - - if (stepPhi < 0) { - stepPhi += 2.0 * ReadoutUtil::PI; - } - - // phi index - return computeBin(stepPhi, deltaPhi / radian); -} - -int G4NonprojectiveCylinderSegmentation::computeBinZ(const G4ThreeVector& localStepPos) -{ - //G4cout << "localStepPos.z() <" << localStepPos.z() << ">" << G4endl; - //G4cout << "m_gridSizeZ <" << m_gridSizeZ << ">" << G4endl; - - return computeBin(localStepPos.z(), m_gridSizeZ); -} - -bool G4NonprojectiveCylinderSegmentation::isValidSolid(G4VSolid* s) -{ - bool valid = G4Segmentation::isValidSolid(s); - - if (valid) { - if (s->GetEntityType() != "G4Tubs") { - valid = false; - } - } - - return valid; -}
diff -N G4OpticalCalorimeter.cc --- G4OpticalCalorimeter.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,116 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4OpticalCalorimeter.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4OpticalCalorimeterSD.hh" -#include "lcdd/detectors/G4Segmentation.hh" -#include "lcdd/detectors/Cerenkov.hh" - -// Geant4 -#include "G4OpticalPhoton.hh" -#include "G4TransportationManager.hh" -#include "G4VProcess.hh" -#include "G4Poisson.hh" - -using std::vector; - -/** - * Constructor for the case only one Hit Collection is given. - * In this case the only the energy deposited by aborbed Cerenkov - * photons is stored. Probably this will be dropped in the - * near future. - */ -G4OpticalCalorimeterSD::G4OpticalCalorimeterSD(G4String sdName, G4String hcName, G4Segmentation* sdSeg, HitComparator* compare) : - G4CalorimeterSD(sdName, hcName, sdSeg, compare) -{ - CerenGenerator = 0; -} - -/** - * Constructor for multiple Hit Collections. - * - * The current implementation uses the first Hit Collection for the - * Cerenkov Photons and the second Collection to store the ionization losses. - * If more than 2 collections are given the additional Hit collections will - * be ignored. - */ -G4OpticalCalorimeterSD::G4OpticalCalorimeterSD(G4String sdName, const vector<G4String>& hcNames, G4Segmentation* sdSeg, HitComparator* compare) : - G4CalorimeterSD(sdName, hcNames, sdSeg, compare) -{ - CerenGenerator = 0; -} - -G4OpticalCalorimeterSD::~G4OpticalCalorimeterSD() -{ -} - -G4bool G4OpticalCalorimeterSD::ProcessHits(G4Step* aStep, G4TouchableHistory* tahis) -{ - if (!CerenGenerator) - CerenGenerator = new Cerenkov(); - G4int NCerenPhotons = 0; - G4Track* theTrack = aStep->GetTrack(); - const G4double charge = theTrack->GetDefinition()->GetPDGCharge(); - G4StepPoint* pPreStepPoint = aStep->GetPreStepPoint(); - G4StepPoint* pPostStepPoint = aStep->GetPostStepPoint(); - G4double beta = 0.5 * (pPreStepPoint->GetBeta() + pPostStepPoint->GetBeta()); - const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable(); - G4String thematerial = touch->GetVolume()->GetLogicalVolume()->GetMaterial()->GetName(); - G4double MeanNumberOfPhotons = CerenGenerator->GetAverageNumberOfPhotons(charge, beta, thematerial); - if (MeanNumberOfPhotons > 0.0) { - G4double step_length = aStep->GetStepLength(); - MeanNumberOfPhotons = MeanNumberOfPhotons * step_length; - NCerenPhotons = (G4int) G4Poisson(MeanNumberOfPhotons); - } else { - NCerenPhotons = 0; - } - - if (NCerenPhotons <= 0) { - return G4CalorimeterSD::ProcessHits(aStep, tahis); - } else { - G4SensitiveDetector::ProcessHits(aStep, 0); - G4ThreeVector myPoint = aStep->GetPreStepPoint()->GetPosition(); - G4StepPoint* apreStepPoint = aStep->GetPreStepPoint(); - G4Navigator* theNavigator = G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking(); - G4VPhysicalVolume* myVolume = theNavigator->LocateGlobalPointAndSetup(myPoint); - if (getVerbose() > 2) { - G4cout << "Physical volume = " << myVolume->GetName() << G4endl; - G4cout << "Point of interaction = " << myPoint<< G4endl; - G4cout << "sdname " << GetName() << " hcname " <<collectionName[0]<< G4endl; - } - // total photon energy - // G4double theEdep = aTrack->GetTotalEnergy(); - G4double theEdep = double(NCerenPhotons); - // get global cell pos from seg - G4ThreeVector globalCellPos = m_segmentation->getGlobalHitPosPreStep(apreStepPoint); - // reset the seg bins - m_segmentation->resetBins(); - // set the seg bins - m_segmentation->setBins(aStep); - // create id and pack into 64 - Id64bit id64 = makeId(); - // 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, eCerenkov))) { - // add it to lkp map - hits_vector[eCerenkov].push_back(thisHit); - // add to the HC - m_hitsCollections[eCerenkov]->insert(thisHit); - } else { - // found a hit - // 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)); - // aTrack->SetTrackStatus(fStopAndKill); // don't step photon any further - return true; - } // end Cerenkov photon treatment -}
diff -N G4ProjectiveCylinderSegmentation.cc --- G4ProjectiveCylinderSegmentation.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,68 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4ProjectiveCylinderSegmentation.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4ProjectiveCylinderSegmentation.hh" -#include "lcdd/detectors/ReadoutUtil.hh" - -// Geant4 -#include "G4StepPoint.hh" -#include "G4NavigationHistory.hh" -#include "G4VPhysicalVolume.hh" -#include "G4LogicalVolume.hh" -#include "G4Tubs.hh" - -G4ProjectiveCylinderSegmentation::G4ProjectiveCylinderSegmentation(G4int ntheta, G4int nphi) : - G4ProjectiveSegmentation(ntheta, nphi) -{ -} - -G4ProjectiveCylinderSegmentation::~G4ProjectiveCylinderSegmentation() -{ -} - -double G4ProjectiveCylinderSegmentation::getRadius(const G4Step* aStep) -{ - return ReadoutUtil::computeTubsMidRadius(ReadoutUtil::getTubs(aStep)); -} -double G4ProjectiveCylinderSegmentation::getRadius(const G4StepPoint* aPreStepPoint) -{ - return ReadoutUtil::computeTubsMidRadius(ReadoutUtil::getTubs(aPreStepPoint)); -} -double G4ProjectiveCylinderSegmentation::getZ(const G4Step* aStep) -{ - double rcyl = getRadius(aStep); - - double ctheta = getThetaDim(aStep); - - // ctheta in 0 to pi ... - // ctheta < pi/2 should be negative - - double zcell = rcyl / tan(ctheta); - - return zcell; -} -double G4ProjectiveCylinderSegmentation::getZ(const G4StepPoint* aPreStepPoint) -{ - double rcyl = getRadius(aPreStepPoint); - - double ctheta = getThetaDim(aPreStepPoint); - - // ctheta in 0 to pi ... - // ctheta < pi/2 should be negative - - double zcell = rcyl / tan(ctheta); - - return zcell; -} -bool G4ProjectiveCylinderSegmentation::isValidSolid(G4VSolid* s) -{ - bool valid = G4Segmentation::isValidSolid(s); - - if (valid) { - if (s->GetEntityType() != "G4Tubs") { - valid = false; - } - } - - return valid; -}
diff -N G4ProjectiveSegmentation.cc --- G4ProjectiveSegmentation.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,238 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4ProjectiveSegmentation.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4ProjectiveSegmentation.hh" -#include "lcdd/detectors/ReadoutUtil.hh" - -// Geant4 -#include "G4StepPoint.hh" -#include "G4NavigationHistory.hh" -#include "G4VPhysicalVolume.hh" -#include "G4LogicalVolume.hh" -#include "G4Tubs.hh" - -G4ProjectiveSegmentation::G4ProjectiveSegmentation(G4int ntheta, G4int nphi) : - G4Segmentation(G4Segmentation::eProjective), m_ntheta(ntheta), m_nphi(nphi) -{ - //G4cout << "G4ProjectiveSegmentation" << G4endl; - //G4cout << "ntheta, nphi: " << ntheta << ", " << nphi << G4endl; - - computeDivisions(); - - setBinNames(); -} - -G4ProjectiveSegmentation::~G4ProjectiveSegmentation() -{ -} - -G4ThreeVector G4ProjectiveSegmentation::getGlobalHitPos(const G4Step* aStep) -{ - // DEBUG - //G4cout << "G4ProjectiveSegmentation::getGlobalHitPos()" << G4endl; - // - - // divide entire theta, phi range into bins; bins always positive - // theta, phi coord of step midpoint - // compute bin numbers - // get dim from bins - - // get radius, z components (probably from subclass function) - double rcyl = getRadius(aStep); - double zcell = getZ(aStep); - - // get phi component - double cphi = getPhiDim(aStep); - - // compute x, y cells - double xcell = rcyl * cos(cphi); - double ycell = rcyl * sin(cphi); - - G4ThreeVector pos(xcell, ycell, zcell); - - //G4ThreeVector midPos = ReadoutUtil::computeMidPos( aStep ); - - // DEBUG: print all - //G4cout << "sphi <" << midPos.phi() << ">" << G4endl; - //G4cout << "cphi <" << cphi << ">" << G4endl; - //G4cout << "sphi - cphi = " << midPos.phi() - cphi << G4endl; - - //G4cout << "stheta <" << midPos.theta() << ">" << G4endl; - //G4cout << "ctheta <" << getThetaDim( aStep ) << ">" << G4endl; - //G4cout << "stheta - ctheta = " << midPos.theta() - getThetaDim( aStep ) << G4endl; - - //G4cout << "rcyl <" << rcyl << ">" << G4endl; - //G4cout << "zcell <" << zcell << ">" << G4endl; - //G4cout << "globalCellPos <" << pos << ">" << G4endl; - // - - return pos; -} -G4ThreeVector G4ProjectiveSegmentation::getGlobalHitPos(const G4StepPoint* aPreStepPoint) -{ - // DEBUG - //G4cout << "G4ProjectiveSegmentation::getGlobalHitPos()" << G4endl; - // - - // divide entire theta, phi range into bins; bins always positive - // theta, phi coord of step midpoint - // compute bin numbers - // get dim from bins - - // get radius, z components (probably from subclass function) - double rcyl = getRadius(aPreStepPoint); - double zcell = getZ(aPreStepPoint); - - // get phi component - double cphi = getPhiDim(aPreStepPoint); - - // compute x, y cells - double xcell = rcyl * cos(cphi); - double ycell = rcyl * sin(cphi); - - G4ThreeVector pos(xcell, ycell, zcell); - - //G4ThreeVector midPos = ReadoutUtil::computeMidPos( aStep ); - - // DEBUG: print all - //G4cout << "sphi <" << midPos.phi() << ">" << G4endl; - //G4cout << "cphi <" << cphi << ">" << G4endl; - //G4cout << "sphi - cphi = " << midPos.phi() - cphi << G4endl; - - //G4cout << "stheta <" << midPos.theta() << ">" << G4endl; - //G4cout << "ctheta <" << getThetaDim( aStep ) << ">" << G4endl; - //G4cout << "stheta - ctheta = " << midPos.theta() - getThetaDim( aStep ) << G4endl; - - //G4cout << "rcyl <" << rcyl << ">" << G4endl; - //G4cout << "zcell <" << zcell << ">" << G4endl; - //G4cout << "globalCellPos <" << pos << ">" << G4endl; - // - - return pos; -} -void G4ProjectiveSegmentation::setBins(const G4Step* aStep) -{ - G4ThreeVector globalMidPos = ReadoutUtil::computeMidPos(aStep); - - setBin(0, getThetaBin(globalMidPos)); - setBin(1, getPhiBin(globalMidPos)); -} - -void G4ProjectiveSegmentation::setBins(const G4StepPoint* aPreStepPoint) -{ - G4ThreeVector globalPos = aPreStepPoint->GetPosition(); - - setBin(0, getThetaBin(globalPos)); - setBin(1, getPhiBin(globalPos)); -} - -G4int G4ProjectiveSegmentation::getNtheta() const -{ - return m_ntheta; -} - -G4int G4ProjectiveSegmentation::getNphi() const -{ - return m_nphi; -} - -void G4ProjectiveSegmentation::computeDivisions() -{ - m_divTheta = (180.0 * deg) / m_ntheta; - m_divPhi = (360.0 * deg) / m_nphi; -} - -int G4ProjectiveSegmentation::getThetaBin(const G4ThreeVector& globalStepPos) -{ - // theta needs to be in range 0 - PI - return G4Segmentation::computeBin(globalStepPos.theta(), m_divTheta / radian); -} - -int G4ProjectiveSegmentation::getPhiBin(const G4ThreeVector& globalStepPos) -{ - - // adjust phi for < 0 - double sphi = globalStepPos.phi(); - - if (sphi < 0.0) { - sphi += 360.0 * deg; - } - - // needs more checks, for phi in range 0 - TWOPI - // if > TWOPI, then subtract TWOPI - // - // OR use X, Y for phi calc - - // compute and return bin - return G4Segmentation::computeBin(sphi, m_divPhi / radian); -} - -// default impl. returns mag of pos -double G4ProjectiveSegmentation::getRadius(const G4Step* aStep) -{ - //G4cout << "G4ProjectiveSegmentation::getRadius()" << G4endl; - - return ReadoutUtil::computeMidPos(aStep).mag(); -} -double G4ProjectiveSegmentation::getRadius(const G4StepPoint* aPreStepPoint) -{ - //G4cout << "G4ProjectiveSegmentation::getRadius()" << G4endl; - return aPreStepPoint->GetPosition().mag(); -} - -// default impl. returns z of pos -double G4ProjectiveSegmentation::getZ(const G4Step* aStep) -{ - //G4cout << "G4ProjectiveSegmentation::getZ()" << G4endl; - return ReadoutUtil::computeMidPos(aStep).z(); -} - -double G4ProjectiveSegmentation::getZ(const G4StepPoint* aPreStepPoint) -{ - //G4cout << "G4ProjectiveSegmentation::getZ()" << G4endl; - return aPreStepPoint->GetPosition().z(); -} - -double G4ProjectiveSegmentation::getThetaDim(const int &thetaBin) const -{ - return G4Segmentation::computeDim(thetaBin, m_divTheta); -} - -double G4ProjectiveSegmentation::getPhiDim(const int &phiBin) const -{ - return G4Segmentation::computeDim(phiBin, m_divPhi); -} - -double G4ProjectiveSegmentation::getThetaDim(const G4Step* aStep) -{ - //G4cout << "G4ProjectiveSegmentation::getThetaDim(G4Step*)" << G4endl; - G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); - double ctheta = getThetaDim(getThetaBin(globalStepPos)); - return ctheta; -} - -double G4ProjectiveSegmentation::getThetaDim(const G4StepPoint* aPreStepPoint) -{ - //G4cout << "G4ProjectiveSegmentation::getThetaDim(G4Step*)" << G4endl; - G4ThreeVector globalStepPos = aPreStepPoint->GetPosition(); - double ctheta = getThetaDim(getThetaBin(globalStepPos)); - return ctheta; -} - -double G4ProjectiveSegmentation::getPhiDim(const G4Step* aStep) -{ - //G4cout << "G4ProjectiveSegmentation::getPhiDim(G4Step*)" << G4endl; - - G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep); - double cphi = getPhiDim(getPhiBin(globalStepPos)); - return cphi; -} -double G4ProjectiveSegmentation::getPhiDim(const G4StepPoint* aPreStepPoint) -{ - //G4cout << "G4ProjectiveSegmentation::getPhiDim(G4Step*)" << G4endl; - - G4ThreeVector globalStepPos = aPreStepPoint->GetPosition(); - double cphi = getPhiDim(getPhiBin(globalStepPos)); - return cphi; -} -
diff -N G4ProjectiveZPlaneSegmentation.cc --- G4ProjectiveZPlaneSegmentation.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,41 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4ProjectiveZPlaneSegmentation.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4ProjectiveZPlaneSegmentation.hh" -#include "lcdd/detectors/ReadoutUtil.hh" - -G4ProjectiveZPlaneSegmentation::G4ProjectiveZPlaneSegmentation(G4int ntheta, G4int nphi) : - G4ProjectiveSegmentation(ntheta, nphi) -{ -} - -G4ProjectiveZPlaneSegmentation::~G4ProjectiveZPlaneSegmentation() -{ -} - -double G4ProjectiveZPlaneSegmentation::getRadius(const G4Step* aStep) -{ - double zcell = getZ(aStep); - double ctheta = G4ProjectiveSegmentation::getThetaDim(aStep); - double rcyl = zcell * tan(ctheta); - return rcyl; -} -double G4ProjectiveZPlaneSegmentation::getRadius(const G4StepPoint* aPreStepPoint) -{ - double zcell = getZ(aPreStepPoint); - double ctheta = G4ProjectiveSegmentation::getThetaDim(aPreStepPoint); - double rcyl = zcell * tan(ctheta); - return rcyl; -} - -double G4ProjectiveZPlaneSegmentation::getZ(const G4Step* aStep) -{ - G4ThreeVector gpos = ReadoutUtil::getVolumeGlobalPosition(aStep->GetPreStepPoint(), G4ThreeVector()); - return gpos.z(); -} - -double G4ProjectiveZPlaneSegmentation::getZ(const G4StepPoint* aPreStepPoint) -{ - G4ThreeVector gpos = ReadoutUtil::getVolumeGlobalPosition(aPreStepPoint, G4ThreeVector()); - return gpos.z(); -}
diff -N G4ScorerSD.cc --- G4ScorerSD.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,98 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4ScorerSD.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4ScorerSD.hh" -#include "lcdd/detectors/ReadoutUtil.hh" -#include "lcdd/hits/TrackInformation.hh" - -G4ScorerSD::G4ScorerSD(G4String sdName, G4String hcName) : - G4TrackerSD(sdName, hcName), m_currentTrackID(-1) -{ -} - -G4bool G4ScorerSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) -{ -#ifdef G4VERBOSE - if ( m_verbose > 1 ) { - std::cout << "G4ScorerSD::ProcessHits() - " << this->GetName() << std::endl; - } -#endif - - G4SensitiveDetector::ProcessHits(aStep, 0); - - bool sameTrack = false; - -#ifdef G4VERBOSE - if ( m_verbose > 3 ) { - std::cout << "current trackID <" << m_currentTrackID << ">" << std::endl; - } -#endif - - if ((m_currentTrackID == -1) || (m_currentTrackID != trackID())) { - -#ifdef G4VERBOSE - if ( m_verbose > 2 ) { - std::cout << "new track <" << trackID() << ">" << std::endl; - } -#endif - - m_currentTrackID = trackID(); - } else { -#ifdef G4VERBOSE - if ( m_verbose > 2 ) { - std::cout << "old track <" << trackID() << ">" << std::endl; - } -#endif - - sameTrack = true; - } - - if (!sameTrack) { - -#ifdef G4VERBOSE - if ( m_verbose > 2 ) { - std::cout << "writing hit" << std::endl; - } -#endif - - // edep - G4double e = edep(); - - // get track information - TrackInformation* trkInfo = trackInformation(); - - // set hit flag in trk info - trkInfo->setHasTrackerHit(true); - - // hit data - G4int trkID = trackID(); - G4double tdep = globalTime(); - G4ThreeVector prepos = prePosition(); - G4ThreeVector meanmom = meanMomentum(); - - // create hit - G4TrackerHit* trkHit = new G4TrackerHit(); - - // create id vector - Id64bit id64 = makeId(); - - // set track hit info - trkHit->setTrackID(trkID); - trkHit->setEdep(e); - trkHit->setPos(prepos); - trkHit->setMomentum(meanmom); - trkHit->setTdep(tdep); - trkHit->setId(id64.getId0()); - trkHit->setLength(ReadoutUtil::computeDistance(aStep)); - - // add to HC - m_HC->insert(trkHit); - } else { -#ifdef G4VERBOSE - if ( m_verbose > 0 ) { - std::cout << "Skipping hit from track <" << m_currentTrackID << ">." << std::endl; - } -#endif - } - return true; -}
diff -N G4Segmentation.cc --- G4Segmentation.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,75 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4Segmentation.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4Segmentation.hh" -#include "lcdd/detectors/ReadoutUtil.hh" - -G4Segmentation::G4Segmentation(EType segType, int nbins) : - m_numBins(nbins), m_type(segType) -{ - // reserve nbins - m_bins.reserve(m_numBins); - - // fill in 0 vals - resetBins(); -} - -G4Segmentation::~G4Segmentation() -{ -} - -void G4Segmentation::setBin(int binIdx, int binVal) -{ - m_bins.insert(m_bins.begin() + binIdx, binVal); -} - -int G4Segmentation::getNumberOfBins() -{ - return m_numBins; -} - -const std::vector<int>& G4Segmentation::getBins() -{ - return m_bins; -} - -G4Segmentation::EType G4Segmentation::getType() -{ - return m_type; -} - -G4ThreeVector G4Segmentation::getGlobalHitPos(const G4Step* aStep) -{ - return ReadoutUtil::computeMidPos(aStep); -} - -G4ThreeVector G4Segmentation::getGlobalHitPosPreStep(const G4StepPoint* aPreStepPoint) -{ - //G4Exception("Do not use this method!"); - return aPreStepPoint->GetPosition(); -} - -void G4Segmentation::resetBins() -{ - m_bins.clear(); -} - -void G4Segmentation::printOutBins(std::ostream& os, const std::vector<int>& bins) -{ - os << "segmentationBins <" << bins.size() << "> :: "; - for (std::vector<int>::const_iterator iter = bins.begin(); iter != bins.end(); iter++) { - os << *iter << " "; - } - os << std::endl; -} - -bool G4Segmentation::isValidSolid(G4VSolid* s) -{ - bool valid = true; - - if (0 == s) { - valid = false; - } - - return valid; -}
diff -N G4SegmentationFactory.cc --- G4SegmentationFactory.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,172 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4SegmentationFactory.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4SegmentationFactory.hh" -#include "lcdd/schema/grid_xyz.hh" -#include "lcdd/schema/global_grid_xy.hh" -#include "lcdd/schema/nonprojective_cylinder.hh" -#include "lcdd/schema/projective_cylinder.hh" -#include "lcdd/schema/projective_zplane.hh" -#include "lcdd/schema/cell_readout_2d.hh" -#include "lcdd/detectors/G4Segmentation.hh" -#include "lcdd/detectors/G4GridXYZSegmentation.hh" -#include "lcdd/detectors/G4GlobalGridXYSegmentation.hh" -#include "lcdd/detectors/G4ProjectiveCylinderSegmentation.hh" -#include "lcdd/detectors/G4ProjectiveZPlaneSegmentation.hh" -#include "lcdd/detectors/G4NonprojectiveCylinderSegmentation.hh" -#include "lcdd/detectors/CellReadout2DSegmentation.hh" - -// GDML -#include "Saxana/SAXObject.h" -#include "G4Processor/GDMLProcessor.h" -#include "G4Evaluator/GDMLExpressionEvaluator.h" - -// STL -#include <iostream> - -G4Segmentation* G4SegmentationFactory::createSegmentation(SAXObject* obj, const std::string& tag) -{ - G4Segmentation* seg = 0; - GDMLExpressionEvaluator* calc = GDMLProcessor::GetInstance()->GetEvaluator(); - - if (tag == "projective_cylinder") { - projective_cylinder* prj = dynamic_cast<projective_cylinder*>(obj); - if (prj) { - int ntheta, nphi; - std::string sval = prj->get_ntheta(); - ntheta = (int) calc->Eval(sval); - sval = prj->get_nphi(); - nphi = (int) calc->Eval(sval); - seg = new G4ProjectiveCylinderSegmentation(ntheta, nphi); - } else { - std::cerr << "Failed cast to projective_cylinder!" << std::endl; - } - - } else if (tag == "grid_xyz") { - // GridXYZ - grid_xyz* np = dynamic_cast<grid_xyz*>(obj); - if (np) { - double gsx, gsy, gsz; - gsx = gsy = gsz = 0.; - std::string lunit = np->get_lunit(); - - std::string sval = np->get_gridSizeX(); - sval += "*" + lunit; - gsx = calc->Eval(sval); - - sval = np->get_gridSizeY(); - sval += "*" + lunit; - gsy = calc->Eval(sval); - - sval = np->get_gridSizeZ(); - sval += "*" + lunit; - gsz = calc->Eval(sval); - - //std::cout << "grid x, y, z: " << gsx << ", " << gsy << ", " << gsz << std::endl; - - seg = new G4GridXYZSegmentation(gsx, gsy, gsz); - } else { - std::cerr << "Failed cast to grid_xyz!" << std::endl; - } - } - // GlobalGridXY - else if (tag == "global_grid_xy") { - global_grid_xy* gridxy = dynamic_cast<global_grid_xy*>(obj); - if (gridxy) { - double gsx, gsy; - gsx = gsy = 0.; - std::string lunit = gridxy->get_lunit(); - - std::string sval = gridxy->get_gridSizeX(); - sval += "*" + lunit; - gsx = calc->Eval(sval); - - sval = gridxy->get_gridSizeY(); - sval += "*" + lunit; - gsy = calc->Eval(sval); - - seg = new G4GlobalGridXYSegmentation(gsx, gsy); - } else { - std::cerr << "Failed cast to global_grid_xy!" << std::endl; - } - } else if (tag == "nonprojective_cylinder") { - // handle NP cylinder - - //std::cout << "add nonprojective_cylinder here" << std::endl; - - nonprojective_cylinder* np = dynamic_cast<nonprojective_cylinder*>(obj); - if (np) { - - double gsp = 0; - double gsz = 0; - - std::string lunit = np->get_lunit(); - - std::string sval = np->get_gridSizePhi(); - sval += "*" + lunit; - gsp = calc->Eval(sval); - - sval = np->get_gridSizeZ(); - sval += "*" + lunit; - gsz = calc->Eval(sval); - - seg = new G4NonprojectiveCylinderSegmentation(gsp, gsz); - } else { - std::cerr << "Failed cast to nonprojective_cylinder!" << std::endl; - } - } else if (tag == "projective_zplane") { - // handle projective_zplane - - //std::cout << "add projective_zplane here" << std::endl; - - projective_zplane* prj = dynamic_cast<projective_zplane*>(obj); - - if (prj) { - - int ntheta, nphi; - std::string sval = prj->get_ntheta(); - ntheta = (int) calc->Eval(sval); - sval = prj->get_nphi(); - nphi = (int) calc->Eval(sval); - - //std::cout << "ntheta, nphi : " - // << ntheta << ", " - // << nphi << std::endl; - - seg = new G4ProjectiveZPlaneSegmentation(ntheta, nphi); - } else { - std::cerr << "Failed cast to projective_zplane!" << std::endl; - } // prj no exist - } else if (tag == "cell_readout_2d") { - - //std::cout << "building cell_readout_2d" << std::endl; - - cell_readout_2d* elem = dynamic_cast<cell_readout_2d*>(obj); - if (0 != elem) { - double cellSizeX, cellSizeY; - cellSizeX = cellSizeY = 0; - std::string lengthUnit = elem->getLengthUnit(); - - std::string val = elem->getCellSizeX(); - val += "*" + lengthUnit; - cellSizeX = calc->Eval(val); - - val = elem->getCellSizeY(); - val += "*" + lengthUnit; - cellSizeY = calc->Eval(val); - - //std::cout << "G4SegmentationFactory creating CellReadout2DSegmentation(x,y): " << cellSizeX << " " << cellSizeY << std::endl; - - seg = new CellReadout2DSegmentation(cellSizeX, cellSizeY); - } - } else { - // bad segmentation tag - std::cerr << "Unknown child tag for calorimeter: " << tag << "." << std::endl; - } - - if (seg == 0) { - G4Exception("", "", FatalException, "Failed to create segmentation."); - } - - return seg; -}
diff -N G4SensitiveDetector.cc --- G4SensitiveDetector.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,186 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4SensitiveDetector.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4SensitiveDetector.hh" -#include "lcdd/id/IdManager.hh" -#include "lcdd/id/IdFactory.hh" -#include "lcdd/detectors/SensitiveDetectorMessenger.hh" -#include "lcdd/hits/TrackInformation.hh" - -// Geant4 -#include "G4EventManager.hh" -#include "G4Event.hh" -#include "G4SDManager.hh" -#include "G4UImessenger.hh" -#include "G4VHitsCollection.hh" -#include "G4LogicalVolumeStore.hh" -#include "G4UnitsTable.hh" - -// STL -#include <iostream> -#include <vector> - -using std::vector; - -const std::string& G4SensitiveDetector::trackerStr = "tracker"; -const std::string& G4SensitiveDetector::calorimeterStr = "calorimeter"; -const std::string& G4SensitiveDetector::noneStr = "none"; - -G4SensitiveDetector::G4SensitiveDetector(G4String sdName, G4String hcName, EType sdType) : - G4VSensitiveDetector(sdName), m_idspec(0), m_type(sdType) -{ - // insert hits collection name into SD's name vector - collectionName.insert(hcName); - - // register detector with G4SDManager - G4SDManager::GetSDMpointer()->AddNewDetector(this); - - // Create the command messenger. - m_messenger = new SensitiveDetectorMessenger(this); - - // Only one HC - m_hcids.clear(); - m_hcids.push_back(-1); -} - -G4SensitiveDetector::G4SensitiveDetector(G4String sdName, const vector<G4String>& hcNames, EType sdType) : - G4VSensitiveDetector(sdName), m_idspec(0), m_type(sdType) -{ - m_hcids.clear(); - - for (int i = 0; i < (int) hcNames.size(); i++) { - // insert hits collection name into SD's name vector - collectionName.insert(hcNames[i]); - m_hcids.push_back(-1); - } - - // register detector with G4SDManager - G4SDManager::GetSDMpointer()->AddNewDetector(this); - - // Create the command messenger. - m_messenger = new SensitiveDetectorMessenger(this); -} - -G4SensitiveDetector::~G4SensitiveDetector() -{ -} - -void G4SensitiveDetector::Initialize(G4HCofThisEvent *) -{ - // no-op -} - -void G4SensitiveDetector::EndOfEvent(G4HCofThisEvent *) -{ - // no-op -} - -G4bool G4SensitiveDetector::ProcessHits(G4Step* aStep, G4TouchableHistory*) -{ - // set cached step - setStep(aStep); - - // doesn't write a hit - return false; -} - -const std::string& G4SensitiveDetector::getTypeString() const -{ - if (m_type == eTracker) { - return trackerStr; - } else if (m_type == eCalorimeter) { - return calorimeterStr; - } - return noneStr; -} - -std::ostream& G4SensitiveDetector::printBasicInfo(std::ostream& os) -{ - os << "name: " << GetName() << std::endl; - os << "type: " << m_type << std::endl; - os << "hits collection: " << this->getHCName() << std::endl; - os << "hits collection ID: " << m_hcids[0] << std::endl; - os << "energy cut: " << G4BestUnit(m_ecut, "Energy") << std::endl; - os << "endcap flag: " << m_endcap << std::endl; - os << "verbose level: " << m_verbose << std::endl; - - if (m_idspec != 0) { - os << "id spec: " << m_idspec->getName() << std::endl; - os << "id fields:"; - for (IdSpec::IdFields::const_iterator it = m_idspec->IdFieldsBegin(); it != m_idspec->IdFieldsEnd(); it++) { - os << " " << (*it)->getLabel(); - } - os << std::endl; - } else { - os << "idspec points to null!" << std::endl; - } - - return os; -} - -Id64bit G4SensitiveDetector::makeId() const -{ - Id64bit id64; - if (hasIdSpec()) { - - // get idvec ordered by this idspec - const IdVec ids = IdFactory::createOrderedIdVec(step(), this); - - // pack into 64 bit cell id - id64 = IdFactory::createId64bit(ids, getIdSpec()); - } - return id64; -} - -G4VHitsCollection* G4SensitiveDetector::getHitsCollection() const -{ - G4VHitsCollection* hc = 0; - if (this->getHCID() != -1) { - hc = G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetHCofThisEvent()->GetHC(this->getHCID()); - } - return hc; -} - -G4VHitsCollection* G4SensitiveDetector::getHitsCollection(G4int nHC) const -{ - G4VHitsCollection* hc = 0; - if (this->getHCID(nHC) != -1) { - hc = G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetHCofThisEvent()->GetHC(this->getHCID(nHC)); - } - return hc; -} - -std::ostream& G4SensitiveDetector::printNumberOfHits(std::ostream& os) -{ - for (int i = 0; i < getNumberOfHitsCollections(); i++) { - os << getHitsCollection(i)->GetName() << " " << getHitsCollection(i)->GetSize() << std::endl; - } - return os; -} - -std::ostream& G4SensitiveDetector::printEdep(std::ostream& os) -{ - os << "total edep: " << G4BestUnit(this->getEdep(), "Energy") << std::endl; - return os; -} - -std::vector<G4LogicalVolume*> G4SensitiveDetector::getLogicalVolumes() const -{ - std::vector<G4LogicalVolume*> volumes; - for (G4LogicalVolumeStore::const_iterator it = G4LogicalVolumeStore::GetInstance()->begin(); it != G4LogicalVolumeStore::GetInstance()->end(); it++) { - if ((*it)->GetSensitiveDetector() == this) { - volumes.push_back(*it); - } - } - return volumes; -} - -std::ostream& G4SensitiveDetector::printVolumes(std::ostream& os) -{ - std::vector<G4LogicalVolume*> volumes = this->getLogicalVolumes(); - - for (std::vector<G4LogicalVolume*>::const_iterator it = volumes.begin(); it != volumes.end(); it++) { - std::cout << (*it)->GetName() << std::endl; - } - return os; -}
diff -N G4TrackerCombineSD.cc --- G4TrackerCombineSD.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,260 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4TrackerCombineSD.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4TrackerCombineSD.hh" -#include "lcdd/detectors/ReadoutUtil.hh" -#include "lcdd/hits/TrackInformation.hh" - -G4TrackerCombineSD::G4TrackerCombineSD(G4String sdName, G4String hcName) : - G4TrackerSD(sdName, hcName), m_combineHits(false), m_currentTrackID(-1), m_currentPV(0), m_edepTotal(0), m_minTime(0), m_startedHit(false), m_currentTrack(false) -{ -} - -G4TrackerCombineSD::~G4TrackerCombineSD() -{ -} - -void G4TrackerCombineSD::EndOfEvent(G4HCofThisEvent *hce) -{ - G4TrackerSD::EndOfEvent(hce); - clear(); -} - -G4bool G4TrackerCombineSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) -{ - // set cached step - G4SensitiveDetector::ProcessHits(aStep, 0); - -#ifdef G4VERBOSE - if (getVerbose() > 0) { - G4cout << "G4TrackerCombineSD::ProcessHits - " << GetName() << G4endl; - G4cout << "trackID - " << trackID() << G4endl; - G4cout << "particle - " << track()->GetDefinition()->GetParticleName() << G4endl; - G4cout << "edep - " << step()->GetTotalEnergyDeposit() << 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 - - // Return value indicating whether a hit was inserted. - bool r = false; - - // Started a hit already? - if (!m_startedHit) { - - // If no hit, then start a new hit on the pre-step. - startHit(pre()); - } - - // Check if the cached trackID is valid. - if (m_currentTrackID != -1) { - - // Is this step's trackID different from the cached trackID? - if (trackID() != m_currentTrackID) { - -#ifdef G4VERBOSE - if ( getVerbose() > 0 ) { - G4cout << "new track ID this step!" << G4endl; - } -#endif - - // Insert the hit on the old track. - r = insertHit(); - - // Start a new hit on the pre-step. - startHit(pre()); - } - } -#ifdef G4DEBUG - else { - std::cout << GetName() << "::WARNING : current TrackID == -1" << std::endl; - } -#endif - - // Update the hit, checking if the call to this function is applicable. - updateHit(); - - // Entering a new PV on this step? - if (prePV() != postPV()) { - -#ifdef G4VERBOSE - if ( getVerbose() > 0 ) { - G4cerr << "new physvol this step!" << G4endl; - } -#endif - - // Insert the current hit. - r = insertHit(); - - // Check if pre and post steps have the same detector. - if (hasSameSD()) { - - // Start a new hit for the adjacent tracker layer. - startHit(post()); - } - } - // Special case where the track status is StopAndKill. - // If so, we won't see it again, so need to insert the hit. - else if (m_currentTrack->GetTrackStatus() == fStopAndKill) { - r = insertHit(); - } - -#ifdef G4VERBOSE - if ( getVerbose() > 0 ) { - G4cerr << "----" << G4endl; - } -#endif - - return r; -} - -void G4TrackerCombineSD::updateHit() -{ - -#ifdef G4VERBOSE - if ( getVerbose() > 1 ) { - G4cout << "updateHit" << G4endl; - } -#endif - - // can only update if started hit - if (m_startedHit) { - - // incr edep - m_edepTotal += edep(); - - // first time only - if (m_minTime == 0) { - m_minTime = globalTime(); - } - - // exit point and momentum - m_exitPoint = postPosition(); - m_exitMomentum = postMomentum(); - } -} - -void G4TrackerCombineSD::clear() -{ -#ifdef G4VERBOSE - if ( getVerbose() > 1 ) { - G4cout << "clear" << G4endl; - } -#endif - - m_minTime = 0; - m_edepTotal = 0; - m_currentPV = 0; - m_currentTrackID = -1; - m_startedHit = false; -} - -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() && !isGeantino() ) { -#ifdef G4VERBOSE - if ( getVerbose() > 0 ) { - std::cout << GetName() << " : cut this edep " << m_edepTotal << std::endl; - } - -#endif - clear(); - return false; - } - - // compute mid point - G4ThreeVector midPoint = - ReadoutUtil::computeThreeVectorMean(m_entryPoint, m_exitPoint); - - // compute mean momentum - G4ThreeVector meanMom = - ReadoutUtil::computeThreeVectorMean(m_entryMomentum, m_exitMomentum); - - // compute distance from start to entry - G4double pathlength = ReadoutUtil::computeDistance(m_entryPoint, m_exitPoint); - - // hit data - G4TrackerHit* trkhit = new G4TrackerHit(); - trkhit->setTdep(m_minTime); - trkhit->setEdep(m_edepTotal); - trkhit->setPos(midPoint); - trkhit->setMomentum(meanMom); - trkhit->setTrackID(m_currentTrackID); - trkhit->setLength(pathlength); - - // set id - Id64bit id64 = makeId(); - trkhit->setId(id64.getId0()); - -#ifdef G4VERBOSE - if ( getVerbose() > 1 ) { - std::cout << GetName() << " : inserting new tracker hit" << std::endl; - std::cout << *trkhit << std::endl; - std::cout << "entryPoint = " << m_entryPoint << std::endl; - std::cout << "entryPointR = " << m_entryPoint.mag() << std::endl; - std::cout << "midPoint = " << midPoint << std::endl; - std::cout << "midPointR = " << midPoint.mag() << std::endl; - std::cout << "exitPoint = " << m_exitPoint << std::endl; - std::cout << "exitPointR = " << m_exitPoint.mag() << std::endl; - std::cout << "(exitPointR - entryPointR) / 2 = " << (m_exitPoint.mag() - m_entryPoint.mag()) / 2 << std::endl; - std::cout << std::endl; - } -#endif - - m_HC->insert(trkhit); - - TrackInformation::getTrackInformation( m_currentTrack )->setHasTrackerHit( true ); - - // 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_currentTrack = step()->GetTrack(); - m_currentPV = aStepPoint->GetPhysicalVolume(); - m_entryPoint = m_exitPoint = aStepPoint->GetPosition(); - m_entryMomentum = m_exitMomentum = aStepPoint->GetMomentum(); - m_currentTrackID = trackID(); - m_startedHit = true; - -#ifdef G4VERBOSE - if ( getVerbose() > 2 ) { - std::cout << GetName() << " : starting new hit" << std::endl; - std::cout << "volume = " << m_currentPV->GetName() << std::endl; - std::cout << "trackID = " << m_currentTrackID << std::endl; - std::cout << "entry point = " << m_entryPoint << std::endl; - } -#endif -} -
diff -N G4TrackerSD.cc --- G4TrackerSD.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,141 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/Attic/G4TrackerSD.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/id/IdManager.hh" -#include "lcdd/id/IdFactory.hh" -#include "lcdd/id/IdVec.hh" -#include "lcdd/detectors/G4TrackerSD.hh" -#include "lcdd/detectors/ReadoutUtil.hh" -#include "lcdd/hits/G4TrackerHit.hh" -#include "lcdd/hits/TrackInformation.hh" - -// Geant4 -#include "G4Geantino.hh" - -// STL -#include <iostream> - -G4TrackerSD::G4TrackerSD(G4String sdName, G4String hcName) : - G4SensitiveDetector(sdName, hcName, G4SensitiveDetector::eTracker), m_HC(0) -{ - m_hits.clear(); -} - -G4TrackerSD::~G4TrackerSD() -{ -} - -void G4TrackerSD::Initialize(G4HCofThisEvent *HCE) -{ - clearHits(); - - // create tracker hits coll - m_HC = new G4TrackerHitsCollection(GetName(), collectionName[0]); - - // set HCID - if (getHCID() < 0) { - setHCID(GetCollectionID(0)); - } - - // add collection to HC of event - HCE->AddHitsCollection(getHCID(), m_HC); -} - -G4bool G4TrackerSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) -{ - // set cached step - G4SensitiveDetector::ProcessHits(aStep, 0); - - // edep - G4double e = edep(); - - // check edep < cut - if (e <= getEcut() && !isGeantino()) { - return false; - } - - // get track information - TrackInformation* trkInfo = trackInformation(); - - // set hit flag in trk info - trkInfo->setHasTrackerHit(true); - - // hit data - G4int trkID = trackID(); - G4double tdep = globalTime(); - G4ThreeVector midPos = midPosition(); - G4ThreeVector prePos = aStep->GetPreStepPoint()->GetPosition(); - G4ThreeVector postPos = aStep->GetPostStepPoint()->GetPosition(); - double avgMom = (pre()->GetMomentum().mag() + post()->GetMomentum().mag()) / 2; - G4ThreeVector mom = (postPos - prePos); - if (mom.mag() > 0) { - mom.setMag(avgMom); - } else { - std::cerr << "prePos - postPos = 0 --> " << prePos << " | " << postPos << std::endl; - } - - G4double pathLength = ReadoutUtil::computeDistance(aStep); - - // create hit - G4TrackerHit* trkHit = new G4TrackerHit(); - - // create id vector - Id64bit id64 = makeId(); - - // set track hit info - trkHit->setTrackID(trkID); - trkHit->setEdep(e); - trkHit->setPos(midPos); - trkHit->setMomentum(mom); - trkHit->setTdep(tdep); - trkHit->setId(id64.getId0()); - trkHit->setLength(pathLength); - - // add to HC - m_HC->insert(trkHit); - - m_hits.push_back(trkHit); - - return true; -} - -std::ostream& G4TrackerSD::printHits(std::ostream& os) -{ - for (G4TrackerHitList::const_iterator iter = m_hits.begin(); iter != m_hits.end(); iter++) { - os << (*(const_cast<const G4TrackerHit*>(*iter))); - } - os << std::endl; - return os; -} - -void G4TrackerSD::EndOfEvent(G4HCofThisEvent *) -{ -#ifdef G4VERBOSE - if ( getVerbose() > 0 ) { - std::cout << GetName() << " has " << m_HC->GetSize() << " hits." << std::endl; - } - - if ( getVerbose() > 1 ) { - printHits ( std::cout ); - } -#endif -} - -double G4TrackerSD::getEdep() const -{ - double edep = 0.0; - for (G4TrackerHitList::const_iterator it = m_hits.begin(); it != m_hits.end(); it++) { - edep += (*it)->getEdep(); - } - return edep; -} - -void G4TrackerSD::clearHits() -{ - m_hits.clear(); -} - -G4TrackerSD::G4TrackerHitList G4TrackerSD::getTrackerHitList() -{ - return m_hits; -}
diff -N G4UnsegmentedCalorimeterSD.cc --- G4UnsegmentedCalorimeterSD.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,69 +0,0 @@
-// $Id: G4UnsegmentedCalorimeterSD.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/detectors/G4UnsegmentedCalorimeterSD.hh" - -G4UnsegmentedCalorimeterSD::G4UnsegmentedCalorimeterSD(G4String sdName, G4String hcName, G4Segmentation* seg) : - G4CalorimeterSD(sdName, hcName, seg) -{ -} - -G4bool G4UnsegmentedCalorimeterSD::ProcessHits(G4Step* aStep, G4TouchableHistory*) -{ -#ifdef G4VERBOSE - if ( getVerbose() > 0 ) - { - std::cout << "G4UnsegmentedCalorimeterSD::ProcessHits - " << this->GetName() << std::endl; - } -#endif - - /* Cache the step information. */ - G4SensitiveDetector::ProcessHits(aStep, 0); - - /* Get the energy deposition. */ - G4double theEdep = edep(); - - /* - * This needs to be a <= comparison for cutting on 0, - * but it allows geantinos, which always have 0 edep. - */ - if (theEdep <= getEcut() && !isGeantino()) { -#ifdef G4VERBOSE - if ( getVerbose() > 2 ) - { - std::cout << "G4UnsegmentedCalorimeterSD::ProcessHits - cut on edep " << theEdep << std::endl; - } -#endif - return false; - } - - /* Get the step mid position. */ - G4ThreeVector hitPos = midPosition(); - - //std::cout << "hit at " << hitPos << std::endl; - - /* Reset the segmentation bins. */ - //m_segmentation->resetBins(); - /* Set the segmentation bins. */ - //m_segmentation->setBins( aStep ); - /* Create a 64-bit ID. */ - Id64bit id64 = makeId(); - - /* Create a new hit. */ - G4CalorimeterHit* thisHit = new G4CalorimeterHit(theEdep, hitPos); - - /* Set the 64-bit ID. */ - thisHit->setId64bit(id64.getId0(), id64.getId1()); - - /* Add hit to lookup map. */ - hits_vector[0].push_back(thisHit); - - /* Add hit to the HC. */ - m_hitsCollections[0]->insert(thisHit); - - /* Add an MCParticle contribution for this hit. */ - thisHit->addMcpHitContrib(McpHitContrib(aStep)); - - /* Success. */ - return true; -}
diff -N PhysicsLimitSet.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ PhysicsLimitSet.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,123 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/geant4/PhysicsLimitSet.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/geant4/PhysicsLimitSet.hh" + +// Geant4 +#include "G4Track.hh" + +/* Code for any particle. */ +const PhysicsLimitSet::ParticleType PhysicsLimitSet::ANY_PARTICLE = "*"; + +/* Code for no limit, as -1 is never a valid limit. */ +const PhysicsLimitSet::LimitValueType PhysicsLimitSet::LIMIT_NOT_SET = -1; + +/* Keys to limit value maps for each parameter. */ +const PhysicsLimitSet::LimitNameKeyType PhysicsLimitSet::STEP_LENGTH_MAX_KEY = "step_length_max"; +const PhysicsLimitSet::LimitNameKeyType PhysicsLimitSet::TRACK_LENGTH_MAX_KEY = "track_length_max"; +const PhysicsLimitSet::LimitNameKeyType PhysicsLimitSet::TIME_MAX_KEY = "time_max"; +const PhysicsLimitSet::LimitNameKeyType PhysicsLimitSet::EKIN_MIN_KEY = "ekin_min"; +const PhysicsLimitSet::LimitNameKeyType PhysicsLimitSet::RANGE_MIN_KEY = "range_min"; + +/* Default values for limits. Taken from G4UserLimit ctor default args. */ +const PhysicsLimitSet::LimitValueType PhysicsLimitSet::STEP_LENGTH_MAX_DEFAULT = DBL_MAX; +const PhysicsLimitSet::LimitValueType PhysicsLimitSet::TRACK_LENGTH_MAX_DEFAULT = DBL_MAX; +const PhysicsLimitSet::LimitValueType PhysicsLimitSet::TIME_MAX_DEFAULT = DBL_MAX; +const PhysicsLimitSet::LimitValueType PhysicsLimitSet::EKIN_MIN_DEFAULT = 0.; +const PhysicsLimitSet::LimitValueType PhysicsLimitSet::RANGE_MIN_DEFAULT = 0.; + +PhysicsLimitSet::PhysicsLimitSet(const G4String& name) : + G4UserLimits("G4LimitSet"), m_name(name) +{ + m_limitsMap[STEP_LENGTH_MAX_KEY] = LimitMap(); + m_limitsMap[TRACK_LENGTH_MAX_KEY] = LimitMap(); + m_limitsMap[TIME_MAX_KEY] = LimitMap(); + m_limitsMap[EKIN_MIN_KEY] = LimitMap(); + m_limitsMap[RANGE_MIN_KEY] = LimitMap(); +} + +PhysicsLimitSet::~PhysicsLimitSet() +{ +} + +G4double PhysicsLimitSet::GetMaxAllowedStep(const G4Track& aTrack) +{ + double maxStepLength = getLimitForParticle(STEP_LENGTH_MAX_KEY, aTrack); + return maxStepLength == LIMIT_NOT_SET ? STEP_LENGTH_MAX_DEFAULT : maxStepLength; +} + +G4double PhysicsLimitSet::GetUserMaxTrackLength(const G4Track& aTrack) +{ + double maxTrackLength = getLimitForParticle(TRACK_LENGTH_MAX_KEY, aTrack); + return maxTrackLength == LIMIT_NOT_SET ? TRACK_LENGTH_MAX_DEFAULT : maxTrackLength; +} + +G4double PhysicsLimitSet::GetUserMaxTime(const G4Track& aTrack) +{ + double maxTime = getLimitForParticle(TIME_MAX_KEY, aTrack); + return maxTime == LIMIT_NOT_SET ? TIME_MAX_DEFAULT : maxTime; +} + +G4double PhysicsLimitSet::GetUserMinEkine(const G4Track& aTrack) +{ + double minEkine = getLimitForParticle(EKIN_MIN_KEY, aTrack); + return minEkine == LIMIT_NOT_SET ? EKIN_MIN_DEFAULT : minEkine; +} + +G4double PhysicsLimitSet::GetUserMinRange(const G4Track& aTrack) +{ + double minRange = getLimitForParticle(RANGE_MIN_KEY, aTrack); + return minRange == LIMIT_NOT_SET ? RANGE_MIN_DEFAULT : minRange; +} + +const PhysicsLimitSet::ParticleType PhysicsLimitSet::getParticleType(const G4Track& aTrack) +{ + return aTrack.GetDefinition()->GetParticleName(); +} + +void PhysicsLimitSet::setLimitForParticle(LimitNameType limitName, ParticleType particleType, LimitValueType limitValue) +{ + if (m_limitsMap.find(limitName) != m_limitsMap.end()) { + m_limitsMap[limitName][particleType] = limitValue; + } else { + G4Exception("", "", FatalException, "Invalid limits map."); + } +} + +PhysicsLimitSet::LimitValueType PhysicsLimitSet::getLimitForParticle(LimitNameType limitName, ParticleType particleType) +{ + //std::cout << "G4LimitSet::getLimitForParticle()" << std::endl; + //std::cout << "limitName, particleType: " << limitName << " " << particleType << std::endl; + LimitValueType limitValue = 0; + if (m_limitsMap.find(limitName) != m_limitsMap.end()) { + if (m_limitsMap[limitName].find(particleType) != m_limitsMap[limitName].end()) { + limitValue = m_limitsMap[limitName][particleType]; + } else { + if ((m_limitsMap[limitName].find(ANY_PARTICLE) != m_limitsMap[limitName].end())) { + limitValue = m_limitsMap[limitName][ANY_PARTICLE]; + } else { + limitValue = LIMIT_NOT_SET; + } + } + } else { + G4Exception("", "", FatalException, "Invalid limits map."); + } + //std::cout << "limitValue: " << limitValue << std::endl; + return limitValue; +} + +PhysicsLimitSet::LimitValueType PhysicsLimitSet::getLimitForParticle(LimitNameType limitName, const G4Track& aTrack) +{ + return getLimitForParticle(limitName, getParticleType(aTrack)); +} + +void PhysicsLimitSet::setName(const G4String& n) +{ + m_name = n; +} + +G4String& PhysicsLimitSet::getName() +{ + return m_name; +} +
diff -N G4LimitSet.cc --- G4LimitSet.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,123 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/geant4/Attic/G4LimitSet.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/geant4/G4LimitSet.hh" - -// Geant4 -#include "G4Track.hh" - -/* Code for any particle. */ -const G4LimitSet::ParticleType G4LimitSet::ANY_PARTICLE = "*"; - -/* Code for no limit, as -1 is never a valid limit. */ -const G4LimitSet::LimitValueType G4LimitSet::LIMIT_NOT_SET = -1; - -/* Keys to limit value maps for each parameter. */ -const G4LimitSet::LimitNameKeyType G4LimitSet::STEP_LENGTH_MAX_KEY = "step_length_max"; -const G4LimitSet::LimitNameKeyType G4LimitSet::TRACK_LENGTH_MAX_KEY = "track_length_max"; -const G4LimitSet::LimitNameKeyType G4LimitSet::TIME_MAX_KEY = "time_max"; -const G4LimitSet::LimitNameKeyType G4LimitSet::EKIN_MIN_KEY = "ekin_min"; -const G4LimitSet::LimitNameKeyType G4LimitSet::RANGE_MIN_KEY = "range_min"; - -/* Default values for limits. Taken from G4UserLimit ctor default args. */ -const G4LimitSet::LimitValueType G4LimitSet::STEP_LENGTH_MAX_DEFAULT = DBL_MAX; -const G4LimitSet::LimitValueType G4LimitSet::TRACK_LENGTH_MAX_DEFAULT = DBL_MAX; -const G4LimitSet::LimitValueType G4LimitSet::TIME_MAX_DEFAULT = DBL_MAX; -const G4LimitSet::LimitValueType G4LimitSet::EKIN_MIN_DEFAULT = 0.; -const G4LimitSet::LimitValueType G4LimitSet::RANGE_MIN_DEFAULT = 0.; - -G4LimitSet::G4LimitSet(const G4String& name) : - G4UserLimits("G4LimitSet"), m_name(name) -{ - m_limitsMap[STEP_LENGTH_MAX_KEY] = LimitMap(); - m_limitsMap[TRACK_LENGTH_MAX_KEY] = LimitMap(); - m_limitsMap[TIME_MAX_KEY] = LimitMap(); - m_limitsMap[EKIN_MIN_KEY] = LimitMap(); - m_limitsMap[RANGE_MIN_KEY] = LimitMap(); -} - -G4LimitSet::~G4LimitSet() -{ -} - -G4double G4LimitSet::GetMaxAllowedStep(const G4Track& aTrack) -{ - double maxStepLength = getLimitForParticle(STEP_LENGTH_MAX_KEY, aTrack); - return maxStepLength == LIMIT_NOT_SET ? STEP_LENGTH_MAX_DEFAULT : maxStepLength; -} - -G4double G4LimitSet::GetUserMaxTrackLength(const G4Track& aTrack) -{ - double maxTrackLength = getLimitForParticle(TRACK_LENGTH_MAX_KEY, aTrack); - return maxTrackLength == LIMIT_NOT_SET ? TRACK_LENGTH_MAX_DEFAULT : maxTrackLength; -} - -G4double G4LimitSet::GetUserMaxTime(const G4Track& aTrack) -{ - double maxTime = getLimitForParticle(TIME_MAX_KEY, aTrack); - return maxTime == LIMIT_NOT_SET ? TIME_MAX_DEFAULT : maxTime; -} - -G4double G4LimitSet::GetUserMinEkine(const G4Track& aTrack) -{ - double minEkine = getLimitForParticle(EKIN_MIN_KEY, aTrack); - return minEkine == LIMIT_NOT_SET ? EKIN_MIN_DEFAULT : minEkine; -} - -G4double G4LimitSet::GetUserMinRange(const G4Track& aTrack) -{ - double minRange = getLimitForParticle(RANGE_MIN_KEY, aTrack); - return minRange == LIMIT_NOT_SET ? RANGE_MIN_DEFAULT : minRange; -} - -const G4LimitSet::ParticleType G4LimitSet::getParticleType(const G4Track& aTrack) -{ - return aTrack.GetDefinition()->GetParticleName(); -} - -void G4LimitSet::setLimitForParticle(LimitNameType limitName, ParticleType particleType, LimitValueType limitValue) -{ - if (m_limitsMap.find(limitName) != m_limitsMap.end()) { - m_limitsMap[limitName][particleType] = limitValue; - } else { - G4Exception("", "", FatalException, "Invalid limits map."); - } -} - -G4LimitSet::LimitValueType G4LimitSet::getLimitForParticle(LimitNameType limitName, ParticleType particleType) -{ - //std::cout << "G4LimitSet::getLimitForParticle()" << std::endl; - //std::cout << "limitName, particleType: " << limitName << " " << particleType << std::endl; - LimitValueType limitValue = 0; - if (m_limitsMap.find(limitName) != m_limitsMap.end()) { - if (m_limitsMap[limitName].find(particleType) != m_limitsMap[limitName].end()) { - limitValue = m_limitsMap[limitName][particleType]; - } else { - if ((m_limitsMap[limitName].find(ANY_PARTICLE) != m_limitsMap[limitName].end())) { - limitValue = m_limitsMap[limitName][ANY_PARTICLE]; - } else { - limitValue = LIMIT_NOT_SET; - } - } - } else { - G4Exception("", "", FatalException, "Invalid limits map."); - } - //std::cout << "limitValue: " << limitValue << std::endl; - return limitValue; -} - -G4LimitSet::LimitValueType G4LimitSet::getLimitForParticle(LimitNameType limitName, const G4Track& aTrack) -{ - return getLimitForParticle(limitName, getParticleType(aTrack)); -} - -void G4LimitSet::setName(const G4String& n) -{ - m_name = n; -} - -G4String& G4LimitSet::getName() -{ - return m_name; -} -
diff -N CalorimeterHit.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ CalorimeterHit.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,99 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/hits/CalorimeterHit.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/hits/CalorimeterHit.hh" + +// Geant4 +#ifdef G4VIS_USE +#include "G4VVisManager.hh" +#include "G4VisAttributes.hh" +#include "G4Circle.hh" +#include "G4Point3D.hh" +#include "G4Transform3D.hh" +#endif + +G4Allocator<CalorimeterHit> G4CalorimeterHitAllocator; + +CalorimeterHit::CalorimeterHit() : + G4VHit(), m_edep(0) +{ + ; +} + +CalorimeterHit::CalorimeterHit(G4double edep, G4ThreeVector globalCellPos) : + G4VHit(), m_edep(edep), m_pos(globalCellPos) +{ + ; +} + +CalorimeterHit::~CalorimeterHit() +{ + ; +} + +CalorimeterHit::CalorimeterHit(const CalorimeterHit &right) : + G4VHit() +{ + m_edep = right.m_edep; + m_pos = right.m_pos; +} + +const CalorimeterHit& CalorimeterHit::operator=(const CalorimeterHit &right) +{ + m_edep = right.m_edep; + m_pos = right.m_pos; + + return *this; +} + +bool CalorimeterHit::operator==(const CalorimeterHit &right) +{ + return (m_pos == right.m_pos); +} + +#ifdef G4VIS_USE +void CalorimeterHit::Draw() +{ + G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance(); + + if(pVVisManager) + { + G4Point3D p3D = G4Point3D( m_pos ); + G4Circle chit(p3D); + chit.SetScreenDiameter(3.0); + chit.SetFillStyle(G4Circle::filled); + + G4Colour col(1.0,0.,1.0); + + chit.SetVisAttributes(G4VisAttributes( col ) ); + pVVisManager->Draw( chit ); + } +} +#endif + +void CalorimeterHit::printMcpHitContribs(std::ostream& os) +{ + printMcpHitContribsHeader(os); + + for (McpHitContribList::iterator iter = m_particleList.begin(); iter != m_particleList.end(); iter++) { + (*iter).printOut(os); + } +} + +void CalorimeterHit::printMcpHitContribsHeader(std::ostream& os) +{ + os << "McpHitContribs" << std::endl; + os << "trackID" << '\t' << "edep" << '\t' << '\t' << "PdgId" << '\t' << "time" << std::endl; +} + +void CalorimeterHit::Print() +{ + std::cout << *this << std::endl; +} + +std::ostream& operator<<(std::ostream &os, const CalorimeterHit& hit) +{ + os << hit.getPos() << " " << G4BestUnit(hit.getEdep(), "Energy") << std::endl; + return os; +} +
diff -N HitContribution.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ HitContribution.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,64 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/hits/HitContribution.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/hits/HitContribution.hh" +#include "lcdd/hits/TrackInformation.hh" + +// Geant4 +#include "G4Track.hh" +#include "G4Step.hh" +#include "G4ParticleDefinition.hh" +#include "G4ParticleTypes.hh" + +HitContribution::HitContribution() : + m_trackID(-1), m_edep(0), m_PdgId(9999999), m_globalTime(0) +{ + ; +} + +HitContribution::HitContribution(G4int trackID, G4double edep, G4int PDGID, G4double globalTime) : + m_trackID(trackID), m_edep(edep), m_PdgId(PDGID), m_globalTime(globalTime) +{ + ; +} + +HitContribution::~HitContribution() +{ + ; +} + +HitContribution::HitContribution(const G4Step* aStep) +{ + // Get the track. + const G4Track* aTrack = aStep->GetTrack(); + + // Get the track information. + TrackInformation* trkInfo = static_cast<TrackInformation*>(aTrack->GetUserInformation()); + + // Get the track ID. + m_trackID = trkInfo->getOriginalTrackID(); + + // Set edep according to type of track. + if (aTrack->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition()) { + m_edep = aTrack->GetTotalEnergy(); + } else { + m_edep = aStep->GetTotalEnergyDeposit(); + } + + // PDG ID. + m_PdgId = aTrack->GetDefinition()->GetPDGEncoding(); + + // Global time. + m_globalTime = aTrack->GetGlobalTime(); + + // Compute the step midpoint. + G4ThreeVector posVec = (0.5 * (aStep->GetPreStepPoint()->GetPosition() + aStep->GetPostStepPoint()->GetPosition())); + m_position[0] = posVec[0]; + m_position[1] = posVec[1]; + m_position[2] = posVec[2]; +} + +void HitContribution::printOut(std::ostream& os) +{ + os << m_trackID << '\t' << m_edep << '\t' << m_PdgId << '\t' << m_globalTime << std::endl; +}
diff -N TrackerHit.cc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ TrackerHit.cc 1 Jul 2013 21:00:45 -0000 1.1 @@ -0,0 +1,55 @@
+// $Header: /cvs/lcd/lcdd/src/lcdd/hits/TrackerHit.cc,v 1.1 2013/07/01 21:00:45 jeremy Exp $ + +// LCDD +#include "lcdd/hits/TrackerHit.hh" + +// Geant4 +#ifdef G4VIS_USE +#include "G4VVisManager.hh" +#include "G4VisAttributes.hh" +#include "G4Circle.hh" +#include "G4Point3D.hh" +#include "G4Transform3D.hh" +#endif + +G4Allocator<TrackerHit> G4TrackerHitAllocator; + +TrackerHit::TrackerHit() : + G4VHit(), m_edep(0), m_tdep(0), m_trkID(-1), m_length(0) +{ +} + +TrackerHit::~TrackerHit() +{ +} + +#ifdef G4VIS_USE +void TrackerHit::Draw() +{ + G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance(); + + if(pVVisManager) { + + G4Point3D p3D = G4Point3D( m_pos ); + G4Circle chit(p3D); + chit.SetScreenDiameter(3.0); + chit.SetFillStyle(G4Circle::filled); + + G4Colour col(1.0, 0.0, 1.0); + + chit.SetVisAttributes(G4VisAttributes( col ) ); + pVVisManager->Draw( chit ); + } +} +#endif + +void TrackerHit::Print() +{ + std::cout << *this << std::endl; +} + +std::ostream& operator<<(std::ostream &os, const TrackerHit& hit) +{ + std::cout << hit.getTrackID() << " " << hit.getPos() << " " << G4BestUnit(hit.getEdep(), "Energy") << " " << hit.getMomentum() << " " << G4BestUnit(hit.getLength(), "Length") << " " << G4BestUnit(hit.getTdep(), "Time") << " " << hit.getPDG() << " " << std::endl; + return os; +}
diff -N G4CalorimeterHit.cc --- G4CalorimeterHit.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,99 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/hits/Attic/G4CalorimeterHit.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/hits/G4CalorimeterHit.hh" - -// Geant4 -#ifdef G4VIS_USE -#include "G4VVisManager.hh" -#include "G4VisAttributes.hh" -#include "G4Circle.hh" -#include "G4Point3D.hh" -#include "G4Transform3D.hh" -#endif - -G4Allocator<G4CalorimeterHit> G4CalorimeterHitAllocator; - -G4CalorimeterHit::G4CalorimeterHit() : - G4VHit(), m_edep(0) -{ - ; -} - -G4CalorimeterHit::G4CalorimeterHit(G4double edep, G4ThreeVector globalCellPos) : - G4VHit(), m_edep(edep), m_pos(globalCellPos) -{ - ; -} - -G4CalorimeterHit::~G4CalorimeterHit() -{ - ; -} - -G4CalorimeterHit::G4CalorimeterHit(const G4CalorimeterHit &right) : - G4VHit() -{ - m_edep = right.m_edep; - m_pos = right.m_pos; -} - -const G4CalorimeterHit& G4CalorimeterHit::operator=(const G4CalorimeterHit &right) -{ - m_edep = right.m_edep; - m_pos = right.m_pos; - - return *this; -} - -bool G4CalorimeterHit::operator==(const G4CalorimeterHit &right) -{ - return (m_pos == right.m_pos); -} - -#ifdef G4VIS_USE -void G4CalorimeterHit::Draw() -{ - G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance(); - - if(pVVisManager) - { - G4Point3D p3D = G4Point3D( m_pos ); - G4Circle chit(p3D); - chit.SetScreenDiameter(3.0); - chit.SetFillStyle(G4Circle::filled); - - G4Colour col(1.0,0.,1.0); - - chit.SetVisAttributes(G4VisAttributes( col ) ); - pVVisManager->Draw( chit ); - } -} -#endif - -void G4CalorimeterHit::printMcpHitContribs(std::ostream& os) -{ - printMcpHitContribsHeader(os); - - for (McpHitContribList::iterator iter = m_particleList.begin(); iter != m_particleList.end(); iter++) { - (*iter).printOut(os); - } -} - -void G4CalorimeterHit::printMcpHitContribsHeader(std::ostream& os) -{ - os << "McpHitContribs" << std::endl; - os << "trackID" << '\t' << "edep" << '\t' << '\t' << "PdgId" << '\t' << "time" << std::endl; -} - -void G4CalorimeterHit::Print() -{ - std::cout << *this << std::endl; -} - -std::ostream& operator<<(std::ostream &os, const G4CalorimeterHit& hit) -{ - os << hit.getPos() << " " << G4BestUnit(hit.getEdep(), "Energy") << std::endl; - return os; -} -
diff -N G4TrackerHit.cc --- G4TrackerHit.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,55 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/hits/Attic/G4TrackerHit.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/hits/G4TrackerHit.hh" - -// for Draw() method -#ifdef G4VIS_USE -#include "G4VVisManager.hh" -#include "G4VisAttributes.hh" -#include "G4Circle.hh" -#include "G4Point3D.hh" -#include "G4Transform3D.hh" -#endif - -G4Allocator<G4TrackerHit> G4TrackerHitAllocator; - -G4TrackerHit::G4TrackerHit() : - G4VHit(), m_edep(0), m_tdep(0), m_trkID(-1), m_length(0) -{ -} - -G4TrackerHit::~G4TrackerHit() -{ -} - -#ifdef G4VIS_USE -void G4TrackerHit::Draw() -{ - G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance(); - - if(pVVisManager) { - - G4Point3D p3D = G4Point3D( m_pos ); - G4Circle chit(p3D); - chit.SetScreenDiameter(3.0); - chit.SetFillStyle(G4Circle::filled); - - G4Colour col(1.0, 0.0, 1.0); - - chit.SetVisAttributes(G4VisAttributes( col ) ); - pVVisManager->Draw( chit ); - } -} -#endif - -void G4TrackerHit::Print() -{ - std::cout << *this << std::endl; -} - -std::ostream& operator<<(std::ostream &os, const G4TrackerHit& hit) -{ - std::cout << hit.getTrackID() << " " << hit.getPos() << " " << G4BestUnit(hit.getEdep(), "Energy") << " " << hit.getMomentum() << " " << G4BestUnit(hit.getLength(), "Length") << " " << G4BestUnit(hit.getTdep(), "Time") << " " << hit.getPDG() << " " << std::endl; - return os; -}
diff -N McpHitContrib.cc --- McpHitContrib.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,64 +0,0 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/hits/Attic/McpHitContrib.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $ - -// LCDD -#include "lcdd/hits/McpHitContrib.hh" -#include "lcdd/hits/TrackInformation.hh" - -// Geant4 -#include "G4Track.hh" -#include "G4Step.hh" -#include "G4ParticleDefinition.hh" -#include "G4ParticleTypes.hh" - -McpHitContrib::McpHitContrib() : - m_trackID(-1), m_edep(0), m_PdgId(9999999), m_globalTime(0) -{ - ; -} - -McpHitContrib::McpHitContrib(G4int trackID, G4double edep, G4int PDGID, G4double globalTime) : - m_trackID(trackID), m_edep(edep), m_PdgId(PDGID), m_globalTime(globalTime) -{ - ; -} - -McpHitContrib::~McpHitContrib() -{ - ; -} - -McpHitContrib::McpHitContrib(const G4Step* aStep) -{ - // Get the track. - const G4Track* aTrack = aStep->GetTrack(); - - // Get the track information. - TrackInformation* trkInfo = static_cast<TrackInformation*>(aTrack->GetUserInformation()); - - // Get the track ID. - m_trackID = trkInfo->getOriginalTrackID(); - - // Set edep according to type of track. - if (aTrack->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition()) { - m_edep = aTrack->GetTotalEnergy(); - } else { - m_edep = aStep->GetTotalEnergyDeposit(); - } - - // PDG ID. - m_PdgId = aTrack->GetDefinition()->GetPDGEncoding(); - - // Global time. - m_globalTime = aTrack->GetGlobalTime(); - - // Compute the step midpoint. - G4ThreeVector posVec = (0.5 * (aStep->GetPreStepPoint()->GetPosition() + aStep->GetPostStepPoint()->GetPosition())); - m_position[0] = posVec[0]; - m_position[1] = posVec[1]; - m_position[2] = posVec[2]; -} - -void McpHitContrib::printOut(std::ostream& os) -{ - os << m_trackID << '\t' << m_edep << '\t' << m_PdgId << '\t' << m_globalTime << std::endl; -}
diff -u -r1.1 -r1.2 --- IdFactory.cc 26 Jun 2013 23:51:00 -0000 1.1 +++ IdFactory.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,12 +1,12 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/id/IdFactory.cc,v 1.1 2013/06/26 23:51:00 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/id/IdFactory.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// Uncomment to enable verbose debug output from this class. //#define ID_DEBUG 1 // LCDD
-#include "lcdd/detectors/G4SensitiveDetector.hh" -#include "lcdd/detectors/G4CalorimeterSD.hh" -#include "lcdd/detectors/G4Segmentation.hh"
+#include "lcdd/detectors/SensitiveDetector.hh" +#include "lcdd/detectors/CalorimeterSD.hh" +#include "lcdd/detectors/Segmentation.hh"
#include "lcdd/id/IdManager.hh" #include "lcdd/id/IdFactory.hh" #include "lcdd/detectors/ReadoutUtil.hh"
@@ -192,7 +192,7 @@
return xbits; }
-IdVec IdFactory::createOrderedIdVec(G4Step* aStep, const G4SensitiveDetector* sd)
+IdVec IdFactory::createOrderedIdVec(G4Step* aStep, const SensitiveDetector* sd)
{ //std::cout << "createOrderedIdVec" << std::endl;
@@ -202,9 +202,9 @@
IdSpec* idspec = sd->getIdSpec(); IdVec ids;
- G4Segmentation* seg = 0; - if (sd->getType() == G4SensitiveDetector::eCalorimeter) { - seg = (dynamic_cast<const G4CalorimeterSD*>(sd))->getSegmentation();
+ Segmentation* seg = 0; + if (sd->getType() == SensitiveDetector::eCalorimeter) { + seg = (dynamic_cast<const CalorimeterSD*>(sd))->getSegmentation();
} if (idspec) {
@@ -280,7 +280,7 @@
return ids; }
-int IdFactory::findFieldIdxInSegmentation(G4Segmentation* seg, const std::string& field_name)
+int IdFactory::findFieldIdxInSegmentation(Segmentation* seg, const std::string& field_name)
{ const std::vector<std::string>& bin_names = seg->getBinNames();
diff -u -r1.1 -r1.2 --- box_dipoleSubscriber.cc 26 Jun 2013 23:51:02 -0000 1.1 +++ box_dipoleSubscriber.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,8 +1,8 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/box_dipoleSubscriber.cc,v 1.1 2013/06/26 23:51:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/box_dipoleSubscriber.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// LCDD #include "lcdd/core/LCDDProcessor.hh"
-#include "lcdd/bfield/G4BoxDipole.hh"
+#include "lcdd/bfield/BoxDipole.hh"
#include "lcdd/schema/box_dipole.hh" // GDML
@@ -81,7 +81,7 @@
val += "*" + funit; bz = calc->Eval(val);
- G4BoxDipole* boxDipole = new G4BoxDipole(x, y, z, dx, dy, dz, bx, by, bz);
+ BoxDipole* boxDipole = new BoxDipole(x, y, z, dx, dy, dz, bx, by, bz);
std::string fieldName = dipoleElement->get_name(); LCDDProcessor::instance()->addMagneticField(fieldName, boxDipole);
diff -u -r1.1 -r1.2 --- calorimeterSubscriber.cc 26 Jun 2013 23:51:02 -0000 1.1 +++ calorimeterSubscriber.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/calorimeterSubscriber.cc,v 1.1 2013/06/26 23:51:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/calorimeterSubscriber.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// GDML #include "Saxana/SAXSubscriber.h"
@@ -8,8 +8,8 @@
// LCDD #include "lcdd/schema/calorimeter.hh" #include "lcdd/core/LCDDProcessor.hh"
-#include "lcdd/detectors/G4CalorimeterSD.hh" -#include "lcdd/detectors/G4SegmentationFactory.hh"
+#include "lcdd/detectors/CalorimeterSD.hh" +#include "lcdd/detectors/SegmentationFactory.hh"
#include "lcdd/detectors/SensitiveDetectorFactory.hh" #include "lcdd/id/IdManager.hh" #include "lcdd/id/IdSpec.hh"
diff -u -r1.1 -r1.2 --- dipoleSubscriber.cc 26 Jun 2013 23:51:02 -0000 1.1 +++ dipoleSubscriber.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/dipoleSubscriber.cc,v 1.1 2013/06/26 23:51:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/dipoleSubscriber.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// GDML #include "Saxana/SAXSubscriber.h"
@@ -7,10 +7,10 @@
#include "G4Evaluator/GDMLExpressionEvaluator.h" // LCDD
+#include "lcdd/bfield/Dipole.hh"
#include "lcdd/core/LCDDProcessor.hh" #include "lcdd/schema/dipole.hh" #include "lcdd/schema/dipole_coeff.hh"
-#include "lcdd/bfield/G4Dipole.hh"
/** * @brief Creates G4Dipole runtime objects in Geant4 from dipole elements.
@@ -63,7 +63,7 @@
rmax = calc->Eval(sval); // Create the Geant4 dipole object.
- G4Dipole* g4d = new G4Dipole();
+ Dipole* g4d = new Dipole();
// Set the field unit's value. g4d->setFieldUnit(calc->Eval(funit));
diff -u -r1.1 -r1.2 --- limitsetSubscriber.cc 26 Jun 2013 23:51:02 -0000 1.1 +++ limitsetSubscriber.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/limitsetSubscriber.cc,v 1.1 2013/06/26 23:51:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/limitsetSubscriber.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// GDML #include "Saxana/SAXSubscriber.h"
@@ -9,7 +9,7 @@
#include "lcdd/schema/limit.hh" #include "lcdd/schema/limitset.hh" #include "lcdd/core/LCDDProcessor.hh"
-#include "lcdd/geant4/G4LimitSet.hh"
+#include "lcdd/geant4/PhysicsLimitSet.hh"
#include "lcdd/util/StringUtil.hh" #include <string>
@@ -46,7 +46,7 @@
if (lsobj != 0) { //std::cout << "got limitset: " << lsobj->get_name() << std::endl;
- G4LimitSet* ls = new G4LimitSet(lsobj->get_name());
+ PhysicsLimitSet* ls = new PhysicsLimitSet(lsobj->get_name());
const ContentSequence* seq = lsobj->get_content(); size_t count = seq->size();
@@ -72,7 +72,7 @@
/* No specific particles so make an entry for all particles. */ if (particleList.end() == particleList.begin()) { //std::cout << "adding limit with name, particle, value: <" << limitName << "> <" << G4LimitSet::ANY_PARTICLE << "> <" << value << ">" << std::endl;
- ls->setLimitForParticle(limitName, G4LimitSet::ANY_PARTICLE, value);
+ ls->setLimitForParticle(limitName, PhysicsLimitSet::ANY_PARTICLE, value);
} /* Insert the limit once for each particle. */ else {
diff -u -r1.1 -r1.2 --- optical_calorimeterSubscriber.cc 26 Jun 2013 23:51:02 -0000 1.1 +++ optical_calorimeterSubscriber.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/optical_calorimeterSubscriber.cc,v 1.1 2013/06/26 23:51:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/optical_calorimeterSubscriber.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// GDML #include "Saxana/SAXSubscriber.h"
@@ -8,8 +8,8 @@
// LCDD #include "lcdd/schema/calorimeter.hh" #include "lcdd/core/LCDDProcessor.hh"
-#include "lcdd/detectors/G4CalorimeterSD.hh" -#include "lcdd/detectors/G4SegmentationFactory.hh"
+#include "lcdd/detectors/CalorimeterSD.hh" +#include "lcdd/detectors/SegmentationFactory.hh"
#include "lcdd/detectors/SensitiveDetectorFactory.hh" #include "lcdd/id/IdManager.hh" #include "lcdd/id/IdSpec.hh"
diff -u -r1.1 -r1.2 --- regionSubscriber.cc 26 Jun 2013 23:51:02 -0000 1.1 +++ regionSubscriber.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/regionSubscriber.cc,v 1.1 2013/06/26 23:51:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/regionSubscriber.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// GDML #include "Saxana/SAXSubscriber.h"
@@ -8,7 +8,7 @@
// LCDD #include "lcdd/schema/region.hh" #include "lcdd/core/LCDDProcessor.hh"
-#include "lcdd/geant4/G4UserRegionInformation.hh"
+#include "lcdd/geant4/UserRegionInformation.hh"
#include "lcdd/schema/LimitSetType.hh" #include "lcdd/util/StringUtil.hh"
@@ -71,7 +71,7 @@
reg->SetProductionCuts(prod_cuts); // create region info with storeSecondaries flag
- G4UserRegionInformation* reg_info = new G4UserRegionInformation();
+ UserRegionInformation* reg_info = new UserRegionInformation();
// set storeSeco reg_info->setStoreSecondaries(StringUtil::toBool(store_seco));
@@ -100,7 +100,7 @@
LimitSetType::limitsetref* limitsetref = dynamic_cast<LimitSetType::limitsetref*>(seq->content(i).object);
- G4UserLimits* ulim = dynamic_cast<G4LimitSet*>(proc->getLimitSet(limitsetref->get_ref()));
+ G4UserLimits* ulim = dynamic_cast<PhysicsLimitSet*>(proc->getLimitSet(limitsetref->get_ref()));
if (ulim) { #ifdef HAVE_G4REGION_SETUSERLIMITS
diff -u -r1.1 -r1.2 --- rz_field_mapSubscriber.cc 26 Jun 2013 23:51:02 -0000 1.1 +++ rz_field_mapSubscriber.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/rz_field_mapSubscriber.cc,v 1.1 2013/06/26 23:51:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/rz_field_mapSubscriber.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// GDML #include "Saxana/SAXSubscriber.h"
@@ -9,10 +9,9 @@
#include "lcdd/core/LCDDProcessor.hh" #include "lcdd/schema/rz_field_map.hh" #include "lcdd/schema/rzb.hh"
-#include "lcdd/bfield/G4RZFieldMap.hh"
+#include "lcdd/bfield/RZFieldMap.hh"
-/* - * @class rz_field_mapSubscriber
+/**
* @brief Subscriber for rz_field_map elements. */ class rz_field_mapSubscriber: virtual public SAXSubscriber
@@ -109,7 +108,7 @@
} }
- G4RZFieldMap* fmap = new G4RZFieldMap(numBinsR, numBinsZ, gridSizeR, gridSizeZ, fieldData);
+ RZFieldMap* fmap = new RZFieldMap(numBinsR, numBinsZ, gridSizeR, gridSizeZ, fieldData);
LCDDProcessor::instance()->addMagneticField(name, fmap); } else { G4Exception("", "", FatalException, "Failed cast to rz_field_map.");
diff -u -r1.1 -r1.2 --- scorerSubscriber.cc 26 Jun 2013 23:51:02 -0000 1.1 +++ scorerSubscriber.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/scorerSubscriber.cc,v 1.1 2013/06/26 23:51:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/scorerSubscriber.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// GDML #include "Saxana/SAXSubscriber.h"
@@ -7,8 +7,8 @@
// LCDD #include "lcdd/core/LCDDProcessor.hh" #include "lcdd/schema/scorer.hh"
-#include "lcdd/detectors/G4SensitiveDetector.hh" -#include "lcdd/detectors/G4ScorerSD.hh"
+#include "lcdd/detectors/SensitiveDetector.hh" +#include "lcdd/detectors/ScorerSD.hh"
#include "lcdd/detectors/SensitiveDetectorFactory.hh" // STL
@@ -20,13 +20,16 @@
*/ class scorerSubscriber: virtual public SAXSubscriber {
+
public:
+
virtual const SAXComponentObject* Build() const { return this; } public:
+
scorerSubscriber() { Subscribe("scorer");
diff -u -r1.1 -r1.2 --- solenoidSubscriber.cc 26 Jun 2013 23:51:02 -0000 1.1 +++ solenoidSubscriber.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/solenoidSubscriber.cc,v 1.1 2013/06/26 23:51:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/solenoidSubscriber.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// GDML #include "Saxana/SAXSubscriber.h"
@@ -9,7 +9,7 @@
// processor #include "lcdd/core/LCDDProcessor.hh" #include "lcdd/schema/solenoid.hh"
-#include "lcdd/bfield/G4Solenoid.hh"
+#include "lcdd/bfield/Solenoid.hh"
/** * @brief SAX subscriber for solenoid element.
@@ -75,7 +75,7 @@
sval += "*" + lunit; outer_radius = calc->Eval(sval);
- G4Solenoid* sol = new G4Solenoid();
+ Solenoid* sol = new Solenoid();
sol->setInnerField(inner_field); sol->setOuterField(outer_field);
diff -u -r1.1 -r1.2 --- trackerSubscriber.cc 26 Jun 2013 23:51:02 -0000 1.1 +++ trackerSubscriber.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/trackerSubscriber.cc,v 1.1 2013/06/26 23:51:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/trackerSubscriber.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// GDML #include "Saxana/SAXSubscriber.h"
@@ -7,17 +7,16 @@
// LCDD #include "lcdd/core/LCDDProcessor.hh" #include "lcdd/schema/tracker.hh"
-#include "lcdd/detectors/G4SensitiveDetector.hh" -#include "lcdd/detectors/G4TrackerSD.hh"
+#include "lcdd/detectors/SensitiveDetector.hh" +#include "lcdd/detectors/TrackerSD.hh"
#include "lcdd/detectors/SensitiveDetectorFactory.hh" // STL #include <iostream> /**
- @class trackerSubscriber - @brief SAX subscriber for tracker element. - @note Delegates to SensitiveDetectorFactory to create G4TrackerSD.
+ * @brief SAX subscriber for tracker element. + * @note Delegates to SensitiveDetectorFactory to create G4TrackerSD.
*/ class trackerSubscriber: virtual public SAXSubscriber {
diff -u -r1.1 -r1.2 --- volumeExtendedSubscriber.cc 26 Jun 2013 23:51:02 -0000 1.1 +++ volumeExtendedSubscriber.cc 1 Jul 2013 21:00:45 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/volumeExtendedSubscriber.cc,v 1.1 2013/06/26 23:51:02 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/subscribers/volumeExtendedSubscriber.cc,v 1.2 2013/07/01 21:00:45 jeremy Exp $
// LCDD #include "lcdd/subscribers/volumeExtendedSubscriber.hh"
@@ -25,7 +25,7 @@
{ LCDDProcessor* proc = LCDDProcessor::instance(); const volume* vobj = 0;
- G4SensitiveDetector* g4sd = 0;
+ SensitiveDetector* g4sd = 0;
G4LogicalVolume* lv; int nchildren = 0;
@@ -88,7 +88,7 @@
LimitSetType::limitsetref* limitsetref = dynamic_cast<LimitSetType::limitsetref*> ( seq->content(i).object );
- G4UserLimits* ulim = dynamic_cast<G4LimitSet*> ( proc->getLimitSet( limitsetref->get_ref() ) );
+ G4UserLimits* ulim = dynamic_cast<PhysicsLimitSet*> ( proc->getLimitSet( limitsetref->get_ref() ) );
if ( ulim ) { lv->SetUserLimits( ulim );
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1