00001 #ifndef ANP_FILLDATA_H
00002 #define ANP_FILLDATA_H
00003
00004
00005
00006
00007
00008
00009
00010 #include "Registry/Registry.h"
00011
00012
00013 #include "PhysicsNtuple/AlgSnarl.h"
00014
00015 class TBranch;
00016 class TFile;
00017 class TTree;
00018
00019 namespace Anp
00020 {
00021 class FillData : public AlgSnarl
00022 {
00023 public:
00024
00025 FillData();
00026 virtual ~FillData();
00027
00028 bool Run(Record &record);
00029
00030 void Config(const Registry ®);
00031
00032 void Set(TDirectory *dir);
00033
00034 void End(const DataBlock &);
00035
00036 private:
00037
00038 struct Tree
00039 {
00040 Tree() : tree_ptr(0), branch_ptr(0), data(0.0) {}
00041 TTree *tree_ptr;
00042 TBranch *branch_ptr;
00043 Float_t data;
00044 };
00045
00046 typedef std::map<std::string, Tree> TreeMap;
00047
00048 private:
00049
00050 void Fill(DataIter ibeg, DataIter iend, const std::string &key);
00051
00052 private:
00053
00054 TDirectory *fDir;
00055 TFile *fFile;
00056
00057 std::string fDirName;
00058
00059 TreeMap fTree;
00060 };
00061 }
00062
00063 #endif