GENFIT  Rev:NoNumberAvailable
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 
28 namespace genfit {
29 
31  : SpacepointMeasurement(nDim), largestErrorDirection_(0,0,1)
32 {
33  ;
34 }
35 
36 ProlateSpacepointMeasurement::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 */
genfit::SharedPlanePtr
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
Definition: SharedPlanePtr.h:43
genfit::Exception
Exception class for error handling in GENFIT (provides storage for diagnostic information)
Definition: Exception.h:48
genfit
Defines for I/O streams used for error and debug printing.
Definition: AbsFinitePlane.cc:22
genfit::DetPlane
Detector plane.
Definition: DetPlane.h:61
genfit::AbsTrackRep
Abstract base class for a track representation.
Definition: AbsTrackRep.h:66
genfit::ProlateSpacepointMeasurement::ProlateSpacepointMeasurement
ProlateSpacepointMeasurement(int nDim=3)
Definition: ProlateSpacepointMeasurement.cc:30
genfit::ProlateSpacepointMeasurement::largestErrorDirection_
TVector3 largestErrorDirection_
Definition: ProlateSpacepointMeasurement.h:63
genfit::AbsMeasurement::rawHitCoords_
TVectorD rawHitCoords_
Definition: AbsMeasurement.h:113
genfit::ProlateSpacepointMeasurement::constructPlane
virtual SharedPlanePtr constructPlane(const StateOnPlane &state) const
Contruct the virtual detector plane.
Definition: ProlateSpacepointMeasurement.cc:43
genfit::TrackPoint
Object containing AbsMeasurement and AbsFitterInfo objects.
Definition: TrackPoint.h:50
genfit::StateOnPlane
A state with arbitrary dimension defined in a DetPlane.
Definition: StateOnPlane.h:45
genfit::AbsTrackRep::extrapolateToLine
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,...
genfit::SpacepointMeasurement
Class for measurements implementing a space point hit geometry.
Definition: SpacepointMeasurement.h:46
genfit::AbsTrackRep::getMom
virtual TVector3 getMom(const StateOnPlane &state) const =0
Get the cartesian momentum vector of a state.
RKTrackRep.h
ProlateSpacepointMeasurement.h
Exception.h
genfit::StateOnPlane::getRep
const AbsTrackRep * getRep() const
Definition: StateOnPlane.h:66