SND@LHC Software
Loading...
Searching...
No Matches
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 <iostream>
21#include <TClass.h>
22#include <TBuffer.h>
23
24#include "MeasurementOnPlane.h"
25
26namespace genfit {
27
30 weight_(other.weight_)
31{
32 hMatrix_.reset(other.hMatrix_->clone());
33}
34
35
40
41
44 this->hMatrix_.swap(other.hMatrix_);
45 std::swap(this->weight_, other.weight_);
46}
47
48
49void MeasurementOnPlane::Print(Option_t*) const
50{
51 std::cout << "genfit::MeasurementOnPlane, weight = " << weight_ << "\n";
52 std::cout << " state vector: "; state_.Print();
53 std::cout << " covariance matrix: "; cov_.Print();
54 if (sharedPlane_ != NULL)
55 std::cout << " defined in plane "; sharedPlane_->Print();
56 std::cout << " hMatrix: "; hMatrix_->Print();
57
58}
59
60
61void MeasurementOnPlane::Streamer(TBuffer &R__b)
62{
63 // Stream an object of class genfit::MeasurementOnPlane.
64
65 //This works around a msvc bug and should be harmless on other platforms
66 typedef ::genfit::MeasurementOnPlane thisClass;
67 UInt_t R__s, R__c;
68 if (R__b.IsReading()) {
69 Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
70 MeasuredStateOnPlane::Streamer(R__b);
71 hMatrix_.reset();
72 char flag;
73 R__b.ReadChar(flag);
74 if (flag) {
75 AbsHMatrix *h = 0;
76 R__b >> h;
77 hMatrix_.reset(h);
78 }
79 R__b >> weight_;
80 R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
81 } else {
82 R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
83 MeasuredStateOnPlane::Streamer(R__b);
84 if (hMatrix_) {
85 R__b.WriteChar(1);
86 R__b << hMatrix_.get();
87 } else {
88 R__b.WriteChar(0);
89 }
90 R__b << weight_;
91 R__b.SetByteCount(R__c, kTRUE);
92 }
93}
94
95} /* End of namespace genfit */
StateOnPlane with additional covariance matrix.
void swap(MeasuredStateOnPlane &other)
Measured coordinates on a plane.
void Print(Option_t *option="") const
void swap(MeasurementOnPlane &other)
MeasurementOnPlane & operator=(MeasurementOnPlane other)
assignment operator
boost::scoped_ptr< const AbsHMatrix > hMatrix_
MeasurementOnPlane(const AbsTrackRep *rep=NULL)
SharedPlanePtr sharedPlane_
Matrix inversion tools.
Definition AbsBField.h:29