47 bool bConfigViaProperties =
false;
48 if (!bConfigViaProperties and !
m_vPtRegion.empty()) bConfigViaProperties =
true;
49 if (!bConfigViaProperties and !std::isnan(
m_dPtMin.value())) bConfigViaProperties =
true;
50 if (!bConfigViaProperties and !std::isnan(
m_dPtMax.value())) bConfigViaProperties =
true;
51 if (!bConfigViaProperties and !
m_vAbsEtaRegion.empty()) bConfigViaProperties =
true;
52 if (!bConfigViaProperties and !std::isnan(
m_dAbsEtaMin.value())) bConfigViaProperties =
true;
53 if (!bConfigViaProperties and !std::isnan(
m_dAbsEtaMax.value())) bConfigViaProperties =
true;
54 if (!bConfigViaProperties and !
m_vAbsCharges.empty()) bConfigViaProperties =
true;
55 if (!bConfigViaProperties and !std::isnan(
m_iAbsCharge.value())) bConfigViaProperties =
true;
56 if (!bConfigViaProperties and !
m_vNTracks.empty()) bConfigViaProperties =
true;
57 if (!bConfigViaProperties and !std::isnan(
m_iNTrack.value())) bConfigViaProperties =
true;
59 if (!bConfigViaProperties and !std::isnan(
m_dJetRNNSigTransMin.value())) bConfigViaProperties =
true;
60 if (!bConfigViaProperties and !std::isnan(
m_dJetRNNSigTransMax.value())) bConfigViaProperties =
true;
62 if (!bConfigViaProperties and !std::isnan(
m_dGNTauSigTransMin.value())) bConfigViaProperties =
true;
63 if (!bConfigViaProperties and !std::isnan(
m_dGNTauSigTransMax.value())) bConfigViaProperties =
true;
66 if (!bConfigViaProperties and !std::isnan(
m_dEleRNNSigTransMin.value())) bConfigViaProperties =
true;
67 if (!bConfigViaProperties and !std::isnan(
m_dEleRNNSigTransMax.value())) bConfigViaProperties =
true;
68 if (!bConfigViaProperties and
m_iEleIDWP != 0) bConfigViaProperties =
true;
69 if (!bConfigViaProperties and
m_bMuonOLR) bConfigViaProperties =
true;
71 if (bConfigViaConfigFile and bConfigViaProperties)
73 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.");
74 return StatusCode::FAILURE;
76 if (!bConfigViaConfigFile and !bConfigViaProperties)
78 ATH_MSG_WARNING(
"No cut configuration provided, the tool will not do anything. For further details please refer to the documentation:");
79 ATH_MSG_WARNING(
"https://gitlab.cern.ch/atlas/athena/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/doc/README-TauSelectionTool.rst");
80 return StatusCode::SUCCESS;
83 if (bConfigViaConfigFile)
89 ATH_MSG_WARNING(
"Config file for TauSelectionTool with path "<<sInputFilePath<<
" does not contain an empty last line. The tool might not be properly configured!");
91 rEnv.ReadFile(sInputFilePath.c_str(),
94 std::vector<std::string> vCuts;
97 if (rEnv.Defined(
"SelectionCuts"))
101 auto lList = rEnv.GetTable();
102 for( Int_t i = 0; i < lList->GetEntries(); ++i )
104 vCuts.push_back( lList->At( i )->GetName() );
108 int iSelectionCuts = 0;
110 for (
const std::string& sCut : vCuts)
112 if (sCut ==
"PtRegion")
114 iSelectionCuts = iSelectionCuts |
CutPt;
118 else if (sCut ==
"PtMin")
120 iSelectionCuts = iSelectionCuts |
CutPt;
122 m_dPtMin = rEnv.GetValue(
"PtMin",NAN);
124 else if (sCut ==
"PtMax")
126 iSelectionCuts = iSelectionCuts |
CutPt;
128 m_dPtMax = rEnv.GetValue(
"PtMax",NAN);
130 else if (sCut ==
"AbsEtaRegion")
132 iSelectionCuts = iSelectionCuts |
CutAbsEta;
136 else if (sCut ==
"AbsEtaMin")
138 iSelectionCuts = iSelectionCuts |
CutAbsEta;
142 else if (sCut ==
"AbsEtaMax")
144 iSelectionCuts = iSelectionCuts |
CutAbsEta;
148 else if (sCut ==
"AbsCharges")
154 else if (sCut ==
"AbsCharge")
160 else if (sCut ==
"NTracks")
162 iSelectionCuts = iSelectionCuts |
CutNTrack;
166 else if (sCut ==
"NTrack")
168 iSelectionCuts = iSelectionCuts |
CutNTrack;
172 else if (sCut ==
"JetRNNSigTransRegion")
178 else if (sCut ==
"JetRNNSigTransMin")
184 else if (sCut ==
"JetRNNSigTransMax")
190 else if (sCut ==
"GNTauSigTransRegion")
199 else if (sCut ==
"GNTauSigTransMin")
208 else if (sCut ==
"GNTauSigTransMax")
217 else if (sCut ==
"EleRNNSigTransRegion")
223 else if (sCut ==
"EleRNNSigTransMin")
229 else if (sCut ==
"EleRNNSigTransMax")
235 else if (sCut ==
"JetIDWP")
242 for (
const std::string& checkCut : vCuts){
243 if (checkCut.find(
"SigTrans") != std::string::npos) {
244 ATH_MSG_ERROR(
"Misconfig due to JetIDWP and SigTrans cuts both present in the config file. Please CHECK carefully config file again");
245 return StatusCode::FAILURE;
249 else if (sCut ==
"EleIDWP")
255 else if (sCut ==
"MuonOLR")
272 if(
m_sJetIDWP.find(
"GNTAU") != std::string::npos)
293 using map_type = std::map<SelectionCuts, std::unique_ptr<TauAnalysisTools::TauSelectionCut>>;
294 using pair_type = map_type::value_type;
296 pair_type elements[] =
298 {
CutPt, std::make_unique<TauAnalysisTools::TauSelectionCutPt>(
this)},
299 {
CutAbsEta, std::make_unique<TauAnalysisTools::TauSelectionCutAbsEta>(
this)},
300 {
CutAbsCharge, std::make_unique<TauAnalysisTools::TauSelectionCutAbsCharge>(
this)},
301 {
CutNTrack, std::make_unique<TauAnalysisTools::TauSelectionCutNTracks>(
this)},
303 {
CutGNTauScoreSigTrans, std::make_unique<TauAnalysisTools::TauSelectionCutGNTauScoreSigTrans>(
this)},
304 {
CutJetIDWP, std::make_unique<TauAnalysisTools::TauSelectionCutJetIDWP>(
this)},
306 {
CutEleIDWP, std::make_unique<TauAnalysisTools::TauSelectionCutEleIDWP>(
this)},
307 {
CutMuonOLR, std::make_unique<TauAnalysisTools::TauSelectionCutMuonOLR>(
this)}
310 m_cMap = { std::make_move_iterator( begin(elements) ), std::make_move_iterator( end(elements) ) };
335 std::string sCuts =
"";
352 for (
const auto& entry :
m_cMap ) {
358 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.