24 return StatusCode::SUCCESS;
38 return StatusCode::SUCCESS;
40 detailed = rh_detailed.
cptr();
52 ATH_CHECK(wh_output.
record(std::unique_ptr<TrackTruthCollection>(out)));
54 return StatusCode::SUCCESS;
62 using Iter = DetailedTrackTruthCollection::const_iterator;
63 Iter itrackData=in->begin();
64 while(itrackData!=in->end()) {
65 std::pair<Iter,Iter> range = in->equal_range(itrackData->first);
68 Iter selected = range.first;
70 ATH_MSG_VERBOSE (
"track=" << selected->first.index() <<
" prob=" << bestProb <<
" link: " << *(selected->second.trajectory().rbegin()));
71 for(Iter imatch = ++range.first; imatch != range.second; ++imatch) {
73 ATH_MSG_VERBOSE (
"track=" << imatch->first.index() <<
" prob=" << prob <<
" link: " << *(imatch->second.trajectory().rbegin()));
84 const HepMcParticleLink& particleLink = *(selected->second.trajectory().rbegin());
86 ATH_MSG_DEBUG (
"Truth selected for track=" << selected->first.index() <<
" prob=" << bestProb <<
" link: " << particleLink);
87 out->insert(std::make_pair(selected->first,
TrackTruth(particleLink, bestProb, 0) ));
88 itrackData=range.second;
96 double prd_track=0, prd_common=0;
101 return (prd_track>0)? prd_common/prd_track : -1.;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
DataLink< TrackCollection > trackCollectionLink() const
a link optimized in size for a GenParticle in a McEventCollection
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
double getProbability(const DetailedTrackTruth &dt) const
DoubleProperty m_weightCSC
SG::WriteHandleKey< TrackTruthCollection > m_outputName
std::vector< double > m_subDetWeights
void fillOutput(TrackTruthCollection *out, const DetailedTrackTruthCollection *in)
SG::ReadHandleKey< DetailedTrackTruthCollection > m_detailedTrackTruthName
virtual StatusCode initialize() override
DoubleProperty m_weightTGC
DoubleProperty m_weightTRT
virtual StatusCode execute() override
TrackTruthSelector(const std::string &name, ISvcLocator *pSvcLocator)
DoubleProperty m_weightMM
DoubleProperty m_weightPixel
DoubleProperty m_weightRPC
DoubleProperty m_weightsTGC
DoubleProperty m_weightSCT
DoubleProperty m_weightMDT
MC particle associated with a reco track + the quality of match.