24 template <
typename TrackerTraits>
48 template <
typename TrackerTraits>
53 clusterThresholds_{iConfig.
getParameter<
int>(
"clusterThreshold_layer1"),
54 iConfig.
getParameter<
int>(
"clusterThreshold_otherLayers")},
55 produceDigis_(iConfig.getParameter<
bool>(
"produceDigis")),
56 storeDigis_(iConfig.getParameter<
bool>(
"produceDigis") && iConfig.getParameter<
bool>(
"storeDigis")) {
58 digiPutToken_ = produces<edm::DetSetVector<PixelDigi>>();
61 template <
typename TrackerTraits>
67 desc.add<
bool>(
"produceDigis",
true);
68 desc.add<
bool>(
"storeDigis",
true);
73 template <
typename TrackerTraits>
77 const auto& digis =
iEvent.get(digiGetToken_);
78 const uint32_t nDigis = digis.size();
79 const auto& ttopo = iSetup.
getData(topoToken_);
82 std::unique_ptr<edm::DetSetVector<PixelDigi>>
collection;
84 collection = std::make_unique<edm::DetSetVector<PixelDigi>>();
87 auto outputClusters = std::make_unique<SiPixelClusterCollectionNew>();
92 for (uint32_t
i = 0;
i < nDigis;
i++) {
95 if (digis.rawIdArr(
i) == 0)
98 if (digis.adc(
i) == 0)
101 detId = digis.rawIdArr(
i);
103 detDigis = &
collection->find_or_insert(detId);
104 if ((*detDigis).empty())
105 (*detDigis).data.reserve(64);
113 auto totClustersFilled = 0;
116 auto fillClusters = [&](uint32_t detId) {
122 for (int32_t ic = 0; ic < nclus + 1; ++ic) {
123 auto const& acluster = aclusters[ic];
126 edm::LogWarning(
"SiPixelDigisClustersFromSoA") <<
"cluster below charge Threshold " 127 <<
"Layer/DetId/clusId " <<
layer <<
'/' << detId <<
'/' << ic
128 <<
" size/charge " << acluster.isize <<
'/' << acluster.charge;
130 spc.
emplace_back(acluster.isize, acluster.adc, acluster.x, acluster.y, acluster.xmin, acluster.ymin, ic);
131 aclusters[ic].
clear();
134 const auto& cluster{spc.
back()};
135 LogDebug(
"SiPixelDigisClustersFromSoA")
136 <<
"putting in this cluster " << ic <<
" " << cluster.charge() <<
" " << cluster.pixelADC().size();
151 for (uint32_t
i = 0;
i < nDigis;
i++) {
153 if (digis.rawIdArr(
i) == 0)
156 if (digis.adc(
i) == 0)
158 if (digis.clus(
i) > 9000)
161 assert(digis.rawIdArr(
i) > 109999);
163 if (detId != digis.rawIdArr(
i)) {
169 detId = digis.rawIdArr(
i);
171 detDigis = &
collection->find_or_insert(detId);
172 if ((*detDigis).empty())
173 (*detDigis).data.reserve(64);
176 <<
"Problem det present twice in input! " << (*detDigis).detId();
182 (*detDigis).data.emplace_back(dig);
189 auto row = dig.row();
190 auto col = dig.column();
192 aclusters[digis.clus(
i)].
add(pix, digis.adc(
i));
200 LogDebug(
"SiPixelDigisClustersFromSoA") <<
"filled " << totClustersFilled <<
" clusters";
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
~SiPixelDigisClustersFromSoAT() override=default
const int32_t otherLayers
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
constexpr uint16_t numberOfModules
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
edm::EDGetTokenT< SiPixelDigisSoA > digiGetToken_
const SiPixelClusterThresholds clusterThresholds_
#define DEFINE_FWK_MODULE(type)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
constexpr int32_t maxNumClustersPerModules
SiPixelDigisClustersFromSoAT(const edm::ParameterSet &iConfig)
constexpr SiPixelClusterThresholds kSiPixelClusterThresholdsDefaultPhase1
Pixel cluster – collection of neighboring pixels above threshold.
void emplace_back(Args &&... args)
edm::EDPutTokenT< edm::DetSetVector< PixelDigi > > digiPutToken_
bool add(SiPixelCluster::PixelPos const &p, uint16_t const iadc)
Log< level::Warning, false > LogWarning
edm::EDPutTokenT< SiPixelClusterCollectionNew > clusterPutToken_