Skip to content

Commit

Permalink
Merge pull request #31719 from cms-patatrack/patatrack_integration_7_…
Browse files Browse the repository at this point in the history
…N_ecal_local_reco

Patatrack integration - ECAL local reconstruction (7/N)
  • Loading branch information
cmsbuild authored Jan 18, 2021
2 parents e41cc23 + 92f3342 commit c98ca60
Show file tree
Hide file tree
Showing 97 changed files with 11,027 additions and 27 deletions.
8 changes: 8 additions & 0 deletions CUDADataFormats/EcalDigi/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<use name="CUDADataFormats/Common"/>
<use name="CUDADataFormats/CaloCommon"/>
<use name="DataFormats/Common"/>
<use name="HeterogeneousCore/CUDAUtilities"/>

<export>
<lib name="1"/>
</export>
24 changes: 24 additions & 0 deletions CUDADataFormats/EcalDigi/interface/DigisCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef CUDADataFormats_EcalDigi_interface_DigisCollection_h
#define CUDADataFormats_EcalDigi_interface_DigisCollection_h

#include "CUDADataFormats/CaloCommon/interface/Common.h"

namespace ecal {

template <typename StoragePolicy>
struct DigisCollection : public ::calo::common::AddSize<typename StoragePolicy::TagType> {
DigisCollection() = default;
DigisCollection(DigisCollection const &) = default;
DigisCollection &operator=(DigisCollection const &) = default;

DigisCollection(DigisCollection &&) = default;
DigisCollection &operator=(DigisCollection &&) = default;

// stride is statically known
typename StoragePolicy::template StorageSelector<uint32_t>::type ids;
typename StoragePolicy::template StorageSelector<uint16_t>::type data;
};

} // namespace ecal

#endif // CUDADataFormats_EcalDigi_interface_DigisCollection_h
3 changes: 3 additions & 0 deletions CUDADataFormats/EcalDigi/src/classes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "CUDADataFormats/Common/interface/Product.h"
#include "CUDADataFormats/EcalDigi/interface/DigisCollection.h"
#include "DataFormats/Common/interface/Wrapper.h"
6 changes: 6 additions & 0 deletions CUDADataFormats/EcalDigi/src/classes_def.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<lcgdict>
<class name="cms::cuda::Product<ecal::DigisCollection<calo::common::ViewStoragePolicy>>" persistent="false" />
<class name="cms::cuda::Product<ecal::DigisCollection<calo::common::DevStoragePolicy>>" persistent="false" />
<class name="edm::Wrapper<cms::cuda::Product<ecal::DigisCollection<calo::common::ViewStoragePolicy>>>" persistent="false"/>
<class name="edm::Wrapper<cms::cuda::Product<ecal::DigisCollection<calo::common::DevStoragePolicy>>>" persistent="false"/>
</lcgdict>
10 changes: 10 additions & 0 deletions CUDADataFormats/EcalRecHitSoA/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<use name="cuda"/>
<use name="CUDADataFormats/Common"/>
<use name="CUDADataFormats/CaloCommon"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/EcalDigi"/>
<use name="HeterogeneousCore/CUDAUtilities"/>

<export>
<lib name="1"/>
</export>
45 changes: 45 additions & 0 deletions CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#ifndef CUDADataFormats_EcalRecHitSoA_interface_EcalRecHit_h
#define CUDADataFormats_EcalRecHitSoA_interface_EcalRecHit_h

#include <array>
#include <vector>

#include "CUDADataFormats/CaloCommon/interface/Common.h"
#include "CUDADataFormats/EcalRecHitSoA/interface/RecoTypes.h"
#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h"

namespace ecal {

template <typename StoragePolicy>
struct RecHit : public ::calo::common::AddSize<typename StoragePolicy::TagType> {
RecHit() = default;
RecHit(const RecHit&) = default;
RecHit& operator=(const RecHit&) = default;

RecHit(RecHit&&) = default;
RecHit& operator=(RecHit&&) = default;

typename StoragePolicy::template StorageSelector<reco::StorageScalarType>::type energy;
typename StoragePolicy::template StorageSelector<reco::StorageScalarType>::type time;
// should we remove the following, since already included in "extra" ?
typename StoragePolicy::template StorageSelector<reco::StorageScalarType>::type chi2;
typename StoragePolicy::template StorageSelector<uint32_t>::type
extra; // packed uint32_t for timeError, chi2, energyError
typename StoragePolicy::template StorageSelector<uint32_t>::type
flagBits; // store rechit condition (see Flags enum) in a bit-wise way
typename StoragePolicy::template StorageSelector<uint32_t>::type did;

template <typename U = typename StoragePolicy::TagType>
typename std::enable_if<std::is_same<U, ::calo::common::tags::Vec>::value, void>::type resize(size_t size) {
energy.resize(size);
time.resize(size);
chi2.resize(size);
extra.resize(size);
flagBits.resize(size);
did.resize(size);
}
};

} // namespace ecal

