Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:54

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     void setUniqueIndex(unsigned int index) { uniqueindex_ = index; }
0085     void setCoords(double x, double y, double z) {
0086       x_ = x;
0087       y_ = y;
0088       z_ = z;
0089     }
0090 
0091     unsigned int allStubIndex() const { return allstubindex_; }
0092     unsigned int uniqueIndex() const { return uniqueindex_; }
0093 
0094     unsigned int strip() const { return strip_; }
0095 
0096     double alpha(double pitch) const;
0097 
0098     //Scaled to go between -1 and +1
0099     double alphanorm() const;
0100 
0101     void setXY(double x, double y);
0102 
0103     unsigned int isPSmodule() const { return isPSmodule_; }
0104     unsigned int isFlipped() const { return isFlipped_; }
0105 
0106     bool isTilted() const { return tiltedBarrel_; }  // Tilted barrel
0107 
0108     // Tilted module ring no. (Increasing 1 to 12 as |z| increases).
0109     unsigned int tiltedRingId() const { return tiltedRingId_; }
0110     // Endcap disk module ring number (1-15 as r increases).
0111     unsigned int endcapRingId() const { return endcapRingId_; }
0112     unsigned int detId() const { return detId_; }  // Of lower sensor in module
0113 
0114     bool tpmatch(int tp) const;
0115     bool tpmatch2(int tp) const;
0116 
0117     const std::string& DTClink() const { return DTClink_; }
0118 
0119     int layerdisk() const { return layerdisk_; }
0120 
0121     int region() const { return region_; }
0122 
0123     const std::string& stubword() const { return stubword_; }
0124 
0125   private:
0126     int layerdisk_;
0127     std::string DTClink_;
0128     int region_;
0129     std::string stubword_;
0130     int eventid_;
0131     std::vector<int> tps_;
0132     unsigned int iphi_;
0133     unsigned int iz_;
0134     unsigned int layer_;
0135     unsigned int strip_;
0136     double x_;
0137     double y_;
0138     double z_;
0139     double sigmax_;
0140     double sigmaz_;
0141     double pt_;
0142     double bend_;
0143     unsigned int allstubindex_;
0144     unsigned int uniqueindex_;
0145     unsigned int isPSmodule_;
0146     unsigned int isFlipped_;
0147     bool tiltedBarrel_;
0148     unsigned int tiltedRingId_;
0149     unsigned int endcapRingId_;
0150     unsigned int detId_;
0151   };
0152 };  // namespace trklet
0153 #endif