Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:23

0001 /* Copyright 2008-2010, Technische Universitaet Muenchen,
0002    Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
0003 
0004    This file is part of GENFIT.
0005 
0006    GENFIT is free software: you can redistribute it and/or modify
0007    it under the terms of the GNU Lesser General Public License as published
0008    by the Free Software Foundation, either version 3 of the License, or
0009    (at your option) any later version.
0010 
0011    GENFIT is distributed in the hope that it will be useful,
0012    but WITHOUT ANY WARRANTY; without even the implied warranty of
0013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014    GNU Lesser General Public License for more details.
0015 
0016    You should have received a copy of the GNU Lesser General Public License
0017    along with GENFIT.  If not, see <http://www.gnu.org/licenses/>.
0018 */
0019 
0020 /** @addtogroup genfit
0021  * @{
0022  */
0023 
0024 #ifndef genfit_ReferenceStateOnPlane_h
0025 #define genfit_ReferenceStateOnPlane_h
0026 
0027 #include "StateOnPlane.h"
0028 
0029 
0030 namespace genfit {
0031 
0032 /**
0033  * @brief #StateOnPlane with linearized transport to that #ReferenceStateOnPlane from previous and next #ReferenceStateOnPlane
0034  *
0035  * Transport matrices describe transport TO that plane.
0036  * We have transport matrix F, noise matrix N and delta state c.
0037  * Now, state p and covariance C follow this mathematics:
0038  *
0039  * p = F * p_old + c
0040  * C = F * C_old * F^T + N
0041  *
0042  */
0043 class ReferenceStateOnPlane : public StateOnPlane {
0044 
0045  public:
0046 
0047   ReferenceStateOnPlane();
0048   ReferenceStateOnPlane(const TVectorD& state,
0049       const SharedPlanePtr& plane,
0050       const AbsTrackRep* rep);
0051   ReferenceStateOnPlane(const TVectorD& state,
0052       const SharedPlanePtr& plane,
0053       const AbsTrackRep* rep,
0054       const TVectorD& auxInfo);
0055   ReferenceStateOnPlane(const StateOnPlane& state);
0056   ReferenceStateOnPlane(const ReferenceStateOnPlane&) = default;
0057 
0058   StateOnPlane& operator=(ReferenceStateOnPlane other);
0059   void swap(ReferenceStateOnPlane& other); // nothrow
0060 
0061   virtual ~ReferenceStateOnPlane() {}
0062 
0063   void setForwardSegmentLength(double len) {forwardSegmentLength_ = len;}
0064   void setBackwardSegmentLength(double len) {backwardSegmentLength_ = len;}
0065   void setForwardTransportMatrix(const TMatrixD& mat) {forwardTransportMatrix_.ResizeTo(mat); forwardTransportMatrix_=mat;}
0066   void setBackwardTransportMatrix(const TMatrixD& mat) {backwardTransportMatrix_.ResizeTo(mat); backwardTransportMatrix_=mat;}
0067   void setTransportMatrix(const TMatrixD& mat, int direction) {if (direction >= 0) setForwardTransportMatrix(mat); else setBackwardTransportMatrix(mat);}
0068   void setForwardNoiseMatrix(const TMatrixDSym& mat) {forwardNoiseMatrix_.ResizeTo(mat); forwardNoiseMatrix_=mat;}
0069   void setBackwardNoiseMatrix(const TMatrixDSym& mat) {backwardNoiseMatrix_.ResizeTo(mat); backwardNoiseMatrix_=mat;}
0070   void setNoiseMatrix(const TMatrixDSym& mat, int direction) {if (direction >= 0) setForwardNoiseMatrix(mat); else setBackwardNoiseMatrix(mat);}
0071   void setForwardDeltaState(const TVectorD& mat) {forwardDeltaState_.ResizeTo(mat); forwardDeltaState_=mat;}
0072   void setBackwardDeltaState(const TVectorD& mat) {backwardDeltaState_.ResizeTo(mat); backwardDeltaState_=mat;}
0073   void setDeltaState(const TVectorD& mat, int direction) {if (direction >= 0) setForwardDeltaState(mat); else setBackwardDeltaState(mat);}
0074 
0075 
0076   double getForwardSegmentLength() const {return forwardSegmentLength_;}
0077   double getBackwardSegmentLength() const {return backwardSegmentLength_;}
0078   const TMatrixD& getForwardTransportMatrix() const {return forwardTransportMatrix_;}
0079   const TMatrixD& getBackwardTransportMatrix() const {return backwardTransportMatrix_;}
0080   const TMatrixD& getTransportMatrix(int direction) const {if (direction >= 0) return forwardTransportMatrix_; return backwardTransportMatrix_;}
0081   const TMatrixDSym& getForwardNoiseMatrix() const {return forwardNoiseMatrix_;}
0082   const TMatrixDSym& getBackwardNoiseMatrix() const {return backwardNoiseMatrix_;}
0083   const TMatrixDSym& getNoiseMatrix(int direction) const {if (direction >= 0) return forwardNoiseMatrix_; return backwardNoiseMatrix_;}
0084   const TVectorD& getForwardDeltaState() const {return forwardDeltaState_;}
0085   const TVectorD& getBackwardDeltaState() const {return backwardDeltaState_;}
0086   const TVectorD& getDeltaState(int direction) const {if (direction >= 0) return forwardDeltaState_; return backwardDeltaState_;}
0087 
0088   void resetForward();
0089   void resetBackward();
0090 
0091   virtual void Print(Option_t* option = "") const override;
0092 
0093  protected:
0094 
0095   double forwardSegmentLength_; /**< Segment length from previous referenceState */
0096   double backwardSegmentLength_; /**< Segment length from next referenceState */
0097   TMatrixD forwardTransportMatrix_; /**< transport matrix F from previous referenceState */
0098   TMatrixD backwardTransportMatrix_; /**< transport matrix F from next referenceState */
0099   TMatrixDSym forwardNoiseMatrix_; /**< noise matrix N for transport from previous referenceState */
0100   TMatrixDSym backwardNoiseMatrix_; /**< noise matrix N for transport from next referenceState */
0101   TVectorD forwardDeltaState_; /**< c */
0102   TVectorD backwardDeltaState_; /**< c */
0103 
0104 
0105  public:
0106 
0107   ClassDefOverride(ReferenceStateOnPlane,1)
0108 
0109 };
0110 
0111 } /* End of namespace genfit */
0112 /** @} */
0113 
0114 #endif // genfit_ReferenceStateOnPlane_h