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_vNSubjetsRegion.empty()) bConfigViaProperties =
true;
55 if (!bConfigViaProperties and !std::isnan(
m_dNSubjetsMin.value())) bConfigViaProperties =
true;
56 if (!bConfigViaProperties and !std::isnan(
m_dNSubjetsMax.value())) bConfigViaProperties =
true;
57 if (!bConfigViaProperties and !
m_vAbsCharges.empty()) bConfigViaProperties =
true;
58 if (!bConfigViaProperties and !std::isnan(
m_iAbsCharge.value())) bConfigViaProperties =
true;
59 if (!bConfigViaProperties and !
m_vOmniScoreRegion.empty()) bConfigViaProperties =
true;
60 if (!bConfigViaProperties and !std::isnan(
m_dOmniScoreMin.value())) bConfigViaProperties =
true;
61 if (!bConfigViaProperties and !std::isnan(
m_dOmniScoreMax.value())) bConfigViaProperties =
true;
62 if (!bConfigViaProperties and
m_iOmniIDWP != 0) bConfigViaProperties =
true;
64 if (bConfigViaConfigFile and bConfigViaProperties)
66 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.");
67 return StatusCode::FAILURE;
70 if (!bConfigViaConfigFile and !bConfigViaProperties)
72 ATH_MSG_WARNING(
"No cut configuration provided, the tool will not do anything. For further details please refer to the documentation:");
73 ATH_MSG_WARNING(
"https://gitlab.cern.ch/atlas/athena/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/doc/README-DiTauSelectionTool.rst");
76 if (bConfigViaConfigFile)
82 ATH_MSG_WARNING(
"Config file for DiTauSelectionTool with path "<<sInputFilePath<<
" does not contain an empty last line. The tool might not be properly configured!");
84 rEnv.ReadFile(sInputFilePath.c_str(),
87 std::vector<std::string> vCuts;
90 if (rEnv.Defined(
"SelectionCuts"))
94 auto lList = rEnv.GetTable();
95 for( Int_t i = 0; i < lList->GetEntries(); ++i )
97 vCuts.push_back( lList->At( i )->GetName() );
101 int iSelectionCuts = 0;
103 for (
const std::string& sCut : vCuts)
105 if (sCut ==
"PtRegion")
111 else if (sCut ==
"PtMin")
115 m_dPtMin = rEnv.GetValue(
"PtMin",NAN);
117 else if (sCut ==
"PtMax")
121 m_dPtMax = rEnv.GetValue(
"PtMax",NAN);
123 else if (sCut ==
"AbsEtaRegion")
129 else if (sCut ==
"AbsEtaMin")
135 else if (sCut ==
"AbsEtaMax")
141 else if (sCut ==
"NSubjetsRegion")
147 else if (sCut ==
"NSubjetsMin")
153 else if (sCut ==
"NSubjetsMax")
159 else if (sCut ==
"AbsCharges")
165 else if (sCut ==
"AbsCharge")
171 else if (sCut ==
"OmniScoreRegion")
180 else if (sCut ==
"OmniScoreMin")
187 for (
const std::string& checkCut : vCuts){
188 if (checkCut.find(
"OmniScoreRegion") != std::string::npos) {
189 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");
190 return StatusCode::FAILURE;
197 else if (sCut ==
"OmniScoreMax")
204 for (
const std::string& checkCut : vCuts){
205 if (checkCut.find(
"OmniScoreRegion") != std::string::npos) {
206 ATH_MSG_ERROR(
"Misconfig due to OmniScoreRegion and OmniScoreMax cuts both present in the config file. Please CHECK carefully config file again and choose of the two");
207 return StatusCode::FAILURE;
214 else if (sCut ==
"OmniIDWP")
221 for (
const std::string& checkCut : vCuts){
222 if (checkCut.find(
"OmniScore") != std::string::npos) {
223 ATH_MSG_ERROR(
"Misconfig due to OmniIDWP and OmniScore cuts both present in the config file. Please CHECK carefully config file again");
224 return StatusCode::FAILURE;
246 using map_type = std::map<DiTauSelectionCuts, std::unique_ptr<TauAnalysisTools::DiTauSelectionCut>>;
247 using pair_type = map_type::value_type;
249 pair_type elements[] =
251 {
DiTauCutPt, std::make_unique<TauAnalysisTools::DiTauSelectionCutPt>(
this)},
252 {
DiTauCutAbsEta, std::make_unique<TauAnalysisTools::DiTauSelectionCutAbsEta>(
this)},
253 {
DiTauCutNSubjets, std::make_unique<TauAnalysisTools::DiTauSelectionCutNSubjets>(
this)},
254 {
DiTauCutAbsCharge, std::make_unique<TauAnalysisTools::DiTauSelectionCutAbsCharge>(
this)},
255 {
DiTauCutOmniScore, std::make_unique<TauAnalysisTools::DiTauSelectionCutOmniScore>(
this)},
256 {
DiTauCutOmniIDWP, std::make_unique<TauAnalysisTools::DiTauSelectionCutOmniIDWP>(
this)},
259 m_cMap = { std::make_move_iterator( begin(elements) ), std::make_move_iterator( end(elements) ) };
275 std::string sCuts =
"";
288 for (
const auto& entry :
m_cMap ) {
294 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.