CMS 3D CMS Logo

FWPFTrackRPZProxyBuilder.cc
Go to the documentation of this file.
2 
3 //______________________________________________________________________________
5  unsigned int iIndex,
6  TEveElement &oItemHolder,
7  const FWViewContext *vc) {
9  TEveTrack *trk = utils->setupTrack(iData);
10  TEvePointSet *ps = utils->getCollisionMarkers(trk);
11  TEvePointSet *rzps = new TEvePointSet();
12  setupAddElement(trk, &oItemHolder);
13 
14  Float_t *trackPoints = trk->GetP();
15  unsigned int last = (trk->GetN() - 1) * 3;
16  float y = trackPoints[last + 1];
17  float z = trackPoints[last + 2];
18 
19  // Reposition any points that have been translated in RhoZ
20  for (signed int i = 0; i < ps->GetN(); ++i) {
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 //______________________________________________________________________________
50  "PF Tracks",
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
double b
Definition: hdecay.h:120
Definition: utils.py:1
double a
Definition: hdecay.h:121