Closed cg-laser closed 3 years ago
Hi Brian, thanks for the thorough check of the module. As I agree with you on most of the points, I won't be able to do something about it as I did not write this module. I just refactored it a bit, so that the noise trigger rate calculation can directly use this module (Before it was done by code duplication which I find quite error prone as any change needs to be implemented in two places)
Hi Christian--fair enough! I defer to and others on how to proceed then. The typos and function renaming is probably easy, but the "What is this actually trying to do" is probably harder.
I think there is a problem in the script that calculates the trigger efficiency curves. The SNR is calculated on the unfiltered signal.
I've been banging my head against the wall for a week and a half now making diagnostic plots. The issue is that the phased array isn't triggering at the single-dipole rate that it should be. The efficiency vs SNR plots (currently running, will upload later) don't look good when running over the same sim data sample that is used to create the Veff plots. The efficiency vs SNR plots look much better if I use boresight only data samples, which suggests somethings wrong with beaming.
While the github linter continues to allude me, I think I've figured out what was wrong with my above problem. I wasn't correctly upsampling, so beams were extremely narrow. I thought things were working last week because I was making efficiency vs SNR plots using only boresight data, where beaming was 'correct'. As soon as I considered events evenly distributed in space, the holes between beams became clearer so dropped performance. With proper number of taps for upsampling, makes things much more reasonable. Attached plots are for a 100 m station. Besides fixing the linter code and commenting out some deprecated code, the phased array module is close to being done.
One thing of note, the RNO-G proposal has a figure made by Daniel that has a quoted sensitive curve quite a bit worse than what I have here. Only thing that comes to mind is that one of us got the noise level wrong.
What uptime did you assume to convert the Veff to expected sensitivity? And how many stations did you use? I expect this the main difference to the RNO-G white paper plot which assumed a realistic uptime (only solar power I think) and 5 years of operation
I saw that you used an upsampling of 2 for the 4 channel setup, and an upsampling of 4 for the 8 channel setup. How much does the sensitivity change if a 4 channel setup is used without upsampling (which I thought was the baseline plan)? And just to be sure: The module is flexible enough to correctly calculate the beams for any upsampling and number of antennas?
Good point about the livetime, I was assuming 100% livetime. I used 35 stations, 5 years. So the livetime would explain a factor of 2. I guess one question is with noise. If the digitizer goes up to say 1 GHz but we have a trigger that goes from 0-250 Mhz, which bandwidth should be used to calculate the noise, ~250 Mhz or ~1 GHz?
I believe the baseline plan for the 4 channel setup was going to be no upsampling with some secondary beaming, but the beams work out pretty well with an upsampling factor of 2. The module should be flexible enough to do any integer upsampling and number of antennas. I did strip away the code for the secondary beams, something I'm planning to add back in just in case. I also should fix any code (for example, envelope phase trigger) that depends on this triggering module.
You need to use the bandwidth of the filter which should be more like ~140MHz (100 - 240MHz). You get the precise number by integrating over the filter.
After a bit more debugging, I found I was misunderstanding how the noise gets added in the various functions that NuRadioMC call up (I redefined the _detector_simulation_part2 so filters in the _detector_simulation_filter_amp weren't getting called). There was also a small filtering bug that I removed. Attached are the most up to date results.
The efficiency vs SNR still isn't behaving exactly as we expect for the single antenna equivalent. Note that, for the Veff plot, there is noise for the phased array but not the single antenna equivalent. I made a residual plot against the 1.5 sigma single dipole trigger to better see the behavior in the Veff plot. For certain energies, things agree with the efficiency vs SNR plot, but things perform worse at lower energies and better at high energies than we would expect from the single antenna. Not sure if this points to things not being properly coded or a breakdown of our understanding of the phased array. Only thing that comes to mind is planewavy-ness and spectral content vs energy.
I also ran for two different integration window, and found a slight improvement using a shorter (16 ns) integration window.
Refactors the phased array trigger module to provide a function that can be called on traces to calculate the trigger. This is required to use this code to calculate the thermal noise trigger rate.
This PR also adds a chebychev filter to the bandstopfilter module