00001 /*************************************************************************** 00002 * 00003 * $Id: rch.C,v 1.2 2000/01/25 16:06:38 fisyak Exp $ 00004 * $Log: rch.C,v $ 00005 * Revision 1.2 2000/01/25 16:06:38 fisyak 00006 * g2r -> g2t 00007 * 00008 * Revision 1.1 1999/07/13 01:05:45 kathy 00009 * this is obsolete 00010 * 00011 * Revision 1.4 1999/05/21 15:40:04 kathy 00012 * fixed owner on rch.C 00013 * 00014 * Revision 1.3 1999/05/21 15:34:00 kathy 00015 * made sure Log & Id are in each file and also put in standard comment line with name of owner 00016 * 00017 * Revision 1.2 1999/02/13 00:17:43 lyons 00018 * Small clean up... untested 00019 * 00020 * Revision 1.1 1999/02/12 23:58:47 lyons 00021 * UNTESTED VERSION, but should hopefully work. 00022 * Should execute the StRchMaker after creating a sufficient chain. 00023 * 00024 *************************************************************************** * 00025 * Author: Dan Lyons 00026 *************************************************************************** 00027 * 00028 * Description: RICH offline software: 00029 * StRchMaker.cxx - ROOT/STAR Maker for offline chain. 00030 * Start at 00031 * http://rsgi01.rhic.bnl.gov/STAR/html/comp_l/root/index2.html 00032 * for more info, or at 00033 * http://rsgi01.rhic.bnl.gov/star/starlib/doc/www/star.html 00034 * if the other one disappears for some reason 00035 * 00036 * 00037 *************************************************************************** 00038 * **************************************************************************/ 00039 00040 //======================================================================= 00041 // owner: Dan Lyons 00042 // what it does: 00043 //======================================================================= 00044 00045 00046 // Emulate BFC... from bfc.C: 00047 00048 TBrowser *b = 0; 00049 class StChain; 00050 StChain *chain=0; 00051 00052 // Only load necessary parts 00053 00054 void Load(){ 00055 gSystem->Load("St_base"); 00056 gSystem->Load("StChain"); 00057 gSystem->Load("xdf2root"); 00058 gSystem->Load("St_Tables"); 00059 00060 00061 gSystem->Load("St_params_Maker"); 00062 gSystem->Load("geometry"); 00063 gSystem->Load("St_g2t"); 00064 00065 gSystem->Load("St_geant_Maker"); 00066 gSystem->Load("St_TLA_Maker"); 00067 gSystem->Load("St_xdfin_Maker"); 00068 gSystem->Load("StRchMaker"); 00069 } 00070 00071 00072 void rch(const Int_t Nevents=1) 00073 { 00074 // ***modified from bfc.C: 00075 00076 if (gClassTable->GetID("StChain") < 0) Load(); 00077 // Create the main chain object 00078 if (chain) delete chain; 00079 chain = new StChain("rch"); // ***string change from bfc.C, "bfc"->"rch" 00080 cout << "2" << endl; 00081 // ***this stuff looks about right... I don't know. from bfc.C: 00082 // Create the makers to be called by the current chain 00083 St_params_Maker *params = new St_params_Maker("params","params"); 00084 // St_TLA_Maker *geom = new 00085 // St_TLA_Maker("geom","run/geant/Run"); 00086 St_geant_Maker *geant = new St_geant_Maker("geant","event/geant/Event"); 00087 geant->SetNwGEANT(20 000 000); 00088 geant->SetIwtype(1); 00089 geant->Do("gfile p /disk1/star/test/psc0049_08_40evts.fzd"); 00090 cout << "3.25" << endl; 00091 // geant->LoadGeometry("detp geometry field_only"); 00092 // *** skip other makers, I think we're good. 00093 // *** Do load that RICH maker, though. 00094 // *** Sorry to follow the nonconformist underscore ban. I just work here. 00095 cout << "3.5" << endl; 00096 StRchMaker *rch=new StRchMaker("rch","event/raw_data/rch"); 00097 // *** follow tpc name/title convention, skipped "_raw" modifier. 00098 // *** back to bfc.C: 00099 cout << "3.75" << endl; 00100 chain->PrintInfo(); 00101 cout << "4" << endl; 00102 // Init the chain and all its makers 00103 chain->SetDebug(1); 00104 cout << "4.35" << endl; 00105 int iInit = chain->Init(); 00106 if (iInit) chain->Fatal(iInit,"on init"); 00107 cout << "4.5" << endl; 00108 // *** How does the chain know who its makers are? 00109 // *** Must be Magic! 00110 // *** Who am I to ask that of the chain, I know not my maker. 00111 // *** skip xdf_out/root_out portion of bfc.C, only interested in debug 00112 // *** info at this point. Loop over events from bfc.C: 00113 00114 gBenchmark->Start("rch"); // *** string change bfc->rch 00115 cout << "5" << endl; 00116 Int_t i=0; 00117 for (Int_t i =1; i <= Nevents; i++){ 00118 if (chain->Make(i)) break; 00119 // *** Skip DST crap, looks like all that stuff is commented out 00120 // *** everywhere. 00121 00122 if (i != Nevents) chain->Clear(); 00123 printf ("===========================================\n"); 00124 printf ("====Done with Event no. %d\n",i); 00125 printf ("===========================================\n"); 00126 // *** Hey, cin with the new and cout with the old... 00127 // *** We don't be usin' that function no more! 00128 } 00129 if (Nevents > 1) { 00130 chain->Finish(); 00131 gBenchmark->Print("rch"); // string change from bfc.C 00132 } 00133 } 00134
1.5.9