Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:49

0001 #ifndef CUDADataFormats_EcalRecHitSoA_interface_EcalRecHit_h
0002 #define CUDADataFormats_EcalRecHitSoA_interface_EcalRecHit_h
0003 
0004 #include <array>
0005 #include <vector>
0006 
0007 #include "CUDADataFormats/CaloCommon/interface/Common.h"
0008 #include "CUDADataFormats/EcalRecHitSoA/interface/RecoTypes.h"
0009 #include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"
0010 
0011 namespace ecal {
0012 
0013   template <typename StoragePolicy>
0014   struct RecHit : public ::calo::common::AddSize<typename StoragePolicy::TagType> {
0015     RecHit() = default;
0016     RecHit(const RecHit&) = default;
0017     RecHit& operator=(const RecHit&) = default;
0018 
0019     RecHit(RecHit&&) = default;
0020     RecHit& operator=(RecHit&&) = default;
0021 
0022     typename StoragePolicy::template StorageSelector<reco::StorageScalarType>::type energy;
0023     typename StoragePolicy::template StorageSelector<reco::StorageScalarType>::type time;
0024     // should we remove the following, since already included in "extra" ?
0025     typename StoragePolicy::template StorageSelector<reco::StorageScalarType>::type chi2;
0026     typename StoragePolicy::template StorageSelector<uint32_t>::type
0027         extra;  // packed uint32_t for timeError, chi2, energyError
0028     typename StoragePolicy::template StorageSelector<uint32_t>::type
0029         flagBits;  // store rechit condition (see Flags enum) in a bit-wise way
0030     typename StoragePolicy::template StorageSelector<uint32_t>::type did;
0031 
0032     template <typename U = typename StoragePolicy::TagType>
0033     typename std::enable_if<std::is_same<U, ::calo::common::tags::Vec>::value, void>::type resize(size_t size) {
0034       energy.resize(size);
0035       time.resize(size);
0036       chi2.resize(size);
0037       extra.resize(size);
0038       flagBits.resize(size);
0039       did.resize(size);
0040     }
0041   };
0042 
0043 }  // namespace ecal
0044 
0045 #endif  // CUDADataFormats_EcalRecHitSoA_interface_EcalRecHit_h