StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEmcTTMatch.cxx
1 // $Id: EEmcTTMatch.cxx,v 1.7 2004/05/14 01:47:22 zolnie Exp $
30 #include <iostream>
31 #include <ostream>
32 
33 #include "TList.h"
34 
35 #include "StMuDSTMaker/COMMON/StMuEvent.h"
36 #include "StMuDSTMaker/COMMON/StMuTrack.h"
37 
38 #include "EEmcTower.h"
39 #include "EEmcTTMatch.h"
40 
41 #if !defined(ST_NO_NAMESPACES)
42 using std::ostream;
43 #endif
44 
45 
46 ClassImp(EEmcTTMatch);
47 
48 //_____________________________________________________________________________
51 {
52  mTower = NULL;
53  mTracks = new TList();
54 }
55 
56 //_____________________________________________________________________________
59 {
60  if(mTracks) {
61  mTracks->Clear();
62  delete mTracks;
63  }
64 }
65 
66 //_____________________________________________________________________________
68 void
69 EEmcTTMatch::Clear(Option_t *opt)
70 {
71  mTower = NULL;
72  mTracks->Clear();
73 }
74 
75 //_____________________________________________________________________________
77 void
79 {
80  mTower = t;
81 }
82 
83 //_____________________________________________________________________________
85 void
87 {
88  mTracks->Add(t);
89 }
90 
91 
92 //_____________________________________________________________________________
94 Int_t
96 {
97  return mTracks->GetSize();
98 }
99 
100 
101 //_____________________________________________________________________________
103 Bool_t
104 EEmcTTMatch::ExtrapolateToZ(const StMuTrack *track, const double z, TVector3 &r)
105 {
106  const double kMinDipAngle = 1.0e-13;
107 
108  StPhysicalHelixD helix = track->helix();
109  double dipAng = helix.dipAngle();
110  double z0 = helix.origin().z();
111  if(dipAng<kMinDipAngle) return kFALSE;
112  double s = ( z - z0 ) / sin(dipAng) ;
113  StThreeVectorD hit = helix.at(s);
114  r.SetXYZ(hit.x(),hit.y(),hit.z());
115  return kTRUE;
116 }
117 
118 
119 //_____________________________________________________________________________
121 ostream&
122 EEmcTTMatch::Out(ostream &out ) const
123 {
124  out << *mTower ;
125  StMuTrack *track;
126  TIter nextTrack(mTracks);
127  while((track=(StMuTrack *)nextTrack())) out << *track;
128  return out;
129 }
130 
131 
132 
133 
134 // ===========================================================================================
135 ostream& operator<<(ostream &out, const StMuTrack &t ) {
136  out << "<StMuTrack";
137  out << " ORIGIN=\"" << t.helix().origin() << "\"";
138  out << " MOMENTUM=\"" << t.momentum() << "\"";
139  out << "/>\n";
140  return out;
141 }
142 // ===========================================================================================
143 ostream& operator<<(ostream &out, const EEmcTTMatch &m ) {
144  return m.Out(out);
145 }
EEmcTTMatch()
the constructor
Definition: EEmcTTMatch.cxx:50
~EEmcTTMatch()
the destructor
Definition: EEmcTTMatch.cxx:58
void Clear(Option_t *opt)
clears list of matches
Definition: EEmcTTMatch.cxx:69
StPhysicalHelixD helix() const
Returns inner helix (first measured point)
Definition: StMuTrack.cxx:407
Int_t Matches()
returns number of matched tracks
Definition: EEmcTTMatch.cxx:95
const StThreeVector< double > & origin() const
-sign(q*B);
Definition: StHelix.hh:224
const StThreeVectorF & momentum() const
Returns 3-momentum at dca to primary vertex.
Definition: StMuTrack.h:260
void Add(EEmcTower *t)
adds tower data
Definition: EEmcTTMatch.cxx:78
EEmcTTMatch class contains results of TPC track to EEMC tower matching.
Definition: EEmcTTMatch.h:22
ostream & Out(ostream &out) const
EEmcTower holds information about an EEMC tower &#39;hit&#39;.
Definition: EEmcTower.h:17
static Bool_t ExtrapolateToZ(const StMuTrack *track, const double z, TVector3 &r)
given track and position z return TVector3 with a