-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16815 from VinInn/SpeedP2Clus
Speed up Phase2TrackerClusterizer by a factor 1000
- Loading branch information
Showing
10 changed files
with
141 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
RecoLocalTracker/SiPhase2Clusterizer/interface/Phase2TrackerClusterizerArray.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<use name="RecoLocalTracker/SiPhase2Clusterizer"/> | ||
<library file="Phase2TrackerClusterizer.cc Phase2TrackerClusterizerAlgorithm.cc Phase2TrackerClusterizerArray.cc" name="Phase2TrackerClusterizerPlugin"> | ||
<library file="*.cc" name="Phase2TrackerClusterizerPlugin"> | ||
<flags EDM_PLUGIN="1"/> | ||
</library> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
RecoLocalTracker/SiPhase2Clusterizer/plugins/Phase2TrackerClusterizerSequentialAlgorithm.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#ifndef RecoLocalTracker_SiPhase2Clusterizer_Phase2TrackerClusterizerSequentialAlgorithm_h | ||
#define RecoLocalTracker_SiPhase2Clusterizer_Phase2TrackerClusterizerSequentialAlgorithm_h | ||
|
||
#include "DataFormats/Common/interface/DetSetVector.h" | ||
#include "DataFormats/Common/interface/DetSetVectorNew.h" | ||
#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" | ||
#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" | ||
|
||
|
||
class Phase2TrackerClusterizerSequentialAlgorithm { | ||
public: | ||
inline void clusterizeDetUnit(const edm::DetSet< Phase2TrackerDigi >&, Phase2TrackerCluster1DCollectionNew::FastFiller&) const; | ||
}; | ||
|
||
void | ||
Phase2TrackerClusterizerSequentialAlgorithm::clusterizeDetUnit(const edm::DetSet< Phase2TrackerDigi >& digis, Phase2TrackerCluster1DCollectionNew::FastFiller& clusters) const { | ||
if (digis.empty()) return; | ||
auto di = digis.begin(); | ||
unsigned int sizeCluster=1; | ||
Phase2TrackerDigi firstDigi = *di; | ||
bool HIPbit = firstDigi.overThreshold(); | ||
auto previous = firstDigi; | ||
++di; | ||
for (;di!=digis.end(); ++di) { | ||
auto digi = *di; | ||
#ifdef VERIFY_PH2_TK_CLUS | ||
if ( !(previous<digi)) std::cout << "not ordered " << previous << ' ' << digi << std::endl; | ||
#endif | ||
if (digi-previous == 1) { | ||
HIPbit |= digi.overThreshold(); | ||
++sizeCluster; | ||
} else { | ||
clusters.push_back(Phase2TrackerCluster1D(firstDigi, sizeCluster, HIPbit)); | ||
firstDigi=digi; | ||
HIPbit = digi.overThreshold(); | ||
sizeCluster=1; | ||
} | ||
previous=digi; | ||
} | ||
clusters.push_back(Phase2TrackerCluster1D(firstDigi, sizeCluster, HIPbit)); | ||
|
||
} | ||
|
||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters