-
Notifications
You must be signed in to change notification settings - Fork 2
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
Primary particle and a new input mode #50
Comments
Part of that shape could be from Root linearly interpolating between bins when it makes the random numbers which gives the triangular shape. Do you know the size of the bins in the 3D plot? Also, you put the units in micrometres, but they're in cm in the projection of the 3D input histogram and you multiply by 1e3 in the formula, so are the units correct or should it be mm? In the same way, I notice the mean of your final plot is about a tenth the size of the mean of the first plot, though that could be complete coincidence. My guess, is that we have a problem with the unit of the output file from the monitors being different to the units used for the input file. Quite why we get this exact shape I don't get though... |
The bin width is 0.1 cm in the 3D plots so I should probably decrease that. So I get a bit confused with the units. The branches i_x etc. want to be read in in cm, right? I write them out to the 3D distribution as cm. I then wanted the final plot in um, so I should have multiplied by 10^4? This then makes the base of the triangle go between +-700 um, which is even worse! I'll try decreasing the bin width and see what happens.... |
Decreasing the bin width by a factor of 10 obviously increases the number of bins by a factor of 1000 and causes ROOT to crash. I think this was a problem I was having before. I've tried using THnSparse but it seems to take a long time to run (it's a lot better when I compile the ROOT macro). But this would mean we would have to change the code to use THnSparse->GetRandom(Double_t* rand) rather than TH3->GetRandom3(Double_t& x, Double_t& y, Double_t& z). The other option (which I think I ended up implementing somewhere) is to just check that the primary vertex is in the Target volume but I seem to remember this slowed the simulation down a bit. I'll keep plugging away at the first one for the time being and try not to break the code for anyone else... |
The other thing is to swap to using the root mode which uses a root tree as an input. Then you can load in the positions directly and not worry about this binning. It's tough to explain here, but I'm thinking that the issue is because the bins are rotated with respect to the target and fairly coarse. If you take the 2nd 2D plot and imagine projecting it back to a plane at 135degrees (so the plane where If that explanation is right, then this isn't a bug so to speak, but it might suggest this technique is not very good. An improvement would be to use a local histogram and move and rotate it to be back at the target. I'm not sure how easy that is to implement though and I'm not sure if we really need it. So if you are able to switch to the root tree approach then perhaps that's worth doing to avoid this issue complicating the uncertainties at this time. |
This is to document a couple of recent additions I've put in:
Hopefully I've not stuck in any bugs but if anyone does use these modes let me know...
Out of curiosity, @thnam and others ( @AndrewEdmonds11 and I have spoken a bit on email) how were you obtaining the primary particle distributions and reading in positions from histograms before? I thought we'd been doing this but the code didn't seem to support it so I guess I mis-understood what was going on.
The text was updated successfully, but these errors were encountered: