File indexing completed on 2025-04-19 09:09:42
0001 #ifndef ATOOLS_Phys_Particle_Qualifier_H
0002 #define ATOOLS_Phys_Particle_Qualifier_H
0003
0004 #include "ATOOLS/Phys/Particle_List.H"
0005 #include "ATOOLS/Org/Getter_Function.H"
0006
0007 namespace ATOOLS {
0008
0009 template <class InIter, class OutIter, class Predicate>
0010 void copy_if( InIter first, InIter last, OutIter out,
0011 Predicate pred ) {
0012 for ( ; first != last; ++first ) { if ( pred(*first) ) out = *first; }
0013 }
0014
0015 template <class Predicate>
0016 void copy_if(Particle_List::iterator first,Particle_List::iterator last,
0017 std::back_insert_iterator<Particle_List> out,
0018 const Predicate & pred)
0019 { for (;first!=last;++first) if (pred(*first)) out = *first; }
0020
0021 class Particle_Qualifier_Base {
0022 public:
0023 virtual ~Particle_Qualifier_Base();
0024 virtual bool operator() (const Particle *) const = 0;
0025 static void ShowQualifiers(const int mode);
0026 void Keep(Particle_List *const list);
0027 void Erase(Particle_List *const list);
0028 };
0029
0030 typedef Getter_Function<Particle_Qualifier_Base,std::string>
0031 Particle_Qualifier_Getter;
0032
0033
0034 class Or_Particle_Qualifier : public Particle_Qualifier_Base {
0035 Particle_Qualifier_Base * p_qual_a;
0036 Particle_Qualifier_Base * p_qual_b;
0037 public:
0038 Or_Particle_Qualifier(Particle_Qualifier_Base * a,
0039 Particle_Qualifier_Base * b)
0040 : p_qual_a(a),p_qual_b(b) {}
0041 bool operator()(const Particle *) const;
0042 };
0043
0044 class And_Particle_Qualifier : public Particle_Qualifier_Base {
0045 Particle_Qualifier_Base * p_qual_a;
0046 Particle_Qualifier_Base * p_qual_b;
0047 public:
0048 And_Particle_Qualifier(Particle_Qualifier_Base * a,
0049 Particle_Qualifier_Base * b)
0050 : p_qual_a(a),p_qual_b(b) {}
0051 bool operator()(const Particle *) const;
0052 };
0053
0054 class Not_Particle_Qualifier : public Particle_Qualifier_Base {
0055 Particle_Qualifier_Base * p_qual_a;
0056 public:
0057 Not_Particle_Qualifier(Particle_Qualifier_Base * qual)
0058 : p_qual_a(qual) {}
0059 bool operator()(const Particle *) const;
0060 };
0061
0062 class Is_ME_Particle : public Particle_Qualifier_Base {
0063 public:
0064 bool operator()(const Particle *) const;
0065 };
0066
0067 class Is_KF : public Particle_Qualifier_Base {
0068 private:
0069 kf_code m_kfcode;
0070 public:
0071 Is_KF(const std::string &kfcode);
0072 bool operator()(const Particle *) const;
0073 };
0074
0075 class Is_Flav : public Particle_Qualifier_Base {
0076 private:
0077 Flavour m_flav;
0078 public:
0079 Is_Flav(const std::string &kfcode);
0080 bool operator()(const Particle *) const;
0081 };
0082
0083 class Is_Parton : public Particle_Qualifier_Base {
0084 public:
0085 bool operator()(const Particle *) const;
0086 };
0087
0088 class Is_Charged : public Particle_Qualifier_Base {
0089 public:
0090 bool operator()(const Particle *) const;
0091 };
0092
0093 class Is_Hadron : public Particle_Qualifier_Base {
0094 public:
0095 bool operator()(const Particle *) const;
0096 };
0097
0098 class Is_Charged_Lepton : public Particle_Qualifier_Base {
0099 public:
0100 bool operator()(const Particle *) const;
0101 };
0102
0103 class Is_Charged_Hadron : public Particle_Qualifier_Base {
0104 public:
0105 bool operator()(const Particle *) const;
0106 };
0107
0108 class Is_Neutral_Hadron : public Particle_Qualifier_Base {
0109 public:
0110 bool operator()(const Particle *) const;
0111 };
0112
0113 class Is_Final_State : public Particle_Qualifier_Base {
0114 public:
0115 bool operator()(const Particle *) const;
0116 };
0117
0118 class Is_Neutral : public Particle_Qualifier_Base {
0119 public:
0120 bool operator()(const Particle *) const;
0121 };
0122
0123 class Is_Charged_Pion : public Particle_Qualifier_Base {
0124 public:
0125 bool operator()(const Particle *) const;
0126 };
0127
0128 class Is_Neutral_Pion : public Particle_Qualifier_Base {
0129 public:
0130 bool operator()(const Particle *) const;
0131 };
0132
0133 class Is_Charged_Kaon : public Particle_Qualifier_Base {
0134 public:
0135 bool operator()(const Particle *) const;
0136 };
0137
0138 class Is_Neutral_Kaon : public Particle_Qualifier_Base {
0139 public:
0140 bool operator()(const Particle *) const;
0141 };
0142
0143 class Is_Charged_KStar : public Particle_Qualifier_Base {
0144 public:
0145 bool operator()(const Particle *) const;
0146 };
0147
0148 class Is_Neutral_KStar : public Particle_Qualifier_Base {
0149 public:
0150 bool operator()(const Particle *) const;
0151 };
0152
0153 class Is_Rho0 : public Particle_Qualifier_Base {
0154 public:
0155 bool operator()(const Particle *) const;
0156 };
0157
0158 class Is_Eta : public Particle_Qualifier_Base {
0159 public:
0160 bool operator()(const Particle *) const;
0161 };
0162
0163 class Is_EtaPrime : public Particle_Qualifier_Base {
0164 public:
0165 bool operator()(const Particle *) const;
0166 };
0167
0168 class Is_Phi : public Particle_Qualifier_Base {
0169 public:
0170 bool operator()(const Particle *) const;
0171 };
0172
0173 class Is_Omega : public Particle_Qualifier_Base {
0174 public:
0175 bool operator()(const Particle *) const;
0176 };
0177
0178 class Is_Lambda : public Particle_Qualifier_Base {
0179 public:
0180 bool operator()(const Particle *) const;
0181 };
0182
0183 class Is_Charged_Sigma : public Particle_Qualifier_Base {
0184 public:
0185 bool operator()(const Particle *) const;
0186 };
0187
0188 class Is_Charged_Xi : public Particle_Qualifier_Base {
0189 public:
0190 bool operator()(const Particle *) const;
0191 };
0192
0193 class Is_Neutral_Xi : public Particle_Qualifier_Base {
0194 public:
0195 bool operator()(const Particle *) const;
0196 };
0197
0198 class Is_Proton_Antiproton : public Particle_Qualifier_Base {
0199 public:
0200 bool operator()(const Particle *) const;
0201 };
0202
0203 class Is_Not_Lepton : public Particle_Qualifier_Base {
0204 public:
0205 bool operator()(const Particle *) const;
0206 };
0207
0208 class Is_Not_Neutrino : public Particle_Qualifier_Base {
0209 public:
0210 bool operator()(const Particle *) const;
0211 };
0212
0213 class Is_There : public Particle_Qualifier_Base {
0214 public:
0215 bool operator()(const Particle *) const;
0216 };
0217
0218 }
0219
0220 #endif