Back to home page

sPhenix code displayed by LXR

 
 

    


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

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 #include "ReferenceStateOnPlane.h"
0021 
0022 #include "IO.h"
0023 
0024 namespace genfit {
0025 
0026 ReferenceStateOnPlane::ReferenceStateOnPlane() :
0027   StateOnPlane(),
0028   forwardSegmentLength_(0),
0029   backwardSegmentLength_(0),
0030   forwardTransportMatrix_(),
0031   backwardTransportMatrix_(),
0032   forwardNoiseMatrix_(),
0033   backwardNoiseMatrix_(),
0034   forwardDeltaState_(),
0035   backwardDeltaState_()
0036 {
0037   ;
0038 }
0039 
0040 ReferenceStateOnPlane::ReferenceStateOnPlane(const TVectorD& state,
0041     const SharedPlanePtr& plane,
0042     const AbsTrackRep* rep) :
0043   StateOnPlane(state, plane, rep),
0044   forwardSegmentLength_(0),
0045   backwardSegmentLength_(0),
0046   forwardTransportMatrix_(rep->getDim(), rep->getDim()),
0047   backwardTransportMatrix_(rep->getDim(), rep->getDim()),
0048   forwardNoiseMatrix_(rep->getDim()),
0049   backwardNoiseMatrix_(rep->getDim()),
0050   forwardDeltaState_(rep->getDim()),
0051   backwardDeltaState_(rep->getDim())
0052 {
0053   ;
0054 }
0055 
0056 ReferenceStateOnPlane::ReferenceStateOnPlane(const TVectorD& state,
0057     const SharedPlanePtr& plane,
0058     const AbsTrackRep* rep,
0059     const TVectorD& auxInfo) :
0060   StateOnPlane(state, plane, rep, auxInfo),
0061   forwardSegmentLength_(0),
0062   backwardSegmentLength_(0),
0063   forwardTransportMatrix_(rep->getDim(), rep->getDim()),
0064   backwardTransportMatrix_(rep->getDim(), rep->getDim()),
0065   forwardNoiseMatrix_(rep->getDim()),
0066   backwardNoiseMatrix_(rep->getDim()),
0067   forwardDeltaState_(rep->getDim()),
0068   backwardDeltaState_(rep->getDim())
0069 {
0070   ;
0071 }
0072 
0073 
0074 ReferenceStateOnPlane::ReferenceStateOnPlane(const StateOnPlane& state) :
0075   StateOnPlane(state),
0076   forwardSegmentLength_(0),
0077   backwardSegmentLength_(0),
0078   forwardTransportMatrix_(state.getRep()->getDim(), state.getRep()->getDim()),
0079   backwardTransportMatrix_(state.getRep()->getDim(), state.getRep()->getDim()),
0080   forwardNoiseMatrix_(state.getRep()->getDim()),
0081   backwardNoiseMatrix_(state.getRep()->getDim()),
0082   forwardDeltaState_(state.getRep()->getDim()),
0083   backwardDeltaState_(state.getRep()->getDim())
0084 {
0085   errorOut << "should never come here" << std::endl;
0086   exit(0);
0087 }
0088 
0089 
0090 StateOnPlane& ReferenceStateOnPlane::operator=(ReferenceStateOnPlane other) {
0091   swap(other);
0092   return *this;
0093 }
0094 
0095 void ReferenceStateOnPlane::swap(ReferenceStateOnPlane& other) {
0096   StateOnPlane::swap(other);
0097   std::swap(this->forwardSegmentLength_, other.forwardSegmentLength_);
0098   std::swap(this->backwardSegmentLength_, other.backwardSegmentLength_);
0099   this->forwardTransportMatrix_.ResizeTo(other.forwardTransportMatrix_);
0100   std::swap(this->forwardTransportMatrix_, other.forwardTransportMatrix_);
0101   this->backwardTransportMatrix_.ResizeTo(other.backwardTransportMatrix_);
0102   std::swap(this->backwardTransportMatrix_, other.backwardTransportMatrix_);
0103   this->forwardNoiseMatrix_.ResizeTo(other.forwardNoiseMatrix_);
0104   std::swap(this->forwardNoiseMatrix_, other.forwardNoiseMatrix_);
0105   this->backwardNoiseMatrix_.ResizeTo(other.backwardNoiseMatrix_);
0106   std::swap(this->backwardNoiseMatrix_, other.backwardNoiseMatrix_);
0107   this->forwardDeltaState_.ResizeTo(other.forwardDeltaState_);
0108   std::swap(this->forwardDeltaState_, other.forwardDeltaState_);
0109   this->backwardDeltaState_.ResizeTo(other.backwardDeltaState_);
0110   std::swap(this->backwardDeltaState_, other.backwardDeltaState_);
0111 }
0112 
0113 
0114 void ReferenceStateOnPlane::resetForward() {
0115   forwardSegmentLength_ = 0;
0116   forwardTransportMatrix_.UnitMatrix();
0117   forwardNoiseMatrix_.Zero();
0118   forwardDeltaState_.Zero();
0119 }
0120 
0121 void ReferenceStateOnPlane::resetBackward() {
0122   backwardSegmentLength_ = 0;
0123   backwardTransportMatrix_.UnitMatrix();
0124   backwardNoiseMatrix_.Zero();
0125   backwardDeltaState_.Zero();
0126 }
0127 
0128 
0129 void ReferenceStateOnPlane::Print(Option_t*) const {
0130   StateOnPlane::Print();
0131 
0132   printOut << " forwardSegmentLength: " << forwardSegmentLength_ << "\n";
0133   printOut << " forwardTransportMatrix: "; forwardTransportMatrix_.Print();
0134   printOut << " forwardNoiseMatrix: "; forwardNoiseMatrix_.Print();
0135   printOut << " forwardDeltaState: "; forwardDeltaState_.Print();
0136 
0137   printOut << " backwardSegmentLength_: " << backwardSegmentLength_ << "\n";
0138   printOut << " backwardTransportMatrix: "; backwardTransportMatrix_.Print();
0139   printOut << " backwardNoiseMatrix: "; backwardNoiseMatrix_.Print();
0140   printOut << " backwardDeltaState: "; backwardDeltaState_.Print();
0141 }
0142 
0143 
0144 } /* End of namespace genfit */