Giter Site home page Giter Site logo

Millepede-II set-up about offline HOT 14 OPEN

ryuwd avatar ryuwd commented on September 16, 2024
Millepede-II set-up

from offline.

Comments (14)

ryuwd avatar ryuwd commented on September 16, 2024

Need Kalman Fit of straight cosmic track, and the form of the residual derivatives. Then it will be possible to start running Millepede.

from offline.

ryuwd avatar ryuwd commented on September 16, 2024

Can start running Millepede now to test with biased residuals and partial derivatives (analytically calculated).

Start thinking about writing a steering and constraints file for plane alignment.

from offline.

ryuwd avatar ryuwd commented on September 16, 2024

Steering file format pretty easy to understand.

Cfiles
<path to binary Mille file> ! comment is denoted by exclamation mark
<path to binary Mille file> ! another file

Constraints ! sets constraints
<constraint settings go here>

method inversion 5 0.1 ! tells pede what solving method to use

The above listing is an example, and the final steering file would probably need more settings applied.
Can set up an alignment combining multiple bin files generated by PlaneAlignment module (containing track residual + derivative data).

Can set up equality constraints between global parameters to 'eliminate' weak degrees of freedom.

I'd first like to try gathering a sample of 10,000+ cosmic tracks to see how ./pede handles them. Currently have amassed about 300 for tests but I don't think this is close to enough, and ./pede doesn't seem to like it.

from offline.

soleti avatar soleti commented on September 16, 2024

Hi Ryun, I've also started looking into Millepede for alignment but I've encountered some issues we might want to address before we continue. In particular, while Millepede would be a good solution for the alignment using straight cosmic tracks (so without a Kalman filter), it can't be used directly with our Kalman filter fit, which we will want do in the future (we will use DIOs and cosmic rays with magnetic field on eventually).
In CMS, for example, they do a re-fit with GBL https://arxiv.org/pdf/1403.2286.pdf that is then used for the alignment procedure.
This is because the computation of the covariance matrix in the Kalman track fit is not complete. This paper https://arxiv.org/pdf/0810.2241.pdf shows a recipe on how to go around this limitation, but I am not sure it would be possible to adapt it to the Millepede input (I am still reading it).
This is not to say we should stop working on this but that maybe we should think more about our approach to the alignment: do we want to do a refit (my feeling is no)? Do we want to use a local iterative approach https://iopscience.iop.org/article/10.1088/1742-6596/119/3/032038/pdf? We should discuss this before we go full steam on code writing.

from offline.

ryuwd avatar ryuwd commented on September 16, 2024

Hi Stefano,
If OK I think Dave should also comment on this, @brownd1978

A few details on alignment with cosmic rays:

  • My current approach is based on a number of discussions between me, Dave, Sophie, my supervisors, and Silvia Borghi at CERN (LHCb alignment)

  • As things are, Sophie is adapting the cosmic track finder to use a Kalman fit / BTrk for the single field off track fit

  • So, we actually are using a Kalman filter for straight cosmics.

    • This allows us to access unbiased residuals without refitting (using LOOCV - leave one out cross-validation) on the straw hits - I have tried this already and it is a slow and unstable process.
    • Dave has said that BTrk supports the exclusion of hits without refitting. This gives us access to the residuals unbiased by the fit (caused by the lack of consideration of alignment constants in the model)
  • My impression of Millepede-II so far is that it is very suitable for straight track cosmics, and probably suitable for magnet on too.

  • My current changes use DOCA as a first-order 'residual' that Millepede aims to minimise during the fit. I will soon change this to use the 'time residual' instead, which will improve accuracy

  • Millepede-II removes complexity from the solving for the alignment implementation-wise

  • Millepede-II solvers can be run on a desktop PC in acceptable timeframes for ~100,000 degrees of freedom

  • When we get to magnet-on, the track parameterisation will change, but this doesn't matter as long as we can calculate the residual derivatives wrt each 'local fit' track parameter.

  • http://www.desy.de/~kleinwrt/MP2/doc/html/draftman_page.html is a very good resource on the Millepede method.

