57 std::vector<edm::Handle<reco::TrackExtraCollection>> trackExtrasV(
trackExtraTokens_.size());
67 std::map<edm::ProductID, std::vector<bool>> idxstokeep;
68 for (
auto const& trackExtras : trackExtrasV) {
69 idxstokeep[trackExtras.id()].resize(trackExtras->size(),
false);
80 if (!
assoc->contains(trackExtra.
id())) {
85 trackExtra = trackExtraOut;
88 auto idxs = idxstokeep.find(trackExtra.
id());
89 if (idxs != idxstokeep.end()) {
90 idxs->second[trackExtra.
key()] =
true;
111 std::vector<bool> pixelClustersToKeep;
112 std::vector<bool> stripClustersToKeep;
118 pixelClustersToKeep.resize(
pixelClusters->dataSize(),
false);
119 stripClustersToKeep.resize(
stripClusters->dataSize(),
false);
127 for (
auto const& trackExtras : trackExtrasV) {
128 const std::vector<bool>& idxs = idxstokeep.at(trackExtras.id());
130 std::vector<int> associdxs(trackExtras->size(), -1);
131 for (
unsigned int i = 0;
i < trackExtras->size(); ++
i) {
138 associdxs[
i] = trackExtrasOut.size();
157 for (
auto const&
hit : trackExtra.
recHits()) {
161 if (singleHit !=
nullptr) {
164 pixelClustersToKeep[pixelRef.
key()] =
true;
166 SiStripClusterRef
const& stripRef = singleHit->
cluster_strip();
167 if (stripRef.isNonnull() && stripRef.id() ==
stripClusters.id()) {
168 stripClustersToKeep[stripRef.key()] =
true;
171 if (matched2DHit !=
nullptr) {
174 if (monoRef.isNonnull() && monoRef.id() ==
stripClusters.id()) {
175 stripClustersToKeep[monoRef.key()] =
true;
177 if (stereoRef.isNonnull() && stereoRef.id() ==
stripClusters.id()) {
178 stripClustersToKeep[stereoRef.key()] =
true;
187 assocfiller.insert(trackExtras, associdxs.begin(), associdxs.end());
197 std::unordered_map<unsigned int, unsigned int> pixelClusterIdxMap;
198 std::unordered_map<unsigned int, unsigned int> stripClusterIdxMap;
202 unsigned int iIndex = 0;
207 for (
auto iter = setIter->begin(), iterEnd = setIter->end(); iter != iterEnd; ++iter, ++iIndex) {
208 if (pixelClustersToKeep[iIndex]) {
210 const unsigned int oIndex = pixelClusterIdxMap.size();
211 pixelClusterIdxMap[iIndex] = oIndex;
220 for (
auto iter = setIter->begin(), iterEnd = setIter->end(); iter != iterEnd; ++iter, ++iIndex) {
221 if (stripClustersToKeep[iIndex]) {
223 const unsigned int oIndex = stripClusterIdxMap.size();
224 stripClusterIdxMap[iIndex] = oIndex;
235 for (
auto&
hit : trackingRecHitsOut) {
237 if (singleHit !=
nullptr) {
243 SiStripClusterRef
const& stripRef = singleHit->
cluster_strip();
244 if (stripRef.isNonnull() && stripRef.id() ==
stripClusters.id()) {
245 SiStripClusterRef
const stripRefOut(stripClustersOutH, stripClusterIdxMap.at(stripRef.key()));
249 if (matched2DHit !=
nullptr) {
252 if (monoRef.isNonnull() && monoRef.id() ==
stripClusters.id()) {
253 SiStripClusterRef
const monoRefOut(stripClustersOutH, stripClusterIdxMap.at(monoRef.key()));
256 if (stereoRef.isNonnull() && stereoRef.id() ==
stripClusters.id()) {
257 SiStripClusterRef
const stereoRefOut(stripClustersOutH, stripClusterIdxMap.at(stereoRef.key()));
void setClusterStripRef(ClusterStripRef const &ref)
ProductID id() const
Accessor for product ID.
OmniClusterRef const & stereoClusterRef() const
bool isNonnull() const
Checks for non-null.
OmniClusterRef const & monoClusterRef() const
key_type key() const
Accessor for product key.
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
ClusterPixelRef cluster_pixel() const
ClusterStripRef cluster_strip() const
Pixel cluster – collection of neighboring pixels above threshold.
ClusterStripRef cluster_strip() const
void setClusterPixelRef(ClusterPixelRef const &ref)