Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:26

0001 /* Copyright 2008-2010, Technische Universitaet Muenchen,
0002    Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
0003 
0004    This file is part of GENFIT.
0005 
0006    GENFIT is free software: you can redistribute it and/or modify
0007    it under the terms of the GNU Lesser General Public License as published
0008    by the Free Software Foundation, either version 3 of the License, or
0009    (at your option) any later version.
0010 
0011    GENFIT is distributed in the hope that it will be useful,
0012    but WITHOUT ANY WARRANTY; without even the implied warranty of
0013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014    GNU Lesser General Public License for more details.
0015 
0016    You should have received a copy of the GNU Lesser General Public License
0017    along with GENFIT.  If not, see <http://www.gnu.org/licenses/>.
0018 */
0019 
0020 
0021 #include "GFRavePropagator.h"
0022 #include "GFRaveConverters.h"
0023 #include "Exception.h"
0024 
0025 #include <iostream>
0026 
0027 
0028 namespace genfit {
0029 
0030 GFRavePropagator::GFRavePropagator() :
0031     IdGFTrackStateMap_(nullptr)
0032 {
0033   //std::cout << "GFRavePropagator::GFRavePropagator() \n";
0034 }
0035   
0036 GFRavePropagator*
0037 GFRavePropagator::copy() const
0038 {
0039   //std::cout << "GFRavePropagator::copy() \n";
0040   return new GFRavePropagator(*this);
0041 }
0042 
0043 
0044 GFRavePropagator::~GFRavePropagator()
0045 {
0046   //std::cout << "GFRavePropagator::~GFRavePropagator() \n";
0047 }
0048     
0049     
0050 std::pair < rave::Track, double >
0051 GFRavePropagator::to ( const rave::Track & /*orig*/,
0052                        const ravesurf::Cylinder & /*rcyl*/ ) const
0053 {
0054   // todo to be implemented!!
0055   Exception exc("GFRavePropagator::to (cylinder) ==> not yet implemented!",__LINE__,__FILE__);
0056   throw exc;
0057 }
0058 
0059 
0060 std::pair < rave::Track, double >
0061 GFRavePropagator::to ( const rave::Track & orig,
0062                        const ravesurf::Plane & rplane ) const
0063 {
0064   // will throw Exception if extrapolation does not work
0065   double path = IdGFTrackStateMap_->at(orig.id()).state_->extrapolateToPlane(PlaneToGFDetPlane(rplane));
0066 
0067   std::pair < rave::Track, double > ret(GFTrackToTrack(IdGFTrackStateMap_->at(orig.id()), orig.id(), orig.tag()), path);
0068   return ret;
0069 }
0070 
0071 
0072 rave::Track
0073 GFRavePropagator::closestTo ( const rave::Track & orig,
0074                               const rave::Point3D & pt, bool transverse ) const
0075 {
0076 
0077   if (transverse){
0078     Exception exc("GFRavePropagator::closestTo ==> transverse is true, not implemented!",__LINE__,__FILE__);
0079     throw exc;
0080   }
0081 
0082   TVector3 point(Point3DToTVector3(pt));
0083   IdGFTrackStateMap_->at(orig.id()).state_->extrapolateToPoint(point);
0084 
0085   return GFTrackToTrack(IdGFTrackStateMap_->at(orig.id()), orig.id(), orig.tag());
0086 }
0087 
0088 
0089 void
0090 GFRavePropagator::setIdGFTrackStateMap(std::map < int, genfit::trackAndState > * map){
0091   //std::cout << "GFRavePropagator::setIdGFMeasuredStateOnPlaneMap() \n";
0092 
0093   IdGFTrackStateMap_ = map;
0094 
0095   if (IdGFTrackStateMap_==nullptr) {
0096     Exception exc("GFRavePropagator::setIdGFMeasuredStateOnPlaneMap ==> map is nullptr!",__LINE__,__FILE__);
0097     throw exc;
0098   }
0099   //std::cout<<"IdGFTrackStateMap_: " << (int)IdGFTrackStateMap_ << std::endl;
0100 }
0101 
0102 } /* End of namespace genfit */