Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-14 08:52:32

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