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> Selector::STATUS = SelectorWrapper<int>([](ConstGenParticlePtr p)->int{return p->status();});
14 const SelectorWrapper<int> Selector::PDG_ID = SelectorWrapper<int>([](ConstGenParticlePtr p)->int{return p->pdg_id();});
15 const SelectorWrapper<double> Selector::PT = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().pt();});
16 const SelectorWrapper<double> Selector::ENERGY = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().e();});
17 const SelectorWrapper<double> Selector::RAPIDITY = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().rap();});
18 const SelectorWrapper<double> Selector::ETA = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().eta();});
19 const SelectorWrapper<double> Selector::PHI = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().phi();});
20 const SelectorWrapper<double> Selector::ET = SelectorWrapper<double>([](ConstGenParticlePtr p)->double{return p->momentum().e() * (p->momentum().pt() / p->momentum().p3mod());});
21 const SelectorWrapper<double> Selector::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 
HepMC3::Selector
Selector is an interface to "standard" Features that are valid for both integral and floating point c...
Definition: Selector.h:55
HepMC3
HepMC3 main namespace.
Definition: ReaderGZ.h:28
HepMC3::abs
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
HepMC3::ConstSelectorPtr
std::shared_ptr< const Selector > ConstSelectorPtr
Declaration of ConstSelectorPtr.
Definition: Selector.h:24
Selector.h
definition of /b Selector class