00001
00008 #include <iostream.h>
00009 #include <math.h>
00010 #include <string.h>
00011 #include <cstdio>
00012 #include "ReactorEvent.hh"
00013 #include "ReactorDetector.hh"
00014 #include "ReactorFortran.hh"
00015 #include "ReactorTree.hh"
00016 #include "RMCEvent.hh"
00017 #include "TTree.h"
00018 #include "TBranch.h"
00019
00020 ReactorTree::ReactorTree(){
00021 }
00022
00023 ReactorTree::ReactorTree(const char* TreeName){
00024
00025
00026
00027 tree = new TTree(TreeName,"ReactorTree");
00028 tree->SetAutoSave(1000000);
00029 int bufsize =64000000;
00030 int split = 2;
00031 if (split) bufsize /=4 ;
00032 int branchstyle=1;
00033 TTree::SetBranchStyle(branchstyle);
00034 rmce = new RMCEvent();
00035 TBranch *branch=tree->Branch("RMCEvent","RMCEvent",&rmce,bufsize,split);
00036
00037 branch->SetAutoDelete(kFALSE);
00038 }
00039
00040 ReactorTree::~ReactorTree(){
00041 ;
00042 }
00043
00044 void ReactorTree::Fill(ReactorEvent& Event,ReactorDetector& Detector){
00045
00046 static const int Ndim=7;
00047
00048 std::string EventType = Event.eventType;
00049 int Nevent = Event.GetNevent();
00050 rmce->Build(Event,Detector,EventType,Nevent);
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 tree->Fill();
00067
00068 }
00069
00070 void ReactorTree::CloseOut(){
00071
00072 tree->Print();
00073
00074 }
00075