Back to home page

sPhenix code displayed by LXR

 
 

    


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

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 /** @addtogroup genfit
0020  * @{
0021  */
0022 
0023 #ifndef genfit_SpacepointMeasurement_h
0024 #define genfit_SpacepointMeasurement_h
0025 
0026 #include "AbsMeasurement.h"
0027 #include "AbsHMatrix.h"
0028 
0029 
0030 namespace genfit {
0031 
0032 /** @brief Class for measurements implementing a space point hit geometry.
0033  *
0034  *  @author Christian H&ouml;ppner (Technische Universit&auml;t M&uuml;nchen, original author)
0035  *  @author Sebastian Neubert  (Technische Universit&auml;t M&uuml;nchen, original author)
0036  *  @author Johannes Rauch  (Technische Universit&auml;t M&uuml;nchen, original author)
0037  *
0038  * For a space point the detector plane has to be defined with respect to
0039  * a track representation. SpacepointMeasurement implements a scheme where the
0040  * detectorplane is chosen perpendicular to the track.
0041  * In a track fit, only two of the three coordinates of a space point are
0042  * independent (the track is a one-dimensional object). Therefore the 3D
0043  * data of the hit is used to define a proper detector plane into which the
0044  * hit coordinates are then projected.
0045  */
0046 class SpacepointMeasurement : public AbsMeasurement {
0047 
0048  public:
0049   SpacepointMeasurement(int nDim = 3);
0050   SpacepointMeasurement(const TVectorD& rawHitCoords, const TMatrixDSym& rawHitCov, int detId, int hitId, TrackPoint* trackPoint,
0051       bool weightedPlaneContruction = true, bool cutCov = true);
0052 
0053   virtual ~SpacepointMeasurement() {;}
0054 
0055   virtual AbsMeasurement* clone() const override {return new SpacepointMeasurement(*this);}
0056 
0057   /**
0058    * @brief Contruct the virtual detector plane
0059    *
0060    * Per default, the plane will be constructed such that it contains the measurement and POCA to the measurement in cartesian space.
0061    * The plane is perpendicular to the track (at the POCA).
0062    *
0063    *  If weightedPlaneContruction_ is set, the POCA will be calculated in a space weighted with the inverse of the 3D covariance.
0064    *  E.g. if the covariance is very oblate, the plane will be almost defined by the covariance shape.
0065    *  If the covariance is very prolate, the behaviour will be very similar to the ProlateSpacepointHit.
0066    */
0067   virtual SharedPlanePtr constructPlane(const StateOnPlane& state) const override;
0068 
0069   virtual std::vector<MeasurementOnPlane*> constructMeasurementsOnPlane(const StateOnPlane& state) const override;
0070 
0071   virtual const AbsHMatrix* constructHMatrix(const AbsTrackRep*) const override;
0072 
0073   /// false: project 3D cov onto DetPlane. true: cut 3D cov with DetPlane
0074   bool getWeightedPlaneConstruction() const     { return weightedPlaneContruction_; }
0075   void setWeightedPlaneConstruction(bool value) { weightedPlaneContruction_ = value; }
0076 
0077   /// false: use POCA to construct DetPlane. true: Use metric G to construct POCA
0078   bool getCutCov() const     { return cutCov_; }
0079   void setCutCov(bool value) { cutCov_ = value; }
0080 
0081  protected:
0082   void initG();
0083 
0084  private:
0085 
0086   bool weightedPlaneContruction_; // false: use POCA to construct DetPlane. true: Use metric G to construct POCA (default)
0087   TMatrixDSym G_; //! inverse of 3x3 cov
0088   bool cutCov_; // false: project 3D cov onto DetPlane. true: cut 3D cov with DetPlane (default)
0089 
0090   ClassDefOverride(SpacepointMeasurement,3)
0091 };
0092 
0093 } /* End of namespace genfit */
0094 /** @} */
0095 
0096 #endif // genfit_SpacepointMeasurement_h