Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:20:31

0001 /**
0002  * @file intt/InttDefs.h
0003  * @author D. McGlinchey
0004  * @date June 2018
0005  * @brief Utility functions for INTT
0006  */
0007 #ifndef INTT_INTTDEFS_H
0008 #define INTT_INTTDEFS_H
0009 
0010 #include "TrkrDefs.h"
0011 
0012 #include <cstdint>  // for uint8_t, uint16_t, uint32_t
0013 
0014 /**
0015  * @brief Utility functions for INTT
0016  *
0017  * Contains the functions for manipulating the various keys
0018  * used by the intt for hits, hit sets, and clusters
0019  */
0020 namespace InttDefs
0021 {
0022   /**
0023    * @brief Get the ladder id from hitsetkey
0024    * @param[in] hitsetkey
0025    * @param[out] ladder id
0026    */
0027   uint8_t getLadderZId(TrkrDefs::hitsetkey key);
0028 
0029   /**
0030    * @brief Get the ladder id from cluskey
0031    * @param[in] cluskey
0032    * @param[out] ladder id
0033    */
0034   uint8_t getLadderZId(TrkrDefs::cluskey key);
0035 
0036   /**
0037    * @brief Get the sensor id from hitsetkey
0038    * @param[in] hitsetkey
0039    * @param[out] sensor id
0040    */
0041   uint8_t getLadderPhiId(TrkrDefs::hitsetkey key);
0042 
0043   /**
0044    * @brief Get the sensor id from cluskey
0045    * @param[in] cluskey
0046    * @param[out] sensor id
0047    */
0048 
0049   uint8_t getLadderPhiId(TrkrDefs::cluskey key);
0050 
0051   /**
0052    * @brief Generate a hitkey from a strip id
0053    * @param[in] strip Strip id
0054    * @param[out] hitkey
0055    */
0056 
0057   int getTimeBucketId(TrkrDefs::hitsetkey key);
0058 
0059   /**
0060    * @brief Get the time bucket id from the hitsetkey
0061    * @param[in] hitsetkey
0062    * @param[out] time bucket id
0063    */
0064 
0065   int getTimeBucketId(TrkrDefs::cluskey key);
0066 
0067   /**
0068    * @brief Get the time bucket id from the cluskey
0069    * @param[in] cluskey
0070    * @param[out] time bucket id
0071    */
0072 
0073   /**
0074    * @brief Get the column index from hitkey
0075    * @param[in] hitkey
0076    * @param[out] column index
0077    */
0078   uint16_t getCol(TrkrDefs::hitkey key);
0079 
0080   /**
0081    * @brief Get the row index from hitkey
0082    * @param[in] hitkey
0083    * @param[out] row index
0084    */
0085   uint16_t getRow(TrkrDefs::hitkey key);
0086 
0087   TrkrDefs::hitkey genHitKey(const uint16_t col, const uint16_t row);
0088 
0089   /**
0090    * @brief Generate a hitsetkey for the intt
0091    * @param[in] lyr Layer index
0092    * @param[in] ladder Ladder index
0093    * @param[in] sensor Sensor index
0094    * @param[out] hitsetkey
0095    *
0096    * Generate a hitsetkey for the intt. The tracker id is known
0097    * implicitly and used in the function.
0098    */
0099   TrkrDefs::hitsetkey genHitSetKey(const uint8_t lyr, const uint8_t ladder_z_index, const uint8_t ladder_phi_index, const int time_bucket);
0100 
0101   /**
0102    * @brief Generate a cluster key from indeces
0103    * @param[in] lyr Layer index
0104    * @param[in] ladder_z_index z index of sensor in ladder
0105    * @param[in] ladder_phi_ndex phi index of ladder in layer
0106    * @param[in] crossing - bunch crossing
0107    * @param[in] clusid Cluster id
0108    * @param[out] cluskey
0109    */
0110   TrkrDefs::cluskey genClusKey(const uint8_t lyr, const uint8_t ladder_z_index, const uint8_t ladder_phi_index, const int crossing, const uint32_t clusid);
0111 
0112   /**
0113    * @brief Zero the crossing bits in a copy of the  hitsetkey
0114    * @param[in] hitsetkey
0115    * @param[out] hitsetkey
0116    */
0117   TrkrDefs::hitsetkey resetCrossing(const TrkrDefs::hitsetkey hitsetkey);
0118 
0119 }  // namespace InttDefs
0120 
0121 #endif  // INTT_INTTDEFS_H