gammasim / simtools

Tools and applications for the Simulation System of the CTA Observatory.
https://gammasim.github.io/simtools
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

Improvements to simulate for trigger rate #1007

Closed VictorBarbosaMartins closed 3 months ago

VictorBarbosaMartins commented 3 months ago

Summary:

This PR improves and tests the simtools-simulate-showers-for-trigger-rates application. It includes also a new file in the DB (see details below). Related to #1001.

Small history of the development:

Statistics of the simulation and trigger rate estimate

MST (North)

LST (North)

SST (South)

Bias curve

Screenshot 2024-06-24 at 09 41 17 Should we perhaps create an application to directly generate bias curves @GernotMaier ?

ctao-dpps-sonarqube[bot] commented 3 months ago

Failed

Analysis Details

0 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

ctao-dpps-sonarqube[bot] commented 3 months ago

Failed

Analysis Details

0 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

GernotMaier commented 3 months ago

Did you check the trigger rates with the results we had before? 4 kHz seems to be quite low for an MST - I remember it to be in the rage of 10-15 kHz.

Note also that bias curves are calculates as a function of trigger threshold setting (depending on the trigger type; e.g., as function of discriminator threshold) and not as function of energy. In bias curves, we also include pure NSB trigger (which gives us the threshold).

VictorBarbosaMartins commented 3 months ago

Did you check the trigger rates with the results we had before? 4 kHz seems to be quite low for an MST - I remember it to be in the rage of 10-15 kHz.

Note also that bias curves are calculates as a function of trigger threshold setting (depending on the trigger type; e.g., as function of discriminator threshold) and not as function of energy. In bias curves, we also include pure NSB trigger (which gives us the threshold).

I believe it is because we used to use the threshold at 8 GeV before and not it is at 10 GeV, but I will double check. The simtools trigger rate tool was already validated by the rht tool, so I tend to believe the results at this first glance.

I am not aware of the definitions you mentioned of "discriminator threshold" and threshold estimated from the NSB. I followed your explanation here https://github.com/gammasim/simtools/issues/1001#issuecomment-2180440189. Could you point me to some references? Ok, so no need for an application to estimate the bias curve for now.

VictorBarbosaMartins commented 3 months ago

Hi @GernotMaier, thank you for the comments. Please let me know if something is missing and you can have a look again once the tests pass.

GernotMaier commented 3 months ago

The important point is that we want to get an understand how telescope triggers change with changes in the setting of the trigger parameters (e.g., trigger discriminator thresholds (or sums), patterns, multiplicities). So will need the trigger rate as function of those parameters for both proton and NSB triggers.

