Commit in projects/lcdd/trunk on MAIN | |||
include/lcdd/segmentation/Segmentation.hh | -5 | 3008 -> 3009 | |
src/lcdd/detectors/LegacyCalorimeterHitProcessor.cc | +1 | -1 | 3008 -> 3009 |
/OpticalCalorimeterHitProcessor.cc | -2 | 3008 -> 3009 | |
src/lcdd/segmentation/Segmentation.cc | +4 | -17 | 3008 -> 3009 |
+5 | -25 |
Fix bug of uninitialized bin vector causing std exception. Also, simplify setting of bin values so that call to setBins() will simply overwrite existing values.
--- projects/lcdd/trunk/include/lcdd/segmentation/Segmentation.hh 2014-02-14 23:30:56 UTC (rev 3008) +++ projects/lcdd/trunk/include/lcdd/segmentation/Segmentation.hh 2014-02-18 22:33:23 UTC (rev 3009) @@ -70,11 +70,6 @@
G4ThreeVector getLocalHitPosition(const G4ThreeVector& localStepPos); /**
- * Reset the bins values to all zero. - */ - void resetBins(); - - /**
* Get the type of this segmentation. * @return The Segmentation type as an enum. */
--- projects/lcdd/trunk/src/lcdd/detectors/LegacyCalorimeterHitProcessor.cc 2014-02-14 23:30:56 UTC (rev 3008) +++ projects/lcdd/trunk/src/lcdd/detectors/LegacyCalorimeterHitProcessor.cc 2014-02-18 22:33:23 UTC (rev 3009) @@ -38,7 +38,7 @@
G4ThreeVector globalCellPosition = segmentation->getGlobalHitPosition(step); // Set the segmentation bin values from the step.
- segmentation->resetBins();
+ //segmentation->resetBins();
segmentation->setBins(step); // Create a 64-bit ID from the step information.
--- projects/lcdd/trunk/src/lcdd/detectors/OpticalCalorimeterHitProcessor.cc 2014-02-14 23:30:56 UTC (rev 3008) +++ projects/lcdd/trunk/src/lcdd/detectors/OpticalCalorimeterHitProcessor.cc 2014-02-18 22:33:23 UTC (rev 3009) @@ -52,8 +52,6 @@
G4double theEdep = double(NCerenPhotons); // get global cell pos from seg G4ThreeVector globalCellPos = getGlobalHitPosition(apreStepPoint);
- // reset the seg bins - _calorimeter->getSegmentation()->resetBins();
// set the seg bins _calorimeter->getSegmentation()->setBins(step);
--- projects/lcdd/trunk/src/lcdd/segmentation/Segmentation.cc 2014-02-14 23:30:56 UTC (rev 3008) +++ projects/lcdd/trunk/src/lcdd/segmentation/Segmentation.cc 2014-02-18 22:33:23 UTC (rev 3009) @@ -6,12 +6,10 @@
Segmentation::Segmentation(EType segType, int nbins) : _numBins(nbins), _type(segType) {
- - // reserve nbins - _bins.reserve(_numBins); - - // fill in 0 vals - resetBins();
+ // Fill bins with zeros. + for (int i=0; i<_numBins; i++) { + _bins.push_back(0); + }
} Segmentation::~Segmentation() {
@@ -37,15 +35,6 @@
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) { os << "segmentationBins <" << bins.size() << "> :: "; for (std::vector<int>::const_iterator iter = bins.begin(); iter != bins.end(); iter++) {
@@ -56,11 +45,9 @@
bool Segmentation::isValidSolid(G4VSolid* s) { bool valid = true;
-
if (0 == s) { valid = false; }
-
return valid; }
Use REPLY-ALL to reply to list
To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1