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 
12 namespace HepMC3 {
13 const SelectorWrapper<int> StandardSelector::STATUS = SelectorWrapper<int>([](ConstGenParticlePtr p)->int{return p->status();});
14 const SelectorWrapper<int> StandardSelector::PDG_ID = SelectorWrapper<int>([](ConstGenParticlePtr p)->int{return p->pdg_id();});
15 const SelectorWrapper<double> StandardSelector::PT = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().pt();});
16 const SelectorWrapper<double> StandardSelector::ENERGY = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().e();});
17 const SelectorWrapper<double> StandardSelector::RAPIDITY = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().rap();});
18 const SelectorWrapper<double> StandardSelector::ETA = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().eta();});
19 const SelectorWrapper<double> StandardSelector::PHI = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().phi();});
20 const SelectorWrapper<double> StandardSelector::ET = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().e() * (p->momentum().pt() / p->momentum().p3mod());});
21 const SelectorWrapper<double> StandardSelector::MASS = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().m();});
22 
23 
24 
26 {
27  return input.abs();
28 }
29 
30 
31 AttributeFeature Selector::ATTRIBUTE(const std::string &name) {return AttributeFeature(name);}
32 
33 }
34 
static const SelectorWrapper< double > MASS
Mass.
Definition: Selector.h:178
static const SelectorWrapper< double > ET
Transverse energy.
Definition: Selector.h:177
static const SelectorWrapper< double > PT
Transverse momentum.
Definition: Selector.h:172
static const SelectorWrapper< int > PDG_ID
PDG ID.
Definition: Selector.h:171
definition of /b Selector class
static const SelectorWrapper< double > RAPIDITY
Rapidity.
Definition: Selector.h:174
std::shared_ptr< const Selector > ConstSelectorPtr
Declaration of ConstSelectorPtr.
Definition: Selector.h:24
static const SelectorWrapper< double > ETA
Pseudorapidity.
Definition: Selector.h:175
static const SelectorWrapper< double > PHI
Azimuthal angle.
Definition: Selector.h:176
Annotation for function names.
Definition: attr.h:36
Selector is an interface to &quot;standard&quot; Features that are valid for both integral and floating point c...
Definition: Selector.h:55
static const SelectorWrapper< int > STATUS
Status.
Definition: Selector.h:170
Feature< Feature_type > abs(const Feature< Feature_type > &input)
Obtain the absolute value of a Feature. This works as you&#39;d expect. If foo is a valid Feature...
Definition: Feature.h:316
static const SelectorWrapper< double > ENERGY
Energy.
Definition: Selector.h:173