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