HepMC3 event record library
Selector.cc
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
5//
6///
7/// @file Selector.cc
8/// @brief Implementation of Selector wrappers
9///
10#include "HepMC3/Selector.h"
11
12namespace HepMC3 {
13const SelectorWrapper<int> StandardSelector::STATUS = SelectorWrapper<int>([](ConstGenParticlePtr p)->int{return p->status();});
14const SelectorWrapper<int> StandardSelector::PDG_ID = SelectorWrapper<int>([](ConstGenParticlePtr p)->int{return p->pdg_id();});
15const SelectorWrapper<double> StandardSelector::PT = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().pt();});
16const SelectorWrapper<double> StandardSelector::ENERGY = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().e();});
17const SelectorWrapper<double> StandardSelector::RAPIDITY = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().rap();});
18const SelectorWrapper<double> StandardSelector::ETA = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().eta();});
19const SelectorWrapper<double> StandardSelector::PHI = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().phi();});
20const SelectorWrapper<double> StandardSelector::ET = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().e() * (p->momentum().pt() / p->momentum().p3mod());});
21const SelectorWrapper<double> StandardSelector::MASS = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().m();});
22
23
24
26{
27 return input.abs();
28}
29
30
31AttributeFeature Selector::ATTRIBUTE(const std::string &name) {return AttributeFeature(name);}
32
33}
34
definition of /b Selector class
Selector is an interface to "standard" Features that are valid for both integral and floating point c...
Definition: Selector.h:55
static const SelectorWrapper< double > MASS
Mass.
Definition: Selector.h:178
static const SelectorWrapper< double > PT
Transverse momentum.
Definition: Selector.h:172
static const SelectorWrapper< int > PDG_ID
PDG ID.
Definition: Selector.h:171
static const SelectorWrapper< double > PHI
Azimuthal angle.
Definition: Selector.h:176
static const SelectorWrapper< double > ETA
Pseudorapidity.
Definition: Selector.h:175
static const SelectorWrapper< double > ET
Transverse energy.
Definition: Selector.h:177
static const SelectorWrapper< int > STATUS
Status.
Definition: Selector.h:170
static const SelectorWrapper< double > RAPIDITY
Rapidity.
Definition: Selector.h:174
static const SelectorWrapper< double > ENERGY
Energy.
Definition: Selector.h:173
HepMC3 main namespace.
std::shared_ptr< const Selector > ConstSelectorPtr
Declaration of ConstSelectorPtr.
Definition: Selector.h:24
Feature< Feature_type > abs(const Feature< Feature_type > &input)
Obtain the absolute value of a Feature. This works as you'd expect. If foo is a valid Feature,...
Definition: Feature.h:316