Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix triggering of telescopes in light emission package #1128

Merged
merged 11 commits into from
Sep 12, 2024

Conversation

tobiaskleiner
Copy link
Collaborator

Deleting the array trigger at two different positions in the code seems to be working for the layout and for the variable case. The same procedure for the axes offsets is not successful at the moment for the varying distance case.

@tobiaskleiner
Copy link
Collaborator Author

When running the script (with explicitly giving the DNUM_TELESCOPES=1), sim_telarray still sets up four telescopes.
This needs further investigation:


Start setting up telescope 1.
Preprocessor command: /workdir/sim_telarray/sim_telarray/bin/pfp -v -I. -DNUM_TELESCOPES=1 -DWITH_LOW_GAIN_CHANNEL -DMAX_GAINS=2 -DWITH_GSL_RNG -DSIMTEL_VERSION=1709915244 -DSIMTEL_RELEASE=20240780 -I../cfg/CTAiobuf_maximum=1000000000 -I. -I/workdir/sim_telarray/sim_telarray/cfg -I/workdir/sim_telarray/sim_telarray/cfg/common -I/workdir/sim_telarray/sim_telarray/cfg/hess -I/workdir/sim_telarray/sim_telarray/cfg/hess2 -I/workdir/sim_telarray/sim_telarray/cfg/hess3 -I/workdir/sim_telarray/sim_telarray/cfg/hess5000 -I/workdir/sim_telarray/sim_telarray/cfg/CTA -I/workdir/sim_telarray/sim_telarray/cfg/MAGIC -DMAX_GAINS=2 -DTELESCOPE=1 - < /workdir/external/simtools/simtools-output/simulate_light_emission/model/CTA-North-MSTN-04-6.0.0_simulate_light_emission.cfg
Applying 0 weak command-line configuration parameter(s).
Check additional configuration for telescope 1 from /workdir/external/simtools/simtools-output/simulate_light_emission/model/CTA-North-MSTN-04-6.0.0_simulate_light_emission.cfg.
Configuration for MSTN-04 - TELESCOPE 1
137 configuration lines were processed.
Applying 10 forced command-line configuration parameter(s).
Filled 8 metaparameters for global configuration.
Camera 1 by default requires 3 pixels per trigger group.
Reading setup for telescope 1 camera from file camera_CTA-MST-NectarCam_20191120_majority-3nn.dat
Pixel type 1 has a hexagonal (flat y) funnel onto a circular visible cathode.
Reading funnel angle efficiencies for telescope 1 from NectarCAM_lightguide_efficiency_POP_131019.dat
Table with 47 rows has been read from file NectarCAM_lightguide_efficiency_POP_131019.dat
Telescope 1 has 86 mirrors (from file mirror_CTA-100_1.20-86-0.04.dat).
Geometric area of 86 mirrors (inclination corrected): 106.26 m^2.
Diameter is approximately 13.775 m
Effective focal length given as 1644.5 for nominal 1600.0 cm.
Random reflections with 0.0068 deg.
Warning: trigger window does not cover full readout window.
(F)ADC data is simulated for a readout window of up to 105.0 ns,
trigger conditions in a 105.0 ns window starting 3.0 ns before (F)ADC data.
Camera filter 1-D transmission table applied for telescope 1.
Average night sky background of telescope 1: 0.218 p.e./ns (DC current: 1.40 uA)

