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

Add beam constraint to extended tracking #75

Merged
merged 5 commits into from
Mar 9, 2021

Conversation

cgsavard
Copy link

@cgsavard cgsavard commented Mar 4, 2021

PR description:

This addition to the code allows users to add in the beam-spot constraint on top of extended tracking based on a bool located in L1Trigger/TrackFindingTMTT/src/Settings.cc called "kalmanAddBeamConstr_". The default is false. Once true, the beam spot constraint is done and the additional bcon_ variables are saved in KFTrackletTrack.h and passed along to the TTTrack. An additional check in KFbase.cc is done after the beam spot constraint is applied to the scaled chi2 variable which ensures that the new bcon_ variables can still fit into the FPGAWord.

PR validation:

I have checked that the distributions of the extended tracking with the beam spot constraint returns the same resolution in pt and phi as in the hybrid prompt tracking. These results can be found here. This also produces the same results when turned the bool is turned off as before this code was implemented.

d0_bcon_(d0),
phi0_bcon_(phi0),
chi2rphi_bcon_(chi2rphi),
done_bcon_(done_bcon),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we choose to add the "bcon" arguments to the KFTrackletTrack constructor, then the setBeamConst() function is no longer needed. Or if we choose to keep the setBeamConstr() function, then the "bcon" arguments don't need adding to the constructor.

Copy link
Author

@cgsavard cgsavard Mar 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you prefer? If in the future we just have extended tracking and a longer track word with both the bcon and non-bcon variables, what makes that transition easiest?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either solution is fine. Choose whichever is easiest for you.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took out the setBeamConstr() function

const L1TStub* l1s = L1StubIndices.at(IDf);
l1stubsFromFit.push_back(l1s);
}
if (trk.done_bcon()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you eliminate all the duplicate code between the done_bcon and not done_bcon options? e.g. How about defining float phi0fit, rinvfit, d0fit & chi2rphi, and setting them to bcon or non-bcon values, according to the value of done_bcon. Then these variables can be passed to setFitPars().

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made changes to reflect this, let me know if this is what you were invisioning.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of these lines rely on the trk phi0 which has a bcon version so this will be different with the beam spot constraint turned on

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you do:

if (trk.done_bcon()) {
phi0fit = trk.phi0_bcon();
...
} else {
phi0fit = trk.phi0();
...
}
phi0fit = reco::reduceRange(phi0fit - iSector_ * 2 * M_PI / N_SECTOR + 0.5 * settings_.dphisectorHG());
...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. In this care then I should also do this to rinvfit I would presume? It would be the same thing with

if (trk.done_bcon()) {
qoverpt = trk.qOverPt_bcon();
...
} else {
qoverpt = trk.qOverPt();
...
}
rinvfit = 0.01 * settings_.c() * settings_.bfield() * qoverpt;
...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made these changes

Copy link
Collaborator

@tomalin tomalin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@cgsavard cgsavard merged commit fb0c000 into cms-L1TK:L1TK-dev-11_3_0_pre3 Mar 9, 2021
skinnari pushed a commit that referenced this pull request May 20, 2021
* add beam spot constraint flag to save new bcon values

* add check on scaled chi2 value after beam constraint

* get rid of code duplication

* include comment on kalmanAddBeamConstr_ boolean

* take out unecessary function
skinnari pushed a commit that referenced this pull request Jun 8, 2021
* add beam spot constraint flag to save new bcon values

* add check on scaled chi2 value after beam constraint

* get rid of code duplication

* include comment on kalmanAddBeamConstr_ boolean

* take out unecessary function
skinnari pushed a commit that referenced this pull request Jun 22, 2021
* add beam spot constraint flag to save new bcon values

* add check on scaled chi2 value after beam constraint

* get rid of code duplication

* include comment on kalmanAddBeamConstr_ boolean

* take out unecessary function
skinnari pushed a commit that referenced this pull request Jun 22, 2021
* add beam spot constraint flag to save new bcon values

* add check on scaled chi2 value after beam constraint

* get rid of code duplication

* include comment on kalmanAddBeamConstr_ boolean

* take out unecessary function
skinnari pushed a commit that referenced this pull request Jul 9, 2021
* add beam spot constraint flag to save new bcon values

* add check on scaled chi2 value after beam constraint

* get rid of code duplication

* include comment on kalmanAddBeamConstr_ boolean

* take out unecessary function
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.

2 participants