Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-07 03:06:28

0001 #ifndef DataFormats_Phase2TrackerDigi_Phase2ITQCore_H
0002 #define DataFormats_Phase2TrackerDigi_Phase2ITQCore_H
0003 #include <vector>
0004 
0005 class Phase2ITQCore {
0006   // Collects hits and creates a quarter core (16 pixel positions)
0007 
0008 public:
0009   Phase2ITQCore(int rocid,
0010                 int ccol_in,
0011                 int qcrow_in,
0012                 bool isneighbour_in,
0013                 bool islast_in,
0014                 const std::vector<int>& adcs_in,
0015                 const std::vector<int>& hits_in);
0016 
0017   Phase2ITQCore() {
0018     rocid_ = -1;
0019     islast_ = false;
0020     isneighbour_ = false;
0021     ccol_ = -1;
0022     qcrow_ = -1;
0023   }
0024 
0025   void setIsLast(bool islast) { islast_ = islast; }
0026   bool islast() const { return islast_; }
0027 
0028   void setIsNeighbour(bool isneighbour) { isneighbour_ = isneighbour; }
0029 
0030   int rocid() const { return rocid_; }
0031   int get_col() const { return ccol_; }
0032   int get_row() const { return qcrow_; }
0033 
0034   std::vector<bool> getHitmap();
0035   std::vector<int> getADCs();
0036   std::vector<bool> encodeQCore(bool is_new_col);
0037 
0038   const bool operator<(const Phase2ITQCore& other) {
0039     if (ccol_ == other.ccol_) {
0040       return (ccol_ < other.ccol_);
0041     } else {
0042       return (qcrow_ < other.qcrow_);
0043     }
0044   }
0045 
0046 private:
0047   std::vector<int> adcs_;  // Full array of adc values in a quarter core
0048   std::vector<int> hits_;  // Full array of hit occurrences
0049   bool islast_;            // RD53 chip encoding bits
0050   bool isneighbour_;       // RD53 chip encoding bits
0051   int rocid_;              // Chip index number
0052   int ccol_;               // QCore position column
0053   int qcrow_;              // QCore position row
0054 
0055   std::vector<bool> toRocCoordinates(std::vector<bool>& hitmap);
0056   std::vector<bool> intToBinary(int num, int length);
0057   bool containsHit(std::vector<bool>& hitmap);
0058   std::vector<bool> getHitmapCode(std::vector<bool> hitmap);
0059 };
0060 
0061 #endif  // DataFormats_Phase2TrackerDigi_Phase2ITQCore_H