File indexing completed on 2024-04-06 12:26:19
0001
0002
0003
0004
0005
0006
0007
0008 template <typename T>
0009 void PixelThresholdClusterizer::clusterizeDetUnitT(const T& input,
0010 const PixelGeomDetUnit* pixDet,
0011 const TrackerTopology* tTopo,
0012 const std::vector<short>& badChannels,
0013 edmNew::DetSetVector<SiPixelCluster>::FastFiller& output) {
0014 typename T::const_iterator begin = input.begin();
0015 typename T::const_iterator end = input.end();
0016
0017
0018 if (begin == end) {
0019 edm::LogError("PixelThresholdClusterizer") << "@SUB=PixelThresholdClusterizer::clusterizeDetUnitT()"
0020 << " No digis to clusterize";
0021 }
0022
0023
0024 if (!setup(pixDet))
0025 return;
0026
0027 theDetid = input.detId();
0028
0029
0030 auto clusterThreshold = theClusterThreshold;
0031 theLayer = (DetId(theDetid).subdetId() == 1) ? tTopo->pxbLayer(theDetid) : 0;
0032 if (theLayer == 1)
0033 clusterThreshold = theClusterThreshold_L1;
0034
0035
0036
0037 if (end > begin)
0038 copy_to_buffer(begin, end);
0039
0040 assert(output.empty());
0041
0042 for (unsigned int i = 0; i < theSeeds.size(); i++) {
0043
0044
0045 if (theBuffer(theSeeds[i]) >= theSeedThreshold) {
0046
0047 SiPixelCluster&& cluster = make_cluster(theSeeds[i], output);
0048
0049
0050
0051 if (cluster.charge() >= clusterThreshold) {
0052
0053 output.push_back(std::move(cluster));
0054 std::push_heap(output.begin(), output.end(), [](SiPixelCluster const& cl1, SiPixelCluster const& cl2) {
0055 return cl1.minPixelRow() < cl2.minPixelRow();
0056 });
0057 }
0058 }
0059 }
0060
0061 std::sort_heap(output.begin(), output.end(), [](SiPixelCluster const& cl1, SiPixelCluster const& cl2) {
0062 return cl1.minPixelRow() < cl2.minPixelRow();
0063 });
0064
0065
0066 theSeeds.clear();
0067
0068
0069 clear_buffer(begin, end);
0070
0071 theFakePixels.clear();
0072
0073 thePixelOccurrence.clear();
0074 }