Back to home page

sPhenix code displayed by LXR

 
 

    


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

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 "MeasurementOnPlane.h"
0021 
0022 #include "IO.h"
0023 
0024 #include <TClass.h>
0025 #include <TBuffer.h>
0026 
0027 namespace genfit {
0028 
0029 MeasurementOnPlane::MeasurementOnPlane(const MeasurementOnPlane& other) :
0030     MeasuredStateOnPlane(other),
0031     weight_(other.weight_)
0032 {
0033   hMatrix_.reset(other.hMatrix_->clone());
0034 }
0035 
0036 
0037 MeasurementOnPlane& MeasurementOnPlane::operator=(MeasurementOnPlane other) {
0038   swap(other);
0039   return *this;
0040 }
0041 
0042 
0043 void MeasurementOnPlane::swap(MeasurementOnPlane& other) {
0044   MeasuredStateOnPlane::swap(other);
0045   this->hMatrix_.swap(other.hMatrix_);
0046   std::swap(this->weight_, other.weight_);
0047 }
0048 
0049 
0050 void MeasurementOnPlane::Print(Option_t*) const
0051 {
0052   printOut << "genfit::MeasurementOnPlane, weight = " << weight_ << "\n";
0053   printOut << " state vector: "; state_.Print();
0054   printOut << " covariance matrix: "; cov_.Print();
0055   if (sharedPlane_ != nullptr) {
0056       printOut << " defined in plane ";
0057       sharedPlane_->Print();
0058   }
0059   printOut << " hMatrix: "; hMatrix_->Print();
0060 
0061 }
0062 
0063 
0064 void MeasurementOnPlane::Streamer(TBuffer &R__b)
0065 {
0066   // Stream an object of class genfit::MeasurementOnPlane.
0067 
0068   //This works around a msvc bug and should be harmless on other platforms
0069   typedef ::genfit::MeasurementOnPlane thisClass;
0070   UInt_t R__s, R__c;
0071   if (R__b.IsReading()) {
0072      Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
0073      MeasuredStateOnPlane::Streamer(R__b);
0074      hMatrix_.reset();
0075      char flag;
0076      R__b.ReadChar(flag);
0077      if (flag) {
0078        AbsHMatrix *h = 0;
0079        R__b >> h;
0080        hMatrix_.reset(h);
0081      }
0082      R__b >> weight_;
0083      R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
0084   } else {
0085      R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
0086      MeasuredStateOnPlane::Streamer(R__b);
0087      if (hMatrix_) {
0088        R__b.WriteChar(1);
0089        R__b << hMatrix_.get();
0090      } else {
0091        R__b.WriteChar(0);
0092      }
0093      R__b << weight_;
0094      R__b.SetByteCount(R__c, kTRUE);
0095   }
0096 }
0097 
0098 } /* End of namespace genfit */