00001 // $Id: laser.C,v 1.7 1999/05/21 15:33:58 kathy Exp $ 00002 // $Log: laser.C,v $ 00003 // Revision 1.7 1999/05/21 15:33:58 kathy 00004 // made sure Log & Id are in each file and also put in standard comment line with name of owner 00005 // 00006 // Revision 1.6 1998/09/08 13:53:31 love 00007 // laser.C divided into load.C and a new laser.C package of routines. tpctest.C created to use tpt tracking 00008 // 00009 // Revision 1.5 1998/08/26 19:04:05 love 00010 // Event display working (SUN arch only) 00011 // 00012 // Revision 1.4 1998/08/26 12:15:15 fisyak 00013 // Remove asu & dsl libraries 00014 // 00015 // Revision 1.3 1998/08/20 12:33:33 fisyak 00016 // Splitted base libraries 00017 // 00018 // Revision 1.2 1998/08/14 18:18:14 love 00019 // An example analysis of 10 events 00020 // 00021 // Revision 1.1 1998/08/10 02:35:13 fisyak 00022 // add laser 00023 // 00024 // Revision 1.6 1998/07/23 11:32:42 fisyak 00025 // Small fixes 00026 // 00027 // Revision 1.5 1998/07/21 13:35:14 fine 00028 // The new version of the macros: MakeHtmlTables and makedoc have been introduced 00029 // 00030 // Revision 1.4 1998/07/21 01:04:41 fisyak 00031 // Clean up 00032 // 00033 // Revision 1.3 1998/07/21 00:36:49 fisyak 00034 // tcl and tpt 00035 // 00036 // Revision 1.2 1998/07/20 15:08:19 fisyak 00037 // Add tcl and tpt 00038 // 00039 //======================================================================= 00040 // owner: Bill Love 00041 // what it does: 00042 //======================================================================= 00043 /*************************************************************\ 00044 laser.C is a CINT script package to analyse data from the 00045 1997 TPC test at LBL which included both Cosmic Ray 00046 triggers and laser events. It (and the St_laser_Maker code) 00047 is derived from the tst.kumac of Iwona Sakrejda and tries 00048 slavishly to reproduce that script to yield a ROOT/STAF(PAW) 00049 comparison. There are four functions: laser() defines and 00050 initializes the system. loop(n) analyses the next n events 00051 on the input file. skip(n) skips n input records. end() 00052 writes the final ntuple to the output.-- WALove 1 Sept 1998 00053 \*************************************************************/ 00054 00055 // Define globals over this package 00056 00057 Int_t ievt=0; //local event counter 00058 StChain *chain = 0; 00059 00060 void laser(){ 00061 00062 #ifndef __CINT__ 00063 #include "Rtypes.h" 00064 #include "St_XDFFile.h" 00065 #include "St_DataSet.h" 00066 #include "St_Module.h" 00067 #include "St_Table.h" 00068 #endif 00069 00070 00071 // Char_t *filename="/star/mds/data/SD97/cosmic/Sept/log-p284-t27-f4-cos.xdf"; 00072 // Char_t *filename="/scr20/love/star/test/log-p284-t27-f4-cos.xdf"; 00073 // Char_t *filename="/scr20/love/star/test/log-p274-t23-f6-las.xdf"; 00074 // Char_t *filename="/star/mds/data/SD97/cosmic/Sept/log-p274-t23-f6-las.xdf"; 00075 Char_t *filename="/star/mds/data/SD97/cosmic/Sept/log-p285-t28-f6-las.xdf"; 00076 00077 St_XDFFile *xdffile_in = new St_XDFFile (filename,"r"); 00078 // Create the main chain object 00079 chain= new StChain("StChain"); 00080 // Create the makers to be called by the current chain 00081 St_xdfin_Maker *xdfin=new St_xdfin_Maker ("xdfin_Maker","event/raw_data/tpc"); 00082 chain->SetInputXDFile(xdffile_in); 00083 St_run_Maker *run_Maker = new St_run_Maker ("run_Maker","run/params"); 00084 St_laser_Maker *laser_Maker = new St_laser_Maker ("laser_Maker","event"); 00085 // 00086 chain->PrintInfo(); 00087 // Create a root file to hold the ntuple. 00088 TFile *f=new TFile("crentup.root","RECREATE"); 00089 // Init the chain and all its makers 00090 chain->Init(); 00091 } 00092 void loop(Int_t nevt=1){ 00093 gBenchmark->Start("TPCtest"); // time the loop 00094 00095 for (Int_t i=ievt;i<ievt+nevt;i++){ 00096 chain->Clear(); 00097 chain->Make(i+1);//Tell Make the event number - starts from 1. 00098 } 00099 ievt += nevt; 00100 gBenchmark->Stop("TPCtest"); 00101 gBenchmark->Print("TPCtest"); 00102 gBenchmark->Reset(); 00103 } 00104 void skip(Int_t nskip=1){ 00105 for (Int_t i=0;i<nskip;i++){ 00106 St_DataSet *set =chain->XDFFile()->NextEventGet(); 00107 delete set; 00108 } 00109 ievt += nskip;// keep the count of events straight. 00110 } 00111 void end(){ chain->Maker("laser_Maker")->Histograms()->Write();}
1.5.9