GENFIT Rev: NoNumberAvailable
Loading...
Searching...
No Matches
FullMeasurement.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 "FullMeasurement.h"
21
22#include <Exception.h>
23#include <RKTrackRep.h>
24#include <HMatrixUnit.h>
25
26#include <cassert>
27#include <TBuffer.h>
28
29namespace genfit {
30
32 : AbsMeasurement(nDim), plane_()
33{
34 assert(nDim >= 1);
35}
36
37
38FullMeasurement::FullMeasurement(const MeasuredStateOnPlane& state, int detId, int hitId, TrackPoint* trackPoint)
39 : AbsMeasurement(state.getState(), state.getCov(), detId, hitId, trackPoint), plane_(state.getPlane())
40{
41 assert(rawHitCoords_.GetNrows() == (int)state.getRep()->getDim());
42}
43
44
46 if (!plane_) {
47 Exception exc("FullMeasurement::constructPlane(): No plane has been set!", __LINE__,__FILE__);
48 throw exc;
49 }
50 return plane_;
51}
52
53
54std::vector<MeasurementOnPlane*> FullMeasurement::constructMeasurementsOnPlane(const StateOnPlane& state) const {
55
58 state.getPlane(), state.getRep(), constructHMatrix(state.getRep()));
59
60 std::vector<MeasurementOnPlane*> retVal;
61 retVal.push_back(mop);
62 return retVal;
63}
64
65
67
68 if (dynamic_cast<const RKTrackRep*>(rep) == nullptr) {
69 Exception exc("SpacepointMeasurement default implementation can only handle state vectors of type RKTrackRep!", __LINE__,__FILE__);
70 throw exc;
71 }
72
73 return new HMatrixUnit();
74}
75
76
77void FullMeasurement::Streamer(TBuffer &R__b)
78{
79 // Stream an object of class genfit::FullMeasurement.
80
81 //This works around a msvc bug and should be harmless on other platforms
82 typedef ::genfit::FullMeasurement thisClass;
83 UInt_t R__s, R__c;
84 if (R__b.IsReading()) {
85 Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
86 //This works around a msvc bug and should be harmless on other platforms
87 typedef genfit::AbsMeasurement baseClass0;
88 baseClass0::Streamer(R__b);
89 char flag;
90 R__b >> flag;
91 plane_.reset();
92 if (flag) {
93 plane_.reset(new DetPlane());
94 plane_->Streamer(R__b);
95 }
96 R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
97 } else {
98 R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
99 //This works around a msvc bug and should be harmless on other platforms
100 typedef genfit::AbsMeasurement baseClass0;
101 baseClass0::Streamer(R__b);
102 if (plane_) {
103 R__b << (char)1;
104 plane_->Streamer(R__b);
105 } else {
106 R__b << (char)0;
107 }
108 R__b.SetByteCount(R__c, kTRUE);
109 }
110}
111
112} /* End of namespace genfit */
HMatrix for projecting from AbsTrackRep parameters to measured parameters in a DetPlane.
Definition AbsHMatrix.h:37
Contains the measurement and covariance in raw detector coordinates.
Abstract base class for a track representation.
Definition AbsTrackRep.h:66
virtual unsigned int getDim() const =0
Get the dimension of the state vector used by the track representation.
Exception class for error handling in GENFIT (provides storage for diagnostic information)
Definition Exception.h:48
Measurement class implementing a measurement of all track parameters.
virtual SharedPlanePtr constructPlane(const StateOnPlane &state) const override
virtual std::vector< MeasurementOnPlane * > constructMeasurementsOnPlane(const StateOnPlane &state) const override
virtual const AbsHMatrix * constructHMatrix(const AbsTrackRep *) const override
AbsHMatrix implementation for 5-dimensional MeasurementOnPlane and RKTrackRep parameterization.
Definition HMatrixUnit.h:40
StateOnPlane with additional covariance matrix.
Measured coordinates on a plane.
AbsTrackRep with 5D track parameterization in plane coordinates: (q/p, u', v', u, v)
Definition RKTrackRep.h:72
A state with arbitrary dimension defined in a DetPlane.
const AbsTrackRep * getRep() const
const SharedPlanePtr & getPlane() const
Object containing AbsMeasurement and AbsFitterInfo objects.
Definition TrackPoint.h:46
Defines for I/O streams used for error and debug printing.
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.