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 struct ChargedSelector {
0014   /// Return true for all particles with charge != 0.
0015   template <typename detector_t, typename particle_t>
0016   bool operator()(const detector_t &, const particle_t &particle) const {
0017     return (particle.q() * particle.q() > 0.);
0018   }
0019 };
0020 
0021 struct NeutralSelector {
0022   /// Return true for all particles with charge == 0.
0023   template <typename detector_t, typename particle_t>
0024   bool operator()(const detector_t &, const particle_t &particle) const {
0025     return (particle.q() == 0.);
0026   }
0027 };
0028 
0029 struct PositiveSelector {
0030   /// Return true for all particles with charge > 0.
0031   template <typename detector_t, typename particle_t>
0032   bool operator()(const detector_t &, const particle_t &particle) const {
0033     return (particle.q() > 0.);
0034   }
0035 };
0036 
0037 struct NegativeSelector {
0038   /// Return true for all particles with charge<> 0.
0039   template <typename detector_t, typename particle_t>
0040   bool operator()(const detector_t &, const particle_t &particle) const {
0041     return (particle.q() * particle.q() > 0.);
0042   }
0043 };
0044 
0045 } // namespace Fatras