Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When evaluating pax efficiency to find S1 and S2s, Joey found that pax performance is not perfect at lowest energy, see Fig 8 of this note. By examining lots of simulated WFs, we conclude that there are three directions pax can further improve the ability to merge single electrons from S2s deep in the TPC.
1, NaturalBreaks clustering threshold is too low. See this plot based on FAX simulations.
![screen shot 2017-10-05 at 3 23 25 pm](https://user-images.githubusercontent.com/18223253/31248277-37a902bc-a9e1-11e7-9909-e41849e7861a.png)
The original threshold to split the peak into too is too low. By simulation we see that the more than 1% of deep S2s can be splitted as two peaks. So we propose to increase the threshold to a solid line where we expect to improve pax's ability to merge S2 signals. This will probably affect our ability to distinguish multiple scatters, however, as this clustering is applied after the gap_size clustering, the impact of it is much smaller compared to gap_size clustering. This Fix the example WF in joey's note, Fig 10.
2, The gap size clustering threshold is too small (currently set as 2.5us). As shown in the WF below, at a smaller probability ~1%, gaps between deep S2s can be larger than 2.5 us, this is probably due to a larger diffusion constant at a lower field in SR1.
![screen shot 2017-10-03 at 3 12 57 pm](https://user-images.githubusercontent.com/18223253/31248485-ecb13b16-a9e1-11e7-8dd6-e1de763ec543.png)
![screen shot 2017-10-03 at 3 11 32 pm](https://user-images.githubusercontent.com/18223253/31248602-4a5f3d94-a9e2-11e7-8eee-b118b7416354.png)
So we'd like to fix this by increasing the gap size to 3.0us, by doing this, we are able to merge the S2s again and do not split deep S2s.
3, After the first gap_size clustering to isolate S1 signals, sometimes single electron S2s from deep TPC can be splitted into several S2 clusters. There is a small probability that one (or more) single electron S2s will be mis-classified as S1 signal, and those hits will be removed when we construct S2s. See this WF as an example.
![screen shot 2017-10-05 at 3 38 48 pm](https://user-images.githubusercontent.com/18223253/31248890-5c82a91a-a9e3-11e7-90cc-819e3e8fb0b8.png)
![screen shot 2017-10-05 at 3 41 04 pm](https://user-images.githubusercontent.com/18223253/31248965-a3ff3074-a9e3-11e7-92b7-11480112bab0.png)
In order to solve this problem, we apply almost the same classification algrithm here during the gap_size cluster algorithms. Then this problem is solved, as seen in the following WF.
Problem 2 and problem 3 both cause ~1% efficiency loss to reconstruct S2s. While we noticed that this effect is small in acceptance, but could be important in terms of ER band leakage as real S2s are splitted.