ATLAS Offline Software
IdentifierByDetElSorter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONIDHELPERS_IDENTIFIERBYDETELSORTER_H
5 #define MUONIDHELPERS_IDENTIFIERBYDETELSORTER_H
6 
8 
12 namespace Muon{
14  template <typename T> concept hasIdentifyConcept = requires (const T theObj){
15  theObj.identify();
16  };
18  public:
20  m_idHelperSvc{idHelperSvc}{}
21 
22  bool operator() (const Identifier& a, const Identifier& b) const{
23  const Identifier detA = m_idHelperSvc->detElId(a);
24  const Identifier detB = m_idHelperSvc->detElId(b);
25  if (detA != detB){
26  return detA < detB;
27  }
28  return a < b;
29  }
30  template <typename T>
31  bool operator () (const T* a, const T* b) const requires hasIdentifyConcept<T> {
32  return (*this)(a->identify(), b->identify());
33  }
34 
35  template <typename T>
36  bool operator () (const T& a, const T&b) const requires hasIdentifyConcept<T> {
37  return (*this)(a.identify(), b.identify());
38  }
39 
40  private:
42 
43  };
44 }
45 
46 #endif
47 
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::IdentifierByDetElSorter::IdentifierByDetElSorter
IdentifierByDetElSorter(const Muon::IMuonIdHelperSvc *idHelperSvc)
Definition: IdentifierByDetElSorter.h:19
Muon::IdentifierByDetElSorter::operator()
bool operator()(const Identifier &a, const Identifier &b) const
Definition: IdentifierByDetElSorter.h:22
Muon::hasIdentifyConcept
concept hasIdentifyConcept
Define the concept that the object needs to have an Identifier method
Definition: IdentifierByDetElSorter.h:14
Muon::IMuonIdHelperSvc::detElId
virtual Identifier detElId(const Identifier &id) const =0
create a detector element ID
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:26
Muon::IdentifierByDetElSorter
Definition: IdentifierByDetElSorter.h:17
Muon::IdentifierByDetElSorter::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: IdentifierByDetElSorter.h:41
IMuonIdHelperSvc.h
Identifier
Definition: IdentifierFieldParser.cxx:14