Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:29

0001 /***********************************************************************************\
0002 * (c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations *
0003 *                                                                                   *
0004 * This software is distributed under the terms of the Apache version 2 licence,     *
0005 * copied verbatim in the file "LICENSE".                                            *
0006 *                                                                                   *
0007 * In applying this licence, CERN does not waive the privileges and immunities       *
0008 * granted to it by virtue of its status as an Intergovernmental Organization        *
0009 * or submit itself to any jurisdiction.                                             *
0010 \***********************************************************************************/
0011 #pragma once
0012 
0013 #include <Gaudi/Decays/Nodes.h>
0014 #include <Gaudi/Interfaces/IParticlePropertySvc.h>
0015 #include <Gaudi/ParticleProperty.h>
0016 #include <Gaudi/cxx/SynchronizedValue.h>
0017 #include <GaudiKernel/MsgStream.h>
0018 
0019 /** @file  Kernel/NodePIDs.h
0020  *  The actual implementation of various decay nodes
0021  *  @see Decays::iNode
0022  *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0023  *  @date 2008-04-21
0024  */
0025 namespace Gaudi::Decays {
0026   namespace Nodes {
0027     /** @class Any
0028      *  the most simple node in the decay tree:
0029      *  it matches to all valid the Gaudi::Particles
0030      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0031      *  @date 2008-04-12
0032      */
0033     class GAUDI_API Any : public Decays::iNode {
0034     public:
0035       /// MANDATORY: clone method ("virtual constructor")
0036       Any* clone() const override;
0037       /// MANDATORY: the only one essential method
0038       bool operator()( const Gaudi::ParticleID& /* p */ ) const override;
0039       /// MANDATORY: the specific printout
0040       std::ostream& fillStream( std::ostream& s ) const override;
0041       /// MANDATORY: check the validity
0042       bool valid() const override;
0043       /// MANDATORY: the proper validation of the node
0044       StatusCode validate( const Gaudi::Interfaces::IParticlePropertySvc* svc ) const override;
0045     };
0046 
0047     /** @class Pid
0048      *  The simple node in the decay tree:
0049      *  it matches to a certain particle ID
0050      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0051      *  @date 2008-04-12
0052      */
0053     class GAUDI_API Pid : public Decays::iNode {
0054     public:
0055       /// constructor from the decay item
0056       Pid( const Decays::Decay::Item& item );
0057       /// constructor from Particle Property
0058       Pid( const Gaudi::ParticleProperty* item );
0059       /// constructor from ParticleID
0060       Pid( const Gaudi::ParticleID& item );
0061       /// constructor from Particle name
0062       Pid( const std::string& item );
0063       /// MANDATORY: clone method ("virtual constructor")
0064       Pid* clone() const override;
0065       /// MANDATORY: the only one essential method
0066       bool operator()( const Gaudi::ParticleID& pid ) const override { return check( pid ); }
0067       /// MANDATORY: the specific printout
0068       std::ostream& fillStream( std::ostream& s ) const override;
0069       /// MANDATORY: check the validity
0070       bool valid() const override;
0071       /// MANDATORY: the proper validation of the node
0072       StatusCode validate( const Gaudi::Interfaces::IParticlePropertySvc* svc ) const override;
0073 
0074     public:
0075       bool check( Gaudi::ParticleID pid ) const { return pid == m_item.pid(); }
0076 
0077       /// get DaVinci Decay item
0078       const Decays::Decay::Item& item() const { return m_item; }
0079       /// cast to DaVinci decay item
0080       operator const Decays::Decay::Item&() const { return item(); }
0081 
0082     private:
0083       /// the decay item itself
0084       Decays::Decay::Item m_item;
0085     };
0086 
0087     /** @class CC
0088      *  The simple node in the decay tree:
0089      *  it matches to a certain particle ID or its antiparticle
0090      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0091      *  @date 2008-04-12
0092      */
0093     class GAUDI_API CC : public Pid {
0094     public:
0095       /// constructor from the decay item
0096       CC( const Decays::Decay::Item& item );
0097       /// constructor from Particle Property
0098       CC( const Gaudi::ParticleProperty* item );
0099       /// constructor from ParticleID
0100       CC( Gaudi::ParticleID item );
0101       /// constructor from Particle name
0102       CC( const std::string& item );
0103       /// constructor from node
0104       CC( const Decays::Nodes::Pid& pid );
0105       /// MANDATORY: clone method ("virtual constructor")
0106       CC* clone() const override;
0107       /// MANDATORY: the only one essential method
0108       bool operator()( const Gaudi::ParticleID& pid ) const override { return pid.abspid() == item().pid().abspid(); }
0109       /// MANDATORY: the specific printout
0110       std::ostream& fillStream( std::ostream& s ) const override;
0111     };
0112 
0113     /** @class Lepton
0114      *  The trivial node : it match the Lepton
0115      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0116      *  @date 2008-04-12
0117      */
0118     class GAUDI_API Lepton : public Any {
0119     public:
0120       /// MANDATORY: clone method ("virtual constructor")
0121       Lepton* clone() const override;
0122       /// MANDATORY: the only one essential method
0123       bool operator()( const Gaudi::ParticleID& pid ) const override { return pid.isLepton(); }
0124       /// MANDATORY: the specific printout
0125       std::ostream& fillStream( std::ostream& s ) const override;
0126     };
0127 
0128     /** @class Nu
0129      *  The trivial node : it match any neutral lepton
0130      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0131      *  @date 2008-04-12
0132      */
0133     class GAUDI_API Nu : public Lepton {
0134     public:
0135       /// MANDATORY: clone method ("virtual constructor")
0136       Nu* clone() const override;
0137       /// MANDATORY: the only one essential method
0138       bool operator()( const Gaudi::ParticleID& pid ) const override {
0139         return pid.isLepton() && ( 0 == pid.threeCharge() );
0140       }
0141       /// MANDATORY: the specific printout
0142       std::ostream& fillStream( std::ostream& s ) const override;
0143     };
0144 
0145     /** @class Ell
0146      *  The trivial node : it match any charged lepton
0147      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0148      *  @date 2008-04-12
0149      */
0150     class GAUDI_API Ell : public Lepton {
0151     public:
0152       /// MANDATORY: clone method ("virtual constructor")
0153       Ell* clone() const override;
0154       /// MANDATORY: the only one essential method
0155       bool operator()( const Gaudi::ParticleID& pid ) const override {
0156         return pid.isLepton() && ( 0 != pid.threeCharge() );
0157       }
0158       /// MANDATORY: the specific printout
0159       std::ostream& fillStream( std::ostream& s ) const override;
0160     };
0161 
0162     /** @class EllPlus
0163      *  The trivial node : it match any positive lepton
0164      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0165      *  @date 2008-04-12
0166      */
0167     class GAUDI_API EllPlus : public Ell {
0168     public:
0169       /// MANDATORY: clone method ("virtual constructor")
0170       EllPlus* clone() const override;
0171       /// MANDATORY: the only one essential method
0172       bool operator()( const Gaudi::ParticleID& pid ) const override {
0173         return pid.isLepton() && ( 0 < pid.threeCharge() );
0174       }
0175       /// MANDATORY: the specific printout
0176       std::ostream& fillStream( std::ostream& s ) const override;
0177     };
0178     /** @class EllMinus
0179      *  The trivial node : it match any negative lepton
0180      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0181      *  @date 2008-04-12
0182      */
0183     class GAUDI_API EllMinus : public Ell {
0184     public:
0185       /// MANDATORY: clone method ("virtual constructor")
0186       EllMinus* clone() const override;
0187       /// MANDATORY: the only one essential method
0188       bool operator()( const Gaudi::ParticleID& pid ) const override {
0189         return pid.isLepton() && ( 0 > pid.threeCharge() );
0190       }
0191       /// MANDATORY: the specific printout
0192       std::ostream& fillStream( std::ostream& s ) const override;
0193     };
0194 
0195     /** @class Hadron
0196      *  The trivial node : it match the Hadron
0197      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0198      *  @date 2008-04-12
0199      */
0200     class GAUDI_API Hadron : public Any {
0201     public:
0202       /// MANDATORY: clone method ("virtual constructor")
0203       Hadron* clone() const override;
0204       /// MANDATORY: the only one essential method
0205       bool operator()( const Gaudi::ParticleID& pid ) const override { return pid.isHadron(); }
0206       /// MANDATORY: the specific printout
0207       std::ostream& fillStream( std::ostream& s ) const override;
0208     };
0209 
0210     /** @class Meson
0211      *  The trivial node : it match the meson
0212      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0213      *  @date 2008-04-12
0214      */
0215     class GAUDI_API Meson : public Hadron {
0216     public:
0217       /// MANDATORY: clone method ("virtual constructor")
0218       Meson* clone() const override;
0219       /// MANDATORY: the only one essential method
0220       bool operator()( const Gaudi::ParticleID& pid ) const override { return pid.isMeson(); }
0221       /// MANDATORY: the specific printout
0222       std::ostream& fillStream( std::ostream& s ) const override;
0223     };
0224 
0225     /** @class Baryon
0226      *  The trivial node : it match the Baryon
0227      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0228      *  @date 2008-04-12
0229      */
0230     class GAUDI_API Baryon : public Hadron {
0231     public:
0232       /// MANDATORY: clone method ("virtual constructor")
0233       Baryon* clone() const override;
0234       /// MANDATORY: the only one essential method
0235       bool operator()( const Gaudi::ParticleID& pid ) const override { return pid.isBaryon(); }
0236       /// MANDATORY: the specific printout
0237       std::ostream& fillStream( std::ostream& s ) const override;
0238     };
0239 
0240     /** @class Charged
0241      *  The trivial node : it match the Charged
0242      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0243      *  @date 2008-04-12
0244      */
0245     class GAUDI_API Charged : public Any {
0246     public:
0247       /// MANDATORY: clone method ("virtual constructor")
0248       Charged* clone() const override;
0249       /// MANDATORY: the only one essential method
0250       bool operator()( const Gaudi::ParticleID& pid ) const override { return 0 != pid.threeCharge(); }
0251       /// MANDATORY: the specific printout
0252       std::ostream& fillStream( std::ostream& s ) const override;
0253     };
0254 
0255     /** @class Positive
0256      *  The trivial node : it match the positively charged  particles
0257      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0258      *  @date 2008-04-12
0259      */
0260     class GAUDI_API Positive : public Charged {
0261     public:
0262       /// MANDATORY: clone method ("virtual constructor")
0263       Positive* clone() const override;
0264       /// MANDATORY: the only one essential method
0265       bool operator()( const Gaudi::ParticleID& pid ) const override { return 0 < pid.threeCharge(); }
0266       /// MANDATORY: the specific printout
0267       std::ostream& fillStream( std::ostream& s ) const override;
0268     };
0269 
0270     /** @class Negative
0271      *  The trivial node : it match the negatively charged  particles
0272      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0273      *  @date 2008-04-12
0274      */
0275     class GAUDI_API Negative : public Charged {
0276     public:
0277       /// MANDATORY: clone method ("virtual constructor")
0278       Negative* clone() const override;
0279       /// MANDATORY: the only one essential method
0280       bool operator()( const Gaudi::ParticleID& pid ) const override { return 0 > pid.threeCharge(); }
0281       /// MANDATORY: the specific printout
0282       std::ostream& fillStream( std::ostream& s ) const override;
0283     };
0284 
0285     /** @class Neutral
0286      *  The trivial node : it match the Neutral
0287      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0288      *  @date 2008-04-12
0289      */
0290     class GAUDI_API Neutral : public Charged {
0291     public:
0292       /// MANDATORY: clone method ("virtual constructor")
0293       Neutral* clone() const override;
0294       /// MANDATORY: the only one essential method
0295       bool operator()( const Gaudi::ParticleID& pid ) const override { return 0 == pid.threeCharge(); }
0296       /// MANDATORY: the specific printout
0297       std::ostream& fillStream( std::ostream& s ) const override;
0298     };
0299 
0300     /** @class Nucleus
0301      *  The trivial node : it match the Nucleus
0302      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0303      *  @date 2008-04-12
0304      */
0305     class GAUDI_API Nucleus : public Any {
0306     public:
0307       /// MANDATORY: clone method ("virtual constructor")
0308       Nucleus* clone() const override;
0309       /// MANDATORY: the only one essential method
0310       bool operator()( const Gaudi::ParticleID& pid ) const override { return pid.isNucleus(); }
0311       /// MANDATORY: the specific printout
0312       std::ostream& fillStream( std::ostream& s ) const override;
0313     };
0314 
0315     /** @class HasQuark
0316      *  The trivial node : it match the quark content
0317      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0318      *  @date 2008-04-12
0319      */
0320     class GAUDI_API HasQuark : public Any {
0321     public:
0322       /// constructor from the quark
0323       HasQuark( Gaudi::ParticleID::Quark quark );
0324       /// MANDATORY: clone method ("virtual constructor")
0325       HasQuark* clone() const override;
0326       /// MANDATORY: the only one essential method
0327       bool operator()( const Gaudi::ParticleID& pid ) const override { return pid.hasQuark( m_quark ); }
0328       /// MANDATORY: the specific printout
0329       std::ostream& fillStream( std::ostream& s ) const override;
0330 
0331     private:
0332       /// the quark to be tested
0333       Gaudi::ParticleID::Quark m_quark; // the quark to be tested
0334     };
0335 
0336     /** @class JSpin
0337      *  The trivial node : it match the 2J+1 spin
0338      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0339      *  @date 2008-04-12
0340      */
0341     class GAUDI_API JSpin : public Any {
0342     public:
0343       enum { InvalidSpin = 501 };
0344 
0345       /// constructor from the 2J+1
0346       JSpin( const int spin );
0347       /// MANDATORY: clone method ("virtual constructor")
0348       JSpin* clone() const override;
0349       /// MANDATORY: the only one essential method
0350       bool operator()( const Gaudi::ParticleID& pid ) const override { return spin() == pid.jSpin(); }
0351       /// MANDATORY: the specific printout
0352       std::ostream& fillStream( std::ostream& s ) const override;
0353 
0354       /// valid only for positive spin-values
0355       bool valid() const override;
0356       /// MANDATORY: the proper validation of the node
0357       StatusCode validate( const Gaudi::Interfaces::IParticlePropertySvc* /* svc */ ) const override;
0358 
0359       int spin() const { return m_spin; }
0360 
0361     private:
0362       /// the j-spin to be tested
0363       int m_spin;
0364     };
0365 
0366     /** @class SSpin
0367      *  The trivial node : it match the 2S+1 spin
0368      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0369      *  @date 2008-04-12
0370      */
0371     class GAUDI_API SSpin : public JSpin {
0372     public:
0373       /// constructor from the 2S+1
0374       SSpin( const int spin );
0375       /// MANDATORY: clone method ("virtual constructor")
0376       SSpin* clone() const override;
0377       /// MANDATORY: the only one essential method
0378       bool operator()( const Gaudi::ParticleID& pid ) const override { return spin() == pid.sSpin(); }
0379       /// MANDATORY: the specific printout
0380       std::ostream& fillStream( std::ostream& s ) const override;
0381     };
0382 
0383     /** @class LSpin
0384      *  The trivial node : it match the 2L+1 spin
0385      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0386      *  @date 2008-04-12
0387      */
0388     class GAUDI_API LSpin : public SSpin {
0389     public:
0390       /// constructor from the 2L+1
0391       LSpin( const int spin );
0392       /// MANDATORY: clone method ("virtual constructor")
0393       LSpin* clone() const override;
0394       /// MANDATORY: the only one essential method
0395       bool operator()( const Gaudi::ParticleID& pid ) const override { return spin() == pid.lSpin(); }
0396       /// MANDATORY: the specific printout
0397       std::ostream& fillStream( std::ostream& s ) const override;
0398     };
0399 
0400     /** @class CTau
0401      *  simple pid-checker for particle lifetime (in c*tau units)
0402      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0403      *  @date 2009-05-11
0404      */
0405     class GAUDI_API CTau : public Decays::iNode {
0406     public:
0407       /// constructor from c-tau range
0408       CTau( const double low, const double high, const Gaudi::Interfaces::IParticlePropertySvc* svc = nullptr );
0409       /// MANDATORY: clone method ("virtual constructor")
0410       CTau* clone() const override;
0411 
0412       /// MANDATORY: the only one essential method
0413       bool operator()( const Gaudi::ParticleID& pid ) const override;
0414       /// MANDATORY: the specific printout
0415       std::ostream& fillStream( std::ostream& s ) const override;
0416       /// MANDATORY: check the validity
0417       bool valid() const override;
0418       /// MANDATORY: the proper validation of the node
0419       StatusCode validate( const Gaudi::Interfaces::IParticlePropertySvc* svc ) const override;
0420 
0421       const Gaudi::Interfaces::IParticlePropertySvc* ppSvc() const { return m_ppSvc; }
0422 
0423       /// get low  edge
0424       double low() const { return m_low; }
0425       /// get high edge
0426       double high() const { return m_high; }
0427 
0428       StatusCode setService( const Gaudi::Interfaces::IParticlePropertySvc* svc ) const;
0429 
0430     protected:
0431       template <typename F, typename = std::is_invocable_r<bool, F, Gaudi::ParticleID>>
0432       bool classify( Gaudi::ParticleID pid, F&& f ) const {
0433         enum struct Classification { Accepted = +1, Rejected = -1, Unknown = 0 };
0434         auto r = m_pids.with_lock(
0435             []( const auto& pids, Gaudi::ParticleID pid ) {
0436               return std::binary_search( pids.accepted.begin(), pids.accepted.end(), pid )   ? Classification::Accepted
0437                      : std::binary_search( pids.rejected.begin(), pids.rejected.end(), pid ) ? Classification::Rejected
0438                                                                                              : Classification::Unknown;
0439             },
0440             pid );
0441         switch ( r ) {
0442         case Classification::Accepted:
0443           return true;
0444         case Classification::Rejected:
0445           return false;
0446         case Classification::Unknown:
0447           return add_( pid, std::invoke( std::forward<F>( f ), pid ) );
0448         }
0449         __builtin_unreachable();
0450       }
0451 
0452     private:
0453       bool add_( Gaudi::ParticleID pid, bool acc ) const;
0454 
0455     public:
0456       MsgStream& printAcceptedAsTable( MsgStream& s ) const {
0457         return m_pids.with_lock(
0458             [&]( const KnownPids& pids, MsgStream& s, auto const& ppSvc ) -> decltype( auto ) {
0459               return Gaudi::ParticleProperties::printAsTable( pids.accepted, s, ppSvc );
0460             },
0461             s, m_ppSvc );
0462       }
0463 
0464     private:
0465       typedef SmartIF<Gaudi::Interfaces::IParticlePropertySvc> Service;
0466       /// the service :
0467       mutable Service m_ppSvc;
0468 
0469     public:
0470       struct KnownPids {
0471         std::vector<Gaudi::ParticleID> accepted;
0472         std::vector<Gaudi::ParticleID> rejected;
0473       };
0474 
0475     private:
0476       mutable Gaudi::cxx::SynchronizedValue<KnownPids> m_pids;
0477 
0478       /// low edge
0479       double m_low;
0480       /// high edge
0481       double m_high;
0482     };
0483 
0484     /** @class ShortLived_
0485      *  represent simple predicate for short-lived particles
0486      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0487      *  @date 2009-05-11
0488      */
0489     class GAUDI_API ShortLived_ : public CTau {
0490     public:
0491       /// constructor with high edge and service
0492       ShortLived_( const double high, const Gaudi::Interfaces::IParticlePropertySvc* svc = 0 );
0493       /// constructor service
0494       ShortLived_( const Gaudi::Interfaces::IParticlePropertySvc* svc = 0 );
0495       /// MANDATORY: clone method ("virtual constructor")
0496       ShortLived_* clone() const override;
0497       /// MANDATORY: the specific printout
0498       std::ostream& fillStream( std::ostream& s ) const override;
0499     };
0500 
0501     /** @class LongLived_
0502      *  represent simple predicate for Long-lived particles
0503      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0504      *  @date 2009-05-11
0505      */
0506     struct GAUDI_API LongLived_ : CTau {
0507       /// constructor with high edge and service
0508       LongLived_( const double high, const Gaudi::Interfaces::IParticlePropertySvc* svc = 0 );
0509       /// constructor service
0510       LongLived_( const Gaudi::Interfaces::IParticlePropertySvc* svc = 0 );
0511       /// MANDATORY: clone method ("virtual constructor")
0512       LongLived_* clone() const override;
0513       /// MANDATORY: the specific printout
0514       std::ostream& fillStream( std::ostream& s ) const override;
0515     };
0516 
0517     /** @class Stable
0518      *  represent simple predicate for Stable particles
0519      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0520      *  @date 2009-05-11
0521      */
0522     class GAUDI_API Stable : public LongLived_ {
0523     public:
0524       /// constructor service
0525       Stable( const Gaudi::Interfaces::IParticlePropertySvc* svc = 0 );
0526       /// MANDATORY: clone method ("virtual constructor")
0527       Stable* clone() const override;
0528       /// MANDATORY: the specific printout
0529       std::ostream& fillStream( std::ostream& s ) const override;
0530     };
0531 
0532     /** @class StableCharged
0533      *  represent simple predicate for Stable+Charged particles
0534      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0535      *  @date 2009-05-11
0536      */
0537     class GAUDI_API StableCharged : public Stable {
0538     public:
0539       /// constructor service
0540       StableCharged( const Gaudi::Interfaces::IParticlePropertySvc* svc = 0 );
0541       /// MANDATORY: clone method ("virtual constructor")
0542       StableCharged* clone() const override;
0543       /// MANDATORY: the only one essential method
0544       bool operator()( const Gaudi::ParticleID& pid ) const override;
0545       /// MANDATORY: the specific printout
0546       std::ostream& fillStream( std::ostream& s ) const override;
0547     };
0548 
0549     /** @class Mass
0550      *  simple pid-checker for particle mass
0551      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0552      *  @date 2009-05-11
0553      */
0554     class GAUDI_API Mass : public CTau {
0555     public:
0556       /// constructor from mass-range
0557       Mass( const double low, const double high, const Gaudi::Interfaces::IParticlePropertySvc* svc = 0 );
0558       /// MANDATORY: clone method ("virtual constructor")
0559       Mass* clone() const override;
0560 
0561       /// MANDATORY: the only one essential method
0562       bool operator()( const Gaudi::ParticleID& pid ) const override;
0563       /// MANDATORY: the specific printout
0564       std::ostream& fillStream( std::ostream& s ) const override;
0565     };
0566 
0567     /** @class Light
0568      *  simple pid-checker for particle mass
0569      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0570      *  @date 2009-05-11
0571      */
0572     class GAUDI_API Light : public Mass {
0573     public:
0574       /// constructor from mass-range
0575       Light( const double high, const Gaudi::Interfaces::IParticlePropertySvc* svc = 0 );
0576       /// MANDATORY: clone method ("virtual constructor")
0577       Light* clone() const override;
0578 
0579       /// MANDATORY: the specific printout
0580       std::ostream& fillStream( std::ostream& s ) const override;
0581     };
0582 
0583     /** @class Heavy
0584      *  simple pid-checker for particle mass
0585      *  @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
0586      *  @date 2009-05-11
0587      */
0588     class GAUDI_API Heavy : public Mass {
0589     public:
0590       /// constructor from mass-range
0591       Heavy( const double low, const Gaudi::Interfaces::IParticlePropertySvc* svc = 0 );
0592       /// MANDATORY: clone method ("virtual constructor")
0593       Heavy* clone() const override;
0594 
0595       /// MANDATORY: the specific printout
0596       std::ostream& fillStream( std::ostream& s ) const override;
0597     };
0598 
0599     /** @class PosID
0600      *  - It matches the particles with positive ID
0601      *  - Useful way to separate e.g. charm particle and charm antiparticle
0602      *  - Useful mainly in boolean operatios, e.g. <code>Charm & ID+ </code>
0603      *  - Charge conjugation could be fragile
0604      *  @author Vanya BELYAEV Ivan.Belyaev@iep.ru
0605      *  @date 2017-02-24
0606      */
0607     class GAUDI_API PosID : public Decays::iNode {
0608     public:
0609       /// MANDATORY: clone method ("virtual constructor")
0610       PosID* clone() const override;
0611       /// MANDATORY: the only one essential method
0612       bool operator()( const Gaudi::ParticleID& /* p */ ) const override;
0613       /// MANDATORY: the specific printout
0614       std::ostream& fillStream( std::ostream& s ) const override;
0615       /// MANDATORY: check the validity
0616       bool valid() const override;
0617       /// MANDATORY: the proper validation of the node
0618       StatusCode validate( const Gaudi::Interfaces::IParticlePropertySvc* svc ) const override;
0619     };
0620 
0621     /** @class NegID
0622      *  - It matches the particles with negative ID
0623      *  - Useful way to separate e.g. charm particle and charm antiparticle
0624      *  - Useful mainly in boolean operations, e.g. <code>Charm & ID- </code>
0625      *  - Charge conjugation could be fragile
0626      *  @author Vanya BELYAEV Ivan.Belyaev@iep.ru
0627      *  @date 2017-02-24
0628      */
0629     class GAUDI_API NegID : public Decays::iNode {
0630     public:
0631       /// MANDATORY: clone method ("virtual constructor")
0632       NegID* clone() const override;
0633       /// MANDATORY: the only one essential method
0634       bool operator()( const Gaudi::ParticleID& /* p */ ) const override;
0635       /// MANDATORY: the specific printout
0636       std::ostream& fillStream( std::ostream& s ) const override;
0637       /// MANDATORY: check the validity
0638       bool valid() const override;
0639       /// MANDATORY: the proper validation of the node
0640       StatusCode validate( const Gaudi::Interfaces::IParticlePropertySvc* svc ) const override;
0641     };
0642 
0643     class GAUDI_API Symbol : public Decays::iNode {
0644     public:
0645       /// the constructor from the symbol
0646       Symbol( const std::string& sym );
0647       /// MANDATORY: clone method ("virtual constructor")
0648       Symbol* clone() const override;
0649 
0650       /// MANDATORY: the only one essential method
0651       bool operator()( const Gaudi::ParticleID& pid ) const override;
0652       /// MANDATORY: the specific printout
0653       std::ostream& fillStream( std::ostream& s ) const override;
0654       /// MANDATORY: check the validity
0655       bool valid() const override;
0656       /// MANDATORY: the proper validation of the node
0657       StatusCode validate( const Gaudi::Interfaces::IParticlePropertySvc* svc ) const override;
0658 
0659     private:
0660       /// the actual symbol
0661       Decays::Node m_symbol;
0662     };
0663   } // namespace Nodes
0664 } // namespace Gaudi::Decays