Weighted optical photons
Selective propagation of optical photons
Kevin Zhang did some work on this. The main part is in http://dayabay.ihep.ac.cn/tracs/dybsvn/browser/dybgaudi/trunk/Simulation/DetSim/src/DsOpStackAction.cc
The Geant4 documentation for this features is http://geant4.web.cern.ch/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/UserActions/OptionalActions.html
The selective propagation of the optical photons is implemented in a tool DsFastMuonSimulation. It implements a "detector element"-based conditional photon weighting.
- On a stage of the configuration one should specify the detector elements of interest, the optical photon weights for these elements and the thresholds applied to the numbers of photons in these DEs, after which the weighting is applied.
- When simulating, the tool delays all the photons in the specified DEs. If the number of photons during the event exceeds the threshold in one of the DEs, the weighting is turned on for this DE.
- All the following photons in the weighting applied DE's survive with the probability of '1/w'. The weight 'w' is set to each them.
- The delayed tracks are propagated only after all the other tracks.
from DetSim.DetSimConf import DsFastMuonStackAction saction = DsFastMuonStackAction("GiGa.DsFastMuonStackAction") saction.Detectors = [ '/dd/Structure/DayaBay/db-rock/db-ows', '/dd/Structure/DayaBay/db-rock/db-ows/db-curtain/db-iws', '/dd/Structure/DayaBay/db-rock/db-ows/db-curtain/db-iws/db-ade1/db-sst1/db-oil1', '/dd/Structure/DayaBay/db-rock/db-ows/db-curtain/db-iws/db-ade2/db-sst2/db-oil2' ] saction.Limits = [ 10000, 10000, 10000, 10000 ] saction.Weights = [ 10, 10, 10, 10 ] # Add the stacking action to the simulation from GiGa.GiGaConf import GiGa giga = GiGa("GiGa") giga.StackingAction = saction
- Detectors — is a list of the DE where the weighting is applied.
- Limits — a list of the photon number thresholds for each DE respectively.
- Weights — the weights are to be set for each DE respectively.
Things to pay attention
Since the photons are delayed, they occupy some amount of memory. Consider that 1000 photons take 164 KB of RAM.
One more effect is the event nonlinearity (the delayed photons have the middle-event time, but are propagated and stored only in the end). This can introduse errors if any of the algorithms does not expect this.
The algorithm of determining the volume the particle is created is recursive and dumb. Setting DE to '/dd/Structure/DayaBay/db-rock/db-ows/db-curtain/db-iws/db-ade1/db-sst1/db-oil1' implies that the photons are counted in the Mineral Oil DE as well as in all the inner DEs (IAV, OAV, etc). This will not happen only to the volumes which are specified for counting themselves. In the configuration example the photons created in both the Mineral Oil DEs are not counted for the IWS and OWS as well as the IWS photons are not added to the OWS photons.