Bug #2181
Light curve normalisation is used twice when doing Monte Carlo simulations
Status: | Closed | Start date: | 08/24/2017 | |
---|---|---|---|---|
Priority: | Immediate | Due date: | ||
Assigned To: | Knödlseder Jürgen | % Done: | 100% | |
Category: | - | |||
Target version: | 1.4.2 | |||
Duration: |
Description
While preparing the 1DC test data it appeared that the normalisation may be used twice in the Monte Carlo simulation. This can be tested using ctobssim
Recurrence
No recurrence.
History
#1 Updated by Knödlseder Jürgen about 7 years ago
Here a ctobssim
analysis that illustrates the problem. The default run gave
2017-08-24T19:18:02: MC source photons .........: 3991 [Crab] 2017-08-24T19:18:02: MC source events ..........: 1387 [Crab] 2017-08-24T19:18:02: MC identifier 1 ...........: Crab 2017-08-24T19:18:02: MC events .................: 1387 (all models)
while doubling the normalisation gave
2017-08-24T19:18:48: MC source photons .........: 15639 [Crab] 2017-08-24T19:18:48: MC source events ..........: 5518 [Crab] 2017-08-24T19:18:48: MC identifier 1 ...........: Crab 2017-08-24T19:18:48: MC events .................: 5518 (all models)
This is about four times the number of events compared to the default run.
#2 Updated by Knödlseder Jürgen about 7 years ago
- Target version set to 1.4.2
#3 Updated by Knödlseder Jürgen about 7 years ago
After removing the multiplication with the normalization factor in the GModelTemporalLightCurve::mc
method the results look better.
The default run now gives
2017-08-24T19:29:43: MC source photons .........: 5269 [Crab] 2017-08-24T19:29:43: MC source events ..........: 1868 [Crab] 2017-08-24T19:29:43: MC identifier 1 ...........: Crab 2017-08-24T19:29:43: MC events .................: 1868 (all models)
while doubling the normalization factor gives
2017-08-24T19:29:59: MC source photons .........: 10548 [Crab] 2017-08-24T19:29:59: MC source events ..........: 3689 [Crab] 2017-08-24T19:29:59: MC identifier 1 ...........: Crab 2017-08-24T19:29:59: MC events .................: 3689 (all models)
which is a factor of 1.97, hence within the statistical fluctuations close to 2. Note that the default run did not produce the same number of events since the time interval was a bit modified.
Here the code:
// Compute mean number of times by multiplying the rate with the
// effective duration. Note that the light curve normalization factor
// is already included in the effective rate, hence we should not
// multiply it here again (see #2181).
double lambda = rate * m_mc_eff_duration;
#4 Updated by Knödlseder Jürgen about 7 years ago
- Subject changed from It seems that the normalisation is used twice when doing Monte Carlo simulations to Light curve normalisation is used twice when doing Monte Carlo simulations
#5 Updated by Knödlseder Jürgen about 7 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Code is integrated into devel
.