52 clusterThresholds_{iConfig.
getParameter<
int>(
"clusterThreshold_layer1"),
53 iConfig.
getParameter<
int>(
"clusterThreshold_otherLayers")},
54 produceDigis_(iConfig.getParameter<
bool>(
"produceDigis")),
55 storeDigis_(iConfig.getParameter<
bool>(
"produceDigis") & iConfig.getParameter<
bool>(
"storeDigis")),
56 isPhase2_(iConfig.getParameter<
bool>(
"isPhase2")) {
58 digiPutToken_ = produces<edm::DetSetVector<PixelDigi>>();
66 desc.add<
bool>(
"produceDigis",
true);
67 desc.add<
bool>(
"storeDigis",
true);
68 desc.add<
bool>(
"isPhase2",
false);
74 const uint32_t nDigis = digis.size();
77 std::unique_ptr<edm::DetSetVector<PixelDigi>>
collection;
79 collection = std::make_unique<edm::DetSetVector<PixelDigi>>();
82 auto outputClusters = std::make_unique<SiPixelClusterCollectionNew>();
87 for (uint32_t
i = 0;
i < nDigis;
i++) {
90 if (digis.rawIdArr(
i) == 0)
93 if (digis.adc(
i) == 0)
96 detId = digis.rawIdArr(
i);
99 if ((*detDigis).empty())
100 (*detDigis).data.reserve(64);
108 auto totClustersFilled = 0;
111 auto fillClusters = [&](uint32_t detId) {
117 for (int32_t ic = 0; ic < nclus + 1; ++ic) {
118 auto const& acluster = aclusters[ic];
121 edm::LogWarning(
"SiPixelDigisClustersFromSoA") <<
"cluster below charge Threshold " 122 <<
"Layer/DetId/clusId " <<
layer <<
'/' << detId <<
'/' << ic
123 <<
" size/charge " << acluster.isize <<
'/' << acluster.charge;
125 spc.
emplace_back(acluster.isize, acluster.adc, acluster.x, acluster.y, acluster.xmin, acluster.ymin, ic);
126 aclusters[ic].
clear();
129 const auto& cluster{spc.
back()};
130 LogDebug(
"SiPixelDigisClustersFromSoA")
131 <<
"putting in this cluster " << ic <<
" " << cluster.charge() <<
" " << cluster.pixelADC().size();
146 for (uint32_t
i = 0;
i < nDigis;
i++) {
148 if (digis.rawIdArr(
i) == 0)
151 if (digis.adc(
i) == 0)
153 if (digis.clus(
i) > 9000)
156 assert(digis.rawIdArr(
i) > 109999);
158 if (detId != digis.rawIdArr(
i)) {
164 detId = digis.rawIdArr(
i);
166 detDigis = &
collection->find_or_insert(detId);
167 if ((*detDigis).empty())
168 (*detDigis).data.reserve(64);
171 <<
"Problem det present twice in input! " << (*detDigis).detId();
177 (*detDigis).data.emplace_back(dig);
184 auto row = dig.row();
185 auto col = dig.column();
187 aclusters[digis.clus(
i)].
add(pix, digis.adc(
i));
195 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
const int32_t otherLayers
constexpr uint32_t numberOfModules
constexpr std::array< uint8_t, layerIndexSize > layer
constexpr int32_t getThresholdForLayerOnCondition(bool isLayer1) const noexcept
edm::EDPutTokenT< edm::DetSetVector< PixelDigi > > digiPutToken_
const SiPixelClusterThresholds clusterThresholds_
SiPixelDigisClustersFromSoA(const edm::ParameterSet &iConfig)
#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
bool getData(T &iHolder) const
~SiPixelDigisClustersFromSoA() override=default
edm::EDPutTokenT< SiPixelClusterCollectionNew > clusterPutToken_
constexpr uint32_t numberOfModules
edm::EDGetTokenT< SiPixelDigisSoA > digiGetToken_
constexpr SiPixelClusterThresholds kSiPixelClusterThresholdsDefaultPhase1
Pixel cluster – collection of neighboring pixels above threshold.
void emplace_back(Args &&... args)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
bool add(SiPixelCluster::PixelPos const &p, uint16_t const iadc)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Log< level::Warning, false > LogWarning