SND@LHC Software
Loading...
Searching...
No Matches
ProlateSpacepointMeasurement.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
21
22#include <cmath>
23
24#include "Exception.h"
25#include "RKTrackRep.h"
26
27
28namespace genfit {
29
31 : SpacepointMeasurement(nDim), largestErrorDirection_(0,0,1)
32{
33 ;
34}
35
36ProlateSpacepointMeasurement::ProlateSpacepointMeasurement(const TVectorD& rawHitCoords, const TMatrixDSym& rawHitCov, int detId, int hitId, TrackPoint* trackPoint)
37 : SpacepointMeasurement(rawHitCoords, rawHitCov, detId, hitId, trackPoint), largestErrorDirection_(0,0,1)
38{
39 ;
40}
41
42
44
45 // copy state. Neglect covariance.
46 StateOnPlane st(state);
47
48
49 const TVector3 wire1(rawHitCoords_(0), rawHitCoords_(1), rawHitCoords_(2));
50
51 const AbsTrackRep* rep = state.getRep();
53
54 TVector3 dirInPoca = rep->getMom(st);
55 dirInPoca.SetMag(1.);
56
57 // check if direction is parallel to wire
58 if (fabs(largestErrorDirection_.Angle(dirInPoca)) < 0.01){
59 Exception exc("ProlateSpacepointMeasurement::constructPlane(): Cannot construct detector plane, track direction is parallel to largest error direction", __LINE__,__FILE__);
60 throw exc;
61 }
62
63 // construct orthogonal vector
64 TVector3 U = largestErrorDirection_.Cross(dirInPoca);
65
66 return SharedPlanePtr(new DetPlane(wire1, U, largestErrorDirection_));
67}
68
69
70} /* End of namespace genfit */
Abstract base class for a track representation.
Definition AbsTrackRep.h:66
virtual double extrapolateToLine(StateOnPlane &state, const TVector3 &linePoint, const TVector3 &lineDirection, bool stopAtBoundary=false, bool calcJacobianNoise=false) const =0
Extrapolates the state to the POCA to a line, and returns the extrapolation length and,...
virtual TVector3 getMom(const StateOnPlane &state) const =0
Get the cartesian momentum vector of a state.
Detector plane.
Definition DetPlane.h:61
Exception class for error handling in GENFIT (provides storage for diagnostic information)
Definition Exception.h:48
virtual SharedPlanePtr constructPlane(const StateOnPlane &state) const
Contruct the virtual detector plane.
Class for measurements implementing a space point hit geometry.
A state with arbitrary dimension defined in a DetPlane.
const AbsTrackRep * getRep() 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.