-
Notifications
You must be signed in to change notification settings - Fork 10
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
Load track parameter constraints from external resource files #947
Comments
I have always just used a text file... |
Does java have an good xml parser? I just feel like a more rigid format will make it easier to maintain. |
I've written a basic JNA accessor to the root library. This has the C wrappers to open TFiles and load histograms in memory. I can augment those by adding the GetBin and GetBinContent which should be everything we need to load corrections. In my view this might be a nice tool. |
There is a native Java interface for reading simple root files available in freehep. I've not used it explicitly in a while, so you would have to check whether it works with the latest root files. Details at java.freehep.org/lib/freehep/doc/root/index.html |
Hi Norman, it doesn't work unfortunately. I found it yesterday and tried it before developing my own. I'm not able to run the basic example as it crashes when opening a file. It exists also a JNI implementation called jroot, but doesn't compile even if reverting to Java SDK 8 (the one used to compile the repo) |
I'm able to open / close a file and to read in an histogram and it's content.
I'll develop track parameter dependent constraints using this tool. If there is interest to add it to hps-java I can open a PR similar to what was done for accessing GBL via JNA. |
adding @cbravo135 as SW coord |
Java does have a decent XML parser (JDOM Parser, StAX Parser) so this may be the simplest solution. However, being able to use 3D histograms and possibly perform some basic fits within hps-java makes the JNA/JNI solution much more attractive. |
My vote is for JNA/JNI. |
I would much prefer to get any needed corrections directly from the data on a track-by-track basis instead of introducing essentially arbitrary modifications. |
If we do decide to introduce a JNA/JNI solution, it should be off by default so we do not introduce any additional dependencies into our hps-java build system. |
Hi @normangraf, We already have JNA dependence from the GBL library, which is OFF by default. This will be introduced with the same spirit: targeted to alignment and off by default. I think this could be a good solution. @omar-moreno Anyway this is just a suggestion. If this doesn't make it to master, I will still make an "alignment branch" with this in. I think Cam should have the final say on this as SW coordinator. |
Please proceed as this will provide new functionality that might be used in other ways. (I'll look into the freehep issue if I can ever find some "spare" time.) And, as you note, we already have the external dependencies as options. My concern was that sampling, for instance, an E/p correction from a distribution derived from an ensemble of tracks would not be as specific as that obtained from the energy of the cluster associated with that particular track. |
Hi Norman, My idea is to use <E/p> for positive and negative tracks to correct the track fit and modify the track-by-track Chi2 instead of simply E/p on track-by-track basis. Using the average, binned in phi/tanL, should give enough granularity to fix angle dependent biases and the advantage would be a stronger statistical power. However, I am struggling to add additional motivations to why to prefer that method over just using E/p on track-by-track basis. I suppose that over a large sample of tracks, results would be the same. |
You might want to look at this package: https://github.com/chekanov/RootIOreader . |
I'm still not sure why you don't just read in some reference histograms and use them directly. |
Sorry, I missed your comment Norman. |
Regarding the package you pointed me to. In the readme there is written: I am not sure if the scope of this package is to illustrate a compatibility issue. I went through the bug report and it's not clear to me if the package is functional. |
So, basically in order to complete some sort of constrained alignment, we should load track parameter constraints from external sources. For example, if we want to correct p vs tanL trend, we could load the EoP correction binned in tanLambda.
We need:
The easiest idea is to use .txt files or .xml files to be loaded in java. Other suggestions?
@omar-moreno @normangraf @tomeichlersmith
Cheers,
PF
The text was updated successfully, but these errors were encountered: