ATLAS Offline Software
Loading...
Searching...
No Matches
Tool_TauConstituentSelector.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
7
11
12
14
15
17
18 ATH_MSG_INFO(" initialize()");
19 m_init=true;
20
23
24 ATH_CHECK( m_Tool_InformationStore->getInfo_Double("TauConstituents_MaxEta", m_MaxEta) );
25
26 //eta bin edges
27 ATH_CHECK( m_Tool_InformationStore->getInfo_VecDouble("Common_BinEdges_Eta", m_BinEdges_Eta) );
28
29 //et cuts for types used in mode reco
30 ATH_CHECK( m_Tool_InformationStore->getInfo_VecDouble("TauConstituents_Selection_Neutral_EtaBinned_EtCut", m_Selection_Neutral_EtaBinned_EtCut) );
31
32 return StatusCode::SUCCESS;
33}
34
35
37
38 for (unsigned int iEtaBin=0; iEtaBin<m_BinEdges_Eta.size()-1; iEtaBin++) {
39 if (m_BinEdges_Eta[iEtaBin] <= eta && eta < m_BinEdges_Eta[iEtaBin+1]) {
40 switch(constituentType) {
42 default:
43 return 9999999.;
44 }
45 }
46 }
47
48 ATH_MSG_WARNING("Eta value of " << eta << " could not be matched to any eta bin!");
49 return 9999999.;
50}
51
52
57StatusCode PanTau::Tool_TauConstituentSelector::SelectTauConstituents(const std::vector<TauConstituent*>& inputList,
58 std::vector<TauConstituent*>& outputList) const {
59
60 for (unsigned int iConst=0; iConst<inputList.size(); iConst++) {
61
62 PanTau::TauConstituent* curConstituent = inputList[iConst];
63
64 //general preselection:
65 double curEta = std::abs( curConstituent->p4().Eta() );
66 if (curEta > m_MaxEta) {
67 ATH_MSG_DEBUG("\tNot using constituent with eta of " << curEta);
68 continue;
69 }
70
71 bool passesSelection = false;
72
73 // check if constituent is charged:
74 if (curConstituent->isOfType(PanTau::TauConstituent::t_Charged)) {
75 // we want to use all tracks
76 passesSelection = true;
77
78 // check if constituent is neutral, assign correctly pi0neut and neut flags:
79 } else if (curConstituent->isOfType(PanTau::TauConstituent::t_Neutral)) {
80 passesSelection = passesSelection_NeutralConstituent(curConstituent);
81
82 //special treatment for the testing neutral flags
83 if (!passesSelection) {
86 }
87 } else {
88 ATH_MSG_DEBUG("Unhandled constituent type (" << curConstituent->getTypeNameString()
89 << ") when trying to apply constituent selection - constituent will not be selected!");
90 passesSelection = false;
91 }
92
93 if (!passesSelection) continue;
94
95 outputList.push_back(inputList[iConst]);
96 }
97
98 return StatusCode::SUCCESS;
99}
100
101
103
104 TLorentzVector tlv_Constituent = tauConstituent->p4();
105
106 if (tlv_Constituent.Et() < getEtCut(std::abs(tlv_Constituent.Eta()), PanTau::TauConstituent::t_Neutral)) {
107 ATH_MSG_DEBUG("\tNot using constituent at eta " << tlv_Constituent.Eta() << " with et of " << tlv_Constituent.Et());
108 return false;
109 }
110
111 return true;
112}
113
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static StatusCode bindToolHandle(ToolHandle< T > &, std::string)
Input object for PanTau.
virtual FourMom_t p4() const
The full 4-momentum of the particle as a TLorentzVector.
std::string getTypeNameString() const
bool isOfType(TauConstituent::Type aType) const
Type
Type enumeration to specify type of this tau constituent.
void removeTypeFlag(TauConstituent::Type aType)
Gaudi::Property< std::string > m_Tool_InformationStoreName
virtual double getEtCut(double eta, PanTau::TauConstituent::Type constituentType) const
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
virtual StatusCode SelectTauConstituents(const std::vector< TauConstituent * > &inputList, std::vector< TauConstituent * > &outputList) const
Function to further select PFOs of the various categories (basically apply additional ET cuts):
virtual bool passesSelection_NeutralConstituent(TauConstituent *tauConstituent) const
ToolHandle< PanTau::ITool_InformationStore > m_Tool_InformationStore
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58