forked from sPHENIX-Collaboration/GenFit
/
GFRavePropagator.cc
102 lines (74 loc) · 2.97 KB
/
GFRavePropagator.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* Copyright 2008-2010, Technische Universitaet Muenchen,
Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
This file is part of GENFIT.
GENFIT is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GENFIT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
*/
#include "GFRavePropagator.h"
#include "GFRaveConverters.h"
#include "Exception.h"
#include <iostream>
namespace genfit {
GFRavePropagator::GFRavePropagator() :
IdGFTrackStateMap_(nullptr)
{
//std::cout << "GFRavePropagator::GFRavePropagator() \n";
}
GFRavePropagator*
GFRavePropagator::copy() const
{
//std::cout << "GFRavePropagator::copy() \n";
return new GFRavePropagator(*this);
}
GFRavePropagator::~GFRavePropagator()
{
//std::cout << "GFRavePropagator::~GFRavePropagator() \n";
}
std::pair < rave::Track, double >
GFRavePropagator::to ( const rave::Track & orig,
const ravesurf::Cylinder & rcyl ) const
{
// todo to be implemented!!
Exception exc("GFRavePropagator::to (cylinder) ==> not yet implemented!",__LINE__,__FILE__);
throw exc;
}
std::pair < rave::Track, double >
GFRavePropagator::to ( const rave::Track & orig,
const ravesurf::Plane & rplane ) const
{
// will throw Exception if extrapolation does not work
double path = IdGFTrackStateMap_->at(orig.id()).state_->extrapolateToPlane(PlaneToGFDetPlane(rplane));
std::pair < rave::Track, double > ret(GFTrackToTrack(IdGFTrackStateMap_->at(orig.id()), orig.id(), orig.tag()), path);
return ret;
}
rave::Track
GFRavePropagator::closestTo ( const rave::Track & orig,
const rave::Point3D & pt, bool transverse ) const
{
if (transverse){
Exception exc("GFRavePropagator::closestTo ==> transverse is true, not implemented!",__LINE__,__FILE__);
throw exc;
}
TVector3 point(Point3DToTVector3(pt));
IdGFTrackStateMap_->at(orig.id()).state_->extrapolateToPoint(point);
return GFTrackToTrack(IdGFTrackStateMap_->at(orig.id()), orig.id(), orig.tag());
}
void
GFRavePropagator::setIdGFTrackStateMap(std::map < int, genfit::trackAndState > * map){
//std::cout << "GFRavePropagator::setIdGFMeasuredStateOnPlaneMap() \n";
IdGFTrackStateMap_ = map;
if (IdGFTrackStateMap_==nullptr) {
Exception exc("GFRavePropagator::setIdGFMeasuredStateOnPlaneMap ==> map is nullptr!",__LINE__,__FILE__);
throw exc;
}
//std::cout<<"IdGFTrackStateMap_: " << (int)IdGFTrackStateMap_ << std::endl;
}
} /* End of namespace genfit */