test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWPFTrackRPZProxyBuilder.cc
Go to the documentation of this file.
2 
3 //______________________________________________________________________________
4 void
5 FWPFTrackRPZProxyBuilder::build( const reco::Track &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *vc )
6 {
7  FWPFTrackUtils *utils = new FWPFTrackUtils();
8  TEveTrack *trk = utils->setupTrack( iData );
9  TEvePointSet *ps = utils->getCollisionMarkers( trk );
10  TEvePointSet *rzps = new TEvePointSet();
11  setupAddElement( trk, &oItemHolder );
12 
13  Float_t *trackPoints = trk->GetP();
14  unsigned int last = ( trk->GetN() - 1 ) * 3;
15  float y = trackPoints[last+1];
16  float z = trackPoints[last+2];
17 
18  // Reposition any points that have been translated in RhoZ
19  for( signed int i = 0; i < ps->GetN(); ++i )
20  {
21  // WORKS BUT DOESN'T HANDLE ALL SCENARIOS.....
22  Float_t a,b,c;
23  ps->GetPoint( i, a, b, c );
24 
25  if( y < 0 && b > 0 )
26  b *= -1;
27  else if( y > 0 && b < 0 )
28  b *= -1;
29 
30  if( z < 0 && c > 0 )
31  c *= -1;
32  else if( z > 0 && c < 0 )
33  c *= -1;
34 
35  rzps->SetNextPoint( a, b, c );
36  }
37 
38  if( rzps->GetN() != 0 )
39  setupAddElement( rzps, &oItemHolder );
40  else
41  delete rzps;
42 
43  delete ps;
44  delete utils;
45 }
46 
47 //______________________________________________________________________________
int i
Definition: DBlmapReader.cc:9
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
TEvePointSet * getCollisionMarkers(const TEveTrack *)
TEveTrack * setupTrack(const reco::Track &)
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121