Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-07 22:33:27

0001 #ifndef L1Trigger_TrackFindingTracklet_interface_L1TStub_h
0002 #define L1Trigger_TrackFindingTracklet_interface_L1TStub_h
0003 
0004 #include "L1Trigger/TrackFindingTracklet/interface/Settings.h"
0005 
0006 #include <iostream>
0007 #include <fstream>
0008 #include <cassert>
0009 #include <cmath>
0010 #include <vector>
0011 
0012 namespace trklet {
0013 
0014   class L1TStub {
0015   public:
0016     L1TStub();
0017 
0018     L1TStub(std::string DTClink,
0019             int region,
0020             int layerdisk,
0021             std::string stubword,
0022             int isPSmodule,
0023             int isFlipped,
0024             double x,
0025             double y,
0026             double z,
0027             double bend,
0028             double strip,
0029             std::vector<int> tps);
0030 
0031     ~L1TStub() = default;
0032 
0033     void write(std::ofstream& out);
0034 
0035     double diphi();
0036 
0037     double iphiouter();
0038 
0039     double diz();
0040 
0041     unsigned int layer() const { return layer_; }
0042     int disk() const {
0043       if (layerdisk_ < N_LAYER) {
0044         return 0;
0045       }
0046       int disk = layerdisk_ - N_LAYER + 1;
0047       if (z_ < 0.0) {
0048         return -disk;
0049       }
0050       return disk;
0051     }
0052     unsigned int ladder() const { return ladder_; }
0053     unsigned int module() const { return module_; }
0054 
0055     double x() const { return x_; }
0056     double y() const { return y_; }
0057     double z() const { return z_; }
0058     double r() const { return std::hypot(x_, y_); }
0059     double pt() const { return pt_; }
0060     double r2() const { return x_ * x_ + y_ * y_; }
0061     double bend() const { return bend_; }
0062 
0063     double phi() const { return atan2(y_, x_); }
0064 
0065     unsigned int iphi() const { return iphi_; }
0066     unsigned int iz() const { return iz_; }
0067 
0068     void setiphi(int iphi) { iphi_ = iphi; }
0069     void setiz(int iz) { iz_ = iz; }
0070 
0071     double sigmax() const { return sigmax_; }
0072     double sigmaz() const { return sigmaz_; }
0073 
0074     bool operator==(const L1TStub& other) const;
0075 
0076     void lorentzcor(double shift);
0077 
0078     int eventid() const { return eventid_; }
0079     std::vector<int> tps() const { return tps_; }
0080 
0081     void setAllStubIndex(unsigned int index) { allstubindex_ = index; }
0082 
0083     unsigned int allStubIndex() const { return allstubindex_; }
0084 
0085     unsigned int strip() const { return strip_; }
0086 
0087     double alpha(double pitch) const;
0088 
0089     //Scaled to go between -1 and +1
0090     double alphanorm() const;
0091 
0092     void setXY(double x, double y);
0093 
0094     unsigned int isPSmodule() const { return isPSmodule_; }
0095     unsigned int isFlipped() const { return isFlipped_; }
0096 
0097     bool isTilted() const;
0098 
0099     bool tpmatch(int tp) const;
0100     bool tpmatch2(int tp) const;
0101 
0102     const std::string& DTClink() const { return DTClink_; }
0103 
0104     int layerdisk() const { return layerdisk_; }
0105 
0106     int region() const { return region_; }
0107 
0108     const std::string& stubword() const { return stubword_; }
0109 
0110   private:
0111     int layerdisk_;
0112     std::string DTClink_;
0113     int region_;
0114     std::string stubword_;
0115     int eventid_;
0116     std::vector<int> tps_;
0117     unsigned int iphi_;
0118     unsigned int iz_;
0119     unsigned int layer_;
0120     unsigned int ladder_;
0121     unsigned int module_;
0122     unsigned int strip_;
0123     double x_;
0124     double y_;
0125     double z_;
0126     double sigmax_;
0127     double sigmaz_;
0128     double pt_;
0129     double bend_;
0130     unsigned int allstubindex_;
0131 
0132     unsigned int isPSmodule_;
0133     unsigned int isFlipped_;
0134   };
0135 };  // namespace trklet
0136 #endif