File indexing completed on 2025-08-05 08:18:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
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
0067
0068
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 }