mcr/raw_read/GetRunInfoFromRaw.C

00001 #include "TFndRun.h"
00002 
00003 void GetRunInfoFromRaw(const TString &run_type,const Int_t &run_num){
00004 
00005   TFndRun *fRun = new TFndRun();
00006   
00007   fRun->SetDebugLevel(0);
00008   fRun->SetDebugRawEv(0);
00009   fRun->SetDataPath("$RDT");
00010   fRun->SetDBHost("$MSQL_DB_HOST");
00011   
00012   fRun->SetMaxNumberOfEvents(1);
00013 
00014   TFndGeometry *fingeo = new TFndGeometry();
00015   fingeo->LoadGeometry("$FROOTSYS/geom/fin_spec_geom_2006.root");
00016 
00017   // --- get file  
00018   Int_t in_val = fRun->InitNewRun(run_type,run_num);
00019   if (in_val == -3) TerminateFroot(0,TString("wrong argument received as \"run-type\" (\""+run_type)+"\").");  
00020   if(in_val != 0){
00021     Printf("Problems while trying to get the raw file.");
00022     fRun->FinishRun(kTRUE);
00023     return;
00024   }
00025 
00026   // --- get first event
00027   Int_t ExitVal = fRun->GetNextEvent(kTRUE); 
00028   if(ExitVal != 0){
00029     Printf("Problems while trying to get the first event.");
00030     fRun->FinishRun(kTRUE);
00031     return;
00032   }
00033   
00034   // --- get header info from TFndGenInfo
00035   fRun->GetGenInfo()->Print();
00036 }

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