Repository navigation
Conversation
|
Test status for this pull request: SUCCESS Summary: summary.txt Build log: make_temporary_fix_gen_amp_V2.log |
|
Ilia_comments.pdf |
|
I think this modification looks good -- can you please verify that two samples produce the same mass distributions:
This would verify that the reweighted distribution recovers phase space. I'm pretty sure this is correct since the choice of t slope should factorize from the problem. It is just like you've turned the generator into a sum of generators that each individually generate with a fixed t slope based on the old algorithm, right? |
|
Hello, Matt
I would say even simpler: the algorithm remains unchanged, the modification is only resetting -t to a value of given probability: now it is reset one time per every kin = ftGen.generate() call. I will make the checks tomorrow. Can you say,
should I weight my UV mass spectrum with the mask weight or with some other weight for this check ? |
Yes, you use the weight provided by the generator. It is the weight data member in the Kinematics class. In both cases you should not specify any Breit Wigners, etc. This is just a test to verify that the reweighted UV mass (and also t-slope if you want) matches that of true phase space. This is important for physics reasons. As I noted, I'm pretty sure this will check out OK, but it is a good final check on the implementation. I like this change that you have made -- it will make it easier for people to get the t slope they desire. |
|
These are the comparisons with 1M generated events for both the single-slope generation and the multiple-slope generation. I didn't specify any BWs for the LV and UV at the generation. |
|
(It would probably be most helpful to scale the plots to a common integral and plot the blue shaded histogram with Sumw2 turned on. I think the wild variations there are just what is going on at the edges of phase space.) The top page looks fine -- good. I'm a bit concernend about the deviation from phase space in the lower left of the 2nd page. I'm surprised by this a bit... I'm curious if it goes away when you revert to the old algorithm. In words, it seems the problem is that your modification has lost the relative normalization of the samples with different t slopes needed to recover phase space. This was preserved in the old algorithm because t was always drawn from the same distribution no mater what. The new algorithm pics a t slope and then keeps drawing t from that specific slope until the kinematic boundary conditions are met. The probability of meeting the boundary conditions varies with choice of t slope (this is the particular inefficiency you were trying to remove). You may have to investigate modifing your algorithm to renormalize the weight based on the particular t-slope that is drawn before you call genCosThetaCM. Maybe it is sufficient to modify the weight returned by 1 / P_t_i, where P is the user-configured probability for a particular t slope. In that case it is really like running multiple instances of the single-slope case and adding them together with appropriate weights. You have: tSlope = m_tSlopeVec[m_tSlopeChannel()]; You can do: int tIdx = m_tSlopeChannel(); Then take the returned weight from genCosThetaCM and divide it by tProb. Matt |
|
Hello, Matt, I have added comparison with the current version of gen_amp_V2 for the case of three slopes. I am working on adjusting the weight by the input probabilities. I will produce more tests, I think we will learn something. Best, |
|
It is interesting that the current version with multiple slopes shows a similar issue. This is not the intent and I think you might have uncovered a bug in the current implementation. (This is independent of the solution to the problem you are trying to solve.) I think the problem is that line 389 of the original implementation of FixedTargetGenerator.cc misses the factor that is the probability of drawing a particular t slope. It is this line: cosThetaWeight.second = 1 / This needs a extra factor that is the factor tProb in the code snippet above. In the original code, could you modify line 376 to use something like this: int tIdx = m_tSlopeChannel(); And then modify 389 so it is: cosThetaWeight.second = 1 / Could you then see if multiple t slopes recovers phase space? That at least would give us a firm understanding of the starting point. As I was mentioning in the call this morning, I think the place to control t consistent with design practices is to do so in the AT config file. Then you can use t arguments to gen_amp_v2 as "hints" to improve accept/reject efficiency for that AT-specified t distribution. |
|
Matt, Can you say, should I divide by tProb, or multiply ? Initially, you suggested dividing, but then you wrote multiplying in the last snippet. I will do this check on the original gen_amp. |
|
Sorry for the confusion-
There is a 1 / in the line above the last snippet. It is multiplying the denominator by tProb which is the same as dividing by tProb.
Matt
…----
This message was sent from my iPhone.
On Nov 19, 2026, at 2:43 PM, iljatt ***@***.***> wrote:
[https://avatars.githubusercontent.com/u/200623699?s=20&v=4]iljatt left a comment (JeffersonLab/halld_sim#429)<#429 (comment)>
Matt,
Can you say, should I divide by tProb, or multiply ? Initially, you suggested dividing, but then you wrote multiplying in the last snippet. I will do this check on the original gen_amp.
—
Reply to this email directly, view it on GitHub<#429?email_source=notifications&email_token=ADG5L2G4EMQ5G6FO6C7GJY35Z5EMZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMBSGAZDEOJWGQYKM4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-7020229640>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADG5L2G54D73KMLPYZOGOYT5Z5EMZAVCNFSNUABFKJSXA33TNF2G64TZHMYTIMRZGI4DGMZRHNEXG43VMU5TMNBUHA4TKNJQGU22C5QC>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/ADG5L2DNI7U2OLMPWM6CR735Z5EMZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMBSGAZDEOJWGQYKM4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJKTGN5XXIZLSL5UW64Y> and Android<https://github.com/notifications/mobile/android/ADG5L2HGOEVZGAT3EZGRGOD5Z5EMZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTOMBSGAZDEOJWGQYKM4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>. Download it today!
You are receiving this because you commented.Message ID: ***@***.***>
|
This modification resets the t-slope sampling in the right position in the code. This will enable control over the generation of -t distribution with the multiple "-t slope weight" input settings.