50 clusterThresholds_{iConfig.
getParameter<
int>(
"clusterThreshold_layer1"),
51 iConfig.
getParameter<
int>(
"clusterThreshold_otherLayers")},
52 produceDigis_(
iConfig.getParameter<
bool>(
"produceDigis")),
53 storeDigis_(
iConfig.getParameter<
bool>(
"produceDigis") &
iConfig.getParameter<
bool>(
"storeDigis")) {
55 digiPutToken_ = produces<edm::DetSetVector<PixelDigi>>();
63 desc.
add<
bool>(
"produceDigis",
true);
64 desc.
add<
bool>(
"storeDigis",
true);
70 const uint32_t nDigis = digis.size();
73 std::unique_ptr<edm::DetSetVector<PixelDigi>>
collection;
75 collection = std::make_unique<edm::DetSetVector<PixelDigi>>();
78 auto outputClusters = std::make_unique<SiPixelClusterCollectionNew>();
83 for (uint32_t
i = 0;
i < nDigis;
i++) {
86 if (digis.rawIdArr(
i) == 0)
89 if (digis.adc(
i) == 0)
92 detId = digis.rawIdArr(
i);
94 detDigis = &collection->find_or_insert(detId);
95 if ((*detDigis).empty())
96 (*detDigis).
data.reserve(64);
104 auto totClustersFilled = 0;
107 auto fillClusters = [&](uint32_t detId) {
113 for (int32_t ic = 0; ic < nclus + 1; ++ic) {
114 auto const& acluster = aclusters[ic];
116 if (acluster.charge < clusterThreshold)
117 edm::LogWarning(
"SiPixelDigisClustersFromSoA") <<
"cluster below charge Threshold "
118 <<
"Layer/DetId/clusId " <<
layer <<
'/' << detId <<
'/' << ic
119 <<
" size/charge " << acluster.isize <<
'/' << acluster.charge;
121 spc.
emplace_back(acluster.isize, acluster.adc, acluster.x, acluster.y, acluster.xmin, acluster.ymin, ic);
122 aclusters[ic].
clear();
125 const auto& cluster{spc.
back()};
126 LogDebug(
"SiPixelDigisClustersFromSoA")
127 <<
"putting in this cluster " << ic <<
" " << cluster.charge() <<
" " << cluster.pixelADC().size();
142 for (uint32_t
i = 0;
i < nDigis;
i++) {
144 if (digis.rawIdArr(
i) == 0)
147 if (digis.adc(
i) == 0)
149 if (digis.clus(
i) > 9000)
152 assert(digis.rawIdArr(
i) > 109999);
154 if (detId != digis.rawIdArr(
i)) {
160 detId = digis.rawIdArr(
i);
162 detDigis = &collection->find_or_insert(detId);
163 if ((*detDigis).empty())
164 (*detDigis).
data.reserve(64);
167 <<
"Problem det present twice in input! " << (*detDigis).detId();
173 (*detDigis).data.emplace_back(dig);
180 auto row = dig.row();
181 auto col = dig.column();
183 aclusters[digis.clus(
i)].
add(pix, digis.adc(
i));
191 LogDebug(
"SiPixelDigisClustersFromSoA") <<
"filled " << totClustersFilled <<
" clusters";
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
#define DEFINE_FWK_MODULE(type)
const int32_t otherLayers
constexpr std::array< uint8_t, layerIndexSize > layer
constexpr int32_t getThresholdForLayerOnCondition(bool isLayer1) const noexcept
bool getData(T &iHolder) const
edm::EDPutTokenT< edm::DetSetVector< PixelDigi > > digiPutToken_
const SiPixelClusterThresholds clusterThresholds_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
SiPixelDigisClustersFromSoA(const edm::ParameterSet &iConfig)
bool get(ProductID const &oid, Handle< PROD > &result) const
constexpr int32_t maxNumClustersPerModules
constexpr uint16_t maxNumModules
ParameterDescriptionBase * add(U const &iLabel, T const &value)
~SiPixelDigisClustersFromSoA() override=default
edm::EDPutTokenT< SiPixelClusterCollectionNew > clusterPutToken_
edm::EDGetTokenT< SiPixelDigisSoA > digiGetToken_
T getParameter(std::string const &) const
constexpr SiPixelClusterThresholds kSiPixelClusterThresholdsDefaultPhase1
Pixel cluster – collection of neighboring pixels above threshold.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void emplace_back(Args &&...args)
bool add(SiPixelCluster::PixelPos const &p, uint16_t const iadc)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Log< level::Warning, false > LogWarning