Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:33

0001 // Class for Gas-Electron Multiplier (GEM) EMTF Data Record
0002 
0003 #ifndef __l1t_emtf_GEM_h__
0004 #define __l1t_emtf_GEM_h__
0005 
0006 #include <vector>
0007 #include <cstdint>
0008 
0009 namespace l1t {
0010   namespace emtf {
0011     class GEM {
0012     public:
0013       explicit GEM(const uint64_t dataword);
0014 
0015       GEM()
0016           : pad(-99),
0017             partition(-99),
0018             cluster_size(-99),
0019             cluster_id(-99),
0020             link(-99),
0021             gem_bxn(-99),
0022             bc0(-99),
0023             tbin(-99),
0024             vp(-99),
0025             format_errors(0),
0026             dataword(-99){};
0027 
0028       virtual ~GEM() = default;
0029 
0030       inline void set_pad(const int bits) { pad = bits; }
0031       inline void set_partition(const int bits) { partition = bits; }
0032       inline void set_cluster_size(const int bits) { cluster_size = bits; }
0033       inline void set_cluster_id(const int bits) { cluster_id = bits; }
0034       inline void set_link(const int bits) { link = bits; }
0035       inline void set_gem_bxn(const int bits) { gem_bxn = bits; }
0036       inline void set_bc0(const int bits) { bc0 = bits; }
0037       inline void set_tbin(const int bits) { tbin = bits; }
0038       inline void set_vp(const int bits) { vp = bits; }
0039       inline void add_format_error() { format_errors += 1; }
0040       inline void set_dataword(const uint64_t bits) { dataword = bits; }
0041 
0042       /// Returns the lowest pad (strip pair, i.e., local phi) of the cluster
0043       inline int Pad() const { return pad; }
0044       /// Returns the eta partition (local eta) of the cluster
0045       inline int Partition() const { return partition; }
0046       /// Returns the size (in pads) of the cluster
0047       inline int ClusterSize() const { return cluster_size; }
0048       /// Returns the the cluster ID within the link
0049       inline int ClusterID() const { return cluster_id; }
0050       /// Returns the input link of the cluster
0051       inline int Link() const { return link; }
0052       /// Returns the BX ID of the cluster
0053       inline int GEM_BXN() const { return gem_bxn; }
0054       /// Returns whether the cluster has BC0
0055       inline int BC0() const { return bc0; }
0056       /// Returns the time bin of the cluster
0057       inline int TBIN() const { return tbin; }
0058       /// Returns the valid flag? of the cluster
0059       inline int VP() const { return vp; }
0060       /// Returns the format errors associated with the cluster
0061       inline int Format_errors() const { return format_errors; }
0062       /// Returns the raw data word of the cluster
0063       inline uint64_t Dataword() const { return dataword; }
0064 
0065     private:
0066       int pad;            ///< Pad (strip pair, i.e., local phi) of the GEM cluster
0067       int partition;      ///< Partition (local eta) of the GEM cluster
0068       int cluster_size;   ///< Size (in pads) of the GEM cluster
0069       int cluster_id;     ///< Cluster number of the GEM cluster
0070       int link;           ///< Input GEM link of the GEM cluster
0071       int gem_bxn;        ///< BX ID of the GEM cluster
0072       int bc0;            ///< BC0 valid for the GEM cluster
0073       int tbin;           ///< Time bin of the GEM cluster
0074       int vp;             ///< Valid status? of the GEM cluster
0075       int format_errors;  ///< Number of format errors for the GEM cluster
0076       uint64_t dataword;  ///< Raw EMTF DAQ word for the GEM cluster
0077 
0078     };  // End of class GEM
0079 
0080     // Define a vector of GEM
0081     typedef std::vector<GEM> GEMCollection;
0082 
0083   }  // End of namespace emtf
0084 }  // End of namespace l1t
0085 
0086 #endif /* define __l1t_emtf_GEM_h__ */