ATLAS Offline Software
TGCTrackSelector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 
10 
11 namespace LVL1TGCTrigger {
12 
13 
15  m_numberOfCandidate_In(0),
16  m_numberOfCandidate_Out(0),
17  m_sectorLogic(sL) {
18  for(int i_track=0; i_track!=MaxNumber_of_TrackCandidate_in; i_track++){
19  m_trackPriorityRank[i_track] = 0;
20  }
21 }
22 
24 {
25 }
26 
27 
31 
32  for(int i_track=0;i_track!=MaxNumber_of_TrackCandidate_in;i_track++){
33  m_trackPriorityRank[i_track]=0;
34  }
35 }
36 
37 
39  if(rPhiOut!=0){
40  if(rPhiOut->getpT()!=0){
43  }
44  }
45 }
46 
47 
48 bool TGCTrackSelector::select(std::shared_ptr<TGCTrackSelectorOut> TrackcandidateOut){
49 
50  if(m_numberOfCandidate_In==0){return false;}
51 
52 
56  for(int track1=0;track1!=m_numberOfCandidate_In-1 && m_numberOfCandidate_In!=0;track1++){
57  for(int track2=track1+1;track2!=m_numberOfCandidate_In;track2++){
58  bool compare_result=compare(m_coincidenceIn[track1].get(),m_coincidenceIn[track2].get()); //1>2 true:1 1<2 false:0
59 
60  //TrackPriorityRank : Smaller value is high priority.
61  m_trackPriorityRank[track1]+=(int)!compare_result;
62  m_trackPriorityRank[track2]+=(int)compare_result;
63  }
64  }
65 
70  if(m_trackPriorityRank[track]<=3){
71 
72  int R= 2*m_coincidenceIn[track]->getIdSSC()+m_coincidenceIn[track]->getR() - (m_sectorLogic->getRegion()==TGCRegionType::ENDCAP ? 1 : 0);
73  TrackcandidateOut->setR(m_numberOfCandidate_Out,R);
74  TrackcandidateOut->setPhi(m_numberOfCandidate_Out,m_coincidenceIn[track]->getPhi());
75  TrackcandidateOut->setPtLevel(m_numberOfCandidate_Out,m_coincidenceIn[track]->getpT());
76  TrackcandidateOut->setDR(m_numberOfCandidate_Out,2*m_coincidenceIn[track]->getDR());
77  TrackcandidateOut->setDPhi(m_numberOfCandidate_Out,m_coincidenceIn[track]->getDPhi());
78  TrackcandidateOut->setInnerVeto(m_numberOfCandidate_Out,m_coincidenceIn[track]->getInnerVeto());
79  TrackcandidateOut->setCharge(m_numberOfCandidate_Out,m_coincidenceIn[track]->getCharge());
80  TrackcandidateOut->setCoincidenceType(m_numberOfCandidate_Out,m_coincidenceIn[track]->getCoincidenceType());
81  TrackcandidateOut->setGoodMFFlag(m_numberOfCandidate_Out,m_coincidenceIn[track]->getGoodMFFlag());
82  TrackcandidateOut->setInnerCoincidenceFlag(m_numberOfCandidate_Out,m_coincidenceIn[track]->getInnerCoincidenceFlag());
84  }
85  }
86 
87  reset();
88 
89  return true;
90 }
91 
93  // The definition of priority is not fixed. This function wiil be updated.
94  if(track1->getpT() > track2->getpT()){return true;}
95  if(track1->getpT() < track2->getpT()){return false;}
96  else{
97  // when the pt level of 2 tracks are same, track with large R is selected.
98  if(track1->getIdSSC()<track2->getIdSSC()){return true;}
99  if(track1->getIdSSC()>track2->getIdSSC()){return false;}
100  }
101  return true;
102 }
103 
104 
105 } // end of namespace
LVL1TGCTrigger::TGCRegionType::ENDCAP
@ ENDCAP
LVL1TGCTrigger::TGCSectorLogic::getRegion
TGCRegionType getRegion() const
Definition: TGCSectorLogic.h:62
LVL1TGCTrigger::TGCTrackSelector::select
bool select(std::shared_ptr< TGCTrackSelectorOut > TrackcandidateOut)
Definition: TGCTrackSelector.cxx:48
LVL1TGCTrigger::TGCTrackSelector::compare
bool compare(TGCRPhiCoincidenceOut *track1, TGCRPhiCoincidenceOut *track2)
Definition: TGCTrackSelector.cxx:92
LVL1TGCTrigger::TGCTrackSelector::m_sectorLogic
const TGCSectorLogic * m_sectorLogic
Definition: TGCTrackSelector.h:40
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
LVL1TGCTrigger::TGCTrackSelector::m_numberOfCandidate_In
int m_numberOfCandidate_In
Definition: TGCTrackSelector.h:37
IDTPM::getPhi
float getPhi(const xAOD::TrackParticle &p)
Accessor utility function for getting the value of phi.
Definition: TrackParametersHelper.h:53
LVL1TGCTrigger::TGCTrackSelector::m_numberOfCandidate_Out
int m_numberOfCandidate_Out
Definition: TGCTrackSelector.h:38
LVL1TGCTrigger::TGCTrackSelector::m_coincidenceIn
std::unique_ptr< TGCRPhiCoincidenceOut > m_coincidenceIn[MaxNumber_of_TrackCandidate_in]
Definition: TGCTrackSelector.h:33
LVL1TGCTrigger::TGCTrackSelector::reset
void reset()
Definition: TGCTrackSelector.cxx:28
TGCTrackSelector.h
LVL1TGCTrigger::TGCTrackSelector::input
void input(TGCRPhiCoincidenceOut *rPhiOut)
Definition: TGCTrackSelector.cxx:38
LVL1TGCTrigger::TGCTrackSelector::~TGCTrackSelector
~TGCTrackSelector()
Definition: TGCTrackSelector.cxx:23
LVL1TGCTrigger::TGCRPhiCoincidenceOut::getIdSSC
int getIdSSC() const
Definition: TGCRPhiCoincidenceOut.h:18
LVL1TGCTrigger::TGCTrackSelector::TGCTrackSelector
TGCTrackSelector(const TGCSectorLogic *sL=0)
Definition: TGCTrackSelector.cxx:14
TGCSectorLogic.h
LVL1TGCTrigger::TGCRPhiCoincidenceOut
Definition: TGCRPhiCoincidenceOut.h:11
LVL1TGCTrigger::TGCTrackSelector::MaxNumber_of_TrackCandidate_in
@ MaxNumber_of_TrackCandidate_in
Definition: TGCTrackSelector.h:27
LVL1TGCTrigger
Definition: LVL1TGCTrigger.cxx:47
LVL1TGCTrigger::TGCRPhiCoincidenceOut::getpT
int getpT() const
Definition: TGCRPhiCoincidenceOut.h:28
LVL1TGCTrigger::TGCSectorLogic
Definition: TGCSectorLogic.h:42
LVL1TGCTrigger::TGCTrackSelector::m_trackPriorityRank
int m_trackPriorityRank[MaxNumber_of_TrackCandidate_in]
Definition: TGCTrackSelector.h:34
TGCRPhiCoincidenceOut.h
TGCTrackSelectorOut.h
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
xAOD::track
@ track
Definition: TrackingPrimitives.h:512