GENFIT  Rev:NoNumberAvailable
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
MeasurementOnPlane.cc
Go to the documentation of this file.
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "MeasurementOnPlane.h"
21 
22 #include "IO.h"
23 
24 #include <TClass.h>
25 #include <TBuffer.h>
26 
27 namespace genfit {
28 
30  MeasuredStateOnPlane(other),
31  weight_(other.weight_)
32 {
33  hMatrix_.reset(other.hMatrix_->clone());
34 }
35 
36 
38  swap(other);
39  return *this;
40 }
41 
42 
45  this->hMatrix_.swap(other.hMatrix_);
46  std::swap(this->weight_, other.weight_);
47 }
48 
49 
50 void MeasurementOnPlane::Print(Option_t*) const
51 {
52  printOut << "genfit::MeasurementOnPlane, weight = " << weight_ << "\n";
53  printOut << " state vector: "; state_.Print();
54  printOut << " covariance matrix: "; cov_.Print();
55  if (sharedPlane_ != NULL)
56  printOut << " defined in plane "; sharedPlane_->Print();
57  printOut << " hMatrix: "; hMatrix_->Print();
58 
59 }
60 
61 
62 void MeasurementOnPlane::Streamer(TBuffer &R__b)
63 {
64  // Stream an object of class genfit::MeasurementOnPlane.
65 
66  //This works around a msvc bug and should be harmless on other platforms
67  typedef ::genfit::MeasurementOnPlane thisClass;
68  UInt_t R__s, R__c;
69  if (R__b.IsReading()) {
70  Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
71  MeasuredStateOnPlane::Streamer(R__b);
72  hMatrix_.reset();
73  char flag;
74  R__b.ReadChar(flag);
75  if (flag) {
76  AbsHMatrix *h = 0;
77  R__b >> h;
78  hMatrix_.reset(h);
79  }
80  R__b >> weight_;
81  R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
82  } else {
83  R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
84  MeasuredStateOnPlane::Streamer(R__b);
85  if (hMatrix_) {
86  R__b.WriteChar(1);
87  R__b << hMatrix_.get();
88  } else {
89  R__b.WriteChar(0);
90  }
91  R__b << weight_;
92  R__b.SetByteCount(R__c, kTRUE);
93  }
94 }
95 
96 } /* End of namespace genfit */
boost::scoped_ptr< const AbsHMatrix > hMatrix_
MeasurementOnPlane(const AbsTrackRep *rep=NULL)
void swap(MeasuredStateOnPlane &other)
std::ostream printOut
StateOnPlane with additional covariance matrix.
MeasurementOnPlane & operator=(MeasurementOnPlane other)
assignment operator
void swap(MeasurementOnPlane &other)
void Print(Option_t *option="") const
Measured coordinates on a plane.
SharedPlanePtr sharedPlane_
Definition: StateOnPlane.h:137
Defines for I/O streams used for error and debug printing.