00001 enum dataFormat {dst, evt, tree};
00002
00003
00004 class StChain;
00005 StChain *chain=0;
00006
00007
00008
00009 Int_t usePath = 0;
00010 Int_t nFile = 0;
00011 TString thePath;
00012 TString theFileName;
00013 TString originalPath;
00014
00015
00016
00017 TBrowser *b=0;
00018 const char *venusFile ="set*geant.root";
00019 const char *venusPath ="/disk00001/star/auau200/venus412/default/b0_3/year_1b/hadronic_on/tfs_4/";
00020 const char *dstFile ="/disk00001/star/auau200/two_photon/starlight/twogam/year_1b/hadronic_on/tfs/ric0022_01_14552evts.dst.root";
00021 const char *xdfFile ="/afs/rhic.bnl.gov/star/data/samples/psc0054_07_40evts_dst.xdf";
00022 const char *mdcFile ="/disk00001/star/auau200/venus412/default/b0_3/year_1b/hadronic_on/tss/psc0081_07_40evts.root";
00023 const char *geantFile ="/disk00000/star/auau200/hijing135/jetq_off/b0_3/year_1b/hadronic_on/tfsr/set0041_01_53evts.geant.root";
00024 const char *fileList[] = {dstFile,xdfFile,mdcFile,0};
00025
00026
00027 void StHbtMuDst2TTreeDstMaker(
00028 const Int_t nevents=999999, int maxFiles=2,
00029 const Char_t *path="",
00030 const Char_t *fileName="AuAu200.lis",
00031 const Char_t *filter="st_physics_2302016:MuDst.root",
00032 const Char_t *outFile="MuDst2TTree.root")
00033
00034 {
00035
00036
00037 gSystem->Load("St_base");
00038 gSystem->Load("StChain");
00039 gSystem->Load("St_Tables");
00040 gSystem->Load("StMagF");
00041 gSystem->Load("StUtilities");
00042 gSystem->Load("StTreeMaker");
00043 gSystem->Load("StIOMaker");
00044 gSystem->Load("StarClassLibrary");
00045 gSystem->Load("StTpcDb");
00046 gSystem->Load("StDbUtilities");
00047 gSystem->Load("StEvent");
00048 gSystem->Load("StEventMaker");
00049 gSystem->Load("StEventUtilities");
00050 gSystem->Load("StEmcUtil");
00051 gSystem->Load("St_emc_Maker");
00052 gSystem->Load("StMcEvent");
00053 gSystem->Load("StMcEventMaker");
00054 gSystem->Load("StAssociationMaker");
00055 gSystem->Load("StMcAnalysisMaker");
00056 gSystem->Load("StFlowMaker");
00057 gSystem->Load("StFlowTagMaker");
00058 gSystem->Load("StFlowAnalysisMaker");
00059 gSystem->Load("StStrangeMuDstMaker");
00060 gSystem->Load("StMuDSTMaker");
00061 gSystem->Load("StHbtMaker");
00062
00063
00064 cout << " loading done " << endl;
00065
00066 chain = new StChain("StChain");
00067 chain->SetDebug();
00068
00069
00070
00071
00072
00073 StMuDebug::setLevel(0);
00074 StMuDbReader* dbReader = StMuDbReader::instance();
00075 dbReader->addDb("P02g.db");
00076 StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,path,fileName,filter,maxFiles);
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 StHbtMaker* hbtMaker = new StHbtMaker("HBT","title");
00088 cout << "StHbtMaker instantiated"<<endl;
00089 cout << "StHbtMaker::Init - setting up Reader and Analyses..." << endl;
00090 StHbtManager* TheManager = hbtMaker->HbtManager();
00091
00092
00093
00094
00095 StHbtMuDstMakerReader* Reader = new StHbtMuDstMakerReader(muDstMaker);
00096 Reader->setTrackType(1);
00097 TheManager->SetEventReader(Reader);
00098
00099
00100
00101 mikesEventCut* EventCut = new mikesEventCut;
00102 EventCut->SetEventMult(0,100000);
00103 EventCut->SetVertZPos(-75.0,75.0);
00104
00105 franksTrackCut* AllTrackCut = new franksTrackCut;
00106 AllTrackCut->SetNSigmaElectron(-1000.0,1000.0);
00107 AllTrackCut->SetNSigmaPion(-1000.0,1000.0);
00108 AllTrackCut->SetNSigmaKaon(-1000.0,1000.0);
00109 AllTrackCut->SetNSigmaProton(-1000.0,1000.0);
00110 AllTrackCut->SetNHits(10,1000);
00111 AllTrackCut->SetP(0.0,50.0);
00112 AllTrackCut->SetPt(0.0,50.0);
00113 AllTrackCut->SetRapidity(-15,15);
00114 AllTrackCut->SetDCA(0.0,200.);
00115 AllTrackCut->SetCharge(0);
00116 AllTrackCut->SetMass(0.139);
00117
00118 helensV0Cut* V0Cut = new helensV0Cut;
00119 V0Cut->SetdcaV0daughters(0.,1.0);
00120 V0Cut->SetdcaV0ToPrimVertex(0.,1.);
00121 V0Cut->SetdecayLengthV0(3.0,5000.);
00122 V0Cut->SettpcHitsPos(15,50);
00123 V0Cut->SettpcHitsNeg(15,50);
00124 V0Cut->SetdcaPosToPrimVertex(1.8,50.);
00125 V0Cut->SetdcaNegToPrimVertex(3.5,50.);
00126 V0Cut->SetPt(0.,10.0);
00127
00128 franksXiCut* XiCut = new franksXiCut;
00129 XiCut->SetdcaXidaughters(0.,1.0);
00130 XiCut->SetdcaXiToPrimVertex(0.,1.);
00131 XiCut->SetdecayLengthXi(3.0,5000.);
00132 XiCut->SetPt(0.,10.0);
00133 cout << "READER SET UP.... " << endl;
00134
00135
00136
00137 StHbtTTreeReader* allWriter = new StHbtTTreeReader(1,0,"./",outFile,".hbtTTreeMuDst","");
00138
00139 TheManager->AddEventWriter(allWriter);
00140 allWriter->SetEventCut(EventCut);
00141 allWriter->SetTrackCut(AllTrackCut);
00142 allWriter->SetV0Cut(V0Cut);
00143 allWriter->SetXiCut(XiCut);
00144 cout << "WRITER SET UP.... " << endl;
00145
00146
00147
00148 chain->Init();
00149 chain->PrintInfo();
00150 for (Int_t iev=0;iev<nevents; iev++) {
00151 cout << "StHbtExample -- Working on eventNumber " << iev << endl;
00152 chain->Clear();
00153 int iret = chain->Make(iev);
00154 if (iret) {
00155 cout << "Bad return code!" << endl;
00156 break;
00157 }
00158 }
00159 chain->Finish();
00160
00161 cout << " End of Analysis " << endl;
00162 }
00163
00164
00165