| File: | analysis/variables/src/MetaVariables.cc |
| Warning: | line 112, column 9 Potential memory leak |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
| 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 | ||||
| 49 | namespace 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) { | |||
| 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 { | |||
| 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")); | |||
| 3564 | Returns 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")); | |||
| 3565 | point 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")); | |||
| 3566 | subtraction (``-``), 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")); | |||
| 3567 | or ``**``). 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")); | |||
| 3568 | or 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")); | |||
| 3569 | arguments. 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")); | |||
| 3585 | Returns 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 | ||||
| 3591 | Specifying 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")); | |||
| 3675 | Returns 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")); | |||
| 3682 | Returns 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")); | |||
| 3736 | The 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")); | |||
| 3737 | and ``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")); | |||
| 3738 | If ``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 | ||||
| 3740 | E.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")); | |||
| 3741 | the 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")); | |||
| 3745 | If 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 | ||||
| 3747 | E.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")); | |||
| 3749 | generator-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")); | |||
| 4021 | Returns 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 | ||||
| 4026 | Daughters 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")); | |||
| 4027 | the 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")); | |||
| 4028 | daughter (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")) ; | |||
| 4036 | Returns 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")); | |||
| 4053 | Ancestor 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 | } |
| 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 | |
| 47 | namespace 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)); |
| 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) |
| 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, |
| 201 | *const_cast<const _Functor*>(_M_get_pointer(__source))); |
| 202 | break; |
| 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()); |
| 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) |
| 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); |
| 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)) |
| 392 | { |
| 393 | __x._M_manager(_M_functor, __x._M_functor, __clone_functor); |
| 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 |