ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCombined::SortInDetCandidates Class Reference

#include <SortInDetCandidates.h>

Collaboration diagram for MuonCombined::SortInDetCandidates:

Public Member Functions

bool operator() (const std::pair< const InDetCandidate *, std::vector< const TagBase * > > &c1, const std::pair< const InDetCandidate *, std::vector< const TagBase * > > &c2) const

Detailed Description

Definition at line 17 of file SortInDetCandidates.h.

Member Function Documentation

◆ operator()()

bool MuonCombined::SortInDetCandidates::operator() ( const std::pair< const InDetCandidate *, std::vector< const TagBase * > > & c1,
const std::pair< const InDetCandidate *, std::vector< const TagBase * > > & c2 ) const
inline

Definition at line 19 of file SortInDetCandidates.h.

20 {
21 if (c1.second.empty() || c2.second.empty()) { return c1.second.empty(); }
22
23 const TagBase& t1 = *c1.second.front();
24 const TagBase& t2 = *c2.second.front();
25 // compare based on author/type
26 bool s1 = t1 < t2;
27 bool s2 = t2 < t1;
28 if (s1 && !s2) return true;
29 if (s2 && !s1) return false;
30
31 // if we get here we have the same author and type
32 // this is not too elegant, maybe rethink implementation
33 if (t1.type() == xAOD::Muon::Combined) {
34 // work out type of tag
35 const CombinedFitTag* cbFitTag1 = dynamic_cast<const CombinedFitTag*>(&t1);
36 if (cbFitTag1) {
37 const CombinedFitTag* cbFitTag2 = dynamic_cast<const CombinedFitTag*>(&t2);
38 if (!cbFitTag2) return false;
39 return *cbFitTag1 < *cbFitTag2;
40 }
41 const StacoTag* stacoTag1 = dynamic_cast<const StacoTag*>(&t1);
42 if (stacoTag1) {
43 const StacoTag* stacoTag2 = dynamic_cast<const StacoTag*>(&t2);
44 if (!stacoTag2) return false;
45 return *stacoTag1 < *stacoTag2;
46 }
47 const MuGirlTag* muGirlTag1 = dynamic_cast<const MuGirlTag*>(&t1);
48 if (muGirlTag1) {
49 const MuGirlTag* muGirlTag2 = dynamic_cast<const MuGirlTag*>(&t2);
50 if (!muGirlTag2) return false;
51 return *muGirlTag1 < *muGirlTag2;
52 }
53 return false;
54 } else if (t1.type() == xAOD::Muon::SegmentTagged) {
55 const SegmentTag* segmentTag1 = dynamic_cast<const SegmentTag*>(&t1);
56 if (segmentTag1) {
57 const SegmentTag* segmentTag2 = dynamic_cast<const SegmentTag*>(&t2);
58 if (!segmentTag2) return false;
59 return *segmentTag1 < *segmentTag2;
60 }
61 const MuGirlTag* muGirlTag1 = dynamic_cast<const MuGirlTag*>(&t1);
62 if (muGirlTag1) {
63 const MuGirlTag* muGirlTag2 = dynamic_cast<const MuGirlTag*>(&t2);
64 if (!muGirlTag2) return false;
65 return *muGirlTag1 < *muGirlTag2;
66 }
67 return false;
68 } else if (t1.type() == xAOD::Muon::CaloTagged) {
69 const CaloTag* caloTag1 = dynamic_cast<const CaloTag*>(&t1);
70 if (caloTag1) {
71 const CaloTag* caloTag2 = dynamic_cast<const CaloTag*>(&t2);
72 if (!caloTag2) return false;
73 return *caloTag1 < *caloTag2;
74 }
75 return false;
76 }
77 return false;
78 }
std::vector< ALFA_RawDataContainer_p1 > t2
std::vector< ALFA_RawDataCollection_p1 > t1

The documentation for this class was generated from the following file: