Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FCAL timing smear #242

Open
ReBarsotti opened this issue May 11, 2022 · 57 comments
Open

FCAL timing smear #242

ReBarsotti opened this issue May 11, 2022 · 57 comments

Comments

@ReBarsotti
Copy link
Contributor

ReBarsotti commented May 11, 2022

Hi everyone,

As you may know, we have been looking to improve the agreement of the MC and data in the FCAL photon reconstruction.

During our search we found that the timing distributions of the hits for the data (shown in the attached plot as the points) has tails that the MC (shown in the histogram) does not have.

We are working on correcting the core distribution to be more accurate but that still will not fix the disagreement in the tails that we see.

The attached plots show the MC and data distributions of the timing hits. For title "Number of Layers = 2" that is the
innermost two layers of the FCAL. For title "Number of Layers = 5" it is the hits in the layers 3-5, etc.
Please note, the y-axis is arbitrary as the histograms were normalized to 1.0 and the x axis is in nanoseconds.

This is using the 2018-08 data set, run numbers 050697-050800.

Thanks for any input or help you can provide!

tHit

@rjones30
Copy link
Contributor

rjones30 commented May 11, 2022 via email

@mashephe
Copy link
Contributor

mashephe commented May 12, 2022 via email

@rjones30
Copy link
Contributor

rjones30 commented May 13, 2022 via email

@mashephe
Copy link
Contributor

Yes, I'm most concerned about the extreme structures out past +/- 5 ns. They make a larger fraction of the total at inner radii (where we know we have some reconstruction issues). I also think they have the potential to interfere with clustering the most. I agree there are issues in the core distribution, but I think this can be corrected mostly with some semi ad-hoc smearing. I'm afraid if we don't get the extreme tails correct then we are not going to get efficiency correct. Any ideas on how to pursue this? I'm surprised in the MC there are absolutely zero hits out in the tails. It is not as if it is just underpopulated... there is nothing there. Is there something about the merging that would prevent such an out of time hit?

@rjones30
Copy link
Contributor

rjones30 commented May 17, 2022 via email

@mashephe
Copy link
Contributor

mashephe commented May 17, 2022 via email

@rjones30
Copy link
Contributor

rjones30 commented May 17, 2022 via email

@ReBarsotti
Copy link
Contributor Author

Here is the top left plot (FCAL layers = 2) with a log scale on the y-axis:
logy

@mashephe
Copy link
Contributor

mashephe commented May 22, 2022 via email

@rjones30
Copy link
Contributor

rjones30 commented May 22, 2022 via email

@rjones30
Copy link
Contributor

rjones30 commented May 22, 2022 via email

@ReBarsotti
Copy link
Contributor Author

Hi Richard,
This does include random triggers. This particular set was run on OSG using a standard release and random noise. Also, the "picket-fence" pattern is visible in the hit timing distribution.
Thanks!

@sdobbs
Copy link
Contributor

sdobbs commented May 23, 2022

Hi all,

I have a hard time believing that the problem is inherent to the random trigger background events, unless there is some additional noise that's created in events that pass the physics trigger? This should be correlated with the reaction that causes the event, though, not with beam-related backgrounds.

It should be fairly straightforward to check to see what happens if we turn off merging of hits close in time for the FCAL (this is pretty much the only transformation of hit parameters that is applied, and i think that hits in the same channel to within about 70ns are merged?). Richard, can you suggest if there's an easy way to do this? I get a little lost in the hit merging code. Maybe setting fcal_integration_window_ns to some small value would do this?

It might also be interesting to look at some data events that have a hit in this side peak (for example) to see if there's any commonalities in them. Maybe @ReBarsotti could supply a list of 10-20 events we could look at?

@sdobbs
Copy link
Contributor

sdobbs commented May 23, 2022

Also, I had previously made a couple suggestions that I think should help us tell how much of this effect is due to issues with background modelling:

It would be interesting to see the same plots in the OP, for a given layer AND

  • slices of the shower energy
  • different ranges of the number of hits in the shower

So, for each of these, you could imagine 4 different ranges for each of the 4 different layers, soa total of 16 timing plots

@rjones30
Copy link
Contributor

rjones30 commented May 23, 2022 via email

@sdobbs
Copy link
Contributor

sdobbs commented May 23, 2022

You might not know how to answer this question, but Beni (or someone else) might: is there some way a person analyzing MC events can ALWAYS get the true DBeamPhoton in Monte Carlo? i.e. the one that actually generated the event in the MC sim?

This is provided with the "TAGGEDMCGEN" or "TRUTH" tags for DBeamPhotons, depending on if you wanted the reconstructed (if available) or thrown values.

FWIW, when I looked at the random hits, the "picket fence" is much more visible when using the RF time as a reference. I don't think that Rebecca is doing that (though it depends on the binning)

Ref: JeffersonLab/HDGeant4#196 (comment)

@rjones30
Copy link
Contributor

