acts-project / acts-project/acts

Create volume restricted BFieldMap

Aperta
#1,659 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Improvement Stale
Lingua principale
C++
Stelle
131
Fork
276
Merge medio
3g 13h
PR unite (30g)
112

Descrizione

As discussed in the context of `FASER2` a convenient volume restricted Bfield map could be very useful.

Possible implementation:

```c++

template
RestrictedBField {
public:
RestrictedBField(std::unique_ptr volume);

/// @copydoc MagneticFieldProvider::getFieldGradient(const Vector3&,ActsMatrix<3,3>&,MagneticFieldProvider::Cache&) const
///
/// @note The @p position is ignored and only kept as argument to provide
/// a consistent interface with other magnetic field services.
/// @note currently the derivative is not calculated
/// @todo return derivative
Result getFieldGradient(
const Vector3& position, ActsMatrix<3, 3>& derivative,
MagneticFieldProvider::Cache& cache) const override;

/// and other access methods

private :
std::unique_ptr m_magVolume;

};
```

And then simply do in the `getX(...)` implementations:

```c++
if (m_magVolume->inside(position)){
// forward call to field_type::getX(...)
return;
}
// set field to (0,0,0) otherwise
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.