ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
displayBarrelXY Class Reference

#include <display_track.h>

Inheritance diagram for displayBarrelXY:
Collaboration diagram for displayBarrelXY:

Public Member Functions

 displayBarrelXY ()
 
virtual void displayTrackState (GlobalPosition &trkPosition, GlobalDirection &trkDirection)
 create the graphic objects for a single track state More...
 
virtual void displayTRT_MeasurementOnTrack (GlobalPosition &strawPosition, double driftRadius, GlobalDirection &trkDirection, bool isOutlier, double=0.)
 create the graphic objects for a single TRT measurement on track More...
 
virtual void displayTRT_Measurement (GlobalPosition &strawPosition, double driftRadius, bool onTrack, bool outlierOnTrack, double=0.)
 create the graphic objects for a single TRT measurement More...
 
virtual void displayTRT_Tubes ()
 
virtual void displaySiliconMeasurement (GlobalPosition &measurementPosition, bool onTrack)
 create the graphic objects for a single Silicon measurement More...
 
virtual void displayCompetingTRT_ROT (std::vector< GlobalPosition > &strawPositions, std::vector< double > driftRadii, std::vector< double > assgnProbs, GlobalDirection &trkDirection)
 create the graphic objects for a single CompetingTRT_DriftCirclesOnTrack More...
 
virtual void clear ()
 clear all graphics vectors More...
 
virtual void clearTrackGraphics ()
 
virtual void clearRIOGraphics ()
 
virtual void clearGeometryGraphics ()
 
virtual void clearCompetingROTsGraphics ()
 
virtual std::vector< TObject * > * getTrackGraphics ()
 
virtual std::vector< TObject * > * getRIOGraphics ()
 
virtual std::vector< TObject * > * getGeometryGraphics ()
 
virtual std::vector< TObject * > * getCompetingROTsGraphics ()
 

Protected Attributes

std::vector< TObject * > * m_trackGraphics
 
std::vector< TObject * > * m_rioGraphics
 
std::vector< TObject * > * m_geometryGraphics
 
std::vector< TObject * > * m_competingRotGraphics
 
ShapeCreator m_shapeCreator
 

Detailed Description

Definition at line 84 of file display_track.h.

Constructor & Destructor Documentation

◆ displayBarrelXY()

displayBarrelXY::displayBarrelXY ( )

Definition at line 92 of file display_track.cxx.

92  :
93 displayTracks() {
94 
95  //ShapeCreator::setProjection(0);
97 
98 };

Member Function Documentation

◆ clear()

void displayTracks::clear ( )
virtualinherited

clear all graphics vectors

Definition at line 84 of file display_track.cxx.

◆ clearCompetingROTsGraphics()

void displayTracks::clearCompetingROTsGraphics ( )
virtualinherited

Definition at line 77 of file display_track.cxx.

77  {
78  while(m_competingRotGraphics->size()!=0) {
79  delete m_competingRotGraphics->back();
80  m_competingRotGraphics->pop_back();
81  }
82 }

◆ clearGeometryGraphics()

void displayTracks::clearGeometryGraphics ( )
virtualinherited

Definition at line 71 of file display_track.cxx.

71  {
72  while(m_geometryGraphics->size()!=0) {
73  delete m_geometryGraphics->back();
74  m_geometryGraphics->pop_back();
75  }
76 }

◆ clearRIOGraphics()

void displayTracks::clearRIOGraphics ( )
virtualinherited

Definition at line 64 of file display_track.cxx.

64  {
65  while(m_rioGraphics->size()!=0) {
66  delete m_rioGraphics->back();
67  m_rioGraphics->pop_back();
68  }
69 }

◆ clearTrackGraphics()

void displayTracks::clearTrackGraphics ( )
virtualinherited

Definition at line 58 of file display_track.cxx.

58  {
59  while(m_trackGraphics->size()!=0) {
60  delete m_trackGraphics->back();
61  m_trackGraphics->pop_back();
62  }
63 }

◆ displayCompetingTRT_ROT()

void displayBarrelXY::displayCompetingTRT_ROT ( std::vector< GlobalPosition > &  strawPositions,
std::vector< double >  driftRadii,
std::vector< double >  assgnProbs,
GlobalDirection trkDirection 
)
virtual

create the graphic objects for a single CompetingTRT_DriftCirclesOnTrack

Implements displayTracks.

Definition at line 250 of file display_track.cxx.

250  {
251 
252  GlobalDirection dir_o(trkDirection.y(), -trkDirection.x(), 0.);
253  dir_o *= (trkDirection.z()<0 ? -1 : 1);
254  char assgnProbText[50];
255 
256  // write the value of the assignment prob near the measurement
257  sprintf(assgnProbText,"%e", assgnProbs[0]);
258  TText* text = m_shapeCreator.createText(strawPositions[0]+(driftRadii[0]*2.)*dir_o.Unit(), assgnProbText);
259  //TText* text = m_shapeCreator.createText(strawPositions[0], assgnProbText);
260  // align left if direction points left and align right if direction points right
261  text->SetTextAlign((dir_o.x()*driftRadii[0])>0 ? 12 : 32);
262  TObject* textObj = text;
263  m_competingRotGraphics->push_back(textObj);
264 
265  // loop over remaining competing measurements
266  for (unsigned int i = 1; i < strawPositions.size(); i++) {
267  // draw drift circle
268  //TArc* hit = m_shapeCreator.createArc( strawPosition, driftRadius );
269  //hit->SetLineColor( color );
270  //TObject* hitObj = hit;
271  //m_competingRotGraphics->push_back(hitObj);
272 
273  // write the value of the assignment prob near the measurement
274  sprintf(assgnProbText,"%e", assgnProbs[i]);
275  TText* text = m_shapeCreator.createText(strawPositions[i]+(driftRadii[i]*2.)*dir_o.Unit(), assgnProbText);
276  //TText* text = m_shapeCreator.createText(strawPositions[i], assgnProbText);
277  // align left if direction points left and align right if direction points right
278  text->SetTextAlign((dir_o.x()*driftRadii[i])>0 ? 12 : 32);
279  TObject* textObj = text;
280  m_competingRotGraphics->push_back(textObj);
281 
282  if (strawPositions[i] != strawPositions[i-1]) {
283  // we have another straw: draw line between straws
284  TLine* connection = m_shapeCreator.createLine(strawPositions[i-1], strawPositions[i-1]);
285  connection->SetLineColor(16); // gray
286  TObject* connectionObj = connection;
287  m_competingRotGraphics->push_back(connectionObj);
288  }
289  }
290 }

◆ displaySiliconMeasurement()

void displayBarrelXY::displaySiliconMeasurement ( GlobalPosition measurementPosition,
bool  onTrack 
)
virtual

create the graphic objects for a single Silicon measurement

Implements displayTracks.

Definition at line 225 of file display_track.cxx.

225  {
226  // marker radius
227  double hit_r = 0.15;
228  std::vector<TObject*>* geometry=0;
229 
230  int color = 6;
231  if (onTrack) {
232  color = 4;
234  } else {
235  color = 6;
237  }
238 
239  // draw measurement position
240  TArc* hit = m_shapeCreator.createArc( measurementPosition, hit_r );
241  hit->SetLineColor( color );
242  hit->SetFillColor( color );
243  //m_display->addArc( hit );
244  //m_arcs.push_back(hit);
245  TObject* hitObj = hit;
246  geometry->push_back(hitObj);
247 
248 }

◆ displayTrackState()

void displayBarrelXY::displayTrackState ( GlobalPosition trkPosition,
GlobalDirection trkDirection 
)
virtual

create the graphic objects for a single track state

displayBarrelXY

Implements displayTracks.

Definition at line 104 of file display_track.cxx.

104  {
105  int color(2);
106  //if( pt[i] == 1) color = 4;
107  // length of track parameters in display (mm)
108  double tp_len = 2*10.;
109  double tp_r = 0.1;
110 
111  // draw circle at track position
112  TArc* trackpp = m_shapeCreator.createArc( trkPosition, tp_r );
113  trackpp->SetLineColor( color );
114  //m_arcs.push_back(trackpp);
115  TObject* trackppObj = trackpp;
116  m_trackGraphics->push_back(trackppObj);
117 
118  //m_display->addArc( trackpp );
119 
120  // draw line in track direction
121  TLine* trackp = m_shapeCreator.createLine( trkPosition, trkDirection, tp_len );
122  trackp->SetLineWidth( 2 );
123  trackp->SetLineColor( color );
124  //m_display->addLine( trackp );
125  //m_lines.push_back(trackp);
126  TObject* trackpObj = trackp;
127  m_trackGraphics->push_back(trackpObj);
128 
129  // draw line perp. to track direction
130  TLine* trackp_o = m_shapeCreator.createOrthogonalLine( trkPosition, trkDirection, tp_len );
131  trackp_o->SetLineColor( color );
132  //m_display->addLine( trackp_o );
133  //m_lines.push_back(trackp_o);
134  TObject* trackp_oObj = trackp_o;
135  m_trackGraphics->push_back(trackp_oObj);
136 
137 }

◆ displayTRT_Measurement()

void displayBarrelXY::displayTRT_Measurement ( GlobalPosition strawPosition,
double  driftRadius,
bool  onTrack,
bool  outlierOnTrack,
double  = 0. 
)
virtual

create the graphic objects for a single TRT measurement

Implements displayTracks.

Definition at line 159 of file display_track.cxx.

160  {
161  // tube radius
162  double tube_radius = 2.;
163 
164  std::vector<TObject*>* geometry=0;
165  bool backside = strawPosition.z() < 0.;
166  int color_hit = 4; // blue
167  int color_tube = 1; // black
168  if (onTrack && !outlierOnTrack ) {
169  color_hit = backside ? 303 : 4; // dark/full blue
171  } else if (onTrack && outlierOnTrack) {
172  color_hit = backside ? 302 : 3; // dark/full green
174  } else {
175  color_hit = backside ? 306 : 6; // dark/full magenta
177  }
178  // draw TRT tube
179  TArc* tube = m_shapeCreator.createArc( strawPosition, tube_radius );
180  tube->SetLineColor( color_tube );
181  if (!onTrack && backside) tube->SetFillColor( 310 );
182  //m_display->addArc( tube );
183  //m_arcs.push_back(tube);
184  TObject* tubeObj = tube;
185  geometry->push_back(tubeObj);
186 
187  // draw little flag to distinguish z<0 / z>0 in XY view
188  double x_flag = backside ? -1.6 : 1.6;
189  GlobalPosition gp_flag(strawPosition.x()+1.6,strawPosition.y()+x_flag,strawPosition.z());
190  TArc* tubeFlag = m_shapeCreator.createArc( gp_flag,0.25 );
191  tubeFlag->SetLineColor( color_hit );
192  tubeFlag->SetFillColor( color_hit );
193  TObject* flagObj = tubeFlag;
194  geometry->push_back(flagObj);
195 
196  // draw drift circle or full NODRIFTTIME tube
197  if (driftRadius != 0.0) {
198  TArc* hit = m_shapeCreator.createArc( strawPosition, driftRadius );
199  hit->SetLineColor( color_hit );
200  hit->SetLineWidth( 2 );
201  //m_display->addArc( hit );
202  //m_arcs.push_back(hit);
203  TObject* hitObj = hit;
204  geometry->push_back(hitObj);
205  } else {
206  TArc* hit = m_shapeCreator.createArc( strawPosition, 1.15 ); // tube used w/o drift time -> 4mm/sqrt(12) error
207  hit->SetLineColor( color_hit );
208  hit->SetFillColor( color_hit );
209  hit->SetLineWidth( 2 );
210  TObject* hitObj = hit;
211  geometry->push_back(hitObj);
212  }
213 
214  // draw circle at straw (wire) position
215  TArc* tube_c = m_shapeCreator.createArc( strawPosition, 0.05 );
216  tube_c->SetLineColor( 1 );
217  tube_c->SetFillColor( 1 );
218  //m_display->addArc( tube_c );
219  //m_arcs.push_back(tube_c);
220  TObject* tube_cObj = tube_c;
221  geometry->push_back(tube_cObj);
222 }

◆ displayTRT_MeasurementOnTrack()

void displayBarrelXY::displayTRT_MeasurementOnTrack ( GlobalPosition strawPosition,
double  driftRadius,
GlobalDirection trkDirection,
bool  isOutlier,
double  = 0. 
)
virtual

create the graphic objects for a single TRT measurement on track

Implements displayTracks.

Definition at line 139 of file display_track.cxx.

139  {
140  displayTRT_Measurement(strawPosition, driftRadius, true, isOutlier);
141  if (!isOutlier) {
142  // display marker for left/right solution
143  GlobalDirection dir_o(trkDirection.y(), -trkDirection.x(), 0.);
144  dir_o *= (trkDirection.z()<0 ? -1 : 1);
145 
146  // use an arrow as marker: fine for higher zoom, with less zoom looks strange
147  //TArrow* marker = ShapeCreator::createArrow(strawPosition, dir_o, driftRadius);
148  TPolyLine* marker = m_shapeCreator.createTriangle(strawPosition, dir_o,
149  0.45*driftRadius+(driftRadius<0?-0.3:0.3));
150  marker->SetLineColor( 311 );
151  marker->SetLineWidth( 2 );
152  //m_display->addLine( marker_o );
153  //m_lines.push_back(marker_o);
154  TObject* markerObj = marker;
155  m_trackGraphics->push_back(markerObj);
156  }
157 }

◆ displayTRT_Tubes()

void displayBarrelXY::displayTRT_Tubes ( )
virtual

Implements displayTracks.

Definition at line 223 of file display_track.cxx.

223 {}

◆ getCompetingROTsGraphics()

std::vector< TObject * > * displayTracks::getCompetingROTsGraphics ( )
virtualinherited

Definition at line 54 of file display_track.cxx.

54  {
56 }

◆ getGeometryGraphics()

std::vector< TObject * > * displayTracks::getGeometryGraphics ( )
virtualinherited

Definition at line 51 of file display_track.cxx.

51  {
52  return m_geometryGraphics;
53 }

◆ getRIOGraphics()

std::vector< TObject * > * displayTracks::getRIOGraphics ( )
virtualinherited

Definition at line 48 of file display_track.cxx.

48  {
49  return m_rioGraphics;
50 }

◆ getTrackGraphics()

std::vector< TObject * > * displayTracks::getTrackGraphics ( )
virtualinherited

Definition at line 45 of file display_track.cxx.

45  {
46  return m_trackGraphics;
47 }

Member Data Documentation

◆ m_competingRotGraphics

std::vector<TObject*>* displayTracks::m_competingRotGraphics
protectedinherited

Definition at line 77 of file display_track.h.

◆ m_geometryGraphics

std::vector<TObject*>* displayTracks::m_geometryGraphics
protectedinherited

Definition at line 76 of file display_track.h.

◆ m_rioGraphics

std::vector<TObject*>* displayTracks::m_rioGraphics
protectedinherited

Definition at line 75 of file display_track.h.

◆ m_shapeCreator

ShapeCreator displayTracks::m_shapeCreator
protectedinherited

Definition at line 79 of file display_track.h.

◆ m_trackGraphics

std::vector<TObject*>* displayTracks::m_trackGraphics
protectedinherited

Definition at line 74 of file display_track.h.


The documentation for this class was generated from the following files:
color
Definition: jFexInputByteStreamTool.cxx:25
displayTracks::m_shapeCreator
ShapeCreator m_shapeCreator
Definition: display_track.h:79
displayTracks::clearTrackGraphics
virtual void clearTrackGraphics()
Definition: display_track.cxx:58
displayTracks::m_geometryGraphics
std::vector< TObject * > * m_geometryGraphics
Definition: display_track.h:76
python.Include.marker
string marker
Definition: Include.py:21
displayTracks::displayTracks
displayTracks()
base class: displayTracks
Definition: display_track.cxx:24
ShapeCreator::createArc
TArc * createArc(const TVector3 &pos, double r)
Definition: ShapeCreator.cxx:175
ShapeCreator::createTriangle
TPolyLine * createTriangle(const TVector3 &pos, const TVector3 &dir, double length)
Definition: ShapeCreator.cxx:161
lumiFormat.i
int i
Definition: lumiFormat.py:85
displayTracks::m_trackGraphics
std::vector< TObject * > * m_trackGraphics
Definition: display_track.h:74
ShapeCreator::createLine
TLine * createLine(const TVector3 &pos, const TVector3 &dir, double length)
Definition: ShapeCreator.cxx:106
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:53
color
color
Definition: BinsDiffFromStripMedian.h:18
displayTracks::clearGeometryGraphics
virtual void clearGeometryGraphics()
Definition: display_track.cxx:71
LArG4GenerateShowerLib.geometry
geometry
Definition: LArG4GenerateShowerLib.py:19
displayTracks::m_competingRotGraphics
std::vector< TObject * > * m_competingRotGraphics
Definition: display_track.h:77
displayTracks::clearRIOGraphics
virtual void clearRIOGraphics()
Definition: display_track.cxx:64
displayBarrelXY::displayTRT_Measurement
virtual void displayTRT_Measurement(GlobalPosition &strawPosition, double driftRadius, bool onTrack, bool outlierOnTrack, double=0.)
create the graphic objects for a single TRT measurement
Definition: display_track.cxx:159
ShapeCreator::createOrthogonalLine
TLine * createOrthogonalLine(const TVector3 &pos, const TVector3 &dir, double length)
Definition: ShapeCreator.cxx:133
ShapeCreator::setProjection
void setProjection(int p)
Definition: ShapeCreator.cxx:95
displayTracks::clearCompetingROTsGraphics
virtual void clearCompetingROTsGraphics()
Definition: display_track.cxx:77
GlobalPosition
TVector3 GlobalPosition
Definition: display_track.h:14
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
displayTracks::m_rioGraphics
std::vector< TObject * > * m_rioGraphics
Definition: display_track.h:75
GlobalDirection
TVector3 GlobalDirection
Definition: display_track.h:15
calibdata.tube
tube
Definition: calibdata.py:31
ShapeCreator::createText
TText * createText(const TVector3 &pos, const char *text)
Definition: ShapeCreator.cxx:195