44 bool bConfigViaProperties =
false;
45 if (!bConfigViaProperties and !
m_vPtRegion.empty()) bConfigViaProperties =
true;
46 if (!bConfigViaProperties and !std::isnan(
m_dPtMin.value())) bConfigViaProperties =
true;
47 if (!bConfigViaProperties and !std::isnan(
m_dPtMax.value())) bConfigViaProperties =
true;
48 if (!bConfigViaProperties and !
m_vAbsEtaRegion.empty()) bConfigViaProperties =
true;
49 if (!bConfigViaProperties and !std::isnan(
m_dAbsEtaMin.value())) bConfigViaProperties =
true;
50 if (!bConfigViaProperties and !std::isnan(
m_dAbsEtaMax.value())) bConfigViaProperties =
true;
51 if (!bConfigViaProperties and !
m_vAbsCharges.empty()) bConfigViaProperties =
true;
52 if (!bConfigViaProperties and !std::isnan(
m_iAbsCharge.value())) bConfigViaProperties =
true;
53 if (!bConfigViaProperties and !
m_vNTracks.empty()) bConfigViaProperties =
true;
54 if (!bConfigViaProperties and !std::isnan(
m_iNTrack.value())) bConfigViaProperties =
true;
55 if (!bConfigViaProperties and !std::isnan(
m_dJetRNNSigTransMin.value())) bConfigViaProperties =
true;
56 if (!bConfigViaProperties and !std::isnan(
m_dGNTauSigTransMin.value())) bConfigViaProperties =
true;
58 if (!bConfigViaProperties and !std::isnan(
m_dEleRNNSigTransMin.value())) bConfigViaProperties =
true;
59 if (!bConfigViaProperties and
m_iEleIDWP != 0) bConfigViaProperties =
true;
60 if (!bConfigViaProperties and
m_bMuonOLR) bConfigViaProperties =
true;
62 if (bConfigViaConfigFile and bConfigViaProperties)
64 ATH_MSG_ERROR(
"Configured tool via setProperty and configuration file, which may lead to unexpected configuration. Please setup the TauSelectionTool using only one of the two methods. For further details please refer to the documentation https://gitlab.cern.ch/atlas/athena/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/doc/README-TauSelectionTool.rst or contact the TauCP group.");
65 return StatusCode::FAILURE;
67 if (!bConfigViaConfigFile and !bConfigViaProperties)
69 ATH_MSG_WARNING(
"No cut configuration provided, the tool will not do anything. For further details please refer to the documentation:");
70 ATH_MSG_WARNING(
"https://gitlab.cern.ch/atlas/athena/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/doc/README-TauSelectionTool.rst");
71 return StatusCode::SUCCESS;
74 if (bConfigViaConfigFile)
80 ATH_MSG_WARNING(
"Config file for TauSelectionTool with path "<<sInputFilePath<<
" does not contain an empty last line. The tool might not be properly configured!");
82 rEnv.ReadFile(sInputFilePath.c_str(),
85 std::vector<std::string> vCuts;
88 if (rEnv.Defined(
"SelectionCuts"))
92 auto lList = rEnv.GetTable();
93 for( Int_t i = 0; i < lList->GetEntries(); ++i )
95 vCuts.push_back( lList->At( i )->GetName() );
99 int iSelectionCuts = 0;
101 for (
const std::string& sCut : vCuts)
103 if (sCut ==
"PtRegion")
105 iSelectionCuts = iSelectionCuts |
CutPt;
109 else if (sCut ==
"PtMin")
111 iSelectionCuts = iSelectionCuts |
CutPt;
113 m_dPtMin = rEnv.GetValue(
"PtMin",NAN);
115 else if (sCut ==
"PtMax")
117 iSelectionCuts = iSelectionCuts |
CutPt;
119 m_dPtMax = rEnv.GetValue(
"PtMax",NAN);
121 else if (sCut ==
"AbsEtaRegion")
123 iSelectionCuts = iSelectionCuts |
CutAbsEta;
127 else if (sCut ==
"AbsEtaMin")
129 iSelectionCuts = iSelectionCuts |
CutAbsEta;
133 else if (sCut ==
"AbsEtaMax")
135 iSelectionCuts = iSelectionCuts |
CutAbsEta;
139 else if (sCut ==
"AbsCharges")
145 else if (sCut ==
"AbsCharge")
151 else if (sCut ==
"NTracks")
153 iSelectionCuts = iSelectionCuts |
CutNTrack;
157 else if (sCut ==
"NTrack")
159 iSelectionCuts = iSelectionCuts |
CutNTrack;
163 else if (sCut ==
"JetRNNSigTransMin")
169 else if (sCut ==
"GNTauSigTransMin")
178 else if (sCut ==
"EleRNNSigTransMin")
184 else if (sCut ==
"JetIDWP")
188 m_sJetIDWP = rEnv.GetValue(
"JetIDWP",
"JETIDNONE");
192 for (
const std::string& checkCut : vCuts){
193 if (checkCut.find(
"SigTrans") != std::string::npos) {
194 ATH_MSG_ERROR(
"Misconfig due to JetIDWP and SigTrans cuts both present in the config file. Please CHECK carefully config file again");
195 return StatusCode::FAILURE;
199 else if (sCut ==
"EleIDWP")
203 m_sEleIDWP = rEnv.GetValue(
"EleIDWP",
"ELEIDNONE");
207 else if (sCut ==
"MuonOLR")
221 if(
m_sJetIDWP.find(
"GNTAU") != std::string::npos)
242 using map_type = std::map<SelectionCuts, std::unique_ptr<TauAnalysisTools::TauSelectionCut>>;
243 using pair_type = map_type::value_type;
245 pair_type elements[] =
247 {
CutPt, std::make_unique<TauAnalysisTools::TauSelectionCutPt>(
this)},
248 {
CutAbsEta, std::make_unique<TauAnalysisTools::TauSelectionCutAbsEta>(
this)},
249 {
CutAbsCharge, std::make_unique<TauAnalysisTools::TauSelectionCutAbsCharge>(
this)},
250 {
CutNTrack, std::make_unique<TauAnalysisTools::TauSelectionCutNTracks>(
this)},
252 {
CutGNTauScoreSigTrans, std::make_unique<TauAnalysisTools::TauSelectionCutGNTauScoreSigTrans>(
this)},
253 {
CutJetIDWP, std::make_unique<TauAnalysisTools::TauSelectionCutJetIDWP>(
this)},
255 {
CutEleIDWP, std::make_unique<TauAnalysisTools::TauSelectionCutEleIDWP>(
this)},
256 {
CutMuonOLR, std::make_unique<TauAnalysisTools::TauSelectionCutMuonOLR>(
this)}
259 m_cMap = { std::make_move_iterator( begin(elements) ), std::make_move_iterator( end(elements) ) };
284 std::string sCuts =
"";
301 for (
const auto& entry :
m_cMap ) {
307 return StatusCode::SUCCESS;
Class providing the definition of the 4-vector interface.
virtual Type::ObjectType type() const =0
The type of the object as a simple enumeration.