00001
00002
00003
00004
00005
00006
00007 #include "StChain.h"
00008
00009 #include "StEvent/StEventTypes.h"
00010
00011 #include "StEventUtilities/StuRefMult.hh"
00012 #include "StEventUtilities/StuProbabilityPidAlgorithm.h"
00013
00014 #include "StarClassLibrary/StPhysicalHelixD.hh"
00015 #include "StarClassLibrary/StTimer.hh"
00016
00017 #include "StFlowMaker/StFlowMaker.h"
00018 #include "StFlowMaker/StFlowSelection.h"
00019 #include "StFlowMaker/StFlowEvent.h"
00020
00021 #include "StStrangeMuDstMaker/StStrangeMuDstMaker.h"
00022 #include "StStrangeMuDstMaker/StStrangeEvMuDst.hh"
00023 #include "StStrangeMuDstMaker/StV0MuDst.hh"
00024 #include "StStrangeMuDstMaker/StV0Mc.hh"
00025 #include "StStrangeMuDstMaker/StXiMuDst.hh"
00026 #include "StStrangeMuDstMaker/StXiMc.hh"
00027 #include "StStrangeMuDstMaker/StKinkMuDst.hh"
00028 #include "StStrangeMuDstMaker/StKinkMc.hh"
00029
00030 #include "StMuDSTMaker/COMMON/StMuException.hh"
00031 #include "StMuDSTMaker/COMMON/StMuEvent.h"
00032 #include "StMuDSTMaker/COMMON/StMuTrack.h"
00033 #include "StMuDSTMaker/COMMON/StMuDebug.h"
00034 #include "StMuDSTMaker/COMMON/StMuCut.h"
00035 #include "StMuDSTMaker/COMMON/StMuDst.h"
00036
00037 #include "StHbtMuDstMakerReader.h"
00038 #include "StHbtMaker/Infrastructure/StHbtEvent.hh"
00039 #include "StHbtMaker/Base/StHbtEventCut.h"
00040
00041 #include "TFile.h"
00042 #include "TTree.h"
00043 #include "TClass.h"
00044 #include "TChain.h"
00045 #include "TStreamerInfo.h"
00046 #include "TClonesArray.h"
00047
00048 ClassImp(StHbtMuDstMakerReader)
00049
00050 #if !(ST_NO_NAMESPACES)
00051 using namespace units;
00052 #endif
00053
00054
00055
00056
00057
00058 StHbtMuDstMakerReader::StHbtMuDstMakerReader(StMuDstMaker* maker) :
00059 mFlowMaker(0), mMuDstMaker(maker),
00060 mTrackType(primary), mReadTracks(1),
00061 mReadV0s(1), mReadXis(1), mReadKinks(1), mFinish(0),
00062 mHbtEvent(0)
00063 {
00064 mEventCounter=0;
00065 mReaderStatus = 0;
00066
00067 }
00068
00069
00070
00071
00072 StHbtMuDstMakerReader::~StHbtMuDstMakerReader(){
00073 }
00074
00075
00076
00077 void StHbtMuDstMakerReader::clear(){
00078 DEBUGMESSAGE1("");
00079
00080 }
00081
00082
00083
00084 int StHbtMuDstMakerReader::Init(){
00085 DEBUGMESSAGE1("");
00086
00087
00088
00089 return 0;
00090 }
00091
00092
00093
00094
00095 void StHbtMuDstMakerReader::Clear(){
00096 DEBUGMESSAGE1("");
00097 clear();
00098 }
00099
00100
00101
00102 StHbtEvent* StHbtMuDstMakerReader::ReturnHbtEvent(){
00103 DEBUGMESSAGE1("");
00104 StTimer timer;
00105 timer.start();
00106 clear();
00107 mMuDst=mMuDstMaker->muDst();
00108 mHbtEvent=0;
00109 if (mMuDst && mMuDst->event() ) {
00110 DEBUGVALUE3(mMuDst);
00111 mMuDst->fixTrackIndices();
00112 mHbtEvent = new StHbtEvent(mMuDst, mTrackType);
00113
00114
00115 if (mEventCut) {
00116 if (!(mEventCut->Pass(mHbtEvent))){
00117 delete mHbtEvent;
00118 mHbtEvent = 0;
00119 return 0;
00120 }
00121 }
00122 }
00123 else
00124 {
00125
00126 mReaderStatus = 1;
00127 }
00128
00129
00130 if (mFlowMaker && mHbtEvent ) {
00131 int harmonic = 1;
00132 mFlowMaker->FlowSelection()->SetHarmonic(harmonic);
00133 float psi = mFlowMaker->FlowEventPointer()->Psi(mFlowMaker->FlowSelection());
00134 mHbtEvent->SetReactionPlane(psi);
00135 }
00136
00137 return mHbtEvent;
00138 }
00139
00140
00141
00142 void StHbtMuDstMakerReader::Finish() {
00143 if (mFinish) {
00144 for ( int i=0; i<10; i++) {
00145 cout << "why are you calling the Finish() again ???????" << endl;
00146 cout << "are you the stupid chain destructor ???????????" << endl;
00147 }
00148 }
00149 else {
00150 mFinish = true;
00151 }
00152 return;
00153 }
00154 void StHbtMuDstMakerReader::setProbabilityPidFile(const char* file) {
00155 if (mProbabilityPidAlgorithm)
00156 mProbabilityPidAlgorithm->readParametersFromFile(file);
00157 }
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195