Skip to content

Commit

Permalink
Add BzSign for ShipBFieldMap
Browse files Browse the repository at this point in the history
As reported by Massi (https://indico.cern.ch/event/1447048/),
The octant symmetry is not correct for the Bz field.
  • Loading branch information
olantwin committed Nov 20, 2024
1 parent afda868 commit 85dfb34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ it in future.

### Fixed

* Use ConstructedAt instead of remove pythonization for TClonesArray
* Use ConstructedAt instead of remove pythonization for TClonesArray
* Octant symmetry was incorrect for B_z when using field maps (reported and fixed by M. Ferro-Luzzi)

### Changed

Expand Down
7 changes: 5 additions & 2 deletions field/ShipBFieldMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ void ShipBFieldMap::Field(const Double_t* position, Double_t* B)
// 4. x < 0, y < 0: Bx = Bx

Float_t BxSign(1.0);
Float_t BzSign = 1;

if (isSymmetric_) {

Expand All @@ -139,7 +140,9 @@ void ShipBFieldMap::Field(const Double_t* position, Double_t* B)
}

if (y < 0.0) {
y = -y; BxSign *= -1.0;
y = -y;
BxSign *= -1.0;
BzSign = -1.0;
}

}
Expand Down Expand Up @@ -193,7 +196,7 @@ void ShipBFieldMap::Field(const Double_t* position, Double_t* B)
// and scale with the appropriate multiplication factor (default = 1.0)
B[0] = this->BInterCalc(ShipBFieldMap::xAxis)*scale_*BxSign;
B[1] = this->BInterCalc(ShipBFieldMap::yAxis)*scale_;
B[2] = this->BInterCalc(ShipBFieldMap::zAxis)*scale_;
B[2] = this->BInterCalc(ShipBFieldMap::zAxis) * scale_ * BzSign;

}

Expand Down

0 comments on commit 85dfb34

Please sign in to comment.