Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 /* Copyright 2008-2009, Technische Universitaet Muenchen,
0002    Authors: 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  *  @author Johannes Rauch (Technische Universit&auml;t M&uuml;nchen, original author)
0022  *
0023  */
0024 
0025 /** @addtogroup GFRave
0026  * @{
0027  */
0028 
0029 
0030 #ifndef GFRAVECONVERTERS_H
0031 #define GFRAVECONVERTERS_H
0032 
0033 #include "AbsTrackRep.h"
0034 #include "DetPlane.h"
0035 #include "Track.h"
0036 #include "GFRaveVertex.h"
0037 #include "GFRaveVertexFactory.h"
0038 
0039 #include <rave/Track.h>
0040 #include <rave/Plane.h>
0041 #include <rave/Vertex.h>
0042 
0043 #include <TVector3.h>
0044 #include <TVectorD.h>
0045 #include <TMatrixDSym.h>
0046 
0047 #include <iostream>
0048 
0049 
0050 /**
0051  * @brief Collection of converter functions
0052  **/
0053 namespace genfit {
0054 
0055   // GENFIT to RAVE
0056 
0057   /** Convert a vector of genfit::Tracks to rave::Tracks
0058    * also builds a map of unique ids to genfit::Tracks; These ids are stored in the rave::tracks. They are counted from startID.
0059    * The map has to be passed to the GFRavePropagator, so that it can access the trackreps of the genfit::Tracks corresponding to the
0060    * rave::tracks.
0061    * If a vector of MeasuredStateOnPlane is provided, they will be used (instead of the tracks fitted states) to calculate the rave::Track parameters.
0062    * Ownership over MeasuredStateOnPlane will be taken.
0063    */
0064   std::vector < rave::Track > GFTracksToTracks(const std::vector < genfit::Track* > & GFTracks,
0065                                                std::vector < genfit::MeasuredStateOnPlane* > * GFStates, // = nullptr
0066                                                std::map<int, genfit::trackAndState>& IdGFTrackStateMap,
0067                                                int startID = 0);
0068 
0069   rave::Track GFTrackToTrack(trackAndState, int id = -1, std::string tag="");
0070   //rave::Track MeasuredStateOnPlaneToTrack(const MeasuredStateOnPlane* state, const rave::Track& orig);
0071   //rave::Track MeasuredStateOnPlaneToTrack(const MeasuredStateOnPlane* state, int id = -1, Track* originaltrack = nullptr, std::string tag="");
0072 
0073   // RAVE to GENFIT
0074   /** set state and cov of a MeasuredStateOnPlane according to rave track
0075    */
0076   void setData(const rave::Track & orig, MeasuredStateOnPlane* state);
0077 
0078   GFRaveVertex* RaveToGFVertex(const rave::Vertex &, const std::map<int, genfit::trackAndState>& IdGFTrackStateMap);
0079   void RaveToGFVertices(std::vector<GFRaveVertex*> *, const std::vector<rave::Vertex> &, const std::map<int, genfit::trackAndState>& IdGFTrackStateMap);
0080 
0081   SharedPlanePtr PlaneToGFDetPlane(const ravesurf::Plane& rplane);
0082 
0083   // RAVE to ROOT
0084   TVector3 Point3DToTVector3(const rave::Point3D&);
0085   TVector3 Vector3DToTVector3(const rave::Vector3D&);
0086 
0087   TMatrixDSym Covariance3DToTMatrixDSym(const rave::Covariance3D&);
0088   TVectorD Vector6DToTVectorD(const rave::Vector6D&);
0089   TMatrixDSym Covariance6DToTMatrixDSym(const rave::Covariance6D&);
0090 
0091   // ROOT to RAVE
0092   rave::Point3D TVector3ToPoint3D(const TVector3 &);
0093   rave::Covariance3D TMatrixDSymToCovariance3D(const TMatrixDSym&);
0094 
0095 
0096 } /* End of namespace genfit */
0097 /** @} */
0098 
0099 #endif // GFRAVECONVERTERS_H
0100