31 m_trackPropagator->SetProjTrackBreaking( TEveTrackPropagator::kPTB_UseLastPointPos );
63 t.fP = TEveVector( iData.
px(), iData.
py(), iData.
pz() );
66 TEveTrack *trk =
new TEveTrack( &t, propagator );
76 using namespace FWPFGeom;
79 int wraps[3] = { -1, -1, -1 };
82 std::vector<TEveVector> trackPoints( trk->GetN() - 1 );
83 const Float_t *points = trk->GetP();
84 TEveStraightLineSet *legoTrack =
new TEveStraightLineSet();
88 if( fabs( iData.
eta() ) < 2.0 && iData.
pt() > 0.5 && iData.
pt() < 30 )
96 for( Int_t
i = 1;
i < trk->GetN(); ++
i )
99 TEveVector
temp = TEveVector( points[j], points[j+1], points[j+2] );
100 TEveVector vec = TEveVector( temp.Eta(), temp.Phi(), 0.001 );
102 trackPoints[
i-1] = vec;
106 for( Int_t
i = 1;
i < trk->GetN(); ++
i )
109 TEveVector v1 = TEveVector( points[j], points[j+1], points[j+2] );
115 TEveVector v2 = TEveVector( points[j-3], points[j-2], points[j-1] );
119 zPoint = TEveVector( xyPoint.fX, xyPoint.fY, v1.fZ - 50.f );
121 zPoint = TEveVector( xyPoint.fX, xyPoint.fY, v1.fZ + 50.f );
124 legoTrack->AddMarker( vec.Eta(), vec.Phi(), 0.001, 0 );
129 else if( fabs( v1.fZ ) >=
caloZ1() )
132 TEveVector vec, v2 = TEveVector( points[j-3], points[j-2], points[j-1] );
140 p1 = TEveVector( v2.fX + 50, y, z );
141 p2 = TEveVector( v2.fX - 50, y, z );
144 legoTrack->AddMarker( vec.Eta(), vec.Phi(), 0.001, 0 );
151 TEveVector v2 = TEveVector( points[j-3], points[j-2], points[j-1] );
155 zPoint = TEveVector( xyPoint.fX, xyPoint.fY, v1.fZ - 50.f );
157 zPoint = TEveVector( xyPoint.fX, xyPoint.fY, v1.fZ + 50.f );
160 legoTrack->AddMarker( vec.Eta(), vec.Phi(), 0.001, 1 );
169 int i = ( trk->GetN() - 1 ) * 3;
170 int j = trk->GetN() - 2;
171 TEveVector vec = TEveVector( points[i], points[i+1], points[i+2] );
175 legoTrack->AddMarker( vec.Eta(), vec.Phi(), 0.001, 2 );
178 else if( fabs( vec.fZ ) >=
caloZ2() )
180 legoTrack->AddMarker( vec.Eta(), vec.Phi(), 0.001, 2 );
186 for(
int i = 0; i < static_cast<int>( trackPoints.size() - 1 ); ++
i )
188 if( ( trackPoints[
i+1].fY - trackPoints[
i].fY ) > 1 )
193 TEveChunkManager::iterator mi( legoTrack->GetMarkerPlex() );
195 TEveStraightLineSet::Marker_t &
m = * ( TEveStraightLineSet::Marker_t* ) mi();
196 m.fV[0] = trackPoints[
i+1].fX; m.fV[1] = trackPoints[
i+1].fY; m.fV[2] = 0.001;
198 else if(
i == wraps[1] )
200 TEveChunkManager::iterator mi( legoTrack->GetMarkerPlex() );
201 mi.next(); mi.next();
202 TEveStraightLineSet::Marker_t &
m = * ( TEveStraightLineSet::Marker_t* ) mi();
203 m.fV[0] = trackPoints[
i+1].fX; m.fV[1] = trackPoints[
i+1].fY; m.fV[2] = 0.001;
207 if( ( trackPoints[
i].fY - trackPoints[
i+1].fY ) > 1 )
212 TEveChunkManager::iterator mi( legoTrack->GetMarkerPlex() );
214 TEveStraightLineSet::Marker_t &
m = * ( TEveStraightLineSet::Marker_t* ) mi();
215 m.fV[0] = trackPoints[
i+1].fX; m.fV[1] = trackPoints[
i+1].fY; m.fV[2] = 0.001;
217 else if(
i == wraps[1] )
219 TEveChunkManager::iterator mi( legoTrack->GetMarkerPlex() );
220 mi.next(); mi.next();
221 TEveStraightLineSet::Marker_t &
m = * ( TEveStraightLineSet::Marker_t* ) mi();
222 m.fV[0] = trackPoints[
i+1].fX; m.fV[1] = trackPoints[
i+1].fY; m.fV[2] = 0.001;
227 int end =
static_cast<int>( trackPoints.size() - 1 );
228 if( wraps[2] ==
end )
230 TEveChunkManager::iterator mi( legoTrack->GetMarkerPlex() );
231 mi.next(); mi.next(); mi.next();
232 TEveStraightLineSet::Marker_t &
m = * ( TEveStraightLineSet::Marker_t* ) mi();
233 m.fV[0] = trackPoints[
end].fX; m.fV[1] = trackPoints[
end].fY; m.fV[2] = 0.001;
237 for(
unsigned int i = 0;
i < trackPoints.size() - 1; ++
i )
238 legoTrack->AddLine( trackPoints[
i], trackPoints[i+1] );
240 legoTrack->SetDepthTest(
false );
241 legoTrack->SetMarkerStyle( 4 );
242 legoTrack->SetMarkerSize( 1 );
243 legoTrack->SetRnrMarkers(
true );
256 if( fabs( iData.
eta() ) < 2.0 && iData.
pt() > 0.5 && iData.
pt() < 30 )
273 using namespace FWPFGeom;
276 const Float_t *points = trk->GetP();
277 TEvePointSet *ps =
new TEvePointSet();
279 for( Int_t
i = 1;
i < trk->GetN(); ++
i )
282 TEveVector v1 = TEveVector( points[j], points[j+1], points[j+2] );
288 TEveVector v2 = TEveVector( points[j-3], points[j-2], points[j-1] );
292 zPoint = TEveVector( xyPoint.fX, xyPoint.fY, v1.fZ - 50.f );
294 zPoint = TEveVector( xyPoint.fX, xyPoint.fY, v1.fZ + 50.f );
297 ps->SetNextPoint( vec.fX, vec.fY, vec.fZ );
301 else if( fabs( v1.fZ ) >=
caloZ1() )
304 TEveVector vec, v2 = TEveVector( points[j-3], points[j-2], points[j-1] );
312 p1 = TEveVector( v2.fX + 50, y, z );
313 p2 = TEveVector( v2.fX - 50, y, z );
316 ps->SetNextPoint( vec.fX, vec.fY, vec.fZ );
322 TEveVector v2 = TEveVector( points[j-3], points[j-2], points[j-1] );
326 zPoint = TEveVector( xyPoint.fX, xyPoint.fY, v1.fZ - 50.f );
328 zPoint = TEveVector( xyPoint.fX, xyPoint.fY, v1.fZ + 50.f );
331 ps->SetNextPoint( vec.fX, vec.fY, vec.fZ );
337 int i = ( trk->GetN() - 1 ) * 3;
338 TEveVector vec = TEveVector( points[
i], points[i+1], points[i+2] );
341 ps->SetNextPoint( vec.fX, vec.fY, vec.fZ );
342 else if( fabs( vec.fZ ) >=
caloZ2() )
343 ps->SetNextPoint( vec.fX, vec.fY, vec.fZ );
const TrackExtraRef & extra() const
reference to "extra" object
TEvePointSet * getCollisionMarkers(const TEveTrack *)
TEveTrack * setupTrack(const reco::Track &)
FWPFTrackSingleton * m_singleton
double px() const
x coordinate of momentum vector
float linearInterpolation(const TEveVector &p1, const TEveVector &p2, float r)
double estimate_field(const reco::Track &track, bool highQuality=false)
bool checkIntersect(const TEveVector &vec, float r)
TEveTrackPropagator * m_trackerTrackPropagator
const Point & vertex() const
reference point on the track. This method is DEPRECATED, please use referencePoint() instead ...
double eta() const
pseudorapidity of momentum vector
void guessField(float estimate) const
double pt() const
track transverse momentum
static FWPFTrackSingleton * pInstance
ESource getSource() const
TEveTrackPropagator * getTrackPropagator()
TEveStraightLineSet * setupLegoTrack(const reco::Track &)
double pz() const
z coordinate of momentum vector
static FWPFTrackSingleton * Instance()
TEveTrack * getTrack(const reco::Track &)
TEveVector lineCircleIntersect(const TEveVector &v1, const TEveVector &v2, float r)
TEveTrackPropagator * m_trackPropagator
int charge() const
track electric charge
TEveVector lineLineIntersect(const TEveVector &v1, const TEveVector &v2, const TEveVector &v3, const TEveVector &v4)
TEveTrackPropagator * getTrackerTrackPropagator()
double py() const
y coordinate of momentum vector