43 bool bConfigViaProperties =
false;
44 if (!bConfigViaProperties and !std::isnan(
m_dPtMin.value())) bConfigViaProperties =
true;
45 if (!bConfigViaProperties and !
m_vAbsEtaRegion.empty()) bConfigViaProperties =
true;
46 if (!bConfigViaProperties and !std::isnan(
m_dAbsEtaMin.value())) bConfigViaProperties =
true;
47 if (!bConfigViaProperties and !std::isnan(
m_dAbsEtaMax.value())) bConfigViaProperties =
true;
48 if (!bConfigViaProperties and !
m_vAbsCharges.empty()) bConfigViaProperties =
true;
49 if (!bConfigViaProperties and !std::isnan(
m_iAbsCharge.value())) bConfigViaProperties =
true;
50 if (!bConfigViaProperties and !
m_vNTracks.empty()) bConfigViaProperties =
true;
51 if (!bConfigViaProperties and !std::isnan(
m_iNTrack.value())) bConfigViaProperties =
true;
52 if (!bConfigViaProperties and !std::isnan(
m_dJetRNNSigTransMin.value())) bConfigViaProperties =
true;
53 if (!bConfigViaProperties and !std::isnan(
m_dGNTauSigTransMin.value())) bConfigViaProperties =
true;
55 if (!bConfigViaProperties and !std::isnan(
m_dEleRNNSigTransMin.value())) bConfigViaProperties =
true;
56 if (!bConfigViaProperties and
m_iEleIDWP != 0) bConfigViaProperties =
true;
57 if (!bConfigViaProperties and
m_bMuonOLR) bConfigViaProperties =
true;
59 if (bConfigViaConfigFile and bConfigViaProperties)
61 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.");
62 return StatusCode::FAILURE;
64 if (!bConfigViaConfigFile and !bConfigViaProperties)
66 ATH_MSG_WARNING(
"No cut configuration provided, the tool will not do anything. For further details please refer to the documentation:");
67 ATH_MSG_WARNING(
"https://gitlab.cern.ch/atlas/athena/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/doc/README-TauSelectionTool.rst");
68 return StatusCode::SUCCESS;
71 if (bConfigViaConfigFile)
77 ATH_MSG_WARNING(
"Config file for TauSelectionTool with path "<<sInputFilePath<<
" does not contain an empty last line. The tool might not be properly configured!");
79 rEnv.ReadFile(sInputFilePath.c_str(),
82 std::vector<std::string> vCuts;
85 if (rEnv.Defined(
"SelectionCuts"))
89 auto lList = rEnv.GetTable();
90 for( Int_t i = 0; i < lList->GetEntries(); ++i )
92 vCuts.push_back( lList->At( i )->GetName() );
96 int iSelectionCuts = 0;
98 for (
const std::string& sCut : vCuts)
102 iSelectionCuts = iSelectionCuts |
CutPt;
104 m_dPtMin = rEnv.GetValue(
"PtMin",NAN);
106 else if (sCut ==
"AbsEtaRegion")
108 iSelectionCuts = iSelectionCuts |
CutAbsEta;
112 else if (sCut ==
"AbsEtaMin")
114 iSelectionCuts = iSelectionCuts |
CutAbsEta;
118 else if (sCut ==
"AbsEtaMax")
120 iSelectionCuts = iSelectionCuts |
CutAbsEta;
124 else if (sCut ==
"AbsCharges")
130 else if (sCut ==
"AbsCharge")
136 else if (sCut ==
"NTracks")
138 iSelectionCuts = iSelectionCuts |
CutNTrack;
142 else if (sCut ==
"NTrack")
144 iSelectionCuts = iSelectionCuts |
CutNTrack;
148 else if (sCut ==
"JetRNNSigTransMin")
154 else if (sCut ==
"GNTauSigTransMin")
163 else if (sCut ==
"EleRNNSigTransMin")
169 else if (sCut ==
"JetIDWP")
173 m_sJetIDWP = rEnv.GetValue(
"JetIDWP",
"JETIDNONE");
177 for (
const std::string& checkCut : vCuts){
178 if (checkCut.find(
"SigTrans") != std::string::npos) {
179 ATH_MSG_ERROR(
"Misconfig due to JetIDWP and SigTrans cuts both present in the config file. Please CHECK carefully config file again");
180 return StatusCode::FAILURE;
184 else if (sCut ==
"EleIDWP")
188 m_sEleIDWP = rEnv.GetValue(
"EleIDWP",
"ELEIDNONE");
192 else if (sCut ==
"MuonOLR")
206 if(
m_sJetIDWP.find(
"GNTAU") != std::string::npos)
227 using map_type = std::map<SelectionCuts, std::unique_ptr<TauAnalysisTools::TauSelectionCut>>;
228 using pair_type = map_type::value_type;
230 pair_type elements[] =
232 {
CutPt, std::make_unique<TauAnalysisTools::TauSelectionCutPt>(
this)},
233 {
CutAbsEta, std::make_unique<TauAnalysisTools::TauSelectionCutAbsEta>(
this)},
234 {
CutAbsCharge, std::make_unique<TauAnalysisTools::TauSelectionCutAbsCharge>(
this)},
235 {
CutNTrack, std::make_unique<TauAnalysisTools::TauSelectionCutNTracks>(
this)},
237 {
CutGNTauScoreSigTrans, std::make_unique<TauAnalysisTools::TauSelectionCutGNTauScoreSigTrans>(
this)},
238 {
CutJetIDWP, std::make_unique<TauAnalysisTools::TauSelectionCutJetIDWP>(
this)},
240 {
CutEleIDWP, std::make_unique<TauAnalysisTools::TauSelectionCutEleIDWP>(
this)},
241 {
CutMuonOLR, std::make_unique<TauAnalysisTools::TauSelectionCutMuonOLR>(
this)}
244 m_cMap = { std::make_move_iterator( begin(elements) ), std::make_move_iterator( end(elements) ) };
269 std::string sCuts =
"";
286 for (
const auto& entry :
m_cMap ) {
292 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.