diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/C++/ConfigToCode.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/C++/ConfigToCode.tex new file mode 100644 index 0000000000000000000000000000000000000000..6f589dbf6fd7b1411073cb66ff71b1f8c1d85ed7 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/C++/ConfigToCode.tex @@ -0,0 +1,456 @@ +\documentclass{beamer} + +% \usepackage{beamerthemesplit} // Activate for custom appearance + +\title{The Trigger Jet Hypo - Concept and C++ Implmentation} +\author{P Sherwood} +\date{05 November 2020} + +\addtobeamertemplate{navigation symbols}{}{% + \usebeamerfont{footline}% + \usebeamercolor[fg]{footline}% + \hspace{1em}% + \insertframenumber/\inserttotalframenumber +} +\usepackage{xcolor} +\usepackage{caption} +\usepackage{subcaption} + + +\begin{document} + +\frame{\titlepage} +% \begin{frame} +% \frametitle{Outline} +% \begin{quotation} +% My mind is clearer now - at last all too well I can see where we all soon will be +% \end{quotation} +% \tableofcontents[pausesections] +%\end{frame} + + + +%\subsection {Tree Structures} +%\subsection{HypoTrees} +%\subsection{ConditionTrees} +%\subsection{Dynamic Programming} + +%\part{The Jet Hypo as a Tree} +%\frame{\partpage +% +%%{ +% \frametitle{Part 1: Fast Reduction Generalities} +% } +%} + +\frame +{ + \frametitle{Past and Present} + +\begin{block}{History} +\begin{description} +\item[Run 1] Write an Athena Component (then Algorithm, now AlgTool) for each new idea. +\item[Run 2] Bipartite Graph of jets and Conditions. Solve with Ford-Fulkerson Alfgorithm +\item[Long Shutdown] AlgTool trees. +\item[Current] FastReduction +\end{description} +\end{block} + +\begin{block}{Goal} +We wish to provide a framework that allows all hypos (current and as yet unthought of) to +be handled in a common way. +\end{block} + } + +\frame{ +\frametitle{FastReduction - Building blocks.} + +\begin{block}{Elements} +\begin{description} +\item[Jet Group] a vector of (not necessarily xAOD) jets objects. +\item [Condition] an object that tests whether a jet group passes some conditions +\end{description} +\end{block} + +\begin{block}{Trees - A Hierarchical Structure of Conditions} +\begin{itemize} +\item nodes represent Condition objects +\item child nodes represent "earlier" conditions. +\item There is a single root node. +\end{itemize} +\end{block} + +} + +\frame{ +\frametitle{Very Simple Examples} + +\begin{minipage}[T]{0.68\linewidth} +\begin{block}{Single Condition Chain (eg j60)} +Any jet with $E_t > 60$ is passed to . +\end{block} + +\end{minipage}%\hfill +\begin{minipage}[T]{0.28\linewidth} + +%\includegraphics[trim = 10mm 0mm 10mm 10mm, clip,width=.9\textwidth, scale = 0.1]{Pictures/conditionsTree_1} +\includegraphics[trim = 10mm 0mm 10mm 10mm, clip, scale = 0.5]{Pictures/conditionsTree_1} +\end{minipage} + +\begin{minipage}[T]{0.68\linewidth} +\begin{block}{Two Condition Chain (eg j80\_j60)} + +\begin{description} +\item[ $E_t(j1)= 70, E_t(j2) = 70$] Fails +\item[ $E_t(j1)= 90, E_t(j2) = 70$] (j1, j2) passed to root +\item[ $E_t(j1)= 90, E_t(j2) = 90$] (j1, j2), (j2, j1) passed to root +\end{description} + + +\end{block} + +\end{minipage}%\hfill +\begin{minipage}[T]{0.28\linewidth} + +\includegraphics[trim = 10mm 0mm 10mm 10mm, clip,scale=0.5]{Pictures/conditionsTree_2} +\end{minipage} +} + +\frame +{ + \frametitle{What are the actions of the jet hypo?} + \begin{block}{} + \begin{enumerate} +\item read in the reconstructed jet container +\item split the container of $n$ jets into $n$ containers of 1 jet +\item present the single jets to conditions at the bottom of the tree +\item event fails if there is an unsatisfied Condition. +\item combine the jets passing these single jet cuts into {\it new} jet groups. Groups with duplicate jets rejected. +\item pass the combined job groups to the parent +\item repeat the procedure. If the root node is reached by some job~group, the hypo passes, otherwise it fails. +\item report any jet that participates in any jet group that reaches the root node to the Trigger framework (for BJets..) +\end{enumerate} +\end{block} +} + + +\frame +{ +\frametitle{Determining node processing order} + +\begin{minipage}[T]{0.58\linewidth} +\begin{block}{Need for node scheduling} +All sibling nodes must be processed before their parents. Siblings are equidistant from root, but varying distance from +their descendant leaf nodes. Use a \alert{priority queue} with highest priority given to the deepest nodes +\end{block} + +\begin{block}{What is a priority queue?} +Queue - like but highest priority out first. +STL provides an implementation. +\end{block} +\begin{block}{Initialize with leaf nodes} +Nodes 8-14 processed before 3. +\end{block} + +\end{minipage}%\hfill +\begin{minipage}[T]{0.38\linewidth} + +\includegraphics[trim = 10mm 0mm 10mm 10mm, clip,width=.9\textwidth]{Pictures/conditionsTree} +\end{minipage} +% +%\begin{block}{What is a priority queue?} +%\end{block} +% +%\begin{block}{Why use a priority queue?} +%\end{block} +} + + + \frame +{ +\frametitle{Data Structures and Growth} +\begin{block}{Indexed Objects} +The algorithm keeps track of indices assigned to Condtion objects and jet groups. Propagation deals with indices. Satisfaction +is tested using Jet Group and Condition objects +\end{block} + +\begin{block}{Data Structures} +\begin{itemize} +\item index to Condition look-up table. Fixed +\item index to Jet group look-up table. \alert{Grows} +\item parent Condition Vector. Used to determine Condition parent and siblings +\item Condition to satisfying job group indices (index $\rightarrow$ [indices])/ \alert{Grows} +\item jobGroup index to elemental (incoming) jet groups. Convenience structure to quickly obtain jets for a combined jet group. \alert{Grows} +\end{itemize} + +\end{block} + +} + + +\begin{frame}[fragile=singleslide] +\frametitle{Fast Reduction - DAta Structures} + + +\begin{minipage}[t]{0.48\linewidth} +\begin{block}{Tree: node representaton} +\includegraphics[trim = 10mm 0mm 10mm 10mm, clip, scale=0.15]{Pictures/conditionsTree} +\end{block} +%\begin{block}{Chain Label} +% +%\begin{tiny} +%partgen([] partgen([] simple([(neta, 84et)(peta, 84et)]))\\ +% combgen([]qjet([(170qjmass190)])\\ +% partgen([]\\ +% combgen([] \\ +% dijet([(70djmass90)])\\ +% simple([(10et)(11et)]))\\ +% combgen([] \\ +% dijet([(71djmass91)])\\ +% simple([(12et)(13et)])))))\\ +% +%\end{tiny} +%\end{block} +\end{minipage}\hfill +\begin{minipage}[t]{0.48\linewidth} +\begin{block}{Tree: Conditions Parent Table representation} +\begin{center} +\begin{tiny} +[0 0 1 \alert{2} \alert{2} 0 5 6 7 \alert{8} \alert{8} 6 11 \alert{12} \alert{12} ] + +Leaf nodes in \alert{red} + +\end{tiny} +\end{center} +\end{block} +\end{minipage} +\begin{minipage}[t]{0.38\linewidth} +\begin{block}{satisfiedBy} +\begin{center} +\begin{tiny} +\begin{tabular}{r|l} +Cond indx& jet groups indices\\ \hline +0: & [] \\ +1: & [] \\ +2: & [] \\ +3: & [] \\ +4: & [] \\ +5: & [] \\ +6: & [] \\ +7: & [] \\ +8: & [] \\ +9: & [] \\ +10:& [] \\ +11:& [] \\ +12:& [] \\ +13:& [] \\ +14:& [] \\ +\end{tabular} +\end{tiny} +\end{center} +\end{block} +\end{minipage}\hfill +\begin{minipage}[t]{0.58\linewidth} +\begin{block}{Conditions Table} +\begin{tiny} +\begin{tabular}{ll} + 0: & AcceptAllConditionMT\\ + 1: & AcceptAllConditionMT\\ + 2: & AcceptAllConditionMT\\ + 3: & EtConditionMT 84000 \\ + & EtaConditionSignedMT etaMin -3.2 etaMax 0 \\ + 4: & EtConditionMT Et threshold: 84000 \\ + & EtaConditionSignedMT etaMin 0 etaMax 3.2 \\ + 5: & QjetMassConditionMT: mass min: 170000 mass max: 190000 \\ + 6: & AcceptAllConditionMT\\ + 7: & DijetMassConditionMT mass min: 70000 mass max: 90000 \\ + 8: & AcceptAllConditionMT\\ + 9: & EtConditionMT Et threshold: 10000 \\ + 10: & EtConditionMT Et threshold: 11000 \\ + 11: & DijetMassConditionMT mass min: 71000 mass max: 91000\\ + 12: & AcceptAllConditionMT\\ + 13: & EtConditionMT (0x646cea0) Et threshold: 12000 \\ + 14: & EtConditionMT (0x646ceb0) Et threshold: 13000 \\ +\end{tabular} +\end{tiny} +\end{block} +\end{minipage} +\end{frame} + + +\begin{frame}[fragile=singleslide] +\frametitle{SatisfiedBy table at the end of processing} + + +%\begin{minipage}[t]{0.48\linewidth} +%\begin{block}{Chain Label} +% +%\begin{tiny} +%partgen([] partgen([] simple([(neta, 84et)(peta, 84et)]))\\ +% combgen([]qjet([(170qjmass190)])\\ +% partgen([]\\ +% combgen([] \\ +% dijet([(70djmass90)])\\ +% simple([(10et)(11et)]))\\ +% combgen([] \\ +% dijet([(71djmass91)])\\ +% simple([(12et)(13et)])))))\\ +% +%\end{tiny} +%\end{block} +%\end{minipage}\hfill +%\begin{minipage}[t]{0.48\linewidth} +%\begin{block}{Conditions Parent Table} +%\begin{center} +%\begin{tiny} +%[0 0 1 \alert{2} \alert{2} 0 5 6 7 \alert{8} \alert{8} 6 11 \alert{12} \alert{12} ] +% +%Leaf nodes in \alert{red} +% +%\end{tiny} +%\end{center} +%\end{block} +%\end{minipage} +\begin{minipage}[t]{0.48\linewidth} +\begin{block}{failing event} +\begin{center} +\begin{tiny} +\begin{tabular}{r|l} +Cond indx& jet groups indices\\ \hline +0: & [] \\ +1: & [] \\ +2: & [] \\ +3: & [1] \\ +4: & [] \\ +5: & [] \\ +6: & [] \\ +7: & [] \\ +8: & [] \\ +9: & [1 2 3 4 5 6 7] \\ +10:& [1 2 3 4 5 6 7] \\ +11:& [] \\ +12:& [] \\ +13:& [1 2 3 4 5 6 7] \\ +14:& [1 2 3 4 5 6 7] \\ +\end{tabular} +\end{tiny} +\end{center} +\end{block} +\end{minipage} +\begin{minipage}[t]{0.48\linewidth} +\begin{block}{passing event} +\begin{center} +\begin{tiny} +\begin{tabular}{r|l} +Cond indx& jet groups indices\\ \hline +0: & [16] \\ +1: & [7 12 13 9 8 14 11] \\ +2: & [7 12 13 9 8 14 11] \\ +3: & [1 3 5 6] \\ +4: & [0 2 4] \\ +5: & [15] \\ +6: & [15] \\ +7: & [7 9 11] \\ +8: & [7 8 9 10 11] \\ +9: & [0 1 4 6] \\ +10: & [0 1 6] \\ +11: & [7 9 11] \\ +12: & [7 8 9 10 11] \\ +13: & [0 1 4 6] \\ +14: & [0 1 6] \\ +\end{tabular} +\end{tiny} +\end{center} +\end{block} +\end{minipage}\hfill +\end{frame} + +% +% \section{FastReduction Configuration} +%\part{Fast Reduction Configuration} +%\frame{\partpage} +% + \frame +{ +\frametitle{C++ Athena Component Structure} +\includegraphics[trim = 0mm 0mm 0mm 10mm, clip, width=0.9\textwidth]{Pictures/AlgTools} + + +} + + \frame +{ +\frametitle{Jet Hypo C++ Mechanics} + +\begin{block}{Classes} +\begin{description} +\item[TrigJetHypoAlgMT] Interacts with Trigger Framework: decides +retrieves Decision objects, retrieves jet collection, passes these to each TrigJetHypoToolMT +\item[TrigJetHypoToolMT] Represents a chain hypo. Decides +whether the jet hypo should run, sends jet collection, to TrigJetHypoHelperTool] +reports a list of jets participating in a positive decision +\item[TrigJetHypoHelperToolMT] Attribute of TrigJetHypoTool. Receives jets, runs FastJet. +\item +\end{description} +\end{block} +} + +\frame +{ +\frametitle{TrigJetHypoHelperTool MT C++} +\begin{block}{TrigJetHypoHelperTool MT attributes} +\begin{description} +\item[JetGrouper ] Splits incoming jet collection into smaller groups of a specified size. +\item[Matcher ] Matcher - Passes the jet groups to Conditions. Keeps track of Condition satisfaction. +\item[ITrigJetHypoToolConfig] class to supply the above attributes +\end{description} +\end{block} +} + +\frame{ +\frametitle{ITrigJetHypoToolConfig implementation for FastReduction} + +TrigJetHypoToolConfig\_fastreduction + +\begin{block}{JetGrouper} +SingleJetGrouper: splits incoming jet collection of $n$ jets to $n$ collections of +1 jet. These are massed to the Matcher +\end{block} + +\begin{block}{Matcher} +FastReductionMatcher: Instantiates FastReducer with the jet group collection. +Run FastReducer. Reports FastReducer result. +\end{block} + +\begin{block}{ConditionMakers} +AlgToolArray. Each Condition is instantiated by an an element of this array. +The ConditionMakers are asked for their Conditions when the Matcher is +instantiated. The Matcher receives the Conditions +\end{block} +} + + + \frame +{ +\frametitle{AlgTool Configuration} + +How do we initialise all these C++ AlgTools? + +Thats what the python configuration code does. + +That story is for next time. +} + +\frame +{ +\frametitle{Afterthoughts} +\begin{itemize} +\item Dumping data structures +\item identical Conditions +\item Code/history clean up +\end{itemize} +} + + + + \end{document} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/C++/Pictures/AlgTools.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/C++/Pictures/AlgTools.tex new file mode 100644 index 0000000000000000000000000000000000000000..c47d915990ea3a76cd8e64db2e94d0fb7808329f --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/C++/Pictures/AlgTools.tex @@ -0,0 +1,63 @@ +\documentclass[11pt]{amsart} +\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. +\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage[english]{babel} +\usepackage{tikz} +\usepackage{ifthen} +\usepackage{calc} +%\usepackage{pfgopts} +\usepackage{tikz-uml} +\usetikzlibrary{positioning} +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + + +\begin{tikzpicture} + +\umlsimpleclass{TrigJetHypoAlgMT}{ +}{} + +\umlsimpleclass[right=4cm of TrigJetHypoAlgMT] {TrigJetHypoToolMT}{ +}{} +\umlsimpleclass[below=2cm of TrigJetHypoToolMT] {TrigJetHypoToolHelper}{}{} +\umlclass[left=3cm of TrigJetHypoToolHelper, type=Interface] {ITrigJetHypoToolConfig}{}{+ getMatcher()\\ ++ getGrouper()\\} +\umlclass[below=2cm of ITrigJetHypoToolConfig] {TrigJetHypoToolConfig-fastreducer}{}{- getConditions\\ +} + +\umlclass[right=3cm of TrigJetHypoToolConfig-fastreducer, type=Interface] {ITrigJetConditionConfig}{}{+getCondition()} + +\umlsimpleclass[below left=2.5cm and -1.5cm of ITrigJetConditionConfig] {TrigJetConditionConfig-et} +\umlsimpleclass[below =3.5cm and -0.5cm of ITrigJetConditionConfig] {TrigJetConditionConfig-eta} +\umlsimpleclass[below right =4.5cm and -3.5 of ITrigJetConditionConfig] {TrigJetConditionConfig-moment} + + +\umluniassoc[mult=*]{TrigJetHypoAlgMT}{TrigJetHypoToolMT} +\umluniassoc[mult=1]{TrigJetHypoToolMT}{TrigJetHypoToolHelper} +\umluniassoc[mult=1]{TrigJetHypoToolHelper}{ITrigJetHypoToolConfig} +\umluniassoc[mult=*]{TrigJetHypoToolConfig-fastreducer}{ITrigJetConditionConfig} +\umlimpl{TrigJetHypoToolConfig-fastreducer}{ITrigJetHypoToolConfig} +\umlimpl{TrigJetConditionConfig-et}{ITrigJetConditionConfig} +\umlimpl{TrigJetConditionConfig-eta}{ITrigJetConditionConfig} +\umlimpl{TrigJetConditionConfig-moment}{ITrigJetConditionConfig} + + + +\end{tikzpicture} + + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/C++/Pictures/hypopass.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/C++/Pictures/hypopass.tex new file mode 100644 index 0000000000000000000000000000000000000000..d6ae9a16256130c0fae2f00f4afeabe0fcbf4157 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/C++/Pictures/hypopass.tex @@ -0,0 +1,40 @@ +\documentclass[11pt]{amsart} +\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. +\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} + +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} +\usepackage{tikz} +\usetikzlibrary{positioning} + +\begin{document} + + +\begin{tikzpicture}[scale=3, ->, >=stealth, shorten >=1pt, auto, node distance = 2.8cm, on grid, semithick, +nd/.style={circle,draw=blue!50, thick,minimum size=15mm}, dots/.style={draw=black!50, thick,minimum size=15mm}] + \node[nd] (0) {$c_0$}; + \node (d1) [below=of 0] {...}; + \node[nd] (11) [left=of d1] {$c_{11}$}; + \node[nd] (10) [left=of 11] {$c_{10}$}; + \node[nd] (12) [right=of d1] {$c_{1n_1-1}$}; + \node[nd] (13) [right=of 12] {$c_{1n_1}$}; + +% \node[nd] (4) [below =of 10] {$c_{20}$}; +% \node[nd] (5) [below =of 20] {$c_{2n_2}$}; +% \node[nd] (5) [below right=of 3] {$c_5$}; + +% \path (0) edge [red] node [swap] {2/2} (1) +% edge [red] node {2/1`} (2) +% (1) edge [red] node [swap] {3/2} (3) +% edge node [near start] {1/0} (4) +% (2) edge node [near start] {1/0} (3) +% edge [red] node {1/1} (4) +% (3) edge [red] node [swap] {2/2} (5) +% (4) edge [red] node {3/1} (5); +\end{tikzpicture}. + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/JetTriggerPythonConfiguration.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/JetTriggerPythonConfiguration.tex new file mode 100644 index 0000000000000000000000000000000000000000..d8058c3980af2ebd29ea7674109384edb66d30d6 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/JetTriggerPythonConfiguration.tex @@ -0,0 +1,365 @@ +\documentclass{beamer} + +% \usepackage{beamerthemesplit} // Activate for custom appearance + +\title{The Trigger Jet Hypo - Python Configuration} +\author{P Sherwood} +\date{10 November 2020} + +\addtobeamertemplate{navigation symbols}{}{% + \usebeamerfont{footline}% + \usebeamercolor[fg]{footline}% + \hspace{1em}% + \insertframenumber/\inserttotalframenumber +} +\usepackage{xcolor} +\usepackage{caption} +\usepackage{subcaption} +\usepackage{wrapfig} + + +\begin{document} + +\frame{\titlepage} +% \begin{frame} +% \frametitle{Outline} +% \begin{quotation} +% My mind is clearer now - at last all too well I can see where we all soon will be +% \end{quotation} +% \tableofcontents[pausesections] +%\end{frame} + + + +%\subsection {Tree Structures} +%\subsection{HypoTrees} +%\subsection{ConditionTrees} +%\subsection{Dynamic Programming} + +%\part{The Jet Hypo as a Tree} +%\frame{\partpage +% +%%{ +% \frametitle{Part 1: Fast Reduction Generalities} +% } +%} + +\frame + { + \frametitle{Context} + + \begin{block}{High level: C++} + At initialisation, the Trigger Framework: + \begin{itemize} +\item instantiates 1 JetHypoTool per chain. +\item instantiates 1 JetHypoAlgorithm +\item passes the tools to the Algorithm +\end{itemize} +\end{block} + +\begin{block}{Role of the python configuration} +Provide the initialisation for any JetHypoAlgTool and its helper AlgTool classes +\end{block} +} + + +\frame + { + \frametitle{Jet Hypo AlgTool structure (C++)} + \begin{block}{} + %\begin{wrapfigure}{l}{0.82\linewidth} + \begin{minipage}[T]{0.75\linewidth} + \includegraphics[trim = 20mm 130mm 0mm 25mm, clip, width= 0.98\linewidth]{Pictures/class_overview} + \end{minipage}% + % \end{wrapfigure} AlgTools to be intialised in yellow + \begin{minipage}[T]{0.25\linewidth} + \begin{small} + {\bf Yellow:} AlgTools to be initialised by jet~trig python\\ + {\it C++ \& python classes are isomorphic} + + \hrulefill\\ + {\bf Red:} Non-component objects instantiated by HelperConfig + \end{small} + \end{minipage} + \end{block} + \begin{block}{} + Experience from Run 2: different hypo approaches can be encapsulated in the Matcher (FastReduction, AlgTrees, Maxflow...) + \end{block} +} + +\frame + { + \frametitle{Overview of the jet trigger python configuration} + \begin{block}{Goal} + Create python instances of TrigJetHypoTool and associated classes in order to initialise the corresponding C++ classes + \end{block} + \begin{block}{Classes to be initialised for each chain} + \begin{itemize} + \item TrigJetHypoToolMT + \item TrigJetHypoToolHelperMT + \item TrigJetHypoToolHelperConfig\_fastreduction + \item multiple TrigJetConditionConfig + \end{itemize} + + + \end{block} + +} + +\frame{ + \frametitle{How do we do it?} + + \begin{block}{View from 35 000 ft} + + \begin{enumerate} + \item Trigger framework sends a chain dict. + \item chain dict $\rightarrow$ chain label (hierarchical tree representation) + \item chain label $\rightarrow$ node tree (hierarchical tree representation) + \item process node tree to recover python AlgTools + \end {enumerate} + \end{block} +} + +\begin{frame}[fragile] + \frametitle{Chain Label examples} + + \begin{block}{chain label examples: scenario = `simple'} + \begin{itemize} + \item 'simple([(38et, 0eta320)])', + \item 'simple([(38et, 0eta320)(40et, 0eta320)])', + \item 'simple([(38et, 0eta320, 011jvt)])', + \end{itemize} + \end{block} + + \begin{block}{chain label examples: scenario $\neq$ `simple', nested scenarios} + and([]\\ + \makebox[1cm]{}{simple([(30et,500neta)(30et,peta500)])}\\ + \makebox[1cm]{}combgen([(10et,0eta320)]\\ + \makebox[2cm]{}dijet([(34djmass,26djdphi)])\\ + \makebox[2cm]{}simple([(10et,0eta320)(20et,0eta320)]\\ + \makebox[1cm]{})\\ + ) + \end{block} +\end{frame} + + +\frame{ + +\frametitle{chainDict $\rightarrow$ chain label (chanDict2jetLabel.py)} +% \frametitle{What's the deal with the `simple' scenario?} +\begin{block}{hypo scenarios} +`hypoScenario' is a key in the chainDict. Its values decides how the chain label is constructed. +\end{block} + +\begin{block}{hypoScenario = `simple'} +\begin{itemize} +\item The `simple' scenario maintains continuity with Run 2 chains. +\item The chain names and chainDict remain as before remain as in Run 2. +\item The jet trig python code assembles the chain label from various entries in the chainDict. +\end{itemize} +\end{block} + +\begin{block}{otherwise...} +\begin{itemize} +\item The `hypoScenario' key in the chain dict contains the chain label +which is taken from the chain name. {\it ex:}~HLT\_j0\_{\color{red}vbenf}{\color{blue}SEP30etSEP34mass35SEP50fbet}\_L1J20 +\item scenario ({\color{red}vbenf}) identifies a string template which is filled in using {\color{blue}parameters} in hypoScenario. +\end{itemize} +\end{block} + +} + +\frame{ + \frametitle{chain label $\rightarrow$ node tree} + \begin{block}{chain label vs node treel} + \begin{center} + \begin{tabular}{|l|c|c|} \hline + & ChainLabel & node tree \\ \hline + type & string & node objects \\ + par-child &nested parens & child elements \\ + extendable & no & typically via visitors \\ + \hline + \end{tabular} + \end{center} + +% \begin{itemize} +% \item chain label is structured - legal chain labels conform to a syntax +% \item the syntax allows for the prescription of a tree through nested parentheses. +% \item chain label contains information on Conditions (cut predicates) +% \end{itemize} + \end{block} +\begin{block}{Why have a node tree as well?} +Chain label and Node tree: same tree structure. Nodes allow python mechanics to set up AlgTools +\end{block} + +\begin{block}{Node tree creation and evolution} +\begin{itemize} +\item JetTrigParser reads the chain label. Syntax is checked. Creates initial node tree. +\item Attributes of the nodes modifiable (are python objects!) +\item Code organisation: encapsulate node modification actions in visitors - avoid complex Node class. +\end{itemize} + +\end{block} +} + +\frame{ + \frametitle{ChainLabel $\rightarrow$ node tree: Generalities} + \begin{block}{chain label} + \begin{itemize} + \item chain label is structured - legal chain labels conform to a syntax + \item the syntax allows for the prescription of a tree through nested parentheses. + \item chain label contains information on Conditions (cut vars, window cuts) and child nodes. + \end{itemize} + \end{block} + +\begin{block}{conversion to a node tree} +\begin{itemize} +\item node tree is tree made of node instances, Each node contains data, and a list of child nodes. +\item the node tree has the strupwdcture prescribed by the chain label. +\item the conversion from chain label to node tree is done using Jet +\end{itemize} + +\end{block} +} + +\frame{ +\frametitle{ChainLabel Syntax} + +Alphabet: $\Sigma=$\{[a-z][0-9],\}. +\begin{center} +\begin{tabular}{lll} +{\it lower} & $\rightarrow$ & $a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z$\\ +{\it digit \it} & $\rightarrow$ &$0|1|2|3|4|5|6|7|8|9$\\ +{\it parR}& $\rightarrow$ & ) \\ +{\it parL } & $\rightarrow$ &( \\ +{\it braL} & $\rightarrow$ &[ \\ +{\it braR \it} & $\rightarrow$ &] \\ +{\it comma \it} & $\rightarrow$ &, \\ +{\it scenario \it}& $\rightarrow$ & {\it name, parL, windowList, \{scenario\}, parR }\\ +{\it name \it} & $\rightarrow$ &{\it lower,\{lower\}} \\ +{\it windowList \it} & $\rightarrow$ & {\it braL window, \{comma, window\}, braR \it}\\ +{\it window \it} & $\rightarrow$ &{\it \{digit\}, lower, \{lower\}, \{digit\}} \\ +{\it scenarioList \it} & $\rightarrow$ &{\color{red}{\it scenario} $|$ {\it scenario scenarioList} } \\ +{\it label$_S$ \it} & $\rightarrow$ &{\it scenarioList} \\ +\end{tabular} +\end{center} + +The scenarioList is what allows nesting (recursion). +} + +\frame{ + \frametitle{ChainLabel $\rightarrow$ node tree: Parsing} +% \begin{block}{} +% \begin{itemize} +% \item The parser checks the ChainLabel obeys the syntax (else ERROR) +% \item Creates an isomorphic node tree +% \end{itemize} +% \end{block} + + \begin{block}{} + \begin{minipage}[T]{0.5\linewidth} + \includegraphics[trim = 30mm 0mm 30mm 30mm, clip, width= \linewidth]{Pictures/hypoStateMachine} + \end{minipage}% + \begin{minipage}[T]{0.5\linewidth} + The parser ensures correct ChainLabel syntax (else Error Condition), node tree ismorphic to the ChainLabel. + \end{minipage} + \end{block} + +} + +\frame{ + \frametitle{Recursive Classes = Trees} + \begin{block}{UML representations of a tree} + \includegraphics[trim = 10mm 230mm 0mm 20mm, clip, width= 1.0\linewidth]{Pictures/recursive} +\end{block} + + \begin{block}{Visitors traverse Trees} + \begin{minipage}[T]{0.55\linewidth} + \includegraphics[trim = 10mm 195mm 60mm 25mm, clip, width= 1.0\linewidth]{Pictures/visitor} + \end{minipage}% + \begin{minipage}[T]{0.45\linewidth} + A: navigation\\Visitor: functionality.\\\mbox{}\\ + New visitors can be introduced with modifying A. + \end{minipage} + \end{block} + + } + + +\frame +{ + \frametitle{The visitors, and what they do} + % \begin{minipage}[T]{0.7\linewidth} +\begin{block}{HLT\_j260\_320eta490\_L1J75\_31ETA49} + \includegraphics[trim = 10mm 180mm 0mm 20mm, clip, width= 0.8\linewidth]{Pictures/node} + + \begin{description} +\item[TreeParameterExpander\_visitor] Modifies node: attach a conf\_attr list of dictionaries +\end{description} +\end{block} +\begin{block}{} + \begin{description} + \item[ConditionsToolSetterFastReduction\_visitor] Modifies self: attaches a TrigJetHypoToolHelperMT instance + \end{description} + \end{block} + } + + \frame +{ + \frametitle{Python TrigJetHypoTool creation: Sequence Overview} + \begin{block}{} + \includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width= \linewidth]{Pictures/Config_seq} + \end{block} + } + + + \frame +{ + \frametitle{Python TrigJetHypoTool creation: TreeExpander\_Visitor} + \begin{block}{} + \includegraphics[trim = 0mm 0mm 0mm 0mm, clip, width= \linewidth]{Pictures/TreeParameterExpanderVisitor_seq} + \end{block} + } + + \frame +{ + \frametitle{Python TrigJetHypoTool creation: TreeToolSetterFastReduction Visitor} + \begin{block}{} + \begin{minipage}[T]{0.45\linewidth} + \includegraphics[trim = 0mm 0mm 100mm 0mm, clip, width= \linewidth]{Pictures/ConditionsToolSetterFastreduction_seq} + \end{minipage}% + \begin{minipage}[T]{0.55\linewidth} + Non-leaf nodes $\rightarrow$ AcceptAll nodes\\ + Collect information from tree to: + \begin{itemize} + \item build tree vector + \item instantiate ConditionMakers + \end{itemize} + \end{minipage} + + \end{block} + } + + + + \end{document} + +\frame{ + \frametitle{Concepts} + \begin{block}{TrigJetHypoToolHelperMT} + \begin{description} +\item[Tree] A graph where each node has a single parent, except the rroot node. Each node as zero or more children. +\item [Jet Group] a vector of jets +\item[Condition] A predicate that accepts a jet group. +\item[Grouper] A device that splits jet groups into smaller jet groups +\item[Matcher] A device that presents jet froups to Conditions +\end{description} + \end{block} + \begin{block}{FastReduction} + \begin{description} +\item[ Condition Tree] Expresses hierarchical relations among Conditions +\item[FastReducer] Class that performs FastReduction +\end{description} +\end{block} + } + diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/ConditionsToolSetterFastreduction_seq.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/ConditionsToolSetterFastreduction_seq.tex new file mode 100644 index 0000000000000000000000000000000000000000..abd2b4e93b112c258474c441621f4e82345ba2d3 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/ConditionsToolSetterFastreduction_seq.tex @@ -0,0 +1,108 @@ +\documentclass[11pt]{amsart} +\usepackage[left=10px,right=10px,top=10px,bottom=10px,paperwidth=12in, paperheight=12in]{geometry} % See geometry.pdf to learn the layout options. There are lots. +%\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage[english]{babel} +\usepackage{tikz} +\usepackage{ifthen} +\usepackage{calc} +%\usepackage{pfgopts} +\usepackage{tikz-uml} +\usetikzlibrary{positioning} +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + + +\begin{tikzpicture} +\begin{umlseqdiag} +\umlobject [class=Node] {tree} +\umlobject [class=ConditionsToolSetterFastReduction, x=5] {toolSetter} +\begin{umlcall}[op={mod(self)}, dt=5]{tree}{toolSetter} + \umlcreatecall[class=Node, x=15]{toolSetter}{root} + \begin{umlcall}[op={attach(tree)}, dt=5]{toolSetter}{root} + \end{umlcall} + \begin{umlcall}[op={check\_scenarios}, dt=5]{toolSetter}{root} + \end{umlcall} + \begin{umlcall}[op={set\_conditions(root)}]{toolSetter}{toolSetter} + \begin{umlcall}[op={mod\_leaf(node)}]{toolSetter}{toolSetter} + \umlcreatecall[class=TrigJetConditionConfig\_compound, x=11]{toolSetter}{anon} + \begin{umlcall}[op={attach(anon)}]{toolSetter}{root} + \end{umlcall} + \end{umlcall} + \end{umlcall} + \begin{umlcall}[op={remove\_combgen}, dt=5]{toolSetter}{root} + \end{umlcall} + \begin{umlcall}[op={remo\_combgen}, dt=5]{toolSetter}{root} + \end{umlcall} + \begin{umlcall}[op={split\_leaves}, dt=5]{toolSetter}{root} + \end{umlcall} + \begin{umlcall}[op={find\_shared}, dt=5]{toolSetter}{root} + \end{umlcall} + \begin{umlcall}[op={set\_ids(par=0, id=0)}, dt=5]{toolSetter}{root} + \end{umlcall} + \umlcreatecall[class=map, x=9]{toolSetter}{conditionsMap} + \begin{umlcall}[op={fillConditionsMap(conditionsMap)}]{toolSetter}{root} + \end{umlcall} + \begin{umlcallself}[op={map\_2\_vec(conditionsMap)}, return=conditionsVec]{toolSetter} + \end{umlcallself} + \umlcreatecall[class=map, x=9]{toolSetter}{tree-map} + \begin{umlcall}[op={fill\_tree\_map(tree-map)}]{toolSetter}{toolSetter} + \end{umlcall} + \begin{umlcallself}[op={map\_2\_vec(tree-map)}, return=treeVec]{toolSetter} + \end{umlcallself} + \umlcreatecall[class=TrigJetHypoToolConfig-fastreduction, x=15]{toolSetter}{confTool} + \begin{umlcall}[op={attach(conditionsVec)}]{toolSetter}{confTool} + \end{umlcall} + \begin{umlcall}[op={attach(treeVec)}]{toolSetter}{confTool} + \end{umlcall} + \begin{umlcall}[op={attach(sharedVector)}]{toolSetter}{confTool} + \end{umlcall} + \umlcreatecall[class=TrigJetHypoToolHelperMT, x=11]{toolSetter}{helperTool} + \begin{umlcall}[op={attach(configTool)}]{toolSetter}{helperTool} + \end{umlcall} + \begin{umlcall}[op={attach(helperTool)}]{toolSetter}{toolSetter} + \end{umlcall} +\end{umlcall} +% \umlcreatecall[class=TrigJetHypoTool, x=25.7]{trigJetHypoToolFromDict}{tool} +% \begin{umlcall}[op={chaindict}, dt=5, return=helper]{trigJetHypoToolFromDict}{trigJetHypoToolHelperFromDict} +% \umlcreatecall[class=ChainLabel, x=13]{trigJetHypoToolHelperFromDict}{label} +% \umlcreatecall[class=ConditionsToolSetterFastReduction, x=19]{trigJetHypoToolHelperFromDict} {t-setter} +% \umlcreatecall[class=ChainLabelParser, x=13.7]{trigJetHypoToolHelperFromDict} {parser} +% \begin{umlcall}[op={parse(label)}, dt=5, return=tree]{trigJetHypoToolHelperFromDict}{parser} +% \umlcreatecall[class=Node, x=16.5]{parser}{tree} +% \end{umlcall} +% \umlcreatecall[class=TreeParameterExpander, x=13.7]{trigJetHypoToolHelperFromDict} {visitor} +% \begin{umlcall}[op={accept(visitor)}, dt=5]{trigJetHypoToolHelperFromDict}{tree} +% \end{umlcall} +% \begin{umlcall}[op={accept(t-setter)}, dt=5]{trigJetHypoToolHelperFromDict}{tree} +% \begin{umlcall}[op={mod(tree)}, return=helper, dt=5]{tree}{t-setter} +% \umlcreatecall[class=TrigJetHypoHelperTool, x=23]{t-setter} {helper} +% \end{umlcall} +% \begin{umlcallself}[op=attach(helper)]{tree} +% \end{umlcallself} +% \end{umlcall} +% \end{umlcall} +% \begin{umlcall}[op={attach(helper)}, dt=5]{trigJetHypoToolFromDict}{tool} +% \end{umlcall} +%\end{umlcall} +\end{umlseqdiag} + + + +\end{tikzpicture} + + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/Config_seq.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/Config_seq.tex new file mode 100644 index 0000000000000000000000000000000000000000..ca40ecdb9f2f88366433521c7ed1ac8170601e69 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/Config_seq.tex @@ -0,0 +1,68 @@ +\documentclass[11pt]{amsart} +\usepackage[left=10px,right=10px,top=10px,bottom=10px,paperwidth=12in]{geometry} % See geometry.pdf to learn the layout options. There are lots. +%\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage[english]{babel} +\usepackage{tikz} +\usepackage{ifthen} +\usepackage{calc} +%\usepackage{pfgopts} +\usepackage{tikz-uml} +\usetikzlibrary{positioning} +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + + +\begin{tikzpicture} +\begin{umlseqdiag} +\umlobject [no ddots] {menu} +\umlobject [class=JC, x=3.7] {trigJetHypoToolFromDict} +\umlobject [class=JC, x=9.5] {trigJetHypoToolHelperFromDict} +\begin{umlcall}[op={chaindict}, dt=5, return=tool]{menu}{trigJetHypoToolFromDict} + \umlcreatecall[class=TrigJetHypoTool, x=25.7]{trigJetHypoToolFromDict}{tool} + \begin{umlcall}[op={chaindict}, dt=5, return=t-setter.helper]{trigJetHypoToolFromDict}{trigJetHypoToolHelperFromDict} + \umlcreatecall[class=ChainLabel, x=13]{trigJetHypoToolHelperFromDict}{label} + \umlcreatecall[class=ConditionsToolSetterFastReduction, x=19]{trigJetHypoToolHelperFromDict} {t-setter} + \umlcreatecall[class=ChainLabelParser, x=13.7]{trigJetHypoToolHelperFromDict} {parser} + \begin{umlcall}[op={parse(label)}, dt=5, return=tree]{trigJetHypoToolHelperFromDict}{parser} + \umlcreatecall[class=Node, x=16.5]{parser}{tree} + \end{umlcall} + \umlcreatecall[class=TreeParameterExpander, x=13.7]{trigJetHypoToolHelperFromDict} {visitor} + \begin{umlfragment}[type=navigate tree] + \begin{umlcall}[op={accept(visitor)}, dt=5]{trigJetHypoToolHelperFromDict}{tree} + \end{umlcall} + \end{umlfragment} + \begin{umlcall}[op={mod(tree)}, dt=5]{trigJetHypoToolHelperFromDict}{t-setter} + \begin{umlfragment}[type=navigate tree] + \begin{umlcall}[op={accept(self)}, dt=5]{t-setter}{tree} + \end{umlcall} + \end{umlfragment} + \umlcreatecall[class=TrigJetHypoHelperTool, x=23]{t-setter} {helper} + \begin{umlcallself}[op=attach(helper)]{t-setter} + \end{umlcallself} + \end{umlcall} + + \end{umlcall} + \begin{umlcall}[op={attach(helper)}, dt=5]{trigJetHypoToolFromDict}{tool} + \end{umlcall} +\end{umlcall} + +\end{umlseqdiag} +\end{tikzpicture} + +JC: abbreviation for TrigJetToolConfig.py + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/Node_treeParameterExpander.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/Node_treeParameterExpander.tex new file mode 100644 index 0000000000000000000000000000000000000000..0609043bb0f9b9a85130d4f4f3c9e50623c7af91 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/Node_treeParameterExpander.tex @@ -0,0 +1,75 @@ +\documentclass[11pt]{amsart} +\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. +\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage[english]{babel} +\usepackage{tikz} +\usepackage{ifthen} +\usepackage{calc} +%\usepackage{pfgopts} +\usepackage{tikz-uml} +\usetikzlibrary{positioning} +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + + +\begin{tikzpicture} + +\umlclass{Node}{ +}{ + int:node\_id=None\\ + int:parent\_id=None\\ + + string:scenario='simple'\\ + string:parameters=(260et,320eta490)\\ + list:children\\ + list$<$dict$>$:conf\_attrs=[0]\\ + AlgTool:tool=None\\ + list$<$AlgTool$>$:compound\_condition\_tools \\ + bool:tree\_top=True\\ +} +\umluniassoc[mult=0..*]{Node}{Node} + +%\umlsimpleclass[right=4cm of TrigJetHypoAlgMT] {TrigJetHypoToolMT}{ +%}{} +%\umlsimpleclass[below=2cm of TrigJetHypoToolMT] {TrigJetHypoToolHelper}{}{} +%\umlclass[left=3cm of TrigJetHypoToolHelper, type=Interface] {ITrigJetHypoToolConfig}{}{+ getMatcher()\\ +%+ getGrouper()\\} +%\umlclass[below=2cm of ITrigJetHypoToolConfig] {TrigJetHypoToolConfig-fastreducer}{}{- getConditions\\ +%} +% +%\umlclass[right=3cm of TrigJetHypoToolConfig-fastreducer, type=Interface] {ITrigJetConditionConfig}{}{+getCondition()} +% +%\umlsimpleclass[below left=2.5cm and -1.5cm of ITrigJetConditionConfig] {TrigJetConditionConfig-et} +%\umlsimpleclass[below =3.5cm and -0.5cm of ITrigJetConditionConfig] {TrigJetConditionConfig-eta} +%\umlsimpleclass[below right =4.5cm and -3.5 of ITrigJetConditionConfig] {TrigJetConditionConfig-moment} +% +% +%\umluniassoc[mult=*]{TrigJetHypoAlgMT}{TrigJetHypoToolMT} +%\umluniassoc[mult=1]{TrigJetHypoToolMT}{TrigJetHypoToolHelper} +%\umluniassoc[mult=1]{TrigJetHypoToolHelper}{ITrigJetHypoToolConfig} +%\umluniassoc[mult=*]{TrigJetHypoToolConfig-fastreducer}{ITrigJetConditionConfig} +%\umlimpl{TrigJetHypoToolConfig-fastreducer}{ITrigJetHypoToolConfig} +%\umlimpl{TrigJetConditionConfig-et}{ITrigJetConditionConfig} +%\umlimpl{TrigJetConditionConfig-eta}{ITrigJetConditionConfig} +%\umlimpl{TrigJetConditionConfig-moment}{ITrigJetConditionConfig} +% +% + +\end{tikzpicture} + + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/TreeParameterExpanderVisitor_seq.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/TreeParameterExpanderVisitor_seq.tex new file mode 100644 index 0000000000000000000000000000000000000000..367437df048c192780058eb02ce85466b7f9106f --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/TreeParameterExpanderVisitor_seq.tex @@ -0,0 +1,61 @@ +\documentclass[11pt]{amsart} +\usepackage[left=10px,right=10px,top=10px,bottom=10px,paperwidth=12in]{geometry} % See geometry.pdf to learn the layout options. There are lots. +%\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage[english]{babel} +\usepackage{tikz} +\usepackage{ifthen} +\usepackage{calc} +%\usepackage{pfgopts} +\usepackage{tikz-uml} +\usetikzlibrary{positioning} +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + + +\begin{tikzpicture} +\begin{umlseqdiag} +\umlobject [class=JC, x=9.5] {trigJetHypoToolHelperFromDict} +\umlobject [class=Node, x=27.5] {tree} +\umlcreatecall[class=TreeParameterExpander, x=13.7, dt=10]{trigJetHypoToolHelperFromDict} {visitor} +\begin{umlcall}[op={mod(tree)}]{trigJetHypoToolHelperFromDict}{visitor} + \umlcreatecall[class=TreeParameterExpander-simple, x=18.7]{visitor}{expander} + \begin{umlcall}[op={mod(tree)}, dt=5]{visitor}{expander} + \begin{umlcall}[op={accept(visitor)}, dt=5]{expander}{tree} + \begin{umlfragment} [type=loop, name=childloop] + \begin{umlcall}[op={mod(node=self)}]{tree}{expander} + \end{umlcall} + \begin{umlcreatecall}[class=ConditionDictMaker, x=25]{expander}{cdm} + \end{umlcreatecall} + \begin{umlcall}[op={makeDict(node.parameters)}, return=dict, dt=5]{expander}{cdm} + \end{umlcall} + \begin{umlcall} [op={attach(dict)}, dt=5, name=nodemod] {expander}{tree} + \end{umlcall} + \end{umlfragment} + \end{umlcall} + + \umlnote[x=23, y = -13, width=150]{childloop}{navigate tree by modifing child nodes, then self} + \end{umlcall} +\end{umlcall} + +\umlnote[x=3]{trigJetHypoToolHelperFromDict}{using a visitor, for each node in a Conditions tree, attach a dictionary of elemental conditions and their explicit values} +\end{umlseqdiag} + + +\end{tikzpicture} + + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/TreeParameterExpanderVister_seq.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/TreeParameterExpanderVister_seq.tex new file mode 100644 index 0000000000000000000000000000000000000000..fd158684dd08c6b227f7b03c72f5823751225396 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/TreeParameterExpanderVister_seq.tex @@ -0,0 +1,58 @@ +\documentclass[11pt]{amsart} +\usepackage[left=10px,right=10px,top=10px,bottom=10px,paperwidth=12in]{geometry} % See geometry.pdf to learn the layout options. There are lots. +%\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage[english]{babel} +\usepackage{tikz} +\usepackage{ifthen} +\usepackage{calc} +%\usepackage{pfgopts} +\usepackage{tikz-uml} +\usetikzlibrary{positioning} +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + + +\begin{tikzpicture} +\begin{umlseqdiag} +\umlobject [class=JC, x=9.5] {trigJetHypoToolHelperFromDict} +\umlobject [class=Node, x=22.5] {tree} +\umlcreatecall[class=TreeParameterExpander, x=13.7, dt=10]{trigJetHypoToolHelperFromDict} {visitor} +\begin{umlcall}[op={mod(tree)}]{trigJetHypoToolHelperFromDict}{visitor} + \umlcreatecall[class=TreeParameterExpander-simple, x=18.7]{visitor}{expander} + \begin{umlcall}[op={accept(visitor)}, dt=5]{visitor}{tree} + \begin{umlfragment} [type=loop, name=childloop] + \begin{umlcall}[op={mod(node=self)}]{tree}{visitor} + \end{umlcall} + \begin{umlcreatecall}[class=ConditionDictMaker, x=19]{visitor}{cdm} + \end{umlcreatecall} + \begin{umlcall}[op={makeDict(node.parameters)}, return=dict, dt=5]{visitor}{cdm} + \end{umlcall} + \begin{umlcall} [op={attach(dict)}, dt=5, name=nodemod] {visitor}{tree} + \end{umlcall} + \end{umlfragment} + \umlnote[x=25, y = -13, width=100]{childloop}{navigate tree by modifing child nodes, then self} + \end{umlcall} +\end{umlcall} + +\umlnote[x=2]{trigJetHypoToolHelperFromDict}{using a visitor, for each node in a Conditions tree, attach a dictionary of elemental conditions and their explicit values} +\end{umlseqdiag} + + +\end{tikzpicture} + + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/class_overview.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/class_overview.tex new file mode 100644 index 0000000000000000000000000000000000000000..82ff8199e795b3bbccfc1948c1056bb8a4e12902 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/class_overview.tex @@ -0,0 +1,64 @@ +\documentclass[11pt]{amsart} +\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. +\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage[english]{babel} +\usepackage{tikz} +\usepackage{ifthen} +\usepackage{calc} +%\usepackage{pfgopts} +\usepackage{tikz-uml} +\usetikzlibrary{positioning} +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + + +\begin{tikzpicture} + +\umlsimpleclass[x=0, y=2, fill=white]{TrigJetHypoAlg} +\umlsimpleclass[x=0, y=0]{TrigJetHypoTool} +\umlsimpleclass[x=0, y=-2]{TrigJetHypoToolHelper} +\umlsimpleclass[x=-7, y=-2, fill=white]{IMatcher} +\umlsimpleclass[x=-7, y=-4, fill=red!20]{FastReductionMatcher} +\umlsimpleclass[x=5, y=-2, fill=red!20]{TrigJetGrouper} +\umlsimpleclass[x=-7, y=-6, fill=red!20]{FastReducer} + + +\umlclass[x=0, y=-4]{TrigJetHypoTooHelperConfig-fastreduction}{+ getMatcher()\\+getGrouper()\\}{- treeVector:list$<$int$>$} +\umlclass[x=0, y=-7]{ConditionMaker}{+ getCondition()}{stuff to make a Condition} + +\umluniassoc[mult=*, pos=0.65]{TrigJetHypoAlg}{TrigJetHypoTool} +\umluniassoc[mult=1, pos=0.65]{TrigJetHypoTool}{TrigJetHypoToolHelper} +\umluniassoc[mult=1, pos=0.65]{TrigJetHypoToolHelper}{TrigJetHypoTooHelperConfig-fastreduction} +\umluniassoc[mult=*, pos=0.65]{TrigJetHypoTooHelperConfig-fastreduction}{ConditionMaker} +\umluniassoc[mult=1, pos=0.65]{TrigJetHypoToolHelper}{IMatcher} +\umlimpl[pos=0.65]{FastReductionMatcher}{IMatcher} +\umluniassoc[mult=1, pos=0.65]{TrigJetHypoToolHelper}{TrigJetGrouper} +\umluniassoc[mult=1, pos=0.65]{FastReductionMatcher}{FastReducer} + +\umlnote[x=-7, y=2, width=140]{TrigJetHypoAlg}{Initialised by trig framework\\- not jet trig python} +\umlnote[x=-7, y=0, width=140]{TrigJetHypoTool}{Trig framework interaction\\Delegate work to Helper} +\umlnote[x=4, y=0]{TrigJetHypoToolHelper}{No semantics} +\umlnote[x=5, y=-8, width=100]{ConditionMaker}{Provides 1 Condition for the Matcher} +\umlnote[x=-9, y=-8, width=100]{FastReducer}{Semantics and key data structures here} + + + + +\end{tikzpicture} + + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/helpertool_instance.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/helpertool_instance.tex new file mode 100644 index 0000000000000000000000000000000000000000..a4b417d8b0d54a39245db8de984b1abd96dd1095 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/helpertool_instance.tex @@ -0,0 +1,81 @@ +\documentclass[11pt]{amsart} +\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. +\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage[english]{babel} +\usepackage{tikz} +\usepackage{ifthen} +\usepackage{calc} +%\usepackage{pfgopts} +\usepackage{tikz-uml} +\usetikzlibrary{positioning} +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + + +\begin{tikzpicture} + +\umlclass{TrigJetHypoToolHelperMT}{ +}{ + name:string='helper\_0\_fn\_n1p0'\\ + %HypoConfigurer=TrigJetHypoToolConfig\_fastreduction('fastreduction\_0\_fn'\\ + %conditionMakers=PrivateToolHandleArray(['TrigJetConditionConfig\_acceptAll/all\_0\_fn','TrigJetConditionConfig\_compound/% compound\_0\_fn']), treeVector=[0, 0], sharedVector=[1]), + int:node\_id=1\\ + int:parent\_id=0\\ +} + +\umlclass [x=10] {TrigJetHypoToolConfig-fastreduction} {}{ +list:treeVector= [0, 0] \\ +list:sharedVector=[1]\\ +int:node\_id=1\\ +int:parent\_id=0\\ +%%name:string='TrigJetHypoToolConfig\_fastreduction('fastreduction\_0\_fn'\\ +conditionMakers:PrivateToolHandleArray=[\\ +\hspace{20pt}TrigJetConditionConfig\_acceptAll\\ +\hspace{20pt}TrigJetConditionConfig\_compound]\\ +} +\umluniassoc[mult=1]{TrigJetHypoToolHelperMT}{TrigJetHypoToolConfig-fastreduction} + +%\umlsimpleclass[right=4cm of TrigJetHypoAlgMT] {TrigJetHypoToolMT}{ +%}{} +%\umlsimpleclass[below=2cm of TrigJetHypoToolMT] {TrigJetHypoToolHelper}{}{} +%\umlclass[left=3cm of TrigJetHypoToolHelper, type=Interface] {ITrigJetHypoToolConfig}{}{+ getMatcher()\\ +%+ getGrouper()\\} +%\umlclass[below=2cm of ITrigJetHypoToolConfig] {TrigJetHypoToolConfig-fastreducer}{}{- getConditions\\ +%} +% +%\umlclass[right=3cm of TrigJetHypoToolConfig-fastreducer, type=Interface] {ITrigJetConditionConfig}{}{+getCondition()} +% +%\umlsimpleclass[below left=2.5cm and -1.5cm of ITrigJetConditionConfig] {TrigJetConditionConfig-et} +%\umlsimpleclass[below =3.5cm and -0.5cm of ITrigJetConditionConfig] {TrigJetConditionConfig-eta} +%\umlsimpleclass[below right =4.5cm and -3.5 of ITrigJetConditionConfig] {TrigJetConditionConfig-moment} +% +% +%\umluniassoc[mult=*]{TrigJetHypoAlgMT}{TrigJetHypoToolMT} +%\umluniassoc[mult=1]{TrigJetHypoToolMT}{TrigJetHypoToolHelper} +%\umluniassoc[mult=1]{TrigJetHypoToolHelper}{ITrigJetHypoToolConfig} +%\umluniassoc[mult=*]{TrigJetHypoToolConfig-fastreducer}{ITrigJetConditionConfig} +%\umlimpl{TrigJetHypoToolConfig-fastreducer}{ITrigJetHypoToolConfig} +%\umlimpl{TrigJetConditionConfig-et}{ITrigJetConditionConfig} +%\umlimpl{TrigJetConditionConfig-eta}{ITrigJetConditionConfig} +%\umlimpl{TrigJetConditionConfig-moment}{ITrigJetConditionConfig} +% +% + +\end{tikzpicture} + + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/hypoStateMachine.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/hypoStateMachine.tex new file mode 100644 index 0000000000000000000000000000000000000000..e39824d02718f9a13538da1c3c237daeb5be53c0 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/hypoStateMachine.tex @@ -0,0 +1,91 @@ +\documentclass[11pt]{amsart} +\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. +\geometry{letterpaper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage{tikz} +\usetikzlibrary{automata} +\usetikzlibrary{positioning} + +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} + +\begin{tikzpicture}[node distance=3cm, on grid, semithick, inner sep= 2pt]%, bend angle=45] + +\node [state] (q_1) {$q_1$}; +\node [initial right, state, below right = of q_1] (q_0) {$q_0$}; +\node [state] (q_2) [above left = of q_1]{$q_{2}$}; +\node [state] (q_3) [above right= of q_1]{$q_3$}; +\node [state] (q_4) [above right = of q_3]{$q_4$}; +\node [state] (q_5) [right=of q_4] {$q_5$}; +\node [state] (q_6) [above right=of q_5] {$q_6$}; +\node [state, accepting] (q_7) [below right=of q_5] {$q_7$}; +\node [state, accepting] (q_e) [below right= of q_3] {$e$}; +\node [state] (q_8) [right =of q_7] {$q_8$}; +\node [state] (q_9) [below right=of q_0] {$q_9$}; + +\path [->] + (q_0) [bend left] edge node {C} (q_1) + (q_0) edge node {K} (q_e) + (q_1) edge node {K}(q_e) + (q_1) [bend left] edge node {(}(q_3) + (q_1) [bend left] edge node {C}(q_2) + (q_2) [bend left] edge node {$\epsilon$}(q_1) + (q_3) [bend left] edge node {$\epsilon$}(q_4) + (q_4) edge node {K}(q_e) + (q_4) edge node {[}(q_5) + (q_5) edge node {C,D,Co} (q_6) + (q_6) edge node {$\epsilon$} (q_5) + (q_7) [bend left] edge node {)}(q_8) + (q_8) [bend left] edge node {$\epsilon$}(q_7) + (q_5) [bend left] edge node {]}(q_7) + (q_5) edge node {K}(q_e) + (q_7) edge node {K}(q_e) + (q_7) edge node {C}(q_9) + (q_9) edge node {$\epsilon$}(q_1) + ; + + +\end{tikzpicture} + +\begin{center} +\begin{tabular}{|l|l|l|} \hline +function & diagram & comment \\ \hline + start & - &\\ + scenario & $q_0$ & expect character, set $1^{st}$ scenario name char\\ + scenario & $q_1, q_2 $ & accumulate scenario name\\ + scenario & $q_3$ & push node stack, clear name\\ + start\_params & $q_4$& expect '['\\ + params & $q_5, q_6$& accumulate scenario parameters\\ + end\_params & $q_7,$& set attr parameters stack top, clear params\\ + end\_params &$q_8$& collapse parens: stack pop; add child; clear name, pars\\ + end\_params &$q_9$& add char to scenario name\\ + error & $e$& raise exception \\ +\hline +\end{tabular} +\end{center} +$$\Sigma = \{\epsilon,a-z0-9][)(,\}.\ \epsilon\text{ is the empty string}$$ + +Abbreviations: +\begin{center} +\begin{tabular}{ll} +C & \{a-z\}\\ +Co& , \\ +D & \{0-9\}\\ +% $\sim$\{\dots\} & $\Sigma$\textbackslash \{\dots\} \\ +K & $\Sigma$\textbackslash \{all other out symbols for the node\} \\ +\end{tabular} +\end{center} + + + + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/node.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/node.tex new file mode 100644 index 0000000000000000000000000000000000000000..b5b3147221fe88dd842fc8ba652c527bdbfbb89d --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/node.tex @@ -0,0 +1,51 @@ +\documentclass[11pt]{amsart} +\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. +\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage[english]{babel} +\usepackage{tikz} +\usepackage{ifthen} +\usepackage{calc} +\usepackage{pbox} +%\usepackage{pfgopts} +\usepackage{tikz-uml} +\usetikzlibrary{positioning} +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + + +\begin{tikzpicture} + +\umlclass{Node}{ +}{ + int:node\_id=None\\ + int:parent\_id=None\\ + + string:scenario='simple'\\ + string:parameters={\color{red}(260et,320eta490)}\\ + list:children=[]\\ + list$<$dict$>$:conf\_attrs={\color{blue}[\{'et': \{'min': '260000.0', 'max': 'inf'\},}\\ \makebox[4cm]{}{\color{blue}'eta': \{'min': '3.2', 'max': '4.9'\}\}]}\\ + bool:tree\_top=True\\ +} +\umluniassoc[mult=0..*, recursive=-90|0|5.6cm, pos=0.95]{Node}{Node} +\umlnote[x = 10, y=2, width=120] {Node}{{\color{red} params} filled in by Parser + +TreeExpanderVisitor adds defaults, fills in {\color{blue} conf\_attrs}} + +\end{tikzpicture} + + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/recursive.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/recursive.tex new file mode 100644 index 0000000000000000000000000000000000000000..bd48b48cc3357ea5bbfcb1ea8e9788fa5f7c0525 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/recursive.tex @@ -0,0 +1,39 @@ +\documentclass[11pt]{amsart} +\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. +\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage[english]{babel} +\usepackage{tikz} +\usepackage{ifthen} +\usepackage{calc} +%\usepackage{pfgopts} +\usepackage{tikz-uml} +\usetikzlibrary{positioning} +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + + +\begin{tikzpicture} + +\umlclass{A}{}{list$<$A$>$} +\umlsimpleclass[x=5]{B} + +\umluniassoc[mult=0..*, recursive=-90|0|2cm, pos=0.95]{B}{B} + +\end{tikzpicture} + + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/visitor.tex b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/visitor.tex new file mode 100644 index 0000000000000000000000000000000000000000..231453c2b1087c5efedcd3b7265a838b9206b3fa --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/doc/Python/Pictures/visitor.tex @@ -0,0 +1,40 @@ +\documentclass[11pt]{amsart} +\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots. +\geometry{a4paper} % ... or a4paper or a5paper or ... +%\geometry{landscape} % Activate for for rotated page geometry +%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent +\usepackage{xstring} +\usepackage{graphicx} +\usepackage{amssymb} +\usepackage{epstopdf} +\usepackage[english]{babel} +\usepackage{tikz} +\usepackage{ifthen} +\usepackage{calc} +%\usepackage{pfgopts} +\usepackage{tikz-uml} +\usetikzlibrary{positioning} +\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png} + +\title{Brief Article} +\author{The Author} +%\date{} % Activate to display a given date or no date + +\begin{document} +%\maketitle +%\section{} +%\subsection{} + + +\begin{tikzpicture} + +\umlclass{A}{accept(visitor)}{children::list$<$A$>$} +\umlclass[x=5]{Visitor}{mod(A)}{} + +\umlnote[y=-4, width=100]{A}{accept(visitor)\{\\for (c : children)\{\\ \ c.accept(visitor)\\ \ visitor.mod(self)\\ \}} +\umlnote[x=5, y=-4, width=100]{Visitor}{mod(A)\{\\do something to or with A\\ \} } + +\end{tikzpicture} + + +\end{document} \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterFastReduction.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterFastReduction.py index 5f6f0b9a76d986dd879152a78f4a8fa3045da2f1..4c40fe3ef828d8b390e56b12e78b25acbc9cd2a1 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterFastReduction.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterFastReduction.py @@ -51,7 +51,8 @@ class ConditionsToolSetterFastReduction(object): 'smc': [CompFactory.TrigJetConditionConfig_smc, 0], 'jvt': [CompFactory.TrigJetConditionConfig_jvt, 0], 'all': [CompFactory.TrigJetConditionConfig_acceptAll, 0], - 'compound': [CompFactory.TrigJetConditionConfig_compound, 0], + 'capacitychecked': + [CompFactory.TrigJetConditionConfig_capacitychecked, 0], 'fastreduction': [CompFactory.TrigJetHypoToolConfig_fastreduction, 0], 'helper': [CompFactory.TrigJetHypoToolHelperMT, 0], } @@ -134,8 +135,11 @@ class ConditionsToolSetterFastReduction(object): # compound_condition_tools: # elemental condition maker AlgToolshelper by the compound condition # AlgTool - compound_condition_tools = [] - for c in node.conf_attrs: # loop over conditions + outer_condition_tools = [] + + # loop over elements of node.conf_attrs. The elements are (dict, int) + # int is multiplicity, dict holds Condition parameters. + for c, mult in node.conf_attrs: condition_tools = [] # elemental conditions for this compounnd ct. for k, v in c.items(): # loop over elemental conditions condition_tool = self._get_tool_instance(k) @@ -154,14 +158,15 @@ class ConditionsToolSetterFastReduction(object): condition_tools.append(condition_tool) - # create compound condition from elemental condition - compoundCondition_tool =self._get_tool_instance('compound') - compoundCondition_tool.conditionMakers = condition_tools + # create capacitychecked condition from elemental condition + condition_tool =self._get_tool_instance('capacitychecked') + condition_tool.conditionMakers = condition_tools + condition_tool.multiplicity = mult - # add compound condition to list - compound_condition_tools.append(compoundCondition_tool) + # add capacitychecked condition to list + outer_condition_tools.append(condition_tool) - return compound_condition_tools + return outer_condition_tools def _mod_leaf(self, node): """ Add Condition tools to For a leaf node.""" @@ -285,7 +290,9 @@ class ConditionsToolSetterFastReduction(object): else: # must have a tool for Gaudi to instantiate in - cmap[node.node_id] = self._get_tool_instance('all') + cmap[node.node_id] = self._get_tool_instance('capacitychecked') + cmap[node.node_id].conditionMakers = [self._get_tool_instance('all')] + cmap[node.node_id].multiplicity = 1 for cn in node.children: self._fill_conditions_map(cn, cmap) diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterFlowNetwork.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterFlowNetwork.py deleted file mode 100644 index 8be5b07f24ca6352a470aa26f79c47b178d75d8b..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterFlowNetwork.py +++ /dev/null @@ -1,390 +0,0 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration - -"""Instantiates TrigJetHypoToolConfig_flownetwork AlgTool -from a hypo tree.""" - -from __future__ import print_function - -from AthenaConfiguration.ComponentFactory import CompFactory -from TrigHLTJetHypo.node import Node - -from collections import defaultdict - -import copy - - -def is_leaf(node): - return node.scenario in ('simple', 'etaet', 'dijet', 'qjet') - - -def is_inner(node): - return node.scenario in ('root', 'and', 'combgen', 'partgen') - - -class ConditionsToolSetterFlowNetwork(object): - - """Visitor to set instantiated AlgTools to a jet hypo tree""" - - from TrigHLTJetHypo.ConditionsToolSetterFastReduction import ConditionsToolSetterFastReduction - JetMoments = ConditionsToolSetterFastReduction.JetMoments - - def __init__(self, name): - - self.name = name - # for simple, use TrigJetConditionConfig_etaet. Needs to be - # completed because simple can conain any single jet condition - self.tool_factories = { - 'eta': [CompFactory.TrigJetConditionConfig_abs_eta, 0], - 'peta': [CompFactory.TrigJetConditionConfig_signed_eta, 0], - 'neta': [CompFactory.TrigJetConditionConfig_signed_eta, 0], - 'et': [CompFactory.TrigJetConditionConfig_et, 0], - 'djmass': [CompFactory.TrigJetConditionConfig_dijet_mass, 0], - 'djdphi': [CompFactory.TrigJetConditionConfig_dijet_dphi, 0], - 'djdeta': [CompFactory.TrigJetConditionConfig_dijet_deta, 0], - 'qjmass': [CompFactory.TrigJetConditionConfig_qjet_mass, 0], - 'smc': [CompFactory.TrigJetConditionConfig_smc, 0], - 'all': [CompFactory.TrigJetConditionConfig_acceptAll, 0], - 'compound': [CompFactory.TrigJetConditionConfig_compound, 0], - 'flownetwork': [CompFactory.TrigJetHypoToolConfig_flownetwork, 0], - 'helper': [CompFactory.TrigJetHypoToolHelperMT, 0], - } - for var in self.JetMoments: - self.tool_factories['mom'+var] = [CompFactory.TrigJetConditionConfig_moment, 0] - - # map conaining parent child ids for the node - self.treeMap = {0: 0} - - # map containing the a list of Condition factory AlgTools for scenario - self.conditionMakers = defaultdict(list) - - def _set_conditions(self, node): - """attach Conditions to leaf nodes""" - - self._mod_leaf(node) - - for cn in node.children: - self._set_conditions(cn) - - - def _remove_combgen(self, node): - """Combination nodes represent parent children relationships. - The child may be a subtree. For now, the parent will be in the - child list at position 0, and the child subtree in position 1.""" - - parent_children = {} - ipos = 0 - - # identify the combgen nodes, and rotate them - for cn in node.children: - if cn.scenario == 'combgen': - assert (len(cn.children) == 2) - parent_children[ipos] = cn.children - ipos += 1 - - # rotate the first combgen child (parent) into the position of the - # combgen node, and set its child node. - for pos, p_c in parent_children.items(): - node.children[pos] = p_c[0] - node.children[pos].children = [p_c[1]] - - for cn in node.children: - self._remove_combgen(cn) - - def _remove_scenario(self, node, scenario): - """Remove Partgen nodes by adding their children to their - parent's children.""" - - def remove_scenario(node, scenario): - for cn in node.children: - if cn.scenario == scenario: - node.children.remove(cn) - node.children.extend(cn.children) - return True - - return False - - more = True - while(more): - more = remove_scenario(node, scenario) - - for cn in node.children: - self._remove_scenario(cn, scenario) - - - def _get_tool_instance(self, key, extra=''): - - klass = self.tool_factories[key][0] - sn = self.tool_factories[key][1] - - name = '%s_%d_fn' % (key, sn) - if extra: name += '_' + extra - tool = klass(name=name) - self.tool_factories[key][1] += 1 - return tool - - def _make_compound_condition_tools(self, node): - - # compound_condition_tools: - # elemental condition maker AlgToolshelper by the compound condition - # AlgTool - compound_condition_tools = [] - for c in node.conf_attrs: # loop over conditions - condition_tools = [] # elemental conditions for this compounnd ct. - for k, v in c.items(): # loop over elemental conditions - condition_tool = self._get_tool_instance(k) - for lim, val in v.items(): # lim: min, max - setattr(condition_tool, lim, val) - - # SPECIAL CASE: Moment tool needs the name of the - # moment as well as the min. max cuts: - if (k.startswith ('mom')): - moment = k[len('mom'):] - if moment in self.JetMoments: - condition_tool.moment = self.JetMoments[moment] - else: raise RuntimeError('%s not supported' % (moment)) - # END SPECIAL CASE - - condition_tools.append(condition_tool) - - # create compound condition from elemental condition - compoundCondition_tool =self._get_tool_instance('compound') - compoundCondition_tool.conditionMakers = condition_tools - - # add compound condition to list - compound_condition_tools.append(compoundCondition_tool) - - return compound_condition_tools - - def _mod_leaf(self, node): - """ Add Condition tools to For a leaf node.""" - - if not is_leaf(node): - return - - # parameters: (10et,0eta320)(20et) - # conf_attrs: [2]: (is a list of length 2) - # defaultdict(<type 'dict'>, {'et': {'max': 'inf', 'min': '10000.0'}, - # 'eta': {'max': '3.2', 'min': '0.0'}}) - # defaultdict(<type 'dict'>, {'et': {'max': 'inf', 'min': '20000.0'}}) - - - # make a config tool and provide it with condition makers - - - node.compound_condition_tools = self._make_compound_condition_tools( - node) - - def _split_leaves(self, node): - """Recursively replace leaf nodes with >1 Condition tools by nodes with - one Condition tool.""" - - def split_leaves(node): - for cn in node.children: - if is_leaf(cn): - if len(cn.compound_condition_tools) > 1: - new_children = [] - new_node = copy.deepcopy(cn) - # set scenarrio to other than leaf results in - # the assignement of an acceptall condition - new_node.scenario = 'inserted' - new_node.compound_condition_tools = [] - for ct in cn.compound_condition_tools: - new_children.append(copy.deepcopy(cn)) - new_children[-1].compound_condition_tools = [ct] - new_children[-1].conf_attrs = [] - new_node.children.extend(new_children) - node.children.remove(cn) - node.children.append(new_node) - return True # return after first modification - - return False - - - more = True - while(more): - more = split_leaves(node) - - for cn in node.children: - self._split_leaves(cn) - - - def _find_shared(self, node, shared): - """Determine which nodes are "shared" - shared nodes - are nodes that see the input jet collection. There - more than one set of shared nodes. These are generated - if an "And" not is present in the hypo tree""" - - - if node.scenario == 'root': - for cn in node.children: - self._find_shared(cn, shared) - - elif node.scenario == 'and': - for cn in node.children: - shared.append([]) - self._find_shared(cn, shared) - - elif node.scenario == 'partgen': - for cn in node.children: - self._find_shared(cn, shared) - - elif node.scenario == 'inserted': - for cn in node.children: - self._find_shared(cn, shared) - - elif is_leaf(node): - if len(node.children) == 0: - if len(shared) == 0: - shared.append([node]) - else: - shared[-1].append(node) - - else: - for cn in node.children: - self._find_shared(cn, shared) - - else: - raise RuntimeError('%s illegal node. scenario: %s' % - (self.__class__.__name__, - node.scenario)) - - return shared - - - - def report(self): - wid = max(len(k) for k in self.tool_factories.keys()) - rep = '\n%s: ' % self.__class__.__name__ - - rep += '\n'.join( - ['%s: %d' % (k.ljust(wid), v[1]) - for k, v in self.tool_factories.items()]) - - return rep - - def _fill_tree_map(self, node, tmap): - tmap[node.node_id] = node.parent_id - - for cn in node.children: - self._fill_tree_map(cn, tmap) - - - def _fill_conditions_map(self, node, cmap): - if is_leaf(node): - - assert (len(node.compound_condition_tools) == 1) - cmap[node.node_id] = node.compound_condition_tools[0] - - else: - # must have a tool for Gaudi to instantiate in - cmap[node.node_id] = self._get_tool_instance('all') - - for cn in node.children: - self._fill_conditions_map(cn, cmap) - - - def _map_2_vec(self, amap): - - vec = [0 for i in range(len(amap))] - for nid, value in amap.items(): - vec[nid] = value - return vec - - def _check_scenarios(self, node): - if not(is_inner(node) or is_leaf(node)): - raise RuntimeError( - 'ConditionsToolSetter: illegal scenario: %s' % node.scenario) - - for cn in node.children: - self._check_scenarios(cn) - - def mod(self, node): - """Entry point for this module. - Modifies a (usually compound) hypo tree node to - reduce it to form from whuch the treevector, conditionsVector and - sharedNodes list can be extracted. These will be used to initialise - FlowNetworkBuilder. - - In particular: all leaf nodes will have a single ConmpoundCondition - All other nodes will be assigned an AcceptAll condition. - """ - - # navigate the tree filling in node-parent and node- Condtion factory - # relations - - print ('%s: starts' % self.__class__.__name__) - - - print ('%s: start step 1' % self.__class__.__name__) - - # Alg step 1: add root node - root = Node(scenario='root') - root.children = [node] - - print ('%s: checking scenarios' % self.__class__.__name__) - - self._check_scenarios(root) - - print ('%s: setting conditions' % self.__class__.__name__) - # add Condition builders to leaf nodes. - self._set_conditions(root) - - print ('%s: removing combgen' % self.__class__.__name__) - # Alg step 2: remove combgen nodes - self._remove_combgen(root) - - print ('%s: split leaves' % self.__class__.__name__) - # Alg step 3: split leaf nodes with multiple Conditions with a - # single Condition - self._split_leaves(root) - - ## print ('%s: remove partgen' % self.__class__.__name__) - # Alg step 4: remove partgen nodes - # single Condition - ## self._remove_scenario(root, 'partgen') - - # Alg step 5: identify the leaf nodes that are to shared - # ie that see the input jet collection. Then remove And nodes - shared = [] - slist = self._find_shared(root, shared) - self._remove_scenario(root, 'and') - - # remove top stub node - assert len(root.children) == 1 - root = root.children[0] - root.set_ids(node_id=0, parent_id = 0) - - # would like to pass a list of lists to the C++ tools - # but this cannot be done using Gaudi::Properties. - # use -1 to separate the list sections all entries of which - # are >= 0. - - self.shared = [] - for ilist in slist: - for n in ilist: - self.shared.append(n.node_id) - self.shared.append(-1) - - self.shared = self.shared[:-1] # remnove trailing -1 - - tree_map = {} - self._fill_tree_map(root, tree_map) - self.treeVec = self._map_2_vec(tree_map) - - conditionsMap = {} - self._fill_conditions_map(root, conditionsMap) - self.conditionsVec = self._map_2_vec(conditionsMap) - - # make a config tool and provide it with condition makers - config_tool = self._get_tool_instance('flownetwork') - config_tool.conditionMakers = self.conditionsVec - config_tool.treeVector = self.treeVec - config_tool.sharedVector = self.shared - - nodestr = 'n%dp%d' % (node.node_id, node.parent_id) - helper_tool = self._get_tool_instance('helper', extra=nodestr) - helper_tool.HypoConfigurer = config_tool - helper_tool.node_id = node.node_id - helper_tool.parent_id = node.parent_id - - self.tool = helper_tool diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterHT.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterHT.py index c2a8236c6df68863d486377e849eea253deb10fc..4af4a67d4c26bca4901590eafb9cb99c7b3d5878 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterHT.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterHT.py @@ -73,7 +73,11 @@ class ConditionsToolSetterHT(object): conditionMaker = self._get_tool_instance('htcondition') config_tool = self._get_tool_instance('htconfig') cut_windows = {} - [cut_windows.update(d) for d in node.conf_attrs] + + # HT not handled by FastReducer. Cut mulitplicity must be 1. + for d in node.conf_attrs: assert d[1] == 1 + + [cut_windows.update(d[0]) for d in node.conf_attrs] print (cut_windows) conditionMaker.htmin = cut_windows['ht']['min'] conditionMaker.etmin = cut_windows['et']['min'] diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterTree.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterTree.py deleted file mode 100644 index 22068d617e32115a7d7ba562d57285b30000ca62..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ConditionsToolSetterTree.py +++ /dev/null @@ -1,257 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -"""Instantiates TrigJetHypoToolConfig_flownetwork AlgTool -from a hypo tree.""" - -from __future__ import print_function - - -from AthenaConfiguration.ComponentFactory import CompFactory - -from collections import defaultdict - -class ConditionsToolSetterTree(object): - """Visitor to set instantiated AlgTools to a jet hypo tree""" - - from TrigHLTJetHypo.ConditionsToolSetterFastReduction import ConditionsToolSetterFastReduction - JetMoments = ConditionsToolSetterFastReduction.JetMoments - - def __init__(self, name): - - self.name = name - # for simple, use TrigJetConditionConfig_etaet. Needs to be - # completed because simple can conain any single jet condition - self.tool_factories = { - 'eta': [CompFactory.TrigJetConditionConfig_abs_eta, 0], - 'peta': [CompFactory.TrigJetConditionConfig_signed_eta, 0], - 'neta': [CompFactory.TrigJetConditionConfig_signed_eta, 0], - 'et': [CompFactory.TrigJetConditionConfig_et, 0], - 'djmass': [CompFactory.TrigJetConditionConfig_dijet_mass, 0], - 'djdphi': [CompFactory.TrigJetConditionConfig_dijet_dphi, 0], - 'djdeta': [CompFactory.TrigJetConditionConfig_dijet_deta, 0], - 'qjmass': [CompFactory.TrigJetConditionConfig_qjet_mass, 0], - 'smc': [CompFactory.TrigJetConditionConfig_smc, 0], - 'jvt': [CompFactory.TrigJetConditionConfig_jvt, 0], - 'compound': [CompFactory.TrigJetConditionConfig_compound, 0], - 'leaf': [CompFactory.TrigJetHypoToolConfig_leaf, 0], - 'helper': [CompFactory.TrigJetHypoToolHelperMT, 0], - 'combgen_helper': [CompFactory.CombinationsHelperTool, 0], - 'not': [CompFactory.NotHelperTool, 0], - 'and': [CompFactory.AndHelperTool, 0], - 'agree': [CompFactory.AgreeHelperTool, 0], - 'or': [CompFactory.OrHelperTool, 0], - 'combgen': [CompFactory.TrigJetHypoToolConfig_combgen, 0], - 'partgen': [CompFactory.TrigJetHypoToolConfig_partgen, 0], - } - for var in self.JetMoments: - self.tool_factories['mom'+var] = [CompFactory.TrigJetConditionConfig_moment, 0] - - self.mod_router = { - 'z': self._mod_z, - 'not': self.mod_logical_unary, - 'and': self.mod_logical_binary, - 'agree': self.mod_logical_binary, - 'or': self.mod_logical_binary, - 'combgen': self._mod_combgen, # shared with partgen - 'partgen': self._mod_combgen, # shared with combgen - 'simple': self._mod_leaf, - 'etaet': self._mod_leaf, - 'dijet': self._mod_leaf, - 'qjet': self._mod_leaf, - } - - # map conaining parent child ids for the node - self.treeMap = {0: 0} - - # map containing the a list of Condition factory AlgTools for scenario - self.conditionMakers = defaultdict(list) - - def not_supported_yet(self, node): - raise NotImplementedError( - 'ConditionsToolSetter: scenarion not yet supported: ' + node.scenario) - - - def illegal(self, node): - raise RuntimeError( - 'ConditionsToolSetter: illegal scenario: %s' + node.scenario) - - def _mod_z(self, node): - """z is the root node: process its children""" - - for cn in node.children: - self.mod_router[cn.scenario](cn) - - def mod_logical_binary(self, node): - """Set the HypoConfigTool instance the 'and' and 'or' scenarios - these take two predicates""" - - scen = node.scenario - klass = self.tool_factories[scen][0] - sn = self.tool_factories[scen][1] - name = '%s_%d' % (scen, sn) - self.tool_factories[scen][1] += 1 - - tool = klass(name=name) - - tool.lhs = node.children[0].tool - tool.rhs = node.children[1].tool - - tool.node_id = node.node_id - tool.parent_id = node.parent_id - - node.tool = tool - - def mod_logical_unary(self, node): - """Set the HypoConfigTool instance for the 'not' scenario - this takes a single predicate""" - - scen = node.scenario - klass = self.tool_factories[scen][0] - sn = self.tool_factories[scen][1] - name = '%s_%d' % (scen, sn) - self.tool_factories[scen][1] += 1 - - tool = klass(name=name) - - tool.hypoTool = node.children[0].tool - - tool.node_id = node.node_id - tool.parent_id = node.parent_id - - node.tool = tool - - def _mod_combgen(self, node): - """Set the HypoConfigTool instance for the combgen or partgeen scenario - these take different condifiguration tools.""" - - config_tool = self._get_tool_instance(node.scenario) - - compound_condition_tools = self._make_compound_condition_tools(node) - config_tool.conditionMakers = compound_condition_tools - # for combinational nodes, the connection between job groups and - # child helper tools is done via a matcher. Provide the helper - # tool children to the condig class which uses them to - # construct the matcher. - config_tool.children = [child.tool for child in node.children] - - nodestr = 'n%dp%d' % (node.node_id, node.parent_id) - helper_tool = self._get_tool_instance('combgen_helper', extra=nodestr) - - helper_tool.HypoConfigurer = config_tool - - helper_tool.node_id = node.node_id - helper_tool.parent_id = node.parent_id - - node.tool = helper_tool - - def _get_tool_instance(self, key, extra=''): - - klass = self.tool_factories[key][0] - sn = self.tool_factories[key][1] - - name = '%s_%d' % (key, sn) - if extra: name += '_' + extra - tool = klass(name=name) - self.tool_factories[key][1] += 1 - return tool - - def _make_compound_condition_tools(self, node): - - # compound_condition_tools: - # elemental condition maker AlgToolshelper by the compound condition - # AlgTool - compound_condition_tools = [] - for c in node.conf_attrs: # loop over conditions - condition_tools = [] # elemental conditions for this compounnd ct. - for k, v in c.items(): # loop over elemental conditions - condition_tool = self._get_tool_instance(k) - for lim, val in v.items(): # lim: min, max - setattr(condition_tool, lim, val) - - # SPECIAL CASE: Moment tool needs the name of the - # moment as well as the min. max cuts: - if (k.startswith ('mom')): - moment = k[len('mom'):] - if moment in self.JetMoments: - condition_tool.moment = self.JetMoments[moment] - else: raise RuntimeError('%s not supported' % (moment)) - # END SPECIAL CASE - - condition_tools.append(condition_tool) - - # create compound condition from elemental condition - compoundCondition_tool =self._get_tool_instance('compound') - compoundCondition_tool.conditionMakers = condition_tools - - # add compound condition to list - compound_condition_tools.append(compoundCondition_tool) - - return compound_condition_tools - - def _mod_leaf(self, node): - """For a leaf node, fill in - 1. map conaining parent child ids for the node - 2. map conainting the AlgTool used to instanitiate the node Conditions - """ - - self.treeMap[node.node_id] = node.parent_id - - # - # parameters: (10et,0eta320)(20et) - # conf_attrs: [2]: (is a list of length 2) - # defaultdict(<type 'dict'>, {'et': {'max': 'inf', 'min': '10000.0'}, - # 'eta': {'max': '3.2', 'min': '0.0'}}) - # defaultdict(<type 'dict'>, {'et': {'max': 'inf', 'min': '20000.0'}}) - - - # make a config tool and provide it with condition makers - config_tool = self._get_tool_instance('leaf') - compound_condition_tools = self._make_compound_condition_tools(node) - config_tool.conditionMakers = compound_condition_tools - - nodestr = 'n%dp%d' % (node.node_id, node.parent_id) - helper_tool = self._get_tool_instance('helper', extra=nodestr) - - helper_tool.HypoConfigurer = config_tool - helper_tool.node_id = node.node_id - helper_tool.parent_id = node.parent_id - - node.tool = helper_tool - - def report(self): - wid = max(len(k) for k in self.tool_factories.keys()) - rep = '\n%s: ' % self.__class__.__name__ - - rep += '\n'.join( - ['%s: %d' % (k.ljust(wid), v[1]) - for k, v in self.tool_factories.items()]) - - return rep - - - def mod(self, node): - """Entry mode for this module. Uses a (usaully compound) hypo tree node. - - The Tools set in the tree nodes are TrigJetConditionConfig_XXX - objects. These are factories for Condition objects - - The tree use used to - = find the tree vector (node-parent relationsships) - = find the node - Condition factory relationships - = instantiate and return a TrigJetHypoToolConfig_flownetwork instance. - """ - - # navigate the tree filling in node-parent and node- Condtion factory - # relations - - self.mod_router[node.scenario](node) - - def __str__(self): - s = '%s: treeMap: %s, conditionMakers [%d]: ' % ( - self.__class__.__name__, - str(self.treeMap), - len(self.conditionMakers)) - - if self.conditionMakers: - s += '\n' - for cm in self.conditionMakers.values(): - s += cm.__class__.__name__ + '\n' - - return s diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/FlowNetworkSetter.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/FlowNetworkSetter.py deleted file mode 100644 index 3e71406c602237a93233c491b6367c722a8e2fc9..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/FlowNetworkSetter.py +++ /dev/null @@ -1,257 +0,0 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -"""Instantiates TrigJetHypoToolConfig_flownetwork AlgTool -from a hypo tree.""" - - -from __future__ import print_function - -from TrigHLTJetHypo.TrigHLTJetHypoConf import ( - TrigJetConditionConfig_abs_eta, - TrigJetConditionConfig_et, - TrigJetHypoToolHelperMT, - CombinationsHelperTool, - TrigJetHypoToolConfig_flownetwork, - ) - -from node import rotate - -from collections import defaultdict - -class FlowNetworkSetter(object): - """Visitor to set instantiated AlgTools to a jet hypo tree""" - - def __init__(self, name): - - self.name = name - # for simple, use TrigJetConditionConfig_etaet. Needs to be - # completed because simple can conain any single jet condition - self.tool_factories = { - 'et': [TrigJetConditionConfig_et, 0], - 'eta': [TrigJetConditionConfig_abs_eta, 0], - } - - self.nodeToParent=defaultdict(list) - self.nodeToConditionTool=defaultdict(list) - - self.mod_router = { - 'not': self.not_supported_yet, - 'and': self.illegal, - 'agree': self.not_supported_yet, - 'or': self.not_supported_yet, - 'simple': self._mod_leaf, - 'etaet': self._mod_leaf, - 'simplepartition': self.not_supported_yet, - 'combgen': self.illegal, - 'partgen': self._mod_partition, - 'dijet': self._mod_leaf, - } - - # map conaining parent child ids for the node - self.treeMap = {} - - # map containing the a list of Condition factory AlgTools for scenario - self.conditionMakers = {} - - def not_supported_yet(self, node): - raise NotImplementedError( - 'FlowNetworkSetter: scenarion not yet supported: ' + node.scenario) - - - def illegal(self, node): - raise RuntimeError( - 'FlowNetworkSetter: illegal scenario: %s' + node.scenario) - - def mod_logical_binary(self, node): - """Set the HypoConfigTool instance the 'and' and 'or' scenarios - these take two predicates""" - - scen = node.scenario - klass = self.tool_factories[scen][0] - sn = self.tool_factories[scen][1] - name = '%s_%d' % (scen, sn) - self.tool_factories[scen][1] += 1 - - tool = klass(name=name) - - tool.lhs = node.children[0].tool - tool.rhs = node.children[1].tool - - tool.node_id = node.node_id - tool.parent_id = node.parent_id - - node.tool = tool - - - def mod_logical_unary(self, node): - """Set the HypoConfigTool instance for the 'not' scenario - this takes a single predicate""" - - scen = node.scenario - klass = self.tool_factories[scen][0] - sn = self.tool_factories[scen][1] - name = '%s_%d' % (scen, sn) - self.tool_factories[scen][1] += 1 - - tool = klass(name=name) - - tool.hypoTool = node.children[0].tool - - tool.node_id = node.node_id - tool.parent_id = node.parent_id - - node.tool = tool - - - def mod_combgen(self, node): - """Set the HypoConfigTool instance for the 'not' scenario - this takes a single predicate""" - - scen = node.scenario - klass = self.tool_factories[scen][0] - sn = self.tool_factories[scen][1] - name = '%s_%d' % (scen, sn) - self.tool_factories[scen][1] += 1 - - config_tool = klass(name=name+'_config') - config_tool.children = [child.tool for child in node.children] - [setattr(config_tool, k, v) for k, v in node.conf_attrs.items()] - - helper_tool = CombinationsHelperTool(name=name+'_helper') - helper_tool.HypoConfigurer = config_tool - - helper_tool.node_id = node.node_id - helper_tool.parent_id = node.parent_id - - node.tool = helper_tool - - def mod_simple(self, node): - """Set the TrigJetHypoToolHelperMT instance in a hypo tree node. - This Algtool will have a TrigJetHypoToolConfig_flownetwork - instance as an attribute, which it will use to configure itself. - """ - - scen = node.scenario - sn = self.tool_factories[scen][1] - self.tool_factories[scen][1] += 1 - - config_tool = TrigJetHypoToolConfig_flownetwork - [setattr(config_tool, k, v) for k, v in node.conf_attrs.items()] - - name = '%s_helper_%d' % (scen, sn) - helper_tool = TrigJetHypoToolHelperMT(name=name) - helper_tool.HypoConfigurer = config_tool - helper_tool.node_id = node.node_id - helper_tool.parent_id = node.parent_id - - node.tool = helper_tool - - def _mod_partition(self, node): - - scen = node.scenario - klass = self.tool_factories[scen][0] - sn = self.tool_factories[scen][1] - name = '%s_%d' % (scen, sn) - - self.tool_factories[scen][1] += 1 - config_tool = klass(name=name) - - self.treeMap[node.node_id] = node.parent_id - self.conditionMakers[node.node_id].append(config_tool) - - - def _mod_leaf(self, node): - """For a leaf node, fill in - 1. map conaining parent child ids for the node - 2. map conainting the AlgTool used to instanitiate the node Conditions - """ - - self.treeMap[node.node_id] = node.parent_id - - scen = node.scenario - - for k, v in node.conf_attrs.items(): - - klass = self.tool_factories[scen][0] - sn = self.tool_factories[scen][1] - - name = '%s_%d' % (scen, sn) - config_tool = klass(name=name) - setattr(config_tool, k, v) - self.conditionMakers[node.node_id].append(config_tool) - self.tool_factories[scen][1] += 1 - - # klass = self.tool_factories[scen][0] - # sn = self.tool_factories[scen][1] - # name = '%s_%d' % (scen, sn) - - # self.tool_factories[scen][1] += 1 - - # config_tool = klass(name=name) - # [setattr(config_tool, k, v) for k, v in node.conf_attrs.items()] - # self.conditionMakers[node.node_id] = config_tool - - for cn in node.children: - self.mod_router[cn.scenario](cn) - - def report(self): - wid = max(len(k) for k in self.tool_factories.keys()) - rep = '\n%s: ' % self.__class__.__name__ - - rep += '\n'.join( - ['%s: %d' % (k.ljust(wid), v[1]) - for k, v in self.tool_factories.items()]) - - return rep - - - def mod(self, node): - """Entry mode for this module. Uses a (usaully compound) hypo tree node. - - The Tools set in the tree nodes are TrigJetConditionConfig_XXX - objects. These are factories for Condition objects - - The tree use used to - = find the tree vector (node-parent relationsships) - = find the node - Condition factory relationships - = instantiate and return a TrigJetHypoToolConfig_flownetwork instance. - """ - - new_node = rotate(node) - new_node.set_ids(0, 0) - - # navigate the tree filling in node-parent and node- Condtion factory - # relations - self.mod_router[new_node.scenario](new_node) - - config_tool = TrigJetHypoToolConfig_flownetwork() - - treeVec = [0 for i in range(len(self.treeMap))] - for n, p in self.treeMap.items(): - treeVec[n] = p - - config_tool.treeVector = treeVec - - conditionMakers = [None for i in range(len(self.treeMap))] - for n, p in self.conditionMakers.items(): - conditionMakers[n] = p - - - assert None not in conditionMakers - - config_tool.conditionMakers = conditionMakers - - self.tool = TrigJetHypoToolHelperMT( - name='TrigJetHypoToolConfig_flownetwor_helper') - - self.tool.HypoConfigurer = config_tool - - def __str__(self): - s = '%s: treeMap: %s, conditionMakers [%d]: ' % ( - self.__class__.__name__, - str(self.treeMap), - len(self.conditionMakers)) - - if self.conditionMakers: - s += '\n' - for cm in self.conditionMakers.values(): - s += cm.__class__.__name__ + '\n' - - return s diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ToolSetter.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ToolSetter.py deleted file mode 100644 index e23af42ec6db951dcd29cad727fdc8714a015f74..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/ToolSetter.py +++ /dev/null @@ -1,183 +0,0 @@ -"""Instantiates AlgTools from parameters stored in a node instance""" - -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -from TrigHLTJetHypo.TrigHLTJetHypoConf import ( - TrigJetHypoToolConfig_simple, - TrigJetConditionConfig_et, - TrigJetConditionConfig_abs_eta, - TrigJetConditionConfig_dijet_mass, - TrigJetConditionConfig_dijet_deta, - TrigJetConditionConfig_dijet_dphi, - TrigJetHypoToolConfig_simple_partition, - TrigJetHypoToolConfig_dijet, - NotHelperTool, - AndHelperTool, - OrHelperTool, - TrigJetHypoToolHelperMT, - CombinationsHelperTool, - TrigJetHypoToolConfig_combgen, - TrigJetHypoToolConfig_partgen, -) - -from TrigHLTJetHypoUnitTests.TrigHLTJetHypoUnitTestsConf import ( - AgreeHelperTool, -) - -class ToolSetter(object): - """Visitor to set instantiated AlgTools to a jet hypo tree""" - - def __init__(self, name): - - self.tool_factories = { - 'simple': [TrigJetHypoToolConfig_simple, 0], - 'simplepartition': [TrigJetHypoToolConfig_simple_partition, 0], - 'not': [NotHelperTool, 0], - 'and': [AndHelperTool, 0], - 'agree': [AgreeHelperTool, 0], - 'or': [OrHelperTool, 0], - 'dijet': [TrigJetHypoToolConfig_dijet, 0], - 'combgen': [TrigJetHypoToolConfig_combgen, 0], - 'partgen': [TrigJetHypoToolConfig_partgen, 0], - 'et': [TrigJetConditionConfig_et, 0], - 'eta': [TrigJetConditionConfig_abs_eta, 0], - 'dijet_mass': [TrigJetConditionConfig_dijet_mass, 0], - 'dijet_deta': [TrigJetConditionConfig_dijet_deta, 0], - 'dijet_dphi': [TrigJetConditionConfig_dijet_dphi, 0], - } - - self.mod_router = { - 'not': self.mod_logical_unary, - 'and': self.mod_logical_binary, - 'agree': self.mod_logical_binary, - 'or': self.mod_logical_binary, - 'simple': self.mod_simple, - 'simplepartition': self.mod_simple, - 'combgen': self.mod_combgen, # shared with partgen - 'partgen': self.mod_combgen, # shared with combgen - 'dijet': self.mod_dijet, - } - - def mod_logical_binary(self, node): - """Set the HypoConfigTool instance the 'and' and 'or' scenarios - these take two predicates""" - - scen = node.scenario - klass = self.tool_factories[scen][0] - sn = self.tool_factories[scen][1] - name = '%s_%d' % (scen, sn) - self.tool_factories[scen][1] += 1 - - tool = klass(name=name) - - # print 'ToolSetter, setting lhs ', node.children[0].tool - tool.lhs = node.children[0].tool - tool.rhs = node.children[1].tool - - tool.node_id = node.node_id - tool.parent_id = node.parent_id - - node.tool = tool - - - def mod_logical_unary(self, node): - """Set the HypoConfigTool instance for the 'not' scenario - this takes a single predicate""" - - scen = node.scenario - klass = self.tool_factories[scen][0] - sn = self.tool_factories[scen][1] - name = '%s_%d' % (scen, sn) - self.tool_factories[scen][1] += 1 - - tool = klass(name=name) - - # print 'ToolSetter, setting lhs ', node.children[0].tool - tool.hypoTool = node.children[0].tool - - tool.node_id = node.node_id - tool.parent_id = node.parent_id - - node.tool = tool - - - def mod_combgen(self, node): - """Set the HypoConfigTool instance for the 'not' scenario - this takes a single predicate""" - - scen = node.scenario - klass = self.tool_factories[scen][0] - sn = self.tool_factories[scen][1] - name = '%s_%d' % (scen, sn) - self.tool_factories[scen][1] += 1 - - config_tool = klass(name=name+'_config') - config_tool.children = [child.tool for child in node.children] - [setattr(config_tool, k, v) for k, v in node.conf_attrs.items()] - - helper_tool = CombinationsHelperTool(name=name+'_helper') - helper_tool.HypoConfigurer = config_tool - - helper_tool.node_id = node.node_id - helper_tool.parent_id = node.parent_id - - node.tool = helper_tool - - def mod_simple(self, node): - """Set the HypoConfigTool instance in a hypo tree node""" - - scen = node.scenario - klass = self.tool_factories[scen][0] - - sn = self.tool_factories[scen][1] - name = '%s_%d' % (scen, sn) - - self.tool_factories[scen][1] += 1 - - - - config_tool = klass(name=name+'_config') - [setattr(config_tool, k, v) for k, v in node.conf_attrs.items()] - - helper_tool = TrigJetHypoToolHelperMT(name=name+'_helper') - helper_tool.HypoConfigurer = config_tool - helper_tool.node_id = node.node_id - helper_tool.parent_id = node.parent_id - - node.tool = helper_tool - - def mod_dijet(self, node): - """Set the HypoConfigTool instance in a hypo tree node""" - - scen = node.scenario - klass = self.tool_factories[scen][0] - sn = self.tool_factories[scen][1] - name = '%s_%d' % (scen, sn) - - self.tool_factories[scen][1] += 1 - - config_tool = klass(name=name+'_config') - [setattr(config_tool, k, v) for k, v in node.conf_attrs.items()] - helper_tool = TrigJetHypoToolHelperMT(name=name+'_helper') - helper_tool.HypoConfigurer = config_tool - - helper_tool.node_id = node.node_id - helper_tool.parent_id = node.parent_id - - node.tool = helper_tool - - def mod(self, node): - """Set the HypoConfigTool instance according to the scenario. - Note: node.accept must perform depth first navigation to ensure - child tools are set.""" - - self.mod_router[node.scenario](node) - - def report(self): - wid = max(len(k) for k in self.tool_factories.keys()) - rep = '\n%s: ' % self.__class__.__name__ - - rep += '\n'.join( - ['%s: %d' % (k.ljust(wid), v[1]) - for k, v in self.tool_factories.items()]) - - return rep diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py index a1e5c78989eb28ef3c7e0c546823be1e8d8ccb38..f433cd6f8264ba9b78597035d0a7c2a1a1c851a0 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/TrigJetHypoToolConfig.py @@ -4,7 +4,6 @@ from __future__ import print_function from AthenaConfiguration.ComponentFactory import CompFactory from TrigHLTJetHypo.treeVisitors import TreeParameterExpander -from TrigHLTJetHypo.ConditionsToolSetterTree import ConditionsToolSetterTree from TrigHLTJetHypo.ConditionsToolSetterFastReduction import ( ConditionsToolSetterFastReduction, ) @@ -28,7 +27,6 @@ def trigJetHypoToolHelperFromDict_(chain_label, tree = parser.parse() - #expand strings of cuts to a cut dictionary visitor = TreeParameterExpander() tree.accept(visitor) @@ -47,28 +45,8 @@ def trigJetHypoToolHelperFromDict_(chain_label, log.info('trigJetHypoToolFromDict chain_name %s', chain_name) - # debug flag to be relayed to C++ objects - tool = None - - if toolSetter is None: - toolSetter = ConditionsToolSetterTree(chain_name) - tree.accept(modifier=toolSetter) - tool = tree.tool - else: - - if toolSetter.__class__.__name__ in ( - 'ConditionsToolSetterFastReduction', - 'ConditionsToolSetterHT'): - toolSetter.mod(tree) - tool = toolSetter.tool - - elif toolSetter.__class__.__name__ in ( - 'ConditionsToolSetterTree',): - tree.accept(modifier=toolSetter) - tool = tree.tool - else: - toolSetter = ConditionsToolSetterTree(chain_name) - tool = tree.tool + toolSetter.mod(tree) + tool = toolSetter.tool log.debug(visitor.report()) diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/jetlabel_tester.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/jetlabel_tester.py index b65e0c0dd96372e1dbdee9602626e2fd402795d7..5741fdbf50b80b3bb1970d75d172f0b7aa5c9e49 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/jetlabel_tester.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/jetlabel_tester.py @@ -1,15 +1,14 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """Utility to test whether a string is a legal jet chain label""" from __future__ import print_function from ChainLabelParser import ChainLabelParser from TrigHLTJetHypo.treeVisitors import TreeParameterExpander -from TrigHLTJetHypo.ConditionsToolSetterTree import ConditionsToolSetterTree -from TrigHLTJetHypo.ConditionsToolSetterFlowNetwork import ( - ConditionsToolSetterFlowNetwork,) +from TrigHLTJetHypo.ConditionsToolSetterFastReduction import ( + ConditionsToolSetterFastReduction,) -def compile(label, setter=None, expand=False, do_dump=False, do_print=False): +def compile(label, setter, expand=False, do_dump=False, do_print=False): print ('compile:', label) parser = ChainLabelParser(label, debug=False) @@ -22,13 +21,12 @@ def compile(label, setter=None, expand=False, do_dump=False, do_print=False): visitor = TreeParameterExpander() tree.accept(visitor) + if setter is not None: + setter.mod(tree) + print ('compile: tree.scenario', tree.scenario) - if setter is not None: - if setter.__class__.__name__ == 'ConditionsToolSetterFlowNetwork': - setter.mod(tree) - else: - raise NotImplementedError('Unknown setter ' + setter.__class__.__name__) + if do_print: print ('\nnode dumping top node only:\n') @@ -67,13 +65,11 @@ if __name__ == '__main__': print('index', index) label = test_strings[index] - setter = None - unused_setter0 = ConditionsToolSetterTree('toolSetter') - unised_setter1 = ConditionsToolSetterFlowNetwork('fnToolSetter') + setter = ConditionsToolSetterFastReduction('toolSetterFastReduction') tree = compile(label, setter=setter, expand=True, do_dump=True) - print ('tvec: %s' % str(setter.treeVec)) + print ('tvec: %s' % str(setter.tool)) print ('svec: %s' % setter.shared) print ('conditionsVec [%d]: %s' % (len(setter.conditionsVec), str(setter.conditionsVec))) diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py index 358e4e69bdad3672d6f3e67ff9eb3162e0e4c261..0b21c68951108579703549316f8444ceb08bbb15 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/node.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """ Node - represents a tree structure. scenario and parameters which are strings filled in while parsing a jet hyp[o label. A visitor is used to convert @@ -26,12 +26,16 @@ class Node(object): self.parameters = '' self.children = [] self.conf_attrs = [] # list of dictionaries - self.tool = None - self.compound_condition_tools = [] + + # filled in by a CondtionsTollSetter: + self.compound_condition_tools = [] + # self.tool = None + # self.compound_condition_tools = [] # self.tree_top kludge carensure top level tools get chain name # as Tool name self.tree_top = False - + self.tool = None + def set_ids(self, node_id, parent_id): "Set ids of nodes in a tree" diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py index 42d7d53e798c317e89f6927aa52c50a4cb63cfdb..312abad23137946c8b0fcaf66f80a6857404749e 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/testChainDictMaker.py @@ -37,6 +37,15 @@ def testChainDictMaker(): ChainProp(name='HLT_j0_vbenfSEP30etSEP34mass35SEP50fbet_L1J20', l1SeedThresholds=['FSNOSEED'], groups=MultiJetGroup), + + ChainProp(name='HLT_10j40_L1J15', + l1SeedThresholds=['FSNOSEED'], groups=MultiJetGroup), + + + # ChainProp(name='HLT_j70_j50 _0eta490_invm1000j50_dphi20_deta40_L1J20', + # l1SeedThresholds=['FSNOSEED']*2, + # groups=MultiJetGroup), + ] result = [] diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py index fbdf5b60bf4927a31e7accbc0a6144fc104686ee..c4c92e78b55762cf8f2cc0f55ca33b174d348923 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/python/treeVisitors.py @@ -4,8 +4,6 @@ from __future__ import absolute_import from .constants import lchars -from TrigHLTJetHypo.ToolSetter import ToolSetter - import re from collections import defaultdict @@ -134,12 +132,16 @@ class ConditionsDictMaker(object): cut vals. Example: makeDict('(10et,0eta320)') - returns the tuple dict, error, msgs : + returns the tuple: ([dict0, dict1,...] , error, msgs]: ( - {'eta_maxs': [3.2], 'EtThresholds': [10000.0], 'eta_mins': [0.0], 'asymmetricEtas': [0]}, - - False, - ['OK'] + [ + {'eta_maxs': [3.2], + 'EtThresholds': [10000.0], + 'eta_mins': [0.0], + 'asymmetricEtas': [0]} + ], + False, + ['OK'] ) dijets: parameter strings looks like '40mass, 0dphi20' @@ -184,12 +186,18 @@ class ConditionsDictMaker(object): # conditions example: ['10et,0eta320', '20et'] conditions = self.get_conditions(params) + # keep track of identical conditions (mult > 1) + + mult_conditions = defaultdict(int) + for c in conditions: mult_conditions[c] += 1 + result = [] msgs = [] - for c in conditions: # there is a parameter string for each condition + + # process each parameter string once. + for c, mult in mult_conditions.items(): # c is condition string cdict = defaultdict(dict) - print ('processing condition', c) toks = c.split(',') # parameters in par string are separated by ',' toks = [t.strip() for t in toks] @@ -244,7 +252,6 @@ class ConditionsDictMaker(object): sf = scaleFactors(attr) if lo: - print (attr, lo) # find the python proxy class name limits_dict['min'] = scale_limit(lo, sf) @@ -253,7 +260,7 @@ class ConditionsDictMaker(object): cdict[attr] = limits_dict - result.append(cdict) + result.append((cdict, mult)) # append dictionary and mult. # Example: input condition string: @@ -269,7 +276,6 @@ class ConditionsDictMaker(object): msgs = ['ConditionsDict OK'] error = False - print ('ConditionsDictMaker::makeDict(), result', result) return result, error, msgs @@ -444,60 +450,3 @@ class TreeParameterExpander(object): return self.expander.report() -def _test(s): - - from .ChainLabelParser import ChainLabelParser - parser = ChainLabelParser(s) - - parser.debug = True - - tree = parser.parse() - print(tree.dump()) - # exapnd the window cuts (strings) obtained from the chain label - # to attributes and floating point numbers, set defaults - # for unspecified vallues - visitor = TreeParameterExpander() - tree.accept(visitor) - - tree.set_ids(0, 0) - tree.accept(visitor) - print(visitor.report()) - print(tree.dump()) - - # set the node attribute node.tool to be the hypo Al\gTool. - print('sending in the ToolSetter visitor') - ts_visitor = ToolSetter(s) - tree.accept_cf(ts_visitor) - print(ts_visitor.report()) - - - # print tree.dump() - print(tree.tool) # printing a Gaudi tool prints its nested tools - - -def test(index): - from .test_cases import test_strings - import sys - if index not in range(len(test_strings)): - print ('expected int in [0,%d) ] on comand line, got %s' % ( - len(test_strings), c)) - sys.exit() - - print('index', index) - print('========== Test %d ==============' % index) - s = test_strings[index] - print(s) - _test(s) - - -if __name__ == '__main__': - import sys - - c = ''.join(sys.argv[1:]) - ic = -1 - try: - ic = int(c) - except Exception: - print('expected int on command line, got ',c) - sys.exit() - test(ic) diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.cxx index ade70fd5f59c4b4bc509d1b9a20a7399ae351415..073719bbe194f33b3c82403fa2c7f62bca97ab03 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ # #include "./AcceptAllConditionMT.h" @@ -41,7 +41,7 @@ AcceptAllConditionMT::isSatisfied(const HypoJetVector& ips, -std::string AcceptAllConditionMT::toString() const noexcept { +std::string AcceptAllConditionMT::toString() const { std::stringstream ss; ss << "AcceptAllConditionMT (" << this << ") capacity " << m_capacity <<'\n'; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.h index a60b7ef77358fb8f1948220e8e9922447d9b47e2..801cc2f8a9adc2386e42cc16533435369370f59d 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AcceptAllConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_ACCEPTALLMT_H @@ -31,7 +31,7 @@ class AcceptAllConditionMT: public IConditionMT{ const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; virtual unsigned int capacity() const override{return m_capacity;} - std::string toString() const noexcept override; + std::string toString() const override; private: diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.cxx deleted file mode 100644 index 7cbaf6684e2a9188de3ad978487261096eb326eb..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.cxx +++ /dev/null @@ -1,71 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: AndHelperTool.cxx -// PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo -// -// -// ******************************************************************** - -#include "AndHelperTool.h" - -#include "GaudiKernel/StatusCode.h" -#include "./ITrigJetHypoInfoCollector.h" -#include "./nodeIDPrinter.h" -#include "./JetTrigTimer.h" -#include <sstream> - -AndHelperTool::AndHelperTool(const std::string& type, - const std::string& name, - const IInterface* parent) : - base_class(type, name, parent){ -} - - -bool -AndHelperTool::pass(HypoJetVector& jets, - xAODJetCollector& jetCollector, - const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const { - ATH_MSG_DEBUG("AndHelperTool::pass... " << jets.size() << " jets"); - - JetTrigTimer timer; - if(collector){ - timer.start(); - } - bool pass = m_lhs->pass(jets, jetCollector, collector); - if (pass){ - ATH_MSG_DEBUG("LHS passed"); - pass = m_rhs->pass(jets, jetCollector, collector); - ATH_MSG_DEBUG("RHS " <<std::boolalpha << pass); - } else { - ATH_MSG_DEBUG("LHS failed"); - } - - if (collector){ - timer.stop(); - collector->collect(name(), nodeIDPrinter(name(), - m_nodeID, - m_parentNodeID, - pass, - timer.readAndReset())); - } - return pass; - -} - -std::string AndHelperTool::toString() const{ - return nodeIDPrinter(name(), m_nodeID, m_parentNodeID); -} - -StatusCode AndHelperTool::getDescription(ITrigJetHypoInfoCollector& c) const { - c.collect(name(), toString()); - return m_lhs->getDescription(c) & m_rhs->getDescription(c); -} - -std::size_t AndHelperTool::requiresNJets() const { - return m_lhs->requiresNJets() + m_rhs->requiresNJets(); -} - diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.h deleted file mode 100644 index 55d6ebab34d0c2ce922acb571d65029f4088ecdf..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/AndHelperTool.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TRIGHLTJETHYPO_ANDHELPERTOOLMT_H -#define TRIGHLTJETHYPO_ANDHELPERTOOLMT_H -/******************************************************************** - * - * NAME: AndHelperTool.h - * PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo - * - * - *********************************************************************/ - -#include "AthenaBaseComps/AthAlgTool.h" - -#include "TrigHLTJetHypo/ITrigJetHypoToolHelperMT.h" -#include "ITrigJetHypoToolConfig.h" -#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h" -#include "./ITrigJetHypoInfoCollector.h" - -class ITrigJetHypoInfoCollector; -class xAODJetCollector; - -class AndHelperTool: public extends<AthAlgTool, ITrigJetHypoToolHelperMT> { - - public: - - AndHelperTool(const std::string& type, - const std::string& name, - const IInterface* parent); - - bool pass(HypoJetVector&, - xAODJetCollector&, - const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - - virtual StatusCode getDescription(ITrigJetHypoInfoCollector&) const override; - virtual std::string toString() const override; - virtual std::size_t requiresNJets() const override; - - private: - - ToolHandle<ITrigJetHypoToolHelperMT> m_lhs { - this, "lhs", {}, "LHS boolean binary expression"}; - - ToolHandle<ITrigJetHypoToolHelperMT> m_rhs { - this, "rhs", {}, "RHS boolean binary expression"}; - - - Gaudi::Property<int> - m_parentNodeID {this, "parent_id", {}, "hypo tool tree parent node id"}; - - Gaudi::Property<int> - m_nodeID {this, "node_id", {}, "hypo tool tree node id"}; - - -}; -#endif diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bcf2cfe05335583b7c13ec757b2992e3f5acc40a --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.cxx @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#include "./CapacityCheckedCondition.h" + +#include <memory> +#include <string> + + +CapacityCheckedCondition::CapacityCheckedCondition(std::unique_ptr<IConditionMT> cp, std::size_t mult): + m_condition{std::move(cp)}, m_multiplicity{mult} {} + + +CapacityCheckedCondition::~CapacityCheckedCondition(){} + +bool +CapacityCheckedCondition::multiplicitySatisfied(std::size_t jgMultiplicity, + const Collector&) const { + return m_multiplicity <= jgMultiplicity; +} + +bool +CapacityCheckedCondition::isSatisfied(const HypoJetVector& v, + const std::unique_ptr<ITrigJetHypoInfoCollector>& c) const { + return m_condition->isSatisfied(v, c); +} + +unsigned int CapacityCheckedCondition::capacity() const { + return m_condition->capacity(); +} + +std::string CapacityCheckedCondition::toString() const { + std::stringstream ss; + const void* address = static_cast<const void*>(this); + + ss << "CapacityCheckedCondition (" << address << ") Multiplicity: " + << m_multiplicity << '\n' << m_condition->toString(); + + return ss.str(); +} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.h index 1455d594aca74b0d974e00e28cbf10abd9961a94..e01bcc13918d18baafbeb8412aa7e269ea32ca94 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CapacityCheckedCondition.h @@ -27,35 +27,25 @@ class ITrigJetHypoInfoCollector; class CapacityCheckedCondition: public ICapacityCheckedCondition { public: - CapacityCheckedCondition(std::unique_ptr<IConditionMT> cp): - m_condition{std::move(cp)} { - } + CapacityCheckedCondition(std::unique_ptr<IConditionMT> cp, + std::size_t mult); + virtual ~CapacityCheckedCondition(); - virtual ~CapacityCheckedCondition(){ - } - virtual bool - capacitySatisfied(std::size_t jgMultiplicity, - const Collector&) const override { - - return m_condition->capacity() <= jgMultiplicity; - } - - virtual bool isSatisfied(const HypoJetVector& v, - const std::unique_ptr<ITrigJetHypoInfoCollector>& c) const override { - return m_condition->isSatisfied(v, c); - } - - virtual unsigned int capacity() const override { - return m_condition->capacity(); - } + multiplicitySatisfied(std::size_t jgMultiplicity, + const Collector&) const override; + virtual bool + isSatisfied(const HypoJetVector& v, + const std::unique_ptr<ITrigJetHypoInfoCollector>& c) const override; - virtual std::string toString() const noexcept override { - return m_condition->toString(); - } + virtual unsigned int capacity() const override; - private: + virtual std::string toString() const override; + +private: + std::unique_ptr<IConditionMT> m_condition; + std::size_t m_multiplicity; }; #endif diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.cxx deleted file mode 100644 index 63cadefa74e1b5d523c478398a57bf61a2041974..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.cxx +++ /dev/null @@ -1,184 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#include "./CombinationsHelperTool.h" -#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CombinationsGrouper.h" -#include "./ITrigJetHypoInfoCollector.h" -#include "./nodeIDPrinter.h" -#include "./JetTrigTimer.h" -#include "./DebugInfoCollector.h" - -#include <sstream> - -CombinationsHelperTool::CombinationsHelperTool(const std::string& type, - const std::string& name, - const IInterface* parent) : - base_class(type, name, parent){ - -} - -StatusCode CombinationsHelperTool::initialize() { - - auto opt_conditions = m_config->getConditions(); - if(!opt_conditions.has_value()){ - ATH_MSG_ERROR("Error setting conditions"); - return StatusCode::FAILURE; - } - m_conditions = std::move(*opt_conditions); - - m_grouper = m_config->getJetGrouper(); - m_matcher = m_config->getMatcher(); - - return StatusCode::SUCCESS; -} - - -void -CombinationsHelperTool::collectData(const std::string& setuptime, - const std::string& exetime, - const std::unique_ptr<ITrigJetHypoInfoCollector>& collector, - - bool pass) const { - if(!collector){return;} - for(const auto& c: m_conditions){ - collector->collect("Condition", c->toString()); - } - auto helperInfo = nodeIDPrinter(name(), - m_nodeID, - m_parentNodeID, - pass, - exetime + setuptime - ); - - collector->collect(name(), helperInfo); -} - - -struct HypoJetSelector{ - // Selector jets according to OR of ocnditions objects. - // This predicate is intended to be used with an STL algorithm - HypoJetSelector(const ConditionsMT& conditions, - const std::unique_ptr<ITrigJetHypoInfoCollector>&collector ): - m_conditions(conditions), m_collector(collector){ - } - - bool operator()(pHypoJet j){ - - if(m_conditions.empty()){return true;} - - std::vector<pHypoJet> v{j}; - for(const auto& c : m_conditions) - { - if (c->isSatisfied(v, m_collector)) // there is a satisfied condition - { - return true; - } - } - - return false; // no condition satisfied - } - const ConditionsMT& m_conditions; - const std::unique_ptr<ITrigJetHypoInfoCollector>& m_collector; -}; - - -bool -CombinationsHelperTool::pass(HypoJetVector& jets, - xAODJetCollector& jetCollector, - const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const { - /* seek first jet group that passes all children */ - - // create vector of vector of jets - - JetTrigTimer exeTimer; - JetTrigTimer setupTimer; - - if(collector){ - std::string msg = "No of jets " + std::to_string(jets.size()); - collector->collect(name(), msg); - } - - - setupTimer.start(); - - auto end_iter = jets.end(); - - if(!m_conditions.empty()){ - - HypoJetSelector selector(m_conditions, collector); - - // use conditions objects to select jets - end_iter = std::partition(jets.begin(), - jets.end(), - selector); - } - - auto begin = jets.begin(); - std::vector<HypoJetGroupVector> jetGroupsVec = - m_grouper->group(begin, end_iter); - - setupTimer.stop(); - exeTimer.start(); - - bool passed{false}; - - if(collector){ - collector->collect(name(), - "size jetGroupsVec " + std::to_string(jetGroupsVec.size())); - } - for(auto& jetGroupVec : jetGroupsVec){ - ATH_MSG_DEBUG("No of groups" << jetGroupVec.size()); - - auto passes = m_matcher->match(jetGroupVec.begin(), - jetGroupVec.end(), - jetCollector, - collector); - - if(!passes.has_value()){ - ATH_MSG_ERROR("Matcher cannot determine result. Config error?"); - return false; - } - - passed = *passes; - if(passed){ - exeTimer.stop(); - collectData(setupTimer.readAndReset(), - exeTimer.readAndReset(), - collector, - passed); - - return passed; - } - } - - exeTimer.stop(); - collectData(setupTimer.readAndReset(), - exeTimer.readAndReset(), - collector, - passed); - - return passed; -} - - -std::string CombinationsHelperTool::toString() const{ - std::stringstream ss; - std::string msg = nodeIDPrinter(name(), m_nodeID, m_parentNodeID) + "\n"; - msg += "Conditions:\nNo. of conditions " - + std::to_string(m_conditions.size()) + '\n'; - for(const auto& cond : m_conditions){ msg += cond->toString() + "\n";} - msg += "Grouper:\n" + m_grouper -> toString() + '\n'; - msg += "Matcher:\n" + m_matcher -> toString() + '\n'; - return msg; -} - -StatusCode -CombinationsHelperTool::getDescription(ITrigJetHypoInfoCollector& c) const { - c.collect(name(), toString()); - return StatusCode::SUCCESS; - -} -std::size_t CombinationsHelperTool::requiresNJets() const { - return m_config->requiresNJets(); -} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.h deleted file mode 100644 index 99146e94ad9fa9b2173418bbca12fa8eabbd1ae7..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CombinationsHelperTool.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -/* IAlg tool that splits up incomming jets and sends then to its children */ - -#ifndef TRIGHLTJETHYPO_COMBINATIONSHELPERTOOL_H -#define TRIGHLTJETHYPO_COMBINATIONSHELPERTOOL_H - -#include "AthenaBaseComps/AthAlgTool.h" - -#include "TrigHLTJetHypo/ITrigJetHypoToolHelperMT.h" -#include "ConditionsDefsMT.h" -#include "ITrigJetHypoToolConfig.h" -#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h" - -class ITrigJetInfoCollector; -class xAODJetCollector; - -class CombinationsHelperTool: public extends<AthAlgTool, ITrigJetHypoToolHelperMT> { - public: - - CombinationsHelperTool(const std::string& type, - const std::string& name, - const IInterface* parent); - - - virtual StatusCode initialize() override; - - virtual bool pass(HypoJetVector&, - xAODJetCollector&, - const std::unique_ptr<ITrigJetHypoInfoCollector>& - ) const override; - - virtual std::size_t requiresNJets() const override; - - virtual StatusCode getDescription(ITrigJetHypoInfoCollector&) const override; - virtual std::string toString() const override; - - private: - - // Used to generate helper objects foe TrigHLTJetHelper - // from user supplied values - ToolHandle<ITrigJetHypoToolConfig> m_config { - this, "HypoConfigurer", {}, "Configurer to set up TrigHLTJetHypoHelper2"}; - - // Object to make jet groups. Jet groups - // are vectors of jets selected from a jet vector - // which is, in this case, the incoming jet vector. - std::unique_ptr<IJetGrouper> m_grouper; - - ConditionsMT m_conditions; - - - Gaudi::Property<int> - m_parentNodeID {this, "parent_id", {}, "hypo tool tree parent node id"}; - - Gaudi::Property<int> - m_nodeID {this, "node_id", {}, "hypo tool tree node id"}; - - // Object that matches jet groups with ITrigJetHypoToolHelper objects - std::unique_ptr<IGroupsMatcherMT> m_matcher; - - - void collectData(const std::string& setuptime, - const std::string& exetime, - const std::unique_ptr<ITrigJetHypoInfoCollector>&, - bool) const; - - -}; -#endif diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.cxx index a602f937d89d9ea1dfa8dda4ce812f7b1f4f395a..af5cb4b646a4f3478c97f24924c007db0e1e4dc4 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ # #include "./CompoundConditionMT.h" @@ -53,7 +53,7 @@ bool CompoundConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string CompoundConditionMT::toString() const noexcept { +std::string CompoundConditionMT::toString() const { std::stringstream ss; ss << "CompoundConditionMT (" << this << ") Capacity: " << m_capacity << '\n'; for(const auto& el :m_elements){ diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.h index c6f1763d6bbd83027c2d9e60990de772e18e3bbf..0e707306cf3bc9857c01b1d63c3aa23c0c75590b 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/CompoundConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_COMPOUNDCONDITIONMT_H @@ -35,7 +35,7 @@ class CompoundConditionMT: public IConditionMT{ virtual unsigned int capacity() const override{return m_capacity;} - std::string toString() const noexcept override; + std::string toString() const override; private: std::vector<ConditionMT> m_elements; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx index a88f89e887f67c47bcae9643b81b6e00c6c0eca7..ab69025c4b9d87927bce4e76229303a1de89125e 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "./DijetConditionMT.h" @@ -79,7 +79,7 @@ DijetConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string DijetConditionMT::toString() const noexcept { +std::string DijetConditionMT::toString() const { std::stringstream ss; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.h index 7a1be3e9d7c94a89e293617bcffeab58d69d443a..04cbf3635d1cfcc375156e82656f97b07164c6e8 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_DIJETCONDITIONMT_H @@ -38,7 +38,7 @@ class DijetConditionMT: public IConditionMT{ bool isSatisfied(const HypoJetVector&, const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - std::string toString() const noexcept override; + std::string toString() const override; virtual unsigned int capacity() const override{return s_capacity;} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.cxx index 004a0830ffd8942fd1cb6a40a27150b4cbf23c2a..c100fec837cc36fa799315cb0f5dc15ad804f0de 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "./DijetDEtaConditionMT.h" @@ -59,7 +59,7 @@ DijetDEtaConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string DijetDEtaConditionMT::toString() const noexcept { +std::string DijetDEtaConditionMT::toString() const { std::stringstream ss; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.h index 3eae0b759e0d46cea40f4af9b21bf383f74e4759..c48870c8491ee60a4aa434682871c78378f83827 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDEtaConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_DIJETDETACONDITIONMT_H @@ -31,7 +31,7 @@ class DijetDEtaConditionMT: public IConditionMT{ bool isSatisfied(const HypoJetVector&, const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - std::string toString() const noexcept override; + std::string toString() const override; virtual unsigned int capacity() const override{return s_capacity;} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.cxx index 2d425350a680c01f122e1730a1020c9e06b0ba7b..567bcaa29aa53960849caf7944f4f3fd6424ea6c 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "./DijetDPhiConditionMT.h" @@ -60,7 +60,7 @@ DijetDPhiConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string DijetDPhiConditionMT::toString() const noexcept { +std::string DijetDPhiConditionMT::toString() const { std::stringstream ss; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.h index 1665b15593acd3b5b0a692645f4cf8a65d271cb9..8a4038456e4172765514ade9de749432b950f191 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetDPhiConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_DIJETDPHICONDITIONMT_H @@ -32,7 +32,7 @@ class DijetDPhiConditionMT: public IConditionMT{ bool isSatisfied(const HypoJetVector&, const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - std::string toString() const noexcept override; + std::string toString() const override; virtual unsigned int capacity() const override{return s_capacity;} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.cxx index 2c3794d4df98a435e48a9094bc78078a78009b75..37a455694117833ff23b3d837076c1499fe37a2b 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "./DijetMassConditionMT.h" @@ -60,7 +60,7 @@ DijetMassConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string DijetMassConditionMT::toString() const noexcept { +std::string DijetMassConditionMT::toString() const { std::stringstream ss; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.h index 1b070c7da93fbbf8514158067beff59691678cf3..0d12562b400a7ecd0f19db6663d20ee4045d2484 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/DijetMassConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_DIJETMASSCONDITIONMT_H @@ -31,7 +31,7 @@ class DijetMassConditionMT: public IConditionMT{ bool isSatisfied(const HypoJetVector&, const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - std::string toString() const noexcept override; + std::string toString() const override; virtual unsigned int capacity() const override{return s_capacity;} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.cxx index 0491bdc2e1ef905405fa4580f4a5dc0e1f558d93..4c6560f02fa158d3f45ab7318a7f27f913edbfc5 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ # #include "./EtConditionMT.h" @@ -49,7 +49,7 @@ EtConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string EtConditionMT::toString() const noexcept { +std::string EtConditionMT::toString() const { std::stringstream ss; ss << "EtConditionMT (" << this << ") " << " Et threshold: " diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.h index fcc51d03037ec7e59ee7df881f617abf46cd4db2..8ddd463eb2648fae413a98aeaf6f9df30b39b2d5 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_ETCONDITIONMT_H @@ -32,7 +32,7 @@ class EtConditionMT: public IConditionMT{ virtual unsigned int capacity() const override{return s_capacity;} - std::string toString() const noexcept override; + std::string toString() const override; private: double m_min; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.cxx index 24843e14553f1571c492ba47cacd1eb6150fc8e6..db606451a340dc218feca61f6fbddc93f0a4deb7 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ # #include "./EtaConditionAbsMT.h" @@ -50,7 +50,7 @@ EtaConditionAbsMT::isSatisfied(const HypoJetVector& ips, } -std::string EtaConditionAbsMT::toString() const noexcept { +std::string EtaConditionAbsMT::toString() const { std::stringstream ss; ss << "EtaConditionAbsMT (" << this << ") Capacity: " << s_capacity << " etaMin "<< m_min diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.h index 680df37226715be082c9967779a70ff55b81fdf2..068042b9b7cb85ae68852eb240a117d697e6924a 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionAbsMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_ETACONDITIONABSMT_H @@ -31,7 +31,7 @@ class EtaConditionAbsMT: public IConditionMT{ const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; virtual unsigned int capacity() const override{return s_capacity;} - std::string toString() const noexcept override; + std::string toString() const override; private: diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.cxx index 78e8c49fbfbbc5813b0de5aac6a20d5f27f71668..9bf9e30a203fb693355337ed6e7f38b301aaf6fa 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ # #include "./EtaConditionSignedMT.h" @@ -49,7 +49,7 @@ EtaConditionSignedMT::isSatisfied(const HypoJetVector& ips, } -std::string EtaConditionSignedMT::toString() const noexcept { +std::string EtaConditionSignedMT::toString() const { std::stringstream ss; ss << "EtaConditionSignedMT (" << this << ") etaMin " << m_min diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.h index 8f6e54c1de4d90be4a900544cc26577fd6becf6d..41096c513d26baabb83ea808e1cd92a990aafb4b 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaConditionSignedMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_ETACONDITIONSIGNEDMT_H @@ -32,7 +32,7 @@ class EtaConditionSignedMT: public IConditionMT{ const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; virtual unsigned int capacity() const override{return s_capacity;} - std::string toString() const noexcept override; + std::string toString() const override; private: diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx index 5b93f2b60402ec4bd87e01c84c609d9fc945f83c..bee5de795ed2b0df13d07fa4f4999d502340fcdb 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "./EtaEtAsymmetricConditionMT.h" @@ -59,7 +59,7 @@ EtaEtAsymmetricConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string EtaEtAsymmetricConditionMT::toString() const noexcept { +std::string EtaEtAsymmetricConditionMT::toString() const { std::stringstream ss; ss << "EtaEtAsymmetric ConditionMT: etaMin " << m_etaMin diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.h index 833a5d4975e07048bb0a4fb70d964994562a7892..5a1168cbc2f966a7c1aa2bd8d690a315b1af7db7 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtAsymmetricConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_ETAETASYMMETRICCONDITIONMT_H @@ -32,7 +32,7 @@ class EtaEtAsymmetricConditionMT: public IConditionMT{ bool isSatisfied(const HypoJetVector&, const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - std::string toString() const noexcept override; + std::string toString() const override; virtual unsigned int capacity() const override {return s_capacity;} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx index b0ebff00139afc008938e3b41cf37218a3e55391..3522bc51cd86f7bcf92061615352eb00f6746c48 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ # #include "./EtaEtConditionMT.h" @@ -57,7 +57,7 @@ EtaEtConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string EtaEtConditionMT::toString() const noexcept { +std::string EtaEtConditionMT::toString() const { std::stringstream ss; ss << "EtaEtConditionMT (" << this << ") etaMin " << m_etaMin diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.h index 041ec51bdf3fb2032159d4c5876a3aa734403844..e3cd7de895abdaa92173bec80e6c4764fc30c75e 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/EtaEtConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_ETAETCONDITIONMT_H @@ -34,7 +34,7 @@ class EtaEtConditionMT: public IConditionMT{ const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; virtual unsigned int capacity() const override{return s_capacity;} - std::string toString() const noexcept override; + std::string toString() const override; private: diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx index f4f36af1ae37c9e77be29521401929ffdf265984..870b26b0f427567b9477b18a5c4e6f9310e3ac87 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.cxx @@ -317,8 +317,6 @@ bool FastReducer::propagate_(std::size_t child, // child == 0 do not attempt to process parent of node. if(child == 0){return true;} - // par is parent of the child (and siblings) passed to this method. - bool par_satisfied{false}; // calculate the external product of the jet groups // eg if condition c1 is satisfied by jg11 and jg12, while its only @@ -380,7 +378,6 @@ bool FastReducer::propagate_(std::size_t child, if (m_conditions[par]->isSatisfied(jg, collector)){// par is a tree ind. // get an index for this set of elementarys jhob groups indices - par_satisfied = true; m_satisfiedBy[par].push_back(cur_jg); m_jg2elemjgs[cur_jg] = elem_jgs; @@ -390,6 +387,10 @@ bool FastReducer::propagate_(std::size_t child, next = jg_product.next(collector); } + // check if enough job groups pass the parent condition + bool par_satisfied = + m_conditions[par]->multiplicitySatisfied(m_satisfiedBy[par].size(), + collector); if(collector and !par_satisfied){ collector->collect("FastReducer", "Condition node " + std::to_string(par) + @@ -510,10 +511,10 @@ bool FastReducer::capacitySatisfied(std::size_t ind, // of Conditions which represent multiple identical conditions. auto jgMult = m_satisfiedBy.at(ind).size(); - auto capSat = m_conditions.at(ind)->capacitySatisfied(jgMult, collector); + auto capSat = m_conditions.at(ind)->multiplicitySatisfied(jgMult, collector); if (!capSat and collector) { collector->collect("FastReduce", "Condition " + std::to_string(ind) - + " unsatisfied capacity, aborting"); + + " unsatisfied multiplicity, aborting"); } return capSat; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h index e92217ae5e438e3d06471d6dada1a3175d725a37..9cb957d1dfe4ae96e9742420164eab5c4499d5c9 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/FastReducer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_FASTREDUCER_H diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx index bcc456d1a53ab543dc6ac23cbfa82a6b709489d0..2f92a1fd0fe46d2f4c386f1e7476d19b338b8450 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.cxx @@ -55,7 +55,7 @@ HTConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string HTConditionMT::toString() const noexcept { +std::string HTConditionMT::toString() const { std::stringstream ss; ss << "HTConditionMT: htMin: " << m_htMin; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.h index e8c6495f9ad2a3d6f9c9083ca02991d930709f63..62116f422f23597938b49eb0564a262cb64c276e 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/HTConditionMT.h @@ -41,7 +41,7 @@ class HTConditionMT: public IConditionMT{ bool isSatisfied(const HypoJetVector&, const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - std::string toString() const noexcept override; + std::string toString() const override; virtual unsigned int capacity() const override {return s_capacity;} private: diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ICapacityCheckedCondition.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ICapacityCheckedCondition.h index 033ce81570cf017b1b735e9a459460049dbc31e8..c49ea11ab1f8fc7cba13df0122ff0a42f0f497c4 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ICapacityCheckedCondition.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ICapacityCheckedCondition.h @@ -30,8 +30,8 @@ class ICapacityCheckedCondition: public IConditionMT { public: virtual ~ICapacityCheckedCondition(){} - virtual bool capacitySatisfied(std::size_t jgMultiplicity, - const Collector&) const = 0; + virtual bool multiplicitySatisfied(std::size_t jgMultiplicity, + const Collector&) const = 0; }; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IConditionMT.h index 625d9f460b3e9422426390dba4f5b2ca34570636..6602ae1ec0157534cb286d610c86628e4913d3ce 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/IConditionMT.h @@ -27,7 +27,7 @@ class IConditionMT { const std::unique_ptr<ITrigJetHypoInfoCollector>&) const = 0; virtual unsigned int capacity() const = 0; - virtual std::string toString() const noexcept = 0; + virtual std::string toString() const = 0; }; #endif diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetCapacityCheckedConditionConfig.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetCapacityCheckedConditionConfig.h new file mode 100644 index 0000000000000000000000000000000000000000..a565dde99f7d27c6f47a0b242622ce1a44d8bd21 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/ITrigJetCapacityCheckedConditionConfig.h @@ -0,0 +1,21 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef TRIGHLTJETHYPO_ITRIGJETCAPACITYCHECKEDCONDITIONCONFIG_H +#define TRIGHLTJETHYPO_ITRIGJETCAPACITYCHECKEDCONDITIONCONFIG_H + +#include "GaudiKernel/IAlgTool.h" +#include "./CapacityCheckedConditionsDefs.h" + +class ITrigJetCapacityCheckedConditionConfig : virtual public ::IAlgTool { + +public: + DeclareInterfaceID(ITrigJetCapacityCheckedConditionConfig, 1, 0); + virtual ~ITrigJetCapacityCheckedConditionConfig(){}; + + virtual ConditionPtr getCapacityCheckedCondition() const = 0; + + virtual bool addToCapacity(std::size_t) = 0; + virtual std::size_t capacity() const = 0; +}; +#endif diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.cxx index 33ae1d96e90246a2a3dc81f381247dd243f960c9..4c1d1478f2aea62af3b169d841d35b3fead3990f 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.cxx @@ -69,7 +69,7 @@ bool JVTConditionMT::isSatisfied(const HypoJetVector& ips, const std::unique_ptr } -std::string JVTConditionMT::toString() const noexcept { +std::string JVTConditionMT::toString() const { std::stringstream ss; const void* address = static_cast<const void*>(this); diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.h index 26a664897aa5886a29cc45fe248a4c4586db4f5d..c6e30f571370512a45cfd16dbd86051c05b49a9a 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/JVTConditionMT.h @@ -27,7 +27,7 @@ class JVTConditionMT: public IConditionMT{ bool isSatisfied(const HypoJetVector&, const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - std::string toString() const noexcept override; + std::string toString() const override; virtual unsigned int capacity() const override{return s_capacity;} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.cxx index 69afa905687c25faccaa10c035643f34422823d4..ea09ac6a94068b23adf11cfa5d802cb776dc9244 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ # #include "./MomentConditionMT.h" @@ -69,7 +69,7 @@ MomentConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string MomentConditionMT::toString() const noexcept { +std::string MomentConditionMT::toString() const { std::stringstream ss; ss << "MomentConditionMT (" << this << ") " << " Et threshold: " diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.h index 7df35ec1517cd658f138b1de9be4e939da979b1e..2eee67c3330f9152758bd17c7970f716773d9bbc 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/MomentConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_MOMENTCONDITIONMT_H @@ -32,7 +32,7 @@ class MomentConditionMT: public IConditionMT{ virtual unsigned int capacity() const override{return s_capacity;} - std::string toString() const noexcept override; + std::string toString() const override; private: double m_min; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.cxx deleted file mode 100644 index 0973a23964219b8f75182ec3094fabbdf8799046..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.cxx +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: NotHelperTool.cxx -// PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo -// -// -// ******************************************************************** - -#include "NotHelperTool.h" - -#include "GaudiKernel/StatusCode.h" -#include "./ITrigJetHypoInfoCollector.h" -#include "./nodeIDPrinter.h" -#include "./JetTrigTimer.h" - -#include <sstream> - -NotHelperTool::NotHelperTool(const std::string& type, - const std::string& name, - const IInterface* parent) : - base_class(type, name, parent){ -} - -bool -NotHelperTool::pass(HypoJetVector& jets, - xAODJetCollector& jetCollector, - const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const { - ATH_MSG_DEBUG("NotHelperTool::pass... " << jets.size() << " jets"); - - JetTrigTimer timer; - if(collector){ - timer.start(); - } - - auto pass = !m_hypoTool->pass(jets, jetCollector, collector); - if (collector){ - timer.stop(); - collector->collect(name(), nodeIDPrinter(name(), - m_nodeID, - m_parentNodeID, - pass, - timer.readAndReset())); - } - - return pass; -} - -std::string NotHelperTool::toString() const{ - return nodeIDPrinter(name(), m_nodeID, m_parentNodeID); -} - - - - -StatusCode NotHelperTool::getDescription(ITrigJetHypoInfoCollector& c) const { - c.collect(name(), toString()); - return m_hypoTool->getDescription(c); -} - -std::size_t NotHelperTool::requiresNJets() const { - return m_hypoTool->requiresNJets(); -} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.h deleted file mode 100644 index c997d0cfb9b62dd3f139f578309f4b31e328bd0e..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/NotHelperTool.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collabnotation -*/ - -#ifndef TRIGJETNOTTOOLMT_H -#define TRIGJETNOTTOOLMT_H -/******************************************************************** - * - * NAME: TrigJetNotToolMT.h - * PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo - * - * - *********************************************************************/ - - -#include "AthenaBaseComps/AthAlgTool.h" - -#include "TrigHLTJetHypo/ITrigJetHypoToolHelperMT.h" -#include "ITrigJetHypoToolConfig.h" -#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h" - -class ITrigJetInfoCollector; -class xAODJetCollector; - -class NotHelperTool: public extends<AthAlgTool, ITrigJetHypoToolHelperMT> { - - public: - - NotHelperTool(const std::string& type, - const std::string& name, - const IInterface* parent); - - bool pass(HypoJetVector&, - xAODJetCollector&, - const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - - virtual std::size_t requiresNJets() const override; - - virtual StatusCode getDescription(ITrigJetHypoInfoCollector&) const override; - virtual std::string toString() const override ; - - private: - - - ToolHandle<ITrigJetHypoToolHelperMT> m_hypoTool { - this, "hypoTool", {}, "predicate to be inverted"}; - - Gaudi::Property<int> - m_parentNodeID {this, "parent_id", {}, "hypo tool tree parent node id"}; - - Gaudi::Property<int> - m_nodeID {this, "node_id", {}, "hypo tool tree node id"}; - -}; -#endif - diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.cxx deleted file mode 100644 index 75c3200a9912883d9c27133932e0ae4233133447..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.cxx +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -// ******************************************************************** -// -// NAME: OrHelperTool.cxx -// PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo -// -// -// ******************************************************************** - -#include "OrHelperTool.h" -#include "./ITrigJetHypoInfoCollector.h" -#include "./nodeIDPrinter.h" -#include "./JetTrigTimer.h" - -#include "GaudiKernel/StatusCode.h" -#include <sstream> - -OrHelperTool::OrHelperTool(const std::string& type, - const std::string& name, - const IInterface* parent) : - base_class(type, name, parent){ -} - - -bool -OrHelperTool::pass(HypoJetVector& jets, - xAODJetCollector& jetCollector, - const std::unique_ptr<ITrigJetHypoInfoCollector>& collector) const { - ATH_MSG_DEBUG("OrHelperTool::pass... " << jets.size() << " jets"); - - JetTrigTimer timer; - if(collector){ - timer.start(); - } - - bool pass = m_lhs->pass(jets, jetCollector, collector); - if (pass){ - ATH_MSG_DEBUG("LHS passed"); - return pass; - } else { - pass = m_rhs->pass(jets, jetCollector, collector); - ATH_MSG_DEBUG("RHS " <<std::boolalpha << pass); - } - - if (collector){ - timer.stop(); - collector->collect(name(), nodeIDPrinter(name(), - m_nodeID, - m_parentNodeID, - pass, - timer.readAndReset())); - } - - return pass; -} - -std::string OrHelperTool::toString() const{ - return nodeIDPrinter(name(), m_nodeID, m_parentNodeID); -} - - -StatusCode OrHelperTool::getDescription(ITrigJetHypoInfoCollector& c) const { - c.collect(name(), toString()); - return m_lhs->getDescription(c) & m_rhs->getDescription(c); -} - -std::size_t OrHelperTool::requiresNJets() const { - return m_lhs->requiresNJets() + m_rhs->requiresNJets(); -} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.h deleted file mode 100644 index c858194bf2c4246ed7f7f63bb4e0b5a519e3e444..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/OrHelperTool.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TRIGHLTJETHYPO_ORHELPERTOOLMT_H -#define TRIGHLTJETHYPO_ORHELPERTOOLMT_H -/******************************************************************** - * - * NAME: OrHelperTool.h - * PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo - * - * - *********************************************************************/ - -#include "AthenaBaseComps/AthAlgTool.h" - -#include "TrigHLTJetHypo/ITrigJetHypoToolHelperMT.h" -#include "ITrigJetHypoToolConfig.h" -#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/HypoJetDefs.h" - -class xAODJetCollector; - -class OrHelperTool: public extends<AthAlgTool, ITrigJetHypoToolHelperMT> { - - public: - - OrHelperTool(const std::string& type, - const std::string& name, - const IInterface* parent); - - bool pass(HypoJetVector&, - xAODJetCollector&, - const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - - virtual StatusCode getDescription(ITrigJetHypoInfoCollector&) const override; - - virtual std::size_t requiresNJets() const override; - - virtual std::string toString() const override; - - - private: - - ToolHandle<ITrigJetHypoToolHelperMT> m_lhs { - this, "lhs", {}, "LHS boolean binary expression"}; - - ToolHandle<ITrigJetHypoToolHelperMT> m_rhs { - this, "rhs", {}, "RHS boolean binary expression"}; - - Gaudi::Property<int> - m_parentNodeID {this, "parent_id", {}, "hypo tool tree parent node id"}; - - Gaudi::Property<int> - m_nodeID {this, "node_id", {}, "hypo tool tree node id"}; - - -}; - -#endif diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.cxx index b89e470090eaef7f73cf987f026ef97a75b73ecf..11302690ace4d2dcf32c3b73510ff7dcdb02dc35 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "./QjetMassConditionMT.h" @@ -63,7 +63,7 @@ QjetMassConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string QjetMassConditionMT::toString() const noexcept { +std::string QjetMassConditionMT::toString() const { std::stringstream ss; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.h index 97b7a6b51836396af6e311906cb866d593357ba9..f491e41fd951a2636c773e36086f8fb379816ce0 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/QjetMassConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_QJETMASSCONDITIONMT_H @@ -31,7 +31,7 @@ class QjetMassConditionMT: public IConditionMT{ bool isSatisfied(const HypoJetVector&, const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - std::string toString() const noexcept override; + std::string toString() const override; virtual unsigned int capacity() const override{return s_capacity;} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.cxx index 1b4236cc8b24e0482481a6facf365e2994c3d811..02b601e0bb45634df4f03093db295e63f3796856 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ # #include "./SMCConditionMT.h" @@ -50,7 +50,7 @@ SMCConditionMT::isSatisfied(const HypoJetVector& ips, } -std::string SMCConditionMT::toString() const noexcept { +std::string SMCConditionMT::toString() const { std::stringstream ss; ss << "SMCConditionMT (" << this << ") mass min " << m_min diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.h index 67d3e7f0ee97369cd408176b47a21a5ffec3e7b3..6d76bd3830c0239c421d019969b2cbee66fbac60 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/SMCConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_SMCCONDITIONMT_H @@ -31,7 +31,7 @@ class SMCConditionMT: public IConditionMT{ const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; virtual unsigned int capacity() const override{return s_capacity;} - std::string toString() const noexcept override; + std::string toString() const override; private: diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.cxx index c10020b311bff4dec13d4f454722f0b3fbf3baef..8070a10e628ed2de4f9051b1f139499668bf87f5 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "./TLAConditionMT.h" @@ -87,7 +87,7 @@ bool TLAConditionMT::isSatisfied(const HypoJetVector& ips, m_massMax > mass; } -std::string TLAConditionMT::toString() const noexcept { +std::string TLAConditionMT::toString() const { std::stringstream ss; ss << "TLAConditionMT: etaMin " << m_etaMin diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.h index ca2cff693e351f8bb1204e3227cf2b8b572f73a3..76ab676d052e63c6851ab524b14f15273bcfadcd 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TLAConditionMT.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGHLTJETHYPO_TLACONDITIONMT_H @@ -40,7 +40,7 @@ class TLAConditionMT: public IConditionMT{ bool isSatisfied(const HypoJetVector&, const std::unique_ptr<ITrigJetHypoInfoCollector>&) const override; - std::string toString() const noexcept override; + std::string toString() const override; virtual unsigned int capacity() const override {return s_capacity;} diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_acceptAll.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_acceptAll.cxx index a83a16d65baa701a53145f5eb1f0c345ce103c01..9b4f8c042161fd817fb104d8662f2b9d0017a86a 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_acceptAll.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_acceptAll.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "TrigJetConditionConfig_acceptAll.h" @@ -19,9 +19,8 @@ ConditionMT TrigJetConditionConfig_acceptAll::getCondition() const { -bool TrigJetConditionConfig_acceptAll::addToCapacity(std::size_t cap) { - m_capacity += cap; - return true; +bool TrigJetConditionConfig_acceptAll::addToCapacity(std::size_t ) { + return false; } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_acceptAll.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_acceptAll.h index 891d47158683709f55213a0f938f631f765476cd..8c6df007dd539b8163db3a3592b5b4a4607dc9f7 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_acceptAll.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_acceptAll.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGJETCONDITIONCONFIG_ACCEPTALL_H diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_capacitychecked.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_capacitychecked.cxx new file mode 100644 index 0000000000000000000000000000000000000000..94be844cd6b0673dd86622258fd6eb814892b093 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_capacitychecked.cxx @@ -0,0 +1,60 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +/* + Instantiator for ET Condition + */ +#include "TrigJetConditionConfig_capacitychecked.h" +#include "CapacityCheckedCondition.h" +#include "GaudiKernel/StatusCode.h" +#include "./CompoundConditionMT.h" +#include <vector> + + +TrigJetConditionConfig_capacitychecked::TrigJetConditionConfig_capacitychecked(const std::string& type, + const std::string& name, + const IInterface* parent) : + base_class(type, name, parent){ + +} + + +StatusCode TrigJetConditionConfig_capacitychecked::initialize() { + return StatusCode::SUCCESS; +} + + +ConditionPtr +TrigJetConditionConfig_capacitychecked::getCapacityCheckedCondition() const { + std::vector<ConditionMT> elements; + for(const auto& el : m_elementConditions){ + elements.push_back(el->getCondition()); + } + + auto cc = std::make_unique<CompoundConditionMT>(elements); + + return std::make_unique<CapacityCheckedCondition>(std::move(cc), + m_multiplicity); +} + + +StatusCode TrigJetConditionConfig_capacitychecked::checkVals() const { + + if (m_multiplicity < 1) { + ATH_MSG_ERROR("m_multiplicity = " + std::to_string(m_multiplicity) + + "expected > 0"); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + +bool TrigJetConditionConfig_capacitychecked::addToCapacity(std::size_t) { + return false; +} + +std::size_t TrigJetConditionConfig_capacitychecked::capacity() const { + return getCapacityCheckedCondition()->capacity(); +} + diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_capacitychecked.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_capacitychecked.h new file mode 100644 index 0000000000000000000000000000000000000000..7f7b4031ef8903673fffe78762bcf95c2e317d37 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_capacitychecked.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TRIGJETCONDITIONCONFIG_CAPACITYCHECKED_H +#define TRIGJETCONDITIONCONFIG_CAPACITYCHECKED_H + +#include "CapacityCheckedConditionsDefs.h" + +#include "ITrigJetCapacityCheckedConditionConfig.h" +#include "ITrigJetConditionConfig.h" +#include "AthenaBaseComps/AthAlgTool.h" + +class TrigJetConditionConfig_capacitychecked: +public extends<AthAlgTool, ITrigJetCapacityCheckedConditionConfig> { + + public: + + TrigJetConditionConfig_capacitychecked(const std::string& type, + const std::string& name, + const IInterface* parent); + + virtual StatusCode initialize() override; + virtual ConditionPtr getCapacityCheckedCondition() const override; + + virtual bool addToCapacity(std::size_t) override; + virtual std::size_t capacity() const override; + + private: + + ToolHandleArray<ITrigJetConditionConfig> m_elementConditions{ + this, "conditionMakers", {}, + "elemental conditions makers for a leaf node."}; + + Gaudi::Property<std::size_t> m_multiplicity {this, "multiplicity", {1}, + "no. of occurences of identical condition"}; + + StatusCode checkVals() const; + +}; +#endif diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_compound.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_compound.cxx index 15b50208dedc253bebe20eea373da8b5fb0c04ef..86480d98253d6dcf28db39fc30eed0b045798b14 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_compound.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_compound.cxx @@ -1,11 +1,12 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ /* Instantiator for ET Condition */ #include "TrigJetConditionConfig_compound.h" +#include "CapacityCheckedCondition.h" #include "GaudiKernel/StatusCode.h" #include "./CompoundConditionMT.h" #include <vector> @@ -31,10 +32,12 @@ ConditionMT TrigJetConditionConfig_compound::getCondition() const { } return std::make_unique<CompoundConditionMT>(elements); + } StatusCode TrigJetConditionConfig_compound::checkVals() const { + return StatusCode::SUCCESS; } diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_compound.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_compound.h index 155ca8527e0c8bfc172d437817f17057d00aa4f0..7d31b7f72a66e091e6038a5403afacacedf0425d 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_compound.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetConditionConfig_compound.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGJETCONDITIONCONFIG_COMPOUND_H @@ -29,7 +29,7 @@ public extends<AthAlgTool, ITrigJetConditionConfig> { ToolHandleArray<ITrigJetConditionConfig> m_elementConditions{ this, "conditionMakers", {}, "elemental conditions makers for a leaf node."}; - + StatusCode checkVals() const; }; diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx index 5e7e446bb9f1ac24db7866a4a27ca3c105dbd27e..06a7b234ac8b30dca7ce6f3be04860cc3878e5f5 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.cxx @@ -136,7 +136,7 @@ TrigJetHypoToolConfig_fastreduction::getCapacityCheckedConditions() const { // return an invalid optional if any src signals a problem for(const auto& cm : m_conditionMakers){ - conditions.push_back(std::make_unique<CapacityCheckedCondition>(cm->getCondition())); + conditions.push_back(std::move(cm->getCapacityCheckedCondition())); } return std::make_optional<ConditionPtrs>(std::move(conditions)); @@ -148,7 +148,7 @@ TrigJetHypoToolConfig_fastreduction::getConditions() const { ConditionsMT conditions; for(const auto& cm : m_conditionMakers){ - conditions.push_back(cm->getCondition()); + conditions.push_back(std::move(cm->getCapacityCheckedCondition())); } return std::make_optional<ConditionsMT>(std::move(conditions)); diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h index 2e70bf1b81674df6139e148c17ce8a25d1342f89..008405edf4d50a944893da8a6dd1254dfc4e7dfc 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/TrigJetHypoToolConfig_fastreduction.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef TRIGJETHYPOTOOLCONFIG_FASTREDUCTION_H @@ -25,7 +25,7 @@ #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/IJetGrouper.h" #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/CleanerBridge.h" #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/ConditionsDefs.h" -#include "./ITrigJetConditionConfig.h" +#include "./ITrigJetCapacityCheckedConditionConfig.h" class TrigJetHypoToolConfig_fastreduction: public extends<AthAlgTool, ITrigJetHypoToolConfig> { @@ -47,7 +47,7 @@ public extends<AthAlgTool, ITrigJetHypoToolConfig> { private: - ToolHandleArray<ITrigJetConditionConfig> m_conditionMakers{ + ToolHandleArray<ITrigJetCapacityCheckedConditionConfig> m_conditionMakers{ this, "conditionMakers", {}, "hypo tree node to conditiionMaker map"}; Gaudi::Property<std::vector<std::size_t>> m_treeVec{ diff --git a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx index 4a5ea51baf2b5e5c4f2f58ca5f467ba50e892333..2c1486abdb3b940ae74a6697996e0750e1d3ab90 100644 --- a/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx +++ b/Trigger/TrigHypothesis/TrigHLTJetHypo/src/components/TrigHLTJetHypo_entries.cxx @@ -35,16 +35,13 @@ #include "../TrigJetConditionConfig_acceptAll.h" #include "../TrigJetConditionConfig_moment.h" #include "../TrigJetConditionConfig_compound.h" +#include "../TrigJetConditionConfig_capacitychecked.h" // -#include "../NotHelperTool.h" -#include "../AndHelperTool.h" -#include "../OrHelperTool.h" #include "../TrigJetHypoToolMT.h" #include "../TrigJetHypoToolHelperMT.h" #include "../TrigJetTLAHypoAlgMT.h" #include "../TrigJetTLAHypoToolMT.h" -#include "../CombinationsHelperTool.h" #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/BasicCleanerTool.h" #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/AntiCleanerTool.h" #include "TrigHLTJetHypo/TrigHLTJetHypoUtils/EtaEtCleanerTool.h" @@ -69,9 +66,6 @@ DECLARE_COMPONENT(TrigJetHypoToolConfig_partgen) DECLARE_COMPONENT(TrigJetHypoToolConfig_fastreduction) DECLARE_COMPONENT(TrigJetHypoToolConfig_leaf) DECLARE_COMPONENT(TrigJetHypoToolConfig_ht) -DECLARE_COMPONENT(NotHelperTool) -DECLARE_COMPONENT(AndHelperTool) - DECLARE_COMPONENT(OrHelperTool) DECLARE_COMPONENT(TrigHLTJetHypo_SMC) DECLARE_COMPONENT(TrigHLTJetHypo_HT) DECLARE_COMPONENT(TrigHLTJetHypo_TLA) @@ -90,6 +84,7 @@ DECLARE_COMPONENT(TrigJetConditionConfig_jvt) DECLARE_COMPONENT(TrigJetConditionConfig_acceptAll) DECLARE_COMPONENT(TrigJetConditionConfig_moment) DECLARE_COMPONENT(TrigJetConditionConfig_compound) +DECLARE_COMPONENT(TrigJetConditionConfig_capacitychecked) DECLARE_COMPONENT(TrigJetConditionConfig_qjet_mass) DECLARE_COMPONENT(TrigJetHypoAlgMT) @@ -97,7 +92,6 @@ DECLARE_COMPONENT(TrigJetHypoToolMT) DECLARE_COMPONENT(TrigJetTLAHypoAlgMT) DECLARE_COMPONENT(TrigJetTLAHypoToolMT) DECLARE_COMPONENT(TrigJetHypoToolHelperMT) -DECLARE_COMPONENT(CombinationsHelperTool) DECLARE_COMPONENT(BasicCleanerTool) DECLARE_COMPONENT(AntiCleanerTool)