ATLAS Offline Software
Functions
JiveXML::TrackParticleRetrieverHelpers Namespace Reference

Functions

void getPolylineFromTrackParticle (const Rec::TrackParticle *track, DataVect &polylineX, DataVect &polylineY, DataVect &polylineZ, DataVect &numPolyline)
 Get polyline hits if available. More...
 

Function Documentation

◆ getPolylineFromTrackParticle()

void JiveXML::TrackParticleRetrieverHelpers::getPolylineFromTrackParticle ( const Rec::TrackParticle track,
DataVect polylineX,
DataVect polylineY,
DataVect polylineZ,
DataVect numPolyline 
)

Get polyline hits if available.

Modified from TrackRetriever

Definition at line 46 of file TrackParticleRetriever.cxx.

47  {
48 
49  DataVect myPositionX;
50  DataVect myPositionY;
51  DataVect myPositionZ;
52 
53  int numPoly = 0 ;
54 
55 // Migration Dec'13: Not yet done here ! Need equivalent code
56 // to access spacepoints. jpt 13Dec13
57 
58  unsigned int i = 0;
59  const std::vector<const Trk::TrackParameters*>& trackpars =track->trackParameters();
60 
61  if (!trackpars.empty() && trackpars.size() == 3 ) { //polylines with less than 3 entries not useful
62 
63  bool needresorting = trackpars.at(0)!=track->perigee();//Needed since TrackParticles are (at the moment)
64  //created with the first parameter put last
65  for ( i=0; i<trackpars.size(); i++){
66  const Amg::Vector3D& pos = trackpars.at(i)->position();
67  myPositionX.push_back(DataType(pos.x()/10.));
68  myPositionY.push_back(DataType(pos.y()/10.));
69  myPositionZ.push_back(DataType(pos.z()/10.));
70  //std::cout << " Polyline # " << i << " x: " << pos.x() << std::endl;
71  ++numPoly;
72  }
73  if (needresorting){ // swapping vector around. Is this too naive ?
74  polylineX.push_back( myPositionX.at( trackpars.size()-1 ) );
75  polylineY.push_back( myPositionY.at( trackpars.size()-1 ) );
76  polylineZ.push_back( myPositionZ.at( trackpars.size()-1 ) );
77  polylineX.push_back( myPositionX.at( trackpars.size()-3 ) );
78  polylineY.push_back( myPositionY.at( trackpars.size()-3 ) );
79  polylineZ.push_back( myPositionZ.at( trackpars.size()-3 ) );
80  polylineX.push_back( myPositionX.at( trackpars.size()-2 ) );
81  polylineY.push_back( myPositionY.at( trackpars.size()-2 ) );
82  polylineZ.push_back( myPositionZ.at( trackpars.size()-2 ) );
83  }
84  }
85 
86  // std::cout << " numPolyline" << numPoly << std::endl;
87 
88  //Store counter as well
89  numPolyline.push_back(DataType(numPoly));
90  }
JiveXML::DataVect
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition: DataType.h:58
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
lumiFormat.i
int i
Definition: lumiFormat.py:85
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
xAOD::track
@ track
Definition: TrackingPrimitives.h:512