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:
@ -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.
|
||||
|
Reference in New Issue
Block a user