rjones30 commented May 23, 2022 via email

@sdobbs
Copy link
Contributor

sdobbs commented May 23, 2022

If you are referring to the FCAL timing plot, the label indicates "FCAL time - RF". Doesn't this mean relative to the RF time?

Yes, in the plots that I linked to, these were the random trigger events collected in data, so I just picked some nominal RF time that was stored in the data stream (a DRFTime object).

I had to remind myself that @ReBarsotti was plotting a hit time - RF time distribution, and I'm guessing that this reference time is the RF bucket that the event is expected to come from based on the reconstructed final state particles (DEventRFBunch - but please correct me if I'm wrong!). That would give the right flight time that we see here, I think.

@ReBarsotti
Copy link
Contributor Author

Correct, this is the time of the hit in the FCAL minus the RF Time. If I plot only the RFTime there is a clear picket fence structure.
I will try to supply the requested plots and a list of some events in the side regions in the next day or so and post them in this thread.

@rjones30
Copy link
Contributor

rjones30 commented May 24, 2022 via email

@ReBarsotti
Copy link
Contributor Author

I'm relatively confident that I am not using those tags, but I will check!

@ReBarsotti
Copy link
Contributor Author

Attached are the plots Sean requested. If the DBeamPhotons flags would be used at the plugin level, I have verified that they were not used.
As for the list of 10 or so events, what particular information were you interested to see? (As you can imagine there are many quantities for each shower so I don't want to flood you with info you weren't looking for)

hitBracket1

hitBracket2

hitBracket3

hitBracket4

OG

showerBracket1

showerBracket2

showerBracket3

showerBracket4

.

@rjones30
Copy link
Contributor

rjones30 commented May 25, 2022 via email

@ReBarsotti
Copy link
Contributor Author

In that case, these were reconstructed using the reaction option in the MC Submit Form for OSG -- so standard reconstruction. Unless these are default flags, there is no reason they would have been used.

@sdobbs
Copy link
Contributor

sdobbs commented May 25, 2022

In that case, these were reconstructed using the reaction option in the MC Submit Form for OSG -- so standard reconstruction. Unless these are default flags, there is no reason they would have been used.

Also, I think you are just plotting the calibrated FCAL times, right? So there's no reference to the beam photon in any of these plots.

@sdobbs
Copy link
Contributor

sdobbs commented May 25, 2022

As for the list of 10 or so events, what particular information were you interested to see? (As you can imagine there are many quantities for each shower so I don't want to flood you with info you weren't looking for)

Thanks a lot for the plots! I don't see any obvious trends, but will think more.

For the 10+ events could you please just give the run/event numbers? I can look at them myself.

@rjones30
Copy link
Contributor

rjones30 commented May 25, 2022 via email

@rjones30
Copy link
Contributor

rjones30 commented May 25, 2022 via email

@mashephe
Copy link
Contributor

mashephe commented May 25, 2022 via email

@rjones30
Copy link
Contributor

rjones30 commented May 25, 2022 via email

@mashephe
Copy link
Contributor

mashephe commented May 26, 2022 via email

@rjones30
Copy link
Contributor

rjones30 commented May 26, 2022 via email

@rjones30
Copy link
Contributor

rjones30 commented May 27, 2022 via email

@mashephe
Copy link
Contributor

mashephe commented May 27, 2022 via email

@ReBarsotti
Copy link
Contributor Author

ReBarsotti commented May 27, 2022

Same here, the images are not visible. Also, I should note that the original plot was for ALL hits in the detector, even if not included in a shower. The second set of plots that Sean requested, I used only true photons. So you can see that this a problem that persists regardless of shower type.
This is reflected in the title of the plots but I should have been more explicit, sorry!

As for the plugin I was using, I will put it on the ifarm at /u/home/rebars/ShowerShapeTree

@rjones30
Copy link
Contributor

rjones30 commented May 27, 2022 via email

@mashephe
Copy link
Contributor

It seems like the interesting thing to do would be to look at the time difference of every FCAL hit with the true tag. This would let one see how the hits populate the neighboring bunches outside of the true one. This must be pretty close to what we are doing with data.

@rjones30
Copy link
Contributor

rjones30 commented Jun 1, 2022

I set up a simulation + reconstruction + ReactionFilter + DSelector chain for exclusive omega(3pi) at 8.5 GeV. I generated 500k signal events using genr8 and simulated them in hdgeant4 for run 50986. With a ReactionFilter 1_14__7_8_9 flags B0_M7 and a kinematic fit CL cut at 1e-6, I get 9075 events reconstructed, with a mean of 6 combos per event. Most of this combo redundancy is from tagging accidentals. In this study, I turned off the internal electromagnetic background in hdgeant4, and used random triggers merging in mcsmear to include the effects of accidentals in the detector and tagger. For every event that passes the kinematic cut I go back and plot the t - tRF for all hits in the inner region of the fcal. Here is what I see for all hits in one of the innermost fcal blocks. The peak height and width for the side peaks look comparable to what you are seeing in the real data at around t0 - 8ns. What I don't understand is why your timing distribution tails off as you go below t0-10ns or above t0+10ns. Is there a limit to the time range you are considering?
image

