00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef _CutBase_h_
00049 #define _CutBase_h_
00050
00051 #include <functional>
00052
00057 template<class Type>
00058 class Cut {
00059 public:
00060
00061
00062
00063
00064
00065 class OR;
00066 OR operator ||( const Cut<Type> & A ) const;
00067
00068
00069
00070 class AND;
00071 AND operator &&( const Cut<Type> & A ) const;
00072
00073
00074
00075 class NOT;
00076 NOT operator ! ( void ) const;
00077
00078
00079
00080
00081 Cut();
00082 Cut(const Cut & right);
00083 virtual ~Cut();
00084 virtual Cut * clone() const = 0;
00085
00086
00087
00088
00089 class Predicate;
00090
00091
00092
00093
00094
00095
00096 virtual bool operator ()( const Type & t ) const = 0;
00097
00098
00099
00100 };
00101
00102
00103
00104
00105 template<class Type>
00106 class Cut<Type>::AND : public Cut<Type> {
00107
00108 public:
00109 AND( const AND & right );
00110 AND( const Cut & A, const Cut & B );
00111 virtual ~AND();
00112 virtual AND * clone( void ) const;
00113 virtual bool operator ()( const Type & t ) const;
00114 private:
00115 const AND & operator=( const AND & right );
00116 Cut * _pA;
00117 Cut * _pB;
00118 };
00119
00120 template<class Type>
00121 class Cut<Type>::OR : public Cut<Type>
00122 {
00123 public:
00124 OR( const OR & right );
00125 OR( const Cut & A, const Cut & B );
00126 virtual ~OR();
00127 virtual OR * clone( void ) const;
00128 virtual bool operator ()( const Type & t ) const;
00129 private:
00130 const OR & operator=( const OR & right );
00131 Cut * _pA;
00132 Cut * _pB;
00133 };
00134
00135 template<class Type>
00136 class Cut<Type>::NOT : public Cut<Type>
00137 {
00138 public:
00139 NOT( const NOT & right );
00140 NOT( const Cut & A );
00141 virtual ~NOT();
00142 virtual NOT * clone( void ) const;
00143 virtual bool operator ()( const Type & t ) const;
00144 private:
00145 const NOT & operator=( const NOT & right );
00146 Cut * _pA ;
00147 };
00148
00149
00150 template<class Type>
00151 class Cut<Type>::Predicate : public Cut<Type>
00152 {
00153 public:
00154 Predicate( const Predicate & right );
00155 Predicate( const Cut & A );
00156 virtual ~Predicate();
00157 virtual Predicate * clone( void ) const;
00158 virtual bool operator ()( const Type & t ) const;
00159 private:
00160 const Predicate & operator=( const Predicate & right );
00161 Cut * _pA ;
00162 };
00163
00164
00165 #include "CLHEP/GenericFunctions/CutBase.icc"
00166
00167 #endif