|
ATLAS Offline Software
|
Go to the documentation of this file.
36 return StatusCode::SUCCESS;
48 return StatusCode::SUCCESS;
52 template <
class PrdType,
class SimCollection>
59 ATH_MSG_DEBUG(
"No key has been defined for "<<
typeid(PrdType).
name()<<
". Bail out silently");
60 return StatusCode::SUCCESS;
63 if (!prdContainer.isPresent()) {
65 return StatusCode::FAILURE;
69 if (!simDataMap.isPresent()) {
70 ATH_MSG_ERROR(
"SimDataCollection for key=" << sdoKey.
key() <<
" not in storegate.");
71 return StatusCode::FAILURE;
76 ATH_CHECK(prdTruth.record(std::make_unique<PRD_MultiTruthCollection>()));
79 for (
const PrdType* prd : *coll) {
80 ATH_MSG_VERBOSE(
"addPrepRawDatum(): new PRD " << prd <<
", id=" << prd->identify() <<
", number of RDOs: " << prd->rdoList().size());
81 bool gotSDO{
false}, gotValidParticle{
false};
83 for (
const auto& nextRDO : prd->rdoList()) {
84 typename SimCollection::const_iterator iter(simDataMap->find(nextRDO));
85 if (iter == simDataMap->end()) {
90 typedef typename SimCollection::mapped_type SIMDATA;
91 const SIMDATA& sdo = iter->second;
92 const std::vector<typename SIMDATA::Deposit>& deposits = sdo.getdeposits();
93 if (deposits.empty()) {
continue; }
94 for (
const auto& [particleLink, mcData] : deposits) {
95 ATH_MSG_VERBOSE(
"addPrepRawDatum(): particleLink.isValid() " << particleLink.isValid());
96 ATH_MSG_VERBOSE(
"addPrepRawDatum(): Barcode " << particleLink.barcode() <<
" evt " << particleLink.eventIndex());
97 if (!particleLink.isValid()) {
100 gotValidParticle =
true;
105 std::pair<truthiter, truthiter>
r = prdTruth->equal_range(prd->identify());
106 const auto& pl = particleLink;
107 if (
r.second == std::find_if(
r.first,
r.second, [pl](
const PRD_MultiTruthCollection::value_type& prd_to_truth) {
108 return prd_to_truth.second == pl;
110 prdTruth->insert(std::make_pair(prd->identify(), particleLink));
114 if (gotSDO && !gotValidParticle) {
117 ATH_MSG_DEBUG(
"addPrepRawDatum(): got SDO but no particles");
121 return StatusCode::SUCCESS;
JetConstituentVector::iterator iterator
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
SG::ReadHandleKey< MuonSimDataCollection > m_MdtSDOKey
SG::ReadHandleKey< Muon::MMPrepDataContainer > m_MmPrdKey
SG::WriteHandleKey< PRD_MultiTruthCollection > m_CscTruthMapKey
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_sTgcPrdKey
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::ReadHandleKey< Muon::CscPrepDataContainer > m_CscPrdKey
SG::ReadHandleKey< MuonSimDataCollection > m_sTgcSDOKey
virtual StatusCode initialize() override final
Handle class for recording to StoreGate.
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadHandleKey< CscSimDataCollection > m_CscSDOKey
SG::WriteHandleKey< PRD_MultiTruthCollection > m_TgcTruthMapKey
SG::WriteHandleKey< PRD_MultiTruthCollection > m_MmTruthMapKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_RpcPrdKey
SG::WriteHandleKey< PRD_MultiTruthCollection > m_sTgcTruthMapKey
Template to hold collections of MuonPrepRawData objects.
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_MdtPrdKey
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ReadHandleKey< MuonSimDataCollection > m_TgcSDOKey
StatusCode buildPRD_Truth(const EventContext &ctx, const SG::ReadHandleKey< Muon::MuonPrepDataContainerT< PrdType >> &prepDataKey, const SG::ReadHandleKey< SimCollection > &sdoKey, const SG::WriteHandleKey< PRD_MultiTruthCollection > &outputKey) const
SG::WriteHandleKey< PRD_MultiTruthCollection > m_MdtTruthMapKey
SG::ReadHandleKey< MuonSimDataCollection > m_RpcSDOKey
SG::ReadHandleKey< MuonSimDataCollection > m_MmSDOKey
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Handle class for reading from StoreGate.
SG::WriteHandleKey< PRD_MultiTruthCollection > m_RpcTruthMapKey
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_TgcPrdKey