Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
brownd1978 committed Dec 29, 2023
1 parent 1007c52 commit d70410b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Fit/BField.hh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ namespace KinKal {
// assume the next domain has ~about the same range
TimeRange newrange = (tdir == TimeDir::forwards) ? TimeRange(etime,std::max(ptraj.range().end(),drange_.end())) :
TimeRange(std::min(ptraj.range().begin(),drange_.begin()),etime);
// TimeRange newrange = (tdir == TimeDir::forwards) ? TimeRange(drange_.begin(),std::max(ptraj.range().end(),drange_.end())) :
// TimeRange(std::min(ptraj.range().begin(),drange_.begin()),drange_.end());
// update the parameters according to the change in bnom across this domain
// This corresponds to keeping the physical position and momentum constant, but referring to the BField
// at the end vs the begining of the domain
Expand Down
13 changes: 7 additions & 6 deletions Fit/Track.hh
Original file line number Diff line number Diff line change
Expand Up @@ -398,23 +398,24 @@ namespace KinKal {
effptr->print(std::cout,config().plevel_-Config::detailed);
}
}
if(status().chisq_.nDOF() >= (int)config().minndof_) { // I need a better way to define coverage as just having sufficien NDOF doesn't mean all parameters are constrained TODO
if(status().chisq_.nDOF() >= (int)config().minndof_) { // I need a better way to define coverage as this test doesn't guarantee all parameters are constrained TODO
double mintime(std::numeric_limits<double>::max());
double maxtime(-std::numeric_limits<float>::max());
for(auto beff = revbnds[0]; beff!=revbnds[1]; ++beff){
auto effptr = beff->get();
effptr->process(states[1],TimeDir::backwards);
mintime = std::min(mintime,effptr->time());
maxtime = std::max(maxtime,effptr->time());
if(effptr->active()){
double etime = effptr->time();
mintime = std::min(mintime,etime);
maxtime = std::max(maxtime,etime);
}
}
// convert the fit result into a new trajectory
// initialize the parameters to the backward processing end
auto front = fittraj_->front();
front.params() = states[1].pData();
// extend range if needed
// TimeRange maxrange(std::min(fittraj_->range().begin(),fwdbnds[0]->get()->time()),
// std::max(fittraj_->range().end(),revbnds[0]->get()->time()));
TimeRange maxrange(mintime-0.1,maxtime+0.1); //fixed time buffer shouldn't be needed FIXME
TimeRange maxrange(mintime-0.1,maxtime+0.1); //fixed time buffer should be configurable TODO
front.setRange(maxrange);
auto ptraj = std::make_unique<PTRAJ>(front);
// process forwards, adding pieces as necessary. This also sets the effects to reference the new trajectory
Expand Down

0 comments on commit d70410b

Please sign in to comment.