#include <G4SmartFilter.hh>
Inheritance diagram for G4SmartFilter< T >:
Public Member Functions | |
G4SmartFilter (const G4String &name) | |
virtual | ~G4SmartFilter () |
virtual G4bool | Evaluate (const T &) const =0 |
virtual void | Print (std::ostream &ostr) const =0 |
virtual void | Clear ()=0 |
G4bool | Accept (const T &) const |
virtual void | PrintAll (std::ostream &ostr) const |
virtual void | Reset () |
void | SetActive (const G4bool &) |
G4bool | GetActive () const |
void | SetInvert (const G4bool &) |
G4bool | GetInvert () const |
void | SetVerbose (const G4bool &) |
G4bool | GetVerbose () const |
Definition at line 39 of file G4SmartFilter.hh.
G4SmartFilter< T >::G4SmartFilter | ( | const G4String & | name | ) |
Definition at line 91 of file G4SmartFilter.hh.
00092 :G4VFilter<T>(name) 00093 ,fActive(true) 00094 ,fInvert(false) 00095 ,fVerbose(false) 00096 ,fNPassed(0) 00097 ,fNProcessed(0) 00098 {}
G4SmartFilter< T >::~G4SmartFilter | ( | ) | [virtual] |
G4bool G4SmartFilter< T >::Accept | ( | const T & | ) | const [virtual] |
Implements G4VFilter< T >.
Definition at line 105 of file G4SmartFilter.hh.
References G4SmartFilter< T >::Evaluate(), G4cout, G4endl, and G4VFilter< T >::Name().
00106 { 00107 if (fVerbose) { 00108 G4cout<<"Begin verbose printout for filter "<<G4VFilter<T>::Name()<<G4endl; 00109 G4cout<<"Active ? : "<<fActive<<G4endl; 00110 } 00111 00112 fNProcessed++; 00113 00114 // Pass everything if filter is not active 00115 if (!fActive) { 00116 fNPassed++; 00117 return true; 00118 } 00119 00120 // Do filtering 00121 G4bool passed = Evaluate(object); 00122 00123 // Apply inversion if applicable 00124 if (fInvert) passed = !passed; 00125 00126 if (passed) fNPassed++; 00127 00128 if (fVerbose) { 00129 G4cout<<"Inverted ? : "<<fInvert<<G4endl; 00130 G4cout<<"Passed ? : "<<passed<<G4endl; 00131 G4cout<<"End verbose printout for filter "<<G4VFilter<T>::Name()<<G4endl; 00132 } 00133 00134 return passed; 00135 }
virtual void G4SmartFilter< T >::Clear | ( | ) | [pure virtual] |
Implemented in G4AttributeFilterT< T >, G4TrajectoryChargeFilter, G4TrajectoryOriginVolumeFilter, and G4TrajectoryParticleFilter.
Referenced by G4SmartFilter< T >::Reset().
virtual G4bool G4SmartFilter< T >::Evaluate | ( | const T & | ) | const [pure virtual] |
Implemented in G4AttributeFilterT< T >, G4TrajectoryChargeFilter, G4TrajectoryOriginVolumeFilter, and G4TrajectoryParticleFilter.
Referenced by G4SmartFilter< T >::Accept().
G4bool G4SmartFilter< T >::GetActive | ( | ) | const |
G4bool G4SmartFilter< T >::GetInvert | ( | ) | const |
G4bool G4SmartFilter< T >::GetVerbose | ( | ) | const |
virtual void G4SmartFilter< T >::Print | ( | std::ostream & | ostr | ) | const [pure virtual] |
Implemented in G4AttributeFilterT< T >, G4TrajectoryChargeFilter, G4TrajectoryOriginVolumeFilter, and G4TrajectoryParticleFilter.
Referenced by G4SmartFilter< T >::PrintAll().
void G4SmartFilter< T >::PrintAll | ( | std::ostream & | ostr | ) | const [virtual] |
Implements G4VFilter< T >.
Definition at line 139 of file G4SmartFilter.hh.
References G4endl, G4VFilter< T >::Name(), and G4SmartFilter< T >::Print().
00140 { 00141 ostr<<"Printing data for filter: "<<G4VFilter<T>::Name()<<G4endl; 00142 00143 Print(ostr); 00144 00145 ostr<<"Active ? : " <<fActive<<G4endl; 00146 ostr<<"Inverted ? : " <<fInvert<<G4endl; 00147 ostr<<"#Processed : " <<fNProcessed<<G4endl; 00148 ostr<<"#Passed : " <<fNPassed<<G4endl; 00149 }
void G4SmartFilter< T >::Reset | ( | ) | [virtual] |
Implements G4VFilter< T >.
Definition at line 153 of file G4SmartFilter.hh.
References G4SmartFilter< T >::Clear().
00154 { 00155 fActive = true; 00156 fInvert = false; 00157 fNProcessed = 0; 00158 fNPassed = 0; 00159 00160 // Clear subclass data 00161 Clear(); 00162 }
void G4SmartFilter< T >::SetActive | ( | const G4bool & | ) |
void G4SmartFilter< T >::SetInvert | ( | const G4bool & | ) |
void G4SmartFilter< T >::SetVerbose | ( | const G4bool & | ) |