@mashephe
Copy link
Contributor

mashephe commented Jun 2, 2022

I believe the sample we are using is written by the omega_skim plugin and uses the analysis cuts specified here:

https://github.com/JeffersonLab/halld_recon/blob/master/src/plugins/Utilities/omega_skim/DReaction_factory_OmegaSkim.cc

It is a tight CL cut (5%) and we only take events where one combo passes the cut. I don't think any of this should affect the timing of other stuff in the event though.

Can you share your MC files? Maybe Rebecca should run on those and see what kind of plots the same code she has been using produces on those files.

@rjones30
Copy link
Contributor

rjones30 commented Jun 2, 2022 via email

@ReBarsotti
Copy link
Contributor Author

Richard,
Using a subset of the files you directed me to above, I get a timing distribution that seems to match your plots.

@rjones30
Copy link
Contributor

rjones30 commented Jun 6, 2022 via email

@mashephe
Copy link
Contributor

mashephe commented Jun 6, 2022 via email

@s6pepaul
Copy link
Contributor

s6pepaul commented Jun 6, 2022

Hi Rebecca, can you let me know which MCwrapper project that was? I want to see if I can dig out some config files for Richard.

@ReBarsotti
Copy link
Contributor Author

Keep in mind, this is only a small sub-selection of the files, so the statistics are much poorer but here is the distribution I get with Richard's files.

Matt - yes, I do think it is fair to say they are significantly different.

The MCWrapper project was likely ID 1246 if I recall correctly
lowStatEx
.

@mashephe
Copy link
Contributor

mashephe commented Jun 9, 2022 via email

@rjones30
Copy link
Contributor

rjones30 commented Jun 9, 2022 via email

@ReBarsotti
Copy link
Contributor Author

Funnily enough, I cannot access the files from JLab as the JLab firewall prevents it. I will process the remaining files after my shift and post full plots.

@ReBarsotti
Copy link
Contributor Author

So this isn't _whole _ data set, as some of the files appear to have some issue have transferring them and throw errors when I try to process them, but this is a considerably larger portion of the files

Screen Shot 2022-06-15 at 11 09 55 AM

@mashephe
Copy link
Contributor

Can you remind us which 4 plots above we should be comparing to? I thought it would be the first set of 4 at the very top of the thread, but it appears the at the number of data events has changed and I don't understand why. You have only been modifying the MC right? Maybe you can paste below what you get by running the exact same macro/code but using the original MC set. Then we can compare those 4 plots with the 4 plots immediately above.

@rjones30
Copy link
Contributor

rjones30 commented Jun 15, 2022 via email

@ReBarsotti
Copy link
Contributor Author

ReBarsotti commented Jun 15, 2022

Matt-
the difference between this and the first plot in the thread is that this is only for true photon showers (instead of all hits in the detector). This makes the comparable to the plots I posted on May 21 with different hit numbers and energy ranges. Below is the plots for all hits in the detector (comparable to the first plot).

Note: The plots as they are now are normalized to both have an integral of 1.0

Richard -
I see no error message when the files are transferred. However in attempting to run the plugin:
"hd_root -PNTHREADS=16 -PPLUGINS=ShowerShapeTree test10M_889_smeared.hddm -o test.root"

I receive the error message:
"JANA >>Opening source
"test10M_889_smeared.hddm" of type: HDDM
terminate called after throwing an instance of 'std::runtime_error'
what(): hddm_s::istream::istream error - invalid hddm header
Abort (core dumped)"

This only occurs for some of the files though, others run with no problem

Screen Shot 2022-06-15 at 12 45 52 PM

@ReBarsotti
Copy link
Contributor Author

Richard -- what was the config file and settings you used to generate your MC?

@rjones30
Copy link
Contributor

rjones30 commented Jul 6, 2022

You will find my control.in file here in the config.d directory with other configs used for this MC set I shared with you.
http://zeus.phys.uconn.edu/halld/gluex_root_analysis/omega3pi/config.d/

Here is a link to the scripts which contain other details from the run, like the ccdb variation, plugins and thread count, etc.
http://zeus.phys.uconn.edu/halld/gluex_root_analysis/omega3pi/scripts.d/

@rjones30
Copy link
Contributor

rjones30 commented Jul 6, 2022

Rebecca, I ran a complete scan over all 1000 files in my test10M_xxx_smeared.hddm set on my xrootd server and all of them have valid headers. Can you try to fetch the corrupted ones again? You may have had a timeout during the original copy. -Richard

@mashephe
Copy link
Contributor

mashephe commented Oct 11, 2022 via email

@rjones30
Copy link
Contributor

rjones30 commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants