Bug Summary

File:analysis/variables/src/MetaVariables.cc
Warning:line 1996, column 9
Potential memory leak

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -O3 -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name MetaVariables.cc -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/data/b2soft/buildbot/development/build -fcoverage-compilation-dir=/data/b2soft/buildbot/development/build -resource-dir /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/lib/clang/21 -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/c++ -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/c++/x86_64-redhat-linux -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/c++/backward -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/include -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/python3.12 -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/include/CLHEP -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/Geant4 -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/include/root -isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/include/belle_legacy -I include/ -D _PACKAGE_="analysis" -D G4UI_USE_TCSH -D RaveDllExport= -D HAS_SQLITE -D HAS_CALLGRIND -I include -I /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/libxml2 -internal-isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/bin/../lib64/gcc/x86_64-redhat-linux/15.2.0/../../../../include/c++ -internal-isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/bin/../lib64/gcc/x86_64-redhat-linux/15.2.0/../../../../include/c++/x86_64-redhat-linux -internal-isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/bin/../lib64/gcc/x86_64-redhat-linux/15.2.0/../../../../include/c++/backward -internal-isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/lib/clang/21/include -internal-isystem /usr/local/include -internal-isystem /cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/bin/../lib64/gcc/x86_64-redhat-linux/15.2.0/../../../../x86_64-redhat-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-missing-braces -Wno-unused-command-line-argument -std=c++20 -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -vectorize-loops -vectorize-slp -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /scan_build/2026-05-31-004316-385593-1 -x c++ analysis/variables/src/MetaVariables.cc

analysis/variables/src/MetaVariables.cc

1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9// Own header.
10#include <analysis/variables/MetaVariables.h>
11#include <analysis/variables/MCTruthVariables.h>
12
13#include <analysis/VariableManager/Utility.h>
14#include <analysis/dataobjects/Particle.h>
15#include <analysis/dataobjects/ParticleList.h>
16#include <analysis/dataobjects/EventKinematics.h>
17#include <analysis/utility/PCmsLabTransform.h>
18#include <analysis/utility/ReferenceFrame.h>
19#include <analysis/utility/EvtPDLUtil.h>
20#include <analysis/utility/ParticleCopy.h>
21#include <analysis/utility/ValueIndexPairSorting.h>
22#include <analysis/ClusterUtility/ClusterUtils.h>
23#include <analysis/variables/VariableFormulaConstructor.h>
24
25#include <framework/logging/Logger.h>
26#include <framework/datastore/StoreArray.h>
27#include <framework/datastore/StoreObjPtr.h>
28#include <framework/dataobjects/EventExtraInfo.h>
29#include <framework/utilities/Conversion.h>
30#include <framework/utilities/MakeROOTCompatible.h>
31#include <framework/gearbox/Const.h>
32
33#include <mdst/dataobjects/Track.h>
34#include <mdst/dataobjects/MCParticle.h>
35#include <mdst/dataobjects/ECLCluster.h>
36#include <mdst/dataobjects/TrackFitResult.h>
37
38#include <boost/algorithm/string.hpp>
39#include <limits>
40
41#include <cmath>
42#include <stdexcept>
43#include <regex>
44
45#include <TDatabasePDG.h>
46#include <Math/Vector4D.h>
47#include <Math/VectorUtil.h>
48
49namespace Belle2 {
50 namespace Variable {
51 double requireDoubleForFrameVariable(const Variable::Manager::Var* var,
52 const Variable::Manager::VarVariant& value,
53 const std::string& frameFunction)
54 {
55 if (std::holds_alternative<double>(value)) {
56 return std::get<double>(value);
57 }
58
59 const char* returnedType = std::holds_alternative<int>(value) ? "int" : "bool";
60 B2ERROR("Meta function " << frameFunction << " expects a double variable, but '" << var->namedo { { LogVariableStream varStream; varStream << "Meta function "
<< frameFunction << " expects a double variable, but '"
<< var->name << "' returned " << returnedType
<< ". Returning NaN."; Belle2::LogSystem::Instance().sendMessage
(Belle2::LogMessage(Belle2::LogConfig::c_Error, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 61, 0)); } } while(false)
61 << "' returned " << returnedType << ". Returning NaN.")do { { LogVariableStream varStream; varStream << "Meta function "
<< frameFunction << " expects a double variable, but '"
<< var->name << "' returned " << returnedType
<< ". Returning NaN."; Belle2::LogSystem::Instance().sendMessage
(Belle2::LogMessage(Belle2::LogConfig::c_Error, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 61, 0)); } } while(false)
;
62 return Const::doubleNaN;
63 }
64
65 Manager::FunctionPtr useRestFrame(const std::vector<std::string>& arguments)
66 {
67 if (arguments.size() == 1) {
68 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
69 auto func = [var](const Particle * particle) -> double {
70 UseReferenceFrame<RestFrame> frame(particle);
71 return requireDoubleForFrameVariable(var, var->function(particle), "useRestFrame");
72 };
73 return func;
74 } else {
75 B2FATAL("Wrong number of arguments for meta function useRestFrame")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function useRestFrame"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 75, 0)); }; exit(1); } while(false)
;
76 }
77 }
78
79 Manager::FunctionPtr useCMSFrame(const std::vector<std::string>& arguments)
80 {
81 if (arguments.size() == 1) {
82 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
83 auto func = [var](const Particle * particle) -> double {
84 UseReferenceFrame<CMSFrame> frame;
85 return requireDoubleForFrameVariable(var, var->function(particle), "useCMSFrame");
86 };
87 return func;
88 } else {
89 B2FATAL("Wrong number of arguments for meta function useCMSFrame")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function useCMSFrame"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 89, 0)); }; exit(1); } while(false)
;
90 }
91 }
92
93 Manager::FunctionPtr useLabFrame(const std::vector<std::string>& arguments)
94 {
95 if (arguments.size() == 1) {
96 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
97 auto func = [var](const Particle * particle) -> double {
98 UseReferenceFrame<LabFrame> frame;
99 return requireDoubleForFrameVariable(var, var->function(particle), "useLabFrame");
100 };
101 return func;
102 } else {
103 B2FATAL("Wrong number of arguments for meta function useLabFrame")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function useLabFrame"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 103, 0)); }; exit(1); } while(false)
;
104 }
105 }
106
107 Manager::FunctionPtr useTagSideRecoilRestFrame(const std::vector<std::string>& arguments)
108 {
109 if (arguments.size() == 2) {
110 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
111 auto daughterFunction = convertToDaughterIndex({arguments[1]});
112 auto func = [var, daughterFunction](const Particle * particle) -> double {
113 int daughterIndexTagB = std::get<int>(daughterFunction(particle));
114 if (daughterIndexTagB < 0)
115 return Const::doubleNaN;
116
117 if (particle->getPDGCode() != 300553)
118 {
119 B2ERROR("Variable should only be used on a Upsilon(4S) Particle List!")do { { LogVariableStream varStream; varStream << "Variable should only be used on a Upsilon(4S) Particle List!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Error, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 119, 0)); } } while(false)
;
120 return Const::doubleNaN;
121 }
122
123 PCmsLabTransform T;
124 ROOT::Math::PxPyPzEVector pSigB = T.getBeamFourMomentum() - particle->getDaughter(daughterIndexTagB)->get4Vector();
125 Particle tmp(pSigB, -particle->getDaughter(daughterIndexTagB)->getPDGCode());
126
127 UseReferenceFrame<RestFrame> frame(&tmp);
128 return requireDoubleForFrameVariable(var, var->function(particle), "useTagSideRecoilRestFrame");
129 };
130
131 return func;
132 } else {
133 B2FATAL("Wrong number of arguments for meta function useTagSideRecoilRestFrame")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function useTagSideRecoilRestFrame"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 133, 0)); }; exit(1); } while(false)
;
134 }
135 }
136
137 Manager::FunctionPtr useParticleRestFrame(const std::vector<std::string>& arguments)
138 {
139 if (arguments.size() == 2) {
140 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
141 std::string listName = arguments[1];
142 auto func = [var, listName](const Particle * particle) -> double {
143 StoreObjPtr<ParticleList> list(listName);
144 unsigned listSize = list->getListSize();
145 if (listSize == 0)
146 return Const::doubleNaN;
147 if (listSize > 1)
148 B2WARNING("The selected ParticleList contains more than 1 Particles in this event. The variable useParticleRestFrame will use only the first candidate, and the result may not be the expected one."do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "The selected ParticleList contains more than 1 Particles in this event. The variable useParticleRestFrame will use only the first candidate, and the result may not be the expected one."
<< LogVar("ParticleList", listName) << LogVar("Number of candidates in the list"
, listSize); Belle2::LogSystem::Instance().sendMessage(Belle2
::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 150, 0)); }; } } while(false)
149 << LogVar("ParticleList", listName)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "The selected ParticleList contains more than 1 Particles in this event. The variable useParticleRestFrame will use only the first candidate, and the result may not be the expected one."
<< LogVar("ParticleList", listName) << LogVar("Number of candidates in the list"
, listSize); Belle2::LogSystem::Instance().sendMessage(Belle2
::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 150, 0)); }; } } while(false)
150 << LogVar("Number of candidates in the list", listSize))do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "The selected ParticleList contains more than 1 Particles in this event. The variable useParticleRestFrame will use only the first candidate, and the result may not be the expected one."
<< LogVar("ParticleList", listName) << LogVar("Number of candidates in the list"
, listSize); Belle2::LogSystem::Instance().sendMessage(Belle2
::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 150, 0)); }; } } while(false)
;
151 const Particle* p = list->getParticle(0);
152 UseReferenceFrame<RestFrame> frame(p);
153 return requireDoubleForFrameVariable(var, var->function(particle), "useParticleRestFrame");
154 };
155 return func;
156 } else {
157 B2FATAL("Wrong number of arguments for meta function useParticleRestFrame.")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function useParticleRestFrame."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 157, 0)); }; exit(1); } while(false)
;
158 }
159 }
160
161 Manager::FunctionPtr useRecoilParticleRestFrame(const std::vector<std::string>& arguments)
162 {
163 if (arguments.size() == 2) {
164 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
165 std::string listName = arguments[1];
166 auto func = [var, listName](const Particle * particle) -> double {
167 StoreObjPtr<ParticleList> list(listName);
168 unsigned listSize = list->getListSize();
169 if (listSize == 0)
170 return Const::doubleNaN;
171 if (listSize > 1)
172 B2WARNING("The selected ParticleList contains more than 1 Particles in this event. The variable useParticleRestFrame will use only the first candidate, and the result may not be the expected one."do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "The selected ParticleList contains more than 1 Particles in this event. The variable useParticleRestFrame will use only the first candidate, and the result may not be the expected one."
<< LogVar("ParticleList", listName) << LogVar("Number of candidates in the list"
, listSize); Belle2::LogSystem::Instance().sendMessage(Belle2
::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 174, 0)); }; } } while(false)
173 << LogVar("ParticleList", listName)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "The selected ParticleList contains more than 1 Particles in this event. The variable useParticleRestFrame will use only the first candidate, and the result may not be the expected one."
<< LogVar("ParticleList", listName) << LogVar("Number of candidates in the list"
, listSize); Belle2::LogSystem::Instance().sendMessage(Belle2
::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 174, 0)); }; } } while(false)
174 << LogVar("Number of candidates in the list", listSize))do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "The selected ParticleList contains more than 1 Particles in this event. The variable useParticleRestFrame will use only the first candidate, and the result may not be the expected one."
<< LogVar("ParticleList", listName) << LogVar("Number of candidates in the list"
, listSize); Belle2::LogSystem::Instance().sendMessage(Belle2
::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 174, 0)); }; } } while(false)
;
175 const Particle* p = list->getParticle(0);
176 PCmsLabTransform T;
177 ROOT::Math::PxPyPzEVector recoil = T.getBeamFourMomentum() - p->get4Vector();
178 /* Let's use 0 as PDG code to avoid wrong assumptions. */
179 Particle pRecoil(recoil, 0);
180 pRecoil.setVertex(particle->getVertex());
181 UseReferenceFrame<RestFrame> frame(&pRecoil);
182 return requireDoubleForFrameVariable(var, var->function(particle), "useRecoilParticleRestFrame");
183 };
184 return func;
185 } else {
186 B2FATAL("Wrong number of arguments for meta function useParticleRestFrame.")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function useParticleRestFrame."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 186, 0)); }; exit(1); } while(false)
;
187 }
188 }
189
190 Manager::FunctionPtr useDaughterRestFrame(const std::vector<std::string>& arguments)
191 {
192 if (arguments.size() >= 2) {
193 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
194 auto func = [var, arguments](const Particle * particle) -> double {
195
196 // Sum of the 4-momenta of all the selected daughters
197 ROOT::Math::PxPyPzEVector pSum(0, 0, 0, 0);
198
199 for (unsigned int i = 1; i < arguments.size(); i++)
200 {
201 auto generalizedIndex = arguments[i];
202 const Particle* dauPart = particle->getParticleFromGeneralizedIndexString(generalizedIndex);
203 if (dauPart)
204 pSum += dauPart->get4Vector();
205 else
206 return Const::doubleNaN;
207 }
208 Particle tmp(pSum, 0);
209 UseReferenceFrame<RestFrame> frame(&tmp);
210 return requireDoubleForFrameVariable(var, var->function(particle), "useDaughterRestFrame");
211 };
212 return func;
213 } else {
214 B2FATAL("Wrong number of arguments for meta function useDaughterRestFrame.")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function useDaughterRestFrame."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 214, 0)); }; exit(1); } while(false)
;
215 }
216 }
217
218 Manager::FunctionPtr useDaughterRecoilRestFrame(const std::vector<std::string>& arguments)
219 {
220 if (arguments.size() >= 2) {
221 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
222 auto func = [var, arguments](const Particle * particle) -> double {
223
224 // Sum of the 4-momenta of all the selected daughters
225 ROOT::Math::PxPyPzEVector pSum(0, 0, 0, 0);
226
227 for (unsigned int i = 1; i < arguments.size(); i++)
228 {
229 auto generalizedIndex = arguments[i];
230 const Particle* dauPart = particle->getParticleFromGeneralizedIndexString(generalizedIndex);
231 if (dauPart)
232 pSum += dauPart->get4Vector();
233 else
234 return Const::doubleNaN;
235 }
236 PCmsLabTransform T;
237 ROOT::Math::PxPyPzEVector recoil = T.getBeamFourMomentum() - pSum;
238 /* Let's use 0 as PDG code to avoid wrong assumptions. */
239 Particle pRecoil(recoil, 0);
240 UseReferenceFrame<RestFrame> frame(&pRecoil);
241 return requireDoubleForFrameVariable(var, var->function(particle), "useDaughterRecoilRestFrame");
242 };
243 return func;
244 } else {
245 B2FATAL("Wrong number of arguments for meta function useDaughterRecoilRestFrame.")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function useDaughterRecoilRestFrame."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 245, 0)); }; exit(1); } while(false)
;
246 }
247 }
248
249 Manager::FunctionPtr useMCancestorBRestFrame(const std::vector<std::string>& arguments)
250 {
251 if (arguments.size() == 1) {
252 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
253 auto func = [var](const Particle * particle) -> double {
254 int index = ancestorBIndex(particle);
255 if (index < 0) return Const::doubleNaN;
256 StoreArray<MCParticle> mcparticles;
257 Particle temp(mcparticles[index]);
258 UseReferenceFrame<RestFrame> frame(&temp);
259 return requireDoubleForFrameVariable(var, var->function(particle), "useMCancestorBRestFrame");
260 };
261 return func;
262 } else {
263 B2FATAL("Wrong number of arguments for meta function useMCancestorBRestFrame.")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function useMCancestorBRestFrame."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 263, 0)); }; exit(1); } while(false)
;
264 }
265 }
266
267 Manager::FunctionPtr extraInfo(const std::vector<std::string>& arguments)
268 {
269 if (arguments.size() == 1) {
270 auto extraInfoName = arguments[0];
271 auto func = [extraInfoName](const Particle * particle) -> double {
272 if (particle == nullptr)
273 {
274 B2WARNING("Returns NaN because the particle is nullptr! If you want EventExtraInfo variables, please use eventExtraInfo() instead")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "Returns NaN because the particle is nullptr! If you want EventExtraInfo variables, please use eventExtraInfo() instead"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Warning, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 274, 0)); }; } } while(false)
;
275 return Const::doubleNaN;
276 }
277 if (particle->hasExtraInfo(extraInfoName))
278 {
279 return particle->getExtraInfo(extraInfoName);
280 } else
281 {
282 return Const::doubleNaN;
283 }
284 };
285 return func;
286 } else {
287 B2FATAL("Wrong number of arguments for meta function extraInfo")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function extraInfo"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 287, 0)); }; exit(1); } while(false)
;
288 }
289 }
290
291 Manager::FunctionPtr eventExtraInfo(const std::vector<std::string>& arguments)
292 {
293 if (arguments.size() == 1) {
294 auto extraInfoName = arguments[0];
295 auto func = [extraInfoName](const Particle*) -> double {
296 StoreObjPtr<EventExtraInfo> eventExtraInfo;
297 if (not eventExtraInfo.isValid())
298 return Const::doubleNaN;
299 if (eventExtraInfo->hasExtraInfo(extraInfoName))
300 {
301 return eventExtraInfo->getExtraInfo(extraInfoName);
302 } else
303 {
304 return Const::doubleNaN;
305 }
306 };
307 return func;
308 } else {
309 B2FATAL("Wrong number of arguments for meta function extraInfo")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function extraInfo"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 309, 0)); }; exit(1); } while(false)
;
310 }
311 }
312
313 Manager::FunctionPtr eventCached(const std::vector<std::string>& arguments)
314 {
315 if (arguments.size() == 1) {
316 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
317 std::string key = std::string("__") + MakeROOTCompatible::makeROOTCompatible(var->name);
318 auto func = [var, key](const Particle*) -> double {
319
320 StoreObjPtr<EventExtraInfo> eventExtraInfo;
321 if (not eventExtraInfo.isValid())
322 eventExtraInfo.create();
323 if (eventExtraInfo->hasExtraInfo(key))
324 {
325 return eventExtraInfo->getExtraInfo(key);
326 } else
327 {
328 double value = Const::doubleNaN;
329 auto var_result = var->function(nullptr);
330 if (std::holds_alternative<double>(var_result)) {
331 value = std::get<double>(var_result);
332 } else if (std::holds_alternative<int>(var_result)) {
333 return std::get<int>(var_result);
334 } else if (std::holds_alternative<bool>(var_result)) {
335 return std::get<bool>(var_result);
336 }
337 eventExtraInfo->addExtraInfo(key, value);
338 return value;
339 }
340 };
341 return func;
342 } else {
343 B2FATAL("Wrong number of arguments for meta function eventCached")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function eventCached"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 343, 0)); }; exit(1); } while(false)
;
344 }
345 }
346
347 Manager::FunctionPtr particleCached(const std::vector<std::string>& arguments)
348 {
349 if (arguments.size() == 1) {
350 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
351 std::string key = std::string("__") + MakeROOTCompatible::makeROOTCompatible(var->name);
352 auto func = [var, key](const Particle * particle) -> double {
353
354 if (particle->hasExtraInfo(key))
355 {
356 return particle->getExtraInfo(key);
357 } else
358 {
359 double value = std::get<double>(var->function(particle));
360 // Remove constness from Particle pointer.
361 // The extra-info is used as a cache in our case,
362 // indicated by the double-underscore in front of the key.
363 // One could implement the cache as a separate property of the particle object
364 // and mark it as mutable, however, this would only lead to code duplication
365 // and an increased size of the particle object.
366 // Thus, we decided to use the extra-info field and cast away the const in this case.
367 const_cast<Particle*>(particle)->addExtraInfo(key, value);
368 return value;
369 }
370 };
371 return func;
372 } else {
373 B2FATAL("Wrong number of arguments for meta function particleCached")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function particleCached"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 373, 0)); }; exit(1); } while(false)
;
374 }
375 }
376
377 // Formula of other variables, going to require a space between all operators and operations.
378 // Later can add some check for : (colon) trailing + or - to distinguish between particle lists
379 // and operations, but for now cbf.
380 Manager::FunctionPtr formula(const std::vector<std::string>& arguments)
381 {
382 if (arguments.size() != 1) B2FATAL("Wrong number of arguments for meta function formula")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function formula"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 382, 0)); }; exit(1); } while(false)
;
383 FormulaParser<VariableFormulaConstructor> parser;
384 try {
385 return parser.parse(arguments[0]);
386 } catch (std::runtime_error& e) {
387 B2FATAL(e.what())do { { LogVariableStream varStream; varStream << e.what
(); Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 387, 0)); }; exit(1); } while(false)
;
388 }
389 }
390
391 Manager::FunctionPtr nCleanedTracks(const std::vector<std::string>& arguments)
392 {
393 if (arguments.size() <= 1) {
394
395 std::string cutString;
396 if (arguments.size() == 1)
397 cutString = arguments[0];
398 std::shared_ptr<Variable::Cut> cut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(cutString));
399 auto func = [cut](const Particle*) -> int {
400
401 int number_of_tracks = 0;
402 StoreArray<Track> tracks;
403 for (const auto& track : tracks)
404 {
405 const TrackFitResult* trackFit = track.getTrackFitResultWithClosestMass(Const::pion);
406 if (!trackFit) continue;
407 if (trackFit->getChargeSign() == 0) {
408 // Ignore track
409 } else {
410 Particle particle(&track, Const::pion);
411 if (cut->check(&particle))
412 number_of_tracks++;
413 }
414 }
415
416 return number_of_tracks;
417
418 };
419 return func;
420 } else {
421 B2FATAL("Wrong number of arguments for meta function nCleanedTracks")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function nCleanedTracks"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 421, 0)); }; exit(1); } while(false)
;
422 }
423 }
424
425 Manager::FunctionPtr nCleanedECLClusters(const std::vector<std::string>& arguments)
426 {
427 if (arguments.size() <= 1) {
428
429 std::string cutString;
430 if (arguments.size() == 1)
431 cutString = arguments[0];
432 std::shared_ptr<Variable::Cut> cut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(cutString));
433 auto func = [cut](const Particle*) -> int {
434
435 int number_of_clusters = 0;
436 StoreArray<ECLCluster> clusters;
437 for (const auto& cluster : clusters)
438 {
439 // look only at momentum of N1 (n photons) ECLClusters
440 if (!cluster.hasHypothesis(ECLCluster::EHypothesisBit::c_nPhotons))
441 continue;
442
443 Particle particle(&cluster);
444 if (cut->check(&particle))
445 number_of_clusters++;
446 }
447
448 return number_of_clusters;
449
450 };
451 return func;
452 } else {
453 B2FATAL("Wrong number of arguments for meta function nCleanedECLClusters")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function nCleanedECLClusters"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 453, 0)); }; exit(1); } while(false)
;
454 }
455 }
456
457 Manager::FunctionPtr passesCut(const std::vector<std::string>& arguments)
458 {
459 if (arguments.size() == 1) {
460 std::string cutString = arguments[0];
461 std::shared_ptr<Variable::Cut> cut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(cutString));
462 auto func = [cut](const Particle * particle) -> bool {
463 if (cut->check(particle))
464 return 1;
465 else
466 return 0;
467 };
468 return func;
469 } else {
470 B2FATAL("Wrong number of arguments for meta function passesCut")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function passesCut"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 470, 0)); }; exit(1); } while(false)
;
471 }
472 }
473
474 Manager::FunctionPtr passesEventCut(const std::vector<std::string>& arguments)
475 {
476 if (arguments.size() == 1) {
477 std::string cutString = arguments[0];
478 std::shared_ptr<Variable::Cut> cut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(cutString));
479 auto func = [cut](const Particle*) -> bool {
480 if (cut->check(nullptr))
481 return 1;
482 else
483 return 0;
484 };
485 return func;
486 } else {
487 B2FATAL("Wrong number of arguments for meta function passesEventCut")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function passesEventCut"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 487, 0)); }; exit(1); } while(false)
;
488 }
489 }
490
491 Manager::FunctionPtr varFor(const std::vector<std::string>& arguments)
492 {
493 if (arguments.size() == 2) {
494 int pdgCode = 0;
495 try {
496 pdgCode = convertString<int>(arguments[0]);
497 } catch (std::invalid_argument&) {
498 B2FATAL("The first argument of varFor meta function must be a positive integer!")do { { LogVariableStream varStream; varStream << "The first argument of varFor meta function must be a positive integer!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 498, 0)); }; exit(1); } while(false)
;
499 }
500 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
501 auto func = [pdgCode, var](const Particle * particle) -> double {
502 if (std::abs(particle->getPDGCode()) == std::abs(pdgCode))
503 {
504 auto var_result = var->function(particle);
505 if (std::holds_alternative<double>(var_result)) {
506 return std::get<double>(var_result);
507 } else if (std::holds_alternative<int>(var_result)) {
508 return std::get<int>(var_result);
509 } else if (std::holds_alternative<bool>(var_result)) {
510 return std::get<bool>(var_result);
511 } else return Const::doubleNaN;
512 } else return Const::doubleNaN;
513 };
514 return func;
515 } else {
516 B2FATAL("Wrong number of arguments for meta function varFor")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function varFor"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 516, 0)); }; exit(1); } while(false)
;
517 }
518 }
519
520 Manager::FunctionPtr varForMCGen(const std::vector<std::string>& arguments)
521 {
522 if (arguments.size() == 1) {
523 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
524 auto func = [var](const Particle * particle) -> double {
525 if (particle->getMCParticle())
526 {
527 if (particle->getMCParticle()->getStatus(MCParticle::c_PrimaryParticle)
528 && (! particle->getMCParticle()->getStatus(MCParticle::c_IsVirtual))
529 && (! particle->getMCParticle()->getStatus(MCParticle::c_Initial))) {
530 auto var_result = var->function(particle);
531 if (std::holds_alternative<double>(var_result)) {
532 return std::get<double>(var_result);
533 } else if (std::holds_alternative<int>(var_result)) {
534 return std::get<int>(var_result);
535 } else if (std::holds_alternative<bool>(var_result)) {
536 return std::get<bool>(var_result);
537 } else return Const::doubleNaN;
538 } else return Const::doubleNaN;
539 } else return Const::doubleNaN;
540 };
541 return func;
542 } else {
543 B2FATAL("Wrong number of arguments for meta function varForMCGen")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function varForMCGen"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 543, 0)); }; exit(1); } while(false)
;
544 }
545 }
546
547 Manager::FunctionPtr nParticlesInList(const std::vector<std::string>& arguments)
548 {
549 if (arguments.size() == 1) {
550 std::string listName = arguments[0];
551 auto func = [listName](const Particle * particle) -> int {
552
553 (void) particle;
554 StoreObjPtr<ParticleList> listOfParticles(listName);
555
556 if (!(listOfParticles.isValid())) B2FATAL("Invalid Listname " << listName << " given to nParticlesInList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< listName << " given to nParticlesInList"; Belle2
::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2
::LogConfig::c_Fatal, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 556, 0)); }; exit
(1); } while(false)
;
557
558 return listOfParticles->getListSize();
559
560 };
561 return func;
562 } else {
563 B2FATAL("Wrong number of arguments for meta function nParticlesInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function nParticlesInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 563, 0)); }; exit(1); } while(false)
;
564 }
565 }
566
567 Manager::FunctionPtr isInList(const std::vector<std::string>& arguments)
568 {
569 // unpack arguments, there should be only one: the name of the list we're checking
570 if (arguments.size() != 1) {
571 B2FATAL("Wrong number of arguments for isInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for isInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 571, 0)); }; exit(1); } while(false)
;
572 }
573 auto listName = arguments[0];
574
575 auto func = [listName](const Particle * particle) -> bool {
576
577 // check the list exists
578 StoreObjPtr<ParticleList> list(listName);
579 if (!(list.isValid()))
580 {
581 B2FATAL("Invalid Listname " << listName << " given to isInList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< listName << " given to isInList"; Belle2::LogSystem
::Instance().sendMessage(Belle2::LogMessage(Belle2::LogConfig
::c_Fatal, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 581, 0)); }; exit
(1); } while(false)
;
582 }
583
584 // is the particle in the list?
585 return list->contains(particle);
586
587 };
588 return func;
589 }
590
591 Manager::FunctionPtr sourceObjectIsInList(const std::vector<std::string>& arguments)
592 {
593 // unpack arguments, there should be only one: the name of the list we're checking
594 if (arguments.size() != 1) {
595 B2FATAL("Wrong number of arguments for sourceObjectIsInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for sourceObjectIsInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 595, 0)); }; exit(1); } while(false)
;
596 }
597 auto listName = arguments[0];
598
599 auto func = [listName](const Particle * particle) -> int {
600
601 // check the list exists
602 StoreObjPtr<ParticleList> list(listName);
603 if (!(list.isValid()))
604 {
605 B2FATAL("Invalid Listname " << listName << " given to sourceObjectIsInList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< listName << " given to sourceObjectIsInList";
Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 605, 0)); }; exit(1); } while(false)
;
606 }
607
608 // this only makes sense for particles that are *not* composite and come
609 // from some mdst object (tracks, clusters..)
610 Particle::EParticleSourceObject particlesource = particle->getParticleSource();
611 if (particlesource == Particle::EParticleSourceObject::c_Composite
612 or particlesource == Particle::EParticleSourceObject::c_Undefined)
613 return -1;
614
615 // it *is* possible to have a particle list from different sources (like
616 // hadrons from the ECL and KLM) so we have to check each particle in
617 // the list individually
618 for (unsigned i = 0; i < list->getListSize(); ++i)
619 {
620 const Particle* iparticle = list->getParticle(i);
621 if (particle->getMdstSource() == iparticle->getMdstSource())
622 return 1;
623 }
624 return 0;
625
626 };
627 return func;
628 }
629
630 Manager::FunctionPtr mcParticleIsInMCList(const std::vector<std::string>& arguments)
631 {
632 // unpack arguments, there should be only one: the name of the list we're checking
633 if (arguments.size() != 1) {
634 B2FATAL("Wrong number of arguments for mcParticleIsInMCList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for mcParticleIsInMCList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 634, 0)); }; exit(1); } while(false)
;
635 }
636 auto listName = arguments[0];
637
638 auto func = [listName](const Particle * particle) -> bool {
639
640 // check the list exists
641 StoreObjPtr<ParticleList> list(listName);
642 if (!(list.isValid()))
643 B2FATAL("Invalid Listname " << listName << " given to mcParticleIsInMCList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< listName << " given to mcParticleIsInMCList";
Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 643, 0)); }; exit(1); } while(false)
;
644
645 // this can only be true for mc-matched particles or particles are created from MCParticles
646 const MCParticle* mcp = particle->getMCParticle();
647 if (mcp == nullptr) return false;
648
649 // check every particle in the input list is not matched to (or created from) the same MCParticle
650 for (unsigned i = 0; i < list->getListSize(); ++i)
651 {
652 const MCParticle* imcp = list->getParticle(i)->getMCParticle();
653 if ((imcp != nullptr) and (mcp->getArrayIndex() == imcp->getArrayIndex()))
654 return true;
655 }
656 return false;
657 };
658 return func;
659 }
660
661 Manager::FunctionPtr isDaughterOfList(const std::vector<std::string>& arguments)
662 {
663 B2WARNING("isDaughterOfList is outdated and replaced by isDescendantOfList.")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "isDaughterOfList is outdated and replaced by isDescendantOfList."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Warning, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 663, 0)); }; } } while(false)
;
664 std::vector<std::string> new_arguments = arguments;
665 new_arguments.push_back(std::string("1"));
666 return isDescendantOfList(new_arguments);
667 }
668
669 Manager::FunctionPtr isGrandDaughterOfList(const std::vector<std::string>& arguments)
670 {
671 B2WARNING("isGrandDaughterOfList is outdated and replaced by isDescendantOfList.")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "isGrandDaughterOfList is outdated and replaced by isDescendantOfList."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Warning, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 671, 0)); }; } } while(false)
;
672 std::vector<std::string> new_arguments = arguments;
673 new_arguments.push_back(std::string("2"));
674 return isDescendantOfList(new_arguments);
675 }
676
677 Manager::FunctionPtr isDescendantOfList(const std::vector<std::string>& arguments)
678 {
679 if (arguments.size() > 0) {
680 auto listNames = arguments;
681 auto func = [listNames](const Particle * particle) -> bool {
682 bool output = false;
683 int generation_flag = -1;
684 try
685 {
686 generation_flag = convertString<int>(listNames.back());
687 } catch (const std::exception& e) {}
688
689 for (const auto& iListName : listNames)
690 {
691 try {
692 convertString<int>(iListName);
693 continue;
694 } catch (const std::exception& e) {}
695
696 // Creating recursive lambda
697 auto list_comparison = [](auto&& self, const Particle * m, const Particle * p, int flag)-> bool {
698 bool result = false;
699 for (unsigned i = 0; i < m->getNDaughters(); ++i)
700 {
701 const Particle* daughter = m->getDaughter(i);
702 if ((flag == 1.) or (flag < 0)) {
703 if (p->isCopyOf(daughter)) {
704 return true;
705 }
706 }
707
708 if (flag != 1.) {
709 if (daughter->getNDaughters() > 0) {
710 result = self(self, daughter, p, flag - 1);
711 if (result == 1) {
712 return true;
713 }
714 }
715 }
716 }
717 return result;
718 };
719
720 StoreObjPtr<ParticleList> listOfParticles(iListName);
721
722 if (!(listOfParticles.isValid())) B2FATAL("Invalid Listname " << iListName << " given to isDescendantOfList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< iListName << " given to isDescendantOfList"; Belle2
::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2
::LogConfig::c_Fatal, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 722, 0)); }; exit
(1); } while(false)
;
723
724 for (unsigned i = 0; i < listOfParticles->getListSize(); ++i) {
725 Particle* iParticle = listOfParticles->getParticle(i);
726 output = list_comparison(list_comparison, iParticle, particle, generation_flag);
727 if (output) {
728 return output;
729 }
730 }
731 }
732 return output;
733 };
734 return func;
735 } else {
736 B2FATAL("Wrong number of arguments for meta function isDescendantOfList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function isDescendantOfList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 736, 0)); }; exit(1); } while(false)
;
737 }
738 }
739
740 Manager::FunctionPtr isMCDescendantOfList(const std::vector<std::string>& arguments)
741 {
742 if (arguments.size() > 0) {
743 auto listNames = arguments;
744 auto func = [listNames](const Particle * particle) -> bool {
745 bool output = false;
746 int generation_flag = -1;
747 try
748 {
749 generation_flag = convertString<int>(listNames.back());
750 } catch (const std::exception& e) {}
751
752 if (particle->getMCParticle() == nullptr)
753 {
754 return false;
755 }
756
757 for (const auto& iListName : listNames)
758 {
759 try {
760 std::stod(iListName);
761 continue;
762 } catch (const std::exception& e) {}
763 // Creating recursive lambda
764 auto list_comparison = [](auto&& self, const Particle * m, const Particle * p, int flag)-> bool {
765 bool result = false;
766 for (unsigned i = 0; i < m->getNDaughters(); ++i)
767 {
768 const Particle* daughter = m->getDaughter(i);
769 if ((flag == 1.) or (flag < 0)) {
770 if (daughter->getMCParticle() != nullptr) {
771 if (p->getMCParticle()->getArrayIndex() == daughter->getMCParticle()->getArrayIndex()) {
772 return true;
773 }
774 }
775 }
776 if (flag != 1.) {
777 if (daughter->getNDaughters() > 0) {
778 result = self(self, daughter, p, flag - 1);
779 if (result) {
780 return true;
781 }
782 }
783 }
784 }
785 return result;
786 };
787
788 StoreObjPtr<ParticleList> listOfParticles(iListName);
789
790 if (!(listOfParticles.isValid())) B2FATAL("Invalid Listname " << iListName << " given to isMCDescendantOfList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< iListName << " given to isMCDescendantOfList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 790, 0)); }; exit(1); } while(false)
;
791
792 for (unsigned i = 0; i < listOfParticles->getListSize(); ++i) {
793 Particle* iParticle = listOfParticles->getParticle(i);
794 output = list_comparison(list_comparison, iParticle, particle, generation_flag);
795 if (output) {
796 return output;
797 }
798 }
799 }
800 return output;
801 };
802 return func;
803 } else {
804 B2FATAL("Wrong number of arguments for meta function isMCDescendantOfList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function isMCDescendantOfList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 804, 0)); }; exit(1); } while(false)
;
805 }
806 }
807
808 Manager::FunctionPtr daughterProductOf(const std::vector<std::string>& arguments)
809 {
810 if (arguments.size() == 1) {
811 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
812 auto func = [var](const Particle * particle) -> double {
813 double product = 1.0;
814 if (particle->getNDaughters() == 0)
815 {
816 return Const::doubleNaN;
817 }
818 if (std::holds_alternative<double>(var->function(particle->getDaughter(0))))
819 {
820 for (unsigned j = 0; j < particle->getNDaughters(); ++j) {
821 product *= std::get<double>(var->function(particle->getDaughter(j)));
822 }
823 } else if (std::holds_alternative<int>(var->function(particle->getDaughter(0))))
824 {
825 for (unsigned j = 0; j < particle->getNDaughters(); ++j) {
826 product *= std::get<int>(var->function(particle->getDaughter(j)));
827 }
828 } else return Const::doubleNaN;
829 return product;
830 };
831 return func;
832 } else {
833 B2FATAL("Wrong number of arguments for meta function daughterProductOf")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughterProductOf"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 833, 0)); }; exit(1); } while(false)
;
834 }
835 }
836
837 Manager::FunctionPtr daughterSumOf(const std::vector<std::string>& arguments)
838 {
839 if (arguments.size() == 1) {
840 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
841 auto func = [var](const Particle * particle) -> double {
842 double sum = 0.0;
843 if (particle->getNDaughters() == 0)
844 {
845 return Const::doubleNaN;
846 }
847 if (std::holds_alternative<double>(var->function(particle->getDaughter(0))))
848 {
849 for (unsigned j = 0; j < particle->getNDaughters(); ++j) {
850 sum += std::get<double>(var->function(particle->getDaughter(j)));
851 }
852 } else if (std::holds_alternative<int>(var->function(particle->getDaughter(0))))
853 {
854 for (unsigned j = 0; j < particle->getNDaughters(); ++j) {
855 sum += std::get<int>(var->function(particle->getDaughter(j)));
856 }
857 } else return Const::doubleNaN;
858 return sum;
859 };
860 return func;
861 } else {
862 B2FATAL("Wrong number of arguments for meta function daughterSumOf")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughterSumOf"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 862, 0)); }; exit(1); } while(false)
;
863 }
864 }
865
866 Manager::FunctionPtr daughterLowest(const std::vector<std::string>& arguments)
867 {
868 if (arguments.size() == 1) {
869 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
870 auto func = [var](const Particle * particle) -> double {
871 double min = Const::doubleNaN;
872 if (particle->getNDaughters() == 0)
873 {
874 return Const::doubleNaN;
875 }
876 if (std::holds_alternative<double>(var->function(particle->getDaughter(0))))
877 {
878 for (unsigned j = 0; j < particle->getNDaughters(); ++j) {
879 double iValue = std::get<double>(var->function(particle->getDaughter(j)));
880 if (std::isnan(iValue)) continue;
881 if (std::isnan(min)) min = iValue;
882 if (iValue < min) min = iValue;
883 }
884 } else if (std::holds_alternative<int>(var->function(particle->getDaughter(0))))
885 {
886 for (unsigned j = 0; j < particle->getNDaughters(); ++j) {
887 int iValue = std::get<int>(var->function(particle->getDaughter(j)));
888 if (std::isnan(min)) min = iValue;
889 if (iValue < min) min = iValue;
890 }
891 }
892 return min;
893 };
894 return func;
895 } else {
896 B2FATAL("Wrong number of arguments for meta function daughterLowest")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughterLowest"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 896, 0)); }; exit(1); } while(false)
;
897 }
898 }
899
900 Manager::FunctionPtr daughterHighest(const std::vector<std::string>& arguments)
901 {
902 if (arguments.size() == 1) {
903 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
904 auto func = [var](const Particle * particle) -> double {
905 double max = Const::doubleNaN;
906 if (particle->getNDaughters() == 0)
907 {
908 return Const::doubleNaN;
909 }
910 if (std::holds_alternative<double>(var->function(particle->getDaughter(0))))
911 {
912 for (unsigned j = 0; j < particle->getNDaughters(); ++j) {
913 double iValue = std::get<double>(var->function(particle->getDaughter(j)));
914 if (std::isnan(iValue)) continue;
915 if (std::isnan(max)) max = iValue;
916 if (iValue > max) max = iValue;
917 }
918 } else if (std::holds_alternative<int>(var->function(particle->getDaughter(0))))
919 {
920 for (unsigned j = 0; j < particle->getNDaughters(); ++j) {
921 int iValue = std::get<int>(var->function(particle->getDaughter(j)));
922 if (std::isnan(max)) max = iValue;
923 if (iValue > max) max = iValue;
924 }
925 }
926 return max;
927 };
928 return func;
929 } else {
930 B2FATAL("Wrong number of arguments for meta function daughterHighest")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughterHighest"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 930, 0)); }; exit(1); } while(false)
;
931 }
932 }
933
934 Manager::FunctionPtr daughterDiffOf(const std::vector<std::string>& arguments)
935 {
936 if (arguments.size() == 3) {
937 auto func = [arguments](const Particle * particle) -> double {
938 if (particle == nullptr)
939 return Const::doubleNaN;
940 const Particle* dau_i = particle->getParticleFromGeneralizedIndexString(arguments[0]);
941 const Particle* dau_j = particle->getParticleFromGeneralizedIndexString(arguments[1]);
942 auto variablename = arguments[2];
943 if (dau_i == nullptr || dau_j == nullptr)
944 {
945 B2ERROR("One of the first two arguments doesn't specify a valid (grand-)daughter!")do { { LogVariableStream varStream; varStream << "One of the first two arguments doesn't specify a valid (grand-)daughter!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Error, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 945, 0)); } } while(false)
;
946 return Const::doubleNaN;
947 }
948 const Variable::Manager::Var* var = Manager::Instance().getVariable(variablename);
949 auto result_j = var->function(dau_j);
950 auto result_i = var->function(dau_i);
951 double diff = Const::doubleNaN;
952 if (std::holds_alternative<double>(result_j) && std::holds_alternative<double>(result_i))
953 {
954 diff = std::get<double>(result_j) - std::get<double>(result_i);
955 } else if (std::holds_alternative<int>(result_j) && std::holds_alternative<int>(result_i))
956 {
957 diff = std::get<int>(result_j) - std::get<int>(result_i);
958 } else
959 {
960 throw std::runtime_error("Bad variant access");
961 }
962 if (variablename == "phi" or variablename == "clusterPhi" or std::regex_match(variablename, std::regex("use.*Frame\\(phi\\)"))
963 or std::regex_match(variablename, std::regex("use.*Frame\\(clusterPhi\\)")))
964 {
965 if (fabs(diff) > M_PI3.14159265358979323846) {
966 if (diff > M_PI3.14159265358979323846) {
967 diff = diff - 2 * M_PI3.14159265358979323846;
968 } else {
969 diff = 2 * M_PI3.14159265358979323846 + diff;
970 }
971 }
972 }
973 return diff;
974 };
975 return func;
976 } else {
977 B2FATAL("Wrong number of arguments for meta function daughterDiffOf")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughterDiffOf"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 977, 0)); }; exit(1); } while(false)
;
978 }
979 }
980
981 Manager::FunctionPtr mcDaughterDiffOf(const std::vector<std::string>& arguments)
982 {
983 if (arguments.size() == 3) {
984 auto func = [arguments](const Particle * particle) -> double {
985 if (particle == nullptr)
986 return Const::doubleNaN;
987 const Particle* dau_i = particle->getParticleFromGeneralizedIndexString(arguments[0]);
988 const Particle* dau_j = particle->getParticleFromGeneralizedIndexString(arguments[1]);
989 auto variablename = arguments[2];
990 if (dau_i == nullptr || dau_j == nullptr)
991 {
992 B2ERROR("One of the first two arguments doesn't specify a valid (grand-)daughter!")do { { LogVariableStream varStream; varStream << "One of the first two arguments doesn't specify a valid (grand-)daughter!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Error, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 992, 0)); } } while(false)
;
993 return Const::doubleNaN;
994 }
995 const MCParticle* iMcDaughter = dau_i->getMCParticle();
996 const MCParticle* jMcDaughter = dau_j->getMCParticle();
997 if (iMcDaughter == nullptr || jMcDaughter == nullptr)
998 return Const::doubleNaN;
999 Particle iTmpPart(iMcDaughter);
1000 Particle jTmpPart(jMcDaughter);
1001 const Variable::Manager::Var* var = Manager::Instance().getVariable(variablename);
1002 auto result_j = var->function(&jTmpPart);
1003 auto result_i = var->function(&iTmpPart);
1004 double diff = Const::doubleNaN;
1005 if (std::holds_alternative<double>(result_j) && std::holds_alternative<double>(result_i))
1006 {
1007 diff = std::get<double>(result_j) - std::get<double>(result_i);
1008 } else if (std::holds_alternative<int>(result_j) && std::holds_alternative<int>(result_i))
1009 {
1010 diff = std::get<int>(result_j) - std::get<int>(result_i);
1011 } else
1012 {
1013 throw std::runtime_error("Bad variant access");
1014 }
1015 if (variablename == "phi" or std::regex_match(variablename, std::regex("use.*Frame\\(phi\\)")))
1016 {
1017 if (fabs(diff) > M_PI3.14159265358979323846) {
1018 if (diff > M_PI3.14159265358979323846) {
1019 diff = diff - 2 * M_PI3.14159265358979323846;
1020 } else {
1021 diff = 2 * M_PI3.14159265358979323846 + diff;
1022 }
1023 }
1024 }
1025 return diff;
1026 };
1027 return func;
1028 } else {
1029 B2FATAL("Wrong number of arguments for meta function mcDaughterDiffOf")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function mcDaughterDiffOf"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1029, 0)); }; exit(1); } while(false)
;
1030 }
1031 }
1032
1033 Manager::FunctionPtr grandDaughterDiffOf(const std::vector<std::string>& arguments)
1034 {
1035 if (arguments.size() == 5) {
1036 try {
1037 convertString<int>(arguments[0]);
1038 convertString<int>(arguments[1]);
1039 convertString<int>(arguments[2]);
1040 convertString<int>(arguments[3]);
1041 } catch (std::invalid_argument&) {
1042 B2FATAL("First four arguments of grandDaughterDiffOf meta function must be integers!")do { { LogVariableStream varStream; varStream << "First four arguments of grandDaughterDiffOf meta function must be integers!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1042, 0)); }; exit(1); } while(false)
;
1043 }
1044 std::vector<std::string> new_arguments;
1045 new_arguments.push_back(std::string(arguments[0] + ":" + arguments[2]));
1046 new_arguments.push_back(std::string(arguments[1] + ":" + arguments[3]));
1047 new_arguments.push_back(arguments[4]);
1048 return daughterDiffOf(new_arguments);
1049 } else {
1050 B2FATAL("Wrong number of arguments for meta function grandDaughterDiffOf")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function grandDaughterDiffOf"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1050, 0)); }; exit(1); } while(false)
;
1051 }
1052 }
1053
1054 Manager::FunctionPtr daughterNormDiffOf(const std::vector<std::string>& arguments)
1055 {
1056 if (arguments.size() == 3) {
1057 auto func = [arguments](const Particle * particle) -> double {
1058 if (particle == nullptr)
1059 return Const::doubleNaN;
1060 const Particle* dau_i = particle->getParticleFromGeneralizedIndexString(arguments[0]);
1061 const Particle* dau_j = particle->getParticleFromGeneralizedIndexString(arguments[1]);
1062 if (!(dau_i && dau_j))
1063 {
1064 B2ERROR("One of the first two arguments doesn't specify a valid (grand-)daughter!")do { { LogVariableStream varStream; varStream << "One of the first two arguments doesn't specify a valid (grand-)daughter!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Error, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1064, 0)); } } while(false)
;
1065 return Const::doubleNaN;
1066 }
1067 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[2]);
1068 double iValue, jValue;
1069 if (std::holds_alternative<double>(var->function(dau_j)))
1070 {
1071 iValue = std::get<double>(var->function(dau_i));
1072 jValue = std::get<double>(var->function(dau_j));
1073 } else if (std::holds_alternative<int>(var->function(dau_j)))
1074 {
1075 iValue = std::get<int>(var->function(dau_i));
1076 jValue = std::get<int>(var->function(dau_j));
1077 } else return Const::doubleNaN;
1078 return (jValue - iValue) / (jValue + iValue);
1079 };
1080 return func;
1081 } else {
1082 B2FATAL("Wrong number of arguments for meta function daughterNormDiffOf")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughterNormDiffOf"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1082, 0)); }; exit(1); } while(false)
;
1083 }
1084 }
1085
1086 Manager::FunctionPtr daughterMotherDiffOf(const std::vector<std::string>& arguments)
1087 {
1088 if (arguments.size() == 2) {
1089 auto daughterFunction = convertToDaughterIndex({arguments[0]});
1090 std::string variableName = arguments[1];
1091 auto func = [daughterFunction, variableName](const Particle * particle) -> double {
1092 if (particle == nullptr)
1093 return Const::doubleNaN;
1094 int daughterNumber = std::get<int>(daughterFunction(particle));
1095 if (daughterNumber >= int(particle->getNDaughters()) or daughterNumber < 0)
1096 return Const::doubleNaN;
1097 const Variable::Manager::Var* var = Manager::Instance().getVariable(variableName);
1098 auto result_mother = var->function(particle);
1099 auto result_daughter = var->function(particle->getDaughter(daughterNumber));
1100 double diff = Const::doubleNaN;
1101 if (std::holds_alternative<double>(result_mother) && std::holds_alternative<double>(result_daughter))
1102 {
1103 diff = std::get<double>(result_mother) - std::get<double>(result_daughter);
1104 } else if (std::holds_alternative<int>(result_mother) && std::holds_alternative<int>(result_daughter))
1105 {
1106 diff = std::get<int>(result_mother) - std::get<int>(result_daughter);
1107 } else
1108 {
1109 throw std::runtime_error("Bad variant access");
1110 }
1111
1112 if (variableName == "phi" or variableName == "useCMSFrame(phi)")
1113 {
1114 if (fabs(diff) > M_PI3.14159265358979323846) {
1115 if (diff > M_PI3.14159265358979323846) {
1116 diff = diff - 2 * M_PI3.14159265358979323846;
1117 } else {
1118 diff = 2 * M_PI3.14159265358979323846 + diff;
1119 }
1120 }
1121 }
1122 return diff;
1123 };
1124 return func;
1125 } else {
1126 B2FATAL("Wrong number of arguments for meta function daughterMotherDiffOf")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughterMotherDiffOf"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1126, 0)); }; exit(1); } while(false)
;
1127 }
1128 }
1129
1130 Manager::FunctionPtr daughterMotherNormDiffOf(const std::vector<std::string>& arguments)
1131 {
1132 if (arguments.size() == 2) {
1133 auto daughterFunction = convertToDaughterIndex({arguments[0]});
1134 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
1135 auto func = [var, daughterFunction](const Particle * particle) -> double {
1136 if (particle == nullptr)
1137 return Const::doubleNaN;
1138 int daughterNumber = std::get<int>(daughterFunction(particle));
1139 if (daughterNumber >= int(particle->getNDaughters()) or daughterNumber < 0)
1140 return Const::doubleNaN;
1141 double daughterValue = 0.0, motherValue = 0.0;
1142 if (std::holds_alternative<double>(var->function(particle)))
1143 {
1144 daughterValue = std::get<double>(var->function(particle->getDaughter(daughterNumber)));
1145 motherValue = std::get<double>(var->function(particle));
1146 } else if (std::holds_alternative<int>(var->function(particle)))
1147 {
1148 daughterValue = std::get<int>(var->function(particle->getDaughter(daughterNumber)));
1149 motherValue = std::get<int>(var->function(particle));
1150 }
1151 return (motherValue - daughterValue) / (motherValue + daughterValue);
1152 };
1153 return func;
1154 } else {
1155 B2FATAL("Wrong number of arguments for meta function daughterMotherNormDiffOf")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughterMotherNormDiffOf"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1155, 0)); }; exit(1); } while(false)
;
1156 }
1157 }
1158
1159 Manager::FunctionPtr angleBetweenDaughterAndRecoil(const std::vector<std::string>& arguments)
1160 {
1161 if (arguments.size() >= 1) {
1162
1163 auto func = [arguments](const Particle * particle) -> double {
1164 if (particle == nullptr)
1165 return Const::doubleNaN;
1166
1167 const auto& frame = ReferenceFrame::GetCurrent();
1168
1169 ROOT::Math::PxPyPzEVector pSum(0, 0, 0, 0);
1170 for (const auto& generalizedIndex : arguments)
1171 {
1172 const Particle* dauPart = particle->getParticleFromGeneralizedIndexString(generalizedIndex);
1173 if (dauPart) pSum += frame.getMomentum(dauPart);
1174 else {
1175 B2WARNING("Trying to access a daughter that does not exist. Index = " << generalizedIndex)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "Trying to access a daughter that does not exist. Index = "
<< generalizedIndex; Belle2::LogSystem::Instance().sendMessage
(Belle2::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1175, 0)); }; } } while(false)
;
1176 return Const::doubleNaN;
1177 }
1178 }
1179
1180 PCmsLabTransform T;
1181 ROOT::Math::PxPyPzEVector pIN = T.getBeamFourMomentum(); // Initial state (e+e- momentum in LAB)
1182 ROOT::Math::PxPyPzEVector pRecoil = frame.getMomentum(pIN - particle->get4Vector());
1183
1184 return ROOT::Math::VectorUtil::Angle(pRecoil, pSum);
1185 };
1186 return func;
1187 } else {
1188 B2FATAL("Wrong number of arguments for meta function angleBetweenDaughterAndRecoil")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function angleBetweenDaughterAndRecoil"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1188, 0)); }; exit(1); } while(false)
;
1189 }
1190 }
1191
1192 Manager::FunctionPtr angleBetweenDaughterAndMissingMomentum(const std::vector<std::string>& arguments)
1193 {
1194 if (arguments.size() >= 1) {
1195 auto func = [arguments](const Particle * particle) -> double {
1196 if (particle == nullptr)
1197 return Const::doubleNaN;
1198
1199 StoreObjPtr<EventKinematics> evtShape;
1200 if (!evtShape)
1201 {
1202 B2WARNING("Cannot find missing momentum information, did you forget to run EventKinematicsModule?")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "Cannot find missing momentum information, did you forget to run EventKinematicsModule?"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Warning, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1202, 0)); }; } } while(false)
;
1203 return Const::doubleNaN;
1204 }
1205 ROOT::Math::XYZVector missingMomentumCMS = evtShape->getMissingMomentumCMS();
1206 ROOT::Math::PxPyPzEVector missingTotalMomentumCMS(missingMomentumCMS.X(),
1207 missingMomentumCMS.Y(),
1208 missingMomentumCMS.Z(),
1209 evtShape->getMissingEnergyCMS());
1210 PCmsLabTransform T;
1211 ROOT::Math::PxPyPzEVector missingTotalMomentumLab = T.rotateCmsToLab() * missingTotalMomentumCMS;
1212
1213 const auto& frame = ReferenceFrame::GetCurrent();
1214 ROOT::Math::PxPyPzEVector pMiss = frame.getMomentum(missingTotalMomentumLab); // transform from lab to reference frame
1215
1216 ROOT::Math::PxPyPzEVector pSum(0, 0, 0, 0);
1217 for (const auto& generalizedIndex : arguments)
1218 {
1219 const Particle* dauPart = particle->getParticleFromGeneralizedIndexString(generalizedIndex);
1220 if (dauPart) pSum += frame.getMomentum(dauPart);
1221 else {
1222 B2WARNING("Trying to access a daughter that does not exist. Index = " << generalizedIndex)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "Trying to access a daughter that does not exist. Index = "
<< generalizedIndex; Belle2::LogSystem::Instance().sendMessage
(Belle2::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1222, 0)); }; } } while(false)
;
1223 return Const::doubleNaN;
1224 }
1225 }
1226
1227 return ROOT::Math::VectorUtil::Angle(pMiss, pSum);
1228 };
1229 return func;
1230 } else {
1231 B2FATAL("Wrong number of arguments for meta function angleBetweenDaughterAndMissingMomentum")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function angleBetweenDaughterAndMissingMomentum"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1231, 0)); }; exit(1); } while(false)
;
1232 }
1233 }
1234
1235 Manager::FunctionPtr daughterAngle(const std::vector<std::string>& arguments)
1236 {
1237 if (arguments.size() == 2 || arguments.size() == 3) {
1238
1239 auto func = [arguments](const Particle * particle) -> double {
1240 if (particle == nullptr)
1241 return Const::doubleNaN;
1242
1243 std::vector<ROOT::Math::PxPyPzEVector> pDaus;
1244 const auto& frame = ReferenceFrame::GetCurrent();
1245
1246 // Parses the generalized indexes and fetches the 4-momenta of the particles of interest
1247 for (const auto& generalizedIndex : arguments)
1248 {
1249 const Particle* dauPart = particle->getParticleFromGeneralizedIndexString(generalizedIndex);
1250 if (dauPart)
1251 pDaus.push_back(frame.getMomentum(dauPart));
1252 else {
1253 B2WARNING("Trying to access a daughter that does not exist. Index = " << generalizedIndex)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "Trying to access a daughter that does not exist. Index = "
<< generalizedIndex; Belle2::LogSystem::Instance().sendMessage
(Belle2::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1253, 0)); }; } } while(false)
;
1254 return Const::doubleNaN;
1255 }
1256 }
1257
1258 // Calculates the angle between the selected particles
1259 if (pDaus.size() == 2)
1260 return ROOT::Math::VectorUtil::Angle(pDaus[0], pDaus[1]);
1261 else
1262 return ROOT::Math::VectorUtil::Angle(pDaus[2], pDaus[0] + pDaus[1]);
1263 };
1264 return func;
1265 } else {
1266 B2FATAL("Wrong number of arguments for meta function daughterAngle")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughterAngle"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1266, 0)); }; exit(1); } while(false)
;
1267 }
1268 }
1269
1270 double grandDaughterDecayAngle(const Particle* particle, const std::vector<double>& arguments)
1271 {
1272 if (arguments.size() == 2) {
1273
1274 if (!particle)
1275 return Const::doubleNaN;
1276
1277 int daughterIndex = std::lround(arguments[0]);
1278 if (daughterIndex >= int(particle->getNDaughters()))
1279 return Const::doubleNaN;
1280 const Particle* dau = particle->getDaughter(daughterIndex);
1281
1282 int grandDaughterIndex = std::lround(arguments[1]);
1283 if (grandDaughterIndex >= int(dau->getNDaughters()))
1284 return Const::doubleNaN;
1285
1286 ROOT::Math::XYZVector boost = dau->get4Vector().BoostToCM();
1287
1288 ROOT::Math::PxPyPzEVector motherMomentum = - particle->get4Vector();
1289 motherMomentum = ROOT::Math::Boost(boost) * motherMomentum;
1290
1291 ROOT::Math::PxPyPzEVector grandDaughterMomentum = dau->getDaughter(grandDaughterIndex)->get4Vector();
1292 grandDaughterMomentum = ROOT::Math::Boost(boost) * grandDaughterMomentum;
1293
1294 return ROOT::Math::VectorUtil::Angle(motherMomentum, grandDaughterMomentum);
1295
1296 } else {
1297 B2FATAL("The variable grandDaughterDecayAngle needs exactly two integers as arguments!")do { { LogVariableStream varStream; varStream << "The variable grandDaughterDecayAngle needs exactly two integers as arguments!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1297, 0)); }; exit(1); } while(false)
;
1298 }
1299 }
1300
1301 Manager::FunctionPtr mcDaughterAngle(const std::vector<std::string>& arguments)
1302 {
1303 if (arguments.size() == 2 || arguments.size() == 3) {
1304
1305 auto func = [arguments](const Particle * particle) -> double {
1306 if (particle == nullptr)
1307 return Const::doubleNaN;
1308
1309 std::vector<ROOT::Math::PxPyPzEVector> pDaus;
1310 const auto& frame = ReferenceFrame::GetCurrent();
1311
1312 // Parses the generalized indexes and fetches the 4-momenta of the particles of interest
1313 if (particle->getParticleSource() == Particle::EParticleSourceObject::c_MCParticle) // Check if MCParticle
1314 {
1315 for (const auto& generalizedIndex : arguments) {
1316 const MCParticle* mcPart = particle->getMCParticle();
1317 if (mcPart == nullptr)
1318 return Const::doubleNaN;
1319 const MCParticle* dauMcPart = mcPart->getParticleFromGeneralizedIndexString(generalizedIndex);
1320 if (dauMcPart == nullptr)
1321 return Const::doubleNaN;
1322
1323 pDaus.push_back(frame.getMomentum(dauMcPart->get4Vector()));
1324 }
1325 } else
1326 {
1327 for (const auto& generalizedIndex : arguments) {
1328 const Particle* dauPart = particle->getParticleFromGeneralizedIndexString(generalizedIndex);
1329 if (dauPart == nullptr)
1330 return Const::doubleNaN;
1331
1332 const MCParticle* dauMcPart = dauPart->getMCParticle();
1333 if (dauMcPart == nullptr)
1334 return Const::doubleNaN;
1335
1336 pDaus.push_back(frame.getMomentum(dauMcPart->get4Vector()));
1337 }
1338 }
1339
1340 // Calculates the angle between the selected particles
1341 if (pDaus.size() == 2)
1342 return ROOT::Math::VectorUtil::Angle(pDaus[0], pDaus[1]);
1343 else
1344 return ROOT::Math::VectorUtil::Angle(pDaus[2], pDaus[0] + pDaus[1]);
1345 };
1346 return func;
1347 } else {
1348 B2FATAL("Wrong number of arguments for meta function mcDaughterAngle")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function mcDaughterAngle"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1348, 0)); }; exit(1); } while(false)
;
1349 }
1350 }
1351
1352 double daughterClusterAngleInBetween(const Particle* particle, const std::vector<double>& daughterIndices)
1353 {
1354 if (daughterIndices.size() == 2) {
1355 int daughterIndexi = std::lround(daughterIndices[0]);
1356 int daughterIndexj = std::lround(daughterIndices[1]);
1357 if (std::max(daughterIndexi, daughterIndexj) >= int(particle->getNDaughters())) {
1358 return Const::doubleNaN;
1359 } else {
1360 const ECLCluster* clusteri = particle->getDaughter(daughterIndexi)->getECLCluster();
1361 const ECLCluster* clusterj = particle->getDaughter(daughterIndexj)->getECLCluster();
1362 if (clusteri and clusterj) {
1363 const auto& frame = ReferenceFrame::GetCurrent();
1364 const ECLCluster::EHypothesisBit clusteriBit = (particle->getDaughter(daughterIndexi))->getECLClusterEHypothesisBit();
1365 const ECLCluster::EHypothesisBit clusterjBit = (particle->getDaughter(daughterIndexj))->getECLClusterEHypothesisBit();
1366 ClusterUtils clusutils;
1367 ROOT::Math::PxPyPzEVector pi = frame.getMomentum(clusutils.Get4MomentumFromCluster(clusteri, clusteriBit));
1368 ROOT::Math::PxPyPzEVector pj = frame.getMomentum(clusutils.Get4MomentumFromCluster(clusterj, clusterjBit));
1369 return ROOT::Math::VectorUtil::Angle(pi, pj);
1370 }
1371 return Const::doubleNaN;
1372 }
1373 } else if (daughterIndices.size() == 3) {
1374 int daughterIndexi = std::lround(daughterIndices[0]);
1375 int daughterIndexj = std::lround(daughterIndices[1]);
1376 int daughterIndexk = std::lround(daughterIndices[2]);
1377 if (std::max(std::max(daughterIndexi, daughterIndexj), daughterIndexk) >= int(particle->getNDaughters())) {
1378 return Const::doubleNaN;
1379 } else {
1380 const ECLCluster* clusteri = (particle->getDaughter(daughterIndices[0]))->getECLCluster();
1381 const ECLCluster* clusterj = (particle->getDaughter(daughterIndices[1]))->getECLCluster();
1382 const ECLCluster* clusterk = (particle->getDaughter(daughterIndices[2]))->getECLCluster();
1383 if (clusteri and clusterj and clusterk) {
1384 const auto& frame = ReferenceFrame::GetCurrent();
1385 const ECLCluster::EHypothesisBit clusteriBit = (particle->getDaughter(daughterIndices[0]))->getECLClusterEHypothesisBit();
1386 const ECLCluster::EHypothesisBit clusterjBit = (particle->getDaughter(daughterIndices[1]))->getECLClusterEHypothesisBit();
1387 const ECLCluster::EHypothesisBit clusterkBit = (particle->getDaughter(daughterIndices[2]))->getECLClusterEHypothesisBit();
1388 ClusterUtils clusutils;
1389 ROOT::Math::PxPyPzEVector pi = frame.getMomentum(clusutils.Get4MomentumFromCluster(clusteri, clusteriBit));
1390 ROOT::Math::PxPyPzEVector pj = frame.getMomentum(clusutils.Get4MomentumFromCluster(clusterj, clusterjBit));
1391 ROOT::Math::PxPyPzEVector pk = frame.getMomentum(clusutils.Get4MomentumFromCluster(clusterk, clusterkBit));
1392 return ROOT::Math::VectorUtil::Angle(pk, pi + pj);
1393 }
1394 return Const::doubleNaN;
1395 }
1396 } else {
1397 B2FATAL("Wrong number of arguments for daughterClusterAngleInBetween!")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for daughterClusterAngleInBetween!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1397, 0)); }; exit(1); } while(false)
;
1398 }
1399 }
1400
1401 Manager::FunctionPtr daughterInvM(const std::vector<std::string>& arguments)
1402 {
1403 if (arguments.size() > 1) {
1404 auto func = [arguments](const Particle * particle) -> double {
1405 const auto& frame = ReferenceFrame::GetCurrent();
1406 ROOT::Math::PxPyPzEVector pSum;
1407
1408 for (const auto& generalizedIndex : arguments)
1409 {
1410 const Particle* dauPart = particle->getParticleFromGeneralizedIndexString(generalizedIndex);
1411 if (dauPart)
1412 pSum += frame.getMomentum(dauPart);
1413 else {
1414 return Const::doubleNaN;
1415 }
1416 }
1417 return pSum.M();
1418 };
1419 return func;
1420 } else {
1421 B2FATAL("Wrong number of arguments for meta function daughterInvM. At least two integers are needed.")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughterInvM. At least two integers are needed."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1421, 0)); }; exit(1); } while(false)
;
1422 }
1423 }
1424
1425 Manager::FunctionPtr modulo(const std::vector<std::string>& arguments)
1426 {
1427 if (arguments.size() == 2) {
1428 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1429 int divideBy = 1;
1430 try {
1431 divideBy = convertString<int>(arguments[1]);
1432 } catch (std::invalid_argument&) {
1433 B2FATAL("Second argument of modulo meta function must be integer!")do { { LogVariableStream varStream; varStream << "Second argument of modulo meta function must be integer!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1433, 0)); }; exit(1); } while(false)
;
1434 }
1435 auto func = [var, divideBy](const Particle * particle) -> int {
1436 auto var_result = var->function(particle);
1437 if (std::holds_alternative<double>(var_result))
1438 {
1439 return int(std::get<double>(var_result)) % divideBy;
1440 } else if (std::holds_alternative<int>(var_result))
1441 {
1442 return std::get<int>(var_result) % divideBy;
1443 } else if (std::holds_alternative<bool>(var_result))
1444 {
1445 return int(std::get<bool>(var_result)) % divideBy;
1446 } else return 0;
1447 };
1448 return func;
1449 } else {
1450 B2FATAL("Wrong number of arguments for meta function modulo")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function modulo"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1450, 0)); }; exit(1); } while(false)
;
1451 }
1452 }
1453
1454 Manager::FunctionPtr isNAN(const std::vector<std::string>& arguments)
1455 {
1456 if (arguments.size() == 1) {
1457 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1458
1459 auto func = [var](const Particle * particle) -> bool { return std::isnan(std::get<double>(var->function(particle))); };
1460 return func;
1461 } else {
1462 B2FATAL("Wrong number of arguments for meta function isNAN")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function isNAN"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1462, 0)); }; exit(1); } while(false)
;
1463 }
1464 }
1465
1466 Manager::FunctionPtr ifNANgiveX(const std::vector<std::string>& arguments)
1467 {
1468 if (arguments.size() == 2) {
1469 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1470 double defaultOutput;
1471 try {
1472 defaultOutput = convertString<double>(arguments[1]);
1473 } catch (std::invalid_argument&) {
1474 B2FATAL("The second argument of ifNANgiveX meta function must be a number!")do { { LogVariableStream varStream; varStream << "The second argument of ifNANgiveX meta function must be a number!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1474, 0)); }; exit(1); } while(false)
;
1475 }
1476 auto func = [var, defaultOutput](const Particle * particle) -> double {
1477 double output = std::get<double>(var->function(particle));
1478 if (std::isnan(output)) return defaultOutput;
1479 else return output;
1480 };
1481 return func;
1482 } else {
1483 B2FATAL("Wrong number of arguments for meta function ifNANgiveX")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function ifNANgiveX"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1483, 0)); }; exit(1); } while(false)
;
1484 }
1485 }
1486
1487 Manager::FunctionPtr isInfinity(const std::vector<std::string>& arguments)
1488 {
1489 if (arguments.size() == 1) {
1490 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1491
1492 auto func = [var](const Particle * particle) -> bool { return std::isinf(std::get<double>(var->function(particle))); };
1493 return func;
1494 } else {
1495 B2FATAL("Wrong number of arguments for meta function isInfinity")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function isInfinity"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1495, 0)); }; exit(1); } while(false)
;
1496 }
1497 }
1498
1499 Manager::FunctionPtr unmask(const std::vector<std::string>& arguments)
1500 {
1501 if (arguments.size() >= 2) {
1502 // get the function pointer of variable to be unmasked
1503 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1504
1505 // get the final mask which summarize all the input masks
1506 int finalMask = 0;
1507 for (size_t i = 1; i < arguments.size(); ++i) {
1508 try {
1509 finalMask |= convertString<int>(arguments[i]);
1510 } catch (std::invalid_argument&) {
1511 B2FATAL("The input flags to meta function unmask() should be integer!")do { { LogVariableStream varStream; varStream << "The input flags to meta function unmask() should be integer!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1511, 0)); }; exit(1); } while(false)
;
1512 return nullptr;
1513 }
1514 }
1515
1516 // unmask the variable
1517 auto func = [var, finalMask](const Particle * particle) -> double {
1518 int value = 0;
1519 auto var_result = var->function(particle);
1520 if (std::holds_alternative<double>(var_result))
1521 {
1522 // judge if the value is nan before unmasking
1523 if (std::isnan(std::get<double>(var_result))) {
1524 return Const::doubleNaN;
1525 }
1526 value = int(std::get<double>(var_result));
1527 } else if (std::holds_alternative<int>(var_result))
1528 {
1529 value = std::get<int>(var_result);
1530 }
1531
1532 // apply the final mask
1533 value &= (~finalMask);
1534
1535 return value;
1536 };
1537 return func;
1538
1539 } else {
1540 B2FATAL("Meta function unmask needs at least two arguments!")do { { LogVariableStream varStream; varStream << "Meta function unmask needs at least two arguments!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1540, 0)); }; exit(1); } while(false)
;
1541 }
1542 }
1543
1544 Manager::FunctionPtr conditionalVariableSelector(const std::vector<std::string>& arguments)
1545 {
1546 if (arguments.size() == 3) {
1547
1548 std::string cutString = arguments[0];
1549 std::shared_ptr<Variable::Cut> cut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(cutString));
1550
1551 const Variable::Manager::Var* variableIfTrue = Manager::Instance().getVariable(arguments[1]);
1552 const Variable::Manager::Var* variableIfFalse = Manager::Instance().getVariable(arguments[2]);
1553
1554 auto func = [cut, variableIfTrue, variableIfFalse](const Particle * particle) -> double {
1555 if (particle == nullptr)
1556 return Const::doubleNaN;
1557 if (cut->check(particle))
1558 {
1559 auto var_result = variableIfTrue->function(particle);
1560 if (std::holds_alternative<double>(var_result)) {
1561 return std::get<double>(var_result);
1562 } else if (std::holds_alternative<int>(var_result)) {
1563 return std::get<int>(var_result);
1564 } else if (std::holds_alternative<bool>(var_result)) {
1565 return std::get<bool>(var_result);
1566 } else return Const::doubleNaN;
1567 } else
1568 {
1569 auto var_result = variableIfFalse->function(particle);
1570 if (std::holds_alternative<double>(var_result)) {
1571 return std::get<double>(var_result);
1572 } else if (std::holds_alternative<int>(var_result)) {
1573 return std::get<int>(var_result);
1574 } else if (std::holds_alternative<bool>(var_result)) {
1575 return std::get<bool>(var_result);
1576 } else return Const::doubleNaN;
1577 }
1578 };
1579 return func;
1580
1581 } else {
1582 B2FATAL("Wrong number of arguments for meta function conditionalVariableSelector")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function conditionalVariableSelector"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1582, 0)); }; exit(1); } while(false)
;
1583 }
1584 }
1585
1586 Manager::FunctionPtr pValueCombination(const std::vector<std::string>& arguments)
1587 {
1588 if (arguments.size() > 0) {
1589 std::vector<const Variable::Manager::Var*> variables;
1590 for (const auto& argument : arguments)
1591 variables.push_back(Manager::Instance().getVariable(argument));
1592
1593 auto func = [variables, arguments](const Particle * particle) -> double {
1594 double pValueProduct = 1.;
1595 for (auto variable : variables)
1596 {
1597 double pValue = std::get<double>(variable->function(particle));
1598 if (pValue < 0)
1599 return -1;
1600 else
1601 pValueProduct *= pValue;
1602 }
1603 double pValueSum = 1.;
1604 double factorial = 1.;
1605 for (unsigned int i = 1; i < arguments.size(); ++i)
1606 {
1607 factorial *= i;
1608 pValueSum += pow(-std::log(pValueProduct), i) / factorial;
1609 }
1610 return pValueProduct * pValueSum;
1611 };
1612 return func;
1613 } else {
1614 B2FATAL("Wrong number of arguments for meta function pValueCombination")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function pValueCombination"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1614, 0)); }; exit(1); } while(false)
;
1615 }
1616 }
1617
1618 Manager::FunctionPtr pValueCombinationOfDaughters(const std::vector<std::string>& arguments)
1619 {
1620 if (arguments.size() == 1) {
1621 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1622 auto func = [var](const Particle * particle) -> double {
1623 double pValueProduct = 1.;
1624 if (particle->getNDaughters() == 0)
1625 {
1626 return Const::doubleNaN;
1627 }
1628
1629 for (unsigned j = 0; j < particle->getNDaughters(); ++j)
1630 {
1631 double pValue = std::get<double>(var->function(particle->getDaughter(j)));
1632 if (pValue < 0) return -1;
1633 else pValueProduct *= pValue;
1634 }
1635
1636 double pValueSum = 1.;
1637 double factorial = 1.;
1638 for (unsigned int i = 1; i < particle->getNDaughters(); ++i)
1639 {
1640 factorial *= i;
1641 pValueSum += pow(-std::log(pValueProduct), i) / factorial;
1642 }
1643 return pValueProduct * pValueSum;
1644 };
1645 return func;
1646 } else {
1647 B2FATAL("Wrong number of arguments for meta function pValueCombinationOfDaughters")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function pValueCombinationOfDaughters"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1647, 0)); }; exit(1); } while(false)
;
1648 }
1649 }
1650
1651 Manager::FunctionPtr abs(const std::vector<std::string>& arguments)
1652 {
1653 if (arguments.size() == 1) {
1654 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1655 auto func = [var](const Particle * particle) -> double {
1656 auto var_result = var->function(particle);
1657 if (std::holds_alternative<double>(var_result))
1658 {
1659 return std::abs(std::get<double>(var_result));
1660 } else if (std::holds_alternative<int>(var_result))
1661 {
1662 return std::abs(std::get<int>(var_result));
1663 } else return Const::doubleNaN;
1664 };
1665 return func;
1666 } else {
1667 B2FATAL("Wrong number of arguments for meta function abs")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function abs"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1667, 0)); }; exit(1); } while(false)
;
1668 }
1669 }
1670
1671 Manager::FunctionPtr max(const std::vector<std::string>& arguments)
1672 {
1673 if (arguments.size() == 2) {
1674 const Variable::Manager::Var* var1 = Manager::Instance().getVariable(arguments[0]);
1675 const Variable::Manager::Var* var2 = Manager::Instance().getVariable(arguments[1]);
1676
1677 if (!var1 or !var2)
1678 B2FATAL("One or both of the used variables doesn't exist!")do { { LogVariableStream varStream; varStream << "One or both of the used variables doesn't exist!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1678, 0)); }; exit(1); } while(false)
;
1679
1680 auto func = [var1, var2](const Particle * particle) -> double {
1681 double val1 = 0.0, val2 = 0.0;
1682 auto var_result1 = var1->function(particle);
1683 auto var_result2 = var2->function(particle);
1684 if (std::holds_alternative<double>(var_result1))
1685 {
1686 val1 = std::get<double>(var_result1);
1687 } else if (std::holds_alternative<int>(var_result1))
1688 {
1689 val1 = std::get<int>(var_result1);
1690 } else if (std::holds_alternative<bool>(var_result1))
1691 {
1692 val1 = std::get<bool>(var_result1);
1693 } else
1694 {
1695 B2FATAL("A variable in meta function max holds no double, int or bool values")do { { LogVariableStream varStream; varStream << "A variable in meta function max holds no double, int or bool values"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1695, 0)); }; exit(1); } while(false)
;
1696 }
1697 if (std::holds_alternative<double>(var_result2))
1698 {
1699 val2 = std::get<double>(var_result2);
1700 } else if (std::holds_alternative<int>(var_result2))
1701 {
1702 val2 = std::get<int>(var_result2);
1703 } else if (std::holds_alternative<bool>(var_result2))
1704 {
1705 val2 = std::get<bool>(var_result2);
1706 } else
1707 {
1708 B2FATAL("A variable in meta function max holds no double, int or bool values")do { { LogVariableStream varStream; varStream << "A variable in meta function max holds no double, int or bool values"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1708, 0)); }; exit(1); } while(false)
;
1709 }
1710 return std::max(val1, val2);
1711 };
1712 return func;
1713 } else {
1714 B2FATAL("Wrong number of arguments for meta function max")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function max"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1714, 0)); }; exit(1); } while(false)
;
1715 }
1716 }
1717
1718 Manager::FunctionPtr min(const std::vector<std::string>& arguments)
1719 {
1720 if (arguments.size() == 2) {
1721 const Variable::Manager::Var* var1 = Manager::Instance().getVariable(arguments[0]);
1722 const Variable::Manager::Var* var2 = Manager::Instance().getVariable(arguments[1]);
1723
1724 if (!var1 or !var2)
1725 B2FATAL("One or both of the used variables doesn't exist!")do { { LogVariableStream varStream; varStream << "One or both of the used variables doesn't exist!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1725, 0)); }; exit(1); } while(false)
;
1726
1727 auto func = [var1, var2](const Particle * particle) -> double {
1728 double val1 = 0.0, val2 = 0.0;
1729 auto var_result1 = var1->function(particle);
1730 auto var_result2 = var2->function(particle);
1731 if (std::holds_alternative<double>(var_result1))
1732 {
1733 val1 = std::get<double>(var_result1);
1734 } else if (std::holds_alternative<int>(var_result1))
1735 {
1736 val1 = std::get<int>(var_result1);
1737 } else if (std::holds_alternative<bool>(var_result1))
1738 {
1739 val1 = std::get<bool>(var_result1);
1740 } else
1741 {
1742 B2FATAL("A variable in meta function min holds no double, int or bool values")do { { LogVariableStream varStream; varStream << "A variable in meta function min holds no double, int or bool values"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1742, 0)); }; exit(1); } while(false)
;
1743 }
1744 if (std::holds_alternative<double>(var_result2))
1745 {
1746 val2 = std::get<double>(var_result2);
1747 } else if (std::holds_alternative<int>(var_result2))
1748 {
1749 val2 = std::get<int>(var_result2);
1750 } else if (std::holds_alternative<bool>(var_result2))
1751 {
1752 val2 = std::get<bool>(var_result2);
1753 } else
1754 {
1755 B2FATAL("A variable in meta function min holds no double, int or bool values")do { { LogVariableStream varStream; varStream << "A variable in meta function min holds no double, int or bool values"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1755, 0)); }; exit(1); } while(false)
;
1756 }
1757 return std::min(val1, val2);
1758 };
1759 return func;
1760 } else {
1761 B2FATAL("Wrong number of arguments for meta function min")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function min"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1761, 0)); }; exit(1); } while(false)
;
1762 }
1763 }
1764
1765 Manager::FunctionPtr sin(const std::vector<std::string>& arguments)
1766 {
1767 if (arguments.size() == 1) {
1768 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1769 auto func = [var](const Particle * particle) -> double {
1770 auto var_result = var->function(particle);
1771 if (std::holds_alternative<double>(var_result))
1772 return std::sin(std::get<double>(var_result));
1773 else if (std::holds_alternative<int>(var_result))
1774 return std::sin(std::get<int>(var_result));
1775 else return Const::doubleNaN;
1776 };
1777 return func;
1778 } else {
1779 B2FATAL("Wrong number of arguments for meta function sin")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function sin"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1779, 0)); }; exit(1); } while(false)
;
1780 }
1781 }
1782
1783 Manager::FunctionPtr asin(const std::vector<std::string>& arguments)
1784 {
1785 if (arguments.size() == 1) {
1786 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1787 auto func = [var](const Particle * particle) -> double {
1788 auto var_result = var->function(particle);
1789 if (std::holds_alternative<double>(var_result))
1790 return std::asin(std::get<double>(var_result));
1791 else if (std::holds_alternative<int>(var_result))
1792 return std::asin(std::get<int>(var_result));
1793 else return Const::doubleNaN;
1794 };
1795 return func;
1796 } else {
1797 B2FATAL("Wrong number of arguments for meta function asin")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function asin"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1797, 0)); }; exit(1); } while(false)
;
1798 }
1799 }
1800
1801 Manager::FunctionPtr cos(const std::vector<std::string>& arguments)
1802 {
1803 if (arguments.size() == 1) {
1804 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1805 auto func = [var](const Particle * particle) -> double {
1806 auto var_result = var->function(particle);
1807 if (std::holds_alternative<double>(var_result))
1808 return std::cos(std::get<double>(var_result));
1809 else if (std::holds_alternative<int>(var_result))
1810 return std::cos(std::get<int>(var_result));
1811 else return Const::doubleNaN;
1812 };
1813 return func;
1814 } else {
1815 B2FATAL("Wrong number of arguments for meta function cos")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function cos"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1815, 0)); }; exit(1); } while(false)
;
1816 }
1817 }
1818
1819 Manager::FunctionPtr acos(const std::vector<std::string>& arguments)
1820 {
1821 if (arguments.size() == 1) {
1822 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1823 auto func = [var](const Particle * particle) -> double {
1824 auto var_result = var->function(particle);
1825 if (std::holds_alternative<double>(var_result))
1826 return std::acos(std::get<double>(var_result));
1827 else if (std::holds_alternative<int>(var_result))
1828 return std::acos(std::get<int>(var_result));
1829 else return Const::doubleNaN;
1830 };
1831 return func;
1832 } else {
1833 B2FATAL("Wrong number of arguments for meta function acos")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function acos"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1833, 0)); }; exit(1); } while(false)
;
1834 }
1835 }
1836
1837 Manager::FunctionPtr tan(const std::vector<std::string>& arguments)
1838 {
1839 if (arguments.size() == 1) {
1840 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1841 auto func = [var](const Particle * particle) -> double { return std::tan(std::get<double>(var->function(particle))); };
1842 return func;
1843 } else {
1844 B2FATAL("Wrong number of arguments for meta function tan")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function tan"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1844, 0)); }; exit(1); } while(false)
;
1845 }
1846 }
1847
1848 Manager::FunctionPtr atan(const std::vector<std::string>& arguments)
1849 {
1850 if (arguments.size() == 1) {
1851 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1852 auto func = [var](const Particle * particle) -> double { return std::atan(std::get<double>(var->function(particle))); };
1853 return func;
1854 } else {
1855 B2FATAL("Wrong number of arguments for meta function atan")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function atan"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1855, 0)); }; exit(1); } while(false)
;
1856 }
1857 }
1858
1859 Manager::FunctionPtr atan2(const std::vector<std::string>& arguments)
1860 {
1861 if (arguments.size() == 2) {
1862 const Variable::Manager::Var* varY = Manager::Instance().getVariable(arguments[0]);
1863 const Variable::Manager::Var* varX = Manager::Instance().getVariable(arguments[1]);
1864 auto func = [varY, varX](const Particle * particle) -> double {
1865 double y = std::get<double>(varY->function(particle));
1866 double x = std::get<double>(varX->function(particle));
1867 return std::atan2(y, x);
1868 };
1869 return func;
1870 } else {
1871 B2FATAL("Wrong number of arguments for meta function atan2")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function atan2"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1871, 0)); }; exit(1); } while(false)
;
1872 }
1873 }
1874
1875 Manager::FunctionPtr exp(const std::vector<std::string>& arguments)
1876 {
1877 if (arguments.size() == 1) {
1878 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1879 auto func = [var](const Particle * particle) -> double {
1880 auto var_result = var->function(particle);
1881 if (std::holds_alternative<double>(var_result))
1882 return std::exp(std::get<double>(var_result));
1883 else if (std::holds_alternative<int>(var_result))
1884 return std::exp(std::get<int>(var_result));
1885 else return Const::doubleNaN;
1886 };
1887 return func;
1888 } else {
1889 B2FATAL("Wrong number of arguments for meta function exp")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function exp"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1889, 0)); }; exit(1); } while(false)
;
1890 }
1891 }
1892
1893 Manager::FunctionPtr log(const std::vector<std::string>& arguments)
1894 {
1895 if (arguments.size() == 1) {
1896 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1897 auto func = [var](const Particle * particle) -> double {
1898 auto var_result = var->function(particle);
1899 if (std::holds_alternative<double>(var_result))
1900 return std::log(std::get<double>(var_result));
1901 else if (std::holds_alternative<int>(var_result))
1902 return std::log(std::get<int>(var_result));
1903 else return Const::doubleNaN;
1904 };
1905 return func;
1906 } else {
1907 B2FATAL("Wrong number of arguments for meta function log")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function log"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1907, 0)); }; exit(1); } while(false)
;
1908 }
1909 }
1910
1911 Manager::FunctionPtr log10(const std::vector<std::string>& arguments)
1912 {
1913 if (arguments.size() == 1) {
1914 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1915 auto func = [var](const Particle * particle) -> double {
1916 auto var_result = var->function(particle);
1917 if (std::holds_alternative<double>(var_result))
1918 return std::log10(std::get<double>(var_result));
1919 else if (std::holds_alternative<int>(var_result))
1920 return std::log10(std::get<int>(var_result));
1921 else return Const::doubleNaN;
1922 };
1923 return func;
1924 } else {
1925 B2FATAL("Wrong number of arguments for meta function log10")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function log10"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1925, 0)); }; exit(1); } while(false)
;
1926 }
1927 }
1928
1929 Manager::FunctionPtr originalParticle(const std::vector<std::string>& arguments)
1930 {
1931 if (arguments.size() == 1) {
1932 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
1933 auto func = [var](const Particle * particle) -> double {
1934 if (particle == nullptr)
1935 return Const::doubleNaN;
1936
1937 StoreArray<Particle> particles;
1938 if (!particle->hasExtraInfo("original_index"))
1939 return Const::doubleNaN;
1940
1941 auto originalParticle = particles[particle->getExtraInfo("original_index")];
1942 if (!originalParticle)
1943 return Const::doubleNaN;
1944 auto var_result = var->function(originalParticle);
1945 if (std::holds_alternative<double>(var_result))
1946 {
1947 return std::get<double>(var_result);
1948 } else if (std::holds_alternative<int>(var_result))
1949 {
1950 return std::get<int>(var_result);
1951 } else if (std::holds_alternative<bool>(var_result))
1952 {
1953 return std::get<bool>(var_result);
1954 } else return Const::doubleNaN;
1955 };
1956 return func;
1957 } else {
1958 B2FATAL("Wrong number of arguments for meta function originalParticle")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function originalParticle"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1958, 0)); }; exit(1); } while(false)
;
1959 }
1960 }
1961
1962 Manager::FunctionPtr daughter(const std::vector<std::string>& arguments)
1963 {
1964 if (arguments.size() == 2) {
1965 auto daughterFunction = convertToDaughterIndex({arguments[0]});
1966 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
1967 auto func = [var, daughterFunction](const Particle * particle) -> double {
1968 if (particle == nullptr)
1969 return Const::doubleNaN;
1970 int daughterNumber = std::get<int>(daughterFunction(particle));
1971 if (daughterNumber >= int(particle->getNDaughters()) or daughterNumber < 0)
1972 return Const::doubleNaN;
1973 auto var_result = var->function(particle->getDaughter(daughterNumber));
1974 if (std::holds_alternative<double>(var_result))
1975 {
1976 return std::get<double>(var_result);
1977 } else if (std::holds_alternative<int>(var_result))
1978 {
1979 return std::get<int>(var_result);
1980 } else if (std::holds_alternative<bool>(var_result))
1981 {
1982 return std::get<bool>(var_result);
1983 } else return Const::doubleNaN;
1984 };
1985 return func;
1986 } else {
1987 B2FATAL("Wrong number of arguments for meta function daughter")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughter"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 1987, 0)); }; exit(1); } while(false)
;
1988 }
1989 }
1990
1991 Manager::FunctionPtr originalDaughter(const std::vector<std::string>& arguments)
1992 {
1993 if (arguments.size() == 2) {
1
Assuming the condition is true
2
Taking true branch
1994 auto daughterFunction = convertToDaughterIndex({arguments[0]});
1995 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
1996 auto func = [var, daughterFunction](const Particle * particle) -> double {
3
Calling copy constructor for 'function<std::variant<double, int, bool> (const Belle2::Particle *)>'
17
Returning from copy constructor for 'function<std::variant<double, int, bool> (const Belle2::Particle *)>'
18
Potential memory leak
1997 if (particle == nullptr)
1998 return Const::doubleNaN;
1999 int daughterNumber = std::get<int>(daughterFunction(particle));
2000 if (daughterNumber >= int(particle->getNDaughters()) or daughterNumber < 0)
2001 return Const::doubleNaN;
2002 else
2003 {
2004 StoreArray<Particle> particles;
2005 if (!particle->getDaughter(daughterNumber)->hasExtraInfo("original_index"))
2006 return Const::doubleNaN;
2007 auto originalDaughter = particles[particle->getDaughter(daughterNumber)->getExtraInfo("original_index")];
2008 if (!originalDaughter)
2009 return Const::doubleNaN;
2010
2011 auto var_result = var->function(originalDaughter);
2012 if (std::holds_alternative<double>(var_result)) {
2013 return std::get<double>(var_result);
2014 } else if (std::holds_alternative<int>(var_result)) {
2015 return std::get<int>(var_result);
2016 } else if (std::holds_alternative<bool>(var_result)) {
2017 return std::get<bool>(var_result);
2018 } else return Const::doubleNaN;
2019 }
2020 };
2021 return func;
2022 } else {
2023 B2FATAL("Wrong number of arguments for meta function daughter")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughter"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2023, 0)); }; exit(1); } while(false)
;
2024 }
2025 }
2026
2027 Manager::FunctionPtr convertToDaughterIndex(const std::vector<std::string>& arguments)
2028 {
2029 if (arguments.size() == 1) {
2030 std::string daughterString = arguments[0];
2031 auto func = [daughterString](const Particle * particle) -> int {
2032 if (particle == nullptr)
2033 return -1;
2034 int daughterNumber = 0;
2035 try
2036 {
2037 daughterNumber = convertString<int>(daughterString);
2038 } catch (std::invalid_argument&)
2039 {
2040 auto daughterFunction = convertToInt({daughterString, "-1"});
2041 auto daughterVarResult = daughterFunction(particle);
2042 daughterNumber = std::get<int>(daughterVarResult);
2043 }
2044 return daughterNumber;
2045 };
2046 return func;
2047 } else {
2048 B2FATAL("Wrong number of arguments for meta function convertToDaughterIndex")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function convertToDaughterIndex"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2048, 0)); }; exit(1); } while(false)
;
2049 }
2050 }
2051
2052 Manager::FunctionPtr mcDaughter(const std::vector<std::string>& arguments)
2053 {
2054 if (arguments.size() == 2) {
2055 auto daughterFunction = convertToDaughterIndex({arguments[0]});
2056 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
2057 auto func = [var, daughterFunction](const Particle * particle) -> double {
2058 if (particle == nullptr)
2059 return Const::doubleNaN;
2060 if (particle->getMCParticle()) // has MC match or is MCParticle
2061 {
2062 int daughterNumber = std::get<int>(daughterFunction(particle));
2063 if (daughterNumber >= int(particle->getMCParticle()->getNDaughters()) or daughterNumber < 0)
2064 return Const::doubleNaN;
2065 Particle tempParticle = Particle(particle->getMCParticle()->getDaughters().at(daughterNumber));
2066 auto var_result = var->function(&tempParticle);
2067 if (std::holds_alternative<double>(var_result)) {
2068 return std::get<double>(var_result);
2069 } else if (std::holds_alternative<int>(var_result)) {
2070 return std::get<int>(var_result);
2071 } else if (std::holds_alternative<bool>(var_result)) {
2072 return std::get<bool>(var_result);
2073 } else {
2074 return Const::doubleNaN;
2075 }
2076 } else
2077 {
2078 return Const::doubleNaN;
2079 }
2080 };
2081 return func;
2082 } else {
2083 B2FATAL("Wrong number of arguments for meta function mcDaughter")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function mcDaughter"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2083, 0)); }; exit(1); } while(false)
;
2084 }
2085 }
2086
2087 Manager::FunctionPtr mcMother(const std::vector<std::string>& arguments)
2088 {
2089 if (arguments.size() == 1) {
2090 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
2091 auto func = [var](const Particle * particle) -> double {
2092 if (particle == nullptr)
2093 return Const::doubleNaN;
2094 if (particle->getMCParticle()) // has MC match or is MCParticle
2095 {
2096 if (particle->getMCParticle()->getMother() == nullptr) {
2097 return Const::doubleNaN;
2098 }
2099 Particle tempParticle = Particle(particle->getMCParticle()->getMother());
2100 auto var_result = var->function(&tempParticle);
2101 if (std::holds_alternative<double>(var_result)) {
2102 return std::get<double>(var_result);
2103 } else if (std::holds_alternative<int>(var_result)) {
2104 return std::get<int>(var_result);
2105 } else if (std::holds_alternative<bool>(var_result)) {
2106 return std::get<bool>(var_result);
2107 } else return Const::doubleNaN;
2108 } else
2109 {
2110 return Const::doubleNaN;
2111 }
2112 };
2113 return func;
2114 } else {
2115 B2FATAL("Wrong number of arguments for meta function mcMother")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function mcMother"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2115, 0)); }; exit(1); } while(false)
;
2116 }
2117 }
2118
2119 Manager::FunctionPtr genParticle(const std::vector<std::string>& arguments)
2120 {
2121 if (arguments.size() == 2) {
2122 std::string indexString = arguments[0];
2123 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
2124
2125 auto func = [var, indexString](const Particle * particle) -> double {
2126 // First get the partcile index. If not int, evaluate the variable
2127 int particleNumber = 0;
2128 try
2129 {
2130 particleNumber = convertString<int>(indexString);
2131 } catch (std::invalid_argument&)
2132 {
2133 auto indexFunction = convertToInt({indexString, "-1"});
2134 auto indexVarResult = indexFunction(particle);
2135 particleNumber = std::get<int>(indexVarResult);
2136 }
2137
2138 StoreArray<MCParticle> mcParticles("MCParticles");
2139 if (particleNumber >= mcParticles.getEntries())
2140 {
2141 return Const::doubleNaN;
2142 }
2143
2144 const MCParticle* mcParticle = mcParticles[particleNumber];
2145 Particle part = Particle(mcParticle);
2146 auto var_result = var->function(&part);
2147 if (std::holds_alternative<double>(var_result))
2148 {
2149 return std::get<double>(var_result);
2150 } else if (std::holds_alternative<int>(var_result))
2151 {
2152 return std::get<int>(var_result);
2153 } else if (std::holds_alternative<bool>(var_result))
2154 {
2155 return std::get<bool>(var_result);
2156 } else return Const::doubleNaN;
2157 };
2158 return func;
2159 } else {
2160 B2FATAL("Wrong number of arguments for meta function genParticle")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function genParticle"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2160, 0)); }; exit(1); } while(false)
;
2161 }
2162 }
2163
2164 Manager::FunctionPtr genUpsilon4S(const std::vector<std::string>& arguments)
2165 {
2166 if (arguments.size() == 1) {
2167 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
2168
2169 auto func = [var](const Particle*) -> double {
2170 StoreArray<MCParticle> mcParticles("MCParticles");
2171 if (mcParticles.getEntries() == 0)
2172 {
2173 return Const::doubleNaN;
2174 }
2175
2176 const MCParticle* mcUpsilon4S = mcParticles[0];
2177 if (mcUpsilon4S->isInitial()) mcUpsilon4S = mcParticles[2];
2178 if (mcUpsilon4S->getPDG() != 300553)
2179 {
2180 return Const::doubleNaN;
2181 }
2182
2183 Particle upsilon4S = Particle(mcUpsilon4S);
2184 auto var_result = var->function(&upsilon4S);
2185 if (std::holds_alternative<double>(var_result))
2186 {
2187 return std::get<double>(var_result);
2188 } else if (std::holds_alternative<int>(var_result))
2189 {
2190 return std::get<int>(var_result);
2191 } else if (std::holds_alternative<bool>(var_result))
2192 {
2193 return std::get<bool>(var_result);
2194 } else return Const::doubleNaN;
2195 };
2196 return func;
2197 } else {
2198 B2FATAL("Wrong number of arguments for meta function genUpsilon4S")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function genUpsilon4S"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2198, 0)); }; exit(1); } while(false)
;
2199 }
2200 }
2201
2202 Manager::FunctionPtr getVariableByRank(const std::vector<std::string>& arguments)
2203 {
2204 if (arguments.size() == 4) {
2205 std::string listName = arguments[0];
2206 std::string rankedVariableName = arguments[1];
2207 std::string returnVariableName = arguments[2];
2208 std::string extraInfoName = rankedVariableName + "_rank";
2209 int rank = 1;
2210 try {
2211 rank = convertString<int>(arguments[3]);
2212 } catch (std::invalid_argument&) {
2213 B2ERROR("3rd argument of getVariableByRank meta function (Rank) must be an integer!")do { { LogVariableStream varStream; varStream << "3rd argument of getVariableByRank meta function (Rank) must be an integer!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Error, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2213, 0)); } } while(false)
;
2214 return nullptr;
2215 }
2216
2217 const Variable::Manager::Var* var = Manager::Instance().getVariable(returnVariableName);
2218 auto func = [var, rank, extraInfoName, listName](const Particle*)-> double {
2219 StoreObjPtr<ParticleList> list(listName);
2220
2221 const unsigned int numParticles = list->getListSize();
2222 for (unsigned int i = 0; i < numParticles; i++)
2223 {
2224 const Particle* p = list->getParticle(i);
2225 if (p->getExtraInfo(extraInfoName) == rank) {
2226 auto var_result = var->function(p);
2227 if (std::holds_alternative<double>(var_result)) {
2228 return std::get<double>(var_result);
2229 } else if (std::holds_alternative<int>(var_result)) {
2230 return std::get<int>(var_result);
2231 } else if (std::holds_alternative<bool>(var_result)) {
2232 return std::get<bool>(var_result);
2233 } else return Const::doubleNaN;
2234 }
2235 }
2236 // return 0;
2237 return std::numeric_limits<double>::signaling_NaN();
2238 };
2239 return func;
2240 } else {
2241 B2FATAL("Wrong number of arguments for meta function getVariableByRank")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function getVariableByRank"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2241, 0)); }; exit(1); } while(false)
;
2242 }
2243 }
2244
2245 Manager::FunctionPtr countInList(const std::vector<std::string>& arguments)
2246 {
2247 if (arguments.size() == 1 or arguments.size() == 2) {
2248
2249 std::string listName = arguments[0];
2250 std::string cutString = "";
2251
2252 if (arguments.size() == 2) {
2253 cutString = arguments[1];
2254 }
2255
2256 std::shared_ptr<Variable::Cut> cut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(cutString));
2257
2258 auto func = [listName, cut](const Particle*) -> int {
2259
2260 StoreObjPtr<ParticleList> list(listName);
2261 int sum = 0;
2262 for (unsigned int i = 0; i < list->getListSize(); i++)
2263 {
2264 const Particle* particle = list->getParticle(i);
2265 if (cut->check(particle)) {
2266 sum++;
2267 }
2268 }
2269 return sum;
2270 };
2271 return func;
2272 } else {
2273 B2FATAL("Wrong number of arguments for meta function countInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function countInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2273, 0)); }; exit(1); } while(false)
;
2274 }
2275 }
2276
2277 Manager::FunctionPtr veto(const std::vector<std::string>& arguments)
2278 {
2279 if (arguments.size() == 2 or arguments.size() == 3) {
2280
2281 std::string roeListName = arguments[0];
2282 std::string cutString = arguments[1];
2283 int pdgCode = Const::electron.getPDGCode();
2284 if (arguments.size() == 2) {
2285 B2INFO("Use pdgCode of electron as default in meta variable veto, other arguments: " << roeListName << ", " << cutString)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Info, 0, "analysis")) { { LogVariableStream varStream
; varStream << "Use pdgCode of electron as default in meta variable veto, other arguments: "
<< roeListName << ", " << cutString; Belle2
::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2
::LogConfig::c_Info, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 2285, 0)); }; } }
while(false)
;
2286 } else {
2287 try {
2288 pdgCode = convertString<int>(arguments[2]);;
2289 } catch (std::invalid_argument&) {
2290 B2FATAL("Third argument of veto meta function must be integer!")do { { LogVariableStream varStream; varStream << "Third argument of veto meta function must be integer!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2290, 0)); }; exit(1); } while(false)
;
2291 }
2292 }
2293
2294 auto flavourType = (EvtPDLUtil::hasAntiParticle(pdgCode)) ? Particle::c_Flavored : Particle::c_Unflavored;
2295 std::shared_ptr<Variable::Cut> cut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(cutString));
2296
2297 auto func = [roeListName, cut, pdgCode, flavourType](const Particle * particle) -> bool {
2298 StoreObjPtr<ParticleList> roeList(roeListName);
2299 ROOT::Math::PxPyPzEVector vec = particle->get4Vector();
2300 for (unsigned int i = 0; i < roeList->getListSize(); i++)
2301 {
2302 const Particle* roeParticle = roeList->getParticle(i);
2303 if (not particle->overlapsWith(roeParticle)) {
2304 ROOT::Math::PxPyPzEVector tempCombination = roeParticle->get4Vector() + vec;
2305 std::vector<int> indices = { particle->getArrayIndex(), roeParticle->getArrayIndex() };
2306 Particle tempParticle = Particle(tempCombination, pdgCode, flavourType, indices, particle->getArrayPointer());
2307 if (cut->check(&tempParticle)) {
2308 return 1;
2309 }
2310 }
2311 }
2312 return 0;
2313 };
2314 return func;
2315 } else {
2316 B2FATAL("Wrong number of arguments for meta function veto")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function veto"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2316, 0)); }; exit(1); } while(false)
;
2317 }
2318 }
2319
2320 Manager::FunctionPtr countDaughters(const std::vector<std::string>& arguments)
2321 {
2322 if (arguments.size() == 1) {
2323 std::string cutString = arguments[0];
2324 std::shared_ptr<Variable::Cut> cut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(cutString));
2325 auto func = [cut](const Particle * particle) -> int {
2326 int n = 0;
2327 for (auto& daughter : particle->getDaughters())
2328 {
2329 if (cut->check(daughter))
2330 ++n;
2331 }
2332 return n;
2333 };
2334 return func;
2335 } else {
2336 B2FATAL("Wrong number of arguments for meta function countDaughters")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function countDaughters"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2336, 0)); }; exit(1); } while(false)
;
2337 }
2338 }
2339
2340 Manager::FunctionPtr countFSPDaughters(const std::vector<std::string>& arguments)
2341 {
2342 if (arguments.size() == 1) {
2343 std::string cutString = arguments[0];
2344 std::shared_ptr<Variable::Cut> cut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(cutString));
2345 auto func = [cut](const Particle * particle) -> int {
2346
2347 std::vector<const Particle*> fspDaughters;
2348 particle->fillFSPDaughters(fspDaughters);
2349
2350 int n = 0;
2351 for (auto& daughter : fspDaughters)
2352 {
2353 if (cut->check(daughter))
2354 ++n;
2355 }
2356 return n;
2357 };
2358 return func;
2359 } else {
2360 B2FATAL("Wrong number of arguments for meta function countFSPDaughters")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function countFSPDaughters"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2360, 0)); }; exit(1); } while(false)
;
2361 }
2362 }
2363
2364 Manager::FunctionPtr countDescendants(const std::vector<std::string>& arguments)
2365 {
2366 if (arguments.size() == 1) {
2367 std::string cutString = arguments[0];
2368 std::shared_ptr<Variable::Cut> cut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(cutString));
2369 auto func = [cut](const Particle * particle) -> int {
2370
2371 std::vector<const Particle*> allDaughters;
2372 particle->fillAllDaughters(allDaughters);
2373
2374 int n = 0;
2375 for (auto& daughter : allDaughters)
2376 {
2377 if (cut->check(daughter))
2378 ++n;
2379 }
2380 return n;
2381 };
2382 return func;
2383 } else {
2384 B2FATAL("Wrong number of arguments for meta function countDescendants")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function countDescendants"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2384, 0)); }; exit(1); } while(false)
;
2385 }
2386 }
2387
2388 Manager::FunctionPtr numberOfNonOverlappingParticles(const std::vector<std::string>& arguments)
2389 {
2390
2391 auto func = [arguments](const Particle * particle) -> int {
2392
2393 int _numberOfNonOverlappingParticles = 0;
2394 for (const auto& listName : arguments)
2395 {
2396 StoreObjPtr<ParticleList> list(listName);
2397 if (not list.isValid()) {
2398 B2FATAL("Invalid list named " << listName << " encountered in numberOfNonOverlappingParticles.")do { { LogVariableStream varStream; varStream << "Invalid list named "
<< listName << " encountered in numberOfNonOverlappingParticles."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2398, 0)); }; exit(1); } while(false)
;
2399 }
2400 for (unsigned int i = 0; i < list->getListSize(); i++) {
2401 const Particle* p = list->getParticle(i);
2402 if (not particle->overlapsWith(p)) {
2403 _numberOfNonOverlappingParticles++;
2404 }
2405 }
2406 }
2407 return _numberOfNonOverlappingParticles;
2408 };
2409
2410 return func;
2411
2412 }
2413
2414 void appendDaughtersRecursive(Particle* mother, StoreArray<Particle>& container)
2415 {
2416
2417 auto* mcmother = mother->getRelated<MCParticle>();
2418
2419 if (!mcmother)
2420 return;
2421
2422 for (auto* mcdaughter : mcmother->getDaughters()) {
2423 if (!mcdaughter->hasStatus(MCParticle::c_PrimaryParticle)) continue;
2424 Particle tmp_daughter(mcdaughter);
2425 Particle* new_daughter = container.appendNew(tmp_daughter);
2426 new_daughter->addRelationTo(mcdaughter);
2427 mother->appendDaughter(new_daughter, false);
2428
2429 if (mcdaughter->getNDaughters() > 0)
2430 appendDaughtersRecursive(new_daughter, container);
2431 }
2432 }
2433
2434 Manager::FunctionPtr matchedMC(const std::vector<std::string>& arguments)
2435 {
2436 if (arguments.size() == 1) {
2437 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
2438 auto func = [var](const Particle * particle) -> double {
2439 const MCParticle* mcp = particle->getMCParticle();
2440 if (!mcp) // Has no MC match and is no MCParticle
2441 {
2442 return Const::doubleNaN;
2443 }
2444 StoreArray<Particle> tempParticles("tempParticles");
2445 tempParticles.clear();
2446 Particle tmpPart(mcp);
2447 Particle* newPart = tempParticles.appendNew(tmpPart);
2448 newPart->addRelationTo(mcp);
2449
2450 appendDaughtersRecursive(newPart, tempParticles);
2451
2452 auto var_result = var->function(newPart);
2453 if (std::holds_alternative<double>(var_result))
2454 {
2455 return std::get<double>(var_result);
2456 } else if (std::holds_alternative<int>(var_result))
2457 {
2458 return std::get<int>(var_result);
2459 } else if (std::holds_alternative<bool>(var_result))
2460 {
2461 return std::get<bool>(var_result);
2462 } else return Const::doubleNaN;
2463 };
2464 return func;
2465 } else {
2466 B2FATAL("Wrong number of arguments for meta function matchedMC")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function matchedMC"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2466, 0)); }; exit(1); } while(false)
;
2467 }
2468 }
2469
2470 Manager::FunctionPtr clusterBestMatchedMCParticle(const std::vector<std::string>& arguments)
2471 {
2472 if (arguments.size() == 1) {
2473 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
2474
2475 auto func = [var](const Particle * particle) -> double {
2476
2477 const ECLCluster* cluster = particle->getECLCluster();
2478 if (!cluster) return Const::doubleNaN;
2479
2480 auto mcps = cluster->getRelationsTo<MCParticle>();
2481 if (mcps.size() == 0) return Const::doubleNaN;
2482
2483 std::vector<std::pair<double, int>> weightsAndIndices;
2484 for (unsigned int i = 0; i < mcps.size(); ++i)
2485 weightsAndIndices.emplace_back(mcps.weight(i), i);
2486
2487 // sort descending by weight
2488 std::sort(weightsAndIndices.begin(), weightsAndIndices.end(),
2489 ValueIndexPairSorting::higherPair<decltype(weightsAndIndices)::value_type>);
2490
2491 const MCParticle* mcp = mcps.object(weightsAndIndices[0].second);
2492
2493 StoreArray<Particle> tempParticles("tempParticles");
2494 tempParticles.clear();
2495 Particle tmpPart(mcp);
2496 Particle* newPart = tempParticles.appendNew(tmpPart);
2497 newPart->addRelationTo(mcp);
2498
2499 appendDaughtersRecursive(newPart, tempParticles);
2500
2501 auto var_result = var->function(newPart);
2502 if (std::holds_alternative<double>(var_result))
2503 {
2504 return std::get<double>(var_result);
2505 } else if (std::holds_alternative<int>(var_result))
2506 {
2507 return std::get<int>(var_result);
2508 } else if (std::holds_alternative<bool>(var_result))
2509 {
2510 return std::get<bool>(var_result);
2511 } else
2512 {
2513 return Const::doubleNaN;
2514 }
2515 };
2516
2517 return func;
2518 } else {
2519 B2FATAL("Wrong number of arguments for meta function clusterBestMatchedMCParticle")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function clusterBestMatchedMCParticle"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2519, 0)); }; exit(1); } while(false)
;
2520 }
2521 }
2522
2523 Manager::FunctionPtr clusterBestMatchedMCKlong(const std::vector<std::string>& arguments)
2524 {
2525 if (arguments.size() == 1) {
2526 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
2527
2528 auto func = [var](const Particle * particle) -> double {
2529
2530 const ECLCluster* cluster = particle->getECLCluster();
2531 if (!cluster) return Const::doubleNaN;
2532
2533 auto mcps = cluster->getRelationsTo<MCParticle>();
2534 if (mcps.size() == 0) return Const::doubleNaN;
2535
2536 std::map<int, double> mapMCParticleIndxAndWeight;
2537 getKlongWeightMap(particle, mapMCParticleIndxAndWeight);
2538
2539 // Klong is not found
2540 if (mapMCParticleIndxAndWeight.size() == 0)
2541 return Const::doubleNaN;
2542
2543 // find max totalWeight
2544 auto maxMap = std::max_element(mapMCParticleIndxAndWeight.begin(), mapMCParticleIndxAndWeight.end(),
2545 [](const auto & x, const auto & y) { return x.second < y.second; }
2546 );
2547
2548 StoreArray<MCParticle> mcparticles;
2549 const MCParticle* mcKlong = mcparticles[maxMap->first];
2550
2551 Particle tmpPart(mcKlong);
2552 auto var_result = var->function(&tmpPart);
2553 if (std::holds_alternative<double>(var_result))
2554 {
2555 return std::get<double>(var_result);
2556 } else if (std::holds_alternative<int>(var_result))
2557 {
2558 return std::get<int>(var_result);
2559 } else if (std::holds_alternative<bool>(var_result))
2560 {
2561 return std::get<bool>(var_result);
2562 } else
2563 {
2564 return Const::doubleNaN;
2565 }
2566 };
2567
2568 return func;
2569 } else {
2570 B2FATAL("Wrong number of arguments for meta function clusterBestMatchedMCKlong")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function clusterBestMatchedMCKlong"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2570, 0)); }; exit(1); } while(false)
;
2571 }
2572 }
2573
2574 double matchedMCHasPDG(const Particle* particle, const std::vector<double>& pdgCode)
2575 {
2576 if (pdgCode.size() != 1) {
2577 B2FATAL("Too many arguments provided to matchedMCHasPDG!")do { { LogVariableStream varStream; varStream << "Too many arguments provided to matchedMCHasPDG!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2577, 0)); }; exit(1); } while(false)
;
2578 }
2579 int inputPDG = std::lround(pdgCode[0]);
2580
2581 const MCParticle* mcp = particle->getMCParticle();
2582 if (!mcp)
2583 return Const::doubleNaN;
2584
2585 return std::abs(mcp->getPDG()) == inputPDG;
2586 }
2587
2588 Manager::FunctionPtr totalEnergyOfParticlesInList(const std::vector<std::string>& arguments)
2589 {
2590 if (arguments.size() == 1) {
2591 std::string listName = arguments[0];
2592 auto func = [listName](const Particle * particle) -> double {
2593
2594 (void) particle;
2595 StoreObjPtr<ParticleList> listOfParticles(listName);
2596
2597 if (!(listOfParticles.isValid())) B2FATAL("Invalid Listname " << listName << " given to totalEnergyOfParticlesInList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< listName << " given to totalEnergyOfParticlesInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2597, 0)); }; exit(1); } while(false)
;
2598 double totalEnergy = 0;
2599 int nParticles = listOfParticles->getListSize();
2600 for (int i = 0; i < nParticles; i++)
2601 {
2602 const Particle* part = listOfParticles->getParticle(i);
2603 const auto& frame = ReferenceFrame::GetCurrent();
2604 totalEnergy += frame.getMomentum(part).E();
2605 }
2606 return totalEnergy;
2607
2608 };
2609 return func;
2610 } else {
2611 B2FATAL("Wrong number of arguments for meta function totalEnergyOfParticlesInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function totalEnergyOfParticlesInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2611, 0)); }; exit(1); } while(false)
;
2612 }
2613 }
2614
2615 Manager::FunctionPtr totalPxOfParticlesInList(const std::vector<std::string>& arguments)
2616 {
2617 if (arguments.size() == 1) {
2618 std::string listName = arguments[0];
2619 auto func = [listName](const Particle*) -> double {
2620 StoreObjPtr<ParticleList> listOfParticles(listName);
2621
2622 if (!(listOfParticles.isValid())) B2FATAL("Invalid Listname " << listName << " given to totalPxOfParticlesInList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< listName << " given to totalPxOfParticlesInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2622, 0)); }; exit(1); } while(false)
;
2623 double totalPx = 0;
2624 int nParticles = listOfParticles->getListSize();
2625 const auto& frame = ReferenceFrame::GetCurrent();
2626 for (int i = 0; i < nParticles; i++)
2627 {
2628 const Particle* part = listOfParticles->getParticle(i);
2629 totalPx += frame.getMomentum(part).Px();
2630 }
2631 return totalPx;
2632 };
2633 return func;
2634 } else {
2635 B2FATAL("Wrong number of arguments for meta function totalPxOfParticlesInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function totalPxOfParticlesInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2635, 0)); }; exit(1); } while(false)
;
2636 }
2637 }
2638
2639 Manager::FunctionPtr totalPyOfParticlesInList(const std::vector<std::string>& arguments)
2640 {
2641 if (arguments.size() == 1) {
2642 std::string listName = arguments[0];
2643 auto func = [listName](const Particle*) -> double {
2644 StoreObjPtr<ParticleList> listOfParticles(listName);
2645
2646 if (!(listOfParticles.isValid())) B2FATAL("Invalid Listname " << listName << " given to totalPyOfParticlesInList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< listName << " given to totalPyOfParticlesInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2646, 0)); }; exit(1); } while(false)
;
2647 double totalPy = 0;
2648 int nParticles = listOfParticles->getListSize();
2649 const auto& frame = ReferenceFrame::GetCurrent();
2650 for (int i = 0; i < nParticles; i++)
2651 {
2652 const Particle* part = listOfParticles->getParticle(i);
2653 totalPy += frame.getMomentum(part).Py();
2654 }
2655 return totalPy;
2656 };
2657 return func;
2658 } else {
2659 B2FATAL("Wrong number of arguments for meta function totalPyOfParticlesInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function totalPyOfParticlesInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2659, 0)); }; exit(1); } while(false)
;
2660 }
2661 }
2662
2663 Manager::FunctionPtr totalPzOfParticlesInList(const std::vector<std::string>& arguments)
2664 {
2665 if (arguments.size() == 1) {
2666 std::string listName = arguments[0];
2667 auto func = [listName](const Particle*) -> double {
2668 StoreObjPtr<ParticleList> listOfParticles(listName);
2669
2670 if (!(listOfParticles.isValid())) B2FATAL("Invalid Listname " << listName << " given to totalPzOfParticlesInList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< listName << " given to totalPzOfParticlesInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2670, 0)); }; exit(1); } while(false)
;
2671 double totalPz = 0;
2672 int nParticles = listOfParticles->getListSize();
2673 const auto& frame = ReferenceFrame::GetCurrent();
2674 for (int i = 0; i < nParticles; i++)
2675 {
2676 const Particle* part = listOfParticles->getParticle(i);
2677 totalPz += frame.getMomentum(part).Pz();
2678 }
2679 return totalPz;
2680 };
2681 return func;
2682 } else {
2683 B2FATAL("Wrong number of arguments for meta function totalPzOfParticlesInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function totalPzOfParticlesInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2683, 0)); }; exit(1); } while(false)
;
2684 }
2685 }
2686
2687 Manager::FunctionPtr invMassInLists(const std::vector<std::string>& arguments)
2688 {
2689 if (arguments.size() > 0) {
2690
2691 auto func = [arguments](const Particle * particle) -> double {
2692
2693 ROOT::Math::PxPyPzEVector total4Vector;
2694 // To make sure particles in particlesList don't overlap.
2695 std::vector<Particle*> particlePool;
2696
2697 (void) particle;
2698 for (const auto& argument : arguments)
2699 {
2700 StoreObjPtr <ParticleList> listOfParticles(argument);
2701
2702 if (!(listOfParticles.isValid())) B2FATAL("Invalid Listname " << argument << " given to invMassInLists")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< argument << " given to invMassInLists"; Belle2
::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2
::LogConfig::c_Fatal, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 2702, 0)); }; exit
(1); } while(false)
;
2703 int nParticles = listOfParticles->getListSize();
2704 for (int i = 0; i < nParticles; i++) {
2705 bool overlaps = false;
2706 Particle* part = listOfParticles->getParticle(i);
2707 for (const auto* poolPart : particlePool) {
2708 if (part->overlapsWith(poolPart)) {
2709 overlaps = true;
2710 break;
2711 }
2712 }
2713 if (!overlaps) {
2714 total4Vector += part->get4Vector();
2715 particlePool.push_back(part);
2716 }
2717 }
2718 }
2719 double invariantMass = total4Vector.M();
2720 return invariantMass;
2721
2722 };
2723 return func;
2724 } else {
2725 B2FATAL("Wrong number of arguments for meta function invMassInLists")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function invMassInLists"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2725, 0)); }; exit(1); } while(false)
;
2726 }
2727 }
2728
2729 Manager::FunctionPtr totalECLEnergyOfParticlesInList(const std::vector<std::string>& arguments)
2730 {
2731 if (arguments.size() == 1) {
2732 std::string listName = arguments[0];
2733 auto func = [listName](const Particle * particle) -> double {
2734
2735 (void) particle;
2736 StoreObjPtr<ParticleList> listOfParticles(listName);
2737
2738 if (!(listOfParticles.isValid())) B2FATAL("Invalid Listname " << listName << " given to totalEnergyOfParticlesInList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< listName << " given to totalEnergyOfParticlesInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2738, 0)); }; exit(1); } while(false)
;
2739 double totalEnergy = 0;
2740 int nParticles = listOfParticles->getListSize();
2741 for (int i = 0; i < nParticles; i++)
2742 {
2743 const Particle* part = listOfParticles->getParticle(i);
2744 const ECLCluster* cluster = part->getECLCluster();
2745 const ECLCluster::EHypothesisBit clusterHypothesis = part->getECLClusterEHypothesisBit();
2746 if (cluster != nullptr) {
2747 totalEnergy += cluster->getEnergy(clusterHypothesis);
2748 }
2749 }
2750 return totalEnergy;
2751
2752 };
2753 return func;
2754 } else {
2755 B2FATAL("Wrong number of arguments for meta function totalECLEnergyOfParticlesInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function totalECLEnergyOfParticlesInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2755, 0)); }; exit(1); } while(false)
;
2756 }
2757 }
2758
2759 Manager::FunctionPtr maxPtInList(const std::vector<std::string>& arguments)
2760 {
2761 if (arguments.size() == 1) {
2762 std::string listName = arguments[0];
2763 auto func = [listName](const Particle*) -> double {
2764 StoreObjPtr<ParticleList> listOfParticles(listName);
2765
2766 if (!(listOfParticles.isValid())) B2FATAL("Invalid Listname " << listName << " given to maxPtInList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< listName << " given to maxPtInList"; Belle2::
LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2::
LogConfig::c_Fatal, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 2766, 0)); }; exit
(1); } while(false)
;
2767 int nParticles = listOfParticles->getListSize();
2768 const auto& frame = ReferenceFrame::GetCurrent();
2769 double maxPt = 0;
2770 for (int i = 0; i < nParticles; i++)
2771 {
2772 const Particle* part = listOfParticles->getParticle(i);
2773 const double Pt = frame.getMomentum(part).Pt();
2774 if (Pt > maxPt) maxPt = Pt;
2775 }
2776 return maxPt;
2777 };
2778 return func;
2779 } else {
2780 B2FATAL("Wrong number of arguments for meta function maxPtInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function maxPtInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2780, 0)); }; exit(1); } while(false)
;
2781 }
2782 }
2783
2784 Manager::FunctionPtr eclClusterTrackMatchedWithCondition(const std::vector<std::string>& arguments)
2785 {
2786 if (arguments.size() <= 1) {
2787
2788 std::string cutString;
2789 if (arguments.size() == 1)
2790 cutString = arguments[0];
2791 std::shared_ptr<Variable::Cut> cut = std::shared_ptr<Variable::Cut>(Variable::Cut::compile(cutString));
2792 auto func = [cut](const Particle * particle) -> double {
2793
2794 if (particle == nullptr)
2795 return Const::doubleNaN;
2796
2797 const ECLCluster* cluster = particle->getECLCluster();
2798
2799 if (cluster)
2800 {
2801 auto tracks = cluster->getRelationsFrom<Track>();
2802
2803 for (const auto& track : tracks) {
2804 Particle trackParticle(&track, Const::pion);
2805
2806 if (cut->check(&trackParticle))
2807 return 1;
2808 }
2809 return 0;
2810 }
2811 return Const::doubleNaN;
2812 };
2813 return func;
2814 } else {
2815 B2FATAL("Wrong number of arguments for meta function eclClusterSpecialTrackMatched")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function eclClusterSpecialTrackMatched"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2815, 0)); }; exit(1); } while(false)
;
2816 }
2817 }
2818
2819 Manager::FunctionPtr averageValueInList(const std::vector<std::string>& arguments)
2820 {
2821 if (arguments.size() == 2) {
2822 std::string listName = arguments[0];
2823 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
2824
2825 auto func = [listName, var](const Particle*) -> double {
2826 StoreObjPtr<ParticleList> listOfParticles(listName);
2827
2828 if (!(listOfParticles.isValid())) B2FATAL("Invalid list name " << listName << " given to averageValueInList")do { { LogVariableStream varStream; varStream << "Invalid list name "
<< listName << " given to averageValueInList"; Belle2
::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2
::LogConfig::c_Fatal, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 2828, 0)); }; exit
(1); } while(false)
;
2829 int nParticles = listOfParticles->getListSize();
2830 if (nParticles == 0)
2831 {
2832 return Const::doubleNaN;
2833 }
2834 double average = 0;
2835 if (std::holds_alternative<double>(var->function(listOfParticles->getParticle(0))))
2836 {
2837 for (int i = 0; i < nParticles; i++) {
2838 average += std::get<double>(var->function(listOfParticles->getParticle(i))) / nParticles;
2839 }
2840 } else if (std::holds_alternative<int>(var->function(listOfParticles->getParticle(0))))
2841 {
2842 for (int i = 0; i < nParticles; i++) {
2843 average += std::get<int>(var->function(listOfParticles->getParticle(i))) / nParticles;
2844 }
2845 } else return Const::doubleNaN;
2846 return average;
2847 };
2848 return func;
2849 } else {
2850 B2FATAL("Wrong number of arguments for meta function averageValueInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function averageValueInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2850, 0)); }; exit(1); } while(false)
;
2851 }
2852 }
2853
2854 Manager::FunctionPtr medianValueInList(const std::vector<std::string>& arguments)
2855 {
2856 if (arguments.size() == 2) {
2857 std::string listName = arguments[0];
2858 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
2859
2860 auto func = [listName, var](const Particle*) -> double {
2861 StoreObjPtr<ParticleList> listOfParticles(listName);
2862
2863 if (!(listOfParticles.isValid())) B2FATAL("Invalid list name " << listName << " given to medianValueInList")do { { LogVariableStream varStream; varStream << "Invalid list name "
<< listName << " given to medianValueInList"; Belle2
::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2
::LogConfig::c_Fatal, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 2863, 0)); }; exit
(1); } while(false)
;
2864 int nParticles = listOfParticles->getListSize();
2865 if (nParticles == 0)
2866 {
2867 return Const::doubleNaN;
2868 }
2869 std::vector<double> valuesInList;
2870 if (std::holds_alternative<double>(var->function(listOfParticles->getParticle(0))))
2871 {
2872 for (int i = 0; i < nParticles; i++) {
2873 valuesInList.push_back(std::get<double>(var->function(listOfParticles->getParticle(i))));
2874 }
2875 } else if (std::holds_alternative<int>(var->function(listOfParticles->getParticle(0))))
2876 {
2877 for (int i = 0; i < nParticles; i++) {
2878 valuesInList.push_back(std::get<int>(var->function(listOfParticles->getParticle(i))));
2879 }
2880 } else return Const::doubleNaN;
2881 std::sort(valuesInList.begin(), valuesInList.end());
2882 if (nParticles % 2 != 0)
2883 {
2884 return valuesInList[nParticles / 2];
2885 } else
2886 {
2887 return 0.5 * (valuesInList[nParticles / 2] + valuesInList[nParticles / 2 - 1]);
2888 }
2889 };
2890 return func;
2891 } else {
2892 B2FATAL("Wrong number of arguments for meta function medianValueInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function medianValueInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2892, 0)); }; exit(1); } while(false)
;
2893 }
2894 }
2895
2896 Manager::FunctionPtr sumValueInList(const std::vector<std::string>& arguments)
2897 {
2898 if (arguments.size() == 2) {
2899 std::string listName = arguments[0];
2900 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
2901
2902 auto func = [listName, var](const Particle*) -> double {
2903 StoreObjPtr<ParticleList> listOfParticles(listName);
2904
2905 if (!(listOfParticles.isValid())) B2FATAL("Invalid list name " << listName << " given to sumValueInList")do { { LogVariableStream varStream; varStream << "Invalid list name "
<< listName << " given to sumValueInList"; Belle2
::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2
::LogConfig::c_Fatal, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 2905, 0)); }; exit
(1); } while(false)
;
2906 int nParticles = listOfParticles->getListSize();
2907 if (nParticles == 0)
2908 {
2909 return Const::doubleNaN;
2910 }
2911 double sum = 0;
2912 if (std::holds_alternative<double>(var->function(listOfParticles->getParticle(0))))
2913 {
2914 for (int i = 0; i < nParticles; i++) {
2915 sum += std::get<double>(var->function(listOfParticles->getParticle(i)));
2916 }
2917 } else if (std::holds_alternative<int>(var->function(listOfParticles->getParticle(0))))
2918 {
2919 for (int i = 0; i < nParticles; i++) {
2920 sum += std::get<int>(var->function(listOfParticles->getParticle(i)));
2921 }
2922 } else return Const::doubleNaN;
2923 return sum;
2924 };
2925 return func;
2926 } else {
2927 B2FATAL("Wrong number of arguments for meta function sumValueInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function sumValueInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2927, 0)); }; exit(1); } while(false)
;
2928 }
2929 }
2930
2931 Manager::FunctionPtr productValueInList(const std::vector<std::string>& arguments)
2932 {
2933 if (arguments.size() == 2) {
2934 std::string listName = arguments[0];
2935 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
2936
2937 auto func = [listName, var](const Particle*) -> double {
2938 StoreObjPtr<ParticleList> listOfParticles(listName);
2939
2940 if (!(listOfParticles.isValid())) B2FATAL("Invalid list name " << listName << " given to productValueInList")do { { LogVariableStream varStream; varStream << "Invalid list name "
<< listName << " given to productValueInList"; Belle2
::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2
::LogConfig::c_Fatal, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 2940, 0)); }; exit
(1); } while(false)
;
2941 int nParticles = listOfParticles->getListSize();
2942 if (nParticles == 0)
2943 {
2944 return Const::doubleNaN;
2945 }
2946 double product = 1;
2947 if (std::holds_alternative<double>(var->function(listOfParticles->getParticle(0))))
2948 {
2949 for (int i = 0; i < nParticles; i++) {
2950 product *= std::get<double>(var->function(listOfParticles->getParticle(i)));
2951 }
2952 } else if (std::holds_alternative<int>(var->function(listOfParticles->getParticle(0))))
2953 {
2954 for (int i = 0; i < nParticles; i++) {
2955 product *= std::get<int>(var->function(listOfParticles->getParticle(i)));
2956 }
2957 } else return Const::doubleNaN;
2958 return product;
2959 };
2960 return func;
2961 } else {
2962 B2FATAL("Wrong number of arguments for meta function productValueInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function productValueInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2962, 0)); }; exit(1); } while(false)
;
2963 }
2964 }
2965
2966 Manager::FunctionPtr angleToClosestInList(const std::vector<std::string>& arguments)
2967 {
2968 // expecting the list name
2969 if (arguments.size() != 1)
2970 B2FATAL("Wrong number of arguments for meta function angleToClosestInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function angleToClosestInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2970, 0)); }; exit(1); } while(false)
;
2971
2972 std::string listname = arguments[0];
2973
2974 auto func = [listname](const Particle * particle) -> double {
2975 // get the list and check it's valid
2976 StoreObjPtr<ParticleList> list(listname);
2977 if (not list.isValid())
2978 B2FATAL("Invalid particle list name " << listname << " given to angleToClosestInList")do { { LogVariableStream varStream; varStream << "Invalid particle list name "
<< listname << " given to angleToClosestInList";
Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 2978, 0)); }; exit(1); } while(false)
;
2979
2980 // check the list isn't empty
2981 if (list->getListSize() == 0)
2982 return Const::doubleNaN;
2983
2984 // respect the current frame and get the momentum of our input
2985 const auto& frame = ReferenceFrame::GetCurrent();
2986 const auto p_this = frame.getMomentum(particle);
2987
2988 // find the particle index with the smallest opening angle
2989 double minAngle = 2 * M_PI3.14159265358979323846;
2990 for (unsigned int i = 0; i < list->getListSize(); ++i)
2991 {
2992 const Particle* compareme = list->getParticle(i);
2993 const auto p_compare = frame.getMomentum(compareme);
2994 double angle = ROOT::Math::VectorUtil::Angle(p_compare, p_this);
2995 if (minAngle > angle) minAngle = angle;
2996 }
2997 return minAngle;
2998 };
2999 return func;
3000 }
3001
3002 Manager::FunctionPtr closestInList(const std::vector<std::string>& arguments)
3003 {
3004 // expecting the list name and a variable name
3005 if (arguments.size() != 2)
3006 B2FATAL("Wrong number of arguments for meta function closestInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function closestInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3006, 0)); }; exit(1); } while(false)
;
3007
3008 std::string listname = arguments[0];
3009
3010 // the requested variable and check it exists
3011 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
3012
3013 auto func = [listname, var](const Particle * particle) -> double {
3014 // get the list and check it's valid
3015 StoreObjPtr<ParticleList> list(listname);
3016 if (not list.isValid())
3017 B2FATAL("Invalid particle list name " << listname << " given to closestInList")do { { LogVariableStream varStream; varStream << "Invalid particle list name "
<< listname << " given to closestInList"; Belle2
::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2
::LogConfig::c_Fatal, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 3017, 0)); }; exit
(1); } while(false)
;
3018
3019 // respect the current frame and get the momentum of our input
3020 const auto& frame = ReferenceFrame::GetCurrent();
3021 const auto p_this = frame.getMomentum(particle);
3022
3023 // find the particle index with the smallest opening angle
3024 double minAngle = 2 * M_PI3.14159265358979323846;
3025 int iClosest = -1;
3026 for (unsigned int i = 0; i < list->getListSize(); ++i)
3027 {
3028 const Particle* compareme = list->getParticle(i);
3029 const auto p_compare = frame.getMomentum(compareme);
3030 double angle = ROOT::Math::VectorUtil::Angle(p_compare, p_this);
3031 if (minAngle > angle) {
3032 minAngle = angle;
3033 iClosest = i;
3034 }
3035 }
3036
3037 // final check that the list wasn't empty (or some other problem)
3038 if (iClosest == -1) return Const::doubleNaN;
3039 auto var_result = var->function(list->getParticle(iClosest));
3040 if (std::holds_alternative<double>(var_result))
3041 {
3042 return std::get<double>(var_result);
3043 } else if (std::holds_alternative<int>(var_result))
3044 {
3045 return std::get<int>(var_result);
3046 } else if (std::holds_alternative<bool>(var_result))
3047 {
3048 return std::get<bool>(var_result);
3049 } else return Const::doubleNaN;
3050 };
3051 return func;
3052 }
3053
3054 Manager::FunctionPtr angleToMostB2BInList(const std::vector<std::string>& arguments)
3055 {
3056 // expecting the list name
3057 if (arguments.size() != 1)
3058 B2FATAL("Wrong number of arguments for meta function angleToMostB2BInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function angleToMostB2BInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3058, 0)); }; exit(1); } while(false)
;
3059
3060 std::string listname = arguments[0];
3061
3062 auto func = [listname](const Particle * particle) -> double {
3063 // get the list and check it's valid
3064 StoreObjPtr<ParticleList> list(listname);
3065 if (not list.isValid())
3066 B2FATAL("Invalid particle list name " << listname << " given to angleToMostB2BInList")do { { LogVariableStream varStream; varStream << "Invalid particle list name "
<< listname << " given to angleToMostB2BInList";
Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3066, 0)); }; exit(1); } while(false)
;
3067
3068 // check the list isn't empty
3069 if (list->getListSize() == 0)
3070 return Const::doubleNaN;
3071
3072 // respect the current frame and get the momentum of our input
3073 const auto& frame = ReferenceFrame::GetCurrent();
3074 const auto p_this = frame.getMomentum(particle);
3075
3076 // find the most back-to-back (the largest opening angle before they
3077 // start getting smaller again!)
3078 double maxAngle = 0;
3079 for (unsigned int i = 0; i < list->getListSize(); ++i)
3080 {
3081 const Particle* compareme = list->getParticle(i);
3082 const auto p_compare = frame.getMomentum(compareme);
3083 double angle = ROOT::Math::VectorUtil::Angle(p_compare, p_this);
3084 if (maxAngle < angle) maxAngle = angle;
3085 }
3086 return maxAngle;
3087 };
3088 return func;
3089 }
3090
3091 Manager::FunctionPtr deltaPhiToMostB2BPhiInList(const std::vector<std::string>& arguments)
3092 {
3093 // expecting the list name
3094 if (arguments.size() != 1)
3095 B2FATAL("Wrong number of arguments for meta function deltaPhiToMostB2BPhiInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function deltaPhiToMostB2BPhiInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3095, 0)); }; exit(1); } while(false)
;
3096
3097 std::string listname = arguments[0];
3098
3099 auto func = [listname](const Particle * particle) -> double {
3100 // get the list and check it's valid
3101 StoreObjPtr<ParticleList> list(listname);
3102 if (not list.isValid())
3103 B2FATAL("Invalid particle list name " << listname << " given to deltaPhiToMostB2BPhiInList")do { { LogVariableStream varStream; varStream << "Invalid particle list name "
<< listname << " given to deltaPhiToMostB2BPhiInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3103, 0)); }; exit(1); } while(false)
;
3104
3105 // check the list isn't empty
3106 if (list->getListSize() == 0)
3107 return Const::doubleNaN;
3108
3109 // respect the current frame and get the momentum of our input
3110 const auto& frame = ReferenceFrame::GetCurrent();
3111 const auto phi_this = frame.getMomentum(particle).Phi();
3112
3113 // find the most back-to-back in phi (largest absolute value of delta phi)
3114 double maxAngle = 0;
3115 for (unsigned int i = 0; i < list->getListSize(); ++i)
3116 {
3117 const Particle* compareme = list->getParticle(i);
3118 const auto phi_compare = frame.getMomentum(compareme).Phi();
3119 double angle = std::abs(phi_compare - phi_this);
3120 if (angle > M_PI3.14159265358979323846) {angle = 2 * M_PI3.14159265358979323846 - angle;}
3121 if (maxAngle < angle) maxAngle = angle;
3122 }
3123 return maxAngle;
3124 };
3125 return func;
3126 }
3127
3128 Manager::FunctionPtr mostB2BInList(const std::vector<std::string>& arguments)
3129 {
3130 // expecting the list name and a variable name
3131 if (arguments.size() != 2)
3132 B2FATAL("Wrong number of arguments for meta function mostB2BInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function mostB2BInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3132, 0)); }; exit(1); } while(false)
;
3133
3134 std::string listname = arguments[0];
3135
3136 // the requested variable and check it exists
3137 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
3138
3139 auto func = [listname, var](const Particle * particle) -> double {
3140 // get the list and check it's valid
3141 StoreObjPtr<ParticleList> list(listname);
3142 if (not list.isValid())
3143 B2FATAL("Invalid particle list name " << listname << " given to mostB2BInList")do { { LogVariableStream varStream; varStream << "Invalid particle list name "
<< listname << " given to mostB2BInList"; Belle2
::LogSystem::Instance().sendMessage(Belle2::LogMessage(Belle2
::LogConfig::c_Fatal, std::move(varStream), "analysis", __PRETTY_FUNCTION__
, "analysis/variables/src/MetaVariables.cc", 3143, 0)); }; exit
(1); } while(false)
;
3144
3145 // respect the current frame and get the momentum of our input
3146 const auto& frame = ReferenceFrame::GetCurrent();
3147 const auto p_this = frame.getMomentum(particle);
3148
3149 // find the most back-to-back (the largest opening angle before they
3150 // start getting smaller again!)
3151 double maxAngle = -1.0;
3152 int iMostB2B = -1;
3153 for (unsigned int i = 0; i < list->getListSize(); ++i)
3154 {
3155 const Particle* compareme = list->getParticle(i);
3156 const auto p_compare = frame.getMomentum(compareme);
3157 double angle = ROOT::Math::VectorUtil::Angle(p_compare, p_this);
3158 if (maxAngle < angle) {
3159 maxAngle = angle;
3160 iMostB2B = i;
3161 }
3162 }
3163
3164 // final check that the list wasn't empty (or some other problem)
3165 if (iMostB2B == -1) return Const::doubleNaN;
3166 auto var_result = var->function(list->getParticle(iMostB2B));
3167 if (std::holds_alternative<double>(var_result))
3168 {
3169 return std::get<double>(var_result);
3170 } else if (std::holds_alternative<int>(var_result))
3171 {
3172 return std::get<int>(var_result);
3173 } else if (std::holds_alternative<bool>(var_result))
3174 {
3175 return std::get<bool>(var_result);
3176 } else return Const::doubleNaN;
3177 };
3178 return func;
3179 }
3180
3181 Manager::FunctionPtr maxOpeningAngleInList(const std::vector<std::string>& arguments)
3182 {
3183 if (arguments.size() == 1) {
3184 std::string listName = arguments[0];
3185 auto func = [listName](const Particle*) -> double {
3186 StoreObjPtr<ParticleList> listOfParticles(listName);
3187
3188 if (!(listOfParticles.isValid())) B2FATAL("Invalid Listname " << listName << " given to maxOpeningAngleInList")do { { LogVariableStream varStream; varStream << "Invalid Listname "
<< listName << " given to maxOpeningAngleInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3188, 0)); }; exit(1); } while(false)
;
3189 int nParticles = listOfParticles->getListSize();
3190 // return NaN if number of particles is less than 2
3191 if (nParticles < 2) return Const::doubleNaN;
3192
3193 const auto& frame = ReferenceFrame::GetCurrent();
3194 double maxOpeningAngle = -1;
3195 for (int i = 0; i < nParticles; i++)
3196 {
3197 ROOT::Math::PxPyPzEVector v1 = frame.getMomentum(listOfParticles->getParticle(i));
3198 for (int j = i + 1; j < nParticles; j++) {
3199 ROOT::Math::PxPyPzEVector v2 = frame.getMomentum(listOfParticles->getParticle(j));
3200 const double angle = ROOT::Math::VectorUtil::Angle(v1, v2);
3201 if (angle > maxOpeningAngle) maxOpeningAngle = angle;
3202 }
3203 }
3204 return maxOpeningAngle;
3205 };
3206 return func;
3207 } else {
3208 B2FATAL("Wrong number of arguments for meta function maxOpeningAngleInList")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function maxOpeningAngleInList"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3208, 0)); }; exit(1); } while(false)
;
3209 }
3210 }
3211
3212 Manager::FunctionPtr daughterCombination(const std::vector<std::string>& arguments)
3213 {
3214 // Expect 2 or more arguments.
3215 if (arguments.size() >= 2) {
3216 // First argument is the variable name
3217 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
3218
3219 // Core function: calculates a variable combining an arbitrary number of particles
3220 auto func = [var, arguments](const Particle * particle) -> double {
3221 if (particle == nullptr)
3222 {
3223 B2WARNING("Trying to access a daughter that does not exist. Skipping")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "Trying to access a daughter that does not exist. Skipping"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Warning, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3223, 0)); }; } } while(false)
;
3224 return Const::doubleNaN;
3225 }
3226 const auto& frame = ReferenceFrame::GetCurrent();
3227
3228 // Sum of the 4-momenta of all the selected daughters
3229 ROOT::Math::PxPyPzEVector pSum(0, 0, 0, 0);
3230
3231 // Loop over the arguments. Each one of them is a generalizedIndex,
3232 // pointing to a particle in the decay tree.
3233 for (unsigned int iCoord = 1; iCoord < arguments.size(); iCoord++)
3234 {
3235 auto generalizedIndex = arguments[iCoord];
3236 const Particle* dauPart = particle->getParticleFromGeneralizedIndexString(generalizedIndex);
3237 if (dauPart)
3238 pSum += frame.getMomentum(dauPart);
3239 else {
3240 B2WARNING("Trying to access a daughter that does not exist. Index = " << generalizedIndex)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "Trying to access a daughter that does not exist. Index = "
<< generalizedIndex; Belle2::LogSystem::Instance().sendMessage
(Belle2::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3240, 0)); }; } } while(false)
;
3241 return Const::doubleNaN;
3242 }
3243 }
3244
3245 // Make a dummy particle out of the sum of the 4-momenta of the selected daughters
3246 Particle sumOfDaughters(pSum, 100); // 100 is one of the special numbers
3247
3248 auto var_result = var->function(&sumOfDaughters);
3249 // Calculate the variable on the dummy particle
3250 if (std::holds_alternative<double>(var_result))
3251 {
3252 return std::get<double>(var_result);
3253 } else if (std::holds_alternative<int>(var_result))
3254 {
3255 return std::get<int>(var_result);
3256 } else if (std::holds_alternative<bool>(var_result))
3257 {
3258 return std::get<bool>(var_result);
3259 } else return Const::doubleNaN;
3260 };
3261 return func;
3262 } else
3263 B2FATAL("Wrong number of arguments for meta function daughterCombination")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function daughterCombination"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3263, 0)); }; exit(1); } while(false)
;
3264 }
3265
3266 Manager::FunctionPtr useAlternativeDaughterHypothesis(const std::vector<std::string>& arguments)
3267 {
3268 /*
3269 `arguments` contains the variable to calculate and a list of colon-separated index-particle pairs.
3270 Overall, it looks like {"M", "0:K+", "1:p+", "3:e-"}.
3271 The code is thus divided in two parts:
3272 1) Parsing. A loop over the elements of `arguments` that first separates the variable from the rest, and then splits all the index:particle
3273 pairs, filling a std::vector with the indexes and another one with the new mass values.
3274 2) Replacing: A loop over the particle's daughters. We take the 4-momentum of each of them, recalculating it with a new mass if needed, and then we calculate
3275 the variable value using the sum of all the 4-momenta, both updated and non-updated ones.
3276 */
3277
3278 // Expect 2 or more arguments.
3279 if (arguments.size() >= 2) {
3280
3281 //----
3282 // 1) parsing
3283 //----
3284
3285 // First argument is the variable name
3286 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
3287
3288 // Parses the other arguments, which are in the form of index:particleName pairs,
3289 // and stores indexes and pdgs in std::unordered_map
3290 std::unordered_map<unsigned int, int> mapOfReplacedDaughters;
3291
3292 // Loop over the arguments to parse them
3293 for (unsigned int iCoord = 1; iCoord < arguments.size(); iCoord++) {
3294 auto replacedDauString = arguments[iCoord];
3295 // Split the string in index and new mass
3296 std::vector<std::string> indexAndMass;
3297 boost::split(indexAndMass, replacedDauString, boost::is_any_of(":"));
3298
3299 // Checks that the index:particleName pair is properly formatted.
3300 if (indexAndMass.size() > 2) {
3301 B2WARNING("The string indicating which daughter's mass should be replaced contains more than two elements separated by a colon. Perhaps you tried to pass a generalized index, which is not supported yet for this variable. The offending string is "do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "The string indicating which daughter's mass should be replaced contains more than two elements separated by a colon. Perhaps you tried to pass a generalized index, which is not supported yet for this variable. The offending string is "
<< replacedDauString << ", while a correct syntax looks like 0:K+."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Warning, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3302, 0)); }; } } while(false)
3302 << replacedDauString << ", while a correct syntax looks like 0:K+.")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "The string indicating which daughter's mass should be replaced contains more than two elements separated by a colon. Perhaps you tried to pass a generalized index, which is not supported yet for this variable. The offending string is "
<< replacedDauString << ", while a correct syntax looks like 0:K+."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Warning, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3302, 0)); }; } } while(false)
;
3303 return nullptr;
3304 }
3305
3306 if (indexAndMass.size() < 2) {
3307 B2WARNING("The string indicating which daughter's mass should be replaced contains only one colon-separated element instead of two. The offending string is "do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "The string indicating which daughter's mass should be replaced contains only one colon-separated element instead of two. The offending string is "
<< replacedDauString << ", while a correct syntax looks like 0:K+."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Warning, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3308, 0)); }; } } while(false)
3308 << replacedDauString << ", while a correct syntax looks like 0:K+.")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "The string indicating which daughter's mass should be replaced contains only one colon-separated element instead of two. The offending string is "
<< replacedDauString << ", while a correct syntax looks like 0:K+."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Warning, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3308, 0)); }; } } while(false)
;
3309 return nullptr;
3310 }
3311
3312 // indexAndMass[0] is the daughter index as string. Try to convert it
3313 int dauIndex = 0;
3314 try {
3315 dauIndex = convertString<int>(indexAndMass[0]);
3316 } catch (std::invalid_argument&) {
3317 B2FATAL("Found the string " << indexAndMass[0] << "instead of a daughter index.")do { { LogVariableStream varStream; varStream << "Found the string "
<< indexAndMass[0] << "instead of a daughter index."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3317, 0)); }; exit(1); } while(false)
;
3318 }
3319
3320 // Determine PDG code corresponding to indexAndMass[1] using the particle names defined in evt.pdl
3321 TParticlePDG* particlePDG = TDatabasePDG::Instance()->GetParticle(indexAndMass[1].c_str());
3322 if (!particlePDG) {
3323 B2WARNING("Particle not in evt.pdl file! " << indexAndMass[1])do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "Particle not in evt.pdl file! " <<
indexAndMass[1]; Belle2::LogSystem::Instance().sendMessage(Belle2
::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3323, 0)); }; } } while(false)
;
3324 return nullptr;
3325 }
3326
3327 // Stores the indexes and the pdgs in the map that will be passed to the lambda function
3328 int pdgCode = particlePDG->PdgCode();
3329 mapOfReplacedDaughters[dauIndex] = pdgCode;
3330 } // End of parsing
3331
3332 // Check the size of mapOfReplacedDaughters
3333 if (mapOfReplacedDaughters.size() != arguments.size() - 1)
3334 B2FATAL("Overlapped daughter's index is detected in the meta-variable useAlternativeDaughterHypothesis")do { { LogVariableStream varStream; varStream << "Overlapped daughter's index is detected in the meta-variable useAlternativeDaughterHypothesis"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3334, 0)); }; exit(1); } while(false)
;
3335
3336 //----
3337 // 2) replacing
3338 //----
3339
3340 // Core function: creates a new particle from the original one changing
3341 // some of the daughters' masses
3342 auto func = [var, mapOfReplacedDaughters](const Particle * particle) -> double {
3343 if (particle == nullptr)
3344 {
3345 B2WARNING("Trying to access a particle that does not exist. Skipping")do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "Trying to access a particle that does not exist. Skipping"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Warning, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3345, 0)); }; } } while(false)
;
3346 return Const::doubleNaN;
3347 }
3348
3349 const auto& frame = ReferenceFrame::GetCurrent();
3350
3351 // Create a dummy particle from the given particle to overwrite its kinematics
3352 Particle* dummy = ParticleCopy::copyParticle(particle);
3353
3354 // Sum of the 4-momenta of all the daughters with the new mass assumptions
3355 ROOT::Math::PxPyPzMVector pSum(0, 0, 0, 0);
3356
3357 for (unsigned int iDau = 0; iDau < particle->getNDaughters(); iDau++)
3358 {
3359 const Particle* dauPart = particle->getDaughter(iDau);
3360 if (not dauPart) {
3361 B2WARNING("Trying to access a daughter that does not exist. Index = " << iDau)do { if (Belle2::LogSystem::Instance().isLevelEnabled(Belle2::
LogConfig::c_Warning, 0, "analysis")) { { LogVariableStream varStream
; varStream << "Trying to access a daughter that does not exist. Index = "
<< iDau; Belle2::LogSystem::Instance().sendMessage(Belle2
::LogMessage(Belle2::LogConfig::c_Warning, std::move(varStream
), "analysis", __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3361, 0)); }; } } while(false)
;
3362 return Const::doubleNaN;
3363 }
3364
3365 ROOT::Math::PxPyPzMVector dauMom = ROOT::Math::PxPyPzMVector(frame.getMomentum(dauPart));
3366
3367 int pdgCode;
3368 try {
3369 pdgCode = mapOfReplacedDaughters.at(iDau);
3370 } catch (std::out_of_range&) {
3371 // iDau is not in mapOfReplacedDaughters
3372 pSum += dauMom;
3373 continue;
3374 }
3375
3376 // overwrite the daughter's kinematics
3377 double p_x = dauMom.Px();
3378 double p_y = dauMom.Py();
3379 double p_z = dauMom.Pz();
3380 dauMom.SetCoordinates(p_x, p_y, p_z, TDatabasePDG::Instance()->GetParticle(pdgCode)->Mass());
3381 const_cast<Particle*>(dummy->getDaughter(iDau))->set4VectorDividingByMomentumScaling(ROOT::Math::PxPyPzEVector(dauMom));
3382
3383 // overwrite the daughter's pdg
3384 const int charge = dummy->getDaughter(iDau)->getCharge();
3385 if (TDatabasePDG::Instance()->GetParticle(pdgCode)->Charge() / 3.0 == charge)
3386 const_cast<Particle*>(dummy->getDaughter(iDau))->setPDGCode(pdgCode);
3387 else
3388 const_cast<Particle*>(dummy->getDaughter(iDau))->setPDGCode(-1 * pdgCode);
3389
3390 pSum += dauMom;
3391 } // End of loop over number of daughter
3392
3393 // overwrite the particle's kinematics
3394 dummy->set4Vector(ROOT::Math::PxPyPzEVector(pSum));
3395
3396 auto var_result = var->function(dummy);
3397
3398 // Calculate the variable on the dummy particle
3399 if (std::holds_alternative<double>(var_result))
3400 {
3401 return std::get<double>(var_result);
3402 } else if (std::holds_alternative<int>(var_result))
3403 {
3404 return std::get<int>(var_result);
3405 } else if (std::holds_alternative<bool>(var_result))
3406 {
3407 return std::get<bool>(var_result);
3408 } else return Const::doubleNaN;
3409 }; // end of lambda function
3410 return func;
3411 }// end of check on number of arguments
3412 else
3413 B2FATAL("Wrong number of arguments for meta function useAlternativeDaughterHypothesis")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function useAlternativeDaughterHypothesis"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3413, 0)); }; exit(1); } while(false)
;
3414 }
3415
3416 Manager::FunctionPtr varForFirstMCAncestorOfType(const std::vector<std::string>& arguments)
3417 {
3418 if (arguments.size() == 2) {
3419 int pdg_code = -1;
3420 std::string arg = arguments[0];
3421 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[1]);
3422 TParticlePDG* part = TDatabasePDG::Instance()->GetParticle(arg.c_str());
3423
3424 if (part != nullptr) {
3425 pdg_code = std::abs(part->PdgCode());
3426 } else {
3427 try {
3428 pdg_code = convertString<int>(arg);
3429 } catch (const std::exception& e) {}
3430 }
3431
3432 if (pdg_code == -1) {
3433 B2FATAL("Ancestor " + arg + " is not recognised. Please provide valid PDG code or particle name.")do { { LogVariableStream varStream; varStream << "Ancestor "
+ arg + " is not recognised. Please provide valid PDG code or particle name."
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3433, 0)); }; exit(1); } while(false)
;
3434 }
3435
3436 auto func = [pdg_code, var](const Particle * particle) -> double {
3437 const Particle* p = particle;
3438
3439 int ancestor_level = std::get<double>(Manager::Instance().getVariable("hasAncestor(" + std::to_string(pdg_code) + ", 0)")->function(p));
3440 if ((ancestor_level <= 0) or (std::isnan(ancestor_level)))
3441 {
3442 return Const::doubleNaN;
3443 }
3444
3445 const MCParticle* i_p = p->getMCParticle();
3446
3447 for (int a = 0; a < ancestor_level ; a = a + 1)
3448 {
3449 i_p = i_p->getMother();
3450 }
3451
3452 StoreArray<Particle> tempParticles("tempParticles");
3453 tempParticles.clear();
3454 Particle m_p(i_p);
3455 Particle* newPart = tempParticles.appendNew(m_p);
3456 newPart->addRelationTo(i_p);
3457
3458 appendDaughtersRecursive(newPart, tempParticles);
3459
3460 auto var_result = var->function(newPart);
3461 if (std::holds_alternative<double>(var_result))
3462 {
3463 return std::get<double>(var_result);
3464 } else if (std::holds_alternative<int>(var_result))
3465 {
3466 return std::get<int>(var_result);
3467 } else if (std::holds_alternative<bool>(var_result))
3468 {
3469 return std::get<bool>(var_result);
3470 } else return Const::doubleNaN;
3471 };
3472 return func;
3473 } else {
3474 B2FATAL("Wrong number of arguments for meta function varForFirstMCAncestorOfType (expected 2: type and variable of interest)")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function varForFirstMCAncestorOfType (expected 2: type and variable of interest)"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3474, 0)); }; exit(1); } while(false)
;
3475 }
3476 }
3477
3478 Manager::FunctionPtr nTrackFitResults(const std::vector<std::string>& arguments)
3479 {
3480 if (arguments.size() != 1) {
3481 B2FATAL("Number of arguments for nTrackFitResults must be 1, particleType or PDGcode")do { { LogVariableStream varStream; varStream << "Number of arguments for nTrackFitResults must be 1, particleType or PDGcode"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3481, 0)); }; exit(1); } while(false)
;
3482 }
3483
3484 std::string arg = arguments[0];
3485 TDatabasePDG* pdgDatabase = TDatabasePDG::Instance();
3486 TParticlePDG* part = pdgDatabase->GetParticle(arg.c_str());
3487 int absPdg = 0;
3488 if (part != nullptr) {
3489 absPdg = std::abs(part->PdgCode());
3490 } else {
3491 try {
3492 absPdg = std::abs(convertString<int>(arg));
3493 } catch (const std::exception&) {
3494 absPdg = 0;
3495 }
3496
3497 if (absPdg == 0 || pdgDatabase->GetParticle(absPdg) == nullptr) {
3498 B2FATAL("nTrackFitResults: argument '" << arg << "' is neither a valid particle name nor a PDG code")do { { LogVariableStream varStream; varStream << "nTrackFitResults: argument '"
<< arg << "' is neither a valid particle name nor a PDG code"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3498, 0)); }; exit(1); } while(false)
;
3499 }
3500 }
3501
3502 auto func = [absPdg](const Particle*) -> int {
3503
3504 Const::ChargedStable type(absPdg);
3505 StoreArray<Track> tracks;
3506
3507 int nTrackFitResults = 0;
3508
3509 for (const auto& track : tracks)
3510 {
3511 const TrackFitResult* trackFit = track.getTrackFitResultWithClosestMass(type);
3512
3513 if (!trackFit) continue;
3514 if (trackFit->getChargeSign() == 0) continue;
3515
3516 nTrackFitResults++;
3517 }
3518
3519 return nTrackFitResults;
3520
3521 };
3522 return func;
3523 }
3524
3525
3526 Manager::FunctionPtr convertToInt(const std::vector<std::string>& arguments)
3527 {
3528 if (arguments.size() == 2) {
3529 const Variable::Manager::Var* var = Manager::Instance().getVariable(arguments[0]);
3530 int default_val = convertString<int>(arguments[1]);
3531 auto func = [var, default_val](const Particle * particle) -> int {
3532 auto var_result = var->function(particle);
3533 if (std::holds_alternative<double>(var_result))
3534 {
3535 double value = std::get<double>(var_result);
3536 if (value > std::numeric_limits<int>::max())
3537 value = std::numeric_limits<int>::max();
3538 if (value < std::numeric_limits<int>::min())
3539 value = std::numeric_limits<int>::min();
3540 if (std::isnan(value))
3541 value = default_val;
3542 return static_cast<int>(value);
3543 } else if (std::holds_alternative<int>(var_result))
3544 return std::get<int>(var_result);
3545 else if (std::holds_alternative<bool>(var_result))
3546 return static_cast<int>(std::get<bool>(var_result));
3547 else return default_val;
3548 };
3549 return func;
3550 } else {
3551 B2FATAL("Wrong number of arguments for meta function int, please provide variable name and replacement value for NaN!")do { { LogVariableStream varStream; varStream << "Wrong number of arguments for meta function int, please provide variable name and replacement value for NaN!"
; Belle2::LogSystem::Instance().sendMessage(Belle2::LogMessage
(Belle2::LogConfig::c_Fatal, std::move(varStream), "analysis"
, __PRETTY_FUNCTION__, "analysis/variables/src/MetaVariables.cc"
, 3551, 0)); }; exit(1); } while(false)
;
3552 }
3553 }
3554
3555 VARIABLE_GROUP("MetaFunctions")static GroupProxy _variablegroupproxy3555("MetaFunctions");;
3556 REGISTER_METAVARIABLE("nCleanedECLClusters(cut)", nCleanedECLClusters,static Proxy _variableproxy3559(std::string("nCleanedECLClusters(cut)"
), Variable::make_function(nCleanedECLClusters), std::string(
"[Eventbased] Returns the number of clean Clusters in the event\n"
"Clean clusters are defined by the clusters which pass the given cut assuming a photon hypothesis."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nCleanedECLClusters"));
3557 "[Eventbased] Returns the number of clean Clusters in the event\n"static Proxy _variableproxy3559(std::string("nCleanedECLClusters(cut)"
), Variable::make_function(nCleanedECLClusters), std::string(
"[Eventbased] Returns the number of clean Clusters in the event\n"
"Clean clusters are defined by the clusters which pass the given cut assuming a photon hypothesis."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nCleanedECLClusters"));
3558 "Clean clusters are defined by the clusters which pass the given cut assuming a photon hypothesis.",static Proxy _variableproxy3559(std::string("nCleanedECLClusters(cut)"
), Variable::make_function(nCleanedECLClusters), std::string(
"[Eventbased] Returns the number of clean Clusters in the event\n"
"Clean clusters are defined by the clusters which pass the given cut assuming a photon hypothesis."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nCleanedECLClusters"));
3559 Manager::VariableDataType::c_int)static Proxy _variableproxy3559(std::string("nCleanedECLClusters(cut)"
), Variable::make_function(nCleanedECLClusters), std::string(
"[Eventbased] Returns the number of clean Clusters in the event\n"
"Clean clusters are defined by the clusters which pass the given cut assuming a photon hypothesis."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nCleanedECLClusters"));
;
3560 REGISTER_METAVARIABLE("nCleanedTracks(cut)", nCleanedTracks,static Proxy _variableproxy3562(std::string("nCleanedTracks(cut)"
), Variable::make_function(nCleanedTracks), std::string("[Eventbased] Returns the number of clean Tracks in the event\n"
"Clean tracks are defined by the tracks which pass the given cut assuming a pion hypothesis."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nCleanedTracks"));
3561 "[Eventbased] Returns the number of clean Tracks in the event\n"static Proxy _variableproxy3562(std::string("nCleanedTracks(cut)"
), Variable::make_function(nCleanedTracks), std::string("[Eventbased] Returns the number of clean Tracks in the event\n"
"Clean tracks are defined by the tracks which pass the given cut assuming a pion hypothesis."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nCleanedTracks"));
3562 "Clean tracks are defined by the tracks which pass the given cut assuming a pion hypothesis.", Manager::VariableDataType::c_int)static Proxy _variableproxy3562(std::string("nCleanedTracks(cut)"
), Variable::make_function(nCleanedTracks), std::string("[Eventbased] Returns the number of clean Tracks in the event\n"
"Clean tracks are defined by the tracks which pass the given cut assuming a pion hypothesis."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nCleanedTracks"));
;
3563 REGISTER_METAVARIABLE("formula(v1 + v2 * [v3 - v4] / v5^v6)", formula, R"DOCSTRING(static Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3564Returns the result of the given formula, where v1 to vN are variables or floatingstatic Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3565point numbers. Currently the only supported operations are addition (``+``),static Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3566subtraction (``-``), multiplication (``*``), division (``/``) and power (``^``static Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3567or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]``static Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3568or normal brackets ``(v1 * v2)``. It will work also with variables takingstatic Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3569arguments. Operator precedence is taken into account. For example ::static Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3570
3571 (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138static Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3572
3573.. versionchanged:: release-03-00-00static Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3574 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` canstatic Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3575 be used for exponent and float literals are possible directly in thestatic Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3576 formula.static Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
3577)DOCSTRING", Manager::VariableDataType::c_double)static Proxy _variableproxy3577(std::string("formula(v1 + v2 * [v3 - v4] / v5^v6)"
), Variable::make_function(formula), std::string(R"DOCSTRING( Returns the result of the given formula, where v1 to vN are variables or floating point numbers. Currently the only supported operations are addition (``+``), subtraction (``-``), multiplication (``*``), division (``/``) and power (``^`` or ``**``). Parenthesis can be in the form of square brackets ``[v1 * v2]`` or normal brackets ``(v1 * v2)``. It will work also with variables taking arguments. Operator precedence is taken into account. For example :: (daughter(0, E) + daughter(1, E))**2 - p**2 + 0.138 .. versionchanged:: release-03-00-00 now both, ``[]`` and ``()`` can be used for grouping operations, ``**`` can be used for exponent and float literals are possible directly in the formula. )DOCSTRING"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("formula"));
;
3578 REGISTER_METAVARIABLE("useRestFrame(variable)", useRestFrame,static Proxy _variableproxy3580(std::string("useRestFrame(variable)"
), Variable::make_function(useRestFrame), std::string("Returns the value of the variable using the rest frame of the given particle as current reference frame.\n"
"E.g. ``useRestFrame(daughter(0, p))`` returns the total momentum of the first daughter in its mother's rest-frame"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useRestFrame"));
3579 "Returns the value of the variable using the rest frame of the given particle as current reference frame.\n"static Proxy _variableproxy3580(std::string("useRestFrame(variable)"
), Variable::make_function(useRestFrame), std::string("Returns the value of the variable using the rest frame of the given particle as current reference frame.\n"
"E.g. ``useRestFrame(daughter(0, p))`` returns the total momentum of the first daughter in its mother's rest-frame"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useRestFrame"));
3580 "E.g. ``useRestFrame(daughter(0, p))`` returns the total momentum of the first daughter in its mother's rest-frame", Manager::VariableDataType::c_double)static Proxy _variableproxy3580(std::string("useRestFrame(variable)"
), Variable::make_function(useRestFrame), std::string("Returns the value of the variable using the rest frame of the given particle as current reference frame.\n"
"E.g. ``useRestFrame(daughter(0, p))`` returns the total momentum of the first daughter in its mother's rest-frame"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useRestFrame"));
;
3581 REGISTER_METAVARIABLE("useCMSFrame(variable)", useCMSFrame,static Proxy _variableproxy3583(std::string("useCMSFrame(variable)"
), Variable::make_function(useCMSFrame), std::string("Returns the value of the variable using the CMS frame as current reference frame.\n"
"E.g. ``useCMSFrame(E)`` returns the energy of a particle in the CMS frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useCMSFrame"));
3582 "Returns the value of the variable using the CMS frame as current reference frame.\n"static Proxy _variableproxy3583(std::string("useCMSFrame(variable)"
), Variable::make_function(useCMSFrame), std::string("Returns the value of the variable using the CMS frame as current reference frame.\n"
"E.g. ``useCMSFrame(E)`` returns the energy of a particle in the CMS frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useCMSFrame"));
3583 "E.g. ``useCMSFrame(E)`` returns the energy of a particle in the CMS frame.", Manager::VariableDataType::c_double)static Proxy _variableproxy3583(std::string("useCMSFrame(variable)"
), Variable::make_function(useCMSFrame), std::string("Returns the value of the variable using the CMS frame as current reference frame.\n"
"E.g. ``useCMSFrame(E)`` returns the energy of a particle in the CMS frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useCMSFrame"));
;
3584 REGISTER_METAVARIABLE("useLabFrame(variable)", useLabFrame, R"DOC(static Proxy _variableproxy3593(std::string("useLabFrame(variable)"
), Variable::make_function(useLabFrame), std::string(R"DOC( Returns the value of ``variable`` in the *lab* frame. .. tip:: The lab frame is the default reference frame, usually you don't need to use this meta-variable. E.g. ``useLabFrame(E)`` returns the energy of a particle in the Lab frame, same as just ``E``. Specifying the lab frame is useful in some corner-cases. For example: ``useRestFrame(daughter(0, formula(E - useLabFrame(E))))`` which is the difference of the first daughter's energy in the rest frame of the mother (current particle) with the same daughter's lab-frame energy. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useLabFrame"));
3585Returns the value of ``variable`` in the *lab* frame.static Proxy _variableproxy3593(std::string("useLabFrame(variable)"
), Variable::make_function(useLabFrame), std::string(R"DOC( Returns the value of ``variable`` in the *lab* frame. .. tip:: The lab frame is the default reference frame, usually you don't need to use this meta-variable. E.g. ``useLabFrame(E)`` returns the energy of a particle in the Lab frame, same as just ``E``. Specifying the lab frame is useful in some corner-cases. For example: ``useRestFrame(daughter(0, formula(E - useLabFrame(E))))`` which is the difference of the first daughter's energy in the rest frame of the mother (current particle) with the same daughter's lab-frame energy. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useLabFrame"));
3586
3587.. tip::static Proxy _variableproxy3593(std::string("useLabFrame(variable)"
), Variable::make_function(useLabFrame), std::string(R"DOC( Returns the value of ``variable`` in the *lab* frame. .. tip:: The lab frame is the default reference frame, usually you don't need to use this meta-variable. E.g. ``useLabFrame(E)`` returns the energy of a particle in the Lab frame, same as just ``E``. Specifying the lab frame is useful in some corner-cases. For example: ``useRestFrame(daughter(0, formula(E - useLabFrame(E))))`` which is the difference of the first daughter's energy in the rest frame of the mother (current particle) with the same daughter's lab-frame energy. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useLabFrame"));
3588 The lab frame is the default reference frame, usually you don't need to use this meta-variable.static Proxy _variableproxy3593(std::string("useLabFrame(variable)"
), Variable::make_function(useLabFrame), std::string(R"DOC( Returns the value of ``variable`` in the *lab* frame. .. tip:: The lab frame is the default reference frame, usually you don't need to use this meta-variable. E.g. ``useLabFrame(E)`` returns the energy of a particle in the Lab frame, same as just ``E``. Specifying the lab frame is useful in some corner-cases. For example: ``useRestFrame(daughter(0, formula(E - useLabFrame(E))))`` which is the difference of the first daughter's energy in the rest frame of the mother (current particle) with the same daughter's lab-frame energy. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useLabFrame"));
3589 E.g. ``useLabFrame(E)`` returns the energy of a particle in the Lab frame, same as just ``E``.static Proxy _variableproxy3593(std::string("useLabFrame(variable)"
), Variable::make_function(useLabFrame), std::string(R"DOC( Returns the value of ``variable`` in the *lab* frame. .. tip:: The lab frame is the default reference frame, usually you don't need to use this meta-variable. E.g. ``useLabFrame(E)`` returns the energy of a particle in the Lab frame, same as just ``E``. Specifying the lab frame is useful in some corner-cases. For example: ``useRestFrame(daughter(0, formula(E - useLabFrame(E))))`` which is the difference of the first daughter's energy in the rest frame of the mother (current particle) with the same daughter's lab-frame energy. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useLabFrame"));
3590
3591Specifying the lab frame is useful in some corner-cases. For example:static Proxy _variableproxy3593(std::string("useLabFrame(variable)"
), Variable::make_function(useLabFrame), std::string(R"DOC( Returns the value of ``variable`` in the *lab* frame. .. tip:: The lab frame is the default reference frame, usually you don't need to use this meta-variable. E.g. ``useLabFrame(E)`` returns the energy of a particle in the Lab frame, same as just ``E``. Specifying the lab frame is useful in some corner-cases. For example: ``useRestFrame(daughter(0, formula(E - useLabFrame(E))))`` which is the difference of the first daughter's energy in the rest frame of the mother (current particle) with the same daughter's lab-frame energy. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useLabFrame"));
3592``useRestFrame(daughter(0, formula(E - useLabFrame(E))))`` which is the difference of the first daughter's energy in the rest frame of the mother (current particle) with the same daughter's lab-frame energy.static Proxy _variableproxy3593(std::string("useLabFrame(variable)"
), Variable::make_function(useLabFrame), std::string(R"DOC( Returns the value of ``variable`` in the *lab* frame. .. tip:: The lab frame is the default reference frame, usually you don't need to use this meta-variable. E.g. ``useLabFrame(E)`` returns the energy of a particle in the Lab frame, same as just ``E``. Specifying the lab frame is useful in some corner-cases. For example: ``useRestFrame(daughter(0, formula(E - useLabFrame(E))))`` which is the difference of the first daughter's energy in the rest frame of the mother (current particle) with the same daughter's lab-frame energy. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useLabFrame"));
3593)DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3593(std::string("useLabFrame(variable)"
), Variable::make_function(useLabFrame), std::string(R"DOC( Returns the value of ``variable`` in the *lab* frame. .. tip:: The lab frame is the default reference frame, usually you don't need to use this meta-variable. E.g. ``useLabFrame(E)`` returns the energy of a particle in the Lab frame, same as just ``E``. Specifying the lab frame is useful in some corner-cases. For example: ``useRestFrame(daughter(0, formula(E - useLabFrame(E))))`` which is the difference of the first daughter's energy in the rest frame of the mother (current particle) with the same daughter's lab-frame energy. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useLabFrame"));
;
3594 REGISTER_METAVARIABLE("useTagSideRecoilRestFrame(variable, daughterIndexTagB)", useTagSideRecoilRestFrame,static Proxy _variableproxy3597(std::string("useTagSideRecoilRestFrame(variable, daughterIndexTagB)"
), Variable::make_function(useTagSideRecoilRestFrame), std::string
("Returns the value of the variable in the rest frame of the recoiling particle to the tag side B meson.\n"
"The variable should only be applied to an Upsilon(4S) list.\n"
"E.g. ``useTagSideRecoilRestFrame(daughter(1, daughter(1, p)), 0)`` applied on a Upsilon(4S) list (``Upsilon(4S)->B+:tag B-:sig``) returns the momentum of the second daughter of the signal B meson in the signal B meson rest frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useTagSideRecoilRestFrame"));
3595 "Returns the value of the variable in the rest frame of the recoiling particle to the tag side B meson.\n"static Proxy _variableproxy3597(std::string("useTagSideRecoilRestFrame(variable, daughterIndexTagB)"
), Variable::make_function(useTagSideRecoilRestFrame), std::string
("Returns the value of the variable in the rest frame of the recoiling particle to the tag side B meson.\n"
"The variable should only be applied to an Upsilon(4S) list.\n"
"E.g. ``useTagSideRecoilRestFrame(daughter(1, daughter(1, p)), 0)`` applied on a Upsilon(4S) list (``Upsilon(4S)->B+:tag B-:sig``) returns the momentum of the second daughter of the signal B meson in the signal B meson rest frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useTagSideRecoilRestFrame"));
3596 "The variable should only be applied to an Upsilon(4S) list.\n"static Proxy _variableproxy3597(std::string("useTagSideRecoilRestFrame(variable, daughterIndexTagB)"
), Variable::make_function(useTagSideRecoilRestFrame), std::string
("Returns the value of the variable in the rest frame of the recoiling particle to the tag side B meson.\n"
"The variable should only be applied to an Upsilon(4S) list.\n"
"E.g. ``useTagSideRecoilRestFrame(daughter(1, daughter(1, p)), 0)`` applied on a Upsilon(4S) list (``Upsilon(4S)->B+:tag B-:sig``) returns the momentum of the second daughter of the signal B meson in the signal B meson rest frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useTagSideRecoilRestFrame"));
3597 "E.g. ``useTagSideRecoilRestFrame(daughter(1, daughter(1, p)), 0)`` applied on a Upsilon(4S) list (``Upsilon(4S)->B+:tag B-:sig``) returns the momentum of the second daughter of the signal B meson in the signal B meson rest frame.", Manager::VariableDataType::c_double)static Proxy _variableproxy3597(std::string("useTagSideRecoilRestFrame(variable, daughterIndexTagB)"
), Variable::make_function(useTagSideRecoilRestFrame), std::string
("Returns the value of the variable in the rest frame of the recoiling particle to the tag side B meson.\n"
"The variable should only be applied to an Upsilon(4S) list.\n"
"E.g. ``useTagSideRecoilRestFrame(daughter(1, daughter(1, p)), 0)`` applied on a Upsilon(4S) list (``Upsilon(4S)->B+:tag B-:sig``) returns the momentum of the second daughter of the signal B meson in the signal B meson rest frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useTagSideRecoilRestFrame"));
;
3598 REGISTER_METAVARIABLE("useParticleRestFrame(variable, particleList)", useParticleRestFrame,static Proxy _variableproxy3602(std::string("useParticleRestFrame(variable, particleList)"
), Variable::make_function(useParticleRestFrame), std::string
("Returns the value of the variable in the rest frame of the first Particle contained in the given ParticleList.\n"
"It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "
"When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "
"computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useParticleRestFrame"));
3599 "Returns the value of the variable in the rest frame of the first Particle contained in the given ParticleList.\n"static Proxy _variableproxy3602(std::string("useParticleRestFrame(variable, particleList)"
), Variable::make_function(useParticleRestFrame), std::string
("Returns the value of the variable in the rest frame of the first Particle contained in the given ParticleList.\n"
"It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "
"When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "
"computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useParticleRestFrame"));
3600 "It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "static Proxy _variableproxy3602(std::string("useParticleRestFrame(variable, particleList)"
), Variable::make_function(useParticleRestFrame), std::string
("Returns the value of the variable in the rest frame of the first Particle contained in the given ParticleList.\n"
"It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "
"When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "
"computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useParticleRestFrame"));
3601 "When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "static Proxy _variableproxy3602(std::string("useParticleRestFrame(variable, particleList)"
), Variable::make_function(useParticleRestFrame), std::string
("Returns the value of the variable in the rest frame of the first Particle contained in the given ParticleList.\n"
"It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "
"When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "
"computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useParticleRestFrame"));
3602 "computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN.", Manager::VariableDataType::c_double)static Proxy _variableproxy3602(std::string("useParticleRestFrame(variable, particleList)"
), Variable::make_function(useParticleRestFrame), std::string
("Returns the value of the variable in the rest frame of the first Particle contained in the given ParticleList.\n"
"It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "
"When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "
"computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useParticleRestFrame"));
;
3603 REGISTER_METAVARIABLE("useRecoilParticleRestFrame(variable, particleList)", useRecoilParticleRestFrame,static Proxy _variableproxy3607(std::string("useRecoilParticleRestFrame(variable, particleList)"
), Variable::make_function(useRecoilParticleRestFrame), std::
string("Returns the value of the variable in the rest frame of recoil system against the first Particle contained in the given ParticleList.\n"
"It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "
"When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "
"computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useRecoilParticleRestFrame"));
3604 "Returns the value of the variable in the rest frame of recoil system against the first Particle contained in the given ParticleList.\n"static Proxy _variableproxy3607(std::string("useRecoilParticleRestFrame(variable, particleList)"
), Variable::make_function(useRecoilParticleRestFrame), std::
string("Returns the value of the variable in the rest frame of recoil system against the first Particle contained in the given ParticleList.\n"
"It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "
"When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "
"computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useRecoilParticleRestFrame"));
3605 "It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "static Proxy _variableproxy3607(std::string("useRecoilParticleRestFrame(variable, particleList)"
), Variable::make_function(useRecoilParticleRestFrame), std::
string("Returns the value of the variable in the rest frame of recoil system against the first Particle contained in the given ParticleList.\n"
"It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "
"When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "
"computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useRecoilParticleRestFrame"));
3606 "When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "static Proxy _variableproxy3607(std::string("useRecoilParticleRestFrame(variable, particleList)"
), Variable::make_function(useRecoilParticleRestFrame), std::
string("Returns the value of the variable in the rest frame of recoil system against the first Particle contained in the given ParticleList.\n"
"It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "
"When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "
"computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useRecoilParticleRestFrame"));
3607 "computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN.", Manager::VariableDataType::c_double)static Proxy _variableproxy3607(std::string("useRecoilParticleRestFrame(variable, particleList)"
), Variable::make_function(useRecoilParticleRestFrame), std::
string("Returns the value of the variable in the rest frame of recoil system against the first Particle contained in the given ParticleList.\n"
"It is strongly recommended to pass a ParticleList that contains at most only one Particle in each event. "
"When more than one Particle is present in the ParticleList, only the first Particle in the list is used for "
"computing the rest frame and a warning is thrown. If the given ParticleList is empty in an event, it returns NaN."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useRecoilParticleRestFrame"));
;
3608 REGISTER_METAVARIABLE("useDaughterRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])", useDaughterRestFrame,static Proxy _variableproxy3613(std::string("useDaughterRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRestFrame), std::string
("Returns the value of the variable in the rest frame of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRestFrame"));
3609 "Returns the value of the variable in the rest frame of the selected daughter particle.\n"static Proxy _variableproxy3613(std::string("useDaughterRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRestFrame), std::string
("Returns the value of the variable in the rest frame of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRestFrame"));
3610 "The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "static Proxy _variableproxy3613(std::string("useDaughterRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRestFrame), std::string
("Returns the value of the variable in the rest frame of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRestFrame"));
3611 "of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"static Proxy _variableproxy3613(std::string("useDaughterRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRestFrame), std::string
("Returns the value of the variable in the rest frame of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRestFrame"));
3612 "If two or more indices are given, the rest frame of the sum of the daughters is used.",static Proxy _variableproxy3613(std::string("useDaughterRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRestFrame), std::string
("Returns the value of the variable in the rest frame of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRestFrame"));
3613 Manager::VariableDataType::c_double)static Proxy _variableproxy3613(std::string("useDaughterRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRestFrame), std::string
("Returns the value of the variable in the rest frame of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRestFrame"));
;
3614 REGISTER_METAVARIABLE("useDaughterRecoilRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])", useDaughterRecoilRestFrame,static Proxy _variableproxy3619(std::string("useDaughterRecoilRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRecoilRestFrame), std::
string("Returns the value of the variable in the rest frame of the recoil of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRecoilRestFrame"));
3615 "Returns the value of the variable in the rest frame of the recoil of the selected daughter particle.\n"static Proxy _variableproxy3619(std::string("useDaughterRecoilRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRecoilRestFrame), std::
string("Returns the value of the variable in the rest frame of the recoil of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRecoilRestFrame"));
3616 "The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "static Proxy _variableproxy3619(std::string("useDaughterRecoilRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRecoilRestFrame), std::
string("Returns the value of the variable in the rest frame of the recoil of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRecoilRestFrame"));
3617 "of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"static Proxy _variableproxy3619(std::string("useDaughterRecoilRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRecoilRestFrame), std::
string("Returns the value of the variable in the rest frame of the recoil of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRecoilRestFrame"));
3618 "If two or more indices are given, the rest frame of the sum of the daughters is used.",static Proxy _variableproxy3619(std::string("useDaughterRecoilRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRecoilRestFrame), std::
string("Returns the value of the variable in the rest frame of the recoil of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRecoilRestFrame"));
3619 Manager::VariableDataType::c_double)static Proxy _variableproxy3619(std::string("useDaughterRecoilRestFrame(variable, daughterIndex_1, [daughterIndex_2, ... daughterIndex_3])"
), Variable::make_function(useDaughterRecoilRestFrame), std::
string("Returns the value of the variable in the rest frame of the recoil of the selected daughter particle.\n"
"The daughter is identified via generalized daughter index, e.g. ``0:1`` identifies the second daughter (1) "
"of the first daughter (0). If the daughter index is invalid, it returns NaN.\n"
"If two or more indices are given, the rest frame of the sum of the daughters is used."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useDaughterRecoilRestFrame"));
;
3620 REGISTER_METAVARIABLE("useMCancestorBRestFrame(variable)", useMCancestorBRestFrame,static Proxy _variableproxy3622(std::string("useMCancestorBRestFrame(variable)"
), Variable::make_function(useMCancestorBRestFrame), std::string
("Returns the value of the variable in the rest frame of the ancestor B MC particle.\n"
"If no B or no MC-matching is found, it returns NaN."), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("useMCancestorBRestFrame"));
3621 "Returns the value of the variable in the rest frame of the ancestor B MC particle.\n"static Proxy _variableproxy3622(std::string("useMCancestorBRestFrame(variable)"
), Variable::make_function(useMCancestorBRestFrame), std::string
("Returns the value of the variable in the rest frame of the ancestor B MC particle.\n"
"If no B or no MC-matching is found, it returns NaN."), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("useMCancestorBRestFrame"));
3622 "If no B or no MC-matching is found, it returns NaN.", Manager::VariableDataType::c_double)static Proxy _variableproxy3622(std::string("useMCancestorBRestFrame(variable)"
), Variable::make_function(useMCancestorBRestFrame), std::string
("Returns the value of the variable in the rest frame of the ancestor B MC particle.\n"
"If no B or no MC-matching is found, it returns NaN."), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("useMCancestorBRestFrame"));
;
3623 REGISTER_METAVARIABLE("passesCut(cut)", passesCut,static Proxy _variableproxy3625(std::string("passesCut(cut)")
, Variable::make_function(passesCut), std::string("Returns 1 if particle passes the cut otherwise 0.\n"
"Useful if you want to write out if a particle would have passed a cut or not."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("passesCut"));
3624 "Returns 1 if particle passes the cut otherwise 0.\n"static Proxy _variableproxy3625(std::string("passesCut(cut)")
, Variable::make_function(passesCut), std::string("Returns 1 if particle passes the cut otherwise 0.\n"
"Useful if you want to write out if a particle would have passed a cut or not."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("passesCut"));
3625 "Useful if you want to write out if a particle would have passed a cut or not.", Manager::VariableDataType::c_bool)static Proxy _variableproxy3625(std::string("passesCut(cut)")
, Variable::make_function(passesCut), std::string("Returns 1 if particle passes the cut otherwise 0.\n"
"Useful if you want to write out if a particle would have passed a cut or not."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("passesCut"));
;
3626 REGISTER_METAVARIABLE("passesEventCut(cut)", passesEventCut,static Proxy _variableproxy3628(std::string("passesEventCut(cut)"
), Variable::make_function(passesEventCut), std::string("[Eventbased] Returns 1 if event passes the cut otherwise 0.\n"
"Useful if you want to select events passing a cut without looping into particles, such as for skimming.\n"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("passesEventCut"));
3627 "[Eventbased] Returns 1 if event passes the cut otherwise 0.\n"static Proxy _variableproxy3628(std::string("passesEventCut(cut)"
), Variable::make_function(passesEventCut), std::string("[Eventbased] Returns 1 if event passes the cut otherwise 0.\n"
"Useful if you want to select events passing a cut without looping into particles, such as for skimming.\n"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("passesEventCut"));
3628 "Useful if you want to select events passing a cut without looping into particles, such as for skimming.\n", Manager::VariableDataType::c_bool)static Proxy _variableproxy3628(std::string("passesEventCut(cut)"
), Variable::make_function(passesEventCut), std::string("[Eventbased] Returns 1 if event passes the cut otherwise 0.\n"
"Useful if you want to select events passing a cut without looping into particles, such as for skimming.\n"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("passesEventCut"));
;
3629 REGISTER_METAVARIABLE("countDaughters(cut)", countDaughters,static Proxy _variableproxy3631(std::string("countDaughters(cut)"
), Variable::make_function(countDaughters), std::string("Returns number of direct daughters which satisfy the cut.\n"
"Used by the skimming package (for what exactly?)"), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_int)
, std::string("countDaughters"));
3630 "Returns number of direct daughters which satisfy the cut.\n"static Proxy _variableproxy3631(std::string("countDaughters(cut)"
), Variable::make_function(countDaughters), std::string("Returns number of direct daughters which satisfy the cut.\n"
"Used by the skimming package (for what exactly?)"), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_int)
, std::string("countDaughters"));
3631 "Used by the skimming package (for what exactly?)", Manager::VariableDataType::c_int)static Proxy _variableproxy3631(std::string("countDaughters(cut)"
), Variable::make_function(countDaughters), std::string("Returns number of direct daughters which satisfy the cut.\n"
"Used by the skimming package (for what exactly?)"), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_int)
, std::string("countDaughters"));
;
3632 REGISTER_METAVARIABLE("countFSPDaughters(cut)", countDescendants,static Proxy _variableproxy3634(std::string("countFSPDaughters(cut)"
), Variable::make_function(countDescendants), std::string("Returns number of final-state daughters which satisfy the cut."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("countDescendants"));
3633 "Returns number of final-state daughters which satisfy the cut.",static Proxy _variableproxy3634(std::string("countFSPDaughters(cut)"
), Variable::make_function(countDescendants), std::string("Returns number of final-state daughters which satisfy the cut."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("countDescendants"));
3634 Manager::VariableDataType::c_int)static Proxy _variableproxy3634(std::string("countFSPDaughters(cut)"
), Variable::make_function(countDescendants), std::string("Returns number of final-state daughters which satisfy the cut."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("countDescendants"));
;
3635 REGISTER_METAVARIABLE("countDescendants(cut)", countDescendants,static Proxy _variableproxy3637(std::string("countDescendants(cut)"
), Variable::make_function(countDescendants), std::string("Returns number of descendants for all generations which satisfy the cut."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("countDescendants"));
3636 "Returns number of descendants for all generations which satisfy the cut.",static Proxy _variableproxy3637(std::string("countDescendants(cut)"
), Variable::make_function(countDescendants), std::string("Returns number of descendants for all generations which satisfy the cut."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("countDescendants"));
3637 Manager::VariableDataType::c_int)static Proxy _variableproxy3637(std::string("countDescendants(cut)"
), Variable::make_function(countDescendants), std::string("Returns number of descendants for all generations which satisfy the cut."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("countDescendants"));
;
3638 REGISTER_METAVARIABLE("varFor(pdgCode, variable)", varFor,static Proxy _variableproxy3640(std::string("varFor(pdgCode, variable)"
), Variable::make_function(varFor), std::string("Returns the value of the variable for the given particle if its abs(pdgCode) agrees with the given one.\n"
"E.g. ``varFor(11, p)`` returns the momentum if the particle is an electron or a positron."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("varFor"));
3639 "Returns the value of the variable for the given particle if its abs(pdgCode) agrees with the given one.\n"static Proxy _variableproxy3640(std::string("varFor(pdgCode, variable)"
), Variable::make_function(varFor), std::string("Returns the value of the variable for the given particle if its abs(pdgCode) agrees with the given one.\n"
"E.g. ``varFor(11, p)`` returns the momentum if the particle is an electron or a positron."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("varFor"));
3640 "E.g. ``varFor(11, p)`` returns the momentum if the particle is an electron or a positron.", Manager::VariableDataType::c_double)static Proxy _variableproxy3640(std::string("varFor(pdgCode, variable)"
), Variable::make_function(varFor), std::string("Returns the value of the variable for the given particle if its abs(pdgCode) agrees with the given one.\n"
"E.g. ``varFor(11, p)`` returns the momentum if the particle is an electron or a positron."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("varFor"));
;
3641 REGISTER_METAVARIABLE("varForMCGen(variable)", varForMCGen,static Proxy _variableproxy3644(std::string("varForMCGen(variable)"
), Variable::make_function(varForMCGen), std::string("Returns the value of the variable for the given particle if the MC particle related to it is primary, not virtual, and not initial.\n"
"If no MC particle is related to the given particle, or the MC particle is not primary, virtual, or initial, NaN will be returned.\n"
"E.g. ``varForMCGen(PDG)`` returns the PDG code of the MC particle related to the given particle if it is primary, not virtual, and not initial."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("varForMCGen"));
3642 "Returns the value of the variable for the given particle if the MC particle related to it is primary, not virtual, and not initial.\n"static Proxy _variableproxy3644(std::string("varForMCGen(variable)"
), Variable::make_function(varForMCGen), std::string("Returns the value of the variable for the given particle if the MC particle related to it is primary, not virtual, and not initial.\n"
"If no MC particle is related to the given particle, or the MC particle is not primary, virtual, or initial, NaN will be returned.\n"
"E.g. ``varForMCGen(PDG)`` returns the PDG code of the MC particle related to the given particle if it is primary, not virtual, and not initial."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("varForMCGen"));
3643 "If no MC particle is related to the given particle, or the MC particle is not primary, virtual, or initial, NaN will be returned.\n"static Proxy _variableproxy3644(std::string("varForMCGen(variable)"
), Variable::make_function(varForMCGen), std::string("Returns the value of the variable for the given particle if the MC particle related to it is primary, not virtual, and not initial.\n"
"If no MC particle is related to the given particle, or the MC particle is not primary, virtual, or initial, NaN will be returned.\n"
"E.g. ``varForMCGen(PDG)`` returns the PDG code of the MC particle related to the given particle if it is primary, not virtual, and not initial."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("varForMCGen"));
3644 "E.g. ``varForMCGen(PDG)`` returns the PDG code of the MC particle related to the given particle if it is primary, not virtual, and not initial.", Manager::VariableDataType::c_double)static Proxy _variableproxy3644(std::string("varForMCGen(variable)"
), Variable::make_function(varForMCGen), std::string("Returns the value of the variable for the given particle if the MC particle related to it is primary, not virtual, and not initial.\n"
"If no MC particle is related to the given particle, or the MC particle is not primary, virtual, or initial, NaN will be returned.\n"
"E.g. ``varForMCGen(PDG)`` returns the PDG code of the MC particle related to the given particle if it is primary, not virtual, and not initial."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("varForMCGen"));
;
3645 REGISTER_METAVARIABLE("nParticlesInList(particleListName)", nParticlesInList,static Proxy _variableproxy3646(std::string("nParticlesInList(particleListName)"
), Variable::make_function(nParticlesInList), std::string("[Eventbased] Returns number of particles in the given particle List."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nParticlesInList"));
3646 "[Eventbased] Returns number of particles in the given particle List.", Manager::VariableDataType::c_int)static Proxy _variableproxy3646(std::string("nParticlesInList(particleListName)"
), Variable::make_function(nParticlesInList), std::string("[Eventbased] Returns number of particles in the given particle List."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nParticlesInList"));
;
3647 REGISTER_METAVARIABLE("isInList(particleListName)", isInList,static Proxy _variableproxy3648(std::string("isInList(particleListName)"
), Variable::make_function(isInList), std::string("Returns 1 if the particle is in the list provided, 0 if not. Note that this only checks the particle given. For daughters of composite particles, please see :b2:var:`isDaughterOfList`."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isInList"));
3648 "Returns 1 if the particle is in the list provided, 0 if not. Note that this only checks the particle given. For daughters of composite particles, please see :b2:var:`isDaughterOfList`.", Manager::VariableDataType::c_bool)static Proxy _variableproxy3648(std::string("isInList(particleListName)"
), Variable::make_function(isInList), std::string("Returns 1 if the particle is in the list provided, 0 if not. Note that this only checks the particle given. For daughters of composite particles, please see :b2:var:`isDaughterOfList`."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isInList"));
;
3649 REGISTER_METAVARIABLE("isDaughterOfList(particleListNames)", isDaughterOfList,static Proxy _variableproxy3650(std::string("isDaughterOfList(particleListNames)"
), Variable::make_function(isDaughterOfList), std::string("Returns 1 if the given particle is a daughter of at least one of the particles in the given particle Lists."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isDaughterOfList"));
3650 "Returns 1 if the given particle is a daughter of at least one of the particles in the given particle Lists.", Manager::VariableDataType::c_bool)static Proxy _variableproxy3650(std::string("isDaughterOfList(particleListNames)"
), Variable::make_function(isDaughterOfList), std::string("Returns 1 if the given particle is a daughter of at least one of the particles in the given particle Lists."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isDaughterOfList"));
;
3651 REGISTER_METAVARIABLE("isDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])", isDescendantOfList, R"DOC(static Proxy _variableproxy3660(std::string("isDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isDescendantOfList), std::string(R"DOC( Returns 1 if the given particle appears in the decay chain of the particles in the given ParticleLists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isDescendantOfList(<particle_list>,1)`` returns 1 if particle is a daughter of the list, * ``isDescendantOfList(<particle_list>,2)`` returns 1 if particle is a granddaughter of the list, * ``isDescendantOfList(<particle_list>,3)`` returns 1 if particle is a great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isDescendantOfList"));
3652 Returns 1 if the given particle appears in the decay chain of the particles in the given ParticleLists.static Proxy _variableproxy3660(std::string("isDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isDescendantOfList), std::string(R"DOC( Returns 1 if the given particle appears in the decay chain of the particles in the given ParticleLists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isDescendantOfList(<particle_list>,1)`` returns 1 if particle is a daughter of the list, * ``isDescendantOfList(<particle_list>,2)`` returns 1 if particle is a granddaughter of the list, * ``isDescendantOfList(<particle_list>,3)`` returns 1 if particle is a great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isDescendantOfList"));
3653
3654 Passing an integer as the last argument, allows to check if the particle belongs to the specific generation:static Proxy _variableproxy3660(std::string("isDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isDescendantOfList), std::string(R"DOC( Returns 1 if the given particle appears in the decay chain of the particles in the given ParticleLists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isDescendantOfList(<particle_list>,1)`` returns 1 if particle is a daughter of the list, * ``isDescendantOfList(<particle_list>,2)`` returns 1 if particle is a granddaughter of the list, * ``isDescendantOfList(<particle_list>,3)`` returns 1 if particle is a great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isDescendantOfList"));
3655
3656 * ``isDescendantOfList(<particle_list>,1)`` returns 1 if particle is a daughter of the list,static Proxy _variableproxy3660(std::string("isDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isDescendantOfList), std::string(R"DOC( Returns 1 if the given particle appears in the decay chain of the particles in the given ParticleLists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isDescendantOfList(<particle_list>,1)`` returns 1 if particle is a daughter of the list, * ``isDescendantOfList(<particle_list>,2)`` returns 1 if particle is a granddaughter of the list, * ``isDescendantOfList(<particle_list>,3)`` returns 1 if particle is a great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isDescendantOfList"));
3657 * ``isDescendantOfList(<particle_list>,2)`` returns 1 if particle is a granddaughter of the list,static Proxy _variableproxy3660(std::string("isDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isDescendantOfList), std::string(R"DOC( Returns 1 if the given particle appears in the decay chain of the particles in the given ParticleLists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isDescendantOfList(<particle_list>,1)`` returns 1 if particle is a daughter of the list, * ``isDescendantOfList(<particle_list>,2)`` returns 1 if particle is a granddaughter of the list, * ``isDescendantOfList(<particle_list>,3)`` returns 1 if particle is a great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isDescendantOfList"));
3658 * ``isDescendantOfList(<particle_list>,3)`` returns 1 if particle is a great-granddaughter of the list, etc.static Proxy _variableproxy3660(std::string("isDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isDescendantOfList), std::string(R"DOC( Returns 1 if the given particle appears in the decay chain of the particles in the given ParticleLists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isDescendantOfList(<particle_list>,1)`` returns 1 if particle is a daughter of the list, * ``isDescendantOfList(<particle_list>,2)`` returns 1 if particle is a granddaughter of the list, * ``isDescendantOfList(<particle_list>,3)`` returns 1 if particle is a great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isDescendantOfList"));
3659 * Default value is ``-1`` that is inclusive for all generations.static Proxy _variableproxy3660(std::string("isDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isDescendantOfList), std::string(R"DOC( Returns 1 if the given particle appears in the decay chain of the particles in the given ParticleLists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isDescendantOfList(<particle_list>,1)`` returns 1 if particle is a daughter of the list, * ``isDescendantOfList(<particle_list>,2)`` returns 1 if particle is a granddaughter of the list, * ``isDescendantOfList(<particle_list>,3)`` returns 1 if particle is a great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isDescendantOfList"));
3660 )DOC", Manager::VariableDataType::c_bool)static Proxy _variableproxy3660(std::string("isDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isDescendantOfList), std::string(R"DOC( Returns 1 if the given particle appears in the decay chain of the particles in the given ParticleLists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isDescendantOfList(<particle_list>,1)`` returns 1 if particle is a daughter of the list, * ``isDescendantOfList(<particle_list>,2)`` returns 1 if particle is a granddaughter of the list, * ``isDescendantOfList(<particle_list>,3)`` returns 1 if particle is a great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isDescendantOfList"));
;
3661 REGISTER_METAVARIABLE("isMCDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])", isMCDescendantOfList, R"DOC(static Proxy _variableproxy3672(std::string("isMCDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isMCDescendantOfList), std::string
(R"DOC( Returns 1 if the given particle is linked to the same MC particle as any reconstructed daughter of the decay lists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isMCDescendantOfList(<particle_list>,1)`` returns 1 if particle is matched to the same particle as any daughter of the list, * ``isMCDescendantOfList(<particle_list>,2)`` returns 1 if particle is matched to the same particle as any granddaughter of the list, * ``isMCDescendantOfList(<particle_list>,3)`` returns 1 if particle is matched to the same particle as any great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. It makes only sense for lists created with `fillParticleListFromMC` function with ``addDaughters=True`` argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isMCDescendantOfList"));
3662 Returns 1 if the given particle is linked to the same MC particle as any reconstructed daughter of the decay lists.static Proxy _variableproxy3672(std::string("isMCDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isMCDescendantOfList), std::string
(R"DOC( Returns 1 if the given particle is linked to the same MC particle as any reconstructed daughter of the decay lists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isMCDescendantOfList(<particle_list>,1)`` returns 1 if particle is matched to the same particle as any daughter of the list, * ``isMCDescendantOfList(<particle_list>,2)`` returns 1 if particle is matched to the same particle as any granddaughter of the list, * ``isMCDescendantOfList(<particle_list>,3)`` returns 1 if particle is matched to the same particle as any great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. It makes only sense for lists created with `fillParticleListFromMC` function with ``addDaughters=True`` argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isMCDescendantOfList"));
3663
3664 Passing an integer as the last argument, allows to check if the particle belongs to the specific generation:static Proxy _variableproxy3672(std::string("isMCDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isMCDescendantOfList), std::string
(R"DOC( Returns 1 if the given particle is linked to the same MC particle as any reconstructed daughter of the decay lists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isMCDescendantOfList(<particle_list>,1)`` returns 1 if particle is matched to the same particle as any daughter of the list, * ``isMCDescendantOfList(<particle_list>,2)`` returns 1 if particle is matched to the same particle as any granddaughter of the list, * ``isMCDescendantOfList(<particle_list>,3)`` returns 1 if particle is matched to the same particle as any great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. It makes only sense for lists created with `fillParticleListFromMC` function with ``addDaughters=True`` argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isMCDescendantOfList"));
3665
3666 * ``isMCDescendantOfList(<particle_list>,1)`` returns 1 if particle is matched to the same particle as any daughter of the list,static Proxy _variableproxy3672(std::string("isMCDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isMCDescendantOfList), std::string
(R"DOC( Returns 1 if the given particle is linked to the same MC particle as any reconstructed daughter of the decay lists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isMCDescendantOfList(<particle_list>,1)`` returns 1 if particle is matched to the same particle as any daughter of the list, * ``isMCDescendantOfList(<particle_list>,2)`` returns 1 if particle is matched to the same particle as any granddaughter of the list, * ``isMCDescendantOfList(<particle_list>,3)`` returns 1 if particle is matched to the same particle as any great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. It makes only sense for lists created with `fillParticleListFromMC` function with ``addDaughters=True`` argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isMCDescendantOfList"));
3667 * ``isMCDescendantOfList(<particle_list>,2)`` returns 1 if particle is matched to the same particle as any granddaughter of the list,static Proxy _variableproxy3672(std::string("isMCDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isMCDescendantOfList), std::string
(R"DOC( Returns 1 if the given particle is linked to the same MC particle as any reconstructed daughter of the decay lists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isMCDescendantOfList(<particle_list>,1)`` returns 1 if particle is matched to the same particle as any daughter of the list, * ``isMCDescendantOfList(<particle_list>,2)`` returns 1 if particle is matched to the same particle as any granddaughter of the list, * ``isMCDescendantOfList(<particle_list>,3)`` returns 1 if particle is matched to the same particle as any great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. It makes only sense for lists created with `fillParticleListFromMC` function with ``addDaughters=True`` argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isMCDescendantOfList"));
3668 * ``isMCDescendantOfList(<particle_list>,3)`` returns 1 if particle is matched to the same particle as any great-granddaughter of the list, etc.static Proxy _variableproxy3672(std::string("isMCDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isMCDescendantOfList), std::string
(R"DOC( Returns 1 if the given particle is linked to the same MC particle as any reconstructed daughter of the decay lists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isMCDescendantOfList(<particle_list>,1)`` returns 1 if particle is matched to the same particle as any daughter of the list, * ``isMCDescendantOfList(<particle_list>,2)`` returns 1 if particle is matched to the same particle as any granddaughter of the list, * ``isMCDescendantOfList(<particle_list>,3)`` returns 1 if particle is matched to the same particle as any great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. It makes only sense for lists created with `fillParticleListFromMC` function with ``addDaughters=True`` argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isMCDescendantOfList"));
3669 * Default value is ``-1`` that is inclusive for all generations.static Proxy _variableproxy3672(std::string("isMCDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isMCDescendantOfList), std::string
(R"DOC( Returns 1 if the given particle is linked to the same MC particle as any reconstructed daughter of the decay lists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isMCDescendantOfList(<particle_list>,1)`` returns 1 if particle is matched to the same particle as any daughter of the list, * ``isMCDescendantOfList(<particle_list>,2)`` returns 1 if particle is matched to the same particle as any granddaughter of the list, * ``isMCDescendantOfList(<particle_list>,3)`` returns 1 if particle is matched to the same particle as any great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. It makes only sense for lists created with `fillParticleListFromMC` function with ``addDaughters=True`` argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isMCDescendantOfList"));
3670
3671 It makes only sense for lists created with `fillParticleListFromMC` function with ``addDaughters=True`` argument.static Proxy _variableproxy3672(std::string("isMCDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isMCDescendantOfList), std::string
(R"DOC( Returns 1 if the given particle is linked to the same MC particle as any reconstructed daughter of the decay lists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isMCDescendantOfList(<particle_list>,1)`` returns 1 if particle is matched to the same particle as any daughter of the list, * ``isMCDescendantOfList(<particle_list>,2)`` returns 1 if particle is matched to the same particle as any granddaughter of the list, * ``isMCDescendantOfList(<particle_list>,3)`` returns 1 if particle is matched to the same particle as any great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. It makes only sense for lists created with `fillParticleListFromMC` function with ``addDaughters=True`` argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isMCDescendantOfList"));
3672 )DOC", Manager::VariableDataType::c_bool)static Proxy _variableproxy3672(std::string("isMCDescendantOfList(particleListName[, anotherParticleListName][, generationFlag = -1])"
), Variable::make_function(isMCDescendantOfList), std::string
(R"DOC( Returns 1 if the given particle is linked to the same MC particle as any reconstructed daughter of the decay lists. Passing an integer as the last argument, allows to check if the particle belongs to the specific generation: * ``isMCDescendantOfList(<particle_list>,1)`` returns 1 if particle is matched to the same particle as any daughter of the list, * ``isMCDescendantOfList(<particle_list>,2)`` returns 1 if particle is matched to the same particle as any granddaughter of the list, * ``isMCDescendantOfList(<particle_list>,3)`` returns 1 if particle is matched to the same particle as any great-granddaughter of the list, etc. * Default value is ``-1`` that is inclusive for all generations. It makes only sense for lists created with `fillParticleListFromMC` function with ``addDaughters=True`` argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isMCDescendantOfList"));
;
3673
3674 REGISTER_METAVARIABLE("sourceObjectIsInList(particleListName)", sourceObjectIsInList, R"DOC(static Proxy _variableproxy3679(std::string("sourceObjectIsInList(particleListName)"
), Variable::make_function(sourceObjectIsInList), std::string
(R"DOC( Returns 1 if the underlying mdst object (e.g. track, or cluster) was used to create a particle in ``particleListName``, 0 if not. .. note:: This only makes sense for particles that are not composite. Returns -1 for composite particles. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("sourceObjectIsInList"));
3675Returns 1 if the underlying mdst object (e.g. track, or cluster) was used to create a particle in ``particleListName``, 0 if not.static Proxy _variableproxy3679(std::string("sourceObjectIsInList(particleListName)"
), Variable::make_function(sourceObjectIsInList), std::string
(R"DOC( Returns 1 if the underlying mdst object (e.g. track, or cluster) was used to create a particle in ``particleListName``, 0 if not. .. note:: This only makes sense for particles that are not composite. Returns -1 for composite particles. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("sourceObjectIsInList"));
3676
3677.. note::static Proxy _variableproxy3679(std::string("sourceObjectIsInList(particleListName)"
), Variable::make_function(sourceObjectIsInList), std::string
(R"DOC( Returns 1 if the underlying mdst object (e.g. track, or cluster) was used to create a particle in ``particleListName``, 0 if not. .. note:: This only makes sense for particles that are not composite. Returns -1 for composite particles. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("sourceObjectIsInList"));
3678 This only makes sense for particles that are not composite. Returns -1 for composite particles.static Proxy _variableproxy3679(std::string("sourceObjectIsInList(particleListName)"
), Variable::make_function(sourceObjectIsInList), std::string
(R"DOC( Returns 1 if the underlying mdst object (e.g. track, or cluster) was used to create a particle in ``particleListName``, 0 if not. .. note:: This only makes sense for particles that are not composite. Returns -1 for composite particles. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("sourceObjectIsInList"));
3679)DOC", Manager::VariableDataType::c_int)static Proxy _variableproxy3679(std::string("sourceObjectIsInList(particleListName)"
), Variable::make_function(sourceObjectIsInList), std::string
(R"DOC( Returns 1 if the underlying mdst object (e.g. track, or cluster) was used to create a particle in ``particleListName``, 0 if not. .. note:: This only makes sense for particles that are not composite. Returns -1 for composite particles. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("sourceObjectIsInList"));
;
3680
3681 REGISTER_METAVARIABLE("mcParticleIsInMCList(particleListName)", mcParticleIsInMCList, R"DOC(static Proxy _variableproxy3686(std::string("mcParticleIsInMCList(particleListName)"
), Variable::make_function(mcParticleIsInMCList), std::string
(R"DOC( Returns 1 if the particle's matched MC particle is also matched to a particle in ``particleListName`` (or if either of the lists were filled from generator level `modularAnalysis.fillParticleListFromMC`.) .. seealso:: :b2:var:`isMCDescendantOfList` to check daughters. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("mcParticleIsInMCList"));
3682Returns 1 if the particle's matched MC particle is also matched to a particle in ``particleListName``static Proxy _variableproxy3686(std::string("mcParticleIsInMCList(particleListName)"
), Variable::make_function(mcParticleIsInMCList), std::string
(R"DOC( Returns 1 if the particle's matched MC particle is also matched to a particle in ``particleListName`` (or if either of the lists were filled from generator level `modularAnalysis.fillParticleListFromMC`.) .. seealso:: :b2:var:`isMCDescendantOfList` to check daughters. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("mcParticleIsInMCList"));
3683(or if either of the lists were filled from generator level `modularAnalysis.fillParticleListFromMC`.)static Proxy _variableproxy3686(std::string("mcParticleIsInMCList(particleListName)"
), Variable::make_function(mcParticleIsInMCList), std::string
(R"DOC( Returns 1 if the particle's matched MC particle is also matched to a particle in ``particleListName`` (or if either of the lists were filled from generator level `modularAnalysis.fillParticleListFromMC`.) .. seealso:: :b2:var:`isMCDescendantOfList` to check daughters. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("mcParticleIsInMCList"));
3684
3685.. seealso:: :b2:var:`isMCDescendantOfList` to check daughters.static Proxy _variableproxy3686(std::string("mcParticleIsInMCList(particleListName)"
), Variable::make_function(mcParticleIsInMCList), std::string
(R"DOC( Returns 1 if the particle's matched MC particle is also matched to a particle in ``particleListName`` (or if either of the lists were filled from generator level `modularAnalysis.fillParticleListFromMC`.) .. seealso:: :b2:var:`isMCDescendantOfList` to check daughters. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("mcParticleIsInMCList"));
3686)DOC", Manager::VariableDataType::c_bool)static Proxy _variableproxy3686(std::string("mcParticleIsInMCList(particleListName)"
), Variable::make_function(mcParticleIsInMCList), std::string
(R"DOC( Returns 1 if the particle's matched MC particle is also matched to a particle in ``particleListName`` (or if either of the lists were filled from generator level `modularAnalysis.fillParticleListFromMC`.) .. seealso:: :b2:var:`isMCDescendantOfList` to check daughters. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("mcParticleIsInMCList"));
;
3687
3688 REGISTER_METAVARIABLE("isGrandDaughterOfList(particleListNames)", isGrandDaughterOfList,static Proxy _variableproxy3689(std::string("isGrandDaughterOfList(particleListNames)"
), Variable::make_function(isGrandDaughterOfList), std::string
("Returns 1 if the given particle is a grand daughter of at least one of the particles in the given particle Lists."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isGrandDaughterOfList"));
3689 "Returns 1 if the given particle is a grand daughter of at least one of the particles in the given particle Lists.", Manager::VariableDataType::c_bool)static Proxy _variableproxy3689(std::string("isGrandDaughterOfList(particleListNames)"
), Variable::make_function(isGrandDaughterOfList), std::string
("Returns 1 if the given particle is a grand daughter of at least one of the particles in the given particle Lists."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("isGrandDaughterOfList"));
;
3690 REGISTER_METAVARIABLE("originalParticle(variable)", originalParticle, R"DOC(static Proxy _variableproxy3695(std::string("originalParticle(variable)"
), Variable::make_function(originalParticle), std::string(R"DOC( Returns value of variable for the original particle from which the given particle is copied. The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called. Returns NaN if the given particle is not copied and so there is no original particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("originalParticle"));
3691 Returns value of variable for the original particle from which the given particle is copied.static Proxy _variableproxy3695(std::string("originalParticle(variable)"
), Variable::make_function(originalParticle), std::string(R"DOC( Returns value of variable for the original particle from which the given particle is copied. The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called. Returns NaN if the given particle is not copied and so there is no original particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("originalParticle"));
3692
3693 The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called.static Proxy _variableproxy3695(std::string("originalParticle(variable)"
), Variable::make_function(originalParticle), std::string(R"DOC( Returns value of variable for the original particle from which the given particle is copied. The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called. Returns NaN if the given particle is not copied and so there is no original particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("originalParticle"));
3694 Returns NaN if the given particle is not copied and so there is no original particle.static Proxy _variableproxy3695(std::string("originalParticle(variable)"
), Variable::make_function(originalParticle), std::string(R"DOC( Returns value of variable for the original particle from which the given particle is copied. The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called. Returns NaN if the given particle is not copied and so there is no original particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("originalParticle"));
3695 )DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3695(std::string("originalParticle(variable)"
), Variable::make_function(originalParticle), std::string(R"DOC( Returns value of variable for the original particle from which the given particle is copied. The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called. Returns NaN if the given particle is not copied and so there is no original particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("originalParticle"));
;
3696 REGISTER_METAVARIABLE("daughter(i, variable)", daughter, R"DOC(static Proxy _variableproxy3703(std::string("daughter(i, variable)"
), Variable::make_function(daughter), std::string(R"DOC( Returns value of variable for the i-th daughter. E.g. * ``daughter(0, p)`` returns the total momentum of the first daughter. * ``daughter(0, daughter(1, p)`` returns the total momentum of the second daughter of the first daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughter"));
3697 Returns value of variable for the i-th daughter. E.g.static Proxy _variableproxy3703(std::string("daughter(i, variable)"
), Variable::make_function(daughter), std::string(R"DOC( Returns value of variable for the i-th daughter. E.g. * ``daughter(0, p)`` returns the total momentum of the first daughter. * ``daughter(0, daughter(1, p)`` returns the total momentum of the second daughter of the first daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughter"));
3698
3699 * ``daughter(0, p)`` returns the total momentum of the first daughter.static Proxy _variableproxy3703(std::string("daughter(i, variable)"
), Variable::make_function(daughter), std::string(R"DOC( Returns value of variable for the i-th daughter. E.g. * ``daughter(0, p)`` returns the total momentum of the first daughter. * ``daughter(0, daughter(1, p)`` returns the total momentum of the second daughter of the first daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughter"));
3700 * ``daughter(0, daughter(1, p)`` returns the total momentum of the second daughter of the first daughter.static Proxy _variableproxy3703(std::string("daughter(i, variable)"
), Variable::make_function(daughter), std::string(R"DOC( Returns value of variable for the i-th daughter. E.g. * ``daughter(0, p)`` returns the total momentum of the first daughter. * ``daughter(0, daughter(1, p)`` returns the total momentum of the second daughter of the first daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughter"));
3701
3702 Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters).static Proxy _variableproxy3703(std::string("daughter(i, variable)"
), Variable::make_function(daughter), std::string(R"DOC( Returns value of variable for the i-th daughter. E.g. * ``daughter(0, p)`` returns the total momentum of the first daughter. * ``daughter(0, daughter(1, p)`` returns the total momentum of the second daughter of the first daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughter"));
3703 )DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3703(std::string("daughter(i, variable)"
), Variable::make_function(daughter), std::string(R"DOC( Returns value of variable for the i-th daughter. E.g. * ``daughter(0, p)`` returns the total momentum of the first daughter. * ``daughter(0, daughter(1, p)`` returns the total momentum of the second daughter of the first daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughter"));
;
3704 REGISTER_METAVARIABLE("originalDaughter(i, variable)", originalDaughter, R"DOC(static Proxy _variableproxy3711(std::string("originalDaughter(i, variable)"
), Variable::make_function(originalDaughter), std::string(R"DOC( Returns value of variable for the original particle from which the i-th daughter is copied. The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called. Returns NaN if the daughter is not copied and so there is no original daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("originalDaughter"));
3705 Returns value of variable for the original particle from which the i-th daughter is copied.static Proxy _variableproxy3711(std::string("originalDaughter(i, variable)"
), Variable::make_function(originalDaughter), std::string(R"DOC( Returns value of variable for the original particle from which the i-th daughter is copied. The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called. Returns NaN if the daughter is not copied and so there is no original daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("originalDaughter"));
3706
3707 The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called.static Proxy _variableproxy3711(std::string("originalDaughter(i, variable)"
), Variable::make_function(originalDaughter), std::string(R"DOC( Returns value of variable for the original particle from which the i-th daughter is copied. The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called. Returns NaN if the daughter is not copied and so there is no original daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("originalDaughter"));
3708 Returns NaN if the daughter is not copied and so there is no original daughter.static Proxy _variableproxy3711(std::string("originalDaughter(i, variable)"
), Variable::make_function(originalDaughter), std::string(R"DOC( Returns value of variable for the original particle from which the i-th daughter is copied. The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called. Returns NaN if the daughter is not copied and so there is no original daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("originalDaughter"));
3709
3710 Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters).static Proxy _variableproxy3711(std::string("originalDaughter(i, variable)"
), Variable::make_function(originalDaughter), std::string(R"DOC( Returns value of variable for the original particle from which the i-th daughter is copied. The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called. Returns NaN if the daughter is not copied and so there is no original daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("originalDaughter"));
3711 )DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3711(std::string("originalDaughter(i, variable)"
), Variable::make_function(originalDaughter), std::string(R"DOC( Returns value of variable for the original particle from which the i-th daughter is copied. The copy of particle is created, for example, when the vertex fit updates the daughters and `modularAnalysis.copyParticles` is called. Returns NaN if the daughter is not copied and so there is no original daughter. Returns NaN if particle is nullptr or if the given daughter-index is out of bound (>= amount of daughters). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("originalDaughter"));
;
3712 REGISTER_METAVARIABLE("mcDaughter(i, variable)", mcDaughter, R"DOC(static Proxy _variableproxy3722(std::string("mcDaughter(i, variable)"
), Variable::make_function(mcDaughter), std::string(R"DOC( Returns the value of the requested variable for the i-th Monte Carlo daughter of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the i-th MC daughter does not exist. E.g. ``mcDaughter(0, PDG)`` will return the PDG code of the first MC daughter of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcDaughter(0, mcDaughter(1, PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughter"));
3713 Returns the value of the requested variable for the i-th Monte Carlo daughter of the particle.static Proxy _variableproxy3722(std::string("mcDaughter(i, variable)"
), Variable::make_function(mcDaughter), std::string(R"DOC( Returns the value of the requested variable for the i-th Monte Carlo daughter of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the i-th MC daughter does not exist. E.g. ``mcDaughter(0, PDG)`` will return the PDG code of the first MC daughter of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcDaughter(0, mcDaughter(1, PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughter"));
3714
3715 Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle,static Proxy _variableproxy3722(std::string("mcDaughter(i, variable)"
), Variable::make_function(mcDaughter), std::string(R"DOC( Returns the value of the requested variable for the i-th Monte Carlo daughter of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the i-th MC daughter does not exist. E.g. ``mcDaughter(0, PDG)`` will return the PDG code of the first MC daughter of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcDaughter(0, mcDaughter(1, PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughter"));
3716 or if the i-th MC daughter does not exist.static Proxy _variableproxy3722(std::string("mcDaughter(i, variable)"
), Variable::make_function(mcDaughter), std::string(R"DOC( Returns the value of the requested variable for the i-th Monte Carlo daughter of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the i-th MC daughter does not exist. E.g. ``mcDaughter(0, PDG)`` will return the PDG code of the first MC daughter of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcDaughter(0, mcDaughter(1, PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughter"));
3717
3718 E.g. ``mcDaughter(0, PDG)`` will return the PDG code of the first MC daughter of the matched MCstatic Proxy _variableproxy3722(std::string("mcDaughter(i, variable)"
), Variable::make_function(mcDaughter), std::string(R"DOC( Returns the value of the requested variable for the i-th Monte Carlo daughter of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the i-th MC daughter does not exist. E.g. ``mcDaughter(0, PDG)`` will return the PDG code of the first MC daughter of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcDaughter(0, mcDaughter(1, PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughter"));
3719 particle of the reconstructed particle the function is applied to.static Proxy _variableproxy3722(std::string("mcDaughter(i, variable)"
), Variable::make_function(mcDaughter), std::string(R"DOC( Returns the value of the requested variable for the i-th Monte Carlo daughter of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the i-th MC daughter does not exist. E.g. ``mcDaughter(0, PDG)`` will return the PDG code of the first MC daughter of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcDaughter(0, mcDaughter(1, PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughter"));
3720
3721 The meta variable can also be nested: ``mcDaughter(0, mcDaughter(1, PDG))``.static Proxy _variableproxy3722(std::string("mcDaughter(i, variable)"
), Variable::make_function(mcDaughter), std::string(R"DOC( Returns the value of the requested variable for the i-th Monte Carlo daughter of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the i-th MC daughter does not exist. E.g. ``mcDaughter(0, PDG)`` will return the PDG code of the first MC daughter of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcDaughter(0, mcDaughter(1, PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughter"));
3722 )DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3722(std::string("mcDaughter(i, variable)"
), Variable::make_function(mcDaughter), std::string(R"DOC( Returns the value of the requested variable for the i-th Monte Carlo daughter of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the i-th MC daughter does not exist. E.g. ``mcDaughter(0, PDG)`` will return the PDG code of the first MC daughter of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcDaughter(0, mcDaughter(1, PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughter"));
;
3723 REGISTER_METAVARIABLE("mcMother(variable)", mcMother, R"DOC(static Proxy _variableproxy3733(std::string("mcMother(variable)"
), Variable::make_function(mcMother), std::string(R"DOC( Returns the value of the requested variable for the Monte Carlo mother of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the MC mother does not exist. E.g. ``mcMother(PDG)`` will return the PDG code of the MC mother of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcMother(mcMother(PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcMother"));
3724 Returns the value of the requested variable for the Monte Carlo mother of the particle.static Proxy _variableproxy3733(std::string("mcMother(variable)"
), Variable::make_function(mcMother), std::string(R"DOC( Returns the value of the requested variable for the Monte Carlo mother of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the MC mother does not exist. E.g. ``mcMother(PDG)`` will return the PDG code of the MC mother of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcMother(mcMother(PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcMother"));
3725
3726 Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle,static Proxy _variableproxy3733(std::string("mcMother(variable)"
), Variable::make_function(mcMother), std::string(R"DOC( Returns the value of the requested variable for the Monte Carlo mother of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the MC mother does not exist. E.g. ``mcMother(PDG)`` will return the PDG code of the MC mother of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcMother(mcMother(PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcMother"));
3727 or if the MC mother does not exist.static Proxy _variableproxy3733(std::string("mcMother(variable)"
), Variable::make_function(mcMother), std::string(R"DOC( Returns the value of the requested variable for the Monte Carlo mother of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the MC mother does not exist. E.g. ``mcMother(PDG)`` will return the PDG code of the MC mother of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcMother(mcMother(PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcMother"));
3728
3729 E.g. ``mcMother(PDG)`` will return the PDG code of the MC mother of the matched MCstatic Proxy _variableproxy3733(std::string("mcMother(variable)"
), Variable::make_function(mcMother), std::string(R"DOC( Returns the value of the requested variable for the Monte Carlo mother of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the MC mother does not exist. E.g. ``mcMother(PDG)`` will return the PDG code of the MC mother of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcMother(mcMother(PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcMother"));
3730 particle of the reconstructed particle the function is applied to.static Proxy _variableproxy3733(std::string("mcMother(variable)"
), Variable::make_function(mcMother), std::string(R"DOC( Returns the value of the requested variable for the Monte Carlo mother of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the MC mother does not exist. E.g. ``mcMother(PDG)`` will return the PDG code of the MC mother of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcMother(mcMother(PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcMother"));
3731
3732 The meta variable can also be nested: ``mcMother(mcMother(PDG))``.static Proxy _variableproxy3733(std::string("mcMother(variable)"
), Variable::make_function(mcMother), std::string(R"DOC( Returns the value of the requested variable for the Monte Carlo mother of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the MC mother does not exist. E.g. ``mcMother(PDG)`` will return the PDG code of the MC mother of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcMother(mcMother(PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcMother"));
3733 )DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3733(std::string("mcMother(variable)"
), Variable::make_function(mcMother), std::string(R"DOC( Returns the value of the requested variable for the Monte Carlo mother of the particle. Returns NaN if the particle is nullptr, if the particle is not matched to an MC particle, or if the MC mother does not exist. E.g. ``mcMother(PDG)`` will return the PDG code of the MC mother of the matched MC particle of the reconstructed particle the function is applied to. The meta variable can also be nested: ``mcMother(mcMother(PDG))``. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcMother"));
;
3734 REGISTER_METAVARIABLE("genParticle(index, variable)", genParticle, R"DOC(static Proxy _variableproxy3742(std::string("genParticle(index, variable)"
), Variable::make_function(genParticle), std::string(R"DOC( [Eventbased] Returns the ``variable`` for the ith generator particle. The arguments of the function must be the ``index`` of the particle in the MCParticle Array, and ``variable``, the name of the function or variable for that generator particle. If ``index`` goes beyond the length of the MCParticles array, NaN will be returned. E.g. ``genParticle(0, p)`` returns the total momentum of the first MCParticle, which in a generic decay up to MC15 is the Upsilon(4S) and for MC16 and beyond the initial electron. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genParticle"));
3735[Eventbased] Returns the ``variable`` for the ith generator particle.static Proxy _variableproxy3742(std::string("genParticle(index, variable)"
), Variable::make_function(genParticle), std::string(R"DOC( [Eventbased] Returns the ``variable`` for the ith generator particle. The arguments of the function must be the ``index`` of the particle in the MCParticle Array, and ``variable``, the name of the function or variable for that generator particle. If ``index`` goes beyond the length of the MCParticles array, NaN will be returned. E.g. ``genParticle(0, p)`` returns the total momentum of the first MCParticle, which in a generic decay up to MC15 is the Upsilon(4S) and for MC16 and beyond the initial electron. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genParticle"));
3736The arguments of the function must be the ``index`` of the particle in the MCParticle Array,static Proxy _variableproxy3742(std::string("genParticle(index, variable)"
), Variable::make_function(genParticle), std::string(R"DOC( [Eventbased] Returns the ``variable`` for the ith generator particle. The arguments of the function must be the ``index`` of the particle in the MCParticle Array, and ``variable``, the name of the function or variable for that generator particle. If ``index`` goes beyond the length of the MCParticles array, NaN will be returned. E.g. ``genParticle(0, p)`` returns the total momentum of the first MCParticle, which in a generic decay up to MC15 is the Upsilon(4S) and for MC16 and beyond the initial electron. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genParticle"));
3737and ``variable``, the name of the function or variable for that generator particle.static Proxy _variableproxy3742(std::string("genParticle(index, variable)"
), Variable::make_function(genParticle), std::string(R"DOC( [Eventbased] Returns the ``variable`` for the ith generator particle. The arguments of the function must be the ``index`` of the particle in the MCParticle Array, and ``variable``, the name of the function or variable for that generator particle. If ``index`` goes beyond the length of the MCParticles array, NaN will be returned. E.g. ``genParticle(0, p)`` returns the total momentum of the first MCParticle, which in a generic decay up to MC15 is the Upsilon(4S) and for MC16 and beyond the initial electron. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genParticle"));
3738If ``index`` goes beyond the length of the MCParticles array, NaN will be returned.static Proxy _variableproxy3742(std::string("genParticle(index, variable)"
), Variable::make_function(genParticle), std::string(R"DOC( [Eventbased] Returns the ``variable`` for the ith generator particle. The arguments of the function must be the ``index`` of the particle in the MCParticle Array, and ``variable``, the name of the function or variable for that generator particle. If ``index`` goes beyond the length of the MCParticles array, NaN will be returned. E.g. ``genParticle(0, p)`` returns the total momentum of the first MCParticle, which in a generic decay up to MC15 is the Upsilon(4S) and for MC16 and beyond the initial electron. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genParticle"));
3739
3740E.g. ``genParticle(0, p)`` returns the total momentum of the first MCParticle, which in a generic decay up to MC15 isstatic Proxy _variableproxy3742(std::string("genParticle(index, variable)"
), Variable::make_function(genParticle), std::string(R"DOC( [Eventbased] Returns the ``variable`` for the ith generator particle. The arguments of the function must be the ``index`` of the particle in the MCParticle Array, and ``variable``, the name of the function or variable for that generator particle. If ``index`` goes beyond the length of the MCParticles array, NaN will be returned. E.g. ``genParticle(0, p)`` returns the total momentum of the first MCParticle, which in a generic decay up to MC15 is the Upsilon(4S) and for MC16 and beyond the initial electron. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genParticle"));
3741the Upsilon(4S) and for MC16 and beyond the initial electron.static Proxy _variableproxy3742(std::string("genParticle(index, variable)"
), Variable::make_function(genParticle), std::string(R"DOC( [Eventbased] Returns the ``variable`` for the ith generator particle. The arguments of the function must be the ``index`` of the particle in the MCParticle Array, and ``variable``, the name of the function or variable for that generator particle. If ``index`` goes beyond the length of the MCParticles array, NaN will be returned. E.g. ``genParticle(0, p)`` returns the total momentum of the first MCParticle, which in a generic decay up to MC15 is the Upsilon(4S) and for MC16 and beyond the initial electron. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genParticle"));
3742)DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3742(std::string("genParticle(index, variable)"
), Variable::make_function(genParticle), std::string(R"DOC( [Eventbased] Returns the ``variable`` for the ith generator particle. The arguments of the function must be the ``index`` of the particle in the MCParticle Array, and ``variable``, the name of the function or variable for that generator particle. If ``index`` goes beyond the length of the MCParticles array, NaN will be returned. E.g. ``genParticle(0, p)`` returns the total momentum of the first MCParticle, which in a generic decay up to MC15 is the Upsilon(4S) and for MC16 and beyond the initial electron. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genParticle"));
;
3743 REGISTER_METAVARIABLE("genUpsilon4S(variable)", genUpsilon4S, R"DOC(static Proxy _variableproxy3750(std::string("genUpsilon4S(variable)"
), Variable::make_function(genUpsilon4S), std::string(R"DOC( [Eventbased] Returns the ``variable`` evaluated for the generator-level :math:`\Upsilon(4S)`. If no generator level :math:`\Upsilon(4S)` exists for the event, NaN will be returned. E.g. ``genUpsilon4S(p)`` returns the total momentum of the :math:`\Upsilon(4S)` in a generic decay. ``genUpsilon4S(mcDaughter(1, p))`` returns the total momentum of the second daughter of the generator-level :math:`\Upsilon(4S)` (i.e. the momentum of the second B meson in a generic decay). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genUpsilon4S"));
3744[Eventbased] Returns the ``variable`` evaluated for the generator-level :math:`\Upsilon(4S)`.static Proxy _variableproxy3750(std::string("genUpsilon4S(variable)"
), Variable::make_function(genUpsilon4S), std::string(R"DOC( [Eventbased] Returns the ``variable`` evaluated for the generator-level :math:`\Upsilon(4S)`. If no generator level :math:`\Upsilon(4S)` exists for the event, NaN will be returned. E.g. ``genUpsilon4S(p)`` returns the total momentum of the :math:`\Upsilon(4S)` in a generic decay. ``genUpsilon4S(mcDaughter(1, p))`` returns the total momentum of the second daughter of the generator-level :math:`\Upsilon(4S)` (i.e. the momentum of the second B meson in a generic decay). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genUpsilon4S"));
3745If no generator level :math:`\Upsilon(4S)` exists for the event, NaN will be returned.static Proxy _variableproxy3750(std::string("genUpsilon4S(variable)"
), Variable::make_function(genUpsilon4S), std::string(R"DOC( [Eventbased] Returns the ``variable`` evaluated for the generator-level :math:`\Upsilon(4S)`. If no generator level :math:`\Upsilon(4S)` exists for the event, NaN will be returned. E.g. ``genUpsilon4S(p)`` returns the total momentum of the :math:`\Upsilon(4S)` in a generic decay. ``genUpsilon4S(mcDaughter(1, p))`` returns the total momentum of the second daughter of the generator-level :math:`\Upsilon(4S)` (i.e. the momentum of the second B meson in a generic decay). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genUpsilon4S"));
3746
3747E.g. ``genUpsilon4S(p)`` returns the total momentum of the :math:`\Upsilon(4S)` in a generic decay.static Proxy _variableproxy3750(std::string("genUpsilon4S(variable)"
), Variable::make_function(genUpsilon4S), std::string(R"DOC( [Eventbased] Returns the ``variable`` evaluated for the generator-level :math:`\Upsilon(4S)`. If no generator level :math:`\Upsilon(4S)` exists for the event, NaN will be returned. E.g. ``genUpsilon4S(p)`` returns the total momentum of the :math:`\Upsilon(4S)` in a generic decay. ``genUpsilon4S(mcDaughter(1, p))`` returns the total momentum of the second daughter of the generator-level :math:`\Upsilon(4S)` (i.e. the momentum of the second B meson in a generic decay). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genUpsilon4S"));
3748``genUpsilon4S(mcDaughter(1, p))`` returns the total momentum of the second daughter of thestatic Proxy _variableproxy3750(std::string("genUpsilon4S(variable)"
), Variable::make_function(genUpsilon4S), std::string(R"DOC( [Eventbased] Returns the ``variable`` evaluated for the generator-level :math:`\Upsilon(4S)`. If no generator level :math:`\Upsilon(4S)` exists for the event, NaN will be returned. E.g. ``genUpsilon4S(p)`` returns the total momentum of the :math:`\Upsilon(4S)` in a generic decay. ``genUpsilon4S(mcDaughter(1, p))`` returns the total momentum of the second daughter of the generator-level :math:`\Upsilon(4S)` (i.e. the momentum of the second B meson in a generic decay). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genUpsilon4S"));
3749generator-level :math:`\Upsilon(4S)` (i.e. the momentum of the second B meson in a generic decay).static Proxy _variableproxy3750(std::string("genUpsilon4S(variable)"
), Variable::make_function(genUpsilon4S), std::string(R"DOC( [Eventbased] Returns the ``variable`` evaluated for the generator-level :math:`\Upsilon(4S)`. If no generator level :math:`\Upsilon(4S)` exists for the event, NaN will be returned. E.g. ``genUpsilon4S(p)`` returns the total momentum of the :math:`\Upsilon(4S)` in a generic decay. ``genUpsilon4S(mcDaughter(1, p))`` returns the total momentum of the second daughter of the generator-level :math:`\Upsilon(4S)` (i.e. the momentum of the second B meson in a generic decay). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genUpsilon4S"));
3750)DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3750(std::string("genUpsilon4S(variable)"
), Variable::make_function(genUpsilon4S), std::string(R"DOC( [Eventbased] Returns the ``variable`` evaluated for the generator-level :math:`\Upsilon(4S)`. If no generator level :math:`\Upsilon(4S)` exists for the event, NaN will be returned. E.g. ``genUpsilon4S(p)`` returns the total momentum of the :math:`\Upsilon(4S)` in a generic decay. ``genUpsilon4S(mcDaughter(1, p))`` returns the total momentum of the second daughter of the generator-level :math:`\Upsilon(4S)` (i.e. the momentum of the second B meson in a generic decay). )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("genUpsilon4S"));
;
3751 REGISTER_METAVARIABLE("daughterProductOf(variable)", daughterProductOf,static Proxy _variableproxy3753(std::string("daughterProductOf(variable)"
), Variable::make_function(daughterProductOf), std::string("Returns product of a variable over all daughters.\n"
"E.g. ``daughterProductOf(extraInfo(SignalProbability))`` returns the product of the SignalProbabilitys of all daughters."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterProductOf"));
3752 "Returns product of a variable over all daughters.\n"static Proxy _variableproxy3753(std::string("daughterProductOf(variable)"
), Variable::make_function(daughterProductOf), std::string("Returns product of a variable over all daughters.\n"
"E.g. ``daughterProductOf(extraInfo(SignalProbability))`` returns the product of the SignalProbabilitys of all daughters."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterProductOf"));
3753 "E.g. ``daughterProductOf(extraInfo(SignalProbability))`` returns the product of the SignalProbabilitys of all daughters.", Manager::VariableDataType::c_double)static Proxy _variableproxy3753(std::string("daughterProductOf(variable)"
), Variable::make_function(daughterProductOf), std::string("Returns product of a variable over all daughters.\n"
"E.g. ``daughterProductOf(extraInfo(SignalProbability))`` returns the product of the SignalProbabilitys of all daughters."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterProductOf"));
;
3754 REGISTER_METAVARIABLE("daughterSumOf(variable)", daughterSumOf,static Proxy _variableproxy3756(std::string("daughterSumOf(variable)"
), Variable::make_function(daughterSumOf), std::string("Returns sum of a variable over all daughters.\n"
"E.g. ``daughterSumOf(nDaughters)`` returns the number of grand-daughters."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterSumOf"));
3755 "Returns sum of a variable over all daughters.\n"static Proxy _variableproxy3756(std::string("daughterSumOf(variable)"
), Variable::make_function(daughterSumOf), std::string("Returns sum of a variable over all daughters.\n"
"E.g. ``daughterSumOf(nDaughters)`` returns the number of grand-daughters."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterSumOf"));
3756 "E.g. ``daughterSumOf(nDaughters)`` returns the number of grand-daughters.", Manager::VariableDataType::c_double)static Proxy _variableproxy3756(std::string("daughterSumOf(variable)"
), Variable::make_function(daughterSumOf), std::string("Returns sum of a variable over all daughters.\n"
"E.g. ``daughterSumOf(nDaughters)`` returns the number of grand-daughters."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterSumOf"));
;
3757 REGISTER_METAVARIABLE("daughterLowest(variable)", daughterLowest,static Proxy _variableproxy3759(std::string("daughterLowest(variable)"
), Variable::make_function(daughterLowest), std::string("Returns the lowest value of the given variable among all daughters.\n"
"E.g. ``useCMSFrame(daughterLowest(p))`` returns the lowest momentum in CMS frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterLowest"));
3758 "Returns the lowest value of the given variable among all daughters.\n"static Proxy _variableproxy3759(std::string("daughterLowest(variable)"
), Variable::make_function(daughterLowest), std::string("Returns the lowest value of the given variable among all daughters.\n"
"E.g. ``useCMSFrame(daughterLowest(p))`` returns the lowest momentum in CMS frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterLowest"));
3759 "E.g. ``useCMSFrame(daughterLowest(p))`` returns the lowest momentum in CMS frame.", Manager::VariableDataType::c_double)static Proxy _variableproxy3759(std::string("daughterLowest(variable)"
), Variable::make_function(daughterLowest), std::string("Returns the lowest value of the given variable among all daughters.\n"
"E.g. ``useCMSFrame(daughterLowest(p))`` returns the lowest momentum in CMS frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterLowest"));
;
3760 REGISTER_METAVARIABLE("daughterHighest(variable)", daughterHighest,static Proxy _variableproxy3762(std::string("daughterHighest(variable)"
), Variable::make_function(daughterHighest), std::string("Returns the highest value of the given variable among all daughters.\n"
"E.g. ``useCMSFrame(daughterHighest(p))`` returns the highest momentum in CMS frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterHighest"));
3761 "Returns the highest value of the given variable among all daughters.\n"static Proxy _variableproxy3762(std::string("daughterHighest(variable)"
), Variable::make_function(daughterHighest), std::string("Returns the highest value of the given variable among all daughters.\n"
"E.g. ``useCMSFrame(daughterHighest(p))`` returns the highest momentum in CMS frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterHighest"));
3762 "E.g. ``useCMSFrame(daughterHighest(p))`` returns the highest momentum in CMS frame.", Manager::VariableDataType::c_double)static Proxy _variableproxy3762(std::string("daughterHighest(variable)"
), Variable::make_function(daughterHighest), std::string("Returns the highest value of the given variable among all daughters.\n"
"E.g. ``useCMSFrame(daughterHighest(p))`` returns the highest momentum in CMS frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterHighest"));
;
3763 REGISTER_METAVARIABLE("daughterDiffOf(daughterIndex_i, daughterIndex_j, variable)", daughterDiffOf, R"DOC(static Proxy _variableproxy3772(std::string("daughterDiffOf(daughterIndex_i, daughterIndex_j, variable)"
), Variable::make_function(daughterDiffOf), std::string(R"DOC( Returns the difference of a variable between the two given daughters. E.g. ``useRestFrame(daughterDiffOf(0, 1, p))`` returns the momentum difference between first and second daughter in the rest frame of the given particle. (That means that it returns :math:`p_j - p_i`) The daughters can be provided as generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1`` identifies the second daughter (1) of the first daughter (0) of the mother particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterDiffOf"));
3764 Returns the difference of a variable between the two given daughters.static Proxy _variableproxy3772(std::string("daughterDiffOf(daughterIndex_i, daughterIndex_j, variable)"
), Variable::make_function(daughterDiffOf), std::string(R"DOC( Returns the difference of a variable between the two given daughters. E.g. ``useRestFrame(daughterDiffOf(0, 1, p))`` returns the momentum difference between first and second daughter in the rest frame of the given particle. (That means that it returns :math:`p_j - p_i`) The daughters can be provided as generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1`` identifies the second daughter (1) of the first daughter (0) of the mother particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterDiffOf"));
3765 E.g. ``useRestFrame(daughterDiffOf(0, 1, p))`` returns the momentum difference between first and second daughter in the rest frame of the given particle.static Proxy _variableproxy3772(std::string("daughterDiffOf(daughterIndex_i, daughterIndex_j, variable)"
), Variable::make_function(daughterDiffOf), std::string(R"DOC( Returns the difference of a variable between the two given daughters. E.g. ``useRestFrame(daughterDiffOf(0, 1, p))`` returns the momentum difference between first and second daughter in the rest frame of the given particle. (That means that it returns :math:`p_j - p_i`) The daughters can be provided as generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1`` identifies the second daughter (1) of the first daughter (0) of the mother particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterDiffOf"));
3766 (That means that it returns :math:`p_j - p_i`)static Proxy _variableproxy3772(std::string("daughterDiffOf(daughterIndex_i, daughterIndex_j, variable)"
), Variable::make_function(daughterDiffOf), std::string(R"DOC( Returns the difference of a variable between the two given daughters. E.g. ``useRestFrame(daughterDiffOf(0, 1, p))`` returns the momentum difference between first and second daughter in the rest frame of the given particle. (That means that it returns :math:`p_j - p_i`) The daughters can be provided as generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1`` identifies the second daughter (1) of the first daughter (0) of the mother particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterDiffOf"));
3767
3768 The daughters can be provided as generalized daughter indexes, which are simply colon-separatedstatic Proxy _variableproxy3772(std::string("daughterDiffOf(daughterIndex_i, daughterIndex_j, variable)"
), Variable::make_function(daughterDiffOf), std::string(R"DOC( Returns the difference of a variable between the two given daughters. E.g. ``useRestFrame(daughterDiffOf(0, 1, p))`` returns the momentum difference between first and second daughter in the rest frame of the given particle. (That means that it returns :math:`p_j - p_i`) The daughters can be provided as generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1`` identifies the second daughter (1) of the first daughter (0) of the mother particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterDiffOf"));
3769 lists of daughter indexes, ordered starting from the root particle. For example, ``0:1``static Proxy _variableproxy3772(std::string("daughterDiffOf(daughterIndex_i, daughterIndex_j, variable)"
), Variable::make_function(daughterDiffOf), std::string(R"DOC( Returns the difference of a variable between the two given daughters. E.g. ``useRestFrame(daughterDiffOf(0, 1, p))`` returns the momentum difference between first and second daughter in the rest frame of the given particle. (That means that it returns :math:`p_j - p_i`) The daughters can be provided as generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1`` identifies the second daughter (1) of the first daughter (0) of the mother particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterDiffOf"));
3770 identifies the second daughter (1) of the first daughter (0) of the mother particle.static Proxy _variableproxy3772(std::string("daughterDiffOf(daughterIndex_i, daughterIndex_j, variable)"
), Variable::make_function(daughterDiffOf), std::string(R"DOC( Returns the difference of a variable between the two given daughters. E.g. ``useRestFrame(daughterDiffOf(0, 1, p))`` returns the momentum difference between first and second daughter in the rest frame of the given particle. (That means that it returns :math:`p_j - p_i`) The daughters can be provided as generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1`` identifies the second daughter (1) of the first daughter (0) of the mother particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterDiffOf"));
3771
3772 )DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3772(std::string("daughterDiffOf(daughterIndex_i, daughterIndex_j, variable)"
), Variable::make_function(daughterDiffOf), std::string(R"DOC( Returns the difference of a variable between the two given daughters. E.g. ``useRestFrame(daughterDiffOf(0, 1, p))`` returns the momentum difference between first and second daughter in the rest frame of the given particle. (That means that it returns :math:`p_j - p_i`) The daughters can be provided as generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1`` identifies the second daughter (1) of the first daughter (0) of the mother particle. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterDiffOf"));
;
3773 REGISTER_METAVARIABLE("mcDaughterDiffOf(i, j, variable)", mcDaughterDiffOf,static Proxy _variableproxy3774(std::string("mcDaughterDiffOf(i, j, variable)"
), Variable::make_function(mcDaughterDiffOf), std::string("MC matched version of the `daughterDiffOf` function."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughterDiffOf"));
3774 "MC matched version of the `daughterDiffOf` function.", Manager::VariableDataType::c_double)static Proxy _variableproxy3774(std::string("mcDaughterDiffOf(i, j, variable)"
), Variable::make_function(mcDaughterDiffOf), std::string("MC matched version of the `daughterDiffOf` function."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughterDiffOf"));
;
3775 REGISTER_METAVARIABLE("grandDaughterDiffOf(i, j, variable)", grandDaughterDiffOf,static Proxy _variableproxy3778(std::string("grandDaughterDiffOf(i, j, variable)"
), Variable::make_function(grandDaughterDiffOf), std::string(
"Returns the difference of a variable between the first daughters of the two given daughters.\n"
"E.g. ``useRestFrame(grandDaughterDiffOf(0, 1, p))`` returns the momentum difference between the first daughters of the first and second daughter in the rest frame of the given particle.\n"
"(That means that it returns :math:`p_j - p_i`)"), Variable::
Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("grandDaughterDiffOf"));
3776 "Returns the difference of a variable between the first daughters of the two given daughters.\n"static Proxy _variableproxy3778(std::string("grandDaughterDiffOf(i, j, variable)"
), Variable::make_function(grandDaughterDiffOf), std::string(
"Returns the difference of a variable between the first daughters of the two given daughters.\n"
"E.g. ``useRestFrame(grandDaughterDiffOf(0, 1, p))`` returns the momentum difference between the first daughters of the first and second daughter in the rest frame of the given particle.\n"
"(That means that it returns :math:`p_j - p_i`)"), Variable::
Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("grandDaughterDiffOf"));
3777 "E.g. ``useRestFrame(grandDaughterDiffOf(0, 1, p))`` returns the momentum difference between the first daughters of the first and second daughter in the rest frame of the given particle.\n"static Proxy _variableproxy3778(std::string("grandDaughterDiffOf(i, j, variable)"
), Variable::make_function(grandDaughterDiffOf), std::string(
"Returns the difference of a variable between the first daughters of the two given daughters.\n"
"E.g. ``useRestFrame(grandDaughterDiffOf(0, 1, p))`` returns the momentum difference between the first daughters of the first and second daughter in the rest frame of the given particle.\n"
"(That means that it returns :math:`p_j - p_i`)"), Variable::
Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("grandDaughterDiffOf"));
3778 "(That means that it returns :math:`p_j - p_i`)", Manager::VariableDataType::c_double)static Proxy _variableproxy3778(std::string("grandDaughterDiffOf(i, j, variable)"
), Variable::make_function(grandDaughterDiffOf), std::string(
"Returns the difference of a variable between the first daughters of the two given daughters.\n"
"E.g. ``useRestFrame(grandDaughterDiffOf(0, 1, p))`` returns the momentum difference between the first daughters of the first and second daughter in the rest frame of the given particle.\n"
"(That means that it returns :math:`p_j - p_i`)"), Variable::
Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("grandDaughterDiffOf"));
;
3779 MAKE_DEPRECATED("grandDaughterDiffOf", false, "light-2402-ocicat", R"DOC(static DeprecateProxy _deprecateproxy3781(std::string("grandDaughterDiffOf"
), bool(false), std::string("light-2402-ocicat"), std::string
(R"DOC( The difference between any combination of (grand-)daughters can be calculated with the more general variable :b2:var:`daughterDiffOf` by using generalized daughter indexes.)DOC"
));
3780 The difference between any combination of (grand-)daughters can be calculated with the more general variable :b2:var:`daughterDiffOf`static DeprecateProxy _deprecateproxy3781(std::string("grandDaughterDiffOf"
), bool(false), std::string("light-2402-ocicat"), std::string
(R"DOC( The difference between any combination of (grand-)daughters can be calculated with the more general variable :b2:var:`daughterDiffOf` by using generalized daughter indexes.)DOC"
));
3781 by using generalized daughter indexes.)DOC")static DeprecateProxy _deprecateproxy3781(std::string("grandDaughterDiffOf"
), bool(false), std::string("light-2402-ocicat"), std::string
(R"DOC( The difference between any combination of (grand-)daughters can be calculated with the more general variable :b2:var:`daughterDiffOf` by using generalized daughter indexes.)DOC"
));
;
3782 REGISTER_METAVARIABLE("daughterNormDiffOf(i, j, variable)", daughterNormDiffOf,static Proxy _variableproxy3784(std::string("daughterNormDiffOf(i, j, variable)"
), Variable::make_function(daughterNormDiffOf), std::string("Returns the normalized difference of a variable between the two given daughters.\n"
"E.g. ``daughterNormDiffOf(0, 1, p)`` returns the normalized momentum difference between first and second daughter in the lab frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterNormDiffOf"));
3783 "Returns the normalized difference of a variable between the two given daughters.\n"static Proxy _variableproxy3784(std::string("daughterNormDiffOf(i, j, variable)"
), Variable::make_function(daughterNormDiffOf), std::string("Returns the normalized difference of a variable between the two given daughters.\n"
"E.g. ``daughterNormDiffOf(0, 1, p)`` returns the normalized momentum difference between first and second daughter in the lab frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterNormDiffOf"));
3784 "E.g. ``daughterNormDiffOf(0, 1, p)`` returns the normalized momentum difference between first and second daughter in the lab frame.", Manager::VariableDataType::c_double)static Proxy _variableproxy3784(std::string("daughterNormDiffOf(i, j, variable)"
), Variable::make_function(daughterNormDiffOf), std::string("Returns the normalized difference of a variable between the two given daughters.\n"
"E.g. ``daughterNormDiffOf(0, 1, p)`` returns the normalized momentum difference between first and second daughter in the lab frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterNormDiffOf"));
;
3785 REGISTER_METAVARIABLE("daughterMotherDiffOf(i, variable)", daughterMotherDiffOf,static Proxy _variableproxy3787(std::string("daughterMotherDiffOf(i, variable)"
), Variable::make_function(daughterMotherDiffOf), std::string
("Returns the difference of a variable between the given daughter and the mother particle itself.\n"
"E.g. ``useRestFrame(daughterMotherDiffOf(0, p))`` returns the momentum difference between the given particle and its first daughter in the rest frame of the mother."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterMotherDiffOf"));
3786 "Returns the difference of a variable between the given daughter and the mother particle itself.\n"static Proxy _variableproxy3787(std::string("daughterMotherDiffOf(i, variable)"
), Variable::make_function(daughterMotherDiffOf), std::string
("Returns the difference of a variable between the given daughter and the mother particle itself.\n"
"E.g. ``useRestFrame(daughterMotherDiffOf(0, p))`` returns the momentum difference between the given particle and its first daughter in the rest frame of the mother."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterMotherDiffOf"));
3787 "E.g. ``useRestFrame(daughterMotherDiffOf(0, p))`` returns the momentum difference between the given particle and its first daughter in the rest frame of the mother.", Manager::VariableDataType::c_double)static Proxy _variableproxy3787(std::string("daughterMotherDiffOf(i, variable)"
), Variable::make_function(daughterMotherDiffOf), std::string
("Returns the difference of a variable between the given daughter and the mother particle itself.\n"
"E.g. ``useRestFrame(daughterMotherDiffOf(0, p))`` returns the momentum difference between the given particle and its first daughter in the rest frame of the mother."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterMotherDiffOf"));
;
3788 REGISTER_METAVARIABLE("daughterMotherNormDiffOf(i, variable)", daughterMotherNormDiffOf,static Proxy _variableproxy3790(std::string("daughterMotherNormDiffOf(i, variable)"
), Variable::make_function(daughterMotherNormDiffOf), std::string
("Returns the normalized difference of a variable between the given daughter and the mother particle itself.\n"
"E.g. ``daughterMotherNormDiffOf(1, p)`` returns the normalized momentum difference between the given particle and its second daughter in the lab frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterMotherNormDiffOf"));
3789 "Returns the normalized difference of a variable between the given daughter and the mother particle itself.\n"static Proxy _variableproxy3790(std::string("daughterMotherNormDiffOf(i, variable)"
), Variable::make_function(daughterMotherNormDiffOf), std::string
("Returns the normalized difference of a variable between the given daughter and the mother particle itself.\n"
"E.g. ``daughterMotherNormDiffOf(1, p)`` returns the normalized momentum difference between the given particle and its second daughter in the lab frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterMotherNormDiffOf"));
3790 "E.g. ``daughterMotherNormDiffOf(1, p)`` returns the normalized momentum difference between the given particle and its second daughter in the lab frame.", Manager::VariableDataType::c_double)static Proxy _variableproxy3790(std::string("daughterMotherNormDiffOf(i, variable)"
), Variable::make_function(daughterMotherNormDiffOf), std::string
("Returns the normalized difference of a variable between the given daughter and the mother particle itself.\n"
"E.g. ``daughterMotherNormDiffOf(1, p)`` returns the normalized momentum difference between the given particle and its second daughter in the lab frame."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterMotherNormDiffOf"));
;
3791 REGISTER_METAVARIABLE("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )", angleBetweenDaughterAndRecoil, R"DOC(static Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3792 Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters.static Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3793 The unit of the angle is ``rad``.static Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3794
3795 The particles are identified via generalized daughter indexes, which are simply colon-separated lists ofstatic Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3796 daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourthstatic Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3797 daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simplystatic Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3798 identifies the second daughter of the root particle.static Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3799
3800 At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``.static Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3801
3802 .. tip::static Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3803 ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter.static Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3804
3805 ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter.static Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3806
3807 ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, andstatic Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
3808 the first daughter of the fourth daughter.)DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3808(std::string("angleBetweenDaughterAndRecoil(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndRecoil), std
::string(R"DOC( Returns the angle between the momentum recoiling against the particle and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndRecoil``. .. tip:: ``angleBetweenDaughterAndRecoil(0)`` will return the angle between pRecoil and the momentum of the first daughter. ``angleBetweenDaughterAndRecoil(0, 1)`` will return the angle between pRecoil and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndRecoil(0:0, 3:0)`` will return the angle between pRecoil and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndRecoil"));
;
3809 REGISTER_METAVARIABLE("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )", angleBetweenDaughterAndMissingMomentum, R"DOC(static Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3810 Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters.static Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3811 The unit of the angle is ``rad``. EventKinematics module has to be called to use this.static Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3812
3813 The particles are identified via generalized daughter indexes, which are simply colon-separated lists ofstatic Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3814 daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourthstatic Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3815 daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simplystatic Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3816 identifies the second daughter of the root particle.static Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3817
3818 At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``.static Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3819
3820 .. tip::static Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3821 ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter.static Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3822
3823 ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter.static Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3824
3825 ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, andstatic Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
3826 the first daughter of the fourth daughter.)DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3826(std::string("angleBetweenDaughterAndMissingMomentum(daughterIndex_1, daughterIndex_2, ... )"
), Variable::make_function(angleBetweenDaughterAndMissingMomentum
), std::string(R"DOC( Returns the angle between the missing momentum in the event and the sum of the momenta of the given daughters. The unit of the angle is ``rad``. EventKinematics module has to be called to use this. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. At least one generalized index has to be given to ``angleBetweenDaughterAndMissingMomentum``. .. tip:: ``angleBetweenDaughterAndMissingMomentum(0)`` will return the angle between missMom and the momentum of the first daughter. ``angleBetweenDaughterAndMissingMomentum(0, 1)`` will return the angle between missMom and the sum of the momenta of the first and second daughter. ``angleBetweenDaughterAndMissingMomentum(0:0, 3:0)`` will return the angle between missMom and the sum of the momenta of the: first daughter of the first daughter, and the first daughter of the fourth daughter.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleBetweenDaughterAndMissingMomentum"
));
;
3827 REGISTER_METAVARIABLE("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])", daughterAngle, R"DOC(static Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3828 Returns the angle in between any pair of particles belonging to the same decay tree.static Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3829 The unit of the angle is ``rad``.static Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3830
3831 The particles are identified via generalized daughter indexes, which are simply colon-separated lists ofstatic Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3832 daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourthstatic Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3833 daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simplystatic Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3834 identifies the second daughter of the root particle.static Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3835
3836 Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, thestatic Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3837 variable returns the angle between the momenta of the two given particles. If three indices are given, thestatic Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3838 variable returns the angle between the momentum of the third particle and a vector which is the sum of thestatic Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3839 first two daughter momenta.static Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3840
3841 .. tip::static Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3842 ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter.static Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3843 ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first andstatic Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3844 second daughter.static Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3845 ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, andstatic Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3846 the first daughter of the fourth daughter.static Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
3847
3848 )DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3848(std::string("daughterAngle(daughterIndex_1, daughterIndex_2[, daughterIndex_3])"
), Variable::make_function(daughterAngle), std::string(R"DOC( Returns the angle in between any pair of particles belonging to the same decay tree. The unit of the angle is ``rad``. The particles are identified via generalized daughter indexes, which are simply colon-separated lists of daughter indexes, ordered starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. ``1`` simply identifies the second daughter of the root particle. Both two and three generalized indexes can be given to ``daughterAngle``. If two indices are given, the variable returns the angle between the momenta of the two given particles. If three indices are given, the variable returns the angle between the momentum of the third particle and a vector which is the sum of the first two daughter momenta. .. tip:: ``daughterAngle(0, 3)`` will return the angle between the first and fourth daughter. ``daughterAngle(0, 1, 3)`` will return the angle between the fourth daughter and the sum of the first and second daughter. ``daughterAngle(0:0, 3:0)`` will return the angle between the first daughter of the first daughter, and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterAngle"));
;
3849 REGISTER_METAVARIABLE("mcDaughterAngle(daughterIndex_1, daughterIndex_2, [daughterIndex_3])", mcDaughterAngle,static Proxy _variableproxy3850(std::string("mcDaughterAngle(daughterIndex_1, daughterIndex_2, [daughterIndex_3])"
), Variable::make_function(mcDaughterAngle), std::string("MC matched version of the `daughterAngle` function. Also works if applied directly to MC particles. The unit of the angle is ``rad``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughterAngle"));
3850 "MC matched version of the `daughterAngle` function. Also works if applied directly to MC particles. The unit of the angle is ``rad``", Manager::VariableDataType::c_double)static Proxy _variableproxy3850(std::string("mcDaughterAngle(daughterIndex_1, daughterIndex_2, [daughterIndex_3])"
), Variable::make_function(mcDaughterAngle), std::string("MC matched version of the `daughterAngle` function. Also works if applied directly to MC particles. The unit of the angle is ``rad``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mcDaughterAngle"));
;
3851 REGISTER_VARIABLE("grandDaughterDecayAngle(i, j)", grandDaughterDecayAngle,static Proxy _variableproxy3854(std::string("grandDaughterDecayAngle(i, j)"
), Variable::make_function(grandDaughterDecayAngle), std::string
("Returns the decay angle of the granddaughter in the daughter particle's rest frame.\n"
"It is calculated with respect to the reverted momentum vector of the particle.\n"
"Two arguments representing the daughter and granddaughter indices have to be provided as arguments.\n\n"
), Variable::get_function_type("grandDaughterDecayAngle(i, j)"
,grandDaughterDecayAngle), std::string("rad"), std::string("grandDaughterDecayAngle"
));
3852 "Returns the decay angle of the granddaughter in the daughter particle's rest frame.\n"static Proxy _variableproxy3854(std::string("grandDaughterDecayAngle(i, j)"
), Variable::make_function(grandDaughterDecayAngle), std::string
("Returns the decay angle of the granddaughter in the daughter particle's rest frame.\n"
"It is calculated with respect to the reverted momentum vector of the particle.\n"
"Two arguments representing the daughter and granddaughter indices have to be provided as arguments.\n\n"
), Variable::get_function_type("grandDaughterDecayAngle(i, j)"
,grandDaughterDecayAngle), std::string("rad"), std::string("grandDaughterDecayAngle"
));
3853 "It is calculated with respect to the reverted momentum vector of the particle.\n"static Proxy _variableproxy3854(std::string("grandDaughterDecayAngle(i, j)"
), Variable::make_function(grandDaughterDecayAngle), std::string
("Returns the decay angle of the granddaughter in the daughter particle's rest frame.\n"
"It is calculated with respect to the reverted momentum vector of the particle.\n"
"Two arguments representing the daughter and granddaughter indices have to be provided as arguments.\n\n"
), Variable::get_function_type("grandDaughterDecayAngle(i, j)"
,grandDaughterDecayAngle), std::string("rad"), std::string("grandDaughterDecayAngle"
));
3854 "Two arguments representing the daughter and granddaughter indices have to be provided as arguments.\n\n", "rad")static Proxy _variableproxy3854(std::string("grandDaughterDecayAngle(i, j)"
), Variable::make_function(grandDaughterDecayAngle), std::string
("Returns the decay angle of the granddaughter in the daughter particle's rest frame.\n"
"It is calculated with respect to the reverted momentum vector of the particle.\n"
"Two arguments representing the daughter and granddaughter indices have to be provided as arguments.\n\n"
), Variable::get_function_type("grandDaughterDecayAngle(i, j)"
,grandDaughterDecayAngle), std::string("rad"), std::string("grandDaughterDecayAngle"
));
;
3855 REGISTER_VARIABLE("daughterClusterAngleInBetween(i, j)", daughterClusterAngleInBetween,static Proxy _variableproxy3861(std::string("daughterClusterAngleInBetween(i, j)"
), Variable::make_function(daughterClusterAngleInBetween), std
::string("Returns the angle between clusters associated to the two daughters."
"If two indices given: returns the angle between the momenta of the clusters associated to the two given daughters."
"If three indices given: returns the angle between the momentum of the third particle's cluster and a vector "
"which is the sum of the first two daughter's cluster momenta."
"Returns nan if any of the daughters specified don't have an associated cluster."
"The arguments in the argument vector must be integers corresponding to the ith and jth (and kth) daughters.\n\n"
), Variable::get_function_type("daughterClusterAngleInBetween(i, j)"
,daughterClusterAngleInBetween), std::string("rad"), std::string
("daughterClusterAngleInBetween"));
3856 "Returns the angle between clusters associated to the two daughters."static Proxy _variableproxy3861(std::string("daughterClusterAngleInBetween(i, j)"
), Variable::make_function(daughterClusterAngleInBetween), std
::string("Returns the angle between clusters associated to the two daughters."
"If two indices given: returns the angle between the momenta of the clusters associated to the two given daughters."
"If three indices given: returns the angle between the momentum of the third particle's cluster and a vector "
"which is the sum of the first two daughter's cluster momenta."
"Returns nan if any of the daughters specified don't have an associated cluster."
"The arguments in the argument vector must be integers corresponding to the ith and jth (and kth) daughters.\n\n"
), Variable::get_function_type("daughterClusterAngleInBetween(i, j)"
,daughterClusterAngleInBetween), std::string("rad"), std::string
("daughterClusterAngleInBetween"));
3857 "If two indices given: returns the angle between the momenta of the clusters associated to the two given daughters."static Proxy _variableproxy3861(std::string("daughterClusterAngleInBetween(i, j)"
), Variable::make_function(daughterClusterAngleInBetween), std
::string("Returns the angle between clusters associated to the two daughters."
"If two indices given: returns the angle between the momenta of the clusters associated to the two given daughters."
"If three indices given: returns the angle between the momentum of the third particle's cluster and a vector "
"which is the sum of the first two daughter's cluster momenta."
"Returns nan if any of the daughters specified don't have an associated cluster."
"The arguments in the argument vector must be integers corresponding to the ith and jth (and kth) daughters.\n\n"
), Variable::get_function_type("daughterClusterAngleInBetween(i, j)"
,daughterClusterAngleInBetween), std::string("rad"), std::string
("daughterClusterAngleInBetween"));
3858 "If three indices given: returns the angle between the momentum of the third particle's cluster and a vector "static Proxy _variableproxy3861(std::string("daughterClusterAngleInBetween(i, j)"
), Variable::make_function(daughterClusterAngleInBetween), std
::string("Returns the angle between clusters associated to the two daughters."
"If two indices given: returns the angle between the momenta of the clusters associated to the two given daughters."
"If three indices given: returns the angle between the momentum of the third particle's cluster and a vector "
"which is the sum of the first two daughter's cluster momenta."
"Returns nan if any of the daughters specified don't have an associated cluster."
"The arguments in the argument vector must be integers corresponding to the ith and jth (and kth) daughters.\n\n"
), Variable::get_function_type("daughterClusterAngleInBetween(i, j)"
,daughterClusterAngleInBetween), std::string("rad"), std::string
("daughterClusterAngleInBetween"));
3859 "which is the sum of the first two daughter's cluster momenta."static Proxy _variableproxy3861(std::string("daughterClusterAngleInBetween(i, j)"
), Variable::make_function(daughterClusterAngleInBetween), std
::string("Returns the angle between clusters associated to the two daughters."
"If two indices given: returns the angle between the momenta of the clusters associated to the two given daughters."
"If three indices given: returns the angle between the momentum of the third particle's cluster and a vector "
"which is the sum of the first two daughter's cluster momenta."
"Returns nan if any of the daughters specified don't have an associated cluster."
"The arguments in the argument vector must be integers corresponding to the ith and jth (and kth) daughters.\n\n"
), Variable::get_function_type("daughterClusterAngleInBetween(i, j)"
,daughterClusterAngleInBetween), std::string("rad"), std::string
("daughterClusterAngleInBetween"));
3860 "Returns nan if any of the daughters specified don't have an associated cluster."static Proxy _variableproxy3861(std::string("daughterClusterAngleInBetween(i, j)"
), Variable::make_function(daughterClusterAngleInBetween), std
::string("Returns the angle between clusters associated to the two daughters."
"If two indices given: returns the angle between the momenta of the clusters associated to the two given daughters."
"If three indices given: returns the angle between the momentum of the third particle's cluster and a vector "
"which is the sum of the first two daughter's cluster momenta."
"Returns nan if any of the daughters specified don't have an associated cluster."
"The arguments in the argument vector must be integers corresponding to the ith and jth (and kth) daughters.\n\n"
), Variable::get_function_type("daughterClusterAngleInBetween(i, j)"
,daughterClusterAngleInBetween), std::string("rad"), std::string
("daughterClusterAngleInBetween"));
3861 "The arguments in the argument vector must be integers corresponding to the ith and jth (and kth) daughters.\n\n", "rad")static Proxy _variableproxy3861(std::string("daughterClusterAngleInBetween(i, j)"
), Variable::make_function(daughterClusterAngleInBetween), std
::string("Returns the angle between clusters associated to the two daughters."
"If two indices given: returns the angle between the momenta of the clusters associated to the two given daughters."
"If three indices given: returns the angle between the momentum of the third particle's cluster and a vector "
"which is the sum of the first two daughter's cluster momenta."
"Returns nan if any of the daughters specified don't have an associated cluster."
"The arguments in the argument vector must be integers corresponding to the ith and jth (and kth) daughters.\n\n"
), Variable::get_function_type("daughterClusterAngleInBetween(i, j)"
,daughterClusterAngleInBetween), std::string("rad"), std::string
("daughterClusterAngleInBetween"));
;
3862 REGISTER_METAVARIABLE("daughterInvM(i[, j, ...])", daughterInvM, R"DOC(static Proxy _variableproxy3871(std::string("daughterInvM(i[, j, ...])"
), Variable::make_function(daughterInvM), std::string(R"DOC( Returns the invariant mass adding the Lorentz vectors of the given daughters. The unit of the invariant mass is GeV/:math:`\text{c}^2` E.g. ``daughterInvM(0, 1, 2)`` returns the invariant Mass :math:`m = \sqrt{(p_0 + p_1 + p_2)^2}` of the first, second and third daughter. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated daughter indexes for each generation, starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter(0) of the mother particle. Returns NaN if the given daughter-index is out of bound (>= number of daughters))DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterInvM"));
3863 Returns the invariant mass adding the Lorentz vectors of the given daughters. The unit of the invariant mass is GeV/:math:`\text{c}^2`static Proxy _variableproxy3871(std::string("daughterInvM(i[, j, ...])"
), Variable::make_function(daughterInvM), std::string(R"DOC( Returns the invariant mass adding the Lorentz vectors of the given daughters. The unit of the invariant mass is GeV/:math:`\text{c}^2` E.g. ``daughterInvM(0, 1, 2)`` returns the invariant Mass :math:`m = \sqrt{(p_0 + p_1 + p_2)^2}` of the first, second and third daughter. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated daughter indexes for each generation, starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter(0) of the mother particle. Returns NaN if the given daughter-index is out of bound (>= number of daughters))DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterInvM"));
3864 E.g. ``daughterInvM(0, 1, 2)`` returns the invariant Mass :math:`m = \sqrt{(p_0 + p_1 + p_2)^2}` of the first, second and third daughter.static Proxy _variableproxy3871(std::string("daughterInvM(i[, j, ...])"
), Variable::make_function(daughterInvM), std::string(R"DOC( Returns the invariant mass adding the Lorentz vectors of the given daughters. The unit of the invariant mass is GeV/:math:`\text{c}^2` E.g. ``daughterInvM(0, 1, 2)`` returns the invariant Mass :math:`m = \sqrt{(p_0 + p_1 + p_2)^2}` of the first, second and third daughter. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated daughter indexes for each generation, starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter(0) of the mother particle. Returns NaN if the given daughter-index is out of bound (>= number of daughters))DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterInvM"));
3865
3866 Daughters from different generations of the decay tree can be combined using generalized daughter indexes,static Proxy _variableproxy3871(std::string("daughterInvM(i[, j, ...])"
), Variable::make_function(daughterInvM), std::string(R"DOC( Returns the invariant mass adding the Lorentz vectors of the given daughters. The unit of the invariant mass is GeV/:math:`\text{c}^2` E.g. ``daughterInvM(0, 1, 2)`` returns the invariant Mass :math:`m = \sqrt{(p_0 + p_1 + p_2)^2}` of the first, second and third daughter. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated daughter indexes for each generation, starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter(0) of the mother particle. Returns NaN if the given daughter-index is out of bound (>= number of daughters))DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterInvM"));
3867 which are simply colon-separated daughter indexes for each generation, starting from the root particle. Forstatic Proxy _variableproxy3871(std::string("daughterInvM(i[, j, ...])"
), Variable::make_function(daughterInvM), std::string(R"DOC( Returns the invariant mass adding the Lorentz vectors of the given daughters. The unit of the invariant mass is GeV/:math:`\text{c}^2` E.g. ``daughterInvM(0, 1, 2)`` returns the invariant Mass :math:`m = \sqrt{(p_0 + p_1 + p_2)^2}` of the first, second and third daughter. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated daughter indexes for each generation, starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter(0) of the mother particle. Returns NaN if the given daughter-index is out of bound (>= number of daughters))DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterInvM"));
3868 example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter(0) ofstatic Proxy _variableproxy3871(std::string("daughterInvM(i[, j, ...])"
), Variable::make_function(daughterInvM), std::string(R"DOC( Returns the invariant mass adding the Lorentz vectors of the given daughters. The unit of the invariant mass is GeV/:math:`\text{c}^2` E.g. ``daughterInvM(0, 1, 2)`` returns the invariant Mass :math:`m = \sqrt{(p_0 + p_1 + p_2)^2}` of the first, second and third daughter. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated daughter indexes for each generation, starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter(0) of the mother particle. Returns NaN if the given daughter-index is out of bound (>= number of daughters))DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterInvM"));
3869 the mother particle.static Proxy _variableproxy3871(std::string("daughterInvM(i[, j, ...])"
), Variable::make_function(daughterInvM), std::string(R"DOC( Returns the invariant mass adding the Lorentz vectors of the given daughters. The unit of the invariant mass is GeV/:math:`\text{c}^2` E.g. ``daughterInvM(0, 1, 2)`` returns the invariant Mass :math:`m = \sqrt{(p_0 + p_1 + p_2)^2}` of the first, second and third daughter. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated daughter indexes for each generation, starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter(0) of the mother particle. Returns NaN if the given daughter-index is out of bound (>= number of daughters))DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterInvM"));
3870
3871 Returns NaN if the given daughter-index is out of bound (>= number of daughters))DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3871(std::string("daughterInvM(i[, j, ...])"
), Variable::make_function(daughterInvM), std::string(R"DOC( Returns the invariant mass adding the Lorentz vectors of the given daughters. The unit of the invariant mass is GeV/:math:`\text{c}^2` E.g. ``daughterInvM(0, 1, 2)`` returns the invariant Mass :math:`m = \sqrt{(p_0 + p_1 + p_2)^2}` of the first, second and third daughter. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated daughter indexes for each generation, starting from the root particle. For example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter(0) of the mother particle. Returns NaN if the given daughter-index is out of bound (>= number of daughters))DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterInvM"));
;
3872 REGISTER_METAVARIABLE("extraInfo(name)", extraInfo,static Proxy _variableproxy3877(std::string("extraInfo(name)"
), Variable::make_function(extraInfo), std::string("Returns extra info stored under the given name.\n"
"The extraInfo has to be set by a module first.\n" "E.g. ``extraInfo(SignalProbability)`` returns the SignalProbability calculated by the ``MVAExpert`` module.\n"
"If nothing is set under the given name or if the particle is a nullptr, NaN is returned.\n"
"In the latter case please use `eventExtraInfo` if you want to access an EventExtraInfo variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("extraInfo"));
3873 "Returns extra info stored under the given name.\n"static Proxy _variableproxy3877(std::string("extraInfo(name)"
), Variable::make_function(extraInfo), std::string("Returns extra info stored under the given name.\n"
"The extraInfo has to be set by a module first.\n" "E.g. ``extraInfo(SignalProbability)`` returns the SignalProbability calculated by the ``MVAExpert`` module.\n"
"If nothing is set under the given name or if the particle is a nullptr, NaN is returned.\n"
"In the latter case please use `eventExtraInfo` if you want to access an EventExtraInfo variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("extraInfo"));
3874 "The extraInfo has to be set by a module first.\n"static Proxy _variableproxy3877(std::string("extraInfo(name)"
), Variable::make_function(extraInfo), std::string("Returns extra info stored under the given name.\n"
"The extraInfo has to be set by a module first.\n" "E.g. ``extraInfo(SignalProbability)`` returns the SignalProbability calculated by the ``MVAExpert`` module.\n"
"If nothing is set under the given name or if the particle is a nullptr, NaN is returned.\n"
"In the latter case please use `eventExtraInfo` if you want to access an EventExtraInfo variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("extraInfo"));
3875 "E.g. ``extraInfo(SignalProbability)`` returns the SignalProbability calculated by the ``MVAExpert`` module.\n"static Proxy _variableproxy3877(std::string("extraInfo(name)"
), Variable::make_function(extraInfo), std::string("Returns extra info stored under the given name.\n"
"The extraInfo has to be set by a module first.\n" "E.g. ``extraInfo(SignalProbability)`` returns the SignalProbability calculated by the ``MVAExpert`` module.\n"
"If nothing is set under the given name or if the particle is a nullptr, NaN is returned.\n"
"In the latter case please use `eventExtraInfo` if you want to access an EventExtraInfo variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("extraInfo"));
3876 "If nothing is set under the given name or if the particle is a nullptr, NaN is returned.\n"static Proxy _variableproxy3877(std::string("extraInfo(name)"
), Variable::make_function(extraInfo), std::string("Returns extra info stored under the given name.\n"
"The extraInfo has to be set by a module first.\n" "E.g. ``extraInfo(SignalProbability)`` returns the SignalProbability calculated by the ``MVAExpert`` module.\n"
"If nothing is set under the given name or if the particle is a nullptr, NaN is returned.\n"
"In the latter case please use `eventExtraInfo` if you want to access an EventExtraInfo variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("extraInfo"));
3877 "In the latter case please use `eventExtraInfo` if you want to access an EventExtraInfo variable.", Manager::VariableDataType::c_double)static Proxy _variableproxy3877(std::string("extraInfo(name)"
), Variable::make_function(extraInfo), std::string("Returns extra info stored under the given name.\n"
"The extraInfo has to be set by a module first.\n" "E.g. ``extraInfo(SignalProbability)`` returns the SignalProbability calculated by the ``MVAExpert`` module.\n"
"If nothing is set under the given name or if the particle is a nullptr, NaN is returned.\n"
"In the latter case please use `eventExtraInfo` if you want to access an EventExtraInfo variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("extraInfo"));
;
3878 REGISTER_METAVARIABLE("eventExtraInfo(name)", eventExtraInfo,static Proxy _variableproxy3881(std::string("eventExtraInfo(name)"
), Variable::make_function(eventExtraInfo), std::string("[Eventbased] Returns extra info stored under the given name in the event extra info.\n"
"The extraInfo has to be set first by another module like MVAExpert in event mode.\n"
"If nothing is set under this name, NaN is returned."), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("eventExtraInfo"));
3879 "[Eventbased] Returns extra info stored under the given name in the event extra info.\n"static Proxy _variableproxy3881(std::string("eventExtraInfo(name)"
), Variable::make_function(eventExtraInfo), std::string("[Eventbased] Returns extra info stored under the given name in the event extra info.\n"
"The extraInfo has to be set first by another module like MVAExpert in event mode.\n"
"If nothing is set under this name, NaN is returned."), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("eventExtraInfo"));
3880 "The extraInfo has to be set first by another module like MVAExpert in event mode.\n"static Proxy _variableproxy3881(std::string("eventExtraInfo(name)"
), Variable::make_function(eventExtraInfo), std::string("[Eventbased] Returns extra info stored under the given name in the event extra info.\n"
"The extraInfo has to be set first by another module like MVAExpert in event mode.\n"
"If nothing is set under this name, NaN is returned."), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("eventExtraInfo"));
3881 "If nothing is set under this name, NaN is returned.", Manager::VariableDataType::c_double)static Proxy _variableproxy3881(std::string("eventExtraInfo(name)"
), Variable::make_function(eventExtraInfo), std::string("[Eventbased] Returns extra info stored under the given name in the event extra info.\n"
"The extraInfo has to be set first by another module like MVAExpert in event mode.\n"
"If nothing is set under this name, NaN is returned."), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("eventExtraInfo"));
;
3882 REGISTER_METAVARIABLE("eventCached(variable)", eventCached,static Proxy _variableproxy3886(std::string("eventCached(variable)"
), Variable::make_function(eventCached), std::string("[Eventbased] Returns value of event-based variable and caches this value in the EventExtraInfo.\n"
"The result of second call to this variable in the same event will be provided from the cache.\n"
"It is recommended to use this variable in order to declare custom aliases as event-based. This is "
"necessary if using the eventwise mode of variablesToNtuple)."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("eventCached"));
3883 "[Eventbased] Returns value of event-based variable and caches this value in the EventExtraInfo.\n"static Proxy _variableproxy3886(std::string("eventCached(variable)"
), Variable::make_function(eventCached), std::string("[Eventbased] Returns value of event-based variable and caches this value in the EventExtraInfo.\n"
"The result of second call to this variable in the same event will be provided from the cache.\n"
"It is recommended to use this variable in order to declare custom aliases as event-based. This is "
"necessary if using the eventwise mode of variablesToNtuple)."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("eventCached"));
3884 "The result of second call to this variable in the same event will be provided from the cache.\n"static Proxy _variableproxy3886(std::string("eventCached(variable)"
), Variable::make_function(eventCached), std::string("[Eventbased] Returns value of event-based variable and caches this value in the EventExtraInfo.\n"
"The result of second call to this variable in the same event will be provided from the cache.\n"
"It is recommended to use this variable in order to declare custom aliases as event-based. This is "
"necessary if using the eventwise mode of variablesToNtuple)."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("eventCached"));
3885 "It is recommended to use this variable in order to declare custom aliases as event-based. This is "static Proxy _variableproxy3886(std::string("eventCached(variable)"
), Variable::make_function(eventCached), std::string("[Eventbased] Returns value of event-based variable and caches this value in the EventExtraInfo.\n"
"The result of second call to this variable in the same event will be provided from the cache.\n"
"It is recommended to use this variable in order to declare custom aliases as event-based. This is "
"necessary if using the eventwise mode of variablesToNtuple)."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("eventCached"));
3886 "necessary if using the eventwise mode of variablesToNtuple).", Manager::VariableDataType::c_double)static Proxy _variableproxy3886(std::string("eventCached(variable)"
), Variable::make_function(eventCached), std::string("[Eventbased] Returns value of event-based variable and caches this value in the EventExtraInfo.\n"
"The result of second call to this variable in the same event will be provided from the cache.\n"
"It is recommended to use this variable in order to declare custom aliases as event-based. This is "
"necessary if using the eventwise mode of variablesToNtuple)."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("eventCached"));
;
3887 REGISTER_METAVARIABLE("particleCached(variable)", particleCached,static Proxy _variableproxy3889(std::string("particleCached(variable)"
), Variable::make_function(particleCached), std::string("Returns value of given variable and caches this value in the ParticleExtraInfo of the provided particle.\n"
"The result of second call to this variable on the same particle will be provided from the cache."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("particleCached"));
3888 "Returns value of given variable and caches this value in the ParticleExtraInfo of the provided particle.\n"static Proxy _variableproxy3889(std::string("particleCached(variable)"
), Variable::make_function(particleCached), std::string("Returns value of given variable and caches this value in the ParticleExtraInfo of the provided particle.\n"
"The result of second call to this variable on the same particle will be provided from the cache."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("particleCached"));
3889 "The result of second call to this variable on the same particle will be provided from the cache.", Manager::VariableDataType::c_double)static Proxy _variableproxy3889(std::string("particleCached(variable)"
), Variable::make_function(particleCached), std::string("Returns value of given variable and caches this value in the ParticleExtraInfo of the provided particle.\n"
"The result of second call to this variable on the same particle will be provided from the cache."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("particleCached"));
;
3890 REGISTER_METAVARIABLE("modulo(variable, n)", modulo,static Proxy _variableproxy3891(std::string("modulo(variable, n)"
), Variable::make_function(modulo), std::string("Returns rest of division of variable by n."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("modulo"));
3891 "Returns rest of division of variable by n.", Manager::VariableDataType::c_int)static Proxy _variableproxy3891(std::string("modulo(variable, n)"
), Variable::make_function(modulo), std::string("Returns rest of division of variable by n."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("modulo"));
;
3892 REGISTER_METAVARIABLE("abs(variable)", abs,static Proxy _variableproxy3894(std::string("abs(variable)"),
Variable::make_function(abs), std::string("Returns absolute value of the given variable.\n"
"E.g. abs(mcPDG) returns the absolute value of the mcPDG, which is often useful for cuts."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("abs"));
3893 "Returns absolute value of the given variable.\n"static Proxy _variableproxy3894(std::string("abs(variable)"),
Variable::make_function(abs), std::string("Returns absolute value of the given variable.\n"
"E.g. abs(mcPDG) returns the absolute value of the mcPDG, which is often useful for cuts."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("abs"));
3894 "E.g. abs(mcPDG) returns the absolute value of the mcPDG, which is often useful for cuts.", Manager::VariableDataType::c_double)static Proxy _variableproxy3894(std::string("abs(variable)"),
Variable::make_function(abs), std::string("Returns absolute value of the given variable.\n"
"E.g. abs(mcPDG) returns the absolute value of the mcPDG, which is often useful for cuts."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("abs"));
;
3895 REGISTER_METAVARIABLE("max(var1,var2)", max, "Returns max value of two variables.\n", Manager::VariableDataType::c_double)static Proxy _variableproxy3895(std::string("max(var1,var2)")
, Variable::make_function(max), std::string("Returns max value of two variables.\n"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("max"));
;
3896 REGISTER_METAVARIABLE("min(var1,var2)", min, "Returns min value of two variables.\n", Manager::VariableDataType::c_double)static Proxy _variableproxy3896(std::string("min(var1,var2)")
, Variable::make_function(min), std::string("Returns min value of two variables.\n"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("min"));
;
3897 REGISTER_METAVARIABLE("sin(variable)", sin, "Returns sine value of the given variable.", Manager::VariableDataType::c_double)static Proxy _variableproxy3897(std::string("sin(variable)"),
Variable::make_function(sin), std::string("Returns sine value of the given variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("sin"));
;
3898 REGISTER_METAVARIABLE("asin(variable)", asin, "Returns arcsine of the given variable. The unit of the asin() is ``rad``", Manager::VariableDataType::c_double)static Proxy _variableproxy3898(std::string("asin(variable)")
, Variable::make_function(asin), std::string("Returns arcsine of the given variable. The unit of the asin() is ``rad``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("asin"));
;
3899 REGISTER_METAVARIABLE("cos(variable)", cos, "Returns cosine value of the given variable.", Manager::VariableDataType::c_double)static Proxy _variableproxy3899(std::string("cos(variable)"),
Variable::make_function(cos), std::string("Returns cosine value of the given variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("cos"));
;
3900 REGISTER_METAVARIABLE("acos(variable)", acos, "Returns arccosine value of the given variable. The unit of the acos() is ``rad``", Manager::VariableDataType::c_double)static Proxy _variableproxy3900(std::string("acos(variable)")
, Variable::make_function(acos), std::string("Returns arccosine value of the given variable. The unit of the acos() is ``rad``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("acos"));
;
3901 REGISTER_METAVARIABLE("tan(variable)", tan, "Returns tangent value of the given variable.", Manager::VariableDataType::c_double)static Proxy _variableproxy3901(std::string("tan(variable)"),
Variable::make_function(tan), std::string("Returns tangent value of the given variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("tan"));
;
3902 REGISTER_METAVARIABLE("atan(variable)", atan, "Returns arctangent value of the given variable. The unit of the atan() is ``rad``", Manager::VariableDataType::c_double)static Proxy _variableproxy3902(std::string("atan(variable)")
, Variable::make_function(atan), std::string("Returns arctangent value of the given variable. The unit of the atan() is ``rad``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("atan"));
;
3903 REGISTER_METAVARIABLE("atan2(variableY, variableX)", atan2, "Returns the atan2 value (arctangent of y/x). The result is in ``rad``, and the correct quadrant is determined by the signs of the two arguments. Both arguments must not be zero at the same time.", Manager::VariableDataType::c_double)static Proxy _variableproxy3903(std::string("atan2(variableY, variableX)"
), Variable::make_function(atan2), std::string("Returns the atan2 value (arctangent of y/x). The result is in ``rad``, and the correct quadrant is determined by the signs of the two arguments. Both arguments must not be zero at the same time."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("atan2"));
;
3904 REGISTER_METAVARIABLE("exp(variable)", exp, "Returns exponential evaluated for the given variable.", Manager::VariableDataType::c_double)static Proxy _variableproxy3904(std::string("exp(variable)"),
Variable::make_function(exp), std::string("Returns exponential evaluated for the given variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("exp"));
;
3905 REGISTER_METAVARIABLE("log(variable)", log, "Returns natural logarithm evaluated for the given variable.", Manager::VariableDataType::c_double)static Proxy _variableproxy3905(std::string("log(variable)"),
Variable::make_function(log), std::string("Returns natural logarithm evaluated for the given variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("log"));
;
3906 REGISTER_METAVARIABLE("log10(variable)", log10, "Returns base-10 logarithm evaluated for the given variable.", Manager::VariableDataType::c_double)static Proxy _variableproxy3906(std::string("log10(variable)"
), Variable::make_function(log10), std::string("Returns base-10 logarithm evaluated for the given variable."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("log10"));
;
3907 REGISTER_METAVARIABLE("int(variable, nan_replacement)", convertToInt, R"DOC(static Proxy _variableproxy3913(std::string("int(variable, nan_replacement)"
), Variable::make_function(convertToInt), std::string(R"DOC( Casts the output of the variable to an integer value. .. note:: Overflow and underflow are clipped at maximum and minimum values, respectively. NaN values are replaced with the value of the 2nd argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("convertToInt"));
3908 Casts the output of the variable to an integer value.static Proxy _variableproxy3913(std::string("int(variable, nan_replacement)"
), Variable::make_function(convertToInt), std::string(R"DOC( Casts the output of the variable to an integer value. .. note:: Overflow and underflow are clipped at maximum and minimum values, respectively. NaN values are replaced with the value of the 2nd argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("convertToInt"));
3909
3910 .. note::static Proxy _variableproxy3913(std::string("int(variable, nan_replacement)"
), Variable::make_function(convertToInt), std::string(R"DOC( Casts the output of the variable to an integer value. .. note:: Overflow and underflow are clipped at maximum and minimum values, respectively. NaN values are replaced with the value of the 2nd argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("convertToInt"));
3911 Overflow and underflow are clipped at maximum and minimum values, respectively. NaN values are replaced with the value of the 2nd argument.static Proxy _variableproxy3913(std::string("int(variable, nan_replacement)"
), Variable::make_function(convertToInt), std::string(R"DOC( Casts the output of the variable to an integer value. .. note:: Overflow and underflow are clipped at maximum and minimum values, respectively. NaN values are replaced with the value of the 2nd argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("convertToInt"));
3912
3913 )DOC", Manager::VariableDataType::c_int)static Proxy _variableproxy3913(std::string("int(variable, nan_replacement)"
), Variable::make_function(convertToInt), std::string(R"DOC( Casts the output of the variable to an integer value. .. note:: Overflow and underflow are clipped at maximum and minimum values, respectively. NaN values are replaced with the value of the 2nd argument. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("convertToInt"));
;
3914 REGISTER_METAVARIABLE("isNAN(variable)", isNAN,static Proxy _variableproxy3916(std::string("isNAN(variable)"
), Variable::make_function(isNAN), std::string("Returns true if variable value evaluates to nan (determined via std::isnan(double)).\n"
"Useful for debugging."), Variable::Manager::VariableDataType
(Manager::VariableDataType::c_bool), std::string("isNAN"));
3915 "Returns true if variable value evaluates to nan (determined via std::isnan(double)).\n"static Proxy _variableproxy3916(std::string("isNAN(variable)"
), Variable::make_function(isNAN), std::string("Returns true if variable value evaluates to nan (determined via std::isnan(double)).\n"
"Useful for debugging."), Variable::Manager::VariableDataType
(Manager::VariableDataType::c_bool), std::string("isNAN"));
3916 "Useful for debugging.", Manager::VariableDataType::c_bool)static Proxy _variableproxy3916(std::string("isNAN(variable)"
), Variable::make_function(isNAN), std::string("Returns true if variable value evaluates to nan (determined via std::isnan(double)).\n"
"Useful for debugging."), Variable::Manager::VariableDataType
(Manager::VariableDataType::c_bool), std::string("isNAN"));
;
3917 REGISTER_METAVARIABLE("ifNANgiveX(variable, x)", ifNANgiveX,static Proxy _variableproxy3919(std::string("ifNANgiveX(variable, x)"
), Variable::make_function(ifNANgiveX), std::string("Returns x (has to be a number) if variable value is nan (determined via std::isnan(double)).\n"
"Useful for technical purposes while training MVAs."), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("ifNANgiveX"));
3918 "Returns x (has to be a number) if variable value is nan (determined via std::isnan(double)).\n"static Proxy _variableproxy3919(std::string("ifNANgiveX(variable, x)"
), Variable::make_function(ifNANgiveX), std::string("Returns x (has to be a number) if variable value is nan (determined via std::isnan(double)).\n"
"Useful for technical purposes while training MVAs."), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("ifNANgiveX"));
3919 "Useful for technical purposes while training MVAs.", Manager::VariableDataType::c_double)static Proxy _variableproxy3919(std::string("ifNANgiveX(variable, x)"
), Variable::make_function(ifNANgiveX), std::string("Returns x (has to be a number) if variable value is nan (determined via std::isnan(double)).\n"
"Useful for technical purposes while training MVAs."), Variable
::Manager::VariableDataType(Manager::VariableDataType::c_double
), std::string("ifNANgiveX"));
;
3920 REGISTER_METAVARIABLE("isInfinity(variable)", isInfinity,static Proxy _variableproxy3922(std::string("isInfinity(variable)"
), Variable::make_function(isInfinity), std::string("Returns true if variable value evaluates to infinity (determined via std::isinf(double)).\n"
"Useful for debugging."), Variable::Manager::VariableDataType
(Manager::VariableDataType::c_bool), std::string("isInfinity"
));
3921 "Returns true if variable value evaluates to infinity (determined via std::isinf(double)).\n"static Proxy _variableproxy3922(std::string("isInfinity(variable)"
), Variable::make_function(isInfinity), std::string("Returns true if variable value evaluates to infinity (determined via std::isinf(double)).\n"
"Useful for debugging."), Variable::Manager::VariableDataType
(Manager::VariableDataType::c_bool), std::string("isInfinity"
));
3922 "Useful for debugging.", Manager::VariableDataType::c_bool)static Proxy _variableproxy3922(std::string("isInfinity(variable)"
), Variable::make_function(isInfinity), std::string("Returns true if variable value evaluates to infinity (determined via std::isinf(double)).\n"
"Useful for debugging."), Variable::Manager::VariableDataType
(Manager::VariableDataType::c_bool), std::string("isInfinity"
));
;
3923 REGISTER_METAVARIABLE("unmask(variable, flag1, flag2, ...)", unmask,static Proxy _variableproxy3927(std::string("unmask(variable, flag1, flag2, ...)"
), Variable::make_function(unmask), std::string("unmask(variable, flag1, flag2, ...) or unmask(variable, mask) sets certain bits in the variable to zero.\n"
"For example, if you want to set the second, fourth and fifth bits to zero, you could call \n"
"``unmask(variable, 2, 8, 16)`` or ``unmask(variable, 26)``.\n"
""), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("unmask"));
3924 "unmask(variable, flag1, flag2, ...) or unmask(variable, mask) sets certain bits in the variable to zero.\n"static Proxy _variableproxy3927(std::string("unmask(variable, flag1, flag2, ...)"
), Variable::make_function(unmask), std::string("unmask(variable, flag1, flag2, ...) or unmask(variable, mask) sets certain bits in the variable to zero.\n"
"For example, if you want to set the second, fourth and fifth bits to zero, you could call \n"
"``unmask(variable, 2, 8, 16)`` or ``unmask(variable, 26)``.\n"
""), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("unmask"));
3925 "For example, if you want to set the second, fourth and fifth bits to zero, you could call \n"static Proxy _variableproxy3927(std::string("unmask(variable, flag1, flag2, ...)"
), Variable::make_function(unmask), std::string("unmask(variable, flag1, flag2, ...) or unmask(variable, mask) sets certain bits in the variable to zero.\n"
"For example, if you want to set the second, fourth and fifth bits to zero, you could call \n"
"``unmask(variable, 2, 8, 16)`` or ``unmask(variable, 26)``.\n"
""), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("unmask"));
3926 "``unmask(variable, 2, 8, 16)`` or ``unmask(variable, 26)``.\n"static Proxy _variableproxy3927(std::string("unmask(variable, flag1, flag2, ...)"
), Variable::make_function(unmask), std::string("unmask(variable, flag1, flag2, ...) or unmask(variable, mask) sets certain bits in the variable to zero.\n"
"For example, if you want to set the second, fourth and fifth bits to zero, you could call \n"
"``unmask(variable, 2, 8, 16)`` or ``unmask(variable, 26)``.\n"
""), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("unmask"));
3927 "", Manager::VariableDataType::c_double)static Proxy _variableproxy3927(std::string("unmask(variable, flag1, flag2, ...)"
), Variable::make_function(unmask), std::string("unmask(variable, flag1, flag2, ...) or unmask(variable, mask) sets certain bits in the variable to zero.\n"
"For example, if you want to set the second, fourth and fifth bits to zero, you could call \n"
"``unmask(variable, 2, 8, 16)`` or ``unmask(variable, 26)``.\n"
""), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("unmask"));
;
3928 REGISTER_METAVARIABLE("conditionalVariableSelector(cut, variableIfTrue, variableIfFalse)", conditionalVariableSelector,static Proxy _variableproxy3930(std::string("conditionalVariableSelector(cut, variableIfTrue, variableIfFalse)"
), Variable::make_function(conditionalVariableSelector), std::
string("Returns one of the two supplied variables, depending on whether the particle passes the supplied cut.\n"
"The first variable is returned if the particle passes the cut, and the second variable is returned otherwise."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("conditionalVariableSelector"));
3929 "Returns one of the two supplied variables, depending on whether the particle passes the supplied cut.\n"static Proxy _variableproxy3930(std::string("conditionalVariableSelector(cut, variableIfTrue, variableIfFalse)"
), Variable::make_function(conditionalVariableSelector), std::
string("Returns one of the two supplied variables, depending on whether the particle passes the supplied cut.\n"
"The first variable is returned if the particle passes the cut, and the second variable is returned otherwise."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("conditionalVariableSelector"));
3930 "The first variable is returned if the particle passes the cut, and the second variable is returned otherwise.", Manager::VariableDataType::c_double)static Proxy _variableproxy3930(std::string("conditionalVariableSelector(cut, variableIfTrue, variableIfFalse)"
), Variable::make_function(conditionalVariableSelector), std::
string("Returns one of the two supplied variables, depending on whether the particle passes the supplied cut.\n"
"The first variable is returned if the particle passes the cut, and the second variable is returned otherwise."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("conditionalVariableSelector"));
;
3931 REGISTER_METAVARIABLE("pValueCombination(p1, p2, ...)", pValueCombination,static Proxy _variableproxy3933(std::string("pValueCombination(p1, p2, ...)"
), Variable::make_function(pValueCombination), std::string("Returns the combined p-value of the provided p-values according to the formula given in `Nucl. Instr. and Meth. A 411 (1998) 449 <https://doi.org/10.1016/S0168-9002(98)00293-9>`_ .\n"
"If any of the p-values is invalid, i.e. smaller than zero, -1 is returned."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("pValueCombination"));
3932 "Returns the combined p-value of the provided p-values according to the formula given in `Nucl. Instr. and Meth. A 411 (1998) 449 <https://doi.org/10.1016/S0168-9002(98)00293-9>`_ .\n"static Proxy _variableproxy3933(std::string("pValueCombination(p1, p2, ...)"
), Variable::make_function(pValueCombination), std::string("Returns the combined p-value of the provided p-values according to the formula given in `Nucl. Instr. and Meth. A 411 (1998) 449 <https://doi.org/10.1016/S0168-9002(98)00293-9>`_ .\n"
"If any of the p-values is invalid, i.e. smaller than zero, -1 is returned."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("pValueCombination"));
3933 "If any of the p-values is invalid, i.e. smaller than zero, -1 is returned.", Manager::VariableDataType::c_double)static Proxy _variableproxy3933(std::string("pValueCombination(p1, p2, ...)"
), Variable::make_function(pValueCombination), std::string("Returns the combined p-value of the provided p-values according to the formula given in `Nucl. Instr. and Meth. A 411 (1998) 449 <https://doi.org/10.1016/S0168-9002(98)00293-9>`_ .\n"
"If any of the p-values is invalid, i.e. smaller than zero, -1 is returned."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("pValueCombination"));
;
3934 REGISTER_METAVARIABLE("pValueCombinationOfDaughters(variable)", pValueCombinationOfDaughters,static Proxy _variableproxy3936(std::string("pValueCombinationOfDaughters(variable)"
), Variable::make_function(pValueCombinationOfDaughters), std
::string("Returns the combined p-value of the daughter p-values according to the formula given in `Nucl. Instr. and Meth. A 411 (1998) 449 <https://doi.org/10.1016/S0168-9002(98)00293-9>`_ .\n"
"If any of the p-values is invalid, i.e. smaller than zero, -1 is returned."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("pValueCombinationOfDaughters"));
3935 "Returns the combined p-value of the daughter p-values according to the formula given in `Nucl. Instr. and Meth. A 411 (1998) 449 <https://doi.org/10.1016/S0168-9002(98)00293-9>`_ .\n"static Proxy _variableproxy3936(std::string("pValueCombinationOfDaughters(variable)"
), Variable::make_function(pValueCombinationOfDaughters), std
::string("Returns the combined p-value of the daughter p-values according to the formula given in `Nucl. Instr. and Meth. A 411 (1998) 449 <https://doi.org/10.1016/S0168-9002(98)00293-9>`_ .\n"
"If any of the p-values is invalid, i.e. smaller than zero, -1 is returned."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("pValueCombinationOfDaughters"));
3936 "If any of the p-values is invalid, i.e. smaller than zero, -1 is returned.", Manager::VariableDataType::c_double)static Proxy _variableproxy3936(std::string("pValueCombinationOfDaughters(variable)"
), Variable::make_function(pValueCombinationOfDaughters), std
::string("Returns the combined p-value of the daughter p-values according to the formula given in `Nucl. Instr. and Meth. A 411 (1998) 449 <https://doi.org/10.1016/S0168-9002(98)00293-9>`_ .\n"
"If any of the p-values is invalid, i.e. smaller than zero, -1 is returned."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("pValueCombinationOfDaughters"));
;
3937 REGISTER_METAVARIABLE("veto(particleList, cut, pdgCode = 11)", veto,static Proxy _variableproxy3941(std::string("veto(particleList, cut, pdgCode = 11)"
), Variable::make_function(veto), std::string("Combines current particle with particles from the given particle list and returns 1 if the combination passes the provided cut. \n"
"For instance one can apply this function on a signal Photon and provide a list of all photons in the rest of event and a cut \n"
"around the neutral Pion mass (e.g. ``0.130 < M < 0.140``). \n"
"If a combination of the signal Photon with a ROE photon fits this criteria, hence looks like a neutral pion, the veto-Metavariable will return 1"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("veto"));
3938 "Combines current particle with particles from the given particle list and returns 1 if the combination passes the provided cut. \n"static Proxy _variableproxy3941(std::string("veto(particleList, cut, pdgCode = 11)"
), Variable::make_function(veto), std::string("Combines current particle with particles from the given particle list and returns 1 if the combination passes the provided cut. \n"
"For instance one can apply this function on a signal Photon and provide a list of all photons in the rest of event and a cut \n"
"around the neutral Pion mass (e.g. ``0.130 < M < 0.140``). \n"
"If a combination of the signal Photon with a ROE photon fits this criteria, hence looks like a neutral pion, the veto-Metavariable will return 1"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("veto"));
3939 "For instance one can apply this function on a signal Photon and provide a list of all photons in the rest of event and a cut \n"static Proxy _variableproxy3941(std::string("veto(particleList, cut, pdgCode = 11)"
), Variable::make_function(veto), std::string("Combines current particle with particles from the given particle list and returns 1 if the combination passes the provided cut. \n"
"For instance one can apply this function on a signal Photon and provide a list of all photons in the rest of event and a cut \n"
"around the neutral Pion mass (e.g. ``0.130 < M < 0.140``). \n"
"If a combination of the signal Photon with a ROE photon fits this criteria, hence looks like a neutral pion, the veto-Metavariable will return 1"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("veto"));
3940 "around the neutral Pion mass (e.g. ``0.130 < M < 0.140``). \n"static Proxy _variableproxy3941(std::string("veto(particleList, cut, pdgCode = 11)"
), Variable::make_function(veto), std::string("Combines current particle with particles from the given particle list and returns 1 if the combination passes the provided cut. \n"
"For instance one can apply this function on a signal Photon and provide a list of all photons in the rest of event and a cut \n"
"around the neutral Pion mass (e.g. ``0.130 < M < 0.140``). \n"
"If a combination of the signal Photon with a ROE photon fits this criteria, hence looks like a neutral pion, the veto-Metavariable will return 1"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("veto"));
3941 "If a combination of the signal Photon with a ROE photon fits this criteria, hence looks like a neutral pion, the veto-Metavariable will return 1", Manager::VariableDataType::c_bool)static Proxy _variableproxy3941(std::string("veto(particleList, cut, pdgCode = 11)"
), Variable::make_function(veto), std::string("Combines current particle with particles from the given particle list and returns 1 if the combination passes the provided cut. \n"
"For instance one can apply this function on a signal Photon and provide a list of all photons in the rest of event and a cut \n"
"around the neutral Pion mass (e.g. ``0.130 < M < 0.140``). \n"
"If a combination of the signal Photon with a ROE photon fits this criteria, hence looks like a neutral pion, the veto-Metavariable will return 1"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_bool), std::string("veto"));
;
3942 REGISTER_METAVARIABLE("matchedMC(variable)", matchedMC,static Proxy _variableproxy3946(std::string("matchedMC(variable)"
), Variable::make_function(matchedMC), std::string("Returns variable output for the matched MCParticle by constructing a temporary Particle from it.\n"
"This may not work too well if your variable requires accessing daughters of the particle.\n"
"E.g. ``matchedMC(p)`` returns the total momentum of the related MCParticle.\n"
"Returns NaN if no matched MCParticle exists."), Variable::Manager
::VariableDataType(Manager::VariableDataType::c_double), std::
string("matchedMC"));
3943 "Returns variable output for the matched MCParticle by constructing a temporary Particle from it.\n"static Proxy _variableproxy3946(std::string("matchedMC(variable)"
), Variable::make_function(matchedMC), std::string("Returns variable output for the matched MCParticle by constructing a temporary Particle from it.\n"
"This may not work too well if your variable requires accessing daughters of the particle.\n"
"E.g. ``matchedMC(p)`` returns the total momentum of the related MCParticle.\n"
"Returns NaN if no matched MCParticle exists."), Variable::Manager
::VariableDataType(Manager::VariableDataType::c_double), std::
string("matchedMC"));
3944 "This may not work too well if your variable requires accessing daughters of the particle.\n"static Proxy _variableproxy3946(std::string("matchedMC(variable)"
), Variable::make_function(matchedMC), std::string("Returns variable output for the matched MCParticle by constructing a temporary Particle from it.\n"
"This may not work too well if your variable requires accessing daughters of the particle.\n"
"E.g. ``matchedMC(p)`` returns the total momentum of the related MCParticle.\n"
"Returns NaN if no matched MCParticle exists."), Variable::Manager
::VariableDataType(Manager::VariableDataType::c_double), std::
string("matchedMC"));
3945 "E.g. ``matchedMC(p)`` returns the total momentum of the related MCParticle.\n"static Proxy _variableproxy3946(std::string("matchedMC(variable)"
), Variable::make_function(matchedMC), std::string("Returns variable output for the matched MCParticle by constructing a temporary Particle from it.\n"
"This may not work too well if your variable requires accessing daughters of the particle.\n"
"E.g. ``matchedMC(p)`` returns the total momentum of the related MCParticle.\n"
"Returns NaN if no matched MCParticle exists."), Variable::Manager
::VariableDataType(Manager::VariableDataType::c_double), std::
string("matchedMC"));
3946 "Returns NaN if no matched MCParticle exists.", Manager::VariableDataType::c_double)static Proxy _variableproxy3946(std::string("matchedMC(variable)"
), Variable::make_function(matchedMC), std::string("Returns variable output for the matched MCParticle by constructing a temporary Particle from it.\n"
"This may not work too well if your variable requires accessing daughters of the particle.\n"
"E.g. ``matchedMC(p)`` returns the total momentum of the related MCParticle.\n"
"Returns NaN if no matched MCParticle exists."), Variable::Manager
::VariableDataType(Manager::VariableDataType::c_double), std::
string("matchedMC"));
;
3947 REGISTER_METAVARIABLE("clusterBestMatchedMCParticle(variable)", clusterBestMatchedMCParticle,static Proxy _variableproxy3952(std::string("clusterBestMatchedMCParticle(variable)"
), Variable::make_function(clusterBestMatchedMCParticle), std
::string("Returns variable output for the MCParticle that is best-matched with the ECLCluster of the given Particle.\n"
"E.g. To get the energy of the MCParticle that matches best with an ECLCluster, one could use ``clusterBestMatchedMCParticle(E)``\n"
"When the variable is called for ``gamma`` and if the ``gamma`` is matched with MCParticle, it works same as `matchedMC`.\n"
"If the variable is called for ``gamma`` that fails to match with an MCParticle, it provides the mdst-level MCMatching information abouth the ECLCluster.\n"
"Returns NaN if the particle is not matched to an ECLCluster, or if the ECLCluster has no matching MCParticles"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("clusterBestMatchedMCParticle"));
3948 "Returns variable output for the MCParticle that is best-matched with the ECLCluster of the given Particle.\n"static Proxy _variableproxy3952(std::string("clusterBestMatchedMCParticle(variable)"
), Variable::make_function(clusterBestMatchedMCParticle), std
::string("Returns variable output for the MCParticle that is best-matched with the ECLCluster of the given Particle.\n"
"E.g. To get the energy of the MCParticle that matches best with an ECLCluster, one could use ``clusterBestMatchedMCParticle(E)``\n"
"When the variable is called for ``gamma`` and if the ``gamma`` is matched with MCParticle, it works same as `matchedMC`.\n"
"If the variable is called for ``gamma`` that fails to match with an MCParticle, it provides the mdst-level MCMatching information abouth the ECLCluster.\n"
"Returns NaN if the particle is not matched to an ECLCluster, or if the ECLCluster has no matching MCParticles"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("clusterBestMatchedMCParticle"));
3949 "E.g. To get the energy of the MCParticle that matches best with an ECLCluster, one could use ``clusterBestMatchedMCParticle(E)``\n"static Proxy _variableproxy3952(std::string("clusterBestMatchedMCParticle(variable)"
), Variable::make_function(clusterBestMatchedMCParticle), std
::string("Returns variable output for the MCParticle that is best-matched with the ECLCluster of the given Particle.\n"
"E.g. To get the energy of the MCParticle that matches best with an ECLCluster, one could use ``clusterBestMatchedMCParticle(E)``\n"
"When the variable is called for ``gamma`` and if the ``gamma`` is matched with MCParticle, it works same as `matchedMC`.\n"
"If the variable is called for ``gamma`` that fails to match with an MCParticle, it provides the mdst-level MCMatching information abouth the ECLCluster.\n"
"Returns NaN if the particle is not matched to an ECLCluster, or if the ECLCluster has no matching MCParticles"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("clusterBestMatchedMCParticle"));
3950 "When the variable is called for ``gamma`` and if the ``gamma`` is matched with MCParticle, it works same as `matchedMC`.\n"static Proxy _variableproxy3952(std::string("clusterBestMatchedMCParticle(variable)"
), Variable::make_function(clusterBestMatchedMCParticle), std
::string("Returns variable output for the MCParticle that is best-matched with the ECLCluster of the given Particle.\n"
"E.g. To get the energy of the MCParticle that matches best with an ECLCluster, one could use ``clusterBestMatchedMCParticle(E)``\n"
"When the variable is called for ``gamma`` and if the ``gamma`` is matched with MCParticle, it works same as `matchedMC`.\n"
"If the variable is called for ``gamma`` that fails to match with an MCParticle, it provides the mdst-level MCMatching information abouth the ECLCluster.\n"
"Returns NaN if the particle is not matched to an ECLCluster, or if the ECLCluster has no matching MCParticles"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("clusterBestMatchedMCParticle"));
3951 "If the variable is called for ``gamma`` that fails to match with an MCParticle, it provides the mdst-level MCMatching information abouth the ECLCluster.\n"static Proxy _variableproxy3952(std::string("clusterBestMatchedMCParticle(variable)"
), Variable::make_function(clusterBestMatchedMCParticle), std
::string("Returns variable output for the MCParticle that is best-matched with the ECLCluster of the given Particle.\n"
"E.g. To get the energy of the MCParticle that matches best with an ECLCluster, one could use ``clusterBestMatchedMCParticle(E)``\n"
"When the variable is called for ``gamma`` and if the ``gamma`` is matched with MCParticle, it works same as `matchedMC`.\n"
"If the variable is called for ``gamma`` that fails to match with an MCParticle, it provides the mdst-level MCMatching information abouth the ECLCluster.\n"
"Returns NaN if the particle is not matched to an ECLCluster, or if the ECLCluster has no matching MCParticles"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("clusterBestMatchedMCParticle"));
3952 "Returns NaN if the particle is not matched to an ECLCluster, or if the ECLCluster has no matching MCParticles", Manager::VariableDataType::c_double)static Proxy _variableproxy3952(std::string("clusterBestMatchedMCParticle(variable)"
), Variable::make_function(clusterBestMatchedMCParticle), std
::string("Returns variable output for the MCParticle that is best-matched with the ECLCluster of the given Particle.\n"
"E.g. To get the energy of the MCParticle that matches best with an ECLCluster, one could use ``clusterBestMatchedMCParticle(E)``\n"
"When the variable is called for ``gamma`` and if the ``gamma`` is matched with MCParticle, it works same as `matchedMC`.\n"
"If the variable is called for ``gamma`` that fails to match with an MCParticle, it provides the mdst-level MCMatching information abouth the ECLCluster.\n"
"Returns NaN if the particle is not matched to an ECLCluster, or if the ECLCluster has no matching MCParticles"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("clusterBestMatchedMCParticle"));
;
3953 REGISTER_METAVARIABLE("varForBestMatchedMCKlong(variable)", clusterBestMatchedMCKlong,static Proxy _variableproxy3955(std::string("varForBestMatchedMCKlong(variable)"
), Variable::make_function(clusterBestMatchedMCKlong), std::string
("Returns variable output for the Klong MCParticle which has the best match with the ECLCluster of the given Particle.\n"
"Returns NaN if the particle is not matched to an ECLCluster, or if the ECLCluster has no matching Klong MCParticle"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("clusterBestMatchedMCKlong"));
3954 "Returns variable output for the Klong MCParticle which has the best match with the ECLCluster of the given Particle.\n"static Proxy _variableproxy3955(std::string("varForBestMatchedMCKlong(variable)"
), Variable::make_function(clusterBestMatchedMCKlong), std::string
("Returns variable output for the Klong MCParticle which has the best match with the ECLCluster of the given Particle.\n"
"Returns NaN if the particle is not matched to an ECLCluster, or if the ECLCluster has no matching Klong MCParticle"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("clusterBestMatchedMCKlong"));
3955 "Returns NaN if the particle is not matched to an ECLCluster, or if the ECLCluster has no matching Klong MCParticle", Manager::VariableDataType::c_double)static Proxy _variableproxy3955(std::string("varForBestMatchedMCKlong(variable)"
), Variable::make_function(clusterBestMatchedMCKlong), std::string
("Returns variable output for the Klong MCParticle which has the best match with the ECLCluster of the given Particle.\n"
"Returns NaN if the particle is not matched to an ECLCluster, or if the ECLCluster has no matching Klong MCParticle"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("clusterBestMatchedMCKlong"));
;
3956
3957 REGISTER_METAVARIABLE("countInList(particleList, cut='')", countInList, "[Eventbased] "static Proxy _variableproxy3961(std::string("countInList(particleList, cut='')"
), Variable::make_function(countInList), std::string("[Eventbased] "
"Returns number of particle which pass given in cut in the specified particle list.\n"
"Useful for creating statistics about the number of particles in a list.\n"
"E.g. ``countInList(e+, isSignal == 1)`` returns the number of correctly reconstructed electrons in the event.\n"
"The variable is event-based and does not need a valid particle pointer as input."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("countInList"));
3958 "Returns number of particle which pass given in cut in the specified particle list.\n"static Proxy _variableproxy3961(std::string("countInList(particleList, cut='')"
), Variable::make_function(countInList), std::string("[Eventbased] "
"Returns number of particle which pass given in cut in the specified particle list.\n"
"Useful for creating statistics about the number of particles in a list.\n"
"E.g. ``countInList(e+, isSignal == 1)`` returns the number of correctly reconstructed electrons in the event.\n"
"The variable is event-based and does not need a valid particle pointer as input."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("countInList"));
3959 "Useful for creating statistics about the number of particles in a list.\n"static Proxy _variableproxy3961(std::string("countInList(particleList, cut='')"
), Variable::make_function(countInList), std::string("[Eventbased] "
"Returns number of particle which pass given in cut in the specified particle list.\n"
"Useful for creating statistics about the number of particles in a list.\n"
"E.g. ``countInList(e+, isSignal == 1)`` returns the number of correctly reconstructed electrons in the event.\n"
"The variable is event-based and does not need a valid particle pointer as input."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("countInList"));
3960 "E.g. ``countInList(e+, isSignal == 1)`` returns the number of correctly reconstructed electrons in the event.\n"static Proxy _variableproxy3961(std::string("countInList(particleList, cut='')"
), Variable::make_function(countInList), std::string("[Eventbased] "
"Returns number of particle which pass given in cut in the specified particle list.\n"
"Useful for creating statistics about the number of particles in a list.\n"
"E.g. ``countInList(e+, isSignal == 1)`` returns the number of correctly reconstructed electrons in the event.\n"
"The variable is event-based and does not need a valid particle pointer as input."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("countInList"));
3961 "The variable is event-based and does not need a valid particle pointer as input.", Manager::VariableDataType::c_int)static Proxy _variableproxy3961(std::string("countInList(particleList, cut='')"
), Variable::make_function(countInList), std::string("[Eventbased] "
"Returns number of particle which pass given in cut in the specified particle list.\n"
"Useful for creating statistics about the number of particles in a list.\n"
"E.g. ``countInList(e+, isSignal == 1)`` returns the number of correctly reconstructed electrons in the event.\n"
"The variable is event-based and does not need a valid particle pointer as input."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("countInList"));
;
3962 REGISTER_METAVARIABLE("getVariableByRank(particleList, rankedVariableName, variableName, rank)", getVariableByRank, R"DOC(static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
3963 [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``.static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
3964
3965 .. note::static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
3966 The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before.static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
3967
3968 .. warning::static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
3969 The first candidate matching the given rank is used.static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
3970 Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module.static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
3971
3972 The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``,static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
3973 which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``.static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
3974 This means that your selected name for the rank variable has to end with ``_rank``.static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
3975
3976 An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
3977 )DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy3977(std::string("getVariableByRank(particleList, rankedVariableName, variableName, rank)"
), Variable::make_function(getVariableByRank), std::string(R"DOC( [Eventbased] Returns the value of ``variableName`` for the candidate in the ``particleList`` with the requested ``rank``. .. note:: The `BestCandidateSelection` module available via `rankByHighest` / `rankByLowest` has to be used before. .. warning:: The first candidate matching the given rank is used. Thus, it is not recommended to use this variable in conjunction with ``allowMultiRank`` in the `BestCandidateSelection` module. The suffix ``_rank`` is automatically added to the argument ``rankedVariableName``, which either has to be the name of the variable used to order the candidates or the selected outputVariable name without the ending ``_rank``. This means that your selected name for the rank variable has to end with ``_rank``. An example of this variable's usage is given in the tutorial `B2A602-BestCandidateSelection <https://gitlab.desy.de/belle2/software/basf2/-/tree/main/analysis/examples/tutorials/B2A602-BestCandidateSelection.py>`_ )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("getVariableByRank"));
;
3978 REGISTER_VARIABLE("matchedMCHasPDG(PDGCode)", matchedMCHasPDG,static Proxy _variableproxy3980(std::string("matchedMCHasPDG(PDGCode)"
), Variable::make_function(matchedMCHasPDG), std::string("Returns if the absolute value of the PDGCode of the MCParticle related to the Particle matches a given PDGCode."
"Returns 0/NAN/1 if PDGCode does not match/is not available/ matches"
), Variable::get_function_type("matchedMCHasPDG(PDGCode)",matchedMCHasPDG
), std::string(""), std::string("matchedMCHasPDG"));
3979 "Returns if the absolute value of the PDGCode of the MCParticle related to the Particle matches a given PDGCode."static Proxy _variableproxy3980(std::string("matchedMCHasPDG(PDGCode)"
), Variable::make_function(matchedMCHasPDG), std::string("Returns if the absolute value of the PDGCode of the MCParticle related to the Particle matches a given PDGCode."
"Returns 0/NAN/1 if PDGCode does not match/is not available/ matches"
), Variable::get_function_type("matchedMCHasPDG(PDGCode)",matchedMCHasPDG
), std::string(""), std::string("matchedMCHasPDG"));
3980 "Returns 0/NAN/1 if PDGCode does not match/is not available/ matches")static Proxy _variableproxy3980(std::string("matchedMCHasPDG(PDGCode)"
), Variable::make_function(matchedMCHasPDG), std::string("Returns if the absolute value of the PDGCode of the MCParticle related to the Particle matches a given PDGCode."
"Returns 0/NAN/1 if PDGCode does not match/is not available/ matches"
), Variable::get_function_type("matchedMCHasPDG(PDGCode)",matchedMCHasPDG
), std::string(""), std::string("matchedMCHasPDG"));
;
3981 REGISTER_METAVARIABLE("numberOfNonOverlappingParticles(pList1, pList2, ...)", numberOfNonOverlappingParticles,static Proxy _variableproxy3983(std::string("numberOfNonOverlappingParticles(pList1, pList2, ...)"
), Variable::make_function(numberOfNonOverlappingParticles), std
::string("Returns the number of non-overlapping particles in the given particle lists"
"Useful to check if there is additional physics going on in the detector if one reconstructed the Y4S"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("numberOfNonOverlappingParticles"));
3982 "Returns the number of non-overlapping particles in the given particle lists"static Proxy _variableproxy3983(std::string("numberOfNonOverlappingParticles(pList1, pList2, ...)"
), Variable::make_function(numberOfNonOverlappingParticles), std
::string("Returns the number of non-overlapping particles in the given particle lists"
"Useful to check if there is additional physics going on in the detector if one reconstructed the Y4S"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("numberOfNonOverlappingParticles"));
3983 "Useful to check if there is additional physics going on in the detector if one reconstructed the Y4S", Manager::VariableDataType::c_int)static Proxy _variableproxy3983(std::string("numberOfNonOverlappingParticles(pList1, pList2, ...)"
), Variable::make_function(numberOfNonOverlappingParticles), std
::string("Returns the number of non-overlapping particles in the given particle lists"
"Useful to check if there is additional physics going on in the detector if one reconstructed the Y4S"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("numberOfNonOverlappingParticles"));
;
3984 REGISTER_METAVARIABLE("totalEnergyOfParticlesInList(particleListName)", totalEnergyOfParticlesInList,static Proxy _variableproxy3985(std::string("totalEnergyOfParticlesInList(particleListName)"
), Variable::make_function(totalEnergyOfParticlesInList), std
::string("[Eventbased] Returns the total energy of particles in the given particle List. The unit of the energy is ``GeV``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("totalEnergyOfParticlesInList"));
3985 "[Eventbased] Returns the total energy of particles in the given particle List. The unit of the energy is ``GeV``", Manager::VariableDataType::c_double)static Proxy _variableproxy3985(std::string("totalEnergyOfParticlesInList(particleListName)"
), Variable::make_function(totalEnergyOfParticlesInList), std
::string("[Eventbased] Returns the total energy of particles in the given particle List. The unit of the energy is ``GeV``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("totalEnergyOfParticlesInList"));
;
3986 REGISTER_METAVARIABLE("totalPxOfParticlesInList(particleListName)", totalPxOfParticlesInList,static Proxy _variableproxy3987(std::string("totalPxOfParticlesInList(particleListName)"
), Variable::make_function(totalPxOfParticlesInList), std::string
("[Eventbased] Returns the total momentum Px of particles in the given particle List. The unit of the momentum is ``GeV/c``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("totalPxOfParticlesInList"));
3987 "[Eventbased] Returns the total momentum Px of particles in the given particle List. The unit of the momentum is ``GeV/c``", Manager::VariableDataType::c_double)static Proxy _variableproxy3987(std::string("totalPxOfParticlesInList(particleListName)"
), Variable::make_function(totalPxOfParticlesInList), std::string
("[Eventbased] Returns the total momentum Px of particles in the given particle List. The unit of the momentum is ``GeV/c``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("totalPxOfParticlesInList"));
;
3988 REGISTER_METAVARIABLE("totalPyOfParticlesInList(particleListName)", totalPyOfParticlesInList,static Proxy _variableproxy3989(std::string("totalPyOfParticlesInList(particleListName)"
), Variable::make_function(totalPyOfParticlesInList), std::string
("[Eventbased] Returns the total momentum Py of particles in the given particle List. The unit of the momentum is ``GeV/c``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("totalPyOfParticlesInList"));
3989 "[Eventbased] Returns the total momentum Py of particles in the given particle List. The unit of the momentum is ``GeV/c``", Manager::VariableDataType::c_double)static Proxy _variableproxy3989(std::string("totalPyOfParticlesInList(particleListName)"
), Variable::make_function(totalPyOfParticlesInList), std::string
("[Eventbased] Returns the total momentum Py of particles in the given particle List. The unit of the momentum is ``GeV/c``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("totalPyOfParticlesInList"));
;
3990 REGISTER_METAVARIABLE("totalPzOfParticlesInList(particleListName)", totalPzOfParticlesInList,static Proxy _variableproxy3991(std::string("totalPzOfParticlesInList(particleListName)"
), Variable::make_function(totalPzOfParticlesInList), std::string
("[Eventbased] Returns the total momentum Pz of particles in the given particle List. The unit of the momentum is ``GeV/c``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("totalPzOfParticlesInList"));
3991 "[Eventbased] Returns the total momentum Pz of particles in the given particle List. The unit of the momentum is ``GeV/c``", Manager::VariableDataType::c_double)static Proxy _variableproxy3991(std::string("totalPzOfParticlesInList(particleListName)"
), Variable::make_function(totalPzOfParticlesInList), std::string
("[Eventbased] Returns the total momentum Pz of particles in the given particle List. The unit of the momentum is ``GeV/c``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("totalPzOfParticlesInList"));
;
3992 REGISTER_METAVARIABLE("invMassInLists(pList1, pList2, ...)", invMassInLists,static Proxy _variableproxy3993(std::string("invMassInLists(pList1, pList2, ...)"
), Variable::make_function(invMassInLists), std::string("[Eventbased] Returns the invariant mass of the combination of particles in the given particle lists. The unit of the invariant mass is GeV/:math:`\\text{c}^2` "
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("invMassInLists"));
3993 "[Eventbased] Returns the invariant mass of the combination of particles in the given particle lists. The unit of the invariant mass is GeV/:math:`\\text{c}^2` ", Manager::VariableDataType::c_double)static Proxy _variableproxy3993(std::string("invMassInLists(pList1, pList2, ...)"
), Variable::make_function(invMassInLists), std::string("[Eventbased] Returns the invariant mass of the combination of particles in the given particle lists. The unit of the invariant mass is GeV/:math:`\\text{c}^2` "
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("invMassInLists"));
;
3994 REGISTER_METAVARIABLE("totalECLEnergyOfParticlesInList(particleListName)", totalECLEnergyOfParticlesInList,static Proxy _variableproxy3995(std::string("totalECLEnergyOfParticlesInList(particleListName)"
), Variable::make_function(totalECLEnergyOfParticlesInList), std
::string("[Eventbased] Returns the total ECL energy of particles in the given particle List. The unit of the energy is ``GeV``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("totalECLEnergyOfParticlesInList"));
3995 "[Eventbased] Returns the total ECL energy of particles in the given particle List. The unit of the energy is ``GeV``", Manager::VariableDataType::c_double)static Proxy _variableproxy3995(std::string("totalECLEnergyOfParticlesInList(particleListName)"
), Variable::make_function(totalECLEnergyOfParticlesInList), std
::string("[Eventbased] Returns the total ECL energy of particles in the given particle List. The unit of the energy is ``GeV``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("totalECLEnergyOfParticlesInList"));
;
3996 REGISTER_METAVARIABLE("maxPtInList(particleListName)", maxPtInList,static Proxy _variableproxy3997(std::string("maxPtInList(particleListName)"
), Variable::make_function(maxPtInList), std::string("[Eventbased] Returns maximum transverse momentum Pt in the given particle List. The unit of the transverse momentum is ``GeV/c``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("maxPtInList"));
3997 "[Eventbased] Returns maximum transverse momentum Pt in the given particle List. The unit of the transverse momentum is ``GeV/c``", Manager::VariableDataType::c_double)static Proxy _variableproxy3997(std::string("maxPtInList(particleListName)"
), Variable::make_function(maxPtInList), std::string("[Eventbased] Returns maximum transverse momentum Pt in the given particle List. The unit of the transverse momentum is ``GeV/c``"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("maxPtInList"));
;
3998 REGISTER_METAVARIABLE("eclClusterSpecialTrackMatched(cut)", eclClusterTrackMatchedWithCondition,static Proxy _variableproxy3999(std::string("eclClusterSpecialTrackMatched(cut)"
), Variable::make_function(eclClusterTrackMatchedWithCondition
), std::string("Returns if at least one Track that satisfies the given condition is related to the ECLCluster of the Particle."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("eclClusterTrackMatchedWithCondition"
));
3999 "Returns if at least one Track that satisfies the given condition is related to the ECLCluster of the Particle.", Manager::VariableDataType::c_double)static Proxy _variableproxy3999(std::string("eclClusterSpecialTrackMatched(cut)"
), Variable::make_function(eclClusterTrackMatchedWithCondition
), std::string("Returns if at least one Track that satisfies the given condition is related to the ECLCluster of the Particle."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("eclClusterTrackMatchedWithCondition"
));
;
4000 REGISTER_METAVARIABLE("averageValueInList(particleListName, variable)", averageValueInList,static Proxy _variableproxy4001(std::string("averageValueInList(particleListName, variable)"
), Variable::make_function(averageValueInList), std::string("[Eventbased] Returns the arithmetic mean of the given variable of the particles in the given particle list."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("averageValueInList"));
4001 "[Eventbased] Returns the arithmetic mean of the given variable of the particles in the given particle list.", Manager::VariableDataType::c_double)static Proxy _variableproxy4001(std::string("averageValueInList(particleListName, variable)"
), Variable::make_function(averageValueInList), std::string("[Eventbased] Returns the arithmetic mean of the given variable of the particles in the given particle list."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("averageValueInList"));
;
4002 REGISTER_METAVARIABLE("medianValueInList(particleListName, variable)", medianValueInList,static Proxy _variableproxy4003(std::string("medianValueInList(particleListName, variable)"
), Variable::make_function(medianValueInList), std::string("[Eventbased] Returns the median value of the given variable of the particles in the given particle list."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("medianValueInList"));
4003 "[Eventbased] Returns the median value of the given variable of the particles in the given particle list.", Manager::VariableDataType::c_double)static Proxy _variableproxy4003(std::string("medianValueInList(particleListName, variable)"
), Variable::make_function(medianValueInList), std::string("[Eventbased] Returns the median value of the given variable of the particles in the given particle list."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("medianValueInList"));
;
4004 REGISTER_METAVARIABLE("sumValueInList(particleListName, variable)", sumValueInList,static Proxy _variableproxy4005(std::string("sumValueInList(particleListName, variable)"
), Variable::make_function(sumValueInList), std::string("[Eventbased] Returns the sum of the given variable of the particles in the given particle list."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("sumValueInList"));
4005 "[Eventbased] Returns the sum of the given variable of the particles in the given particle list.", Manager::VariableDataType::c_double)static Proxy _variableproxy4005(std::string("sumValueInList(particleListName, variable)"
), Variable::make_function(sumValueInList), std::string("[Eventbased] Returns the sum of the given variable of the particles in the given particle list."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("sumValueInList"));
;
4006 REGISTER_METAVARIABLE("productValueInList(particleListName, variable)", productValueInList,static Proxy _variableproxy4007(std::string("productValueInList(particleListName, variable)"
), Variable::make_function(productValueInList), std::string("[Eventbased] Returns the product of the given variable of the particles in the given particle list."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("productValueInList"));
4007 "[Eventbased] Returns the product of the given variable of the particles in the given particle list.", Manager::VariableDataType::c_double)static Proxy _variableproxy4007(std::string("productValueInList(particleListName, variable)"
), Variable::make_function(productValueInList), std::string("[Eventbased] Returns the product of the given variable of the particles in the given particle list."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("productValueInList"));
;
4008 REGISTER_METAVARIABLE("angleToClosestInList(particleListName)", angleToClosestInList,static Proxy _variableproxy4009(std::string("angleToClosestInList(particleListName)"
), Variable::make_function(angleToClosestInList), std::string
("Returns the angle between this particle and the closest particle (smallest opening angle) in the list provided. The unit of the angle is ``rad`` "
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleToClosestInList"));
4009 "Returns the angle between this particle and the closest particle (smallest opening angle) in the list provided. The unit of the angle is ``rad`` ", Manager::VariableDataType::c_double)static Proxy _variableproxy4009(std::string("angleToClosestInList(particleListName)"
), Variable::make_function(angleToClosestInList), std::string
("Returns the angle between this particle and the closest particle (smallest opening angle) in the list provided. The unit of the angle is ``rad`` "
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleToClosestInList"));
;
4010 REGISTER_METAVARIABLE("closestInList(particleListName, variable)", closestInList,static Proxy _variableproxy4011(std::string("closestInList(particleListName, variable)"
), Variable::make_function(closestInList), std::string("Returns `variable` for the closest particle (smallest opening angle) in the list provided."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("closestInList"));
4011 "Returns `variable` for the closest particle (smallest opening angle) in the list provided.", Manager::VariableDataType::c_double)static Proxy _variableproxy4011(std::string("closestInList(particleListName, variable)"
), Variable::make_function(closestInList), std::string("Returns `variable` for the closest particle (smallest opening angle) in the list provided."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("closestInList"));
;
4012 REGISTER_METAVARIABLE("angleToMostB2BInList(particleListName)", angleToMostB2BInList,static Proxy _variableproxy4013(std::string("angleToMostB2BInList(particleListName)"
), Variable::make_function(angleToMostB2BInList), std::string
("Returns the angle between this particle and the most back-to-back particle (closest opening angle to 180) in the list provided. The unit of the angle is ``rad`` "
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleToMostB2BInList"));
4013 "Returns the angle between this particle and the most back-to-back particle (closest opening angle to 180) in the list provided. The unit of the angle is ``rad`` ", Manager::VariableDataType::c_double)static Proxy _variableproxy4013(std::string("angleToMostB2BInList(particleListName)"
), Variable::make_function(angleToMostB2BInList), std::string
("Returns the angle between this particle and the most back-to-back particle (closest opening angle to 180) in the list provided. The unit of the angle is ``rad`` "
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("angleToMostB2BInList"));
;
4014 REGISTER_METAVARIABLE("deltaPhiToMostB2BPhiInList(particleListName)", deltaPhiToMostB2BPhiInList,static Proxy _variableproxy4015(std::string("deltaPhiToMostB2BPhiInList(particleListName)"
), Variable::make_function(deltaPhiToMostB2BPhiInList), std::
string("Returns the abs(delta phi) between this particle and the most back-to-back particle in phi (closest opening angle to 180) in the list provided. The unit of the angle is ``rad`` "
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("deltaPhiToMostB2BPhiInList"));
4015 "Returns the abs(delta phi) between this particle and the most back-to-back particle in phi (closest opening angle to 180) in the list provided. The unit of the angle is ``rad`` ", Manager::VariableDataType::c_double)static Proxy _variableproxy4015(std::string("deltaPhiToMostB2BPhiInList(particleListName)"
), Variable::make_function(deltaPhiToMostB2BPhiInList), std::
string("Returns the abs(delta phi) between this particle and the most back-to-back particle in phi (closest opening angle to 180) in the list provided. The unit of the angle is ``rad`` "
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("deltaPhiToMostB2BPhiInList"));
;
4016 REGISTER_METAVARIABLE("mostB2BInList(particleListName, variable)", mostB2BInList,static Proxy _variableproxy4017(std::string("mostB2BInList(particleListName, variable)"
), Variable::make_function(mostB2BInList), std::string("Returns `variable` for the most back-to-back particle (closest opening angle to 180) in the list provided."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mostB2BInList"));
4017 "Returns `variable` for the most back-to-back particle (closest opening angle to 180) in the list provided.", Manager::VariableDataType::c_double)static Proxy _variableproxy4017(std::string("mostB2BInList(particleListName, variable)"
), Variable::make_function(mostB2BInList), std::string("Returns `variable` for the most back-to-back particle (closest opening angle to 180) in the list provided."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("mostB2BInList"));
;
4018 REGISTER_METAVARIABLE("maxOpeningAngleInList(particleListName)", maxOpeningAngleInList,static Proxy _variableproxy4019(std::string("maxOpeningAngleInList(particleListName)"
), Variable::make_function(maxOpeningAngleInList), std::string
("[Eventbased] Returns maximum opening angle in the given particle List. The unit of the angle is ``rad`` "
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("maxOpeningAngleInList"));
4019 "[Eventbased] Returns maximum opening angle in the given particle List. The unit of the angle is ``rad`` ", Manager::VariableDataType::c_double)static Proxy _variableproxy4019(std::string("maxOpeningAngleInList(particleListName)"
), Variable::make_function(maxOpeningAngleInList), std::string
("[Eventbased] Returns maximum opening angle in the given particle List. The unit of the angle is ``rad`` "
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("maxOpeningAngleInList"));
;
4020 REGISTER_METAVARIABLE("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)", daughterCombination,R"DOC(static Proxy _variableproxy4034(std::string("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)"
), Variable::make_function(daughterCombination), std::string(
R"DOC( Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters. .. warning:: ``variable`` can only be a function of the daughters' 4-momenta. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. .. tip:: ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle. ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterCombination"));
4021Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters.static Proxy _variableproxy4034(std::string("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)"
), Variable::make_function(daughterCombination), std::string(
R"DOC( Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters. .. warning:: ``variable`` can only be a function of the daughters' 4-momenta. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. .. tip:: ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle. ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterCombination"));
4022
4023.. warning::static Proxy _variableproxy4034(std::string("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)"
), Variable::make_function(daughterCombination), std::string(
R"DOC( Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters. .. warning:: ``variable`` can only be a function of the daughters' 4-momenta. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. .. tip:: ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle. ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterCombination"));
4024 ``variable`` can only be a function of the daughters' 4-momenta.static Proxy _variableproxy4034(std::string("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)"
), Variable::make_function(daughterCombination), std::string(
R"DOC( Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters. .. warning:: ``variable`` can only be a function of the daughters' 4-momenta. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. .. tip:: ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle. ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterCombination"));
4025
4026Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separatedstatic Proxy _variableproxy4034(std::string("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)"
), Variable::make_function(daughterCombination), std::string(
R"DOC( Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters. .. warning:: ``variable`` can only be a function of the daughters' 4-momenta. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. .. tip:: ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle. ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterCombination"));
4027the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourthstatic Proxy _variableproxy4034(std::string("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)"
), Variable::make_function(daughterCombination), std::string(
R"DOC( Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters. .. warning:: ``variable`` can only be a function of the daughters' 4-momenta. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. .. tip:: ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle. ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterCombination"));
4028daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle.static Proxy _variableproxy4034(std::string("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)"
), Variable::make_function(daughterCombination), std::string(
R"DOC( Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters. .. warning:: ``variable`` can only be a function of the daughters' 4-momenta. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. .. tip:: ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle. ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterCombination"));
4029
4030.. tip::static Proxy _variableproxy4034(std::string("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)"
), Variable::make_function(daughterCombination), std::string(
R"DOC( Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters. .. warning:: ``variable`` can only be a function of the daughters' 4-momenta. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. .. tip:: ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle. ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterCombination"));
4031 ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle.static Proxy _variableproxy4034(std::string("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)"
), Variable::make_function(daughterCombination), std::string(
R"DOC( Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters. .. warning:: ``variable`` can only be a function of the daughters' 4-momenta. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. .. tip:: ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle. ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterCombination"));
4032 ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter.static Proxy _variableproxy4034(std::string("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)"
), Variable::make_function(daughterCombination), std::string(
R"DOC( Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters. .. warning:: ``variable`` can only be a function of the daughters' 4-momenta. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. .. tip:: ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle. ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterCombination"));
4033
4034)DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy4034(std::string("daughterCombination(variable, daughterIndex_1, daughterIndex_2 ... daughterIndex_n)"
), Variable::make_function(daughterCombination), std::string(
R"DOC( Returns a ``variable`` function only of the 4-momentum calculated on an arbitrary set of (grand)daughters. .. warning:: ``variable`` can only be a function of the daughters' 4-momenta. Daughters from different generations of the decay tree can be combined using generalized daughter indexes, which are simply colon-separated the list of daughter indexes, starting from the root particle: for example, ``0:1:3`` identifies the fourth daughter (3) of the second daughter (1) of the first daughter (0) of the mother particle. .. tip:: ``daughterCombination(M, 0, 3, 4)`` will return the invariant mass of the system made of the first, fourth and fifth daughter of particle. ``daughterCombination(M, 0:0, 3:0)`` will return the invariant mass of the system made of the first daughter of the first daughter and the first daughter of the fourth daughter. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("daughterCombination"));
;
4035 REGISTER_METAVARIABLE("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)", useAlternativeDaughterHypothesis,R"DOC(static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4036Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters.static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4037
4038.. warning::static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4039 ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum.static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4040 This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit.static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4041 Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions.static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4042 In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed).static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4043
4044.. warning::static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4045 Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters.static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4046
4047.. tip::static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4048 ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay.static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4049 ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay.static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
4050
4051)DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy4051(std::string("useAlternativeDaughterHypothesis(variable, daughterIndex_1:newMassHyp_1, ..., daughterIndex_n:newMassHyp_n)"
), Variable::make_function(useAlternativeDaughterHypothesis),
std::string(R"DOC( Returns a ``variable`` calculated using new mass hypotheses for (some of) the particle's daughters. .. warning:: ``variable`` can only be a function of the particle 4-momentum, which is re-calculated as the sum of the daughters' 4-momenta, and the daughters' 4-momentum. This means that if you made a kinematic fit without updating the daughters' momenta, the result of this variable will not reflect the effect of the kinematic fit. Also, the track fit is not performed again: the variable only re-calculates the 4-vectors using different mass assumptions. In the variable, a copy of the given particle is created with daughters' alternative mass assumption (i.e. the original particle and daughters are not changed). .. warning:: Generalized daughter indexes are not supported (yet!): this variable can be used only on first-generation daughters. .. tip:: ``useAlternativeDaughterHypothesis(M, 0:K+, 2:pi-)`` will return the invariant mass of the particle assuming that the first daughter is a kaon and the third is a pion, instead of whatever was used in reconstructing the decay. ``useAlternativeDaughterHypothesis(mRecoil, 1:p+)`` will return the recoil mass of the particle assuming that the second daughter is a proton instead of whatever was used in reconstructing the decay. )DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("useAlternativeDaughterHypothesis"))
;
;
4052 REGISTER_METAVARIABLE("varForFirstMCAncestorOfType(type, variable)",varForFirstMCAncestorOfType,R"DOC(Returns requested variable of the first ancestor of the given type.static Proxy _variableproxy4053(std::string("varForFirstMCAncestorOfType(type, variable)"
), Variable::make_function(varForFirstMCAncestorOfType), std::
string(R"DOC(Returns requested variable of the first ancestor of the given type. Ancestor type can be set up by PDG code or by particle name (check evt.pdl for valid particle names))DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("varForFirstMCAncestorOfType"));
4053Ancestor type can be set up by PDG code or by particle name (check evt.pdl for valid particle names))DOC", Manager::VariableDataType::c_double)static Proxy _variableproxy4053(std::string("varForFirstMCAncestorOfType(type, variable)"
), Variable::make_function(varForFirstMCAncestorOfType), std::
string(R"DOC(Returns requested variable of the first ancestor of the given type. Ancestor type can be set up by PDG code or by particle name (check evt.pdl for valid particle names))DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_double), std::string("varForFirstMCAncestorOfType"));
;
4054
4055 REGISTER_METAVARIABLE("nTrackFitResults(particleType)", nTrackFitResults,static Proxy _variableproxy4057(std::string("nTrackFitResults(particleType)"
), Variable::make_function(nTrackFitResults), std::string("[Eventbased] Returns the total number of TrackFitResults for a given particleType. The argument can be the name of particle (e.g. pi+) or PDG code (e.g. 211)."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nTrackFitResults"));
4056 "[Eventbased] Returns the total number of TrackFitResults for a given particleType. The argument can be the name of particle (e.g. pi+) or PDG code (e.g. 211).",static Proxy _variableproxy4057(std::string("nTrackFitResults(particleType)"
), Variable::make_function(nTrackFitResults), std::string("[Eventbased] Returns the total number of TrackFitResults for a given particleType. The argument can be the name of particle (e.g. pi+) or PDG code (e.g. 211)."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nTrackFitResults"));
4057 Manager::VariableDataType::c_int)static Proxy _variableproxy4057(std::string("nTrackFitResults(particleType)"
), Variable::make_function(nTrackFitResults), std::string("[Eventbased] Returns the total number of TrackFitResults for a given particleType. The argument can be the name of particle (e.g. pi+) or PDG code (e.g. 211)."
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("nTrackFitResults"));
;
4058
4059 REGISTER_METAVARIABLE("convertToDaughterIndex(variable)", convertToDaughterIndex, R"DOC(Converts the variable of the given particle into integer and returns it if it is a valid daughter index, else returns -1.)DOC", Manager::VariableDataType::c_int)static Proxy _variableproxy4059(std::string("convertToDaughterIndex(variable)"
), Variable::make_function(convertToDaughterIndex), std::string
(R"DOC(Converts the variable of the given particle into integer and returns it if it is a valid daughter index, else returns -1.)DOC"
), Variable::Manager::VariableDataType(Manager::VariableDataType
::c_int), std::string("convertToDaughterIndex"));
;
4060
4061 }
4062}

/cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/c++/bits/stl_vector.h

1// Vector implementation -*- C++ -*-
2
3// Copyright (C) 2001-2025 Free Software Foundation, Inc.
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
24
25/*
26 *
27 * Copyright (c) 1994
28 * Hewlett-Packard Company
29 *
30 * Permission to use, copy, modify, distribute and sell this software
31 * and its documentation for any purpose is hereby granted without fee,
32 * provided that the above copyright notice appear in all copies and
33 * that both that copyright notice and this permission notice appear
34 * in supporting documentation. Hewlett-Packard Company makes no
35 * representations about the suitability of this software for any
36 * purpose. It is provided "as is" without express or implied warranty.
37 *
38 *
39 * Copyright (c) 1996
40 * Silicon Graphics Computer Systems, Inc.
41 *
42 * Permission to use, copy, modify, distribute and sell this software
43 * and its documentation for any purpose is hereby granted without fee,
44 * provided that the above copyright notice appear in all copies and
45 * that both that copyright notice and this permission notice appear
46 * in supporting documentation. Silicon Graphics makes no
47 * representations about the suitability of this software for any
48 * purpose. It is provided "as is" without express or implied warranty.
49 */
50
51/** @file bits/stl_vector.h
52 * This is an internal header file, included by other library headers.
53 * Do not attempt to use it directly. @headername{vector}
54 */
55
56#ifndef _STL_VECTOR_H1
57#define _STL_VECTOR_H1 1
58
59#include <bits/stl_iterator_base_funcs.h>
60#include <bits/functexcept.h>
61#include <bits/concept_check.h>
62#if __cplusplus202002L >= 201103L
63#include <initializer_list>
64#endif
65#if __cplusplus202002L >= 202002L
66# include <compare>
67#endif
68#if __glibcxx_concepts202002L // C++ >= C++20
69# include <bits/ranges_base.h> // ranges::distance
70#endif
71#if __glibcxx_containers_ranges // C++ >= 23
72# include <bits/ranges_algobase.h> // ranges::copy
73# include <bits/ranges_util.h> // ranges::subrange
74#endif
75
76#include <debug/assertions.h>
77
78#if _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
79extern "C" void
80__sanitizer_annotate_contiguous_container(const void*, const void*,
81 const void*, const void*);
82#endif
83
84namespace std _GLIBCXX_VISIBILITY(default)__attribute__ ((__visibility__ ("default")))
85{
86_GLIBCXX_BEGIN_NAMESPACE_VERSION
87_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
88
89 /// See bits/stl_deque.h's _Deque_base for an explanation.
90 template<typename _Tp, typename _Alloc>
91 struct _Vector_base
92 {
93 typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
94 rebind<_Tp>::other _Tp_alloc_type;
95 typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer
96 pointer;
97
98 struct _Vector_impl_data
99 {
100 pointer _M_start;
101 pointer _M_finish;
102 pointer _M_end_of_storage;
103
104 _GLIBCXX20_CONSTEXPRconstexpr
105 _Vector_impl_data() _GLIBCXX_NOEXCEPTnoexcept
106 : _M_start(), _M_finish(), _M_end_of_storage()
107 { }
108
109#if __cplusplus202002L >= 201103L
110 _GLIBCXX20_CONSTEXPRconstexpr
111 _Vector_impl_data(_Vector_impl_data&& __x) noexcept
112 : _M_start(__x._M_start), _M_finish(__x._M_finish),
113 _M_end_of_storage(__x._M_end_of_storage)
114 { __x._M_start = __x._M_finish = __x._M_end_of_storage = pointer(); }
115#endif
116
117 _GLIBCXX20_CONSTEXPRconstexpr
118 void
119 _M_copy_data(_Vector_impl_data const& __x) _GLIBCXX_NOEXCEPTnoexcept
120 {
121 _M_start = __x._M_start;
122 _M_finish = __x._M_finish;
123 _M_end_of_storage = __x._M_end_of_storage;
124 }
125
126 _GLIBCXX20_CONSTEXPRconstexpr
127 void
128 _M_swap_data(_Vector_impl_data& __x) _GLIBCXX_NOEXCEPTnoexcept
129 {
130 // Do not use std::swap(_M_start, __x._M_start), etc as it loses
131 // information used by TBAA.
132 _Vector_impl_data __tmp;
133 __tmp._M_copy_data(*this);
134 _M_copy_data(__x);
135 __x._M_copy_data(__tmp);
136 }
137 };
138
139 struct _Vector_impl
140 : public _Tp_alloc_type, public _Vector_impl_data
141 {
142 _GLIBCXX20_CONSTEXPRconstexpr
143 _Vector_impl() _GLIBCXX_NOEXCEPT_IF(noexcept(is_nothrow_default_constructible<_Tp_alloc_type>
::value)
144 is_nothrow_default_constructible<_Tp_alloc_type>::value)noexcept(is_nothrow_default_constructible<_Tp_alloc_type>
::value)
145#if __cpp_lib_concepts202002L
146 requires is_default_constructible_v<_Tp_alloc_type>
147#endif
148 : _Tp_alloc_type()
149 { }
150
151 _GLIBCXX20_CONSTEXPRconstexpr
152 _Vector_impl(_Tp_alloc_type const& __a) _GLIBCXX_NOEXCEPTnoexcept
153 : _Tp_alloc_type(__a)
154 { }
155
156#if __cplusplus202002L >= 201103L
157 // Not defaulted, to enforce noexcept(true) even when
158 // !is_nothrow_move_constructible<_Tp_alloc_type>.
159 _GLIBCXX20_CONSTEXPRconstexpr
160 _Vector_impl(_Vector_impl&& __x) noexcept
161 : _Tp_alloc_type(std::move(__x)), _Vector_impl_data(std::move(__x))
162 { }
163
164 _GLIBCXX20_CONSTEXPRconstexpr
165 _Vector_impl(_Tp_alloc_type&& __a) noexcept
166 : _Tp_alloc_type(std::move(__a))
167 { }
168
169 _GLIBCXX20_CONSTEXPRconstexpr
170 _Vector_impl(_Tp_alloc_type&& __a, _Vector_impl&& __rv) noexcept
171 : _Tp_alloc_type(std::move(__a)), _Vector_impl_data(std::move(__rv))
172 { }
173#endif
174
175#if _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
176 template<typename = _Tp_alloc_type>
177 struct _Asan
178 {
179 typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>
180 ::size_type size_type;
181
182 static _GLIBCXX20_CONSTEXPRconstexpr void
183 _S_shrink(_Vector_impl&, size_type) { }
184 static _GLIBCXX20_CONSTEXPRconstexpr void
185 _S_on_dealloc(_Vector_impl&) { }
186
187 typedef _Vector_impl& _Reinit;
188
189 struct _Grow
190 {
191 _GLIBCXX20_CONSTEXPRconstexpr _Grow(_Vector_impl&, size_type) { }
192 _GLIBCXX20_CONSTEXPRconstexpr void _M_grew(size_type) { }
193 };
194 };
195
196 // Enable ASan annotations for memory obtained from std::allocator.
197 template<typename _Up>
198 struct _Asan<allocator<_Up> >
199 {
200 typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>
201 ::size_type size_type;
202
203 // Adjust ASan annotation for [_M_start, _M_end_of_storage) to
204 // mark end of valid region as __curr instead of __prev.
205 static _GLIBCXX20_CONSTEXPRconstexpr void
206 _S_adjust(_Vector_impl& __impl, pointer __prev, pointer __curr)
207 {
208#if __cpp_lib_is_constant_evaluated201811L
209 if (std::is_constant_evaluated())
210 return;
211#endif
212 __sanitizer_annotate_contiguous_container(__impl._M_start,
213 __impl._M_end_of_storage, __prev, __curr);
214 }
215
216 static _GLIBCXX20_CONSTEXPRconstexpr void
217 _S_grow(_Vector_impl& __impl, size_type __n)
218 { _S_adjust(__impl, __impl._M_finish, __impl._M_finish + __n); }
219
220 static _GLIBCXX20_CONSTEXPRconstexpr void
221 _S_shrink(_Vector_impl& __impl, size_type __n)
222 { _S_adjust(__impl, __impl._M_finish + __n, __impl._M_finish); }
223
224 static _GLIBCXX20_CONSTEXPRconstexpr void
225 _S_on_dealloc(_Vector_impl& __impl)
226 {
227 if (__impl._M_start)
228 _S_adjust(__impl, __impl._M_finish, __impl._M_end_of_storage);
229 }
230
231 // Used on reallocation to tell ASan unused capacity is invalid.
232 struct _Reinit
233 {
234 explicit _GLIBCXX20_CONSTEXPRconstexpr
235 _Reinit(_Vector_impl& __impl) : _M_impl(__impl)
236 {
237 // Mark unused capacity as valid again before deallocating it.
238 _S_on_dealloc(_M_impl);
239 }
240
241 _GLIBCXX20_CONSTEXPRconstexpr
242 ~_Reinit()
243 {
244 // Mark unused capacity as invalid after reallocation.
245 if (_M_impl._M_start)
246 _S_adjust(_M_impl, _M_impl._M_end_of_storage,
247 _M_impl._M_finish);
248 }
249
250 _Vector_impl& _M_impl;
251
252#if __cplusplus202002L >= 201103L
253 _Reinit(const _Reinit&) = delete;
254 _Reinit& operator=(const _Reinit&) = delete;
255#endif
256 };
257
258 // Tell ASan when unused capacity is initialized to be valid.
259 struct _Grow
260 {
261 _GLIBCXX20_CONSTEXPRconstexpr
262 _Grow(_Vector_impl& __impl, size_type __n)
263 : _M_impl(__impl), _M_n(__n)
264 { _S_grow(_M_impl, __n); }
265
266 _GLIBCXX20_CONSTEXPRconstexpr
267 ~_Grow() { if (_M_n) _S_shrink(_M_impl, _M_n); }
268
269 _GLIBCXX20_CONSTEXPRconstexpr
270 void _M_grew(size_type __n) { _M_n -= __n; }
271
272#if __cplusplus202002L >= 201103L
273 _Grow(const _Grow&) = delete;
274 _Grow& operator=(const _Grow&) = delete;
275#endif
276 private:
277 _Vector_impl& _M_impl;
278 size_type _M_n;
279 };
280 };
281
282#define _GLIBCXX_ASAN_ANNOTATE_REINIT \
283 typename _Base::_Vector_impl::template _Asan<>::_Reinit const \
284 __attribute__((__unused__)) __reinit_guard(this->_M_impl)
285#define _GLIBCXX_ASAN_ANNOTATE_GROW(n) \
286 typename _Base::_Vector_impl::template _Asan<>::_Grow \
287 __attribute__((__unused__)) __grow_guard(this->_M_impl, (n))
288#define _GLIBCXX_ASAN_ANNOTATE_GREW(n) __grow_guard._M_grew(n)
289#define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n) \
290 _Base::_Vector_impl::template _Asan<>::_S_shrink(this->_M_impl, n)
291#define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC \
292 _Base::_Vector_impl::template _Asan<>::_S_on_dealloc(this->_M_impl)
293#else // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR)
294#define _GLIBCXX_ASAN_ANNOTATE_REINIT
295#define _GLIBCXX_ASAN_ANNOTATE_GROW(n)
296#define _GLIBCXX_ASAN_ANNOTATE_GREW(n)
297#define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n)
298#define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC
299#endif // _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
300 };
301
302 public:
303 typedef _Alloc allocator_type;
304
305 _GLIBCXX20_CONSTEXPRconstexpr
306 _Tp_alloc_type&
307 _M_get_Tp_allocator() _GLIBCXX_NOEXCEPTnoexcept
308 { return this->_M_impl; }
309
310 _GLIBCXX20_CONSTEXPRconstexpr
311 const _Tp_alloc_type&
312 _M_get_Tp_allocator() const _GLIBCXX_NOEXCEPTnoexcept
313 { return this->_M_impl; }
314
315 _GLIBCXX20_CONSTEXPRconstexpr
316 allocator_type
317 get_allocator() const _GLIBCXX_NOEXCEPTnoexcept
318 { return allocator_type(_M_get_Tp_allocator()); }
319
320#if __cplusplus202002L >= 201103L
321 _Vector_base() = default;
322#else
323 _Vector_base() { }
324#endif
325
326 _GLIBCXX20_CONSTEXPRconstexpr
327 _Vector_base(const allocator_type& __a) _GLIBCXX_NOEXCEPTnoexcept
328 : _M_impl(__a) { }
329
330 // Kept for ABI compatibility.
331#if !_GLIBCXX_INLINE_VERSION0
332 _GLIBCXX20_CONSTEXPRconstexpr
333 _Vector_base(size_t __n)
334 : _M_impl()
335 { _M_create_storage(__n); }
336#endif
337
338 _GLIBCXX20_CONSTEXPRconstexpr
339 _Vector_base(size_t __n, const allocator_type& __a)
340 : _M_impl(__a)
341 { _M_create_storage(__n); }
342
343#if __cplusplus202002L >= 201103L
344 _Vector_base(_Vector_base&&) = default;
345
346 // Kept for ABI compatibility.
347# if !_GLIBCXX_INLINE_VERSION0
348 _GLIBCXX20_CONSTEXPRconstexpr
349 _Vector_base(_Tp_alloc_type&& __a) noexcept
350 : _M_impl(std::move(__a)) { }
351
352 _GLIBCXX20_CONSTEXPRconstexpr
353 _Vector_base(_Vector_base&& __x, const allocator_type& __a)
354 : _M_impl(__a)
355 {
356 if (__x.get_allocator() == __a)
357 this->_M_impl._M_swap_data(__x._M_impl);
358 else
359 {
360 size_t __n = __x._M_impl._M_finish - __x._M_impl._M_start;
361 _M_create_storage(__n);
362 }
363 }
364# endif
365
366 _GLIBCXX20_CONSTEXPRconstexpr
367 _Vector_base(const allocator_type& __a, _Vector_base&& __x)
368 : _M_impl(_Tp_alloc_type(__a), std::move(__x._M_impl))
369 { }
370#endif
371
372 _GLIBCXX20_CONSTEXPRconstexpr
373 ~_Vector_base() _GLIBCXX_NOEXCEPTnoexcept
374 {
375 _M_deallocate(_M_impl._M_start,
376 _M_impl._M_end_of_storage - _M_impl._M_start);
377 }
378
379 public:
380 _Vector_impl _M_impl;
381
382 _GLIBCXX20_CONSTEXPRconstexpr
383 pointer
384 _M_allocate(size_t __n)
385 {
386 typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
387 return __n != 0 ? _Tr::allocate(_M_impl, __n) : pointer();
388 }
389
390 _GLIBCXX20_CONSTEXPRconstexpr
391 void
392 _M_deallocate(pointer __p, size_t __n)
393 {
394 typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Tr;
395 if (__p)
396 _Tr::deallocate(_M_impl, __p, __n);
397 }
398
399 protected:
400
401 _GLIBCXX20_CONSTEXPRconstexpr
402 void
403 _M_create_storage(size_t __n)
404 {
405 this->_M_impl._M_start = this->_M_allocate(__n);
406 this->_M_impl._M_finish = this->_M_impl._M_start;
407 this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
408 }
409
410#if __glibcxx_containers_ranges // C++ >= 23
411 // Called by insert_range, and indirectly by assign_range, append_range.
412 // Initializes new elements in storage at __ptr and updates __ptr to
413 // point after the last new element.
414 // Provides strong exception safety guarantee.
415 // Requires [ptr, ptr+distance(rg)) is a valid range.
416 template<ranges::input_range _Rg>
417 constexpr void
418 _M_append_range_to(_Rg&& __rg, pointer& __ptr)
419 {
420 __ptr = std::__uninitialized_copy_a(ranges::begin(__rg),
421 ranges::end(__rg),
422 __ptr, _M_get_Tp_allocator());
423 }
424
425 // Called by assign_range, append_range, insert_range.
426 // Requires capacity() >= size()+distance(rg).
427 template<ranges::input_range _Rg>
428 constexpr void
429 _M_append_range(_Rg&& __rg)
430 { _M_append_range_to(std::forward<_Rg>(__rg), _M_impl._M_finish); }
431#endif
432 };
433
434 /**
435 * @brief A standard container which offers fixed time access to
436 * individual elements in any order.
437 *
438 * @ingroup sequences
439 * @headerfile vector
440 * @since C++98
441 *
442 * @tparam _Tp Type of element.
443 * @tparam _Alloc Allocator type, defaults to allocator<_Tp>.
444 *
445 * Meets the requirements of a <a href="tables.html#65">container</a>, a
446 * <a href="tables.html#66">reversible container</a>, and a
447 * <a href="tables.html#67">sequence</a>, including the
448 * <a href="tables.html#68">optional sequence requirements</a> with the
449 * %exception of @c push_front and @c pop_front.
450 *
451 * In some terminology a %vector can be described as a dynamic
452 * C-style array, it offers fast and efficient access to individual
453 * elements in any order and saves the user from worrying about
454 * memory and size allocation. Subscripting ( @c [] ) access is
455 * also provided as with C-style arrays.
456 */
457 template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
458 class vector : protected _Vector_base<_Tp, _Alloc>
459 {
460#ifdef _GLIBCXX_CONCEPT_CHECKS
461 // Concept requirements.
462 typedef typename _Alloc::value_type _Alloc_value_type;
463# if __cplusplus202002L < 201103L
464 __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
465# endif
466 __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept)
467#endif
468
469#if __cplusplus202002L >= 201103L
470 static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
471 "std::vector must have a non-const, non-volatile value_type");
472# if __cplusplus202002L > 201703L || defined __STRICT_ANSI__1
473 static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
474 "std::vector must have the same value_type as its allocator");
475# endif
476#endif
477
478 typedef _Vector_base<_Tp, _Alloc> _Base;
479 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
480 typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits;
481
482 public:
483 typedef _Tp value_type;
484 typedef typename _Base::pointer pointer;
485 typedef typename _Alloc_traits::const_pointer const_pointer;
486 typedef typename _Alloc_traits::reference reference;
487 typedef typename _Alloc_traits::const_reference const_reference;
488 typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
489 typedef __gnu_cxx::__normal_iterator<const_pointer, vector>
490 const_iterator;
491 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
492 typedef std::reverse_iterator<iterator> reverse_iterator;
493 typedef size_t size_type;
494 typedef ptrdiff_t difference_type;
495 typedef _Alloc allocator_type;
496
497 private:
498#if __cplusplus202002L >= 201103L
499 static constexpr bool
500 _S_nothrow_relocate(true_type)
501 {
502 return noexcept(std::__relocate_a(std::declval<pointer>(),
503 std::declval<pointer>(),
504 std::declval<pointer>(),
505 std::declval<_Tp_alloc_type&>()));
506 }
507
508 static constexpr bool
509 _S_nothrow_relocate(false_type)
510 { return false; }
511
512 static constexpr bool
513 _S_use_relocate()
514 {
515 // Instantiating std::__relocate_a might cause an error outside the
516 // immediate context (in __relocate_object_a's noexcept-specifier),
517 // so only do it if we know the type can be move-inserted into *this.
518 return _S_nothrow_relocate(__is_move_insertable<_Tp_alloc_type>{});
519 }
520
521 static pointer
522 _S_do_relocate(pointer __first, pointer __last, pointer __result,
523 _Tp_alloc_type& __alloc, true_type) noexcept
524 {
525 return std::__relocate_a(__first, __last, __result, __alloc);
526 }
527
528 static pointer
529 _S_do_relocate(pointer, pointer, pointer __result,
530 _Tp_alloc_type&, false_type) noexcept
531 { return __result; }
532
533 static _GLIBCXX20_CONSTEXPRconstexpr pointer
534 _S_relocate(pointer __first, pointer __last, pointer __result,
535 _Tp_alloc_type& __alloc) noexcept
536 {
537#if __cpp_if_constexpr201606L
538 // All callers have already checked _S_use_relocate() so just do it.
539 return std::__relocate_a(__first, __last, __result, __alloc);
540#else
541 using __do_it = __bool_constant<_S_use_relocate()>;
542 return _S_do_relocate(__first, __last, __result, __alloc, __do_it{});
543#endif
544 }
545#endif // C++11
546
547 protected:
548 using _Base::_M_allocate;
549 using _Base::_M_deallocate;
550 using _Base::_M_impl;
551 using _Base::_M_get_Tp_allocator;
552
553 public:
554 // [23.2.4.1] construct/copy/destroy
555 // (assign() and get_allocator() are also listed in this section)
556
557 /**
558 * @brief Creates a %vector with no elements.
559 */
560#if __cplusplus202002L >= 201103L
561 vector() = default;
562#else
563 vector() { }
564#endif
565
566 /**
567 * @brief Creates a %vector with no elements.
568 * @param __a An allocator object.
569 */
570 explicit
571 _GLIBCXX20_CONSTEXPRconstexpr
572 vector(const allocator_type& __a) _GLIBCXX_NOEXCEPTnoexcept
573 : _Base(__a) { }
574
575#if __cplusplus202002L >= 201103L
576 /**
577 * @brief Creates a %vector with default constructed elements.
578 * @param __n The number of elements to initially create.
579 * @param __a An allocator.
580 *
581 * This constructor fills the %vector with @a __n default
582 * constructed elements.
583 */
584 explicit
585 _GLIBCXX20_CONSTEXPRconstexpr
586 vector(size_type __n, const allocator_type& __a = allocator_type())
587 : _Base(_S_check_init_len(__n, __a), __a)
588 { _M_default_initialize(__n); }
589
590 /**
591 * @brief Creates a %vector with copies of an exemplar element.
592 * @param __n The number of elements to initially create.
593 * @param __value An element to copy.
594 * @param __a An allocator.
595 *
596 * This constructor fills the %vector with @a __n copies of @a __value.
597 */
598 _GLIBCXX20_CONSTEXPRconstexpr
599 vector(size_type __n, const value_type& __value,
600 const allocator_type& __a = allocator_type())
601 : _Base(_S_check_init_len(__n, __a), __a)
602 { _M_fill_initialize(__n, __value); }
603#else
604 /**
605 * @brief Creates a %vector with copies of an exemplar element.
606 * @param __n The number of elements to initially create.
607 * @param __value An element to copy.
608 * @param __a An allocator.
609 *
610 * This constructor fills the %vector with @a __n copies of @a __value.
611 */
612 explicit
613 vector(size_type __n, const value_type& __value = value_type(),
614 const allocator_type& __a = allocator_type())
615 : _Base(_S_check_init_len(__n, __a), __a)
616 { _M_fill_initialize(__n, __value); }
617#endif
618
619 /**
620 * @brief %Vector copy constructor.
621 * @param __x A %vector of identical element and allocator types.
622 *
623 * All the elements of @a __x are copied, but any unused capacity in
624 * @a __x will not be copied
625 * (i.e. capacity() == size() in the new %vector).
626 *
627 * The newly-created %vector uses a copy of the allocator object used
628 * by @a __x (unless the allocator traits dictate a different object).
629 */
630 _GLIBCXX20_CONSTEXPRconstexpr
631 vector(const vector& __x)
632 : _Base(__x.size(),
633 _Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()))
634 {
635 this->_M_impl._M_finish =
636 std::__uninitialized_copy_a(__x.begin(), __x.end(),
637 this->_M_impl._M_start,
638 _M_get_Tp_allocator());
639 }
640
641#if __cplusplus202002L >= 201103L
642 /**
643 * @brief %Vector move constructor.
644 *
645 * The newly-created %vector contains the exact contents of the
646 * moved instance.
647 * The contents of the moved instance are a valid, but unspecified
648 * %vector.
649 */
650 vector(vector&&) noexcept = default;
651
652 /// Copy constructor with alternative allocator
653 _GLIBCXX20_CONSTEXPRconstexpr
654 vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
655 : _Base(__x.size(), __a)
656 {
657 this->_M_impl._M_finish =
658 std::__uninitialized_copy_a(__x.begin(), __x.end(),
659 this->_M_impl._M_start,
660 _M_get_Tp_allocator());
661 }
662
663 private:
664 _GLIBCXX20_CONSTEXPRconstexpr
665 vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
666 : _Base(__m, std::move(__rv))
667 { }
668
669 _GLIBCXX20_CONSTEXPRconstexpr
670 vector(vector&& __rv, const allocator_type& __m, false_type)
671 : _Base(__m)
672 {
673 if (__rv.get_allocator() == __m)
674 this->_M_impl._M_swap_data(__rv._M_impl);
675 else if (!__rv.empty())
676 {
677 this->_M_create_storage(__rv.size());
678 this->_M_impl._M_finish =
679 std::__uninitialized_move_a(__rv.begin(), __rv.end(),
680 this->_M_impl._M_start,
681 _M_get_Tp_allocator());
682 __rv.clear();
683 }
684 }
685
686 public:
687 /// Move constructor with alternative allocator
688 _GLIBCXX20_CONSTEXPRconstexpr
689 vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
690 noexcept( noexcept(
691 vector(std::declval<vector&&>(), std::declval<const allocator_type&>(),
692 std::declval<typename _Alloc_traits::is_always_equal>())) )
693 : vector(std::move(__rv), __m, typename _Alloc_traits::is_always_equal{})
694 { }
695
696 /**
697 * @brief Builds a %vector from an initializer list.
698 * @param __l An initializer_list.
699 * @param __a An allocator.
700 *
701 * Create a %vector consisting of copies of the elements in the
702 * initializer_list @a __l.
703 *
704 * This will call the element type's copy constructor N times
705 * (where N is @a __l.size()) and do no memory reallocation.
706 */
707 _GLIBCXX20_CONSTEXPRconstexpr
708 vector(initializer_list<value_type> __l,
709 const allocator_type& __a = allocator_type())
710 : _Base(__a)
711 {
712 _M_range_initialize_n(__l.begin(), __l.end(), __l.size());
713 }
714#endif
715
716 /**
717 * @brief Builds a %vector from a range.
718 * @param __first An input iterator.
719 * @param __last An input iterator.
720 * @param __a An allocator.
721 *
722 * Create a %vector consisting of copies of the elements from
723 * [first,last).
724 *
725 * If the iterators are forward, bidirectional, or
726 * random-access, then this will call the elements' copy
727 * constructor N times (where N is distance(first,last)) and do
728 * no memory reallocation. But if only input iterators are
729 * used, then this will do at most 2N calls to the copy
730 * constructor, and logN memory reallocations.
731 */
732#if __cplusplus202002L >= 201103L
733 template<typename _InputIterator,
734 typename = std::_RequireInputIter<_InputIterator>>
735 _GLIBCXX20_CONSTEXPRconstexpr
736 vector(_InputIterator __first, _InputIterator __last,
737 const allocator_type& __a = allocator_type())
738 : _Base(__a)
739 {
740#if __glibcxx_concepts202002L // C++ >= C++20
741 if constexpr (sized_sentinel_for<_InputIterator, _InputIterator>
742 || forward_iterator<_InputIterator>)
743 {
744 const auto __n
745 = static_cast<size_type>(ranges::distance(__first, __last));
746 _M_range_initialize_n(__first, __last, __n);
747 return;
748 }
749 else
750#endif
751 _M_range_initialize(__first, __last,
752 std::__iterator_category(__first));
753 }
754#else
755 template<typename _InputIterator>
756 vector(_InputIterator __first, _InputIterator __last,
757 const allocator_type& __a = allocator_type())
758 : _Base(__a)
759 {
760 // Check whether it's an integral type. If so, it's not an iterator.
761 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
762 _M_initialize_dispatch(__first, __last, _Integral());
763 }
764#endif
765
766#if __glibcxx_containers_ranges // C++ >= 23
767 /**
768 * @brief Construct a vector from a range.
769 * @param __rg A range of values that are convertible to `bool`.
770 * @since C++23
771 */
772 template<__detail::__container_compatible_range<_Tp> _Rg>
773 constexpr
774 vector(from_range_t, _Rg&& __rg, const _Alloc& __a = _Alloc())
775 : vector(__a)
776 {
777 if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
778 {
779 const auto __n = static_cast<size_type>(ranges::distance(__rg));
780 _M_range_initialize_n(ranges::begin(__rg), ranges::end(__rg),
781 __n);
782 }
783 else
784 {
785 auto __first = ranges::begin(__rg);
786 const auto __last = ranges::end(__rg);
787 for (; __first != __last; ++__first)
788 emplace_back(*__first);
789 }
790 }
791#endif
792
793 /**
794 * The dtor only erases the elements, and note that if the
795 * elements themselves are pointers, the pointed-to memory is
796 * not touched in any way. Managing the pointer is the user's
797 * responsibility.
798 */
799 _GLIBCXX20_CONSTEXPRconstexpr
800 ~vector() _GLIBCXX_NOEXCEPTnoexcept
801 {
802 std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
803 _M_get_Tp_allocator());
804 _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC;
805 }
806
807 /**
808 * @brief %Vector assignment operator.
809 * @param __x A %vector of identical element and allocator types.
810 *
811 * All the elements of @a __x are copied, but any unused capacity in
812 * @a __x will not be copied.
813 *
814 * Whether the allocator is copied depends on the allocator traits.
815 */
816 _GLIBCXX20_CONSTEXPRconstexpr
817 vector&
818 operator=(const vector& __x);
819
820#if __cplusplus202002L >= 201103L
821 /**
822 * @brief %Vector move assignment operator.
823 * @param __x A %vector of identical element and allocator types.
824 *
825 * The contents of @a __x are moved into this %vector (without copying,
826 * if the allocators permit it).
827 * Afterwards @a __x is a valid, but unspecified %vector.
828 *
829 * Whether the allocator is moved depends on the allocator traits.
830 */
831 _GLIBCXX20_CONSTEXPRconstexpr
832 vector&
833 operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
834 {
835 constexpr bool __move_storage =
836 _Alloc_traits::_S_propagate_on_move_assign()
837 || _Alloc_traits::_S_always_equal();
838 _M_move_assign(std::move(__x), __bool_constant<__move_storage>());
839 return *this;
840 }
841
842 /**
843 * @brief %Vector list assignment operator.
844 * @param __l An initializer_list.
845 *
846 * This function fills a %vector with copies of the elements in the
847 * initializer list @a __l.
848 *
849 * Note that the assignment completely changes the %vector and
850 * that the resulting %vector's size is the same as the number
851 * of elements assigned.
852 */
853 _GLIBCXX20_CONSTEXPRconstexpr
854 vector&
855 operator=(initializer_list<value_type> __l)
856 {
857 this->_M_assign_aux(__l.begin(), __l.end(),
858 random_access_iterator_tag());
859 return *this;
860 }
861#endif
862
863 /**
864 * @brief Assigns a given value to a %vector.
865 * @param __n Number of elements to be assigned.
866 * @param __val Value to be assigned.
867 *
868 * This function fills a %vector with @a __n copies of the given
869 * value. Note that the assignment completely changes the
870 * %vector and that the resulting %vector's size is the same as
871 * the number of elements assigned.
872 */
873 _GLIBCXX20_CONSTEXPRconstexpr
874 void
875 assign(size_type __n, const value_type& __val)
876 { _M_fill_assign(__n, __val); }
877
878 /**
879 * @brief Assigns a range to a %vector.
880 * @param __first An input iterator.
881 * @param __last An input iterator.
882 *
883 * This function fills a %vector with copies of the elements in the
884 * range [__first,__last).
885 *
886 * Note that the assignment completely changes the %vector and
887 * that the resulting %vector's size is the same as the number
888 * of elements assigned.
889 */
890#if __cplusplus202002L >= 201103L
891 template<typename _InputIterator,
892 typename = std::_RequireInputIter<_InputIterator>>
893 _GLIBCXX20_CONSTEXPRconstexpr
894 void
895 assign(_InputIterator __first, _InputIterator __last)
896 { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
897#else
898 template<typename _InputIterator>
899 void
900 assign(_InputIterator __first, _InputIterator __last)
901 {
902 // Check whether it's an integral type. If so, it's not an iterator.
903 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
904 _M_assign_dispatch(__first, __last, _Integral());
905 }
906#endif
907
908#if __cplusplus202002L >= 201103L
909 /**
910 * @brief Assigns an initializer list to a %vector.
911 * @param __l An initializer_list.
912 *
913 * This function fills a %vector with copies of the elements in the
914 * initializer list @a __l.
915 *
916 * Note that the assignment completely changes the %vector and
917 * that the resulting %vector's size is the same as the number
918 * of elements assigned.
919 */
920 _GLIBCXX20_CONSTEXPRconstexpr
921 void
922 assign(initializer_list<value_type> __l)
923 {
924 this->_M_assign_aux(__l.begin(), __l.end(),
925 random_access_iterator_tag());
926 }
927#endif
928
929#if __glibcxx_containers_ranges // C++ >= 23
930 /**
931 * @brief Assign a range to the vector.
932 * @param __rg A range of values that are convertible to `value_type`.
933 * @pre `__rg` and `*this` do not overlap.
934 * @since C++23
935 */
936 template<__detail::__container_compatible_range<_Tp> _Rg>
937 constexpr void
938 assign_range(_Rg&& __rg)
939 {
940 static_assert(assignable_from<_Tp&, ranges::range_reference_t<_Rg>>);
941
942 if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
943 {
944 const auto __n = size_type(ranges::distance(__rg));
945 if (__n <= size())
946 {
947 auto __res = ranges::copy(__rg, this->_M_impl._M_start);
948 _M_erase_at_end(__res.out);
949 return;
950 }
951
952 reserve(__n);
953 auto __first = ranges::copy_n(ranges::begin(__rg), size(),
954 this->_M_impl._M_start).in;
955 [[maybe_unused]] const auto __diff = __n - size();
956 _GLIBCXX_ASAN_ANNOTATE_GROW(__diff);
957 _Base::_M_append_range(ranges::subrange(std::move(__first),
958 ranges::end(__rg)));
959 _GLIBCXX_ASAN_ANNOTATE_GREW(__diff);
960 }
961 else // input_range<_Rg> && !sized_range<_Rg>
962 {
963 auto __first = ranges::begin(__rg);
964 const auto __last = ranges::end(__rg);
965 pointer __ptr = this->_M_impl._M_start;
966 pointer const __end = this->_M_impl._M_finish;
967
968 while (__ptr < __end && __first != __last)
969 {
970 *__ptr = *__first;
971 ++__ptr;
972 ++__first;
973 }
974
975 if (__first == __last)
976 _M_erase_at_end(__ptr);
977 else
978 {
979 do
980 emplace_back(*__first);
981 while (++__first != __last);
982 }
983 }
984 }
985#endif // containers_ranges
986
987 /// Get a copy of the memory allocation object.
988 using _Base::get_allocator;
989
990 // iterators
991 /**
992 * Returns a read/write iterator that points to the first
993 * element in the %vector. Iteration is done in ordinary
994 * element order.
995 */
996 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
997 iterator
998 begin() _GLIBCXX_NOEXCEPTnoexcept
999 { return iterator(this->_M_impl._M_start); }
1000
1001 /**
1002 * Returns a read-only (constant) iterator that points to the
1003 * first element in the %vector. Iteration is done in ordinary
1004 * element order.
1005 */
1006 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1007 const_iterator
1008 begin() const _GLIBCXX_NOEXCEPTnoexcept
1009 { return const_iterator(this->_M_impl._M_start); }
1010
1011 /**
1012 * Returns a read/write iterator that points one past the last
1013 * element in the %vector. Iteration is done in ordinary
1014 * element order.
1015 */
1016 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1017 iterator
1018 end() _GLIBCXX_NOEXCEPTnoexcept
1019 { return iterator(this->_M_impl._M_finish); }
1020
1021 /**
1022 * Returns a read-only (constant) iterator that points one past
1023 * the last element in the %vector. Iteration is done in
1024 * ordinary element order.
1025 */
1026 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1027 const_iterator
1028 end() const _GLIBCXX_NOEXCEPTnoexcept
1029 { return const_iterator(this->_M_impl._M_finish); }
1030
1031 /**
1032 * Returns a read/write reverse iterator that points to the
1033 * last element in the %vector. Iteration is done in reverse
1034 * element order.
1035 */
1036 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1037 reverse_iterator
1038 rbegin() _GLIBCXX_NOEXCEPTnoexcept
1039 { return reverse_iterator(end()); }
1040
1041 /**
1042 * Returns a read-only (constant) reverse iterator that points
1043 * to the last element in the %vector. Iteration is done in
1044 * reverse element order.
1045 */
1046 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1047 const_reverse_iterator
1048 rbegin() const _GLIBCXX_NOEXCEPTnoexcept
1049 { return const_reverse_iterator(end()); }
1050
1051 /**
1052 * Returns a read/write reverse iterator that points to one
1053 * before the first element in the %vector. Iteration is done
1054 * in reverse element order.
1055 */
1056 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1057 reverse_iterator
1058 rend() _GLIBCXX_NOEXCEPTnoexcept
1059 { return reverse_iterator(begin()); }
1060
1061 /**
1062 * Returns a read-only (constant) reverse iterator that points
1063 * to one before the first element in the %vector. Iteration
1064 * is done in reverse element order.
1065 */
1066 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1067 const_reverse_iterator
1068 rend() const _GLIBCXX_NOEXCEPTnoexcept
1069 { return const_reverse_iterator(begin()); }
1070
1071#if __cplusplus202002L >= 201103L
1072 /**
1073 * Returns a read-only (constant) iterator that points to the
1074 * first element in the %vector. Iteration is done in ordinary
1075 * element order.
1076 */
1077 [[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1078 const_iterator
1079 cbegin() const noexcept
1080 { return const_iterator(this->_M_impl._M_start); }
1081
1082 /**
1083 * Returns a read-only (constant) iterator that points one past
1084 * the last element in the %vector. Iteration is done in
1085 * ordinary element order.
1086 */
1087 [[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1088 const_iterator
1089 cend() const noexcept
1090 { return const_iterator(this->_M_impl._M_finish); }
1091
1092 /**
1093 * Returns a read-only (constant) reverse iterator that points
1094 * to the last element in the %vector. Iteration is done in
1095 * reverse element order.
1096 */
1097 [[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1098 const_reverse_iterator
1099 crbegin() const noexcept
1100 { return const_reverse_iterator(end()); }
1101
1102 /**
1103 * Returns a read-only (constant) reverse iterator that points
1104 * to one before the first element in the %vector. Iteration
1105 * is done in reverse element order.
1106 */
1107 [[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1108 const_reverse_iterator
1109 crend() const noexcept
1110 { return const_reverse_iterator(begin()); }
1111#endif
1112
1113 // [23.2.4.2] capacity
1114 /** Returns the number of elements in the %vector. */
1115 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1116 size_type
1117 size() const _GLIBCXX_NOEXCEPTnoexcept
1118 {
1119 ptrdiff_t __dif = this->_M_impl._M_finish - this->_M_impl._M_start;
1120 if (__dif < 0)
1121 __builtin_unreachable ();
1122 return size_type(__dif);
1123 }
1124
1125 /** Returns the size() of the largest possible %vector. */
1126 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1127 size_type
1128 max_size() const _GLIBCXX_NOEXCEPTnoexcept
1129 { return _S_max_size(_M_get_Tp_allocator()); }
1130
1131#if __cplusplus202002L >= 201103L
1132 /**
1133 * @brief Resizes the %vector to the specified number of elements.
1134 * @param __new_size Number of elements the %vector should contain.
1135 *
1136 * This function will %resize the %vector to the specified
1137 * number of elements. If the number is smaller than the
1138 * %vector's current size the %vector is truncated, otherwise
1139 * default constructed elements are appended.
1140 */
1141 _GLIBCXX20_CONSTEXPRconstexpr
1142 void
1143 resize(size_type __new_size)
1144 {
1145 if (__new_size > size())
1146 _M_default_append(__new_size - size());
1147 else if (__new_size < size())
1148 _M_erase_at_end(this->_M_impl._M_start + __new_size);
1149 }
1150
1151 /**
1152 * @brief Resizes the %vector to the specified number of elements.
1153 * @param __new_size Number of elements the %vector should contain.
1154 * @param __x Data with which new elements should be populated.
1155 *
1156 * This function will %resize the %vector to the specified
1157 * number of elements. If the number is smaller than the
1158 * %vector's current size the %vector is truncated, otherwise
1159 * the %vector is extended and new elements are populated with
1160 * given data.
1161 */
1162 _GLIBCXX20_CONSTEXPRconstexpr
1163 void
1164 resize(size_type __new_size, const value_type& __x)
1165 {
1166 if (__new_size > size())
1167 _M_fill_insert(end(), __new_size - size(), __x);
1168 else if (__new_size < size())
1169 _M_erase_at_end(this->_M_impl._M_start + __new_size);
1170 }
1171#else
1172 /**
1173 * @brief Resizes the %vector to the specified number of elements.
1174 * @param __new_size Number of elements the %vector should contain.
1175 * @param __x Data with which new elements should be populated.
1176 *
1177 * This function will %resize the %vector to the specified
1178 * number of elements. If the number is smaller than the
1179 * %vector's current size the %vector is truncated, otherwise
1180 * the %vector is extended and new elements are populated with
1181 * given data.
1182 */
1183 _GLIBCXX20_CONSTEXPRconstexpr
1184 void
1185 resize(size_type __new_size, value_type __x = value_type())
1186 {
1187 if (__new_size > size())
1188 _M_fill_insert(end(), __new_size - size(), __x);
1189 else if (__new_size < size())
1190 _M_erase_at_end(this->_M_impl._M_start + __new_size);
1191 }
1192#endif
1193
1194#if __cplusplus202002L >= 201103L
1195 /** A non-binding request to reduce capacity() to size(). */
1196 _GLIBCXX20_CONSTEXPRconstexpr
1197 void
1198 shrink_to_fit()
1199 { _M_shrink_to_fit(); }
1200#endif
1201
1202 /**
1203 * Returns the total number of elements that the %vector can
1204 * hold before needing to allocate more memory.
1205 */
1206 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1207 size_type
1208 capacity() const _GLIBCXX_NOEXCEPTnoexcept
1209 {
1210 ptrdiff_t __dif = this->_M_impl._M_end_of_storage
1211 - this->_M_impl._M_start;
1212 if (__dif < 0)
1213 __builtin_unreachable ();
1214 return size_type(__dif);
1215 }
1216
1217 /**
1218 * Returns true if the %vector is empty. (Thus begin() would
1219 * equal end().)
1220 */
1221 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1222 bool
1223 empty() const _GLIBCXX_NOEXCEPTnoexcept
1224 { return begin() == end(); }
1225
1226 /**
1227 * @brief Attempt to preallocate enough memory for specified number of
1228 * elements.
1229 * @param __n Number of elements required.
1230 * @throw std::length_error If @a n exceeds @c max_size().
1231 *
1232 * This function attempts to reserve enough memory for the
1233 * %vector to hold the specified number of elements. If the
1234 * number requested is more than max_size(), length_error is
1235 * thrown.
1236 *
1237 * The advantage of this function is that if optimal code is a
1238 * necessity and the user can determine the number of elements
1239 * that will be required, the user can reserve the memory in
1240 * %advance, and thus prevent a possible reallocation of memory
1241 * and copying of %vector data.
1242 */
1243 _GLIBCXX20_CONSTEXPRconstexpr
1244 void
1245 reserve(size_type __n);
1246
1247 // element access
1248 /**
1249 * @brief Subscript access to the data contained in the %vector.
1250 * @param __n The index of the element for which data should be
1251 * accessed.
1252 * @return Read/write reference to data.
1253 *
1254 * This operator allows for easy, array-style, data access.
1255 * Note that data access with this operator is unchecked and
1256 * out_of_range lookups are not defined. (For checked lookups
1257 * see at().)
1258 */
1259 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1260 reference
1261 operator[](size_type __n) _GLIBCXX_NOEXCEPTnoexcept
1262 {
1263 __glibcxx_requires_subscript(__n)do { if (std::__is_constant_evaluated() && !bool(__n <
this->size())) std::__glibcxx_assert_fail(); } while (false
)
;
1264 return *(this->_M_impl._M_start + __n);
1265 }
1266
1267 /**
1268 * @brief Subscript access to the data contained in the %vector.
1269 * @param __n The index of the element for which data should be
1270 * accessed.
1271 * @return Read-only (constant) reference to data.
1272 *
1273 * This operator allows for easy, array-style, data access.
1274 * Note that data access with this operator is unchecked and
1275 * out_of_range lookups are not defined. (For checked lookups
1276 * see at().)
1277 */
1278 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1279 const_reference
1280 operator[](size_type __n) const _GLIBCXX_NOEXCEPTnoexcept
1281 {
1282 __glibcxx_requires_subscript(__n)do { if (std::__is_constant_evaluated() && !bool(__n <
this->size())) std::__glibcxx_assert_fail(); } while (false
)
;
1283 return *(this->_M_impl._M_start + __n);
1284 }
1285
1286 protected:
1287 /// Safety check used only from at().
1288 _GLIBCXX20_CONSTEXPRconstexpr
1289 void
1290 _M_range_check(size_type __n) const
1291 {
1292 if (__n >= this->size())
1293 __throw_out_of_range_fmt(__N("vector::_M_range_check: __n "("vector::_M_range_check: __n " "(which is %zu) >= this->size() "
"(which is %zu)")
1294 "(which is %zu) >= this->size() "("vector::_M_range_check: __n " "(which is %zu) >= this->size() "
"(which is %zu)")
1295 "(which is %zu)")("vector::_M_range_check: __n " "(which is %zu) >= this->size() "
"(which is %zu)")
,
1296 __n, this->size());
1297 }
1298
1299 public:
1300 /**
1301 * @brief Provides access to the data contained in the %vector.
1302 * @param __n The index of the element for which data should be
1303 * accessed.
1304 * @return Read/write reference to data.
1305 * @throw std::out_of_range If @a __n is an invalid index.
1306 *
1307 * This function provides for safer data access. The parameter
1308 * is first checked that it is in the range of the vector. The
1309 * function throws out_of_range if the check fails.
1310 */
1311 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1312 reference
1313 at(size_type __n)
1314 {
1315 _M_range_check(__n);
1316 return (*this)[__n];
1317 }
1318
1319 /**
1320 * @brief Provides access to the data contained in the %vector.
1321 * @param __n The index of the element for which data should be
1322 * accessed.
1323 * @return Read-only (constant) reference to data.
1324 * @throw std::out_of_range If @a __n is an invalid index.
1325 *
1326 * This function provides for safer data access. The parameter
1327 * is first checked that it is in the range of the vector. The
1328 * function throws out_of_range if the check fails.
1329 */
1330 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1331 const_reference
1332 at(size_type __n) const
1333 {
1334 _M_range_check(__n);
1335 return (*this)[__n];
1336 }
1337
1338 /**
1339 * Returns a read/write reference to the data at the first
1340 * element of the %vector.
1341 */
1342 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1343 reference
1344 front() _GLIBCXX_NOEXCEPTnoexcept
1345 {
1346 __glibcxx_requires_nonempty()do { if (std::__is_constant_evaluated() && !bool(!this
->empty())) std::__glibcxx_assert_fail(); } while (false)
;
1347 return *begin();
1348 }
1349
1350 /**
1351 * Returns a read-only (constant) reference to the data at the first
1352 * element of the %vector.
1353 */
1354 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1355 const_reference
1356 front() const _GLIBCXX_NOEXCEPTnoexcept
1357 {
1358 __glibcxx_requires_nonempty()do { if (std::__is_constant_evaluated() && !bool(!this
->empty())) std::__glibcxx_assert_fail(); } while (false)
;
1359 return *begin();
1360 }
1361
1362 /**
1363 * Returns a read/write reference to the data at the last
1364 * element of the %vector.
1365 */
1366 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1367 reference
1368 back() _GLIBCXX_NOEXCEPTnoexcept
1369 {
1370 __glibcxx_requires_nonempty()do { if (std::__is_constant_evaluated() && !bool(!this
->empty())) std::__glibcxx_assert_fail(); } while (false)
;
1371 return *(end() - 1);
1372 }
1373
1374 /**
1375 * Returns a read-only (constant) reference to the data at the
1376 * last element of the %vector.
1377 */
1378 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1379 const_reference
1380 back() const _GLIBCXX_NOEXCEPTnoexcept
1381 {
1382 __glibcxx_requires_nonempty()do { if (std::__is_constant_evaluated() && !bool(!this
->empty())) std::__glibcxx_assert_fail(); } while (false)
;
1383 return *(end() - 1);
1384 }
1385
1386 // _GLIBCXX_RESOLVE_LIB_DEFECTS
1387 // DR 464. Suggestion for new member functions in standard containers.
1388 // data access
1389 /**
1390 * Returns a pointer such that [data(), data() + size()) is a valid
1391 * range. For a non-empty %vector, data() == &front().
1392 */
1393 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1394 _Tp*
1395 data() _GLIBCXX_NOEXCEPTnoexcept
1396 { return _M_data_ptr(this->_M_impl._M_start); }
1397
1398 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
1399 const _Tp*
1400 data() const _GLIBCXX_NOEXCEPTnoexcept
1401 { return _M_data_ptr(this->_M_impl._M_start); }
1402
1403 // [23.2.4.3] modifiers
1404 /**
1405 * @brief Add data to the end of the %vector.
1406 * @param __x Data to be added.
1407 *
1408 * This is a typical stack operation. The function creates an
1409 * element at the end of the %vector and assigns the given data
1410 * to it. Due to the nature of a %vector this operation can be
1411 * done in constant time if the %vector has preallocated space
1412 * available.
1413 */
1414 _GLIBCXX20_CONSTEXPRconstexpr
1415 void
1416 push_back(const value_type& __x)
1417 {
1418 if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
1419 {
1420 _GLIBCXX_ASAN_ANNOTATE_GROW(1);
1421 _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
1422 __x);
1423 ++this->_M_impl._M_finish;
1424 _GLIBCXX_ASAN_ANNOTATE_GREW(1);
1425 }
1426 else
1427 _M_realloc_append(__x);
1428 }
1429
1430#if __cplusplus202002L >= 201103L
1431 _GLIBCXX20_CONSTEXPRconstexpr
1432 void
1433 push_back(value_type&& __x)
1434 { emplace_back(std::move(__x)); }
1435
1436 template<typename... _Args>
1437#if __cplusplus202002L > 201402L
1438 _GLIBCXX20_CONSTEXPRconstexpr
1439 reference
1440#else
1441 void
1442#endif
1443 emplace_back(_Args&&... __args);
1444#endif
1445
1446 /**
1447 * @brief Removes last element.
1448 *
1449 * This is a typical stack operation. It shrinks the %vector by one.
1450 *
1451 * Note that no data is returned, and if the last element's
1452 * data is needed, it should be retrieved before pop_back() is
1453 * called.
1454 */
1455 _GLIBCXX20_CONSTEXPRconstexpr
1456 void
1457 pop_back() _GLIBCXX_NOEXCEPTnoexcept
1458 {
1459 __glibcxx_requires_nonempty()do { if (std::__is_constant_evaluated() && !bool(!this
->empty())) std::__glibcxx_assert_fail(); } while (false)
;
1460 --this->_M_impl._M_finish;
1461 _Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
1462 _GLIBCXX_ASAN_ANNOTATE_SHRINK(1);
1463 }
1464
1465#if __cplusplus202002L >= 201103L
1466 /**
1467 * @brief Inserts an object in %vector before specified iterator.
1468 * @param __position A const_iterator into the %vector.
1469 * @param __args Arguments.
1470 * @return An iterator that points to the inserted data.
1471 *
1472 * This function will insert an object of type T constructed
1473 * with T(std::forward<Args>(args)...) before the specified location.
1474 * Note that this kind of operation could be expensive for a %vector
1475 * and if it is frequently used the user should consider using
1476 * std::list.
1477 */
1478 template<typename... _Args>
1479 _GLIBCXX20_CONSTEXPRconstexpr
1480 iterator
1481 emplace(const_iterator __position, _Args&&... __args)
1482 { return _M_emplace_aux(__position, std::forward<_Args>(__args)...); }
1483
1484 /**
1485 * @brief Inserts given value into %vector before specified iterator.
1486 * @param __position A const_iterator into the %vector.
1487 * @param __x Data to be inserted.
1488 * @return An iterator that points to the inserted data.
1489 *
1490 * This function will insert a copy of the given value before
1491 * the specified location. Note that this kind of operation
1492 * could be expensive for a %vector and if it is frequently
1493 * used the user should consider using std::list.
1494 */
1495 _GLIBCXX20_CONSTEXPRconstexpr
1496 iterator
1497 insert(const_iterator __position, const value_type& __x);
1498#else
1499 /**
1500 * @brief Inserts given value into %vector before specified iterator.
1501 * @param __position An iterator into the %vector.
1502 * @param __x Data to be inserted.
1503 * @return An iterator that points to the inserted data.
1504 *
1505 * This function will insert a copy of the given value before
1506 * the specified location. Note that this kind of operation
1507 * could be expensive for a %vector and if it is frequently
1508 * used the user should consider using std::list.
1509 */
1510 iterator
1511 insert(iterator __position, const value_type& __x);
1512#endif
1513
1514#if __cplusplus202002L >= 201103L
1515 /**
1516 * @brief Inserts given rvalue into %vector before specified iterator.
1517 * @param __position A const_iterator into the %vector.
1518 * @param __x Data to be inserted.
1519 * @return An iterator that points to the inserted data.
1520 *
1521 * This function will insert a copy of the given rvalue before
1522 * the specified location. Note that this kind of operation
1523 * could be expensive for a %vector and if it is frequently
1524 * used the user should consider using std::list.
1525 */
1526 _GLIBCXX20_CONSTEXPRconstexpr
1527 iterator
1528 insert(const_iterator __position, value_type&& __x)
1529 { return _M_insert_rval(__position, std::move(__x)); }
1530
1531 /**
1532 * @brief Inserts an initializer_list into the %vector.
1533 * @param __position An iterator into the %vector.
1534 * @param __l An initializer_list.
1535 *
1536 * This function will insert copies of the data in the
1537 * initializer_list @a l into the %vector before the location
1538 * specified by @a position.
1539 *
1540 * Note that this kind of operation could be expensive for a
1541 * %vector and if it is frequently used the user should
1542 * consider using std::list.
1543 */
1544 _GLIBCXX20_CONSTEXPRconstexpr
1545 iterator
1546 insert(const_iterator __position, initializer_list<value_type> __l)
1547 {
1548 auto __offset = __position - cbegin();
1549 _M_range_insert(begin() + __offset, __l.begin(), __l.end(),
1550 std::random_access_iterator_tag());
1551 return begin() + __offset;
1552 }
1553#endif
1554
1555#if __cplusplus202002L >= 201103L
1556 /**
1557 * @brief Inserts a number of copies of given data into the %vector.
1558 * @param __position A const_iterator into the %vector.
1559 * @param __n Number of elements to be inserted.
1560 * @param __x Data to be inserted.
1561 * @return An iterator that points to the inserted data.
1562 *
1563 * This function will insert a specified number of copies of
1564 * the given data before the location specified by @a position.
1565 *
1566 * Note that this kind of operation could be expensive for a
1567 * %vector and if it is frequently used the user should
1568 * consider using std::list.
1569 */
1570 _GLIBCXX20_CONSTEXPRconstexpr
1571 iterator
1572 insert(const_iterator __position, size_type __n, const value_type& __x)
1573 {
1574 difference_type __offset = __position - cbegin();
1575 _M_fill_insert(begin() + __offset, __n, __x);
1576 return begin() + __offset;
1577 }
1578#else
1579 /**
1580 * @brief Inserts a number of copies of given data into the %vector.
1581 * @param __position An iterator into the %vector.
1582 * @param __n Number of elements to be inserted.
1583 * @param __x Data to be inserted.
1584 *
1585 * This function will insert a specified number of copies of
1586 * the given data before the location specified by @a position.
1587 *
1588 * Note that this kind of operation could be expensive for a
1589 * %vector and if it is frequently used the user should
1590 * consider using std::list.
1591 */
1592 void
1593 insert(iterator __position, size_type __n, const value_type& __x)
1594 { _M_fill_insert(__position, __n, __x); }
1595#endif
1596
1597#if __cplusplus202002L >= 201103L
1598 /**
1599 * @brief Inserts a range into the %vector.
1600 * @param __position A const_iterator into the %vector.
1601 * @param __first An input iterator.
1602 * @param __last An input iterator.
1603 * @return An iterator that points to the inserted data.
1604 *
1605 * This function will insert copies of the data in the range
1606 * [__first,__last) into the %vector before the location specified
1607 * by @a pos.
1608 *
1609 * Note that this kind of operation could be expensive for a
1610 * %vector and if it is frequently used the user should
1611 * consider using std::list.
1612 */
1613 template<typename _InputIterator,
1614 typename = std::_RequireInputIter<_InputIterator>>
1615 _GLIBCXX20_CONSTEXPRconstexpr
1616 iterator
1617 insert(const_iterator __position, _InputIterator __first,
1618 _InputIterator __last)
1619 {
1620 difference_type __offset = __position - cbegin();
1621 _M_range_insert(begin() + __offset, __first, __last,
1622 std::__iterator_category(__first));
1623 return begin() + __offset;
1624 }
1625#else
1626 /**
1627 * @brief Inserts a range into the %vector.
1628 * @param __position An iterator into the %vector.
1629 * @param __first An input iterator.
1630 * @param __last An input iterator.
1631 *
1632 * This function will insert copies of the data in the range
1633 * [__first,__last) into the %vector before the location specified
1634 * by @a pos.
1635 *
1636 * Note that this kind of operation could be expensive for a
1637 * %vector and if it is frequently used the user should
1638 * consider using std::list.
1639 */
1640 template<typename _InputIterator>
1641 void
1642 insert(iterator __position, _InputIterator __first,
1643 _InputIterator __last)
1644 {
1645 // Check whether it's an integral type. If so, it's not an iterator.
1646 typedef typename std::__is_integer<_InputIterator>::__type _Integral;
1647 _M_insert_dispatch(__position, __first, __last, _Integral());
1648 }
1649#endif
1650
1651#if __glibcxx_containers_ranges // C++ >= 23
1652 /**
1653 * @brief Insert a range into the vector.
1654 * @param __rg A range of values that are convertible to `value_type`.
1655 * @return An iterator that points to the first new element inserted,
1656 * or to `__pos` if `__rg` is an empty range.
1657 * @pre `__rg` and `*this` do not overlap.
1658 * @since C++23
1659 */
1660 template<__detail::__container_compatible_range<_Tp> _Rg>
1661 constexpr iterator
1662 insert_range(const_iterator __pos, _Rg&& __rg);
1663
1664 /**
1665 * @brief Append a range at the end of the vector.
1666 * @param __rg A range of values that are convertible to `value_type`.
1667 * @since C++23
1668 */
1669 template<__detail::__container_compatible_range<_Tp> _Rg>
1670 constexpr void
1671 append_range(_Rg&& __rg)
1672 {
1673 // N.B. __rg may overlap with *this, so we must copy from __rg before
1674 // existing elements or iterators referring to *this are invalidated.
1675 // e.g. in v.append_range(views::concat(v, foo)) rg overlaps v.
1676 if constexpr (ranges::forward_range<_Rg> || ranges::sized_range<_Rg>)
1677 {
1678 const auto __n = size_type(ranges::distance(__rg));
1679
1680 // If there is no existing storage, there are no iterators that
1681 // can be referring to our storage, so it's safe to allocate now.
1682 if (capacity() == 0)
1683 reserve(__n);
1684
1685 const auto __sz = size();
1686 const auto __capacity = capacity();
1687 if ((__capacity - __sz) >= __n)
1688 {
1689 _GLIBCXX_ASAN_ANNOTATE_GROW(__n);
1690 _Base::_M_append_range(__rg);
1691 _GLIBCXX_ASAN_ANNOTATE_GREW(__n);
1692 return;
1693 }
1694
1695 const size_type __len = _M_check_len(__n, "vector::append_range");
1696
1697 pointer __old_start = this->_M_impl._M_start;
1698 pointer __old_finish = this->_M_impl._M_finish;
1699
1700 allocator_type& __a = _M_get_Tp_allocator();
1701 const pointer __start = this->_M_allocate(__len);
1702 const pointer __mid = __start + __sz;
1703 const pointer __back = __mid + __n;
1704 _Guard_alloc __guard(__start, __len, *this);
1705 std::__uninitialized_copy_a(ranges::begin(__rg),
1706 ranges::end(__rg),
1707 __mid, __a);
1708
1709 if constexpr (_S_use_relocate())
1710 _S_relocate(__old_start, __old_finish, __start, __a);
1711 else
1712 {
1713 // RAII type to destroy initialized elements.
1714 struct _Guard_elts
1715 {
1716 pointer _M_first, _M_last; // Elements to destroy
1717 _Tp_alloc_type& _M_alloc;
1718
1719 constexpr
1720 _Guard_elts(pointer __f, pointer __l, _Tp_alloc_type& __a)
1721 : _M_first(__f), _M_last(__l), _M_alloc(__a)
1722 { }
1723
1724 constexpr
1725 ~_Guard_elts()
1726 { std::_Destroy(_M_first, _M_last, _M_alloc); }
1727
1728 _Guard_elts(_Guard_elts&&) = delete;
1729 };
1730 _Guard_elts __guard_elts{__mid, __back, __a};
1731
1732 std::__uninitialized_move_a(__old_start, __old_finish,
1733 __start, __a);
1734
1735 // Let old elements get destroyed by __guard_elts:
1736 __guard_elts._M_first = __old_start;
1737 __guard_elts._M_last = __old_finish;
1738 }
1739
1740 // Now give ownership of old storage to __guard:
1741 __guard._M_storage = __old_start;
1742 __guard._M_len = __capacity;
1743 // Finally, take ownership of new storage:
1744 this->_M_impl._M_start = __start;
1745 this->_M_impl._M_finish = __back;
1746 this->_M_impl._M_end_of_storage = __start + __len;
1747 }
1748 else
1749 {
1750 auto __first = ranges::begin(__rg);
1751 const auto __last = ranges::end(__rg);
1752
1753 // Fill up to the end of current capacity.
1754 for (auto __free = capacity() - size();
1755 __first != __last && __free > 0;
1756 ++__first, (void) --__free)
1757 emplace_back(*__first);
1758
1759 if (__first == __last)
1760 return;
1761
1762 // Copy the rest of the range to a new vector.
1763 vector __tmp(_M_get_Tp_allocator());
1764 for (; __first != __last; ++__first)
1765 __tmp.emplace_back(*__first);
1766 reserve(_M_check_len(__tmp.size(), "vector::append_range"));
1767 ranges::subrange __r(std::make_move_iterator(__tmp.begin()),
1768 std::make_move_iterator(__tmp.end()));
1769 append_range(__r); // This will take the fast path above.
1770 }
1771 }
1772#endif // containers_ranges
1773
1774 /**
1775 * @brief Remove element at given position.
1776 * @param __position Iterator pointing to element to be erased.
1777 * @return An iterator pointing to the next element (or end()).
1778 *
1779 * This function will erase the element at the given position and thus
1780 * shorten the %vector by one.
1781 *
1782 * Note This operation could be expensive and if it is
1783 * frequently used the user should consider using std::list.
1784 * The user is also cautioned that this function only erases
1785 * the element, and that if the element is itself a pointer,
1786 * the pointed-to memory is not touched in any way. Managing
1787 * the pointer is the user's responsibility.
1788 */
1789 _GLIBCXX20_CONSTEXPRconstexpr
1790 iterator
1791#if __cplusplus202002L >= 201103L
1792 erase(const_iterator __position)
1793 { return _M_erase(begin() + (__position - cbegin())); }
1794#else
1795 erase(iterator __position)
1796 { return _M_erase(__position); }
1797#endif
1798
1799 /**
1800 * @brief Remove a range of elements.
1801 * @param __first Iterator pointing to the first element to be erased.
1802 * @param __last Iterator pointing to one past the last element to be
1803 * erased.
1804 * @return An iterator pointing to the element pointed to by @a __last
1805 * prior to erasing (or end()).
1806 *
1807 * This function will erase the elements in the range
1808 * [__first,__last) and shorten the %vector accordingly.
1809 *
1810 * Note This operation could be expensive and if it is
1811 * frequently used the user should consider using std::list.
1812 * The user is also cautioned that this function only erases
1813 * the elements, and that if the elements themselves are
1814 * pointers, the pointed-to memory is not touched in any way.
1815 * Managing the pointer is the user's responsibility.
1816 */
1817 _GLIBCXX20_CONSTEXPRconstexpr
1818 iterator
1819#if __cplusplus202002L >= 201103L
1820 erase(const_iterator __first, const_iterator __last)
1821 {
1822 const auto __beg = begin();
1823 const auto __cbeg = cbegin();
1824 return _M_erase(__beg + (__first - __cbeg), __beg + (__last - __cbeg));
1825 }
1826#else
1827 erase(iterator __first, iterator __last)
1828 { return _M_erase(__first, __last); }
1829#endif
1830
1831 /**
1832 * @brief Swaps data with another %vector.
1833 * @param __x A %vector of the same element and allocator types.
1834 *
1835 * This exchanges the elements between two vectors in constant time.
1836 * (Three pointers, so it should be quite fast.)
1837 * Note that the global std::swap() function is specialized such that
1838 * std::swap(v1,v2) will feed to this function.
1839 *
1840 * Whether the allocators are swapped depends on the allocator traits.
1841 */
1842 _GLIBCXX20_CONSTEXPRconstexpr
1843 void
1844 swap(vector& __x) _GLIBCXX_NOEXCEPTnoexcept
1845 {
1846#if __cplusplus202002L >= 201103L
1847 __glibcxx_assert(_Alloc_traits::propagate_on_container_swap::valuedo { if (std::__is_constant_evaluated() && !bool(_Alloc_traits
::propagate_on_container_swap::value || _M_get_Tp_allocator()
== __x._M_get_Tp_allocator())) std::__glibcxx_assert_fail();
} while (false)
1848 || _M_get_Tp_allocator() == __x._M_get_Tp_allocator())do { if (std::__is_constant_evaluated() && !bool(_Alloc_traits
::propagate_on_container_swap::value || _M_get_Tp_allocator()
== __x._M_get_Tp_allocator())) std::__glibcxx_assert_fail();
} while (false)
;
1849#endif
1850 this->_M_impl._M_swap_data(__x._M_impl);
1851 _Alloc_traits::_S_on_swap(_M_get_Tp_allocator(),
1852 __x._M_get_Tp_allocator());
1853 }
1854
1855 /**
1856 * Erases all the elements. Note that this function only erases the
1857 * elements, and that if the elements themselves are pointers, the
1858 * pointed-to memory is not touched in any way. Managing the pointer is
1859 * the user's responsibility.
1860 */
1861 _GLIBCXX20_CONSTEXPRconstexpr
1862 void
1863 clear() _GLIBCXX_NOEXCEPTnoexcept
1864 { _M_erase_at_end(this->_M_impl._M_start); }
1865
1866 private:
1867 // RAII guard for allocated storage.
1868 struct _Guard_alloc
1869 {
1870 pointer _M_storage; // Storage to deallocate
1871 size_type _M_len;
1872 _Base& _M_vect;
1873
1874 _GLIBCXX20_CONSTEXPRconstexpr
1875 _Guard_alloc(pointer __s, size_type __l, _Base& __vect)
1876 : _M_storage(__s), _M_len(__l), _M_vect(__vect)
1877 { }
1878
1879 _GLIBCXX20_CONSTEXPRconstexpr
1880 ~_Guard_alloc()
1881 {
1882 if (_M_storage)
1883 _M_vect._M_deallocate(_M_storage, _M_len);
1884 }
1885
1886 _GLIBCXX20_CONSTEXPRconstexpr
1887 pointer
1888 _M_release()
1889 {
1890 pointer __res = _M_storage;
1891 _M_storage = pointer();
1892 return __res;
1893 }
1894
1895 private:
1896 _Guard_alloc(const _Guard_alloc&);
1897 };
1898
1899 protected:
1900 /**
1901 * Memory expansion handler. Uses the member allocation function to
1902 * obtain @a n bytes of memory, and then copies [first,last) into it.
1903 */
1904 template<typename _ForwardIterator>
1905 _GLIBCXX20_CONSTEXPRconstexpr
1906 pointer
1907 _M_allocate_and_copy(size_type __n,
1908 _ForwardIterator __first, _ForwardIterator __last)
1909 {
1910 _Guard_alloc __guard(this->_M_allocate(__n), __n, *this);
1911 std::__uninitialized_copy_a
1912 (__first, __last, __guard._M_storage, _M_get_Tp_allocator());
1913 return __guard._M_release();
1914 }
1915
1916
1917 // Internal constructor functions follow.
1918
1919 // Called by the range constructor to implement [23.1.1]/9
1920
1921#if __cplusplus202002L < 201103L
1922 // _GLIBCXX_RESOLVE_LIB_DEFECTS
1923 // 438. Ambiguity in the "do the right thing" clause
1924 template<typename _Integer>
1925 void
1926 _M_initialize_dispatch(_Integer __int_n, _Integer __value, __true_type)
1927 {
1928 const size_type __n = static_cast<size_type>(__int_n);
1929 pointer __start =
1930 _M_allocate(_S_check_init_len(__n, _M_get_Tp_allocator()));
1931 this->_M_impl._M_start = __start;
1932 this->_M_impl._M_end_of_storage = __start + __n;
1933 _M_fill_initialize(__n, __value);
1934 }
1935
1936 // Called by the range constructor to implement [23.1.1]/9
1937 template<typename _InputIterator>
1938 void
1939 _M_initialize_dispatch(_InputIterator __first, _InputIterator __last,
1940 __false_type)
1941 {
1942 _M_range_initialize(__first, __last,
1943 std::__iterator_category(__first));
1944 }
1945#endif
1946
1947 // Called by the second initialize_dispatch above
1948 template<typename _InputIterator>
1949 _GLIBCXX20_CONSTEXPRconstexpr
1950 void
1951 _M_range_initialize(_InputIterator __first, _InputIterator __last,
1952 std::input_iterator_tag)
1953 {
1954 __trytry {
1955 for (; __first != __last; ++__first)
1956#if __cplusplus202002L >= 201103L
1957 emplace_back(*__first);
1958#else
1959 push_back(*__first);
1960#endif
1961 } __catch(...)catch(...) {
1962 clear();
1963 __throw_exception_againthrow;
1964 }
1965 }
1966
1967 // Called by the second initialize_dispatch above
1968 template<typename _ForwardIterator>
1969 _GLIBCXX20_CONSTEXPRconstexpr
1970 void
1971 _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
1972 std::forward_iterator_tag)
1973 {
1974 _M_range_initialize_n(__first, __last,
1975 std::distance(__first, __last));
1976 }
1977
1978 template<typename _Iterator, typename _Sentinel>
1979 _GLIBCXX20_CONSTEXPRconstexpr
1980 void
1981 _M_range_initialize_n(_Iterator __first, _Sentinel __last,
1982 size_type __n)
1983 {
1984 pointer __start =
1985 this->_M_allocate(_S_check_init_len(__n, _M_get_Tp_allocator()));
1986 this->_M_impl._M_start = this->_M_impl._M_finish = __start;
1987 this->_M_impl._M_end_of_storage = __start + __n;
1988 this->_M_impl._M_finish
1989 = std::__uninitialized_copy_a(_GLIBCXX_MOVE(__first)std::move(__first), __last,
1990 __start, _M_get_Tp_allocator());
1991 }
1992
1993 // Called by the first initialize_dispatch above and by the
1994 // vector(n,value,a) constructor.
1995 _GLIBCXX20_CONSTEXPRconstexpr
1996 void
1997 _M_fill_initialize(size_type __n, const value_type& __value)
1998 {
1999 this->_M_impl._M_finish =
2000 std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
2001 _M_get_Tp_allocator());
2002 }
2003
2004#if __cplusplus202002L >= 201103L
2005 // Called by the vector(n) constructor.
2006 _GLIBCXX20_CONSTEXPRconstexpr
2007 void
2008 _M_default_initialize(size_type __n)
2009 {
2010 this->_M_impl._M_finish =
2011 std::__uninitialized_default_n_a(this->_M_impl._M_start, __n,
2012 _M_get_Tp_allocator());
2013 }
2014#endif
2015
2016 // Internal assign functions follow. The *_aux functions do the actual
2017 // assignment work for the range versions.
2018
2019 // Called by the range assign to implement [23.1.1]/9
2020
2021 // _GLIBCXX_RESOLVE_LIB_DEFECTS
2022 // 438. Ambiguity in the "do the right thing" clause
2023 template<typename _Integer>
2024 _GLIBCXX20_CONSTEXPRconstexpr
2025 void
2026 _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
2027 { _M_fill_assign(__n, __val); }
2028
2029 // Called by the range assign to implement [23.1.1]/9
2030 template<typename _InputIterator>
2031 _GLIBCXX20_CONSTEXPRconstexpr
2032 void
2033 _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
2034 __false_type)
2035 { _M_assign_aux(__first, __last, std::__iterator_category(__first)); }
2036
2037 // Called by the second assign_dispatch above
2038 template<typename _InputIterator>
2039 _GLIBCXX20_CONSTEXPRconstexpr
2040 void
2041 _M_assign_aux(_InputIterator __first, _InputIterator __last,
2042 std::input_iterator_tag);
2043
2044 // Called by the second assign_dispatch above
2045 template<typename _ForwardIterator>
2046 _GLIBCXX20_CONSTEXPRconstexpr
2047 void
2048 _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
2049 std::forward_iterator_tag);
2050
2051 // Called by assign(n,t), and the range assign when it turns out
2052 // to be the same thing.
2053 _GLIBCXX20_CONSTEXPRconstexpr
2054 void
2055 _M_fill_assign(size_type __n, const value_type& __val);
2056
2057 // Internal insert functions follow.
2058
2059 // Called by the range insert to implement [23.1.1]/9
2060
2061 // _GLIBCXX_RESOLVE_LIB_DEFECTS
2062 // 438. Ambiguity in the "do the right thing" clause
2063 template<typename _Integer>
2064 _GLIBCXX20_CONSTEXPRconstexpr
2065 void
2066 _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
2067 __true_type)
2068 { _M_fill_insert(__pos, __n, __val); }
2069
2070 // Called by the range insert to implement [23.1.1]/9
2071 template<typename _InputIterator>
2072 _GLIBCXX20_CONSTEXPRconstexpr
2073 void
2074 _M_insert_dispatch(iterator __pos, _InputIterator __first,
2075 _InputIterator __last, __false_type)
2076 {
2077 _M_range_insert(__pos, __first, __last,
2078 std::__iterator_category(__first));
2079 }
2080
2081 // Called by the second insert_dispatch above
2082 template<typename _InputIterator>
2083 _GLIBCXX20_CONSTEXPRconstexpr
2084 void
2085 _M_range_insert(iterator __pos, _InputIterator __first,
2086 _InputIterator __last, std::input_iterator_tag);
2087
2088 // Called by the second insert_dispatch above
2089 template<typename _ForwardIterator>
2090 _GLIBCXX20_CONSTEXPRconstexpr
2091 void
2092 _M_range_insert(iterator __pos, _ForwardIterator __first,
2093 _ForwardIterator __last, std::forward_iterator_tag);
2094
2095 // Called by insert(p,n,x), and the range insert when it turns out to be
2096 // the same thing.
2097 _GLIBCXX20_CONSTEXPRconstexpr
2098 void
2099 _M_fill_insert(iterator __pos, size_type __n, const value_type& __x);
2100
2101#if __cplusplus202002L >= 201103L
2102 // Called by resize(n).
2103 _GLIBCXX20_CONSTEXPRconstexpr
2104 void
2105 _M_default_append(size_type __n);
2106
2107 _GLIBCXX20_CONSTEXPRconstexpr
2108 bool
2109 _M_shrink_to_fit();
2110#endif
2111
2112#if __cplusplus202002L < 201103L
2113 // Called by insert(p,x)
2114 void
2115 _M_insert_aux(iterator __position, const value_type& __x);
2116
2117 void
2118 _M_realloc_insert(iterator __position, const value_type& __x);
2119
2120 void
2121 _M_realloc_append(const value_type& __x);
2122#else
2123 // A value_type object constructed with _Alloc_traits::construct()
2124 // and destroyed with _Alloc_traits::destroy().
2125 struct _Temporary_value
2126 {
2127 template<typename... _Args>
2128 _GLIBCXX20_CONSTEXPRconstexpr explicit
2129 _Temporary_value(vector* __vec, _Args&&... __args) : _M_this(__vec)
2130 {
2131 _Alloc_traits::construct(_M_this->_M_impl, _M_ptr(),
2132 std::forward<_Args>(__args)...);
2133 }
2134
2135 _GLIBCXX20_CONSTEXPRconstexpr
2136 ~_Temporary_value()
2137 { _Alloc_traits::destroy(_M_this->_M_impl, _M_ptr()); }
2138
2139 _GLIBCXX20_CONSTEXPRconstexpr value_type&
2140 _M_val() noexcept { return _M_storage._M_val; }
2141
2142 private:
2143 _GLIBCXX20_CONSTEXPRconstexpr _Tp*
2144 _M_ptr() noexcept { return std::__addressof(_M_storage._M_val); }
2145
2146 union _Storage
2147 {
2148 constexpr _Storage() : _M_byte() { }
2149 _GLIBCXX20_CONSTEXPRconstexpr ~_Storage() { }
2150 _Storage& operator=(const _Storage&) = delete;
2151 unsigned char _M_byte;
2152 _Tp _M_val;
2153 };
2154
2155 vector* _M_this;
2156 _Storage _M_storage;
2157 };
2158
2159 // Called by insert(p,x) and other functions when insertion needs to
2160 // reallocate or move existing elements. _Arg is either _Tp& or _Tp.
2161 template<typename _Arg>
2162 _GLIBCXX20_CONSTEXPRconstexpr
2163 void
2164 _M_insert_aux(iterator __position, _Arg&& __arg);
2165
2166 template<typename... _Args>
2167 _GLIBCXX20_CONSTEXPRconstexpr
2168 void
2169 _M_realloc_insert(iterator __position, _Args&&... __args);
2170
2171 template<typename... _Args>
2172 _GLIBCXX20_CONSTEXPRconstexpr
2173 void
2174 _M_realloc_append(_Args&&... __args);
2175
2176 // Either move-construct at the end, or forward to _M_insert_aux.
2177 _GLIBCXX20_CONSTEXPRconstexpr
2178 iterator
2179 _M_insert_rval(const_iterator __position, value_type&& __v);
2180
2181 // Try to emplace at the end, otherwise forward to _M_insert_aux.
2182 template<typename... _Args>
2183 _GLIBCXX20_CONSTEXPRconstexpr
2184 iterator
2185 _M_emplace_aux(const_iterator __position, _Args&&... __args);
2186
2187 // Emplacing an rvalue of the correct type can use _M_insert_rval.
2188 _GLIBCXX20_CONSTEXPRconstexpr
2189 iterator
2190 _M_emplace_aux(const_iterator __position, value_type&& __v)
2191 { return _M_insert_rval(__position, std::move(__v)); }
2192#endif
2193
2194 // Called by _M_fill_insert, _M_insert_aux etc.
2195 _GLIBCXX20_CONSTEXPRconstexpr
2196 size_type
2197 _M_check_len(size_type __n, const char* __s) const
2198 {
2199 if (max_size() - size() < __n)
2200 __throw_length_error(__N(__s)(__s));
2201
2202 const size_type __len = size() + (std::max)(size(), __n);
2203 return (__len < size() || __len > max_size()) ? max_size() : __len;
2204 }
2205
2206 // Called by constructors to check initial size.
2207 static _GLIBCXX20_CONSTEXPRconstexpr size_type
2208 _S_check_init_len(size_type __n, const allocator_type& __a)
2209 {
2210 if (__n > _S_max_size(_Tp_alloc_type(__a)))
2211 __throw_length_error(
2212 __N("cannot create std::vector larger than max_size()")("cannot create std::vector larger than max_size()"));
2213 return __n;
2214 }
2215
2216 static _GLIBCXX20_CONSTEXPRconstexpr size_type
2217 _S_max_size(const _Tp_alloc_type& __a) _GLIBCXX_NOEXCEPTnoexcept
2218 {
2219 // std::distance(begin(), end()) cannot be greater than PTRDIFF_MAX,
2220 // and realistically we can't store more than PTRDIFF_MAX/sizeof(T)
2221 // (even if std::allocator_traits::max_size says we can).
2222 const size_t __diffmax
2223 = __gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
2224 const size_t __allocmax = _Alloc_traits::max_size(__a);
2225 return (std::min)(__diffmax, __allocmax);
2226 }
2227
2228 // Internal erase functions follow.
2229
2230 // Called by erase(q1,q2), clear(), resize(), _M_fill_assign,
2231 // _M_assign_aux.
2232 _GLIBCXX20_CONSTEXPRconstexpr
2233 void
2234 _M_erase_at_end(pointer __pos) _GLIBCXX_NOEXCEPTnoexcept
2235 {
2236 if (size_type __n = this->_M_impl._M_finish - __pos)
2237 {
2238 std::_Destroy(__pos, this->_M_impl._M_finish,
2239 _M_get_Tp_allocator());
2240 this->_M_impl._M_finish = __pos;
2241 _GLIBCXX_ASAN_ANNOTATE_SHRINK(__n);
2242 }
2243 }
2244
2245 _GLIBCXX20_CONSTEXPRconstexpr
2246 iterator
2247 _M_erase(iterator __position);
2248
2249 _GLIBCXX20_CONSTEXPRconstexpr
2250 iterator
2251 _M_erase(iterator __first, iterator __last);
2252
2253#if __cplusplus202002L >= 201103L
2254 private:
2255 // Constant-time move assignment when source object's memory can be
2256 // moved, either because the source's allocator will move too
2257 // or because the allocators are equal.
2258 _GLIBCXX20_CONSTEXPRconstexpr
2259 void
2260 _M_move_assign(vector&& __x, true_type) noexcept
2261 {
2262 vector __tmp(get_allocator());
2263 this->_M_impl._M_swap_data(__x._M_impl);
2264 __tmp._M_impl._M_swap_data(__x._M_impl);
2265 std::__alloc_on_move(_M_get_Tp_allocator(), __x._M_get_Tp_allocator());
2266 }
2267
2268 // Do move assignment when it might not be possible to move source
2269 // object's memory, resulting in a linear-time operation.
2270 _GLIBCXX20_CONSTEXPRconstexpr
2271 void
2272 _M_move_assign(vector&& __x, false_type)
2273 {
2274 if (__x._M_get_Tp_allocator() == this->_M_get_Tp_allocator())
2275 _M_move_assign(std::move(__x), true_type());
2276 else
2277 {
2278 // The rvalue's allocator cannot be moved and is not equal,
2279 // so we need to individually move each element.
2280 this->_M_assign_aux(std::make_move_iterator(__x.begin()),
2281 std::make_move_iterator(__x.end()),
2282 std::random_access_iterator_tag());
2283 __x.clear();
2284 }
2285 }
2286#endif
2287
2288 template<typename _Up>
2289 _GLIBCXX20_CONSTEXPRconstexpr
2290 _Up*
2291 _M_data_ptr(_Up* __ptr) const _GLIBCXX_NOEXCEPTnoexcept
2292 { return __ptr; }
2293
2294#if __cplusplus202002L >= 201103L
2295 template<typename _Ptr>
2296 _GLIBCXX20_CONSTEXPRconstexpr
2297 typename std::pointer_traits<_Ptr>::element_type*
2298 _M_data_ptr(_Ptr __ptr) const
2299 { return empty() ? nullptr : std::__to_address(__ptr); }
2300#else
2301 template<typename _Ptr>
2302 value_type*
2303 _M_data_ptr(_Ptr __ptr) const
2304 { return empty() ? (value_type*)0 : __ptr.operator->(); }
2305#endif
2306 };
2307
2308#if __cpp_deduction_guides201703L >= 201606
2309 template<typename _InputIterator, typename _ValT
2310 = typename iterator_traits<_InputIterator>::value_type,
2311 typename _Allocator = allocator<_ValT>,
2312 typename = _RequireInputIter<_InputIterator>,
2313 typename = _RequireAllocator<_Allocator>>
2314 vector(_InputIterator, _InputIterator, _Allocator = _Allocator())
2315 -> vector<_ValT, _Allocator>;
2316
2317#if __glibcxx_containers_ranges // C++ >= 23
2318 template<ranges::input_range _Rg,
2319 typename _Alloc = allocator<ranges::range_value_t<_Rg>>>
2320 vector(from_range_t, _Rg&&, _Alloc = _Alloc())
2321 -> vector<ranges::range_value_t<_Rg>, _Alloc>;
2322#endif
2323#endif
2324
2325 /**
2326 * @brief Vector equality comparison.
2327 * @param __x A %vector.
2328 * @param __y A %vector of the same type as @a __x.
2329 * @return True iff the size and elements of the vectors are equal.
2330 *
2331 * This is an equivalence relation. It is linear in the size of the
2332 * vectors. Vectors are considered equivalent if their sizes are equal,
2333 * and if corresponding elements compare equal.
2334 */
2335 template<typename _Tp, typename _Alloc>
2336 _GLIBCXX_NODISCARD[[__nodiscard__]] _GLIBCXX20_CONSTEXPRconstexpr
2337 inline bool
2338 operator==(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
2339 { return (__x.size() == __y.size()
2340 && std::equal(__x.begin(), __x.end(), __y.begin())); }
2341
2342#if __cpp_lib_three_way_comparison201907L // >= C++20
2343 /**
2344 * @brief Vector ordering relation.
2345 * @param __x A `vector`.
2346 * @param __y A `vector` of the same type as `__x`.
2347 * @return A value indicating whether `__x` is less than, equal to,
2348 * greater than, or incomparable with `__y`.
2349 *
2350 * See `std::lexicographical_compare_three_way()` for how the determination
2351 * is made. This operator is used to synthesize relational operators like
2352 * `<` and `>=` etc.
2353 */
2354 template<typename _Tp, typename _Alloc>
2355 [[nodiscard]]
2356 constexpr __detail::__synth3way_t<_Tp>
2357 operator<=>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
2358 {
2359 return std::lexicographical_compare_three_way(__x.begin(), __x.end(),
2360 __y.begin(), __y.end(),
2361 __detail::__synth3way);
2362 }
2363#else
2364 /**
2365 * @brief Vector ordering relation.
2366 * @param __x A %vector.
2367 * @param __y A %vector of the same type as @a __x.
2368 * @return True iff @a __x is lexicographically less than @a __y.
2369 *
2370 * This is a total ordering relation. It is linear in the size of the
2371 * vectors. The elements must be comparable with @c <.
2372 *
2373 * See std::lexicographical_compare() for how the determination is made.
2374 */
2375 template<typename _Tp, typename _Alloc>
2376 _GLIBCXX_NODISCARD[[__nodiscard__]] inline bool
2377 operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
2378 { return std::lexicographical_compare(__x.begin(), __x.end(),
2379 __y.begin(), __y.end()); }
2380
2381 /// Based on operator==
2382 template<typename _Tp, typename _Alloc>
2383 _GLIBCXX_NODISCARD[[__nodiscard__]] inline bool
2384 operator!=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
2385 { return !(__x == __y); }
2386
2387 /// Based on operator<
2388 template<typename _Tp, typename _Alloc>
2389 _GLIBCXX_NODISCARD[[__nodiscard__]] inline bool
2390 operator>(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
2391 { return __y < __x; }
2392
2393 /// Based on operator<
2394 template<typename _Tp, typename _Alloc>
2395 _GLIBCXX_NODISCARD[[__nodiscard__]] inline bool
2396 operator<=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
2397 { return !(__y < __x); }
2398
2399 /// Based on operator<
2400 template<typename _Tp, typename _Alloc>
2401 _GLIBCXX_NODISCARD[[__nodiscard__]] inline bool
2402 operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
2403 { return !(__x < __y); }
2404#endif // three-way comparison
2405
2406 /// See std::vector::swap().
2407 template<typename _Tp, typename _Alloc>
2408 _GLIBCXX20_CONSTEXPRconstexpr
2409 inline void
2410 swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
2411 _GLIBCXX_NOEXCEPT_IF(noexcept(__x.swap(__y)))noexcept(noexcept(__x.swap(__y)))
2412 { __x.swap(__y); }
2413
2414_GLIBCXX_END_NAMESPACE_CONTAINER
2415
2416#if __cplusplus202002L >= 201703L
2417 namespace __detail::__variant
2418 {
2419 template<typename> struct _Never_valueless_alt; // see <variant>
2420
2421 // Provide the strong exception-safety guarantee when emplacing a
2422 // vector into a variant, but only if move assignment cannot throw.
2423 template<typename _Tp, typename _Alloc>
2424 struct _Never_valueless_alt<_GLIBCXX_STD_Cstd::vector<_Tp, _Alloc>>
2425 : std::is_nothrow_move_assignable<_GLIBCXX_STD_Cstd::vector<_Tp, _Alloc>>
2426 { };
2427 } // namespace __detail::__variant
2428#endif // C++17
2429
2430_GLIBCXX_END_NAMESPACE_VERSION
2431} // namespace std
2432
2433#endif /* _STL_VECTOR_H */

/cvmfs/belle.cern.ch/el9/externals/v02-04-00/Linux_x86_64/common/include/c++/bits/std_function.h

1// Implementation of std::function -*- C++ -*-
2
3// Copyright (C) 2004-2025 Free Software Foundation, Inc.
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
24
25/** @file include/bits/std_function.h
26 * This is an internal header file, included by other library headers.
27 * Do not attempt to use it directly. @headername{functional}
28 */
29
30#ifndef _GLIBCXX_STD_FUNCTION_H1
31#define _GLIBCXX_STD_FUNCTION_H1 1
32
33#ifdef _GLIBCXX_SYSHDR
34#pragma GCC system_header
35#endif
36
37#if __cplusplus202002L < 201103L
38# include <bits/c++0x_warning.h>
39#else
40
41#include <new> // placement new
42#include <typeinfo> // typeid
43#include <bits/invoke.h> // __invoke_r
44#include <bits/refwrap.h> // ref wrapper, _Maybe_unary_or_binary_function
45#include <bits/functexcept.h> // __throw_bad_function_call
46
47namespace std _GLIBCXX_VISIBILITY(default)__attribute__ ((__visibility__ ("default")))
48{
49_GLIBCXX_BEGIN_NAMESPACE_VERSION
50
51 /**
52 * @brief Exception class thrown when class template function's
53 * operator() is called with an empty target.
54 * @ingroup exceptions
55 */
56 class bad_function_call : public std::exception
57 {
58 public:
59 virtual ~bad_function_call() noexcept;
60
61 const char* what() const noexcept;
62 };
63
64 /**
65 * Trait identifying "location-invariant" types, meaning that the
66 * address of the object (or any of its members) will not escape.
67 * Trivially copyable types are location-invariant and users can
68 * specialize this trait for other types.
69 */
70 template<typename _Tp>
71 struct __is_location_invariant
72 : is_trivially_copyable<_Tp>::type
73 { };
74
75 class _Undefined_class;
76
77 union _Nocopy_types
78 {
79 void* _M_object;
80 const void* _M_const_object;
81 void (*_M_function_pointer)();
82 void (_Undefined_class::*_M_member_pointer)();
83 };
84
85 union [[gnu::may_alias]] _Any_data
86 {
87 void* _M_access() noexcept { return &_M_pod_data[0]; }
88 const void* _M_access() const noexcept { return &_M_pod_data[0]; }
89
90 template<typename _Tp>
91 _Tp&
92 _M_access() noexcept
93 { return *static_cast<_Tp*>(_M_access()); }
94
95 template<typename _Tp>
96 const _Tp&
97 _M_access() const noexcept
98 { return *static_cast<const _Tp*>(_M_access()); }
99
100 _Nocopy_types _M_unused;
101 char _M_pod_data[sizeof(_Nocopy_types)];
102 };
103
104 enum _Manager_operation
105 {
106 __get_type_info,
107 __get_functor_ptr,
108 __clone_functor,
109 __destroy_functor
110 };
111
112 template<typename _Signature>
113 class function;
114
115 /// Base class of all polymorphic function object wrappers.
116 class _Function_base
117 {
118 public:
119 static const size_t _M_max_size = sizeof(_Nocopy_types);
120 static const size_t _M_max_align = __alignof__(_Nocopy_types);
121
122 template<typename _Functor>
123 class _Base_manager
124 {
125 protected:
126 static const bool __stored_locally =
127 (__is_location_invariant<_Functor>::value
128 && sizeof(_Functor) <= _M_max_size
129 && __alignof__(_Functor) <= _M_max_align
130 && (_M_max_align % __alignof__(_Functor) == 0));
131
132 using _Local_storage = integral_constant<bool, __stored_locally>;
133
134 // Retrieve a pointer to the function object
135 static _Functor*
136 _M_get_pointer(const _Any_data& __source) noexcept
137 {
138 if _GLIBCXX17_CONSTEXPRconstexpr (__stored_locally)
139 {
140 const _Functor& __f = __source._M_access<_Functor>();
141 return const_cast<_Functor*>(std::__addressof(__f));
142 }
143 else // have stored a pointer
144 return __source._M_access<_Functor*>();
145 }
146
147 private:
148 // Construct a location-invariant function object that fits within
149 // an _Any_data structure.
150 template<typename _Fn>
151 static void
152 _M_create(_Any_data& __dest, _Fn&& __f, true_type)
153 {
154 ::new (__dest._M_access()) _Functor(std::forward<_Fn>(__f));
155 }
156
157 // Construct a function object on the heap and store a pointer.
158 template<typename _Fn>
159 static void
160 _M_create(_Any_data& __dest, _Fn&& __f, false_type)
161 {
162 __dest._M_access<_Functor*>()
163 = new _Functor(std::forward<_Fn>(__f));
11
Memory is allocated
164 }
165
166 // Destroy an object stored in the internal buffer.
167 static void
168 _M_destroy(_Any_data& __victim, true_type)
169 {
170 __victim._M_access<_Functor>().~_Functor();
171 }
172
173 // Destroy an object located on the heap.
174 static void
175 _M_destroy(_Any_data& __victim, false_type)
176 {
177 delete __victim._M_access<_Functor*>();
178 }
179
180 public:
181 static bool
182 _M_manager(_Any_data& __dest, const _Any_data& __source,
183 _Manager_operation __op)
184 {
185 switch (__op)
8
Control jumps to 'case __clone_functor:' at line 199
186 {
187 case __get_type_info:
188#if __cpp_rtti199711L
189 __dest._M_access<const type_info*>() = &typeid(_Functor);
190#else
191 __dest._M_access<const type_info*>() = nullptr;
192#endif
193 break;
194
195 case __get_functor_ptr:
196 __dest._M_access<_Functor*>() = _M_get_pointer(__source);
197 break;
198
199 case __clone_functor:
200 _M_init_functor(__dest,
9
Calling '_Base_manager::_M_init_functor'
13
Returned allocated memory
201 *const_cast<const _Functor*>(_M_get_pointer(__source)));
202 break;
14
Execution continues on line 208
203
204 case __destroy_functor:
205 _M_destroy(__dest, _Local_storage());
206 break;
207 }
208 return false;
209 }
210
211 template<typename _Fn>
212 static void
213 _M_init_functor(_Any_data& __functor, _Fn&& __f)
214 noexcept(__and_<_Local_storage,
215 is_nothrow_constructible<_Functor, _Fn>>::value)
216 {
217 _M_create(__functor, std::forward<_Fn>(__f), _Local_storage());
10
Calling '_Base_manager::_M_create'
12
Returned allocated memory
218 }
219
220 template<typename _Signature>
221 static bool
222 _M_not_empty_function(const function<_Signature>& __f) noexcept
223 { return static_cast<bool>(__f); }
224
225 template<typename _Tp>
226 static bool
227 _M_not_empty_function(_Tp* __fp) noexcept
228 { return __fp != nullptr; }
229
230 template<typename _Class, typename _Tp>
231 static bool
232 _M_not_empty_function(_Tp _Class::* __mp) noexcept
233 { return __mp != nullptr; }
234
235 template<typename _Tp>
236 static bool
237 _M_not_empty_function(const _Tp&) noexcept
238 { return true; }
239 };
240
241 _Function_base() = default;
242
243 ~_Function_base()
244 {
245 if (_M_manager)
246 _M_manager(_M_functor, _M_functor, __destroy_functor);
247 }
248
249 bool _M_empty() const { return !_M_manager; }
250
251 using _Manager_type
252 = bool (*)(_Any_data&, const _Any_data&, _Manager_operation);
253
254 _Any_data _M_functor{};
255 _Manager_type _M_manager{};
256 };
257
258 template<typename _Signature, typename _Functor>
259 class _Function_handler;
260
261 template<typename _Res, typename _Functor, typename... _ArgTypes>
262 class _Function_handler<_Res(_ArgTypes...), _Functor>
263 : public _Function_base::_Base_manager<_Functor>
264 {
265 using _Base = _Function_base::_Base_manager<_Functor>;
266
267 public:
268 static bool
269 _M_manager(_Any_data& __dest, const _Any_data& __source,
270 _Manager_operation __op)
271 {
272 switch (__op)
6
Control jumps to the 'default' case at line 283
273 {
274#if __cpp_rtti199711L
275 case __get_type_info:
276 __dest._M_access<const type_info*>() = &typeid(_Functor);
277 break;
278#endif
279 case __get_functor_ptr:
280 __dest._M_access<_Functor*>() = _Base::_M_get_pointer(__source);
281 break;
282
283 default:
284 _Base::_M_manager(__dest, __source, __op);
7
Calling '_Base_manager::_M_manager'
15
Returned allocated memory
285 }
286 return false;
287 }
288
289 static _Res
290 _M_invoke(const _Any_data& __functor, _ArgTypes&&... __args)
291 {
292 return std::__invoke_r<_Res>(*_Base::_M_get_pointer(__functor),
293 std::forward<_ArgTypes>(__args)...);
294 }
295
296 template<typename _Fn>
297 static constexpr bool
298 _S_nothrow_init() noexcept
299 {
300 return __and_<typename _Base::_Local_storage,
301 is_nothrow_constructible<_Functor, _Fn>>::value;
302 }
303 };
304
305 // Specialization for invalid types
306 template<>
307 class _Function_handler<void, void>
308 {
309 public:
310 static bool
311 _M_manager(_Any_data&, const _Any_data&, _Manager_operation)
312 { return false; }
313 };
314
315 // Avoids instantiating ill-formed specializations of _Function_handler
316 // in std::function<_Signature>::target<_Functor>().
317 // e.g. _Function_handler<Sig, void()> and _Function_handler<Sig, void>
318 // would be ill-formed.
319 template<typename _Signature, typename _Functor,
320 bool __valid = is_object<_Functor>::value>
321 struct _Target_handler
322 : _Function_handler<_Signature, typename remove_cv<_Functor>::type>
323 { };
324
325 template<typename _Signature, typename _Functor>
326 struct _Target_handler<_Signature, _Functor, false>
327 : _Function_handler<void, void>
328 { };
329
330 /**
331 * @brief Polymorphic function wrapper.
332 * @ingroup functors
333 * @since C++11
334 */
335 template<typename _Res, typename... _ArgTypes>
336 class function<_Res(_ArgTypes...)>
337 : public _Maybe_unary_or_binary_function<_Res, _ArgTypes...>,
338 private _Function_base
339 {
340 // Equivalent to std::decay_t except that it produces an invalid type
341 // if the decayed type is the current specialization of std::function.
342 template<typename _Func,
343 bool _Self = is_same<__remove_cvref_t<_Func>, function>::value>
344 using _Decay_t
345 = typename __enable_if_t<!_Self, decay<_Func>>::type;
346
347 template<typename _Func,
348 typename _DFunc = _Decay_t<_Func>,
349 typename _Res2 = __invoke_result<_DFunc&, _ArgTypes...>>
350 struct _Callable
351 : __is_invocable_impl<_Res2, _Res>::type
352 { };
353
354 template<typename _Cond, typename _Tp = void>
355 using _Requires = __enable_if_t<_Cond::value, _Tp>;
356
357 template<typename _Functor>
358 using _Handler
359 = _Function_handler<_Res(_ArgTypes...), __decay_t<_Functor>>;
360
361 public:
362 typedef _Res result_type;
363
364 // [3.7.2.1] construct/copy/destroy
365
366 /**
367 * @brief Default construct creates an empty function call wrapper.
368 * @post `!(bool)*this`
369 */
370 function() noexcept
371 : _Function_base() { }
372
373 /**
374 * @brief Creates an empty function call wrapper.
375 * @post @c !(bool)*this
376 */
377 function(nullptr_t) noexcept
378 : _Function_base() { }
379
380 /**
381 * @brief %Function copy constructor.
382 * @param __x A %function object with identical call signature.
383 * @post `bool(*this) == bool(__x)`
384 *
385 * The newly-created %function contains a copy of the target of
386 * `__x` (if it has one).
387 */
388 function(const function& __x)
389 : _Function_base()
390 {
391 if (static_cast<bool>(__x))
4
Taking true branch
392 {
393 __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
5
Calling '_Function_handler::_M_manager'
16
Returned allocated memory
394 _M_invoker = __x._M_invoker;
395 _M_manager = __x._M_manager;
396 }
397 }
398
399 /**
400 * @brief %Function move constructor.
401 * @param __x A %function object rvalue with identical call signature.
402 *
403 * The newly-created %function contains the target of `__x`
404 * (if it has one).
405 */
406 function(function&& __x) noexcept
407 : _Function_base(), _M_invoker(__x._M_invoker)
408 {
409 if (static_cast<bool>(__x))
410 {
411 _M_functor = __x._M_functor;
412 _M_manager = __x._M_manager;
413 __x._M_manager = nullptr;
414 __x._M_invoker = nullptr;
415 }
416 }
417
418 /**
419 * @brief Builds a %function that targets a copy of the incoming
420 * function object.
421 * @param __f A %function object that is callable with parameters of
422 * type `ArgTypes...` and returns a value convertible to `Res`.
423 *
424 * The newly-created %function object will target a copy of
425 * `__f`. If `__f` is `reference_wrapper<F>`, then this function
426 * object will contain a reference to the function object `__f.get()`.
427 * If `__f` is a null function pointer, null pointer-to-member, or
428 * empty `std::function`, the newly-created object will be empty.
429 *
430 * If `__f` is a non-null function pointer or an object of type
431 * `reference_wrapper<F>`, this function will not throw.
432 */
433 // _GLIBCXX_RESOLVE_LIB_DEFECTS
434 // 2774. std::function construction vs assignment
435 template<typename _Functor,
436 typename _Constraints = _Requires<_Callable<_Functor>>>
437 function(_Functor&& __f)
438 noexcept(_Handler<_Functor>::template _S_nothrow_init<_Functor>())
439 : _Function_base()
440 {
441 static_assert(is_copy_constructible<__decay_t<_Functor>>::value,
442 "std::function target must be copy-constructible");
443 static_assert(is_constructible<__decay_t<_Functor>, _Functor>::value,
444 "std::function target must be constructible from the "
445 "constructor argument");
446
447 using _My_handler = _Handler<_Functor>;
448
449 if (_My_handler::_M_not_empty_function(__f))
450 {
451 _My_handler::_M_init_functor(_M_functor,
452 std::forward<_Functor>(__f));
453 _M_invoker = &_My_handler::_M_invoke;
454 _M_manager = &_My_handler::_M_manager;
455 }
456 }
457
458 /**
459 * @brief Function assignment operator.
460 * @param __x A %function with identical call signature.
461 * @post `(bool)*this == (bool)x`
462 * @returns `*this`
463 *
464 * The target of `__x` is copied to `*this`. If `__x` has no
465 * target, then `*this` will be empty.
466 *
467 * If `__x` targets a function pointer or a reference to a function
468 * object, then this operation will not throw an exception.
469 */
470 function&
471 operator=(const function& __x)
472 {
473 function(__x).swap(*this);
474 return *this;
475 }
476
477 /**
478 * @brief Function move-assignment operator.
479 * @param __x A %function rvalue with identical call signature.
480 * @returns `*this`
481 *
482 * The target of `__x` is moved to `*this`. If `__x` has no
483 * target, then `*this` will be empty.
484 *
485 * If `__x` targets a function pointer or a reference to a function
486 * object, then this operation will not throw an exception.
487 */
488 function&
489 operator=(function&& __x) noexcept
490 {
491 function(std::move(__x)).swap(*this);
492 return *this;
493 }
494
495 /**
496 * @brief Function assignment to empty.
497 * @post `!(bool)*this`
498 * @returns `*this`
499 *
500 * The target of `*this` is deallocated, leaving it empty.
501 */
502 function&
503 operator=(nullptr_t) noexcept
504 {
505 if (_M_manager)
506 {
507 _M_manager(_M_functor, _M_functor, __destroy_functor);
508 _M_manager = nullptr;
509 _M_invoker = nullptr;
510 }
511 return *this;
512 }
513
514 /**
515 * @brief Function assignment to a new target.
516 * @param __f A function object that is callable with parameters of
517 * type `_ArgTypes...` and returns a value convertible
518 * to `_Res`.
519 * @return `*this`
520 * @since C++11
521 *
522 * This function object wrapper will target a copy of `__f`. If `__f`
523 * is `reference_wrapper<F>`, then this function object will contain
524 * a reference to the function object `__f.get()`. If `__f` is a null
525 * function pointer or null pointer-to-member, this object will be
526 * empty.
527 *
528 * If `__f` is a non-null function pointer or an object of type
529 * `reference_wrapper<F>`, this function will not throw.
530 */
531 template<typename _Functor>
532 _Requires<_Callable<_Functor>, function&>
533 operator=(_Functor&& __f)
534 noexcept(_Handler<_Functor>::template _S_nothrow_init<_Functor>())
535 {
536 function(std::forward<_Functor>(__f)).swap(*this);
537 return *this;
538 }
539
540 /// @overload
541 template<typename _Functor>
542 function&
543 operator=(reference_wrapper<_Functor> __f) noexcept
544 {
545 function(__f).swap(*this);
546 return *this;
547 }
548
549 // [3.7.2.2] function modifiers
550
551 /**
552 * @brief Swap the targets of two %function objects.
553 * @param __x A %function with identical call signature.
554 *
555 * Swap the targets of `this` function object and `__f`.
556 * This function will not throw exceptions.
557 */
558 void swap(function& __x) noexcept
559 {
560 std::swap(_M_functor, __x._M_functor);
561 std::swap(_M_manager, __x._M_manager);
562 std::swap(_M_invoker, __x._M_invoker);
563 }
564
565 // [3.7.2.3] function capacity
566
567 /**
568 * @brief Determine if the %function wrapper has a target.
569 *
570 * @return `true` when this function object contains a target,
571 * or `false` when it is empty.
572 *
573 * This function will not throw exceptions.
574 */
575 explicit operator bool() const noexcept
576 { return !_M_empty(); }
577
578 // [3.7.2.4] function invocation
579
580 /**
581 * @brief Invokes the function targeted by `*this`.
582 * @returns the result of the target.
583 * @throws `bad_function_call` when `!(bool)*this`
584 *
585 * The function call operator invokes the target function object
586 * stored by `this`.
587 */
588 _Res
589 operator()(_ArgTypes... __args) const
590 {
591 if (_M_empty())
592 __throw_bad_function_call();
593 return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
594 }
595
596#if __cpp_rtti199711L
597 // [3.7.2.5] function target access
598 /**
599 * @brief Determine the type of the target of this function object
600 * wrapper.
601 *
602 * @returns the type identifier of the target function object, or
603 * `typeid(void)` if `!(bool)*this`.
604 *
605 * This function will not throw exceptions.
606 */
607 const type_info&
608 target_type() const noexcept
609 {
610 if (_M_manager)
611 {
612 _Any_data __typeinfo_result;
613 _M_manager(__typeinfo_result, _M_functor, __get_type_info);
614 if (auto __ti = __typeinfo_result._M_access<const type_info*>())
615 return *__ti;
616 }
617 return typeid(void);
618 }
619#endif
620
621 /**
622 * @brief Access the stored target function object.
623 *
624 * @return Returns a pointer to the stored target function object,
625 * if `typeid(_Functor).equals(target_type())`; otherwise, a null
626 * pointer.
627 *
628 * This function does not throw exceptions.
629 *
630 * @{
631 */
632 template<typename _Functor>
633 _Functor*
634 target() noexcept
635 {
636 const function* __const_this = this;
637 const _Functor* __func = __const_this->template target<_Functor>();
638 // If is_function_v<_Functor> is true then const_cast<_Functor*>
639 // would be ill-formed, so use *const_cast<_Functor**> instead.
640 return *const_cast<_Functor**>(&__func);
641 }
642
643 template<typename _Functor>
644 const _Functor*
645 target() const noexcept
646 {
647 if _GLIBCXX17_CONSTEXPRconstexpr (is_object<_Functor>::value)
648 {
649 // For C++11 and C++14 if-constexpr is not used above, so
650 // _Target_handler avoids ill-formed _Function_handler types.
651 using _Handler = _Target_handler<_Res(_ArgTypes...), _Functor>;
652
653 if (_M_manager == &_Handler::_M_manager
654#if __cpp_rtti199711L
655 || (_M_manager && typeid(_Functor) == target_type())
656#endif
657 )
658 {
659 _Any_data __ptr;
660 _M_manager(__ptr, _M_functor, __get_functor_ptr);
661 return __ptr._M_access<const _Functor*>();
662 }
663 }
664 return nullptr;
665 }
666 /// @}
667
668 private:
669 using _Invoker_type = _Res (*)(const _Any_data&, _ArgTypes&&...);
670 _Invoker_type _M_invoker = nullptr;
671 };
672
673#if __cpp_deduction_guides201703L >= 201606
674 template<typename>
675 struct __function_guide_helper
676 { };
677
678 template<typename _Res, typename _Tp, bool _Nx, typename... _Args>
679 struct __function_guide_helper<
680 _Res (_Tp::*) (_Args...) noexcept(_Nx)
681 >
682 { using type = _Res(_Args...); };
683
684 template<typename _Res, typename _Tp, bool _Nx, typename... _Args>
685 struct __function_guide_helper<
686 _Res (_Tp::*) (_Args...) & noexcept(_Nx)
687 >
688 { using type = _Res(_Args...); };
689
690 template<typename _Res, typename _Tp, bool _Nx, typename... _Args>
691 struct __function_guide_helper<
692 _Res (_Tp::*) (_Args...) const noexcept(_Nx)
693 >
694 { using type = _Res(_Args...); };
695
696 template<typename _Res, typename _Tp, bool _Nx, typename... _Args>
697 struct __function_guide_helper<
698 _Res (_Tp::*) (_Args...) const & noexcept(_Nx)
699 >
700 { using type = _Res(_Args...); };
701
702#if __cpp_explicit_this_parameter >= 202110L
703 // _GLIBCXX_RESOLVE_LIB_DEFECTS
704 // 3617. function/packaged_task deduction guides and deducing this
705 template<typename _Res, typename _Tp, bool _Nx, typename... _Args>
706 struct __function_guide_helper<_Res (*) (_Tp, _Args...) noexcept(_Nx)>
707 { using type = _Res(_Args...); };
708#endif
709
710#if __cpp_static_call_operator202207L >= 202207L && __cpp_concepts202002 >= 202002L
711 template<typename _StaticCallOp>
712 struct __function_guide_static_helper
713 { };
714
715 template<typename _Res, bool _Nx, typename... _Args>
716 struct __function_guide_static_helper<_Res (*) (_Args...) noexcept(_Nx)>
717 { using type = _Res(_Args...); };
718
719 template<typename _Fn, typename _Op>
720 using __function_guide_t = typename __conditional_t<
721 requires (_Fn& __f) { (void) __f.operator(); },
722 __function_guide_static_helper<_Op>,
723 __function_guide_helper<_Op>>::type;
724#else
725 template<typename _Fn, typename _Op>
726 using __function_guide_t = typename __function_guide_helper<_Op>::type;
727#endif
728
729 template<typename _Res, typename... _ArgTypes>
730 function(_Res(*)(_ArgTypes...)) -> function<_Res(_ArgTypes...)>;
731
732 template<typename _Fn, typename _Signature
733 = __function_guide_t<_Fn, decltype(&_Fn::operator())>>
734 function(_Fn) -> function<_Signature>;
735#endif
736
737 // [20.7.15.2.6] null pointer comparisons
738
739 /**
740 * @brief Test whether a polymorphic function object wrapper is empty.
741 * @returns `true` if the wrapper has no target, `false` otherwise
742 *
743 * This function will not throw exceptions.
744 */
745 template<typename _Res, typename... _Args>
746 inline bool
747 operator==(const function<_Res(_Args...)>& __f, nullptr_t) noexcept
748 { return !static_cast<bool>(__f); }
749
750#if __cpp_impl_three_way_comparison201907L < 201907L
751 /// @overload
752 template<typename _Res, typename... _Args>
753 inline bool
754 operator==(nullptr_t, const function<_Res(_Args...)>& __f) noexcept
755 { return !static_cast<bool>(__f); }
756
757 /**
758 * @brief Test whether a polymorphic function object wrapper is non-empty.
759 * @returns `false` if the wrapper has no target, `true` otherwise
760 *
761 * This function will not throw exceptions.
762 */
763 template<typename _Res, typename... _Args>
764 inline bool
765 operator!=(const function<_Res(_Args...)>& __f, nullptr_t) noexcept
766 { return static_cast<bool>(__f); }
767
768 /// @overload
769 template<typename _Res, typename... _Args>
770 inline bool
771 operator!=(nullptr_t, const function<_Res(_Args...)>& __f) noexcept
772 { return static_cast<bool>(__f); }
773#endif
774
775 // [20.7.15.2.7] specialized algorithms
776
777 /**
778 * @brief Swap the targets of two polymorphic function object wrappers.
779 *
780 * This function will not throw exceptions.
781 */
782 // _GLIBCXX_RESOLVE_LIB_DEFECTS
783 // 2062. Effect contradictions w/o no-throw guarantee of std::function swaps
784 template<typename _Res, typename... _Args>
785 inline void
786 swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y) noexcept
787 { __x.swap(__y); }
788
789#if __cplusplus202002L >= 201703L
790 namespace __detail::__variant
791 {
792 template<typename> struct _Never_valueless_alt; // see <variant>
793
794 // Provide the strong exception-safety guarantee when emplacing a
795 // function into a variant.
796 template<typename _Signature>
797 struct _Never_valueless_alt<std::function<_Signature>>
798 : std::true_type
799 { };
800 } // namespace __detail::__variant
801#endif // C++17
802
803_GLIBCXX_END_NAMESPACE_VERSION
804} // namespace std
805
806#endif // C++11
807#endif // _GLIBCXX_STD_FUNCTION_H