Back to home page

sPhenix code displayed by LXR

 
 

    


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

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  *  @author Johannes Rauch (Technische Universit&auml;t M&uuml;nchen, original author)
0021  *
0022  */
0023 
0024 
0025 /** @addtogroup utilities
0026  * @{
0027  */
0028 
0029 #ifndef genfit_MeasurementOnPlaneCreator_h
0030 #define genfit_MeasurementOnPlaneCreator_h
0031 
0032 #include "AbsMeasurement.h"
0033 #include "HelixTrackModel.h"
0034 
0035 #include <TObject.h>
0036 #include <TVector3.h>
0037 
0038 
0039 namespace genfit {
0040 
0041 
0042 enum eMeasurementType { Pixel = 0,
0043         Spacepoint,
0044         ProlateSpacepoint,
0045         StripU,
0046         StripV,
0047         StripUV,
0048     Wire,
0049     WirePoint,
0050     nMeasurementTypes
0051         };
0052 
0053 
0054 /**
0055  * @brief Create different measurement types along a HelixTrackModel for testing purposes.
0056  */
0057 class MeasurementCreator : public TObject {
0058 
0059 
0060  public:
0061 
0062   // Constructors/Destructors ---------
0063   MeasurementCreator();
0064 
0065   ~MeasurementCreator() {delete trackModel_;}
0066 
0067   //! Takes ownership!
0068   void setTrackModel(const HelixTrackModel* model) {delete trackModel_; trackModel_ = model;}
0069   void setResolution(double resolution) {resolution_ = resolution;}
0070   void setResolutionWire(double resolutionWire) {resolutionWire_ = resolutionWire;}
0071   void setOutlierProb(double outlierProb) {outlierProb_ = outlierProb;}
0072   void setOutlierRange(double outlierRange) {outlierRange_ = outlierRange;}
0073   void setThetaDetPlane(double thetaDetPlane) {thetaDetPlane_ = thetaDetPlane;}
0074   void setPhiDetPlane(double phiDetPlane) {phiDetPlane_ = phiDetPlane;}
0075   void setWireDir(const TVector3 wireDir) {wireDir_ = wireDir; wireDir_.SetMag(1.);}
0076   void setMinDrift(double minDrift) {minDrift_ = minDrift;}
0077   void setMaxDrift(double maxDrift) {maxDrift_ = maxDrift;}
0078   void setIdealLRResolution(bool idealLRResolution) {idealLRResolution_ = idealLRResolution;}
0079   void setUseSkew(bool useSkew) {useSkew_ = useSkew;}
0080   void setSkewAngle(double skewAngle) {skewAngle_ = skewAngle;}
0081   void setNSuperLayer(int nSuperLayer) {nSuperLayer_ = nSuperLayer;}
0082   void setDebug(bool debug) {debug_ = debug;}
0083 
0084 
0085   std::vector<genfit::AbsMeasurement*> create(eMeasurementType, double tracklength, bool& outlier, int& lr);
0086   std::vector<genfit::AbsMeasurement*> create(eMeasurementType type, double tracklength) {
0087     bool dummy1;
0088     int dummy2;
0089     return create(type, tracklength, dummy1, dummy2);
0090   }
0091 
0092   void reset();
0093 
0094  private:
0095 
0096   const HelixTrackModel* trackModel_; // ownership
0097 
0098   double resolution_;  // cm; resolution of generated measurements
0099   double resolutionWire_;  // cm; resolution in wire direction of generated measurements (wire and prolate sp measurements)
0100 
0101   double outlierProb_;
0102   double outlierRange_;
0103 
0104   // planarMeasurement specific
0105   double thetaDetPlane_; // degree
0106   double phiDetPlane_; // degree
0107 
0108   // WireMeasurement specific
0109   int wireCounter_;
0110   TVector3 wireDir_;
0111   double minDrift_;
0112   double maxDrift_;
0113   bool idealLRResolution_; // resolve the l/r ambiguities of the wire measurements
0114   bool useSkew_;
0115   double skewAngle_;
0116   int nSuperLayer_;
0117 
0118   // misc
0119   int measurementCounter_;
0120   bool debug_;
0121 
0122 
0123  public:
0124   ClassDef(MeasurementCreator,1)
0125 
0126 };
0127 
0128 } /* End of namespace genfit */
0129 /** @} */
0130 
0131 #endif // genfit_MeasurementOnPlaneCreator_h