SND@LHC Software
Loading...
Searching...
No Matches
GFRaveTrackParameters.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
22#include "GFRaveConverters.h"
23#include "Exception.h"
24
25#include <iostream>
26
27
28namespace genfit {
29
30
32 originalTrack_(NULL),
33 weight_(0),
34 state_(6),
35 cov_(6,6),
36 hasSmoothedData_(false)
37{
38 ;
39}
40
41
42GFRaveTrackParameters::GFRaveTrackParameters(const Track* track, MeasuredStateOnPlane* originalState, double weight, const TVectorD & state6, const TMatrixDSym & cov6x6, bool isSmoothed) :
43 originalTrack_(const_cast<Track*>(track)),
44 weight_(weight),
45 state_(state6),
46 cov_(cov6x6),
47 hasSmoothedData_(isSmoothed)
48{
49 if (state_.GetNrows() != 6) {
50 Exception exc("GFRaveTrackParameters ==> State is not 6D!",__LINE__,__FILE__);
51 throw exc;
52 }
53 if (cov_.GetNrows()!=6) {
54 Exception exc("GFRaveTrackParameters ==> Covariance is not 6D!",__LINE__,__FILE__);
55 throw exc;
56 }
57
58}
59
60
61GFRaveTrackParameters::GFRaveTrackParameters(const Track* track, MeasuredStateOnPlane* originalState, double weight) :
62 originalTrack_(const_cast<Track*>(track)),
63 weight_(weight),
64 state_(1,6),
65 cov_(6,6),
66 hasSmoothedData_(false)
67{
68 ;
69}
70
71
72TVector3
74 return TVector3(state_[0], state_[1], state_[2]);
75}
76
77
78TVector3
80 return TVector3(state_[3], state_[4], state_[5]);
81}
82
83
84double
88
89
90double
92 if (hasTrack())
93 return getTrack()->getCardinalRep()->getPDG();
94 else {
95 Exception exc("GFRaveTrackParameters::getPdg() ==> no genfit::Track available!",__LINE__,__FILE__);
96 throw exc;
97 }
98}
99
100
101void
102GFRaveTrackParameters::Print(const Option_t*) const {
103 std::cout << "weight: " << getWeight() << "\n";
104 if (!hasSmoothedData_) std::cout << "state and cov are NOT smoothed! \n";
105 std::cout << "state: "; getState().Print();
106 std::cout << "cov: "; getCov().Print();
107 if (hasTrack()) {std::cout << "genfit::Track: "; getTrack()->Print();}
108 else std::cout << "NO genfit::Track pointer \n";
109}
110
111
112} /* End of namespace genfit */
int getPDG() const
Get the pdg code.
Exception class for error handling in GENFIT (provides storage for diagnostic information)
Definition Exception.h:48
double getCharge() const
Get the fitted charge.
Definition FitStatus.h:72
const TMatrixDSym & getCov() const
void Print(const Option_t *="") const
StateOnPlane with additional covariance matrix.
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Definition Track.h:71
FitStatus * getFitStatus(const AbsTrackRep *rep=NULL) const
Get FitStatus for a AbsTrackRep. Per default, return FitStatus for cardinalRep.
Definition Track.h:149
void Print(const Option_t *="") const
Definition Track.cc:1026
AbsTrackRep * getCardinalRep() const
Get cardinal track representation.
Definition Track.h:140
Matrix inversion tools.
Definition AbsBField.h:29