Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-05-26 00:02:25

0001 #ifndef DataFormats_SiPixelDigi_interface_SiPixelDigisSoA_h
0002 #define DataFormats_SiPixelDigi_interface_SiPixelDigisSoA_h
0003 
0004 #include <cstddef>
0005 #include <cstdint>
0006 #include <vector>
0007 
0008 // The main purpose of this class is to deliver digi and cluster data
0009 // from an EDProducer that transfers the data from GPU to host to an
0010 // EDProducer that converts the SoA to legacy data products. The class
0011 // is independent of any GPU technology, and in prunciple could be
0012 // produced by host code, and be used for other purposes than
0013 // conversion-to-legacy as well.
0014 class SiPixelDigisSoA {
0015 public:
0016   SiPixelDigisSoA() = default;
0017   explicit SiPixelDigisSoA(
0018       size_t nDigis, const uint32_t* pdigi, const uint32_t* rawIdArr, const uint16_t* adc, const int32_t* clus);
0019   ~SiPixelDigisSoA() = default;
0020 
0021   auto size() const { return pdigi_.size(); }
0022 
0023   uint32_t pdigi(size_t i) const { return pdigi_[i]; }
0024   uint32_t rawIdArr(size_t i) const { return rawIdArr_[i]; }
0025   uint16_t adc(size_t i) const { return adc_[i]; }
0026   int32_t clus(size_t i) const { return clus_[i]; }
0027 
0028   const std::vector<uint32_t>& pdigiVector() const { return pdigi_; }
0029   const std::vector<uint32_t>& rawIdArrVector() const { return rawIdArr_; }
0030   const std::vector<uint16_t>& adcVector() const { return adc_; }
0031   const std::vector<int32_t>& clusVector() const { return clus_; }
0032 
0033 private:
0034   std::vector<uint32_t> pdigi_;     // packed digi (row, col, adc) of each pixel
0035   std::vector<uint32_t> rawIdArr_;  // DetId of each pixel
0036   std::vector<uint16_t> adc_;       // ADC of each pixel
0037   std::vector<int32_t> clus_;       // cluster id of each pixel
0038 };
0039 
0040 #endif