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")
162 for (
const std::string& checkCut : vCuts){
163 if (checkCut.find(
"OmniScore") != std::string::npos) {
164 ATH_MSG_ERROR(
"Misconfig due to OmniIDWP and OmniScore cuts both present in the config file. Please CHECK carefully config file again");
165 return StatusCode::FAILURE;
187 using map_type = std::map<DiTauSelectionCuts, std::unique_ptr<TauAnalysisTools::DiTauSelectionCut>>;
188 using pair_type = map_type::value_type;
190 pair_type elements[] =
192 {
DiTauCutPt, std::make_unique<TauAnalysisTools::DiTauSelectionCutPt>(
this)},
193 {
DiTauCutAbsEta, std::make_unique<TauAnalysisTools::DiTauSelectionCutAbsEta>(
this)},
194 {
DiTauCutNSubjets, std::make_unique<TauAnalysisTools::DiTauSelectionCutNSubjets>(
this)},
195 {
DiTauCutAbsCharge, std::make_unique<TauAnalysisTools::DiTauSelectionCutAbsCharge>(
this)},
196 {
DiTauCutOmniScore, std::make_unique<TauAnalysisTools::DiTauSelectionCutOmniScore>(
this)},
197 {
DiTauCutOmniIDWP, std::make_unique<TauAnalysisTools::DiTauSelectionCutOmniIDWP>(
this)},
200 m_cMap = { std::make_move_iterator( begin(elements) ), std::make_move_iterator( end(elements) ) };
216 std::string sCuts =
"";
229 for (
const auto& entry :
m_cMap ) {
235 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.