15.9.2011 Kamil Sedlak

1) Bug removed from the simulation of optical photons with
    the option "APDcellsEffectRequested" -- namely, when any
    simulated photon hit a given APD cell, the cell became "blind"
    to any other photon, irrespective of the arrival time of the
    next photon. However, we need that if the "second" photon
    (simulated at later phase) enters the APD cell before the
    "first" one, that the time of photon arrival changes to the
    earlierst photon.
 2) A new keyword "sampleID ..." (defining which volume is the
    sample volume) was added to the musrSimAna.  The manual
    was updated accordingly.
This commit is contained in:
2011-09-15 13:37:48 +00:00
parent 7e6228aa10
commit e815b0a752
7 changed files with 43 additions and 5 deletions

View File

@ -269,18 +269,25 @@ void musrScintSD::ProcessOpticalPhoton(G4Step* aStep) {
// whether a given cell already fired - if so, do not store the photon.
G4bool APDcellAlreadyFired = false;
G4int APDcellID = 0;
if (APDcellsTimeVariationRequested) tmpTime += G4RandGauss::shoot(0,APDcellsTimeVariationSigma);
if (APDcellsEffectRequested) {
APDcellID = FindAPDcellID(aStep);
// G4cout<<"Cell ID="<<APDcellID<<G4endl;
for (optHitDetectorMapType::const_iterator it2 = optHitDetectorMap->begin(); it2 != optHitDetectorMap->end(); it2++ ) {
for (optHitDetectorMapType::iterator it2 = optHitDetectorMap->begin(); it2 != optHitDetectorMap->end(); it2++ ) {
if ((it2->second)==APDcellID) {
// G4cout<<"Already fired cell ="<<APDcellID<<G4endl;
APDcellAlreadyFired = true;
// G4cout<<"HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH already fired cell ="<<APDcellID<<G4endl;
// Now lets check whether the new photon came earlier than the already saved one.
// If so, delete the previous photon and store the time of the new one instead:
if (tmpTime<(it2->first)) {
optHitDetectorMap->erase(it2);
optHitDetectorMap->insert(std::pair<G4double,G4int>(tmpTime,APDcellID));
}
break;
}
}
}
if (APDcellsTimeVariationRequested) tmpTime += G4RandGauss::shoot(0,APDcellsTimeVariationSigma);
if (!APDcellAlreadyFired) optHitDetectorMap->insert(std::pair<G4double,G4int>(tmpTime,APDcellID));
// G4cout<<" tmpTime="<<tmpTime<<G4endl;
// G4cout<<" Detection"<<G4endl;