#endif // CUDADataFormats_EcalRecHitSoA_interface_EcalRecHit_h
46 changes: 46 additions & 0 deletions CUDADataFormats/EcalRecHitSoA/interface/EcalUncalibratedRecHit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#ifndef CUDADataFormats_EcalRecHitSoA_interface_EcalUncalibratedRecHit_h
#define CUDADataFormats_EcalRecHitSoA_interface_EcalUncalibratedRecHit_h

#include <array>
#include <vector>

#include "CUDADataFormats/CaloCommon/interface/Common.h"
#include "CUDADataFormats/EcalRecHitSoA/interface/RecoTypes.h"
#include "DataFormats/EcalDigi/interface/EcalDataFrame.h"

namespace ecal {

template <typename StoragePolicy>
struct UncalibratedRecHit : public ::calo::common::AddSize<typename StoragePolicy::TagType> {
UncalibratedRecHit() = default;
UncalibratedRecHit(const UncalibratedRecHit&) = default;
UncalibratedRecHit& operator=(const UncalibratedRecHit&) = default;

UncalibratedRecHit(UncalibratedRecHit&&) = default;
UncalibratedRecHit& operator=(UncalibratedRecHit&&) = default;

typename StoragePolicy::template StorageSelector<reco::ComputationScalarType>::type amplitudesAll;
typename StoragePolicy::template StorageSelector<reco::StorageScalarType>::type amplitude;
typename StoragePolicy::template StorageSelector<reco::StorageScalarType>::type chi2;
typename StoragePolicy::template StorageSelector<reco::StorageScalarType>::type pedestal;
typename StoragePolicy::template StorageSelector<reco::StorageScalarType>::type jitter;
typename StoragePolicy::template StorageSelector<reco::StorageScalarType>::type jitterError;
typename StoragePolicy::template StorageSelector<uint32_t>::type did;
typename StoragePolicy::template StorageSelector<uint32_t>::type flags;

template <typename U = typename StoragePolicy::TagType>
typename std::enable_if<std::is_same<U, ::calo::common::tags::Vec>::value, void>::type resize(size_t size) {
amplitudesAll.resize(size * EcalDataFrame::MAXSAMPLES);
amplitude.resize(size);
pedestal.resize(size);
chi2.resize(size);
did.resize(size);
flags.resize(size);
jitter.resize(size);
jitterError.resize(size);
}
};

} // namespace ecal

#endif // CUDADataFormats_EcalRecHitSoA_interface_EcalUncalibratedRecHit_h
13 changes: 13 additions & 0 deletions CUDADataFormats/EcalRecHitSoA/interface/RecoTypes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef CUDADataFormats_EcalRecHitSoA_interface_RecoTypes_h
#define CUDADataFormats_EcalRecHitSoA_interface_RecoTypes_h

namespace ecal {
namespace reco {

using ComputationScalarType = float;
using StorageScalarType = float;

} // namespace reco
} // namespace ecal

#endif // CUDADataFormats_EcalRecHitSoA_interface_RecoTypes_h
4 changes: 4 additions & 0 deletions CUDADataFormats/EcalRecHitSoA/src/classes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "CUDADataFormats/Common/interface/Product.h"
#include "CUDADataFormats/EcalRecHitSoA/interface/EcalRecHit.h"
#include "CUDADataFormats/EcalRecHitSoA/interface/EcalUncalibratedRecHit.h"
#include "DataFormats/Common/interface/Wrapper.h"
20 changes: 20 additions & 0 deletions CUDADataFormats/EcalRecHitSoA/src/classes_def.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<lcgdict>
<class name="cms::cuda::Product<ecal::UncalibratedRecHit<calo::common::ViewStoragePolicy>>" persistent="false"/>
<class name="cms::cuda::Product<ecal::UncalibratedRecHit<calo::common::DevStoragePolicy>>" persistent="false"/>
<class name="edm::Wrapper<cms::cuda::Product<ecal::UncalibratedRecHit<calo::common::ViewStoragePolicy>>>" persistent="false"/>
<class name="edm::Wrapper<cms::cuda::Product<ecal::UncalibratedRecHit<calo::common::DevStoragePolicy>>>" persistent="false"/>

