CMS 3D CMS Logo

SiPixelDigisSoA.h
Go to the documentation of this file.
1 #ifndef DataFormats_SiPixelDigi_interface_SiPixelDigisSoA_h
2 #define DataFormats_SiPixelDigi_interface_SiPixelDigisSoA_h
3 
4 #include <cstddef>
5 #include <cstdint>
6 #include <vector>
7 
8 namespace legacy {
9 
10  // The main purpose of this class is to deliver digi and cluster data
11  // from an EDProducer that transfers the data from GPU to host to an
12  // EDProducer that converts the SoA to legacy data products. The class
13  // is independent of any GPU technology, and in prunciple could be
14  // produced by host code, and be used for other purposes than
15  // conversion-to-legacy as well.
16 
18  public:
19  SiPixelDigisSoA() = default;
20  explicit SiPixelDigisSoA(
21  size_t nDigis, const uint32_t* pdigi, const uint32_t* rawIdArr, const uint16_t* adc, const int32_t* clus)
22  : pdigi_(pdigi, pdigi + nDigis),
23  rawIdArr_(rawIdArr, rawIdArr + nDigis),
24  adc_(adc, adc + nDigis),
25  clus_(clus, clus + nDigis) {}
26 
27  ~SiPixelDigisSoA() = default;
28 
29  auto size() const { return pdigi_.size(); }
30 
31  uint32_t pdigi(size_t i) const { return pdigi_[i]; }
32  uint32_t rawIdArr(size_t i) const { return rawIdArr_[i]; }
33  uint16_t adc(size_t i) const { return adc_[i]; }
34  int32_t clus(size_t i) const { return clus_[i]; }
35 
36  const std::vector<uint32_t>& pdigiVector() const { return pdigi_; }
37  const std::vector<uint32_t>& rawIdArrVector() const { return rawIdArr_; }
38  const std::vector<uint16_t>& adcVector() const { return adc_; }
39  const std::vector<int32_t>& clusVector() const { return clus_; }
40 
41  private:
42  std::vector<uint32_t> pdigi_; // packed digi (row, col, adc) of each pixel
43  std::vector<uint32_t> rawIdArr_; // DetId of each pixel
44  std::vector<uint16_t> adc_; // ADC of each pixel
45  std::vector<int32_t> clus_; // cluster id of each pixel
46  };
47 
48 } // namespace legacy
49 
50 #endif // DataFormats_SiPixelDigi_interface_SiPixelDigisSoA_h
const std::vector< int32_t > & clusVector() const
int32_t clus(size_t i) const
const std::vector< uint32_t > & rawIdArrVector() const
std::vector< int32_t > clus_
std::vector< uint32_t > rawIdArr_
uint16_t adc(size_t i) const
const std::vector< uint16_t > & adcVector() const
const std::vector< uint32_t > & pdigiVector() const
std::vector< uint32_t > pdigi_
SiPixelDigisSoA(size_t nDigis, const uint32_t *pdigi, const uint32_t *rawIdArr, const uint16_t *adc, const int32_t *clus)
std::vector< uint16_t > adc_
uint32_t pdigi(size_t i) const
uint32_t rawIdArr(size_t i) const