Skip to content

Commit

Permalink
Ignore upfront SimHits with particleType different from SimTrack pdgId
Browse files Browse the repository at this point in the history
These are anyway ignored from the number of hit calculation, so let's
ignore them from the "first hit" deduction as well.
  • Loading branch information
makortel committed Feb 2, 2017
1 parent 4c69a0a commit b9b75bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Expand Up @@ -661,6 +661,10 @@ namespace // Unnamed namespace for things only used in this file
{
const auto& pSimHit=simHits_[ iHitIndex->second ];

// Skip hits with particle type different from SimTrack pdgId
if(pSimHit->particleType() != pdgId)
continue;

// Initial condition for consistent simhit selection
if( init )
{
Expand All @@ -678,7 +682,7 @@ namespace // Unnamed namespace for things only used in this file
if( allowDifferentProcessTypeForDifferentDetectors_ && newDetector.det()!=oldDetector.det() ) processType=pSimHit->processType();

// Check for delta and interaction products discards
if( processType==pSimHit->processType() && particleType==pSimHit->particleType() && pdgId==pSimHit->particleType() )
if( processType==pSimHit->processType() && particleType==pSimHit->particleType() )
{
++numberOfHits;
oldLayer=newLayer;
Expand Down
Expand Up @@ -71,6 +71,13 @@ TrackingParticleNumberOfLayers::calculate(const edm::Handle<TrackingParticleColl
if(range.first == range.second) continue;

auto iHitPtr = range.first;
for(; iHitPtr != range.second; ++iHitPtr) {
// prevent simhits with particleType != pdgId from being the "first hit"
if(iHitPtr->second->particleType() == pdgId)
break;
}
if(iHitPtr == range.second) // no simhits with particleType == pdgId
continue;
int processType = iHitPtr->second->processType();
int particleType = iHitPtr->second->particleType();

Expand Down

0 comments on commit b9b75bf

Please sign in to comment.