<class name="cms::cuda::Product<ecal::RecHit<calo::common::ViewStoragePolicy>>" persistent="false"/>
<class name="cms::cuda::Product<ecal::RecHit<calo::common::DevStoragePolicy>>" persistent="false"/>
<class name="edm::Wrapper<cms::cuda::Product<ecal::RecHit<calo::common::ViewStoragePolicy>>>" persistent="false"/>
<class name="edm::Wrapper<cms::cuda::Product<ecal::RecHit<calo::common::DevStoragePolicy>>>" persistent="false"/>

<class name="ecal::UncalibratedRecHit<calo::common::VecStoragePolicy<calo::common::CUDAHostAllocatorAlias>>" persistent="false"/>
<class name="edm::Wrapper<ecal::UncalibratedRecHit<calo::common::VecStoragePolicy<calo::common::CUDAHostAllocatorAlias>>>" persistent="false"/>
<class name="ecal::RecHit<calo::common::VecStoragePolicy<calo::common::CUDAHostAllocatorAlias>>" persistent="false"/>
<class name="edm::Wrapper<ecal::RecHit<calo::common::VecStoragePolicy<calo::common::CUDAHostAllocatorAlias>>>" persistent="false"/>
<class name="ecal::UncalibratedRecHit<calo::common::VecStoragePolicy<std::allocator>>" persistent="false"/>
<class name="edm::Wrapper<ecal::UncalibratedRecHit<calo::common::VecStoragePolicy<std::allocator>>>" persistent="false"/>
<class name="ecal::RecHit<calo::common::VecStoragePolicy<std::allocator>>" persistent="false"/>
<class name="edm::Wrapper<ecal::RecHit<calo::common::VecStoragePolicy<std::allocator>>>" persistent="false"/>
</lcgdict>
3 changes: 2 additions & 1 deletion Configuration/StandardSequences/python/RawToDigi_cff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import FWCore.ParameterSet.Config as cms
from Configuration.ProcessModifiers.gpu_cff import gpu

# This object is used to selectively make changes for different running
# scenarios. In this case it makes changes for Run 2.
Expand Down Expand Up @@ -74,7 +75,7 @@

scalersRawToDigi.scalersInputTag = 'rawDataCollector'
siPixelDigis.cpu.InputLabel = 'rawDataCollector'
ecalDigis.InputLabel = 'rawDataCollector'
(~gpu).toModify(ecalDigis, InputLabel='rawDataCollector')
ecalPreshowerDigis.sourceTag = 'rawDataCollector'
hcalDigis.InputLabel = 'rawDataCollector'
muonCSCDigis.InputObjects = 'rawDataCollector'
Expand Down
8 changes: 6 additions & 2 deletions EventFilter/EcalRawToDigi/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="boost"/>
<use name="cuda"/>
<use name="CUDADataFormats/EcalDigi" />
<use name="CondFormats/EcalObjects"/>
<use name="DataFormats/EcalDetId"/>
<use name="DataFormats/EcalDigi"/>
<use name="DataFormats/EcalRawData"/>
<use name="DataFormats/EcalRecHit"/>
<use name="DataFormats/FEDRawData"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ParameterSet"/>
<use name="Geometry/EcalMapping"/>
<use name="HeterogeneousCore/CUDACore"/>
<use name="HeterogeneousCore/CUDAUtilities"/>
<use name="Utilities/StorageFactory"/>
<export>
<lib name="1"/>
Expand Down
7 changes: 7 additions & 0 deletions EventFilter/EcalRawToDigi/bin/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<bin name="makeEcalRaw2DigiGpuValidationPlots" file="makeEcalRaw2DigiGpuValidationPlots.cpp">
<use name="root"/>
<use name="rootgraphics"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/EcalDigi"/>
<use name="DataFormats/EcalDetId"/>
</bin>
Loading

0 comments on commit c98ca60

Please sign in to comment.