Start setting up telescope 2.
Preprocessor command: /workdir/sim_telarray/sim_telarray/bin/pfp -v -I. -DNUM_TELESCOPES=1 -DWITH_LOW_GAIN_CHANNEL -DMAX_GAINS=2 -DWITH_GSL_RNG -DSIMTEL_VERSION=1709915244 -DSIMTEL_RELEASE=20240780 -I../cfg/CTAiobuf_maximum=1000000000 -I. -I/workdir/sim_telarray/sim_telarray/cfg -I/workdir/sim_telarray/sim_telarray/cfg/common -I/workdir/sim_telarray/sim_telarray/cfg/hess -I/workdir/sim_telarray/sim_telarray/cfg/hess2 -I/workdir/sim_telarray/sim_telarray/cfg/hess3 -I/workdir/sim_telarray/sim_telarray/cfg/hess5000 -I/workdir/sim_telarray/sim_telarray/cfg/CTA -I/workdir/sim_telarray/sim_telarray/cfg/MAGIC -DMAX_GAINS=2 -DTELESCOPE=2 - < /workdir/external/simtools/simtools-output/simulate_light_emission/model/CTA-North-MSTN-04-6.0.0_simulate_light_emission.cfg
Applying 0 weak command-line configuration parameter(s).
Check additional configuration for telescope 2 from /workdir/external/simtools/simtools-output/simulate_light_emission/model/CTA-North-MSTN-04-6.0.0_simulate_light_emission.cfg.
Configuration for MSTN-04 - TELESCOPE 2
137 configuration lines were processed.
Applying 10 forced command-line configuration parameter(s).
Filled 8 metaparameters for telescope ID 2 (itel=1).
Camera 2 by default requires 3 pixels per trigger group.
Reading setup for telescope 2 camera from file camera_CTA-MST-NectarCam_20191120_majority-3nn.dat
Pixel type 1 has a hexagonal (flat y) funnel onto a circular visible cathode.
Reading funnel angle efficiencies for telescope 2 from NectarCAM_lightguide_efficiency_POP_131019.dat
Table with 47 rows has been read from file NectarCAM_lightguide_efficiency_POP_131019.dat
Telescope 2 has 86 mirrors (from file mirror_CTA-100_1.20-86-0.04.dat).
Geometric area of 86 mirrors (inclination corrected): 106.26 m^2.
Diameter is approximately 13.775 m
Effective focal length given as 1644.5 for nominal 1600.0 cm.
Random reflections with 0.0068 deg.
Warning: trigger window does not cover full readout window.
(F)ADC data is simulated for a readout window of up to 105.0 ns,
trigger conditions in a 105.0 ns window starting 3.0 ns before (F)ADC data.
Camera filter 1-D transmission table applied for telescope 2.
Average night sky background of telescope 2: 0.218 p.e./ns (DC current: 1.40 uA)

Start setting up telescope 3.
Preprocessor command: /workdir/sim_telarray/sim_telarray/bin/pfp -v -I. -DNUM_TELESCOPES=1 -DWITH_LOW_GAIN_CHANNEL -DMAX_GAINS=2 -DWITH_GSL_RNG -DSIMTEL_VERSION=1709915244 -DSIMTEL_RELEASE=20240780 -I../cfg/CTAiobuf_maximum=1000000000 -I. -I/workdir/sim_telarray/sim_telarray/cfg -I/workdir/sim_telarray/sim_telarray/cfg/common -I/workdir/sim_telarray/sim_telarray/cfg/hess -I/workdir/sim_telarray/sim_telarray/cfg/hess2 -I/workdir/sim_telarray/sim_telarray/cfg/hess3 -I/workdir/sim_telarray/sim_telarray/cfg/hess5000 -I/workdir/sim_telarray/sim_telarray/cfg/CTA -I/workdir/sim_telarray/sim_telarray/cfg/MAGIC -DMAX_GAINS=2 -DTELESCOPE=3 - < /workdir/external/simtools/simtools-output/simulate_light_emission/model/CTA-North-MSTN-04-6.0.0_simulate_light_emission.cfg
Applying 0 weak command-line configuration parameter(s).
Check additional configuration for telescope 3 from /workdir/external/simtools/simtools-output/simulate_light_emission/model/CTA-North-MSTN-04-6.0.0_simulate_light_emission.cfg.
Configuration for MSTN-04 - TELESCOPE 3
137 configuration lines were processed.
Applying 10 forced command-line configuration parameter(s).
Filled 8 metaparameters for telescope ID 3 (itel=2).
Camera 3 by default requires 3 pixels per trigger group.
Reading setup for telescope 3 camera from file camera_CTA-MST-NectarCam_20191120_majority-3nn.dat
Pixel type 1 has a hexagonal (flat y) funnel onto a circular visible cathode.
Reading funnel angle efficiencies for telescope 3 from NectarCAM_lightguide_efficiency_POP_131019.dat
Table with 47 rows has been read from file NectarCAM_lightguide_efficiency_POP_131019.dat
Telescope 3 has 86 mirrors (from file mirror_CTA-100_1.20-86-0.04.dat).
Geometric area of 86 mirrors (inclination corrected): 106.26 m^2.
Diameter is approximately 13.775 m
Effective focal length given as 1644.5 for nominal 1600.0 cm.
Random reflections with 0.0068 deg.
Warning: trigger window does not cover full readout window.
(F)ADC data is simulated for a readout window of up to 105.0 ns,
trigger conditions in a 105.0 ns window starting 3.0 ns before (F)ADC data.
Camera filter 1-D transmission table applied for telescope 3.
Average night sky background of telescope 3: 0.218 p.e./ns (DC current: 1.40 uA)

Start setting up telescope 4.
Preprocessor command: /workdir/sim_telarray/sim_telarray/bin/pfp -v -I. -DNUM_TELESCOPES=1 -DWITH_LOW_GAIN_CHANNEL -DMAX_GAINS=2 -DWITH_GSL_RNG -DSIMTEL_VERSION=1709915244 -DSIMTEL_RELEASE=20240780 -I../cfg/CTAiobuf_maximum=1000000000 -I. -I/workdir/sim_telarray/sim_telarray/cfg -I/workdir/sim_telarray/sim_telarray/cfg/common -I/workdir/sim_telarray/sim_telarray/cfg/hess -I/workdir/sim_telarray/sim_telarray/cfg/hess2 -I/workdir/sim_telarray/sim_telarray/cfg/hess3 -I/workdir/sim_telarray/sim_telarray/cfg/hess5000 -I/workdir/sim_telarray/sim_telarray/cfg/CTA -I/workdir/sim_telarray/sim_telarray/cfg/MAGIC -DMAX_GAINS=2 -DTELESCOPE=4 - < /workdir/external/simtools/simtools-output/simulate_light_emission/model/CTA-North-MSTN-04-6.0.0_simulate_light_emission.cfg
Applying 0 weak command-line configuration parameter(s).
Check additional configuration for telescope 4 from /workdir/external/simtools/simtools-output/simulate_light_emission/model/CTA-North-MSTN-04-6.0.0_simulate_light_emission.cfg.
Configuration for MSTN-04 - TELESCOPE 4
137 configuration lines were processed.
Applying 10 forced command-line configuration parameter(s).
Filled 8 metaparameters for telescope ID 4 (itel=3).
Camera 4 by default requires 3 pixels per trigger group.
Reading setup for telescope 4 camera from file camera_CTA-MST-NectarCam_20191120_majority-3nn.dat
Pixel type 1 has a hexagonal (flat y) funnel onto a circular visible cathode.
Reading funnel angle efficiencies for telescope 4 from NectarCAM_lightguide_efficiency_POP_131019.dat
Table with 47 rows has been read from file NectarCAM_lightguide_efficiency_POP_131019.dat
Telescope 4 has 86 mirrors (from file mirror_CTA-100_1.20-86-0.04.dat).
Geometric area of 86 mirrors (inclination corrected): 106.26 m^2.
Diameter is approximately 13.775 m
Effective focal length given as 1644.5 for nominal 1600.0 cm.
Random reflections with 0.0068 deg.
Warning: trigger window does not cover full readout window.
(F)ADC data is simulated for a readout window of up to 105.0 ns,
trigger conditions in a 105.0 ns window starting 3.0 ns before (F)ADC data.
Camera filter 1-D transmission table applied for telescope 4.
Average night sky background of telescope 4: 0.218 p.e./ns (DC current: 1.40 uA)



@orelgueta
Copy link
Contributor

I would also suggest avoiding using the pfp preprocessor and reduce the default include paths used to just the ones necessary (i.e., not HESS/MAGIC ones). We should try to decouple as much as possible from the built in scripts.

@tobiaskleiner tobiaskleiner marked this pull request as ready for review September 4, 2024 14:37

This comment has been minimized.

@tobiaskleiner
Copy link
Collaborator Author

I would also suggest avoiding using the pfp preprocessor and reduce the default include paths used to just the ones necessary (i.e., not HESS/MAGIC ones). We should try to decouple as much as possible from the built in scripts.

This would need a change in sim_telarray. I have added an issue #1132

This comment has been minimized.

Copy link
Contributor

@GernotMaier GernotMaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments below. I think the missing unit test is also the reason why sonarq is failing.

.gitignore Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove those changes. They seem to be more related to your local environment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have noticed these files are sometimes created from the light emission package when interrupted before finishing.
Not sure how the .swp file has been created, but I can remove it if it is not appearing for you.

@@ -398,6 +354,26 @@ def remove_line_from_config(file_path, line_prefix):

return command

def _remove_line_from_config(self, file_path, line_prefix):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a unit test for this function? I didn't see it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out. A test is included now.

This comment has been minimized.

This comment has been minimized.

Copy link

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage 91.70% Coverage (91.00% Estimated after merge)
  • Duplications 0.00% Duplicated Code (0.00% Estimated after merge)

Project ID: gammasim_simtools_AY_ssha9WiFxsX-2oy_w

View in SonarQube

Copy link
Contributor

@GernotMaier GernotMaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@tobiaskleiner tobiaskleiner merged commit 4a48f85 into main Sep 12, 2024
12 checks passed
@tobiaskleiner tobiaskleiner deleted the light-emission-trigger-fix branch September 12, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants