3 #include "StuDraw3DEvent.h"
4 #if !defined(__CINT__) && !defined(__CLING__)
5 # include "TVirtualPad.h"
7 # include "StEventHelper.h"
11 # include "StTpcHit.h"
12 # include "StTrackNode.h"
13 # include "StTrackGeometry.h"
14 # include "StTpcHitCollection.h"
15 # include "StMeasuredPoint.h"
16 # include "StTrackDetectorInfo.h"
41 EveDis(
const char *detectorName=
"TPC",TVirtualPad *pad=0)
53 void AddHits(
const StEvent *event,EStuDraw3DEvent trackHitsOnly, StTrackType type)
59 if (trackHitsOnly != kUnusedHitsOnly) {
61 Style_t sty =
Style(kUsedHit).Sty();
62 Size_t siz =
Style(kUsedHit).Siz();
63 Style_t styPnt =
Style(kTrackBegin).Sty();
64 Size_t sizPnt =
Style(kTrackBegin).Siz();
66 const StSPtrVecTrackNode& theNodes =
event->trackNodes();
67 for (
unsigned int i=0; i<theNodes.size(); i++) {
74 if (track && track->flag() > 0
75 && track->detectorInfo()
82 double pt = track->geometry()->momentum().perp();
84 if ( trackHitsOnly != kUsedHits) {
88 Track(*track,trackColor);
89 TrackInOut(*track,
true, trackColor, styPnt, sizPnt);
90 TrackInOut(*track,
false, trackColor, styPnt, sizPnt);
92 if ( trackHitsOnly != kTracksOnly) {
97 std::vector<float> hitPoints;
98 const StPtrVecHit& trackHits = track->detectorInfo()->hits(kTpcId);
99 for (m=0; m<trackHits.size(); m++) {
107 hitPoints.push_back( hit->position().x());
108 hitPoints.push_back( hit->position().y());
109 hitPoints.push_back( hit->position().z());
114 std::vector<float>::iterator xyz = hitPoints.begin();
115 Points(hitPoints.size()/3,&*xyz,trackColor,sty,siz);
116 if (trackHitsOnly == kUsedHits) SetModel(track);
125 std::vector<float> hitPoints;
126 for (n=0; n<hits->numberOfSectors(); n++) {
127 for (m=0; m<hits->sector(n)->numberOfPadrows(); m++) {
128 for (h=0; h<hits->sector(n)->padrow(m)->hits().size(); h++) {
132 hit = hits->sector(n)->padrow(m)->hits()[h];
136 hitPoints.push_back( hit->position().x());
137 hitPoints.push_back( hit->position().y());
138 hitPoints.push_back( hit->position().z());
142 std::vector<float>::iterator xyz = hitPoints.begin();
146 Points(hitPoints.size()/3,&*xyz,kUnusedHit);
147 SetComment(
"Unused TPC hits");
virtual const StDraw3DStyle & Style(EDraw3DStyle type) const
Return the reference to the predefined StDraw3DStyle object.
static Color_t Pt2Color(double pt)
Maps the track pt to the STAR StTrack track color code.
virtual TObject * Track(const StTrack &track, Color_t col, Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
Add track to the display list with the col color sty and size if provided.
virtual TObject * TrackInOut(const StTrack &track, Bool_t in, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
Add the in point of the given track to the display list with the col color sty and siz size if provid...
virtual TObject * Points(int n, const float *xyz, EDraw3DStyle sty)
This is an overloaded member function, provided for convenience.
Class StuDraw3DEvent - to draw the 3D StEvent primitives like StTrack, StHit, StVertex decorated with...