Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-10-14 01:43:59

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             bool tiltedBarrel,
0025             unsigned int tiltedRingId,
0026             unsigned int endcapRingId,
0027             unsigned int detId,
0028             double x,
0029             double y,
0030             double z,
0031             double bend,
0032             double strip,
0033             std::vector<int> tps);
0034 
0035     ~L1TStub() = default;
0036 
0037     void write(std::ofstream& out);
0038 
0039     double diphi();
0040 
0041     double iphiouter();
0042 
0043     double diz();
0044 
0045     unsigned int layer() const { return layer_; }
0046     int disk() const {
0047       if (layerdisk_ < N_LAYER) {
0048         return 0;
0049       }
0050       int disk = layerdisk_ - N_LAYER + 1;
0051       if (z_ < 0.0) {
0052         return -disk;
0053       }
0054       return disk;
0055     }
0056 
0057     double x() const { return x_; }
0058     double y() const { return y_; }
0059     double z() const { return z_; }
0060     double r() const { return std::hypot(x_, y_); }
0061     double pt() const { return pt_; }
0062     double r2() const { return x_ * x_ + y_ * y_; }
0063     double bend() const { return bend_; }
0064 
0065     double phi() const { return atan2(y_, x_); }
0066 
0067     unsigned int iphi() const { return iphi_; }
0068     unsigned int iz() const { return iz_; }
0069 
0070     void setiphi(int iphi) { iphi_ = iphi; }
0071     void setiz(int iz) { iz_ = iz; }
0072 
0073     double sigmax() const { return sigmax_; }
0074     double sigmaz() const { return sigmaz_; }
0075 
0076     bool operator==(const L1TStub& other) const;
0077 
0078     void lorentzcor(double shift);
0079 
0080     int eventid() const { return eventid_; }
0081     std::vector<int> tps() const { return tps_; }
0082 
0083     void setAllStubIndex(unsigned int index) { allstubindex_ = index; }
0084 
0085     unsigned int allStubIndex() const { return allstubindex_; }
0086 
0087     unsigned int strip() const { return strip_; }
0088 
0089     double alpha(double pitch) const;
0090 
0091     //Scaled to go between -1 and +1
0092     double alphanorm() const;
0093 
0094     void setXY(double x, double y);
0095 
0096     unsigned int isPSmodule() const { return isPSmodule_; }
0097     unsigned int isFlipped() const { return isFlipped_; }
0098 
0099     bool isTilted() const { return tiltedBarrel_; }  // Tilted barrel
0100 
0101     // Tilted module ring no. (Increasing 1 to 12 as |z| increases).
0102     unsigned int tiltedRingId() const { return tiltedRingId_; }
0103     // Endcap disk module ring number (1-15 as r increases).
0104     unsigned int endcapRingId() const { return endcapRingId_; }
0105     unsigned int detId() const { return detId_; }  // Of lower sensor in module
0106 
0107     bool tpmatch(int tp) const;
0108     bool tpmatch2(int tp) const;
0109 
0110     const std::string& DTClink() const { return DTClink_; }
0111 
0112     int layerdisk() const { return layerdisk_; }
0113 
0114     int region() const { return region_; }
0115 
0116     const std::string& stubword() const { return stubword_; }
0117 
0118   private:
0119     int layerdisk_;
0120     std::string DTClink_;
0121     int region_;
0122     std::string stubword_;
0123     int eventid_;
0124     std::vector<int> tps_;
0125     unsigned int iphi_;
0126     unsigned int iz_;
0127     unsigned int layer_;
0128     unsigned int strip_;
0129     double x_;
0130     double y_;
0131     double z_;
0132     double sigmax_;
0133     double sigmaz_;
0134     double pt_;
0135     double bend_;
0136     unsigned int allstubindex_;
0137     unsigned int isPSmodule_;
0138     unsigned int isFlipped_;
0139     bool tiltedBarrel_;
0140     unsigned int tiltedRingId_;
0141     unsigned int endcapRingId_;
0142     unsigned int detId_;
0143   };
0144 };  // namespace trklet
0145 #endif