Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

AlgEvent.h

Go to the documentation of this file.
00001 #ifndef ANP_ALGEVENT_H
00002 #define ANP_ALGEVENT_H
00003 
00004 //
00005 // ABC for event based algorithm
00006 // 
00007 // This algorithm is executed once for each event
00008 //
00009 // Four virtual functions
00010 //
00011 // Run() is executed on every event
00012 //
00013 // Config() is called after algorithm is created
00014 //          it passed registry with configuration parameters
00015 //
00016 // Set() is called after Config()
00017 //       it provides a pointer to TDirectory in ROOT file
00018 //       TDirectory pointer can be NULL
00019 //
00020 // End() is called after processing is complete
00021 //       after this call there no more events to Run()
00022 //
00023 
00024 // C++
00025 #include <string>
00026 
00027 // Local
00028 #include "PhysicsNtuple/Handle.h"
00029 #include "PhysicsNtuple/Record.h"
00030 
00031 class DataBlock;
00032 class Registry;
00033 class TDirectory;
00034 
00035 namespace Anp
00036 {
00037    class AlgEvent: public virtual Base
00038    {      
00039    public:      
00040       
00041       AlgEvent();
00042       virtual ~AlgEvent() ;
00043 
00044       virtual bool Run(Event &event, const Record &record, bool pass) = 0;
00045       
00046       virtual void Config(const Registry &);
00047 
00048       virtual void Set(TDirectory *);
00049 
00050       virtual void End(const DataBlock &);
00051 
00052       void Name(const std::string &value);
00053       const std::string& Name() const;
00054 
00055    private:
00056 
00057       AlgEvent(const AlgEvent &);
00058       AlgEvent& operator=(const AlgEvent &);
00059 
00060    private:
00061 
00062       std::string fName;
00063 
00064    };
00065 
00066    typedef Anp::Handle<Anp::AlgEvent> AlgEventPtr;
00067 
00068    //
00069    // Inlined member functions
00070    //
00071 
00072    inline AlgEvent::AlgEvent() : fName("generic")
00073    {
00074    }
00075 
00076    inline AlgEvent::~AlgEvent()
00077    {
00078    }
00079 
00080    inline void AlgEvent::Config(const Registry &)
00081    {
00082    }
00083 
00084    inline void AlgEvent::Set(TDirectory *)
00085    {
00086    }
00087 
00088    inline void AlgEvent::End(const DataBlock &)
00089    {
00090    }
00091 
00092    inline void AlgEvent::Name(const std::string &value)
00093    { 
00094       fName = value;
00095    }
00096 
00097    inline const std::string& AlgEvent::Name() const
00098    {
00099       return fName;
00100    }
00101 }
00102 
00103 #endif

Generated on Mon Feb 15 11:06:17 2010 for loon by  doxygen 1.3.9.1