Skip to content

Commit

Permalink
Merge pull request #1 from slava77/CMSSW_10_4_0_patch1/tkNtuple4micNt…
Browse files Browse the repository at this point in the history
…kLayout-pull26028-0a6f9ed-fixClusterTP

import trackingNtuple developments on top of official 10_4_X
  • Loading branch information
slava77 authored Jan 10, 2020
2 parents 9529af0 + 719c457 commit 1068c1b
Show file tree
Hide file tree
Showing 4 changed files with 343 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ class ClusterTPAssociation {
explicit ClusterTPAssociation(const edm::HandleBase& mappedHandle): ClusterTPAssociation(mappedHandle.id()) {}
explicit ClusterTPAssociation(const edm::ProductID& mappedProductId): mappedProductId_(mappedProductId) {}

void emplace_back(const OmniClusterRef& cluster, const TrackingParticleRef& tp) {
checkMappedProductID(tp);
auto foundKeyID = std::find(std::begin(keyProductIDs_), std::end(keyProductIDs_), cluster.id());
void addKeyID(edm::ProductID id) {
auto foundKeyID = std::find(std::begin(keyProductIDs_), std::end(keyProductIDs_), id);
if(foundKeyID == std::end(keyProductIDs_)) {
keyProductIDs_.emplace_back(cluster.id());
keyProductIDs_.emplace_back(id);
}
}

void emplace_back(const OmniClusterRef& cluster, const TrackingParticleRef& tp) {
checkMappedProductID(tp);
checkKeyProductID(cluster.id());
map_.emplace_back(cluster, tp);
}
void sortAndUnique() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ void ClusterTPAssociationProducer::produce(edm::StreamID, edm::Event& iEvent, co

if ( foundPixelClusters ) {
// Pixel Clusters
clusterTPList->addKeyID(pixelClusters.id());
for (edmNew::DetSetVector<SiPixelCluster>::const_iterator iter = pixelClusters->begin();
iter != pixelClusters->end(); ++iter) {
uint32_t detid = iter->id();
Expand Down Expand Up @@ -168,6 +169,7 @@ void ClusterTPAssociationProducer::produce(edm::StreamID, edm::Event& iEvent, co

if ( foundStripClusters ) {
// Strip Clusters
clusterTPList->addKeyID(stripClusters.id());
for (edmNew::DetSetVector<SiStripCluster>::const_iterator iter = stripClusters->begin(false), eter = stripClusters->end(false);
iter != eter; ++iter) {
if (!(*iter).isValid()) continue;
Expand Down Expand Up @@ -202,8 +204,8 @@ void ClusterTPAssociationProducer::produce(edm::StreamID, edm::Event& iEvent, co
}

if ( foundPhase2OTClusters ) {

// Phase2 Clusters
clusterTPList->addKeyID(phase2OTClusters.id());
if(phase2OTClusters.isValid()){
for (edmNew::DetSetVector<Phase2TrackerCluster1D>::const_iterator iter = phase2OTClusters->begin(false), eter = phase2OTClusters->end(false);
iter != eter; ++iter) {
Expand Down
Loading

0 comments on commit 1068c1b

Please sign in to comment.