44 bool bConfigViaProperties =
false;
45 if (!bConfigViaProperties and !std::isnan(
m_dPtMin.value())) bConfigViaProperties =
true;
46 if (!bConfigViaProperties and !
m_vAbsEtaRegion.empty()) bConfigViaProperties =
true;
47 if (!bConfigViaProperties and !std::isnan(
m_dAbsEtaMin.value())) bConfigViaProperties =
true;
48 if (!bConfigViaProperties and !std::isnan(
m_dAbsEtaMax.value())) bConfigViaProperties =
true;
49 if (!bConfigViaProperties and !std::isnan(
m_dNSubjetsMin.value())) bConfigViaProperties =
true;
50 if (!bConfigViaProperties and !
m_vAbsCharges.empty()) bConfigViaProperties =
true;
51 if (!bConfigViaProperties and !std::isnan(
m_iAbsCharge.value())) bConfigViaProperties =
true;
52 if (!bConfigViaProperties and !std::isnan(
m_dOmniScoreMin.value())) bConfigViaProperties =
true;
53 if (!bConfigViaProperties and
m_iOmniIDWP != 0) bConfigViaProperties =
true;
55 if (bConfigViaConfigFile and bConfigViaProperties)
57 ATH_MSG_ERROR(
"Configured tool via setProperty and configuration file, which may lead to unexpected configuration. Please setup the DiTauSelectionTool 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-DiTauSelectionTool.rst or contact the TauCP group.");
58 return StatusCode::FAILURE;
61 if (!bConfigViaConfigFile and !bConfigViaProperties)
63 ATH_MSG_WARNING(
"No cut configuration provided, the tool will not do anything. For further details please refer to the documentation:");
64 ATH_MSG_WARNING(
"https://gitlab.cern.ch/atlas/athena/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/doc/README-DiTauSelectionTool.rst");
67 if (bConfigViaConfigFile)
73 ATH_MSG_WARNING(
"Config file for DiTauSelectionTool with path "<<sInputFilePath<<
" does not contain an empty last line. The tool might not be properly configured!");
75 rEnv.ReadFile(sInputFilePath.c_str(),
78 std::vector<std::string> vCuts;
81 if (rEnv.Defined(
"SelectionCuts"))
85 auto lList = rEnv.GetTable();
86 for( Int_t i = 0; i < lList->GetEntries(); ++i )
88 vCuts.push_back( lList->At( i )->GetName() );
92 int iSelectionCuts = 0;
94 for (
const std::string& sCut : vCuts)
100 m_dPtMin = rEnv.GetValue(
"PtMin",NAN);
102 else if (sCut ==
"AbsEtaRegion")
108 else if (sCut ==
"AbsEtaMin")
114 else if (sCut ==
"AbsEtaMax")
120 else if (sCut ==
"NSubjetsMin")
126 else if (sCut ==
"AbsCharges")
132 else if (sCut ==
"AbsCharge")
138 else if (sCut ==
"OmniScoreMin")
145 for (
const std::string& checkCut : vCuts){
146 if (checkCut.find(
"OmniScoreRegion") != std::string::npos) {
147 ATH_MSG_ERROR(
"Misconfig due to OmniScoreRegion and OmniScoreMin cuts both present in the config file. Please CHECK carefully config file again and choose of the two");
148 return StatusCode::FAILURE;
155 else if (sCut ==
"OmniIDWP")
159 m_sOmniIDWP = rEnv.GetValue(
"OmniIDWP",
"OMNIIDNONE");
163 for (
const std::string& checkCut : vCuts){
164 if (checkCut.find(
"OmniScore") != std::string::npos) {
165 ATH_MSG_ERROR(
"Misconfig due to OmniIDWP and OmniScore cuts both present in the config file. Please CHECK carefully config file again");
166 return StatusCode::FAILURE;
186 using map_type = std::map<DiTauSelectionCuts, std::unique_ptr<TauAnalysisTools::DiTauSelectionCut>>;
187 using pair_type = map_type::value_type;
189 pair_type elements[] =
191 {
DiTauCutPt, std::make_unique<TauAnalysisTools::DiTauSelectionCutPt>(
this)},
192 {
DiTauCutAbsEta, std::make_unique<TauAnalysisTools::DiTauSelectionCutAbsEta>(
this)},
193 {
DiTauCutNSubjets, std::make_unique<TauAnalysisTools::DiTauSelectionCutNSubjets>(
this)},
194 {
DiTauCutAbsCharge, std::make_unique<TauAnalysisTools::DiTauSelectionCutAbsCharge>(
this)},
195 {
DiTauCutOmniScore, std::make_unique<TauAnalysisTools::DiTauSelectionCutOmniScore>(
this)},
196 {
DiTauCutOmniIDWP, std::make_unique<TauAnalysisTools::DiTauSelectionCutOmniIDWP>(
this)},
199 m_cMap = { std::make_move_iterator( begin(elements) ), std::make_move_iterator( end(elements) ) };
215 std::string sCuts =
"";
228 for (
const auto& entry :
m_cMap ) {
234 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.