-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add beam constraint to extended tracking #75
Conversation
d0_bcon_(d0), | ||
phi0_bcon_(phi0), | ||
chi2rphi_bcon_(chi2rphi), | ||
done_bcon_(done_bcon), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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().
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, almost. Though you should be able to eliminate also duplicate code at https://github.com/cgsavard/cmssw/blob/add_beam_constr/L1Trigger/TrackFindingTracklet/src/HybridFit.cc#L206 and https://github.com/cgsavard/cmssw/blob/add_beam_constr/L1Trigger/TrackFindingTracklet/src/HybridFit.cc#L215 .
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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());
...
There was a problem hiding this comment.
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;
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made these changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
* 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
* 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
* 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
* 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
* 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
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.