TreeOut Class Reference

#include <TreeOut.h>

Inheritance diagram for TreeOut:
CamAna

List of all members.

Public Member Functions

 TreeOut (std::string fname="TreeOut.root")
 ~TreeOut ()
bool FillEvent (const AtmosEvent *evt)
void MakeHistos ()
void MakeCanvases ()
void Reset ()
void Finish ()

Private Attributes

TFile * fFile
TTree * fTree
const AtmosEventfEvent

Detailed Description

Definition at line 10 of file TreeOut.h.


Constructor & Destructor Documentation

TreeOut::TreeOut ( std::string  fname = "TreeOut.root"  ) 

Definition at line 25 of file TreeOut.cxx.

References Msg::kVerbose, and MSG.

00025                                 {
00026   MSG("TreeOut",Msg::kVerbose) << "TreeOut::TreeOut" << endl;
00027 
00028   TDirectory *tmpd = gDirectory;
00029   fFile = new TFile(fname.c_str(), "RECREATE");
00030   fTree = new TTree("ntp", "FarDet Atmos Events");
00031   fTree->SetDirectory(fFile);
00032   fEvent = 0;
00033   fTree->Branch("evt", "AtmosEvent", &fEvent);
00034   tmpd->cd();
00035 }

TreeOut::~TreeOut (  ) 

Definition at line 37 of file TreeOut.cxx.

References Msg::kVerbose, and MSG.

00037                   {
00038   MSG("TreeOut",Msg::kVerbose) << "TreeOut::~TreeOut" << endl;
00039 }


Member Function Documentation

bool TreeOut::FillEvent ( const AtmosEvent evt  )  [virtual]

Reimplemented from CamAna.

Definition at line 49 of file TreeOut.cxx.

References fEvent, fFile, fTree, Msg::kVerbose, Msg::kWarning, and MSG.

00049                                                {
00050   MSG("TreeOut",Msg::kVerbose) << "TreeOut::FillEvent" << endl;
00051 
00052   if (!event) {
00053     MSG("TreeOut",Msg::kWarning)<< "No Event in TreeOut::FillEvent" << endl;
00054     return false;
00055   }
00056 
00057   //fEvent = new AtmosEvent(*event);
00058   fEvent = event;
00059   if(!fEvent) return false;//wtf
00060 
00061   TDirectory* tmpd = gDirectory;
00062   fFile->cd();
00063   fTree->Fill();
00064   gDirectory = tmpd;
00065 
00066   return(true);
00067 }

void TreeOut::Finish (  )  [virtual]

Reimplemented from CamAna.

Definition at line 73 of file TreeOut.cxx.

References fFile, fTree, Msg::kVerbose, and MSG.

00073                      {
00074   MSG("TreeOut",Msg::kVerbose) << "TreeOut::Finish" << endl;
00075   TDirectory* tmpd = gDirectory;
00076   fFile->cd();
00077   fTree->SetDirectory(fFile);
00078   fTree->Write();
00079   fFile->Write();
00080   fFile->Close();
00081   gDirectory = tmpd;
00082 }

void TreeOut::MakeCanvases (  )  [virtual]

Reimplemented from CamAna.

Definition at line 45 of file TreeOut.cxx.

References Msg::kVerbose, and MSG.

00045                            {
00046   MSG("TreeOut",Msg::kVerbose) << "TreeOut::MakeCanvases" << endl;
00047 }

void TreeOut::MakeHistos (  )  [virtual]

Reimplemented from CamAna.

Definition at line 41 of file TreeOut.cxx.

References Msg::kVerbose, and MSG.

00041                          {
00042   MSG("TreeOut",Msg::kVerbose) << "TreeOut::MakeHistos" << endl;
00043 }

void TreeOut::Reset (  )  [virtual]

Reimplemented from CamAna.

Definition at line 69 of file TreeOut.cxx.

References Msg::kVerbose, and MSG.

00069                     {
00070   MSG("TreeOut",Msg::kVerbose) << "TreeOut::Reset" << endl;
00071 }


Member Data Documentation

const AtmosEvent* TreeOut::fEvent [private]

Definition at line 26 of file TreeOut.h.

Referenced by FillEvent().

TFile* TreeOut::fFile [private]

Definition at line 24 of file TreeOut.h.

Referenced by FillEvent(), and Finish().

TTree* TreeOut::fTree [private]

Definition at line 25 of file TreeOut.h.

Referenced by FillEvent(), and Finish().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1