Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

NCutter.h

Go to the documentation of this file.
00001 //*************************************************************************
00002 //*                                                                       *
00003 //*                     class NCutter  GenParticle Selector               * 
00004 //*                                                                       *
00005 //*  NCutter allows the chaining of a number of GenParticle selectors     *
00006 //*  effecivly "anding" them together                                     *
00007 //*                                                                       *
00008 //*************************************************************************  
00009 #ifndef HEPMCHELPER_NCUTTER_H
00010 #define HEPMCHELPER_NCUTTER_H
00011 
00012 #ifndef HEPMCHELPER_IMCSELECTOR_H
00013 #include "AtlfastUtils/HepMC_helper/IMCselector.h"
00014 #endif
00015 
00016 #ifndef HEPMCHELPER_ALL_H
00017 #include "AtlfastUtils/HepMC_helper/All.h"
00018 #endif
00019 
00020 #ifndef STD_VECTOR_H
00021 #include <vector>
00022 #define STD_VECTOR_H
00023 #endif
00024 
00025 namespace HepMC_helper{
00026   
00027   class NCutter: public IMCselector {
00028     typedef  std::vector<IMCselector*> Selectors;
00029   private:
00030     Selectors m_selectors;
00031     
00032   public:
00033     // Constructors
00034     NCutter() {m_selectors.push_back( new All() ); }
00035     
00036     NCutter(const Selectors selectors){
00037       Selectors::const_iterator i=selectors.begin();
00038       for(; i != selectors.end(); ++i) m_selectors.push_back((*i)->create());
00039     }
00040     
00041     NCutter(const IMCselector* selector){ 
00042       m_selectors.push_back(selector->create() );
00043     }    
00044     
00045     NCutter( const NCutter& src ):IMCselector(){
00046       Selectors::const_iterator i=(src.m_selectors).begin();
00047       for(;i != (src.m_selectors).end(); ++i){
00048         m_selectors.push_back((*i)->create());
00049       }
00050     }  
00051     // Destructor
00052     ~NCutter() {
00053       Selectors::iterator i=m_selectors.begin();
00054       for(; i != m_selectors.end(); ++i) delete(*i);
00055     }
00056     
00057     IMCselector* create() const;
00058     bool operator() ( const Particle* const ) const ;
00059     bool operator() ( const Particle& p ) const;
00060   };
00061 }//namespace
00062 #endif
00063 
00064 
00065 
00066 
00067 
00068 

Generated on Wed Jan 15 11:00:29 2003 for AtlfastUtils by doxygen1.3-rc1