Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:08

0001 #ifndef DTSegment_DTHitPairForFit_h
0002 #define DTSegment_DTHitPairForFit_h
0003 
0004 /** \class DTHitPairForFit
0005  *
0006  * Hit pair used for the segments fit
0007  *
0008  * This class is useful for segment fitting, which is done in SL or Chamber
0009  * reference frame, while the DT hits live on the layer.
0010  *
0011  * \author Stefano Lacaprara - INFN Legnaro <stefano.lacaprara@pd.infn.it>
0012  * \author Riccardo Bellan - INFN TO <riccardo.bellan@cern.ch>
0013  *
0014  */
0015 
0016 /* Base Class Headers */
0017 
0018 /* Collaborating Class Declarations */
0019 #include "FWCore/Framework/interface/ESHandle.h"
0020 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0021 #include "DataFormats/DTRecHit/interface/DTRecHit1DPair.h"
0022 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0023 #include "Geometry/DTGeometry/interface/DTSuperLayer.h"
0024 
0025 /* C++ Headers */
0026 
0027 /* ====================================================================== */
0028 
0029 /* Class DTHitPairForFit Interface */
0030 
0031 class DTHitPairForFit {
0032 public:
0033   /// Constructor
0034   DTHitPairForFit(const DTRecHit1DPair& pair, const DTSuperLayer& sl, const edm::ESHandle<DTGeometry>& dtGeom);
0035 
0036   /// Destructor
0037   ~DTHitPairForFit();
0038 
0039   /* Operations */
0040 
0041   /// Returns the local position in the layer
0042   LocalPoint localPosition(DTEnums::DTCellSide s) const;
0043 
0044   /// Returns the position in the layer r.f. of the left rechit
0045   LocalPoint leftPos() const { return theLeftPos; }
0046 
0047   /// Returns the position in the layer r.f. of the right rechit
0048   LocalPoint rightPos() const { return theRightPos; }
0049 
0050   // Returns the LocalError
0051   LocalError localPositionError() const { return theError; }
0052 
0053   /// Returns the Id of the wire on which the rechit rely
0054   const DTWireId& id() const { return theWireId; }
0055 
0056   /// Returns the time of the corresponding digi
0057   float digiTime() const { return theDigiTime; }
0058 
0059   /** check for compatibility of the hit pair with a given position and direction: 
0060      * the first bool of the returned pair is for the left hit, the second for
0061      * the right one */
0062   std::pair<bool, bool> isCompatible(const LocalPoint& posIni, const LocalVector& dirIni) const;
0063 
0064   /// define the order by increasing z
0065   bool operator<(const DTHitPairForFit& hit) const;
0066 
0067   bool operator==(const DTHitPairForFit& hit) const;
0068 
0069 protected:
0070 private:
0071   LocalPoint theLeftPos;   // left hit pos in SL ref frame
0072   LocalPoint theRightPos;  // right hit pos in SL ref frame
0073   LocalError theError;     // it's the same for left and right
0074   DTWireId theWireId;
0075   float theDigiTime;  // the time of the corresp. digi
0076   //    int theLayerNumber;             // the layer number
0077 };
0078 
0079 std::ostream& operator<<(std::ostream& out, const DTHitPairForFit& hit);
0080 #endif  // DTSegment_DTHitPairForFit_h