I've looked again into KB's results (here and those results give:

So LST/MST look fine; SST a bit high.

(the 10-15 kHz for the MST I had in mind was protons + NSB trigger).

ctao-dpps-sonarqube[bot] commented 3 months ago

Failed

Analysis Details

0 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

ctao-dpps-sonarqube[bot] commented 3 months ago

Failed

Analysis Details

0 Issues

Coverage and Duplications

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

VictorBarbosaMartins commented 3 months ago

The important point is that we want to get an understand how telescope triggers change with changes in the setting of the trigger parameters (e.g., trigger discriminator thresholds (or sums), patterns, multiplicities). So will need the trigger rate as function of those parameters for both proton and NSB triggers.

I've looked again into KB's results (here and those results give:

  • SST: 350-450 Hz (above value given is 1.3 kHz; much higher)
  • MST-N: 2.8-4.2 kHz depending on the trigger settings (above value is 4 kHz, so probably fine; but need to check the corresponding trigger setting)
  • LST-N: 4.2-6 kHz (above value is 4.7 kHz; check settings)

So LST/MST look fine; SST a bit high.

(the 10-15 kHz for the MST I had in mind was protons + NSB trigger).

I used the very same simulation results for the SST here as input to the rht tool and got 1.38 KHz, hence compatible with the simtools trigger estimate. The differences are either configuration or model:

(base) ./rht $USERMASSSTORAGE/CTA/simtools/run000003_proton_za020deg_azm000deg_South_1SST_simulate_showers_for_trigger_rates.hdata.zst --show-num
# Read 151 histograms from /lustre/fs23/group/hess/user/vimartin/CTA/simtools/run000003_proton_za020deg_azm000deg_South_1SST_simulate_showers_for_trigger_rates.hdata.zst
# Maximum actual core range of simulations: 1499.87 m

Attention: Core range in histograms not matching. Use common part.

Attention: Energy range in histograms not matching. Use common part.
# Core range up to 3000 m, energy range 0.001 to 10000 TeV
# Cone angle = 10 deg. (solid angle = 0.0954557 sr)
# No histogram 11000

# Maximum radius from histogram #1006 = 1499.87 m.
#@EA lg(E)      Aeff    diff.Rate       E
#@EA [(TeV)]    [m^2]   [Hz/bin]        [TeV]
@EA -1.975  0   0       0.0105925
@EA -1.925  0   0       0.011885
@EA -1.875  0   0       0.0133352
@EA -1.825  0   0       0.0149624
@EA -1.775  0   0       0.016788
@EA -1.725  0   0       0.0188365
@EA -1.675  0   0       0.0211349
@EA -1.625  0   0       0.0237137
@EA -1.575  0   0       0.0266073
@EA -1.525  0   0       0.0298538
@EA -1.475  0   0       0.0334965
@EA -1.425  0   0       0.0375837
@EA -1.375  0   0       0.0421697
@EA -1.325  0   0       0.0473151
@EA -1.275  0   0       0.0530884
@EA -1.225  0   0       0.0595662
@EA -1.175  0   0       0.0668344
@EA -1.125  0   0       0.0749894
@EA -1.075  0   0       0.0841395
@EA -1.025  0   0       0.0944061
@EA -0.975  306.645 155.619     0.105925
@EA -0.925  0   0       0.11885
@EA -0.875  0   0       0.133352
@EA -0.825  0   0       0.149624
@EA -0.775  0   0       0.16788
@EA -0.725  0   0       0.188365
@EA -0.675  0   0       0.211349
@EA -0.625  0   0       0.237137
@EA -0.575  0   0       0.266073
@EA -0.525  1984.17 176.204     0.298538
@EA -0.475  3162.27 231.059     0.334965
@EA -0.425  864.895 51.9902     0.375837
@EA -0.375  0   0       0.421697
@EA -0.325  2810.91 114.329     0.473151
@EA -0.275  0   0       0.530884
@EA -0.225  4216.36 116.006     0.595662
@EA -0.175  1466.56 33.184      0.668344
@EA -0.125  0   0       0.749894
@EA -0.075  0   0       0.841395
@EA -0.025  0   0       0.944061
@EA 0.025   5189.37 53.6978     1.05925
@EA 0.075   11243.6 95.6709     1.1885
@EA 0.125   0   0       1.33352
@EA 0.175   8432.73 48.5163     1.49624
@EA 0.225   11243.6 53.1917     1.6788
@EA 0.275   0   0       1.88365
@EA 0.325   33730.9 107.892     2.11349
@EA 0.375   5621.82 14.7859     2.37137
@EA 0.425   0   0       2.66073
@EA 0.475   28912.2 51.4123     2.98538
@EA 0.525   11243.6 16.4398     3.34965
@EA 0.575   0   0       3.75837
@EA 0.725   0   0       5.30884
@EA 0.775   33730.9 18.5367     5.95662
@EA 0.825   33730.9 15.2418     6.68344
@EA 0.875   0   0       7.49894
@EA 0.975   0   0       9.44061
@EA 1.025   33730.9 6.96689     10.5925
@EA 1.125   101193  14.1306     13.3352
@EA 1.525   134924  3.93642     33.4965
@EA 1.775   33730.9 0.369864        59.5662
@EA 1.875   67461.8 0.500117        74.9894
@EA 2.325   67461.8 0.0859156       211.349

# Proton trigger rate(#1007/#1006)  = 1379.77 Hz.
# Rate in range: 1379.77 (1379.77)
# dN/dE peak at 0.105925 TeV
# dN/d log E peak at 0.324882 TeV
# Median energy 0.481731 TeV
# 10% of events below 0.110747 TeV
# 1% of events below 0.101026 TeV
# 0.1% of events below 0.100102 TeV
# Total number of events simulated: 200000
# Total number of events triggered: 48

#@TA   Rate     Pk(dN/dlogE)    Pk(dN/dE)   Median      10%<        1%<         0.1%<           Filename
#@TA   [Hz]     [TeV] ...

@TA  1379.77    0.324882    0.105925    0.481731    0.110747    0.101026    0.100102    run000003_proton_za020deg_azm000deg_South_1SST_simulate_showers_for_trigger_rates.hdata.zst

Summary of class constructor, Reset(), and Clear() calls:
   iactio::MultiDimHistogram: 19,  0,  1,  0
VictorBarbosaMartins commented 3 months ago

Thanks for checking the SST rates. All good now and ready to merge.

Thanks!