Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:24:52

0001 #ifndef DTSEGMENTRESIDUAL_H
0002 #define DTSEGMENTRESIDUAL_H
0003 
0004 /** \class DTSegmentResidual
0005  *
0006  * Compute the residual of the hits wrt their segments
0007  *  
0008  * \author : Stefano Lacaprara - INFN LNL <stefano.lacaprara@pd.infn.it>
0009  *
0010  * Modification:
0011  *
0012  */
0013 
0014 /* Base Class Headers */
0015 
0016 /* Collaborating Class Declarations */
0017 class DTRecSegment2D;
0018 class DTChamberRecSegment2D;
0019 class DTChamber;
0020 class DTSuperLayer;
0021 #include "DataFormats/DTRecHit/interface/DTEnums.h"
0022 
0023 /* C++ Headers */
0024 #include <vector>
0025 #include <utility>
0026 
0027 /* ====================================================================== */
0028 
0029 /* Class DTSegmentResidual Interface */
0030 
0031 class DTSegmentResidual {
0032 public:
0033   struct DTResidual {
0034     DTResidual(double value,
0035                double wireDistance = 0.0,
0036                double angle = 0.0,
0037                DTEnums::DTCellSide side = DTEnums::undefLR);  // constructor
0038     double value;                                             // the resudual value
0039     double wireDistance;                                      // the distance from wire
0040     double angle;                                             // the impact angle (if any)
0041     DTEnums::DTCellSide side;                                 // the side of the cell
0042   };
0043 
0044   /* Constructor */
0045   DTSegmentResidual(const DTRecSegment2D* seg, const DTSuperLayer* sl);
0046 
0047   DTSegmentResidual(const DTChamberRecSegment2D* seg, const DTChamber* ch);
0048   /* Destructor */
0049 
0050   /* Operations */
0051   /// compute thr residuals
0052   void run();
0053 
0054   /// return the residuals
0055   std::vector<DTSegmentResidual::DTResidual> residuals() const { return theResiduals; }
0056 
0057   /// return the residuals as double
0058   std::vector<double> res() const;
0059 
0060   /// return the residuals vs angle
0061   std::vector<std::pair<double, double> > residualsVsAngle() const;
0062 
0063   /// return the residuals vs distance from wire
0064   std::vector<std::pair<double, double> > residualsVsWireDist() const;
0065 
0066   /// return the residuals vs cell side
0067   std::vector<std::pair<double, DTEnums::DTCellSide> > residualsVsCellSide() const;
0068 
0069 private:
0070   const DTRecSegment2D* theSeg;
0071   const DTChamber* theCh;
0072   const DTSuperLayer* theSL;
0073   std::vector<DTResidual> theResiduals;
0074 
0075 protected:
0076 };
0077 #endif  // DTSEGMENTRESIDUAL_H