SND@LHC Software
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
29
30namespace genfit {
31
33 : AbsMeasurement(nDim), plane_()
34{
35 assert(nDim >= 1);
36}
37
38
39FullMeasurement::FullMeasurement(const MeasuredStateOnPlane& state, int detId, int hitId, TrackPoint* trackPoint)
40 : AbsMeasurement(state.getState(), state.getCov(), detId, hitId, trackPoint), plane_(state.getPlane())
41{
42 assert(rawHitCoords_.GetNrows() == (int)state.getRep()->getDim());
43}
44
45
47 if (!plane_) {
48 Exception exc("FullMeasurement::constructPlane(): No plane has been set!", __LINE__,__FILE__);
49 throw exc;
50 }
51 return plane_;
52}
53
54
55std::vector<MeasurementOnPlane*> FullMeasurement::constructMeasurementsOnPlane(const StateOnPlane& state) const {
56
59 state.getPlane(), state.getRep(), constructHMatrix(state.getRep()));
60
61 std::vector<MeasurementOnPlane*> retVal;
62 retVal.push_back(mop);
63 return retVal;
64}
65
66
68
69 if (dynamic_cast<const RKTrackRep*>(rep) == NULL) {
70 Exception exc("SpacepointMeasurement default implementation can only handle state vectors of type RKTrackRep!", __LINE__,__FILE__);
71 throw exc;
72 }
73
74 return new HMatrixUnit();
75}
76
77
78void FullMeasurement::Streamer(TBuffer &R__b)
79{
80 // Stream an object of class genfit::FullMeasurement.
81
82 //This works around a msvc bug and should be harmless on other platforms
83 typedef ::genfit::FullMeasurement thisClass;
84 UInt_t R__s, R__c;
85 if (R__b.IsReading()) {
86 Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v) { }
87 //This works around a msvc bug and should be harmless on other platforms
88 typedef genfit::AbsMeasurement baseClass0;
89 baseClass0::Streamer(R__b);
90 char flag;
91 R__b >> flag;
92 plane_.reset();
93 if (flag) {
94 plane_.reset(new DetPlane());
95 plane_->Streamer(R__b);
96 }
97 R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
98 } else {
99 R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
100 //This works around a msvc bug and should be harmless on other platforms
101 typedef genfit::AbsMeasurement baseClass0;
102 baseClass0::Streamer(R__b);
103 if (plane_) {
104 R__b << (char)1;
105 plane_->Streamer(R__b);
106 } else {
107 R__b << (char)0;
108 }
109 R__b.SetByteCount(R__c, kTRUE);
110 }
111}
112
113} /* 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
virtual std::vector< MeasurementOnPlane * > constructMeasurementsOnPlane(const StateOnPlane &state) const
virtual const AbsHMatrix * constructHMatrix(const AbsTrackRep *) const
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:70
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:50
Matrix inversion tools.
Definition AbsBField.h:29
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.