11 #include "StHbtMaker/Infrastructure/StHbtKink.hh"
12 #include "StHbtMaker/Infrastructure/StHbtV0.hh"
13 #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
14 #include "StHbtMaker/Infrastructure/StHbtEvent.hh"
21 ostream& operator<<(ostream& out,
StHbtTrack& trk){
23 float ChiSqXYtemp = (fabs(trk.mChiSqXY)>FLT_MAX) ? FLT_MAX : trk.mChiSqXY;
27 << trk.mTrackId <<
" "
30 << trk.mNHitsPoss <<
" "
31 << trk.mNSigmaElectron <<
" "
32 << trk.mNSigmaPion <<
" "
33 << trk.mNSigmaKaon <<
" "
34 << trk.mNSigmaProton <<
" "
44 << trk.mHelix.curvature() <<
" "
45 << trk.mHelix.dipAngle() <<
" "
46 << trk.mHelix.
phase() <<
" "
47 << trk.mHelix.
origin().x() <<
" "
48 << trk.mHelix.
origin().y() <<
" "
49 << trk.mHelix.
origin().z() <<
" "
50 << trk.mHelix.
h() <<
" "
56 istream& operator>>(istream& in,
StHbtTrack& trk){
58 double curvature, dipAngle, phase;
59 double xorigin,yorigin,zorigin;
92 trk.mPt = ::sqrt(x*x+y*y);
100 ostream& operator<<(ostream& out,
StHbtV0& v0){
103 << v0.mDecayLengthV0 <<
" " << v0.mDecayVertexV0.x() <<
" "
104 << v0.mDecayVertexV0.y() <<
" " << v0.mDecayVertexV0.z() <<
" "
105 << v0.mDcaV0Daughters <<
" " << v0.mDcaV0ToPrimVertex <<
" "
106 << v0.mDcaPosToPrimVertex <<
" "<< v0.mDcaNegToPrimVertex <<
" "
107 << v0.mMomPos.x() <<
" " << v0.mMomPos.y() <<
" "
108 << v0.mMomPos.z() <<
" " << v0.mMomNeg.x() <<
" "
109 << v0.mMomNeg.y() <<
" " << v0.mMomNeg.z() <<
" "
110 << v0.mTrackTopologyMapPos[0] <<
" " << v0.mTrackTopologyMapPos[1] <<
" "
111 << v0.mTrackTopologyMapNeg[0] <<
" " << v0.mTrackTopologyMapNeg[1] <<
" "
112 << v0.mRapLambda <<
" " << v0.mRapK0Short <<
" "
113 << v0.mCTauLambda <<
" " << v0.mCTauK0Short <<
" "
114 << v0.mKeyNeg <<
" " << v0.mKeyPos );
118 istream& operator>>(istream& in,
StHbtV0& v0){
120 >> v0.mDecayLengthV0 >> v0.mDecayVertexV0
121 >> v0.mDcaV0Daughters >> v0.mDcaV0ToPrimVertex
122 >> v0.mDcaPosToPrimVertex >> v0.mDcaNegToPrimVertex
123 >> v0.mMomPos >> v0.mMomNeg
124 >> v0.mTrackTopologyMapPos[0] >> v0.mTrackTopologyMapPos[1]
125 >> v0.mTrackTopologyMapNeg[0] >> v0.mTrackTopologyMapNeg[1]
126 >> v0.mRapLambda >> v0.mRapK0Short
127 >> v0.mCTauLambda >> v0.mCTauK0Short
128 >> v0.mKeyNeg >> v0.mKeyPos;
134 ostream& operator<<(ostream& out,
StHbtEvent& ev){
136 << ev.mEventNumber <<
" " << ev.mRunNumber <<
" "
137 << ev.mCtbMultiplicity <<
" " << ev.mZdcAdc[0] <<
" "
138 << ev.mZdcAdc[1] <<
" " << ev.mTpcNhits <<
" "
139 << ev.mNumberOfTracks <<
" " << ev.mNumberOfGoodTracks <<
" "
140 << ev.mReactionPlane[0] <<
" " << ev.mReactionPlane[1] <<
" "
141 << ev.mPrimVertPos.x() <<
" " << ev.mPrimVertPos.y() <<
" "
142 << ev.mPrimVertPos.z() <<
" " << ev.mMagneticField << endl;
143 out << ev.mTrackCollection->size() << endl;;
145 for (StHbtTrackIterator iter=ev.mTrackCollection->begin();
146 iter != ev.mTrackCollection->end(); iter++){
151 out << ev.mV0Collection->size() << endl;;
153 for (StHbtV0Iterator iterv0=ev.mV0Collection->begin();
154 iterv0 != ev.mV0Collection->end(); iterv0++){
163 istream& operator>>(istream& in,
StHbtEvent& ev){
166 in >> ev.mEventNumber;
168 cout <<
"Hit end of file " << endl;
172 >> ev.mCtbMultiplicity
173 >> ev.mZdcAdc[0] >> ev.mZdcAdc[1]
174 >> ev.mTpcNhits >> ev.mNumberOfTracks
175 >> ev.mNumberOfGoodTracks >> ev.mReactionPlane[0]
176 >> ev.mReactionPlane[1] >> x
178 >> ev.mMagneticField;
179 ev.mPrimVertPos.setX(x);
180 ev.mPrimVertPos.setY(y);
181 ev.mPrimVertPos.setZ(z);
185 long NtracksInCollection;
186 in >> NtracksInCollection;
188 cout <<
"StHbtEvent input operator finds stream in bad state ! " << endl;
197 StHbtTrackIterator iter;
198 for (iter=ev.mTrackCollection->begin();iter!=ev.mTrackCollection->end();iter++){
202 ev.mTrackCollection->clear();
204 for (
int itrk=0; itrk<NtracksInCollection; itrk++){
206 if ( !(in >> (*trk))){
207 cout <<
"StHbtEvent input operator finds stream in bad state during track read ! ";
208 cout << itrk <<
" of " << NtracksInCollection <<
" intended" << endl;
211 ev.mTrackCollection->push_back(trk);
216 long NV0sInCollection;
217 in >> NV0sInCollection;
219 cout <<
"StHbtEvent input operator finds stream in bad state ! " << endl;
225 StHbtV0Iterator iterv0;
226 for (iterv0=ev.mV0Collection->begin();iterv0!=ev.mV0Collection->end();iterv0++){
230 ev.mV0Collection->clear();
232 for (
int iv0=0; iv0<NV0sInCollection; iv0++){
234 if ( !(in >> (*v0))){
235 cout <<
"StHbtEvent input operator finds stream in bad state during v0 read ! ";
236 cout << iv0 <<
" of " << NV0sInCollection <<
" intended" << endl;
239 ev.mV0Collection->push_back(v0);
247 ostream& operator<<(ostream& out,
StHbtKink& knk){
250 << knk.mDcaParentDaughter <<
" "
251 << knk.mDcaDaughterPrimaryVertex <<
" "
252 << knk.mDcaParentPrimaryVertex <<
" "
253 << knk.mHitDistanceParentDaughter <<
" "
254 << knk.mHitDistanceParentVertex <<
" "
255 << knk.mDeltaEnergy[0] <<
" "
256 << knk.mDeltaEnergy[1] <<
" "
257 << knk.mDeltaEnergy[2] <<
" "
258 << knk.mDecayAngle <<
" "
259 << knk.mDecayAngleCM <<
" "
260 << knk.mDaughter <<
" "
261 << knk.mParent <<
" "
262 << knk.mPosition.x() <<
" "
263 << knk.mPosition.y() <<
" "
267 istream& operator>>(istream& in,
StHbtKink& knk){
270 >> knk.mDcaParentDaughter
271 >> knk.mDcaDaughterPrimaryVertex
272 >> knk.mDcaParentPrimaryVertex
273 >> knk.mHitDistanceParentDaughter
274 >> knk.mHitDistanceParentVertex
275 >> knk.mDeltaEnergy[0]
276 >> knk.mDeltaEnergy[1]
277 >> knk.mDeltaEnergy[2]
285 knk.mPosition.setX(x);
286 knk.mPosition.setY(y);
287 knk.mPosition.setZ(z);
void setParameters(double c, double dip, double phase, const StThreeVector< double > &o, int h)
starting point
int h() const
y-center of circle in xy-plane
const StThreeVector< double > & origin() const
-sign(q*B);
double phase() const
1/R in xy-plane