Skip to content

Commit

Permalink
Merge pull request KFTrack#197 from bonventre/klextrap
Browse files Browse the repository at this point in the history
Update KinematicLine intersect and add no bfield extendTraj
  • Loading branch information
brownd1978 authored Oct 30, 2024
2 parents 1ff3309 + e67811f commit 348e945
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,20 @@ jobs:
with:
fetch-depth: 0
- name: Install conda environment with micromamba
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
micromamba-version: 'latest'
environment-name: "kinkal-test-env"
channels: conda-forge,defaults
channel-priority: strict
extra-specs: |
create-args: >-
python=${{ matrix.python-version }}
root=${{ matrix.root-version }}
cxx-compiler
cmake
condarc : |
channels:
- conda-forge
- defaults
channel-priority: strict
- name: CMake (${{ matrix.build-type }})
run: |
cd ..
Expand Down
7 changes: 7 additions & 0 deletions Fit/Track.hh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ namespace KinKal {
DOMAINCOL const& domains() const { return domains_; }
void print(std::ostream& ost=std::cout,int detail=0) const;
TimeRange activeRange() const; // time range of active hits
void extendTraj(TimeRange const& newrange);
protected:
Track(Config const& cfg, BFieldMap const& bfield, PTRAJ const& seedtraj );
void fit(HITCOL& hits, EXINGCOL& exings );
Expand Down Expand Up @@ -308,6 +309,12 @@ namespace KinKal {
}
}

template <class KTRAJ> void Track<KTRAJ>::extendTraj(TimeRange const& newrange){
TimeRange temprange(std::min(fittraj_->range().begin(),newrange.begin()),
std::max(fittraj_->range().end(),newrange.end()));
fittraj_->setRange(temprange);
}

template <class KTRAJ> void Track<KTRAJ>::createTraj(PTRAJ const& seedtraj , TimeRange const& range, DOMAINCOL const& domains ) {
// if we're making local DomainWall corrections, divide the trajectory into domain pieces. Each will have equivalent parameters, but relative
// to the local field
Expand Down
4 changes: 3 additions & 1 deletion Geometry/Intersect.hh
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,10 @@ namespace KinKal {
retval.norm_ = surf.normal(retval.pos_);
retval.pdir_ = dir;
// calculate the time
retval.time_ = tstart + dist/kkline.speed(tstart);
retval.time_ = tstart + dist*timeDirSign(tdir)/kkline.speed(tstart);
}
// check the final time to be in range; if we're out of range, negate the intersection
if(!trange.inRange(retval.time_))retval.inbounds_ = false; // I should make a separate flag for time bounds TODO
return retval;
}
// generic surface intersection cast down till we find something that works. This will only be used for helices, as KinematicLine
Expand Down

0 comments on commit 348e945

Please sign in to comment.