00001
00002
00003 #include "StjMCKinMuDst.h"
00004
00005 #include <StMuDSTMaker/COMMON/StMuDstMaker.h>
00006 #include <StMuDSTMaker/COMMON/StMuDst.h>
00007 #include <StMuDSTMaker/COMMON/StMuEvent.h>
00008
00009 #include "tables/St_g2t_event_Table.h"
00010 #include "tables/St_particle_Table.h"
00011 #include "tables/St_g2t_pythia_Table.h"
00012
00013 #include <iostream>
00014
00015 ClassImp(StjMCKinMuDst)
00016
00017 using namespace std;
00018
00019 void StjMCKinMuDst::readIfNewEvent() const
00020 {
00021 if(isNewEvent()) readNewEvent();
00022 }
00023
00024 bool StjMCKinMuDst::isNewEvent() const
00025 {
00026 if(_runNumber != _uDstMaker->muDst()->event()->runId()) return true;
00027 if(_eventId != _uDstMaker->muDst()->event()->eventId()) return true;
00028 return false;
00029 }
00030
00031 void StjMCKinMuDst::readNewEvent() const
00032 {
00033 _runNumber = _uDstMaker->muDst()->event()->runId();
00034 _eventId = _uDstMaker->muDst()->event()->eventId();
00035
00036 _vertexZ = _uDstMaker->muDst()->event()->primaryVertexPosition().z();
00037
00038 TDataSet *Event = _uDstMaker->GetDataSet("geant");
00039 TDataSetIter geantDstI(Event);
00040 St_g2t_pythia *Pg2t_pythia = (St_g2t_pythia *)geantDstI("g2t_pythia");
00041 g2t_pythia_st *g2t_pythia1 = Pg2t_pythia->GetTable();
00042 _s = g2t_pythia1->mand_s;
00043 _t = g2t_pythia1->mand_t;
00044 _u = g2t_pythia1->mand_u;
00045 _pt = g2t_pythia1->hard_p;
00046 _costh = g2t_pythia1->cos_th;
00047 _x1 = g2t_pythia1->bjor_1;
00048 _x2 = g2t_pythia1->bjor_2;
00049
00050 St_g2t_event *Pg2t_event = (St_g2t_event *)geantDstI("g2t_event");
00051 g2t_event_st *g2t_event1 = Pg2t_event->GetTable();
00052 _pid = g2t_event1->subprocess_id;
00053 }
00054
00055 int StjMCKinMuDst::runNumber()
00056 {
00057 readIfNewEvent();
00058 return _runNumber;
00059 }
00060
00061 int StjMCKinMuDst::eventId()
00062 {
00063 readIfNewEvent();
00064 return _eventId;
00065 }
00066
00067 double StjMCKinMuDst::vertexZ()
00068 {
00069 readIfNewEvent();
00070 return _vertexZ;
00071 }
00072
00073 double StjMCKinMuDst::s()
00074 {
00075 readIfNewEvent();
00076 return _s;
00077 }
00078
00079 double StjMCKinMuDst::t()
00080 {
00081 readIfNewEvent();
00082 return _t;
00083 }
00084
00085 double StjMCKinMuDst::u()
00086 {
00087 readIfNewEvent();
00088 return _u;
00089 }
00090
00091 double StjMCKinMuDst::pt()
00092 {
00093 readIfNewEvent();
00094 return _pt;
00095 }
00096
00097 double StjMCKinMuDst::costh()
00098 {
00099 readIfNewEvent();
00100 return _costh;
00101 }
00102
00103 double StjMCKinMuDst::x1()
00104 {
00105 readIfNewEvent();
00106 return _x1;
00107 }
00108
00109 double StjMCKinMuDst::x2()
00110 {
00111 readIfNewEvent();
00112 return _x2;
00113 }
00114
00115 int StjMCKinMuDst::pid()
00116 {
00117 readIfNewEvent();
00118 return _pid;
00119 }
00120
00121