1 #include "StHbtMaker/Infrastructure/StHbtEvent.hh"
2 #include "StHbtMaker/Infrastructure/StHbtTTreeEvent.h"
3 #include "StHbtMaker/Infrastructure/StHbtTTreeTrack.h"
4 #include "StHbtMaker/Infrastructure/StHbtTTreeV0.h"
5 #include "StHbtMaker/Infrastructure/StHbtTTreeXi.h"
6 #include "StHbtMaker/Infrastructure/StHbtTTreeKink.h"
7 #include "StHbtMaker/Base/StHbtEventCut.h"
8 #include "StHbtMaker/Base/StHbtTrackCut.h"
9 #include "StHbtMaker/Base/StHbtV0Cut.h"
10 #include "StHbtMaker/Base/StHbtXiCut.h"
11 #include "StHbtMaker/Base/StHbtKinkCut.h"
13 #include "StHbtMaker/Infrastructure/StHbtTrackCollection.hh"
14 #include "StHbtMaker/Infrastructure/StHbtV0Collection.hh"
15 #include "StHbtMaker/Infrastructure/StHbtXiCollection.hh"
16 #include "StHbtMaker/Infrastructure/StHbtKinkCollection.hh"
18 #include "StExceptions.hh"
19 #include "StarClassLibrary/SystemOfUnits.h"
33 if (mDebug) cout <<
"StHbtTTreeEvent::StHbtTTreeEvent()" << endl;
39 StHbtTTreeEvent::~StHbtTTreeEvent(){
40 if (mDebug) cout <<
"StHbtTTreeEvent::~StHbtTTreeEvent()" << endl;
53 void StHbtTTreeEvent::initClonesArrays(){
54 if (mDebug) cout <<
"StHbtTTreeEvent::initClonesArrays()" << endl;
57 if (mDebug) cout <<
"StHbtTTreeEvent::initClonesArrays() create fgTracks" << endl;
58 fgTracks =
new TClonesArray(
"StHbtTTreeTrack", 4000);
64 if (mDebug) cout <<
"StHbtTTreeEvent::initClonesArrays() create fgV0s" << endl;
65 fgV0s =
new TClonesArray(
"StHbtTTreeV0", 4000);
71 if (mDebug) cout <<
"StHbtTTreeEvent::initClonesArrays() create fgXis" << endl;
72 fgXis =
new TClonesArray(
"StHbtTTreeXi", 4000);
78 if (mDebug) cout <<
"StHbtTTreeEvent::initClonesArrays() create fgKinks" << endl;
79 fgKinks =
new TClonesArray(
"StHbtTTreeKink", 4000);
84 if (mDebug) cout <<
"StHbtTTreeEvent::initClonesArrays() leaving" << endl;
99 if (mDebug) cout <<
"StHbtTTreeEvent::StHbtTTreeEvent(...) - now fill " <<
event->TrackCollection()->size() <<
" tracks" << endl;
100 for (StHbtTrackIterator iter=event->TrackCollection()->begin(); iter !=
event->TrackCollection()->end(); iter++){
101 if (!trackCut || trackCut->Pass(*iter)) addTrack(event,*iter);
104 if (mDebug) cout <<
"StHbtTTreeEvent::StHbtTTreeEvent(...) - now fill " <<
event->V0Collection()->size() <<
" v0s" << endl;
105 for (StHbtV0Iterator iter=event->V0Collection()->begin(); iter !=
event->V0Collection()->end(); iter++){
106 if (!v0Cut || v0Cut->Pass(*iter)) addV0(event,*iter);
109 if (mDebug) cout <<
"StHbtTTreeEvent::StHbtTTreeEvent(...) - now fill " <<
event->XiCollection()->size() <<
" xis" << endl;
110 for (StHbtXiIterator iter=event->XiCollection()->begin(); iter !=
event->XiCollection()->end(); iter++){
111 if (!xiCut || xiCut->Pass(*iter)) addXi(event,*iter);
114 if (mDebug) cout <<
"StHbtTTreeEvent::StHbtTTreeEvent(...) - now fill " <<
event->KinkCollection()->size() <<
" kinks" << endl;
115 for (StHbtKinkIterator iter=event->KinkCollection()->begin(); iter !=
event->KinkCollection()->end(); iter++){
116 if (!kinkCut || kinkCut->Pass(*iter)) addKink(event,*iter);
125 fillEventInfo(event);
131 if (mDebug) cout <<
"StHbtTTreeEvent::StHbtTTreeEvent(...) - now fill " <<
event->TrackCollection()->size() <<
" tracks" << endl;
132 for (StHbtTrackIterator iter=event->TrackCollection()->begin(); iter !=
event->TrackCollection()->end(); iter++){
133 if (!trackCut || trackCut->Pass(*iter)) addTrack(event,*iter);
136 if (mDebug) cout <<
"StHbtTTreeEvent::StHbtTTreeEvent(...) - now fill " <<
event->V0Collection()->size() <<
" v0s" << endl;
137 for (StHbtV0Iterator iter=event->V0Collection()->begin(); iter !=
event->V0Collection()->end(); iter++){
138 if (!v0Cut || v0Cut->Pass(*iter)) addV0(event,*iter);
141 if (mDebug) cout <<
"StHbtTTreeEvent::StHbtTTreeEvent(...) - now fill " <<
event->XiCollection()->size() <<
" xis" << endl;
142 for (StHbtXiIterator iter=event->XiCollection()->begin(); iter !=
event->XiCollection()->end(); iter++){
143 if (!xiCut || xiCut->Pass(*iter)) addXi(event,*iter);
146 if (mDebug) cout <<
"StHbtTTreeEvent::StHbtTTreeEvent(...) - now fill " <<
event->KinkCollection()->size() <<
" kinks" << endl;
147 for (StHbtKinkIterator iter=event->KinkCollection()->begin(); iter !=
event->KinkCollection()->end(); iter++){
148 if (!kinkCut || kinkCut->Pass(*iter)) addKink(event,*iter);
154 void StHbtTTreeEvent::fillEventInfo(
const StHbtEvent* event){
155 if (mDebug) cout <<
"StHbtTTreeEvent::fillEventInfo(StEvent* event)" << endl;
158 mEventNumber =
event->mEventNumber;
159 mRunNumber =
event->mRunNumber;
160 mTpcNhits =
event->mTpcNhits;
161 mNumberOfTracks =
event->mNumberOfTracks;
162 mNumberOfGoodTracks=
event->mNumberOfGoodTracks;
163 mUncorrectedNumberOfPositivePrimaries =
event->mUncorrectedNumberOfPositivePrimaries;
164 mUncorrectedNumberOfNegativePrimaries =
event->mUncorrectedNumberOfNegativePrimaries;
165 mReactionPlane[0] =
event->mReactionPlane[0];
166 mReactionPlane[1] =
event->mReactionPlane[1];
167 mReactionPlanePtWgt[0] =
event->mReactionPlanePtWgt[0];
168 mReactionPlanePtWgt[1] =
event->mReactionPlanePtWgt[1];
169 mVertexX =
event->mPrimVertPos.x();
170 mVertexY =
event->mPrimVertPos.y();
171 mVertexZ =
event->mPrimVertPos.z();
172 mCtbMultiplicity =
event->mCtbMultiplicity;
173 mZdcAdc[0] =
event->mZdcAdc[0];
174 mZdcAdc[1] =
event->mZdcAdc[1];
175 mMagneticField =
event->mMagneticField;
176 mTriggerWord =
event->mTriggerWord;
177 mTriggerActionWord =
event->mTriggerActionWord;
179 mL3TriggerAlgorithm =
event->mL3TriggerAlgorithm[0];
181 if (mDebug) cout <<
"StHbtTTreeEvent::fillEventInfo(StEvent* event) - leaving" << endl;
186 void StHbtTTreeEvent::clear(){
187 if (mDebug) cout <<
"StHbtTTreeEvent::clear(...)" << endl;
207 if (mDebug>1) cout <<
"StHbtTTreeEvent::addTrack(...) " << endl;
208 TClonesArray &tracks = *fTracks;
213 if (mDebug>1) e.print();
220 if (mDebug>1) cout <<
"StHbtTTreeEvent::addV0(...) " << endl;
221 TClonesArray &v0s = *fV0s;
233 if (mDebug>1) cout <<
"StHbtTTreeEvent::addXi(...) " << endl;
234 TClonesArray &xis = *fXis;
246 TClonesArray &kinks = *fKinks;
256 void StHbtTTreeEvent::SetMagneticField(
double m) {mMagneticField=m;}