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

Implementing TRestAxionMagneticFit and related classes #90

Closed
wants to merge 23 commits into from

Conversation

jgalan
Copy link
Member

@jgalan jgalan commented Mar 13, 2024

jgalan Large: 1655 Powered by Pull Request Badge

  • Implement a class TRestAxionMagneticFit that allows to describe the field along Z using a parametric function for each Bx, By, Bz component.

  • Upgrade the TRestAxionMagneticFit and do the necessary changes so that we obtain a valid fit for any (X,Y) set values. Right now is optimized for X=340mm Y=0mm.

  • Implement a new class TRestAxionMagnetModel that will contain the fits for all the (X,Y) values, and that defines an interpolation function to access the field on non-parallel tracks.

The following code can be used to reproduce the results obtained in this PR. Also found inside TRestAxionMagneticFit documentation.

TRestAxionMagneticField field("fields.rml", "babyIAXO_2024");

// Extracting the profile for each B-component (must be a parallel track)
Double_t dl = 50;
std::vector<Double_t> bX = field.GetComponentAlongPath( 0, TVector3(340, 0, -10000), TVector3(340, 0, 10000), dl );
std::vector<Double_t> bY = field.GetComponentAlongPath( 1, TVector3(340, 0, -10000), TVector3(340, 0, 10000), dl );
std::vector<Double_t> bZ = field.GetComponentAlongPath( 2, TVector3(340, 0, -10000), TVector3(340, 0, 10000), dl );
 
std::vector<Double_t> z;
for( int n = 0; n < bX.size(); n++ )
    z.push_back(dl/2 + n * dl);
 
TRestAxionMagneticFit bFit;
bFit.LoadData( z, bX, bY, bZ );
 
bFit.Fit( );
 
TCanvas *c = bFit.DrawComponents();
c->Print("bFit.png");
Screenshot 2024-04-08 at 11 19 47

@jgalan jgalan changed the title Fixing compilation problem Implementing TRestAxionMagneticFit and related classes Apr 8, 2024
@jgalan jgalan requested review from LouisHelary, francandon and a team April 8, 2024 09:24
@jgalan
Copy link
Member Author

jgalan commented May 3, 2024

Not needed anymore since @LouisHelary found a fix for the long computation times required on field retrieval at #92

@jgalan jgalan closed this May 3, 2024
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

Successfully merging this pull request may close these issues.

1 participant