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_WireMeasurement_h
0024 #define genfit_WireMeasurement_h
0025 
0026 #include "AbsMeasurement.h"
0027 #include "AbsHMatrix.h"
0028 #include "MeasurementOnPlane.h"
0029 
0030 
0031 namespace genfit {
0032 
0033 /** @brief Class for measurements in wire detectors (Straw tubes and drift chambers)
0034  *  which do not measure the coordinate along the wire.
0035  *
0036  *  @author Christian H&ouml;ppner (Technische Universit&auml;t M&uuml;nchen, original author)
0037  *  @author Lia Lavezzi (INFN Pavia, original author)
0038  *  @author Sebastian Neubert  (Technische Universit&auml;t M&uuml;nchen, original author)
0039  *  @author Johannes Rauch  (Technische Universit&auml;t M&uuml;nchen, original author)
0040  *
0041  * This hit class is not valid for any kind of plane orientation
0042  * choice: to use it you MUST choose a plane described by u
0043  * and v axes with v coincident with the wire (and u orthogonal
0044  * to it, obviously).
0045  * The hit will be described by 7 coordinates:
0046  * w_x1, w_y1, w_z1, w_x2, w_y2, w_z2, rdrift
0047  * where w_ji (with j = x, y, z and i = 1, 2) are the wire
0048  * extremities coordinates; rdrift = distance from the wire (u
0049  * coordinate in the plane)
0050  *
0051  */
0052 class WireMeasurement : public AbsMeasurement {
0053 
0054  public:
0055   WireMeasurement(int nDim = 7);
0056   WireMeasurement(const TVectorD& rawHitCoords, const TMatrixDSym& rawHitCov, int detId, int hitId, TrackPoint* trackPoint);
0057 
0058   virtual ~WireMeasurement() {;}
0059 
0060   virtual AbsMeasurement* clone() const override {return new WireMeasurement(*this);}
0061 
0062   virtual SharedPlanePtr constructPlane(const StateOnPlane& state) const override;
0063 
0064   /**  Hits with a small drift distance get a higher weight, whereas hits with
0065     * big drift distances become weighted down.
0066     * When these initial weights are used by the DAF, the smoothed track will be closer to the real
0067     * trajectory than if both sides are weighted with 0.5 regardless of the drift distance.
0068     * This helps a lot when resolving l/r ambiguities with the DAF.
0069     * The idea is that for the first iteration of the DAF, the wire positions are taken.
0070     * For small drift radii, the wire position does not bend the fit away from the
0071     * trajectory, whereas the wire position for hits with large drift radii is further away
0072     * from the trajectory and will therefore bias the fit if not weighted down.
0073     */
0074   virtual std::vector<MeasurementOnPlane*> constructMeasurementsOnPlane(const StateOnPlane& state) const override;
0075 
0076   virtual const AbsHMatrix* constructHMatrix(const AbsTrackRep*) const override;
0077 
0078   /** Set maximum drift distance. This is used to calculate the start weights of the two
0079    * measurementsOnPlane.
0080    */
0081   void setMaxDistance(double d){maxDistance_ = d;}
0082   /**
0083    * select how to resolve the left/right ambiguity:
0084    * -1: negative (left) side on vector (track direction) x (wire direction)
0085    * 0: auto select (take side with smallest distance to track)
0086    * 1: positive (right) side on vector (track direction) x (wire direction)
0087    */
0088   void setLeftRightResolution(int lr);
0089 
0090   virtual bool isLeftRightMeasurement() const override {return true;}
0091   virtual int getLeftRightResolution() const override {return leftRight_;}
0092 
0093   double getMaxDistance(){return maxDistance_;}
0094 
0095  protected:
0096 
0097   double maxDistance_;
0098   signed char leftRight_;
0099 
0100  public:
0101 
0102   ClassDefOverride(WireMeasurement, 2)
0103 
0104 };
0105 
0106 } /* End of namespace genfit */
0107 /** @} */
0108 
0109 #endif // genfit_WireMeasurement_h