Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:59:56

0001 // -*- C++ -*-
0002 //
0003 // Package:    CalibTracker/SiStripHitResolution
0004 // Class:      SiStripOverlapHit
0005 //
0006 /**\class SiStripOverlapHit SiStripOverlapHit.h CalibTracker/SiStripHitResolution/interface/SiStripOverlapHit.cc
0007 
0008  Description: A pair of hits on overlaping modules
0009 
0010  Implementation:
0011      Designed for CPE studies. Includes methods to compute residuals, etc.
0012 */
0013 //
0014 // Original Author:  Christophe Delaere
0015 //         Created:  Fri, 20 Sep 2019 14:45:00 GMT
0016 //
0017 //
0018 #ifndef CalibTracker_SiStripHitResolution_SiStripOverlapHit_H
0019 #define CalibTracker_SiStripHitResolution_SiStripOverlapHit_H
0020 
0021 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h"
0022 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
0023 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0024 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
0025 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0026 
0027 class SiStripOverlapHit {
0028 public:
0029   using RecHitPointer = TrackingRecHit::RecHitPointer;
0030   using ConstRecHitPointer = TrackingRecHit::ConstRecHitPointer;
0031 
0032   // constructes an overlap from 2 hits and a track. Hits are internally sorted inside-out
0033   explicit SiStripOverlapHit(TrajectoryMeasurement const& measA, TrajectoryMeasurement const& measB);
0034   // destructor
0035   virtual ~SiStripOverlapHit(){};
0036 
0037   // access to indivitual hits and to the trajectory state
0038   inline ConstRecHitPointer const& hitA() const { return measA_.recHit(); }
0039   inline ConstRecHitPointer const& hitB() const { return measB_.recHit(); }
0040   inline ConstRecHitPointer const& hit(unsigned int hit) const { return hit ? hitB() : hitA(); }
0041   TrajectoryStateOnSurface const& trajectoryStateOnSurface(unsigned int hit = 0, bool updated = true) const;
0042 
0043   // utilities
0044 
0045   // track local angle
0046   double getTrackLocalAngle(unsigned int hit) const;  // 0: average, 1: hit A, 2: hit B
0047   // raw local distance between hit and strajectory state
0048   double offset(unsigned int hit) const;
0049   // distance between the two hits in the "trajectory frame"
0050   double shift() const;
0051   // absolute global distance between the hits (useful to debug pair finding)
0052   double distance(bool fromTrajectory = false) const;
0053   // global position (averaged over the two hits)
0054   GlobalPoint position() const;
0055 
0056 private:
0057   TrajectoryMeasurement measA_;
0058   TrajectoryMeasurement measB_;
0059 };
0060 
0061 #endif