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 );
FWPFTrackSingleton * m_singleton
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)
double eta() const
pseudorapidity of momentum vector
void guessField(float estimate) const
double pt() const
track transverse momentum
ESource getSource() const
TEveTrack * getTrack(const reco::Track &)
TEveVector lineCircleIntersect(const TEveVector &v1, const TEveVector &v2, float r)
TEveVector lineLineIntersect(const TEveVector &v1, const TEveVector &v2, const TEveVector &v3, const TEveVector &v4)