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 #ifndef GFRAVETRACKPARAMETERS_H
0030 #define GFRAVETRACKPARAMETERS_H
0031 
0032 #include "Track.h"
0033 #include "AbsTrackRep.h"
0034 
0035 #include <TObject.h>
0036 #include <TVector3.h>
0037 #include <TVectorD.h>
0038 #include <TMatrixDSym.h>
0039 #include <TRef.h>
0040 
0041 #include <iostream>
0042 
0043 
0044 namespace genfit {
0045 
0046 /**
0047  * @brief GFRaveTrackParameters class
0048  * Contains a pointer to the original genfit::Track, the weight of the track in the vertex,
0049  * and smoothed (with the vertex information) state and covariance of the track.
0050  */
0051 class GFRaveTrackParameters : public TObject
0052 {
0053   public:
0054     // constructors, destructors
0055     GFRaveTrackParameters();
0056     GFRaveTrackParameters(const Track* track, MeasuredStateOnPlane* originalState, double weight, const TVectorD & state6, const TMatrixDSym & cov6x6, bool isSmoothed);
0057     GFRaveTrackParameters(const Track* track, MeasuredStateOnPlane* originalState, double weight);
0058 
0059     // Accessors
0060     double getWeight() const {return weight_;}
0061 
0062     bool hasTrack() const {return originalTrack_.GetObject() != nullptr;}
0063     const Track* getTrack() const {return  static_cast<Track*>(originalTrack_.GetObject());}
0064 
0065     UInt_t GetUniqueID() const {return originalTrack_.GetUniqueID();}
0066 
0067     bool hasSmoothedData() const {return hasSmoothedData_;}
0068     TVectorD getState() const {return state_;}
0069     TVector3 getPos() const;
0070     TVector3 getMom() const;
0071     const TMatrixDSym & getCov() const {return cov_;}
0072 
0073     double getCharge() const;
0074     double getPdg() const;
0075 
0076     void Print(const Option_t* = "") const;
0077 
0078   private:
0079 
0080     const TRef originalTrack_; // NO ownership. We use TRef, since the Tracks could be stored in another file or tree.
0081 
0082     double weight_; // weight of the track in the vertex
0083     TVectorD state_; // x, y, z, px, py, pz
0084     TMatrixDSym cov_; // 6x6 covariance matrix
0085     bool hasSmoothedData_; // true if state_ is forced to go through the vertex
0086 
0087   private:
0088     ClassDef(GFRaveTrackParameters, 1)
0089 };
0090 
0091 } /* End of namespace genfit */
0092 /** @} */
0093 
0094 #endif // GFRAVETRACKPARAMETERS_H