JeffersonLab / HDGeant4

Geant4 simulation for the GlueX experiment
4 stars 4 forks source link

K particle gun request to resolve G3/G4 difference near p 0.5 GeV/c and theta 120 degrees #137

Closed nsjarvis closed 4 years ago

nsjarvis commented 4 years ago

A marked difference between G3 and G4 simulations was seen in the u-channel of the K+Sigma0 analysis. With the current analysis, the data look more like G3.

This was brought up in the 19 Nov HDG4 meeting, the minutes and original presentation are at https://halldweb.jlab.org/wiki/index.php/HDGeant4_Meeting,_November_19,_2019#Minutes

image

sdobbs commented 4 years ago

This should be revisited in light of #149

rjones30 commented 4 years ago

Here is what I see when I look at slow backward K+ tracks in G4, G3(HADR=1) and G3(HADR=4). The output is just what monitoring_hists saves for K+ under Hist_DetectorParticleKinematics. I can remake these histograms with higher resolution if desired, but I think these are adequate.

Here are the x and y projections of these plots, shown for comparison in the same plot. image image

It is important to have both G3 results in front of us when we discuss this, otherwise we are apt to suppose that any differences we are due to things like tracking and/or hits collection that are being done differently in G3 and G4. The two G3 simulations have exactly the same algorithms in play for tracking and hits collection, so those differences arise entirely from within the hadronic models.

rjones30 commented 4 years ago

How does the "dip" structure arise in Nilanga's result for G3, and it is consistent with these results? I would say yes. His recoil k+ has a strong theta-momentum correlation. Here is a plot taken from his talk that Naomi references above. This is his U-channel distribution, which is where the dip structure appears. image The y-axis scale is too big to see the correlation at backward angles, but we can presume it is just as strong there as it is in the forward region. That cuts a narrow diagonal swath across the PvsTheta plots that I showed in the previous posting. It is easy to imagine there that a dip might be visible as you cross from the higher-momentum blob forward of 120 degrees to the lower-momentum blob backward of 120 degrees.

But why is the dip so much more distinct in G3 than in G4? From the 2D plots above, I imagine a banana-shaped stripe starting at 80 degrees, p=0.8 and extending diagonally across the plot to 140 degrees, p=0.3 GeV. The region between the two blobs is more filled in for G4 than for G3.

The more fundamental question is, why are there 2 blobs? What is this transition around theta=120 degrees? To me, that is weird. BTW, the shapes and positions of the 2 blobs is pretty much the same in all 3 sims, but the relative intensities are different between all 3.

The nice thing about the particle gun is that there is no p-theta correlation in the input sample, so any correlation you see in the output is acceptance. Like a big chunk of material in the inner region of the geometry starting at 120 degrees and going backward?? All of the simulations see it.

niwgit commented 4 years ago

I made these plots from projecting the p vs theta distribution for K+ in data for events in the u-channel (-u < 2.0 GeV^2). The momentum and theta plots in data does seem to behave somewhat similar to G3. -Nilanga KSigma_u_channel_data_kp_momentum.pdf KSigma_u_channel_data_kp_theta.pdf

rjones30 commented 4 years ago

It seems that this cutoff around 120degrees might be related to tracking at backward angles. Here is another plot from monitoring_hists that suggests this is happening. Screenshot 2020-05-06 at 7 25 26 AM I looked in hdview2 at several events where I generated 0.6 GeV/c k+ tracks at 125o. These tracks looked fine visually at the DTrackWireBased and DTrackTimeBased level in hdview with >20 straw hits assigned to the track, but they had very low FOM values for all of the mass hypotheses, including k+, and no DTrackTimeBased:Combos were created.

I will report this to the tracking experts and ask them to look into this. If there is a critical angle where the tracking is breaking down then it is possible that small differences between G3 and G4 are being amplified by the sharpness of the cutoff of the acceptance in the CDC. If so then there might also be a big difference between G3(HADR=1) and G3(HADR=4).

zihlmann commented 4 years ago

advice for beginners like me, whats the magic comand to look had hddm rest files with hdview? here the error I get for being naive.

