diff --git a/InnerDetector/InDetTruth/InDetTruthTools/InDetTruthTools/PRD_MultiTruthBuilder.h b/InnerDetector/InDetTruth/InDetTruthTools/InDetTruthTools/PRD_MultiTruthBuilder.h index 2bc7d9538d204dc39b0d59014d4b5c9dc65ec3d0..f73a2f8d17d85a0fdc67fd52c98c5ed241ef58c6 100755 --- a/InnerDetector/InDetTruth/InDetTruthTools/InDetTruthTools/PRD_MultiTruthBuilder.h +++ b/InnerDetector/InDetTruth/InDetTruthTools/InDetTruthTools/PRD_MultiTruthBuilder.h @@ -30,6 +30,20 @@ namespace InDet { private: const PixelID *m_idHelperPixel; + + Gaudi::Property<float> m_pixelThreshold{ + this, + "PixelThreshold", + 300, + "Minimum charge in a cluster required to associate a truth particle to a pixel RDO [e's] -- default set to ~noise level = ~1/10 of threshold" + }; + + Gaudi::Property<float> m_sctThreshold{ + this, + "SCT_Threshold", + 600, + "Minimum charge in a cluster required to associate a truth particle to a SCT RDO [e's] -- default set to ~1/10 threshold" + }; }; diff --git a/InnerDetector/InDetTruth/InDetTruthTools/src/PRD_MultiTruthBuilder.cxx b/InnerDetector/InDetTruth/InDetTruthTools/src/PRD_MultiTruthBuilder.cxx index 2736f32e583839e7c9f93b22160371b307430014..05d8be030a32e986839384e4ec6193921f224992 100755 --- a/InnerDetector/InDetTruth/InDetTruthTools/src/PRD_MultiTruthBuilder.cxx +++ b/InnerDetector/InDetTruth/InDetTruthTools/src/PRD_MultiTruthBuilder.cxx @@ -64,6 +64,9 @@ void PRD_MultiTruthBuilder::addPrepRawDatum(PRD_MultiTruthCollection *prdTruth, ATH_MSG_VERBOSE ( "Pixel=" << m_idHelperPixel->eta_index(*nextRDO) << "," <<m_idHelperPixel->phi_index(*nextRDO) << " does not match any SDO"); } + bool isPixel = m_idHelperPixel->is_pixel( *nextRDO ); + bool isSCT = m_idHelperPixel->is_sct( *nextRDO ); + if(iter != simDataMap->end() ) { gotSDO = true; // Got an SDO. Try to associate the PRD to MC particles we have info about. @@ -72,25 +75,36 @@ void PRD_MultiTruthBuilder::addPrepRawDatum(PRD_MultiTruthCollection *prdTruth, std::vector< InDetSimData::Deposit >::const_iterator nextdeposit = deposits.begin(); std::vector< InDetSimData::Deposit >::const_iterator lastdeposit = deposits.end(); for( ; nextdeposit!=lastdeposit; ++nextdeposit) { - const HepMcParticleLink& particleLink = nextdeposit->first; - - ATH_MSG_VERBOSE("addPrepRawDatum(): Barcode " << particleLink.barcode()); - - if (particleLink.isValid()) { - gotValidParticle = true; - // Associate the particle to the PRD. But don't add duplicates. - // Note: it may be more efficient to filter out duplicates among particles for the current PRD, then check-and-add the reduced set to the large multimap. - // But may be not for the typically small RDO/PRD ratio. - typedef PRD_MultiTruthCollection::iterator truthiter; - std::pair<truthiter, truthiter> r = prdTruth->equal_range(prd->identify()); - if(r.second == std::find_if(r.first, r.second, - [ particleLink ](const PRD_MultiTruthCollection::value_type &prd_to_truth) { - return prd_to_truth.second == particleLink; - } )) - { - prdTruth->insert(std::make_pair(prd->identify(), particleLink)); - } - } + const HepMcParticleLink& particleLink = nextdeposit->first; + + ATH_MSG_VERBOSE("addPrepRawDatum(): Barcode " << particleLink.barcode() << " with charge " << nextdeposit->second ); + + // Confirm that the energy deposited in the RDO is significant + if( isPixel && nextdeposit->second < m_pixelThreshold ){ + ATH_MSG_VERBOSE("addPrepRawDatum() ignored PIXEL: Barcode " << particleLink.barcode() << " with charge " << nextdeposit->second ); + continue; + } + + if( isSCT && nextdeposit->second < m_sctThreshold ){ + ATH_MSG_VERBOSE("addPrepRawDatum() ignored SCT: Barcode " << particleLink.barcode() << " with charge " << nextdeposit->second ); + continue; + } + + if (particleLink.isValid()) { + gotValidParticle = true; + // Associate the particle to the PRD. But don't add duplicates. + // Note: it may be more efficient to filter out duplicates among particles for the current PRD, then check-and-add the reduced set to the large multimap. + // But may be not for the typically small RDO/PRD ratio. + typedef PRD_MultiTruthCollection::iterator truthiter; + std::pair<truthiter, truthiter> r = prdTruth->equal_range(prd->identify()); + if(r.second == std::find_if(r.first, r.second, + [ particleLink ](const PRD_MultiTruthCollection::value_type &prd_to_truth) { + return prd_to_truth.second == particleLink; + } )) + { + prdTruth->insert(std::make_pair(prd->identify(), particleLink)); + } + } } } }