mcr/hdt_read/PrintHdt.C

00001 #include "TApplication.h"
00002 #include "TFndHdt.h"
00003 
00004 #include "FROOT.h"
00005 //using namespace FROOT;
00006 
00007 void PrintHdt(TString run_type="FINU",Int_t run_num=10000,Int_t from_event=1,Int_t nevs=3){
00008 
00009   TString hdt_name;
00010   hdt_name.Form("%s%s.hdt.root",
00011                 FROOT::ExpandPathName("$FND_HDT/").Data(),
00012                 FROOT::BuildRunName(run_type,run_num,kTRUE).Data());
00013   
00014   if(gSystem->AccessPathName(hdt_name)){
00015     Printf("file \"%s\" not found.",hdt_name.Data());
00016     return;
00017   }
00018 
00019   TFile *h_file = new TFile(hdt_name,"OPEN");
00020   TTree *tree = (TTree *) h_file->Get("FIN_HDT_TREE");
00021 
00022   //  tree->Print();
00023 
00024   TFndHdt *hit = 0;
00025   tree->SetBranchAddress("fndhdt",&hit);
00026 
00027   for(Int_t ev=from_event; ev< (from_event+nevs); ev++){
00028     tree->GetEntry(ev-1);
00029     // depths:     GTS TOF SIL LMD STB
00030     hit->PrintHits( 0 , 2 , 0 , 0 , 0 );
00031   }
00032 
00033 }

Generated on Tue Oct 16 15:40:47 2007 by  doxygen 1.5.2