Skip to content

Commit

Permalink
fixed Seed charge calculation (#1213)
Browse files Browse the repository at this point in the history
### Briefly, what does this PR introduce?
This pull request modifies the calculation of the seed charge for real
seeding for particles generated off the beam axis.

The diagram below shows the proposed change

<img width="816" alt="Screenshot 2024-01-10 at 3 03 59 PM"
src="https://github.com/eic/EICrecon/assets/108902343/5e229492-26d7-4ae0-bd7f-019b15bb8bfd">

Here is some statistics to validate this request:
N=10k events, muon with eta -4 to 4, and momentum 0.5 to 20 GeV


Negative muon at (0,0,0)
Total seeds: 25774
Wrong charge seeds (pre-fix):  301 (1.2%)
Wrong charge seeds (post-fix): 224 (0.87%)

Negative muon at (1,0,0) mm
Total seeds: 25521
Wrong charge seeds(pre-fix): 5407 (21.1%)
Wrong charge seeds(post-fix): 230 (0.9%)

Positive muon at (1,0,0) mm
Total seeds: 27688
Wrong charge seeds(pre-fix): 5376 (19.4%)
Wrong charge seeds(post-fix): 368 (1.3%)

This shows that the results are stable for particle generated at z=0. 
for particles generated off the beam axis, the results improve
significantly for both positive and negative muon.

### What kind of change does this PR introduce?
- [ X] Bug fix (issue #__)
- [ ] New feature (issue #__)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [x ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ x] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
none

### Does this PR change default behavior?
yes, for real seeded tracking

---------

Co-authored-by: Barak Schmookler <[email protected]>
  • Loading branch information
Jeet-bhai and bschmookler authored Jan 11, 2024
1 parent 3b8d579 commit 417daff
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/algorithms/tracking/TrackSeeding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,18 @@ std::unique_ptr<edm4eic::TrackParametersCollection> eicrecon::TrackSeeding::make
}

auto slopeZ0 = lineFit(rzHitPositions);
const auto xypos = findPCA(RX0Y0);

//Determine charge
std::vector<std::pair<float,float>> xyrelPos;

for ( const auto& spptr : seed.sp() )
{
xyrelPos.emplace_back(spptr->x()-xypos.first, spptr->y()-xypos.second);
}

int charge = determineCharge(xyrelPos);

int charge = determineCharge(xyHitPositions);
float theta = atan(1./std::get<0>(slopeZ0));
// normalize to 0<theta<pi
if(theta < 0)
Expand All @@ -192,8 +202,6 @@ std::unique_ptr<edm4eic::TrackParametersCollection> eicrecon::TrackSeeding::make
float p = pt * cosh(eta);
float qOverP = charge / p;

const auto xypos = findPCA(RX0Y0);

//Calculate phi at xypos
auto xpos = xypos.first;
auto ypos = xypos.second;
Expand Down

0 comments on commit 417daff

Please sign in to comment.