Commit in lcdd on MAIN | |||
include/lcdd/bfield/BoxDipole.hh | +15 | -1 | 1.2 -> 1.3 |
/Cartesian3DMagneticFieldMap.hh | +14 | -2 | 1.3 -> 1.4 |
/Dipole.hh | +9 | -2 | 1.1 -> 1.2 |
/FieldManager.hh | +37 | -4 | 1.2 -> 1.3 |
/MagneticFieldOverlay.hh | +9 | -4 | 1.3 -> 1.4 |
include/lcdd/detectors/CalorimeterHitProcessor.hh | +3 | -3 | 1.3 -> 1.4 |
/CalorimeterSD.hh | +95 | -10 | 1.1 -> 1.2 |
/Segmentation.hh | +89 | -15 | 1.1 -> 1.2 |
src/lcdd/detectors/CalorimeterSD.cc | +8 | -8 | 1.1 -> 1.2 |
+279 | -49 |
add doxygen tags; end of day checkin
diff -u -r1.2 -r1.3 --- BoxDipole.hh 1 Jul 2013 22:10:34 -0000 1.2 +++ BoxDipole.hh 2 Jul 2013 01:46:54 -0000 1.3 @@ -5,19 +5,33 @@
#include "G4MagneticField.hh" /**
- * @brief This is a magnetic field implementation that assigns a fixed set of B-field components to a box-like region.
+ * This is a G4MagneticField implementation that assigns fixed B-field components to a box-like region in world coordinates.
*/ class BoxDipole: public G4MagneticField { public:
+ /** + * Class constructor. + * @param[in] x, y, z The global position of the box's center. + * @param[in] dx, dy, dz The half lengths of the box. + * @param[in] by, by, bz The B-field coordinates for the region. + */
BoxDipole(double x, double y, double z, double dx, double dy, double dz, double bx, double by, double bz);
+ /** + * Class destructor. + */
virtual ~BoxDipole() { ; }
+ /** + * Implementation of G4MagneticField class's primary method to get B-field at a point. + * @param[in] point The 3D point at which B-field components will be read. + * @param[out] bfield The output B-field components at the point. + */
void GetFieldValue(const double point[3], double *bfield) const; private:
diff -u -r1.3 -r1.4 --- Cartesian3DMagneticFieldMap.hh 1 Jul 2013 22:10:34 -0000 1.3 +++ Cartesian3DMagneticFieldMap.hh 2 Jul 2013 01:46:54 -0000 1.4 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Cartesian3DMagneticFieldMap.hh,v 1.3 2013/07/01 22:10:34 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Cartesian3DMagneticFieldMap.hh,v 1.4 2013/07/02 01:46:54 jeremy Exp $
#ifndef LCDD_BFIELD_CARTESIAN3DMAGNETICFIELDMAP_HH #define LCDD_BFIELD_CARTESIAN3DMAGNETICFIELDMAP_HH 1
@@ -11,7 +11,9 @@
using std::vector; /**
- * @brief Original PurgMagTabulatedField3D code developed by: S.Larsson and J. Generowicz.
+ * A 3D B-field map defined as a grid of points with associated B-field values. Values are + * interpolated to obtain B-field information at points in between. + * @note Original PurgMagTabulatedField3D code developed by: S.Larsson and J. Generowicz.
* @author Norman Graf */ class Cartesian3DMagneticFieldMap: public G4MagneticField
@@ -41,8 +43,18 @@
public:
+ /** + * Class constructor. + * @param[in] filename The name of the file defining the B-field grid. + * @param[in] xOffset, yOffset, zOffset The offset of the grid's coordinate system. + */
Cartesian3DMagneticFieldMap(const char* filename, double xOffset, double yOffset, double zOffset);
+ /** + * Implementation of primary virtual method from G4MagneticField intercace. + * @param[in] Point The point in 3D space. + * @param[out] Bfield The output B-field data at the point. + */
void GetFieldValue(const double Point[4], double* Bfield) const; };
diff -u -r1.1 -r1.2 --- Dipole.hh 1 Jul 2013 21:00:40 -0000 1.1 +++ Dipole.hh 2 Jul 2013 01:46:54 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Dipole.hh,v 1.1 2013/07/01 21:00:40 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/Dipole.hh,v 1.2 2013/07/02 01:46:54 jeremy Exp $
#ifndef LCDD_BFIELD_DIPOLE_HH #define LCDD_BFIELD_DIPOLE_HH 1
@@ -10,16 +10,23 @@
#include <vector> /**
- * @brief The Geant4 binding for the dipole element.
+ * An implementation of a simple parameterized dipole as a G4MagneticField.
*/ class Dipole: public G4MagneticField { public:
+ /** + * Class constructor. + * @todo Add fully qualified constructor. + */
Dipole() { }
+ /** + * Class destructor. + */
virtual ~Dipole() { }
diff -u -r1.2 -r1.3 --- FieldManager.hh 1 Jul 2013 22:10:34 -0000 1.2 +++ FieldManager.hh 2 Jul 2013 01:46:54 -0000 1.3 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/FieldManager.hh,v 1.2 2013/07/01 22:10:34 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/FieldManager.hh,v 1.3 2013/07/02 01:46:54 jeremy Exp $
#ifndef LCDD_BFIELD_FIELDMANAGER_HH #define LCDD_BFIELD_FIELDMANAGER_HH 1
@@ -12,27 +12,60 @@
class LCDDProcessor; /**
- * @brief Manages LCDD B-field classes.
+ * Manager for B-field implementation classes defined by LCDD.
*/ class FieldManager { public:
+ /** + * Class destructor. + */
virtual ~FieldManager();
+ /** + * Get the static instance of this class. + */
static FieldManager* instance();
- MagneticFieldOverlay* makeOverlay(std::vector<G4MagneticField*> fields); -
+ /** + * Setup the fields for the simulation run, combining multiple fields into an overlay. + */
void setup();
+private: + + /** + * Create an overlay from multiple magnetic field objects. + * @param[in] The list of magnetic fields. + * @return The overlay created from the list of fields. + */ + MagneticFieldOverlay* makeOverlay(std::vector<G4MagneticField*> fields); + + /** + * Get the overlay as a Geant4 implementation class. + * @param[in] fields The list of magnetic fields. + * @return The overlay as a G4MagneticField. + */
G4MagneticField* setup(std::vector<G4MagneticField*> fields);
+ /** + * Setup a single field from the G4TransportationManager. + * @param[in] field The magnetic field to setup. + */
void initialize(G4MagneticField* field);
+ /** + * Add a global magnetic field. + * @param[in] f The magnetic field. + */
void addGlobalField(G4MagneticField* f);
+ /** + * Add a magnetic field. + * @param[in] f The magnetic field. + */
void addField(G4MagneticField* f); private:
diff -u -r1.3 -r1.4 --- MagneticFieldOverlay.hh 1 Jul 2013 22:10:34 -0000 1.3 +++ MagneticFieldOverlay.hh 2 Jul 2013 01:46:54 -0000 1.4 @@ -1,13 +1,15 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/MagneticFieldOverlay.hh,v 1.3 2013/07/01 22:10:34 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/bfield/MagneticFieldOverlay.hh,v 1.4 2013/07/02 01:46:54 jeremy Exp $
#ifndef LCDD_BFIELD_MAGNETICFIELDOVERLAY_HH #define LCDD_BFIELD_MAGNETICFIELDOVERLAY_HH 1
+// Geant4
#include "G4MagneticField.hh"
+// STL
#include <vector> /**
- * @brief Overlay multiple G4MagneticField objects by calling all their GetFieldValue functions.
+ * Class to overlay B-field values from multiple G4MagneticField objects.
*/ class MagneticFieldOverlay: public G4MagneticField {
@@ -19,12 +21,15 @@
public: /**
- * Add a G4MagneticField to the fields vector.
+ * Add a G4MagneticField to the overlay.
+ * @param[in] field The magnetic field to add.
*/ void addMagneticField(G4MagneticField* field); /**
- * Call GetFieldValue of each field in fields.
+ * Get the combined B-field at a point. + * @param[in] Point The 3D point. + * @param[out] Bfield The output B-field values.
*/ void GetFieldValue(const double Point[3], double *Bfield) const;
diff -u -r1.3 -r1.4 --- CalorimeterHitProcessor.hh 1 Jul 2013 22:10:34 -0000 1.3 +++ CalorimeterHitProcessor.hh 2 Jul 2013 01:46:54 -0000 1.4 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/CalorimeterHitProcessor.hh,v 1.3 2013/07/01 22:10:34 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/CalorimeterHitProcessor.hh,v 1.4 2013/07/02 01:46:54 jeremy Exp $
#ifndef LCDD_DETECTORS_CALORIMETERHITPROCESSOR_HH #define LCDD_DETECTORS_CALORIMETERHITPROCESSOR_HH 1
@@ -10,8 +10,8 @@
#include "lcdd/detectors/CellReadout.hh" /**
- * @brief This is a class for use with future infrastructure to separate hit processing from SD classes. - * @note This class is not currently used in the code base.
+ * This is a class to be used for the separation of hit processing from SD classes. + * @note This class is not currently used in the code base.
*/ class CalorimeterHitProcessor {
diff -u -r1.1 -r1.2 --- CalorimeterSD.hh 1 Jul 2013 21:00:41 -0000 1.1 +++ CalorimeterSD.hh 2 Jul 2013 01:46:54 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/CalorimeterSD.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/CalorimeterSD.hh,v 1.2 2013/07/02 01:46:54 jeremy Exp $
#ifndef LCDD_DETECTORS_CALORIMETERSD_HH #define LCDD_DETECTORS_CALORIMETERSD_HH 1
@@ -10,45 +10,130 @@
#include "lcdd/detectors/Segmentation.hh" /**
- * @brief Simulator implementation of calorimeter-type SD.
+ * The implementation of a calorimeter that accumulates energy depositions by event + * and processes them depending on the particular XML configuration of the detector. + * @todo Remove class alterations made for use by OpticalCalorimeter only e.g. things having to do + * with multiple hit output collections.
*/ class CalorimeterSD: public SensitiveDetector { public:
- typedef std::vector<CalorimeterHit*> G4CalorimeterHitList;
+ /** + * Type definition for a list of LCDD CalorimeterHit objects. + */ + typedef std::vector<CalorimeterHit*> CalorimeterHitList;
public:
+ + /** + * Class constructor. + * @param[in] sdName The name of the sensitive detector. + * @param[in] hcName The name of the output hit collection. + * @param[in] sdSeg The detector's segmentation object for dividing into artificial cells. + * @param[in] compare The hit comparator to be used by this detector. + */
CalorimeterSD(G4String sdName, G4String hcName, Segmentation* sdSeg, HitComparator* compare = 0);
+ /** + * Class constructor. + * @param[in] sdName The name of the sensitive detector. + * @param[in] hcName The name of the output hit collections. + * @param[in] sdSeg The detector's segmentation object for dividing into artificial cells. + * @param[in] compare The hit comparator to be used by this detector. + */
CalorimeterSD(G4String sdName, const std::vector<G4String>& hcNames, Segmentation* sdSeg, HitComparator* compare = 0);
+ /** + * Class destructor. + */
virtual ~CalorimeterSD(); public:
+ /** + * Check whether a given logical volume is valid for this detector. + * @return True if lv is valid; false if not. + */
virtual bool isValidVolume(G4LogicalVolume* lv);
- virtual void Initialize(G4HCofThisEvent *); - virtual void EndOfEvent(G4HCofThisEvent *); -
+ /** + * Implementation of Geant4's G4VSensitiveDetector::Initialize method. + * @param[in] hc The hit collection of the event. + */ + virtual void Initialize(G4HCofThisEvent* hc); + + /** + * Implementation of Geant4's G4VSensitiveDetector::EndOfEvent method. + * @param[in] hc The hit collection of the event. + */ + virtual void EndOfEvent(G4HCofThisEvent* hc); + + /** + * Get the segmentation of this detector or 0 if unset. + * @return The detector's segmentation. + */
Segmentation* getSegmentation() const;
+ /** + * Find a hit using the current HitComparator. + * @param[in] The hit to find. + * @return The found hit or 0 if not found. + */
CalorimeterHit* findHit(CalorimeterHit* aHit) const;
+ + /** + * Find a hit in the given hit collection using the current HitComparator. + * @param[in] The hit to find. + * @param[in] The index of the hits collection. + * @return The found hit or 0 if not found. + */
CalorimeterHit* findHit(CalorimeterHit* aHit, G4int nHC) const;
+ /** + * Print out the hit data to an output stream. + * @param[in] os The output stream. + * @return The same output stream. + */
std::ostream& printHits(std::ostream& os);
+ /** + * Clear the current list of hits. + */
void clearHits();
+ /** + * Print the calorimeter's basic information. + * @param[in] os The output stream. + * @return The same output stream. + */
virtual std::ostream& printBasicInfo(std::ostream& os);
+ /** + * Get the total energy deposition in this detector. + * @return The total energy deposition. + */
virtual double getEdep() const;
+ + /** + * Get the total energy deposition in this detector by hits collection index. + * @param[in] nhC The index of the hits collection. + * @return The total energy deposition in the given hits collection. + */
virtual double getEdep(G4int nHC) const;
- G4CalorimeterHitList getCalorimeterHitList(); - G4CalorimeterHitList getCalorimeterHitList(G4int nHC);
+ /** + * Get a list of CalorimeterHit objects created by this detector. + * @return The list of CalorimeterHit objects. + */ + CalorimeterHitList getCalorimeterHitList(); + + /** + * Get a list of CalorimeterHit objects by hits collection index. + * @param[in] nHC The index of the hit collection. + */ + CalorimeterHitList getCalorimeterHitList(G4int nHC);
protected: virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*);
@@ -57,8 +142,8 @@
Segmentation* m_segmentation; G4CalorimeterHitsCollection* m_collection; std::vector<G4CalorimeterHitsCollection*> m_hitsCollections;
- G4CalorimeterHitList m_hits; - std::vector<G4CalorimeterHitList> hits_vector;
+ CalorimeterHitList m_hits; + std::vector<CalorimeterHitList> hits_vector;
HitComparator* m_hitCompare; };
diff -u -r1.1 -r1.2 --- Segmentation.hh 1 Jul 2013 21:00:41 -0000 1.1 +++ Segmentation.hh 2 Jul 2013 01:46:54 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Segmentation.hh,v 1.1 2013/07/01 21:00:41 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/include/lcdd/detectors/Segmentation.hh,v 1.2 2013/07/02 01:46:54 jeremy Exp $
#ifndef LCDD_DETECTORS_SEGMENTATION_HH #define LCDD_DETECTORS_SEGMENTATION_HH 1
@@ -12,16 +12,24 @@
#include <vector> /**
- * @brief Segmentation base class.
+ * This is the base class for calorimeter Segmentation implementations.
* @todo Add method setVolume(G4LogicalVolume*) for setting up segmentation with current step volume. */ class Segmentation { public:
+ + /** + * Defines the basic type of Segmentation, e.g. projective or non-projective. + */
enum EType { eProjective = 1, eNonprojective };
+ + /** + * Type definition for list of bin names. + */
typedef std::vector<std::string> BinNames; public:
@@ -31,22 +39,28 @@
public: /**
- * Compute the global hit position from a step.
+ * Compute the global hit position from a step using this Segmentation.
+ * @param[in] aStep The Geant4 step.
*/ virtual G4ThreeVector getGlobalHitPos(const G4Step* aStep); /** * Set the identifier bin values from a step.
+ * @param[in] aStep The Geant4 step.
*/
- virtual void setBins(const G4Step*) = 0;
+ virtual void setBins(const G4Step* aStep) = 0;
/**
- * Add valid bin names to this segmentation.
+ * Add the list of valid bin names. + * @note This should only be called once.
*/ virtual void setBinNames() = 0; /** * Compute the bin given a coordinate in one dimension.
+ * @param[in] localDim The 1D coordinate value. + * @param[in] gridDim The dimension of the readout grid. + * @return The value of the bin at that coordinate.
*/ static int computeBin(double localDim, double gridDim) {
@@ -55,25 +69,43 @@
} /**
- * Compute the coordinate in one dimension given a bin value.
+ * Compute the coordinate of a cell center at a given a bin value.
+ * @param[in] bin The bin value.
+ * @param[in] incr The grid size.
+ * @return The coordinate of the cell center.
*/ static double computeDim(const int &bin, const double &incr) { return (double(bin) + .5) * incr; }
- // DEPRECATED - // Used by G4OpticalCalorimeter only.
+ /** + * @deprecated Only used by G4OpticalCalorimeter. + * @todo Move to G4OpticalCalorimeter. + */
virtual G4ThreeVector getGlobalHitPosPreStep(const G4StepPoint* aPreStepPoint);
- // DEPRECATED - // Used by G4OpticalCalorimeter only.
+ /** + * @deprecated Only used by G4OpticalCalorimeter. + * @todo Move to G4OpticalCalorimeter. + */
G4ThreeVector getLocalHitPos(const G4ThreeVector& localStepPos);
+ /** + * Reset the current bin values to all zeros. + */
void resetBins();
+ /** + * Get the type of the segmentation. + * @return The segmentation type as an enum. + */
EType getType();
+ /** + * Get a string for this segmentation type. + * @return The segmentation type as a string. + */
inline const G4String& getTypeString() { static G4String typestr;
@@ -88,57 +120,99 @@
return typestr; }
+ /** + * Get a bin value from an index. + * @param[in] idx The index of the bin. + * @return The bin value. + * @todo Change this method's name to "getBinValue". + */
inline int getBin(int idx) { return m_bins.at(idx); }
+ /** + * Get the name of a bin from an index. + * @param[in] idx The bin index. + * @return The name of the bin. + */
inline const std::string& getBinName(int idx) { return m_binNames.at(idx); }
+ /** + * Add a bin name to the end of the list. + * @param[in] The name of the bin. + */
inline void addBinName(const std::string& binName) { m_binNames.push_back(binName); }
+ /** + * Set the bin value. + * @param[in] binIdx The index of the bin. + * @param[in] binVal The value of the bin. + * @todo Change method name to "setBinValue". + */
void setBin(int binIdx, int binVal);
+ /** + * Get the number of bins defined by this Segmentation. + * @return The number of bins. + */
int getNumberOfBins();
+ /** + * Get a list of current bin values. + * @return A list of bin values. + */
const std::vector<int>& getBins();
+ /** + * Get a list of bin names. + * @return The list of bin names. + */
const std::vector<std::string>& getBinNames() { return m_binNames; }
- // Print the bins.
+ /** + * Print this object's bin values to an output stream. + * @param[in] os The output stream. + */
void printOutBins(std::ostream& os) { printOutBins(os, m_bins); }
+ /** + * Print the bin values to an output stream. + * @param[in] os The output stream. + * @param[in] bins The list of bin values. + */
static void printOutBins(std::ostream& os, const std::vector<int>& bins); /* * Check whether the solid is valid for this segmentation.
+ * @return True if solid is valid; false if not.
*/ virtual bool isValidSolid(G4VSolid*); private:
- // bin values
+ /** The current bin values. */
std::vector<int> m_bins;
- // bin names
+ /** The list of bin names. */
BinNames m_binNames;
- // number of numbers
+ /** The number of bins. */
int m_numBins;
- // type of segmentation
+ /** The type of Segmentation. */
EType m_type; };
diff -u -r1.1 -r1.2 --- CalorimeterSD.cc 1 Jul 2013 21:00:44 -0000 1.1 +++ CalorimeterSD.cc 2 Jul 2013 01:46:54 -0000 1.2 @@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/CalorimeterSD.cc,v 1.1 2013/07/01 21:00:44 jeremy Exp $
+// $Header: /cvs/lcd/lcdd/src/lcdd/detectors/CalorimeterSD.cc,v 1.2 2013/07/02 01:46:54 jeremy Exp $
// LCDD #include "lcdd/detectors/CalorimeterSD.hh"
@@ -187,7 +187,7 @@
CalorimeterHit* CalorimeterSD::findHit(CalorimeterHit* aHit) const { CalorimeterHit* fndHit = 0;
- for (G4CalorimeterHitList::const_iterator iter = hits_vector[0].begin(); iter != hits_vector[0].end(); iter++) {
+ for (CalorimeterHitList::const_iterator iter = hits_vector[0].begin(); iter != hits_vector[0].end(); iter++) {
if (m_hitCompare->compare(**iter, *aHit)) { fndHit = *iter; break;
@@ -199,7 +199,7 @@
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++) {
+ for (CalorimeterHitList::const_iterator iter = hits_vector[nHC].begin(); iter != hits_vector[nHC].end(); iter++) {
if (m_hitCompare->compare(**iter, *aHit)) { fndHit = *iter; break;
@@ -212,7 +212,7 @@
{ 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++) {
+ for (CalorimeterHitList::const_iterator iter = hits_vector[i].begin(); iter != hits_vector[i].end(); iter++) {
os << " " << **iter; } }
@@ -244,7 +244,7 @@
double CalorimeterSD::getEdep() const { double edep = 0.0;
- for (G4CalorimeterHitList::const_iterator it = hits_vector[0].begin(); it != hits_vector[0].end(); it++) {
+ for (CalorimeterHitList::const_iterator it = hits_vector[0].begin(); it != hits_vector[0].end(); it++) {
edep += (*it)->getEdep(); } return edep;
@@ -253,7 +253,7 @@
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++) {
+ for (CalorimeterHitList::const_iterator it = hits_vector[nHC].begin(); it != hits_vector[nHC].end(); it++) {
edep += (*it)->getEdep(); } return edep;
@@ -266,12 +266,12 @@
} }
-CalorimeterSD::G4CalorimeterHitList CalorimeterSD::getCalorimeterHitList()
+CalorimeterSD::CalorimeterHitList CalorimeterSD::getCalorimeterHitList()
{ return hits_vector[0]; }
-CalorimeterSD::G4CalorimeterHitList CalorimeterSD::getCalorimeterHitList(G4int nHC)
+CalorimeterSD::CalorimeterHitList CalorimeterSD::getCalorimeterHitList(G4int nHC)
{ return hits_vector[nHC]; }
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