Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:09:08

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2018 CERN for the benefit of the Acts project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 namespace Fatras {
0012 
0013 template <int pdg_t> struct AbsPdgSelector {
0014 
0015   // absolute Pdg selection
0016   const int saPDG = pdg_t;
0017 
0018   /// Return true for all particles with | pdg | matching
0019   /// the selection criteria
0020   template <typename detector_t, typename particle_t>
0021   bool operator()(const detector_t &, const particle_t &particle) const {
0022     return (particle.pdg() * particle.pdg() == saPDG * saPDG);
0023   }
0024 };
0025 
0026 template <int pdg_t> struct PdgSelector {
0027 
0028   // Pdg selection
0029   const int saPDG = pdg_t;
0030 
0031   /// Return true for all particles with pdg matching
0032   /// the selection criteria
0033   template <typename detector_t, typename particle_t>
0034   bool operator()(const detector_t &, const particle_t &particle) const {
0035     return (particle.pdg() == saPDG);
0036   }
0037 };
0038 
0039 template <int pdg_t> struct AbsPdgExcluder {
0040 
0041   // absolute Pdg selection
0042   const int saPDG = pdg_t;
0043 
0044   /// Return true for all particles with | pdg | matching
0045   /// the selection criteria
0046   template <typename detector_t, typename particle_t>
0047   bool operator()(const detector_t &, const particle_t &particle) const {
0048     return !(particle.pdg() * particle.pdg() == saPDG * saPDG);
0049   }
0050 };
0051 
0052 template <int pdg_t> struct PdgExcluder {
0053 
0054   // Pdg selection
0055   const int saPDG = pdg_t;
0056 
0057   /// Return true for all particles with pdg matching
0058   /// the selection criteria
0059   template <typename detector_t, typename particle_t>
0060   bool operator()(const detector_t &, const particle_t &particle) const {
0061     return !(particle.pdg() == saPDG);
0062   }
0063 };
0064 
0065 } // namespace Fatras