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  *  @author Johannes Rauch (Technische Universit&auml;t M&uuml;nchen, original author)
0022  *
0023  */
0024 
0025 /** @addtogroup GFRave
0026  * @{
0027  */
0028 
0029 
0030 #ifndef GFRAVEVERTEXFACTORY_H
0031 #define GFRAVEVERTEXFACTORY_H
0032 
0033 #include "GFRaveVertex.h"
0034 #include "Track.h"
0035 #include "MeasuredStateOnPlane.h"
0036 
0037 #include <vector>
0038 
0039 
0040 namespace rave {
0041   class VertexFactory;
0042   class MagneticField;
0043   class Propagator;
0044 }
0045 
0046 namespace genfit {
0047 
0048 /**
0049  * @brief Simple struct containing a Track pointer and a MeasuredStateOnPlane. Used in GFRave.
0050  */
0051 struct trackAndState {
0052   const Track* track_; // pointer to original track
0053   MeasuredStateOnPlane* state_; // pointer to copy of fitted state; can be altered (extrapolated) during vertexing
0054 };
0055 
0056 
0057 /**
0058  * @brief Vertex factory for producing GFRaveVertex objects from Track objects.
0059  *
0060  * The GFRaveVertexFactory is basically a wrapper around the rave::VertexFactory.
0061  * It takes care of initializing the rave::VertexFactory, building the necessary maps,
0062  * convert GENFIT to rave objects and vice versa.
0063  **/
0064 class GFRaveVertexFactory {
0065  public:
0066   // constructors, destructors
0067   GFRaveVertexFactory(int verbosity = 0, bool useVacuumPropagator = false);
0068   ~GFRaveVertexFactory();
0069 
0070   // functions
0071   void findVertices ( std::vector <  genfit::GFRaveVertex* > *, const std::vector < genfit::Track* > &, bool use_beamspot=false );
0072   //! MeasuredStateOnPlanes will be used (instead of the tracks fitted states) to calculate the rave::Track parameters. takes ownership of MeasuredStateOnPlanes.
0073   void findVertices ( std::vector <  genfit::GFRaveVertex* > *, const std::vector < genfit::Track* > &, std::vector < genfit::MeasuredStateOnPlane* > &, bool use_beamspot=false );
0074 
0075   void setBeamspot(const TVector3 & pos, const TMatrixDSym & cov);
0076 
0077   /**
0078    * Set the reconstruction method. See http://projects.hepforge.org/rave/trac/wiki/RaveMethods
0079    * Smoothing has to be turned on! e.g. kalman-smoothing:1
0080    */
0081   void setMethod(const std::string & method);
0082 
0083  private:
0084 
0085   void clearMap();
0086 
0087   // data members
0088   std::map<int, genfit::trackAndState> IdGFTrackStateMap_; // map of copies of the cardinal MeasuredStateOnPlanes for the GFRavePropagator; ownership of MeasuredStateOnPlanes is HERE!!!
0089   rave::VertexFactory* factory_; // Ownership
0090   rave::MagneticField* magneticField_; // Ownership
0091   rave::Propagator* propagator_; // Ownership
0092 
0093 };
0094 
0095 } /* End of namespace genfit */
0096 /** @} */
0097 
0098 #endif // GFRAVEVERTEXFACTORY_H