I think it's worth a go. I've already written a module that takes track information and outputs Millepede binary files. I just need the Tracker misalignments simualation to work first (nearly done, issue Mu2e#77)

from offline.

ryuwd avatar ryuwd commented on September 16, 2024

For DIOs perhaps another approach would be suitable, such as the one described in this paper (LHCb uses this): (page 13)
https://mega.nz/#!lwYQHSiL!CXkNLDSOwc4BL0ewEUK9_AdW8IOLcivqGwz8pqzdGGM

But currently not there yet

from offline.

soleti avatar soleti commented on September 16, 2024

I am well aware of the advantages of Millepede-II and I am not saying we should abandon it. As far as I've understood, Sophie's straight cosmic track fit is a "classic" fit and not a Kalman filter fit, which means it has a global parametrization. This makes it particularly suitable for Millepede-II. However, if we want to have a single alignment procedure that can use also
DIOs and cosmic rays with magnet on we should think carefully if the Millepede-II is the best way to go.

from offline.

ryuwd avatar ryuwd commented on September 16, 2024

Sophie is currently refactoring her CosmicReco package to use a Kalman Filter for single straight cosmic track fitting, instead of the Max Likelihood fit with MINUIT, so the classic fit wouldn't be used.

The current state of my branch was an attempt to use the classic fit, but this will be changed to use the new track parameterisation when it is available

For the alignment project, my supervisor Marco is in charge of 'alignment execution'. I will speak to my supervisors further (probably Monday?) for the details about the magnet-on and DIO case (also Dave will already know a great deal about this.) I agree at this stage it is difficult to be able to conveniently unify all of the Alignment procedures without further study and discussion.

from offline.

soleti avatar soleti commented on September 16, 2024

The problem of moving from a classic fit to a Kalman filter fit is that the correlations between track parameters at different positions are not calculated, so you can't use the result of Kalman filter fit, at least not directly, as explained here https://arxiv.org/pdf/0810.2241.pdf. There are few ways to overcome this but they are all non trivial and we should discuss them in detail.

from offline.

ryuwd avatar ryuwd commented on September 16, 2024

Hi Stefano,

Apologies for the delay in replying. I had a quick read - I had actually downloaded this specific paper a few months back but haven't had a chance to read yet. I think this method is also used in the LHCb kalman filter alignment method as well. So you're saying that the direct inavailability of the variance-covariance matrix of the track parameters would not allow us to calculate the residual derivatives with respect to those parameters (which is needed by Millepede)? Up to now I was not entirely certain of how to go about it, so you raise a valid point.

The reason I am still fairly certain of Millepede-II (for straight track kalman) is that the manual explicitly does not rule out the use of Kalman-fitted tracks (see: Application: alignment of tracking detectors.) The manual suggests a workaround to the problem you raise by calculating the residual derivatives numerically, but an analytical calculation of them sounds a million times better to me, and this paper seems to provide a solution for it. I'd definitely prefer using this paper's method if it is valid, over a numerical approximation.

Making sure that the correct residual derivatives wrt the track parameters are available after a kalman track fit routine generally will be useful for any alignment routine that we may decide to use (such as a closed-form Kalman alignment, Millepede-II, or iterative method.)

With that in mind, I agree it's worth implementing or at least discussing further?

Best wishes, Ryun

from offline.

ryuwd avatar ryuwd commented on September 16, 2024

Also wrt DIO's and magnet on cosmics, we've not gotten around to discussing what to use for these yet, so that is still open to discussion. There is also still a lot of unfinished infrastructure in that area. Maybe it is worth discussing with Dave, Sophie, my supervisors in another zoom meeting to discuss alignment progress sometime?

For straight cosmics, it seems like so far the consensus is to use Millepede-II.

from offline.

soleti avatar soleti commented on September 16, 2024

Yes, that was my point. I am not sure if the procedure described in the paper can be easily interfaced to Millepede. The paper itself doesn't mention it, so I assume it was a custom solution. It was actually implemented in LHCb so your supervisor probably knows more. It is true that the Millepede manual mentions the Kalman filter, however I couldn't find a paper describing it (probably it's too expensive computationally?). For example both CMS and Belle2 refit with General Broken Lines. Also, quoting from https://arxiv.org/pdf/1403.2286.pdf:

However, the Kalman filter does not provide the full (singular)
covariance matrix Cāˆ’1 of these parameters as needed in a global-fit alignment approach. As j
shown in [24], the Kalman filter fit procedure can be extended to provide this covariance ma- trix, but since MILLEPEDE II is designed for a simultaneous fit of all measurements, another approach is followed here.

In any case, I agree it would be interesting to use Millepede with the straight cosmic track classic fit and maybe compare the results with a local iterative approach.

from offline.

ryuwd avatar ryuwd commented on September 16, 2024

Hi Roberto,

Thanks for the reply. The problem with using the classic fit is we are working with biased residuals and 'cross-validation' or refitting isn't possible (I've tried it and it's very unstable + slow.)

I'm relatively close to being able to run some tests with Millepede-II using nofield cosmic tracks from the classic fit, but these would use 'biased' residuals as input.

In the case that a kalman track is used, we get 'unbiased residuals' and my understanding is that the Millepede manual suggests calculating (for each hit):

  • (change in residual) / (variation/delta of track parameter) for each track parameter, per hit.

The residual in our case is the (DOCA - drift radius), so to find a residual derivative numerically we'd calculate the change in DOCA divided by the delta of the track parameter. (not 100% sure of this yet, and a good performance may not be guaranteed either)

Also, quoting from https://arxiv.org/pdf/1403.2286.pdf:

However, the Kalman filter does not provide the full (singular)
covariance matrix Cāˆ’1 of these parameters as needed in a global-fit alignment approach. As j
shown in [24], the Kalman filter fit procedure can be extended to provide this covariance ma- trix, but since MILLEPEDE II is designed for a simultaneous fit of all measurements, another approach is followed here.

My feeling is that implementing a GBL procedure would require rewriting a fresh cosmic track fit again (which seems undesirable, if just to accommodate Millepede, and since it is already undergoing a major refactor by Sophie for the straight track kalman fit)

By local iterative approach do you mean the kalman filter alignment method you linked earlier?

Thanks, Ryun

from offline.

soleti avatar soleti commented on September 16, 2024

Hi Ryun,

Yes, I also think re-fitting is not the right solution. I was just pointing out that this was the choice made by CMS and Belle2 but we don't have to follow it necessarily. Yes, by local iterative approach I mean the procedure described in http://cds.cern.ch/record/1073700/files/CR2007_055.pdf.

from offline.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.