hdview2 kstudyrec3_600.hddm Error in : cannot find dictionary module hdv_fulllistframe_Dict_rdict.pcm Error in : cannot find dictionary module hdv_optionsframe_Dict_rdict.pcm Error in : cannot find dictionary module hdv_endviewBframe_Dict_rdict.pcm Error in : cannot find dictionary module hdv_endviewAframe_Dict_rdict.pcm Error in : cannot find dictionary module hdv_mainframe_Dict_rdict.pcm Error in : cannot find dictionary module trk_mainframe_Dict_rdict.pcm Error in : cannot find dictionary module hdv_debugerframe_Dict_rdict.pcm JANA >>Opening source "kstudyrec3_600.hddm" of type: HDDM terminate called after throwing an instance of 'std::runtime_error'   what():  Unexpected header found in input HDDM stream: <HDDM class="r" version="1.1.0" xmlns="http://www.gluex.org/hddm">kstudyrec3_600.hddm Abort

On 5/6/20 7:32 AM, Richard Jones wrote:

It seems that this cutoff around 120degrees might be related to tracking at backward angles. Here is another plot from monitoring_hists that suggests this is happening. Screenshot 2020-05-06 at 7 25 26 AM https://urldefense.proofpoint.com/v2/url?u=https-3A__user-2Dimages.githubusercontent.com_7832920_81171870-2D30219000-2D8f6b-2D11ea-2D9a05-2Db715e92f1b99.png&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Hy7ijcc6pcMoP-QxZxtQH4-vodW_VGkrA9xiBc7InXk&m=BMFylzNtRbuMlnNyVCYHJ30wKUjym5Bo6urJh6GZw6Q&s=tjsB3XIs22tlfM9MpzkH1g0lhQ-sM3tZpdO616cr_tg&e= I looked in hdview2 at several events where I generated 0.6 GeV/c k+ tracks at 125o. These tracks looked fine visually at the DTrackWireBased and DTrackTimeBased level in hdview with >20 straw hits assigned to the track, but they had very low FOM values for all of the mass hypotheses, including k+, and no DTrackTimeBased:Combos were created.

I will report this to the tracking experts and ask them to look into this. If there is a critical angle where the tracking is breaking down then it is possible that small differences between G3 and G4 are being amplified by the sharpness of the cutoff of the acceptance in the CDC. If so then there might also be a big difference between G3(HADR=1) and G3(HADR=4).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_JeffersonLab_HDGeant4_issues_137-23issuecomment-2D624596170&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Hy7ijcc6pcMoP-QxZxtQH4-vodW_VGkrA9xiBc7InXk&m=BMFylzNtRbuMlnNyVCYHJ30wKUjym5Bo6urJh6GZw6Q&s=7sqJ5HxMiAt_FGtRNXyJJj6ybry-qHLJ5wMU-2P_EKU&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ADF7AC24PNRLD2H4BIU7KDTRQFDGNANCNFSM4J4RA2EQ&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Hy7ijcc6pcMoP-QxZxtQH4-vodW_VGkrA9xiBc7InXk&m=BMFylzNtRbuMlnNyVCYHJ30wKUjym5Bo6urJh6GZw6Q&s=YEY9P-Olh3HPikVhc9s31UQah9m9OzvCKBv5lZBn0CE&e=.

nsjarvis commented 4 years ago

Here's a plot of real CDC dE/dx vs theta.

cdcdedxthetarun50932

(sorry, transferred the wrong file the first time)

sdobbs commented 4 years ago

Beni, it looks like our HDDM format guessing is not working perfectly - you can put the string "rest" in the file name, for example, rename the file to "kstudyrec3_rest_600.hddm"

rjones30 commented 4 years ago

Beni,

Hmm, not sure. On the UConn cluster that command works just as you issued it. Is your environment correctly configured for JANA?

-Richard

On Wed, May 6, 2020 at 8:21 AM zihlmann notifications@github.com wrote:

advice for beginners like me, whats the magic comand to look had hddm rest files with hdview? here the error I get for being naive.

hdview2 kstudyrec3_600.hddm Error in : cannot find dictionary module hdv_fulllistframe_Dict_rdict.pcm Error in : cannot find dictionary module hdv_optionsframe_Dict_rdict.pcm Error in : cannot find dictionary module hdv_endviewBframe_Dict_rdict.pcm Error in : cannot find dictionary module hdv_endviewAframe_Dict_rdict.pcm Error in : cannot find dictionary module hdv_mainframe_Dict_rdict.pcm Error in : cannot find dictionary module trk_mainframe_Dict_rdict.pcm Error in : cannot find dictionary module hdv_debugerframe_Dict_rdict.pcm JANA >>Opening source "kstudyrec3_600.hddm" of type: HDDM terminate called after throwing an instance of 'std::runtime_error' what(): Unexpected header found in input HDDM stream: <HDDM class="r" version="1.1.0" xmlns="http://www.gluex.org/hddm">kstudyrec3_600.hddm Abort

On 5/6/20 7:32 AM, Richard Jones wrote:

It seems that this cutoff around 120degrees might be related to tracking at backward angles. Here is another plot from monitoring_hists that suggests this is happening. Screenshot 2020-05-06 at 7 25 26 AM < https://urldefense.proofpoint.com/v2/url?u=https-3A__user-2Dimages.githubusercontent.com_7832920_81171870-2D30219000-2D8f6b-2D11ea-2D9a05-2Db715e92f1b99.png&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Hy7ijcc6pcMoP-QxZxtQH4-vodW_VGkrA9xiBc7InXk&m=BMFylzNtRbuMlnNyVCYHJ30wKUjym5Bo6urJh6GZw6Q&s=tjsB3XIs22tlfM9MpzkH1g0lhQ-sM3tZpdO616cr_tg&e=

I looked in hdview2 at several events where I generated 0.6 GeV/c k+ tracks at 125o. These tracks looked fine visually at the DTrackWireBased and DTrackTimeBased level in hdview with >20 straw hits assigned to the track, but they had very low FOM values for all of the mass hypotheses, including k+, and no DTrackTimeBased:Combos were created.

I will report this to the tracking experts and ask them to look into this. If there is a critical angle where the tracking is breaking down then it is possible that small differences between G3 and G4 are being amplified by the sharpness of the cutoff of the acceptance in the CDC. If so then there might also be a big difference between G3(HADR=1) and G3(HADR=4).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_JeffersonLab_HDGeant4_issues_137-23issuecomment-2D624596170&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Hy7ijcc6pcMoP-QxZxtQH4-vodW_VGkrA9xiBc7InXk&m=BMFylzNtRbuMlnNyVCYHJ30wKUjym5Bo6urJh6GZw6Q&s=7sqJ5HxMiAt_FGtRNXyJJj6ybry-qHLJ5wMU-2P_EKU&e=>,

or unsubscribe < https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ADF7AC24PNRLD2H4BIU7KDTRQFDGNANCNFSM4J4RA2EQ&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Hy7ijcc6pcMoP-QxZxtQH4-vodW_VGkrA9xiBc7InXk&m=BMFylzNtRbuMlnNyVCYHJ30wKUjym5Bo6urJh6GZw6Q&s=YEY9P-Olh3HPikVhc9s31UQah9m9OzvCKBv5lZBn0CE&e= .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JeffersonLab/HDGeant4/issues/137#issuecomment-624616415, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3YKWH5LGDSFBKFOBG6ED3RQFI35ANCNFSM4J4RA2EQ .

nsjarvis commented 4 years ago

Nilanga,

the files that you attached yesterday don't seem to be accessible. The filenames were KSigma_u_channel_data_kp_momentum.pdf and KSigma_u_channel_data_kp_theta.pdf.

Could you try uploading the plots as png images instead, please?

niwgit commented 4 years ago

I'll try uploading as png. KSigma_u_channel_data_kp_momentum KSigma_u_channel_data_kp_theta

rjones30 commented 4 years ago

I took the k+ generated kinematics shared by Nilanga and generated 3 samples of 1M events each, one with hdgeant4, one with hdgeant(HADR=1) and one with hdgeant(HADR=4). Here is the reconstructed p vs theta 2d plot from the hdgeant4 sample. image All three of these plots look the same. The x and y projections are more useful, since this is really a 1d distribution. image image The dip structure is seen in all three samples, with slight differences between them, but nothing that would make G4 stand out from G3. In fact, G4 seems to be intermediate between the two G3 models. I see nothing here to suggest a problem with the simulation. There are probably issues with the PID at backward angles that are not well understood because u-channel processes have not been looked at much so far in GlueX.

rjones30 commented 4 years ago

To rule out the possibility that the blob structure might be coming from a bug in the geometry that affects all 3 simulations, I produced REST output from the earlier particle gun samples and plot all of the time-based tracks that are reconstructed as kaons. There is no FOM cut here. The first plot is generated, followed by reconstructed G4, G3(HADR=1), and G3(HADR=4). These plots suggest that the tracking is working just fine. I conclude from this that the blobs are coming from some combination of timing chisquare cuts and other PID algorithm issues, eg. competition between k+ and proton hypotheses leaning the wrong way in certain regions. image image image image

rjones30 commented 4 years ago

Based on the above, I conclude that there is no evidence of misbehavior in the simulations underlying this issue. The dips seen in some distributions seem to correspond to structures in the PvsTheta plots that arise from analysis cuts, because they are not seen in the REST data at the level of time-based tracks. They might be related to timing in the BCAL, but if so looking at these high-level plots is not the best way to investigate them.

If these arguments survive review by Nilanga, Noami and others, I suggest that this issue can be closed.

zihlmann commented 4 years ago

..... and the issue opened in halld_recon.

On 5/7/20 6:03 AM, Richard Jones wrote:

Based on the above, I conclude that there is no evidence of misbehavior in the simulations underlying this issue. There are structures in the PvsTheta plots that arise from analysis CUTS that are not seen in the REST data at the level of time-based tracks. This might be related to timing in the BCAL, but if so looking at these high-level plots is not the best way to study it. If these arguments survive review by Nilanga, Noami and others, I suggest that this issue can be closed.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_JeffersonLab_HDGeant4_issues_137-23issuecomment-2D625157161&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Hy7ijcc6pcMoP-QxZxtQH4-vodW_VGkrA9xiBc7InXk&m=GkXEllt7w17aCo4PaE4dYoOLFSpLGjz5AHWMBqyKoCI&s=LsTiUIdTjC-pEqBbx24YM4DNhuO4BhaLBfUvSqulV4A&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ADF7AC2WW7LWH5XATSICJ7LRQKBOZANCNFSM4J4RA2EQ&d=DwMCaQ&c=CJqEzB1piLOyyvZjb8YUQw&r=Hy7ijcc6pcMoP-QxZxtQH4-vodW_VGkrA9xiBc7InXk&m=GkXEllt7w17aCo4PaE4dYoOLFSpLGjz5AHWMBqyKoCI&s=IIF_3gNXVLdBnwsy8_QXfScaY-HqZ65Vb-evbWEqvlo&e=.

nsjarvis commented 4 years ago

I agree. This issue was to investigate differences between the Geant versions. Thank you.

niwgit commented 4 years ago

Thanks Richard, I missed the point what caused the reconstructed plots from my G4 simulation looks much more like thrown. Could you clarify please?

markdalton commented 4 years ago

There was a bug in hdgeant4 which has been fixed. You should use the latest code, comment out the CUTS card in control.in and do 3 simulations G4, G3(HADR=1) and G3(HADR=4) and check that they produce the same result.

jrstevenjlab commented 4 years ago

Since we're generally interested in the differences between detector response for samples from G3/G4, especially after the CUTS card removal, it would be good to see the new timing distributions for these tracks to see how sensitive our cuts are. This would be analogous to the request I made to Colin to reproduce his DeltaT plots https://github.com/JeffersonLab/HDGeant4/issues/111#issuecomment-579437648 with the CUTS card now off.

Richard, could you post the histogram files from the monitoring_hists plugin you've already run, so Nilanga could post plots of Independent/Hist_DetectorPID/BCAL/DeltaTVsP_K+ and compare with his timing distributions from data?

niwgit commented 4 years ago

Thanks for the clarification Mark.

rjones30 commented 4 years ago

Here are the monitoring_plots histograms for the 8 samples that I have run so far, for easy reference. The studies are: 0: k- particle gun, 0.45<p<0.55 GeV/c, 80o<𝜃<100o, 𝜙=180o 1: k- particle gun, 0.10<p<0.90 GeV/c, 80o<𝜃<100o, 𝜙=180o 2: k- particle gun, 0.25<p<0.85 GeV/c, 5o<𝜃<75o, all 𝜙 3: k- spectrum from recoil Y decays, generated by Peter Pauli 4: k- particle gun, 0.25<p<0.85 GeV/c, 5o<𝜃<75o, all 𝜙, with CUTS enabled in G4 5: k- particle gun, 0.25<p<0.85 GeV/c, 5o<𝜃<75o, all 𝜙, with CUTS, with G4 fix in place 6: k+ particle gun, 0.25 < p < 0.75 GeV/c and 80o < 𝜃 < 140o, no CUTS 7: k+ spectrum from u-channel Y reaction, generated from Nilanga's genr8 spec, no CUTS

Each of these was studied in 3 different runs, 1M events each, tagged by its own suffix.

The monitoringhists output files are available over https at: https://zeus.phys.uconn.edu/halld/kstudy-4-2020/kstudyrec${suffix}${sample}xx.root

niwgit commented 4 years ago

Thanks Richard for the MC root file. Here are BCAL timing plots for K+. Plot for MC is from Independent/Hist_DetectorPID/BCAL/DeltaTVsP_K+ For data it's for the u-channel and for signal region (no accidentals) and from Hist_ParticleID.

BCAL_delta_t_MC BCAL_delta_t_data

niwgit commented 4 years ago

Actually the data plot has both signal and accidental regions.

rjones30 commented 4 years ago

It looks like the data have a strict cut on time around the peak at zero delta t. Notice the complete lack of noise over the complete area of the plot. Accidentals subtraction does not do that. The MC does not have such a cut, apparently.

niwgit commented 4 years ago

The cut in the data must be coming from the default analysis launch cuts.

rjones30 commented 4 years ago

It would be good if you could investigate that. -Richard

On Thu, May 7, 2020 at 7:46 PM niwgit notifications@github.com wrote:

The cut in the data must be coming from the default analysis launch cuts.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JeffersonLab/HDGeant4/issues/137#issuecomment-625552213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3YKWBADZOBUOIKJSVSIJ3RQNB4LANCNFSM4J4RA2EQ .

sdobbs commented 4 years ago

Hi Nilanga, If you could please project both of those 2D distributions onto the y axis, this would also be useful to see.

---Sean

niwgit commented 4 years ago

Hi Sean, Here are the y-projections from the 2 plots. -Nilanga

DeltaT_MC DeltaT_data

rjones30 commented 4 years ago

Definitely something is cutting into the delta-T plot in real data. These studies of low-level things (time resolution in the bcal) using a high-level analysis might not be a great use of your time, Nilanga. There are too many cuts between you and the simulation to see what is going on.

-Richard Jones

On Fri, May 8, 2020 at 2:46 PM niwgit notifications@github.com wrote:

Hi Sean, Here are the y-projections from the 2 plots. -Nilanga

[image: DeltaT_MC] https://user-images.githubusercontent.com/23059941/81438327-96104200-913a-11ea-86ae-0cc559c15d6d.png [image: DeltaT_data] https://user-images.githubusercontent.com/23059941/81438332-9ad4f600-913a-11ea-802d-e5c2a4010f84.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JeffersonLab/HDGeant4/issues/137#issuecomment-625961373, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3YKWFMGBPUJV5VALKG5VDRQRHRHANCNFSM4J4RA2EQ .

sdobbs commented 4 years ago

Do we have a volunteer to peel off the backwards track reconstruction/hit matching part of the discussion to a halld_recon issue?