-
Notifications
You must be signed in to change notification settings - Fork 3
OldLrfHowto
Back to Hot-to guides
Say you have made a geometry model of a camera (or just opened one from the examples) and now want to check how good the statistical reconstruction can perform in it. Let us start by making the detector response model in the form of a set of LRFs.
First of all you need simulated data to fit. Go to the Simulation tab and set up the photon source simulation for flood field to cover the entire active area of the detector (You can also use regular grid but reconstructing from a flood is more robust so stick with flood unless you know what you are doing). Set number of nodes to at least a few thousand to guarantee the smoothness of the fit. Choose the option of constant number of photons per node and set it high enough to have the peak response of at least a few thousand photoelectrons for all the photosensors.
Now click the button Simulate and, when the simulation is over, open the LRF window. Select Use True/Scan data. To keep the things simple, leave all the checkboxes in the main section (above the Load and Save buttons) unchecked for now. Set LRF Type to Axial and number of nodes in R to 15. Now click Make LRFs button. After the progress bar reaches 100% the LRFs are ready. Easy, isn’t it?
OK, click the Show radial button to examine the result. A separate window opens containing the plot of an LRF vs the distance from the photosensor center in the XY-plane. To see how well it fits the data check the Data checkbox below the Show radial button. Use the PM# spinbox to go through all the photosensors one by one.
Do the LRFs fit well the data? If yes then cool, you can move on to the Reconstruction HOWTO. If not - do not despair yet as we still got a few tricks up the sleeve. For starters we need to determine what is the reason for the discrepancy between the fit and the data. Look again at the plot window. If the data points all follow a common curve which the fit fails to reproduce the problem is with the number of nodes. Try setting it higher or lower and see what happens (you need to repeat Make LRFs - Show radial cycle to see the results). Another option is to use compression which allows finer node step near the origin, where the LRF varies faster. For this check the Use radial compression checkbox and set Compression factor to 5, Switchover to the radius at which the response reaches 10-20% of its peak value and Smoothness to the radius at which the response reaches ~50% of its peak value. Of course, these values make just a first guess, you might need to play a bit with these parameters until you get a nice smooth fit.
Another situation is when the response is not axially-symmetric. If the data points on the radial plot are not falling on a single curve but got spread along the vertical axis then this is probably the case (Caveat: this can be also due to insufficient photon statistics - check if you have sufficient number of photons per node in the simulation settings). In this case the axial fit doesn’t work any more so we need to use 2D fit. To do it, set LRF type to XY and number of nodes to 15 for both X and Y. Click Make LRFs button again (yes, we click it a lot) and when the fit is finished you can examine the result with Show XY button. Again, use Data and Difference checkboxes to verify if the fit reproduces the data faithfully enough. The closer the difference points to the zero plane the better. You might need to adjust the number of nodes to improve the results. Lower number of nodes leads to smoother fit but may fail to reproduce well the peak or give a notable undershoot around it. Excessive number of nodes will lead to ripples, especially near the edges of the active area. It will also require much longer time to fit (30x30 nodes and up can be painfully slow even on high-end computers).