00001 // $Id: makeStrangeMuDst.C,v 2.8 2010/03/16 16:23:09 fisyak Exp $ 00002 // $Log: makeStrangeMuDst.C,v $ 00003 // Revision 2.8 2010/03/16 16:23:09 fisyak 00004 // StTpcDb requires StDetectorDbMaker 00005 // 00006 // Revision 2.7 2006/08/15 21:42:48 jeromel 00007 // Fix rhic -> rhic.bnl.gov 00008 // 00009 // Revision 2.6 2005/08/31 15:03:09 fisyak 00010 // Add dependence StMagF vs StarMagField 00011 // 00012 // Revision 2.5 2003/02/10 16:50:08 genevb 00013 // simple updates 00014 // 00015 // Revision 2.4 2001/09/21 02:21:57 jeromel 00016 // StTpcDb needed by StEventMaker. 00017 // 00018 // Revision 2.3 2001/05/04 20:18:46 genevb 00019 // Update for new EMC dependencies 00020 // 00021 // Revision 2.2 2000/06/30 23:54:20 lansdell 00022 // load St_emc_Maker so StMcEventMaker runs properly 00023 // 00024 // Revision 2.1 2000/06/09 22:15:10 genevb 00025 // Include code for fixing track topology maps, if necessary 00026 // 00027 // Revision 2.0 2000/06/02 22:28:58 genevb 00028 // Updated for version 2 of Strangeness mico DST package 00029 // 00030 // Revision 1.5 2000/05/18 19:50:48 genevb 00031 // Better handling of status returned by chain.Make() 00032 // 00033 // Revision 1.4 2000/04/13 21:46:35 kathy 00034 // remove loading of libtpc_Tables since l3Track table is now dst_track type from global 00035 // 00036 // Revision 1.3 2000/04/12 16:16:55 genevb 00037 // Remove unnecessary library loads 00038 // 00039 // Revision 1.2 2000/04/12 15:06:53 kathy 00040 // changed all macros that read DSTs to load Tables from libraries: gen,sim,global,dst instead of ALL Tables (previously loaded St_Tables); currently, if you are using DEV to read a DST in NEW,PRO, you must comment out the loading of libtpc_Tables because of a mismatch with tpt_track table 00041 // 00042 // Revision 1.1 2000/03/29 00:24:54 genevb 00043 // Introduction of macro to use StStrangeMuDstMaker 00044 // 00045 // 00046 //====================================================== 00047 // owner: Gene Van Buren, UCLA 00048 // what it does: Uses StStrangeMuDstMaker to create a micro DST 00049 // with both v0's and xi's. Uncomment lines after 00050 // "using Monte Carlo" to include MC info in DST. 00051 // Uncomment lines after "for MDC3 files" to fix 00052 // track topology maps from MDC. 00053 //====================================================== 00054 00055 00056 00057 void load() { 00058 gSystem->Load("St_base"); 00059 gSystem->Load("StUtilities"); 00060 gSystem->Load("St_Tables"); 00061 00062 gSystem->Load("StChain"); 00063 gSystem->Load("StIOMaker"); 00064 gSystem->Load("StarClassLibrary"); 00065 gSystem->Load("StEvent"); 00066 gSystem->Load("StarMagField"); 00067 gSystem->Load("StMagF"); 00068 gSystem->Load("StDetectorDbMaker"); 00069 gSystem->Load("StTpcDb"); 00070 // The following is needed if reading from dst Branch instead of Event Branch 00071 // gSystem->Load("StEventMaker"); 00072 gSystem->Load("StStrangeMuDstMaker"); 00073 // The following are needed for using Monte Carlo info 00074 // gSystem->Load("StEmcUtil"); 00075 // gSystem->Load("StMcEvent"); 00076 // gSystem->Load("StMcEventMaker"); 00077 // gSystem->Load("StAssociationMaker"); 00078 // gSystem->Load("StMcAnalysisMaker"); 00079 // The following is needed for MDC3 files with incorrect track topology maps 00080 // gSystem->Load("StHbtMaker"); 00081 } 00082 00083 void run() { 00084 // Open input file 00085 const Char_t *file = "/afs/rhic.bnl.gov/star/data/samples/hc_standard.40_evts.dst.root"; 00086 00087 StFile *files = new StFile(); 00088 files->AddFile(file); 00089 00090 // Set number of events to analyse 00091 const Int_t Nevents = 10; 00092 00093 // Create a chain 00094 StChain chain("myChain"); 00095 00096 // Create Makers 00097 StIOMaker IOMaker("IO","r",files,"bfcTree"); 00098 // The following is needed if reading from dst Branch instead of Event Branch 00099 // StEventMaker eventMaker("events","title"); 00100 // The following are needed for using Monte Carlo info 00101 // StMcEventMaker* mcEventReader = new StMcEventMaker; 00102 // StAssociationMaker* associator = new StAssociationMaker; 00103 // The following is needed for MDC3 files with incorrect track topology maps 00104 // StRandyTopMapMaker topoMapFixer(); 00105 StStrangeMuDstMaker strangeDst("strangeMuDst"); 00106 00107 // Indicate input branches (i.e. eventBranch = *.event.root file) 00108 IOMaker.SetBranch("*",0,"0"); //deactivate all branches 00109 IOMaker.SetBranch("runcoBranch",0,"r"); //activate runco Branch 00110 // One of the following two branches must be selected to read from 00111 // IOMaker.SetBranch("dstBranch",0,"r"); //activate sst Branch 00112 IOMaker.SetBranch("eventBranch",0,"r"); //activate Event Branch 00113 // The following is needed for using Monte Carlo info 00114 // IOMaker.SetBranch("geantBranch",0,"r"); //activate geant Branch 00115 00116 // Indicate micro DST settings 00117 strangeDst.DoV0(); // Selects V0 vertices for micro-DST 00118 strangeDst.DoXi(); // Selects Xi vertices for micro-DST 00119 strangeDst.SetWrite(); // Sets "write" mode (using default filenames) 00120 // The following is needed for using Monte Carlo info 00121 // strangeDst.DoMc(); 00122 00123 // Do init 00124 Int_t istatus = chain.Init(); 00125 if( istatus ) { chain.Fatal(istatus,"on init"); return; } 00126 00127 // Loop over events 00128 for( Int_t i=0; (i<Nevents) && (istatus!=2); i++ ) { 00129 switch (istatus = chain.Make(i)) { 00130 case 0: break; 00131 case 2: { gMessMgr->Info("Last event from input."); break; } 00132 case 3: { gMessMgr->Error() << "Event " << i << " had error " << 00133 istatus << ". Now skipping event."; gMessMgr->Print(); break; } 00134 default: { gMessMgr->Warning() << "Event " << i << " returned status " << 00135 istatus << ". Continuing."; gMessMgr->Print(); } 00136 } 00137 if( i != Nevents) chain.Clear(); 00138 gMessMgr->Info() << "*** Finished processing event " << i; 00139 gMessMgr->Print(); 00140 } 00141 00142 // Finish 00143 if( Nevents >= 1 ) { 00144 chain.Finish(); 00145 } 00146 } 00147 00148 void makeStrangeMuDst() { 00149 load(); 00150 run(); 00151 } 00152
1.5.9