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-2020 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 
24 {
25  return input.abs();
26 }
27 
28 AttributeFeature Selector::ATTRIBUTE(const std::string &name) {return AttributeFeature(name);}
29 
30 } // namespace HepMC3
virtual ConstSelectorPtr abs() const =0
abs function
static const SelectorWrapper< double > MASS
Mass.
Definition: Selector.h:187
HepMC3 main namespace.
static const SelectorWrapper< double > ET
Transverse energy.
Definition: Selector.h:186
static const SelectorWrapper< double > PT
Transverse momentum.
Definition: Selector.h:181
static const SelectorWrapper< int > PDG_ID
PDG ID.
Definition: Selector.h:180
definition of /b Selector class
static const SelectorWrapper< double > RAPIDITY
Rapidity.
Definition: Selector.h:183
std::shared_ptr< const Selector > ConstSelectorPtr
Declaration of ConstSelectorPtr.
Definition: Selector.h:26
static const SelectorWrapper< double > ETA
Pseudorapidity.
Definition: Selector.h:184
static const SelectorWrapper< double > PHI
Azimuthal angle.
Definition: Selector.h:185
static AttributeFeature ATTRIBUTE(const std::string &name)
ATTRIBUTE function.
Definition: Selector.cc:28
AttributeFeature.
Selector is an interface to "standard" Features that are valid for both integral and floating point c...
Definition: Selector.h:57
static const SelectorWrapper< int > STATUS
Status.
Definition: Selector.h:179
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:323
static const SelectorWrapper< double > ENERGY
Energy.
Definition: Selector.h:182