Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RecoLocalMuon_DTRecHitBaseAlgo_H
0002 #define RecoLocalMuon_DTRecHitBaseAlgo_H
0003 
0004 /** \class DTRecHitBaseAlgo
0005  *  Abstract algorithmic class to compute drift distance and error 
0006  *  form a DT digi
0007  *
0008  *  \author N. Amapane & G. Cerminara - INFN Torino
0009  */
0010 
0011 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0012 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0013 #include "DataFormats/GeometrySurface/interface/LocalError.h"
0014 
0015 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
0016 #include "DataFormats/DTRecHit/interface/DTRecHit1DPair.h"
0017 #include "DataFormats/Common/interface/OwnVector.h"
0018 
0019 class DTDigi;
0020 class DTLayer;
0021 class DTLayerId;
0022 class DTTTrigBaseSync;
0023 
0024 namespace edm {
0025   class ParameterSet;
0026   class EventSetup;
0027   class ConsumesCollector;
0028 }  // namespace edm
0029 
0030 class DTRecHitBaseAlgo {
0031 public:
0032   /// Constructor
0033   DTRecHitBaseAlgo(const edm::ParameterSet& config, edm::ConsumesCollector);
0034 
0035   /// Destructor
0036   virtual ~DTRecHitBaseAlgo();
0037 
0038   /// Pass the Event Setup to the algo at each event
0039   virtual void setES(const edm::EventSetup& setup) = 0;
0040 
0041   /// Build all hits in the range associated to the layerId, at the 1st step.
0042   virtual edm::OwnVector<DTRecHit1DPair> reconstruct(const DTLayer* layer,
0043                                                      const DTLayerId& layerId,
0044                                                      const DTDigiCollection::Range& digiRange);
0045 
0046   /// First step in computation of Left/Right hits from a Digi.
0047   /// The results are the local position (in MuBarLayer frame) of the
0048   /// Left and Right hit, and the error (which is common). Returns
0049   /// false on failure.
0050   virtual bool compute(const DTLayer* layer,
0051                        const DTDigi& digi,
0052                        LocalPoint& leftPoint,
0053                        LocalPoint& rightPoint,
0054                        LocalError& error) const = 0;
0055 
0056   /// Second step in hit position computation, for algorithms which support it.
0057   /// The impact angle is given as input, and it's used to improve the hit
0058   /// position (and relative error). The angle is defined in radians, with
0059   /// respect to the perpendicular to the layer plane. Given the local direction,
0060   /// angle=atan(dir.x()/-dir.z()) . This can be used when a SL segment is
0061   /// built, so the impact angle is known but the position along wire is not.
0062   virtual bool compute(const DTLayer* layer,
0063                        const DTRecHit1D& recHit1D,
0064                        const float& angle,
0065                        DTRecHit1D& newHit1D) const = 0;
0066 
0067   /// Third (and final) step in hits position computation, for
0068   /// algorithms which support it.
0069   /// In addition the the angle, also the global position of the hit is given
0070   /// as input. This allows to get the magnetic field at the hit position (and
0071   /// not only that at the center of the wire). Also the position along the
0072   /// wire is available and can be used to correct the drift time for particle
0073   /// TOF and propagation of signal along the wire.
0074   virtual bool compute(const DTLayer* layer,
0075                        const DTRecHit1D& recHit1D,
0076                        const float& angle,
0077                        const GlobalPoint& globPos,
0078                        DTRecHit1D& newHit1D) const = 0;
0079 
0080 protected:
0081   // The module to be used for digi time synchronization
0082   std::unique_ptr<DTTTrigBaseSync> theSync;
0083 };
0084 #endif