7 modified files
projects/lcdd/branches/v00-00-01_LCDD-104-dev
--- projects/lcdd/branches/v00-00-01_LCDD-104-dev/CMakeLists.txt 2014-02-14 23:15:04 UTC (rev 3007)
+++ projects/lcdd/branches/v00-00-01_LCDD-104-dev/CMakeLists.txt 2014-02-14 23:30:56 UTC (rev 3008)
@@ -12,8 +12,8 @@
# project version
SET( LCDD_VERSION_MAJOR 3 )
-SET( LCDD_VERSION_MINOR 2 )
-SET( LCDD_VERSION_PATCH 2 )
+SET( LCDD_VERSION_MINOR 3 )
+SET( LCDD_VERSION_PATCH 0 )
# find ilcutil
FIND_PACKAGE( ILCUTIL COMPONENTS ILCSOFT_CMAKE_MODULES REQUIRED )
projects/lcdd/branches/v00-00-01_LCDD-104-dev/include/lcdd/hits
--- projects/lcdd/branches/v00-00-01_LCDD-104-dev/include/lcdd/hits/CalorimeterHitMap.hh 2014-02-14 23:15:04 UTC (rev 3007)
+++ projects/lcdd/branches/v00-00-01_LCDD-104-dev/include/lcdd/hits/CalorimeterHitMap.hh 2014-02-14 23:30:56 UTC (rev 3008)
@@ -48,6 +48,12 @@
CalorimeterHit* get(const Id64bit& id);
/**
+ * Get the size of the map.
+ * @return The size of the map.
+ */
+ int size();
+
+ /**
* Clear all entries from this hit map.
*/
void clear();
projects/lcdd/branches/v00-00-01_LCDD-104-dev/include/lcdd/segmentation
--- projects/lcdd/branches/v00-00-01_LCDD-104-dev/include/lcdd/segmentation/Segmentation.hh 2014-02-14 23:15:04 UTC (rev 3007)
+++ projects/lcdd/branches/v00-00-01_LCDD-104-dev/include/lcdd/segmentation/Segmentation.hh 2014-02-14 23:30:56 UTC (rev 3008)
@@ -170,7 +170,7 @@
*/
static double computeDim(const int &bin, const double &incr);
-private:
+protected:
/** The current bin values. */
std::vector<int> _bins;
projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/detectors
--- projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/detectors/LegacyCalorimeterHitProcessor.cc 2014-02-14 23:15:04 UTC (rev 3007)
+++ projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/detectors/LegacyCalorimeterHitProcessor.cc 2014-02-14 23:30:56 UTC (rev 3008)
@@ -15,6 +15,7 @@
}
bool LegacyCalorimeterHitProcessor::processHits(G4Step* step) {
+
// Get the energy deposition.
G4double edep = step->GetTotalEnergyDeposit();
@@ -37,6 +38,7 @@
G4ThreeVector globalCellPosition = segmentation->getGlobalHitPosition(step);
// Set the segmentation bin values from the step.
+ segmentation->resetBins();
segmentation->setBins(step);
// Create a 64-bit ID from the step information.
@@ -46,7 +48,7 @@
CalorimeterHit* hit = _calorimeter->findHit(id);
// Was there a hit found with this identifier?
- if (hit == 0) {
+ if (hit == NULL) {
// No hit was found, so a new one is created.
hit = new CalorimeterHit(id, edep, globalCellPosition);
projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/hits
--- projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/hits/CalorimeterHitMap.cc 2014-02-14 23:15:04 UTC (rev 3007)
+++ projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/hits/CalorimeterHitMap.cc 2014-02-14 23:30:56 UTC (rev 3008)
@@ -20,3 +20,7 @@
void CalorimeterHitMap::clear() {
_map.clear();
}
+
+int CalorimeterHitMap::size() {
+ return _map.size();
+}
projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/segmentation
--- projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/segmentation/GridXYZSegmentation.cc 2014-02-14 23:15:04 UTC (rev 3007)
+++ projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/segmentation/GridXYZSegmentation.cc 2014-02-14 23:30:56 UTC (rev 3008)
@@ -3,6 +3,7 @@
// LCDD
#include "lcdd/segmentation/GridXYZSegmentation.hh"
#include "lcdd/detectors/ReadoutUtil.hh"
+//#include "lcdd/util/TimeUtil.hh"
// Geant4
#include "G4NavigationHistory.hh"
@@ -22,6 +23,7 @@
}
G4ThreeVector GridXYZSegmentation::getGlobalHitPosition(const G4Step* aStep) {
+
// compute midpoint
G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep);
@@ -38,6 +40,7 @@
}
void GridXYZSegmentation::setBins(const G4Step* aStep) {
+
// Compute the midpoint of the step.
G4ThreeVector globalStepPos = ReadoutUtil::computeMidPos(aStep);
@@ -49,47 +52,34 @@
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;
+ // Set the bin values.
+ setBin(0, binX);
+ setBin(1, binY);
+ setBin(2, binZ);
}
int GridXYZSegmentation::computeBinX(const G4ThreeVector& localStepPos) {
- int ret;
if (_gridSizeX != 0) {
- ret = Segmentation::computeBin(localStepPos.x(), _gridSizeX);
+ return Segmentation::computeBin(localStepPos.x(), _gridSizeX);
} else {
- ret = 0;
+ return 0;
}
- return ret;
}
int GridXYZSegmentation::computeBinY(const G4ThreeVector& localStepPos) {
- int ret;
if (_gridSizeY != 0) {
- ret = Segmentation::computeBin(localStepPos.y(), _gridSizeY);
+ return Segmentation::computeBin(localStepPos.y(), _gridSizeY);
} else {
- ret = 0;
+ return 0;
}
- return ret;
}
int GridXYZSegmentation::computeBinZ(const G4ThreeVector& localStepPos) {
- int ret;
if (_gridSizeZ != 0) {
- ret = Segmentation::computeBin(localStepPos.z(), _gridSizeZ);
+ return Segmentation::computeBin(localStepPos.z(), _gridSizeZ);
} else {
- ret = 0;
+ return 0;
}
- return ret;
}
double GridXYZSegmentation::computeDimX(int bin) {
@@ -104,24 +94,6 @@
return Segmentation::computeDim(bin, _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;
projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/segmentation
--- projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/segmentation/Segmentation.cc 2014-02-14 23:15:04 UTC (rev 3007)
+++ projects/lcdd/branches/v00-00-01_LCDD-104-dev/src/lcdd/segmentation/Segmentation.cc 2014-02-14 23:30:56 UTC (rev 3008)
@@ -6,6 +6,7 @@
Segmentation::Segmentation(EType segType, int nbins) :
_numBins(nbins), _type(segType) {
+
// reserve nbins
_bins.reserve(_numBins);
@@ -17,7 +18,7 @@
}
void Segmentation::setBin(int binIdx, int binVal) {
- _bins.insert(_bins.begin() + binIdx, binVal);
+ _bins[binIdx] = binVal;
}
int Segmentation::getNumberOfBins() {
@@ -32,23 +33,17 @@
return _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();
-//}
-
G4ThreeVector Segmentation::getLocalHitPosition(const G4ThreeVector& localStepPos) {
return localStepPos;
}
void Segmentation::resetBins() {
+
+ // Clear the bin values.
_bins.clear();
+
+ // Re-reserve space for new bin values, just in case.
+ _bins.reserve(_numBins);
}
void Segmentation::printOutBins(std::ostream& os, const std::vector<int>& bins) {
SVNspam 0.1