Skip to content

Commit

Permalink
Making the second histogram work, see #53
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinVallejo committed Nov 12, 2024
1 parent dcd365e commit 209ce8c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/spin/model/SpinModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,15 @@ export default class SpinModel implements TModel {
particle.reset();
}
}

const secondDetectorPosition = this.sternGerlachs[ 1 ].positionProperty.value.plus( BLOCKER_OFFSET ).x;
if ( particle.positionProperty.value.x >= secondDetectorPosition ) {
if ( !particle.wasCounted[ 2 ] ) {
// Regardless which SG is active, we count the particles in the SG1
this.sternGerlachs[ 1 ].count( particle.isSpinUp[ 2 ] );
particle.wasCounted[ 2 ] = true;
}
}
} );
}
}
Expand Down

0 comments on commit 209ce8c

Please sign in to comment.