Skip to content

Commit

Permalink
safety added after new digitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
pozzobon committed Oct 28, 2014
1 parent 058c670 commit 895f878
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions SimTracker/TrackTriggerAssociation/plugins/TTClusterAssociator.cc
Expand Up @@ -135,6 +135,26 @@ void TTClusterAssociator< Ref_PixelDigi_ >::produce( edm::Event& iEvent, const e
const DetId detId = theStackedTrackers->idToDet( tempCluRef->getDetId(), tempCluRef->getStackMember() )->geographicalId();

/// Get the PixelDigiSimLink
/// Safety check added after new digitizer (Oct 2014)
if ( thePixelDigiSimLinkHandle->find(detId.rawId()) == thePixelDigiSimLinkHandle->end() )
{
/// Sensor is not found in DigiSimLink.
/// Set MC truth to NULL for all hits in this sensor. Period.

/// Get the Digis and loop over them
std::vector< Ref_PixelDigi_ > theseHits = tempCluRef->getHits();
for ( unsigned int i = 0; i < theseHits.size(); i++ )
{
/// No SimLink is found by definition
/// Then store NULL MC truth for all the digis
edm::Ptr< TrackingParticle > tempTPPtr; // = new edm::Ptr< TrackingParticle >();
clusterToTrackingParticleVectorMap.find( tempCluRef )->second.push_back( tempTPPtr );
}

/// Go to the next sensor
continue;
}

edm::DetSet<PixelDigiSimLink> thisDigiSimLink = (*(thePixelDigiSimLinkHandle) )[detId.rawId()];
edm::DetSet<PixelDigiSimLink>::const_iterator iterSimLink;

Expand Down

0 comments on commit 895f878

Please sign in to comment.