ATLAS Offline Software
Loading...
Searching...
No Matches
MuonPatternCombinationDetailedTrackTruthMaker.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Algorithm producing truth info for PrepRawData, keeping all MC particles contributed to a PRD.
6// A. Gaponenko, 2006
7
9
10#include <iterator>
11
16
17//================================================================
19 ISvcLocator *pSvcLocator) :
20 AthAlgorithm(name, pSvcLocator) {
22}
23
24// -----------------------------------------------------------------------------------------------------
26 ATH_MSG_DEBUG("MuonPatternCombinationDetailedTrackTruthMaker::initialize()");
27 ATH_CHECK(m_truthTool.retrieve());
28 return StatusCode::SUCCESS;
29}
30
31// -----------------------------------------------------------------------------------------------------
33 ATH_MSG_DEBUG("MuonPatternCombinationDetailedTrackTruthMaker::execute()");
34
35 StatusCode sc;
36
37 //----------------------------------------------------------------
38 // Retrieve prep raw data truth
39 std::vector<const PRD_MultiTruthCollection *> prdCollectionVector;
40 for (std::vector<std::string>::const_iterator ikey = m_PRD_TruthNames.begin(); ikey != m_PRD_TruthNames.end(); ++ikey) {
41 prdCollectionVector.push_back(nullptr);
42 sc = evtStore()->retrieve(*prdCollectionVector.rbegin(), *ikey);
43 if (!sc.isSuccess()) {
44 ATH_MSG_WARNING("PRD_MultiTruthCollection " << *ikey << " NOT found");
45 } else {
46 ATH_MSG_DEBUG("Got PRD_MultiTruthCollection " << *ikey);
47 }
48 }
49
50 //----------------------------------------------------------------
51 // Retrieve track collections
52
53 const TrackCollection *tracks = nullptr;
55 ATH_MSG_DEBUG("Got TrackCollection " << m_trackCollectionName);
56 } else {
57 ATH_MSG_VERBOSE("TrackCollection " << m_trackCollectionName << " NOT found");
58 return StatusCode::FAILURE;
59 }
60
61 const MuonPatternCombinationCollection *muPatternCombinations = nullptr;
63 evtStore()->retrieve(muPatternCombinations, m_collection).isSuccess()) {
64 ATH_MSG_DEBUG("Got MuonPatternCombinationCollection " << m_collection);
65 } else {
66 ATH_MSG_VERBOSE("MuonpatternCombinationCollection " << m_collection << " NOT found");
67 return StatusCode::FAILURE;
68 }
69
70 //----------------------------------------------------------------
71 // Produce and store the output.
72
73 // DetailedTrackTruthCollection *dttc = new DetailedTrackTruthCollection(tracks);
74 // m_truthTool->buildDetailedTrackTruth(dttc, *tracks, prdCollectionVector);
75
76 //(DetailedMuonPatternTruthCollection *output, const MuonPatternCombinationCollection& tracks, const std::vector<const
77 // PRD_MultiTruthCollection*>& prdTruth);
78
80 m_truthTool->buildDetailedMuonPatternTruth(dmptc, *muPatternCombinations, prdCollectionVector);
81
82 sc = evtStore()->record(dmptc, m_detailedTrackTruthName);
83 if (sc.isFailure()) {
84 ATH_MSG_WARNING("DetailedMuonPatternTrackTruthCollection '" << m_detailedTrackTruthName
85 << "' could not be registered in StoreGate !");
86 return StatusCode::SUCCESS;
87 } else {
88 ATH_MSG_DEBUG("DetailedMuonPatternTrackTruthCollection '" << m_detailedTrackTruthName
89 << "' is registered in StoreGate, size=" << dmptc->size());
90 std::cout << "Debug 7.0: DetailedTrackTruthCollection is registered in storegate." << std::endl;
91 }
92
93 return StatusCode::SUCCESS;
94}
95
96//================================================================
97// EOF
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
DataVector< Muon::MuonPatternCombination > MuonPatternCombinationCollection
This typedef represents a collection of MuonPatternCombination objects.
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
MuonPatternCombinationDetailedTrackTruthMaker(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandle< Trk::IDetailedMuonPatternTruthBuilder > m_truthTool
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114