Main Page   Compound List   File List   Compound Members   File Members  

ReactorTree.cpp

Go to the documentation of this file.
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   // define Tree branches here
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 //  tree->Show();
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 // Harvest information from ReactorEvent 
00048     std::string EventType = Event.eventType;
00049     int Nevent = Event.GetNevent();
00050     rmce->Build(Event,Detector,EventType,Nevent);
00051 /*    if (EventType == "reactor"){   
00052     }
00053     else if(EventType == "cf252"){   
00054             rmce->SetEventType(1);
00055     }
00056     else if(EventType == "pmtrad"){   
00057             rmce->SetEventType(2);
00058     }
00059     else if(EventType == "muon"){   
00060             rmce->SetEventType(3);
00061     }
00062     else if(EventType == "all"){   
00063             rmce->SetEventType(4);
00064     }
00065     */
00066     tree->Fill();
00067 
00068 }
00069 
00070 void ReactorTree::CloseOut(){
00071 
00072   tree->Print();
00073 
00074 }
00075 

Generated on Mon Feb 21 16:11:19 2005 for ReactorFsim by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002