2.11.2011 Kamil Sedlak

1) Correcting bugs with the (multi)map treatment in routines
   musrCounter.cxx and musrScintSD.cc - the elements of the (multi)maps
   were erased in a loop over the (multi)maps, which is wrong.
2) Also the time variation is moved back to "process event" rather
   then "end of event" in the musrScintSD.cc  (is probably more realistic).
This commit is contained in:
2011-11-02 14:45:44 +00:00
parent f93a3c070b
commit db0c8f35ee
3 changed files with 80 additions and 29 deletions

View File

@ -270,9 +270,13 @@ void musrScintSD::ProcessOpticalPhoton(G4Step* aStep) {
//non-zero efficiency
// Do APD cell variation time if requested. Even if not requested, generate the random numbers in order to
// have reproducible simulation.
G4double APDcellsTimeVariation = G4RandGauss::shoot(0,APDcellsTimeVariationSigma);
if (APDcellsTimeVariationRequested) tmpTime += APDcellsTimeVariation;
// If the simulation of the effect of the finite number of cells in APD is requested, find out
// whether a given cell already fired - if so, do not store the photon.
// G4bool APDcellAlreadyFired = false;
G4int APDcellID = (APDcellsEffectRequested) ? FindAPDcellID(aStep) : 0;
FireAPDcell(optHitDetectorMap,APDcellID,tmpTime);
// if (APDcellsEffectRequested) {
@ -595,15 +599,15 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
// Do APD cell variation time if requested. Even if not requested, generate the random numbers in order to
// have reproducible simulation.
for (optHitDetectorMapType::iterator it2 = optHitDetectorMap->begin(); it2 != optHitDetectorMap->end(); it2++ ) {
G4double APDcellsTimeVariation = G4RandGauss::shoot(0,APDcellsTimeVariationSigma);
if (APDcellsTimeVariationRequested) {
G4int APDcellID = it2->second;
G4double tmpTime = it2->first + APDcellsTimeVariation;
optHitDetectorMap->erase(it2);
optHitDetectorMap->insert(std::pair<G4double,G4int>(tmpTime,APDcellID));
}
}
// for (optHitDetectorMapType::iterator it2 = optHitDetectorMap->begin(); it2 != optHitDetectorMap->end(); it2++ ) {
// G4double APDcellsTimeVariation = G4RandGauss::shoot(0,APDcellsTimeVariationSigma);
// if (APDcellsTimeVariationRequested) {
// G4int APDcellID = it2->second;
// G4double tmpTime = it2->first + APDcellsTimeVariation;
// optHitDetectorMap->erase(it2);
// optHitDetectorMap->insert(std::pair<G4double,G4int>(tmpTime,APDcellID));
// }
// }
// Simulate cross talk if requested. Even if not requested, generate the random numbers in order to
// have reproducible simulation.