3 #include "StuDraw3DMuEvent.h"
5 #include "StHelixHelper.h"
6 #include "StMuDSTMaker/COMMON/StMuTrack.h"
7 #include "StThreeVector.hh"
8 #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h"
9 #include "StEmcUtil/geometry/StEmcGeom.h"
40 StuDraw3DMuEvent::StuDraw3DMuEvent(
const char *detectorName,TVirtualPad *pad):
41 StDraw3D(detectorName,pad),fEndcapGeom(0)
46 if (!gMuEventDisplay) gMuEventDisplay =
this;
56 if (gMuEventDisplay ==
this) gMuEventDisplay = 0;
57 delete fEndcapGeom; fEndcapGeom=0;
71 TObjArray *globTracks = 0;
72 TObjArray *primTracks = 0;
74 n_glob=StMuDst::GetNGlobalTrack();
76 n_prim=StMuDst::GetNPrimaryTrack();
80 while (i_track < n_prim) {
82 double pt =track.
pt();
83 Style_t sty =
Style(kPrimaryTrack).Sty();
84 Size_t siz =
Style(kPrimaryTrack).Siz();
89 while (i_track < n_glob) {
91 double pt =track.
pt();
92 Style_t sty =
Style(kGlobalTrack).Sty();
93 Size_t siz =
Style(kGlobalTrack).Siz();
97 cout << endl << n_prim <<
" primary and " << n_glob <<
" global tracks have been rendered" << endl;
116 Float_t *xyz = trPnt.GetPoints(size);
117 TObject *l =
Line(size,xyz,col,sty,siz);
118 SetModel((TObject*)&track);
131 if (sty == kPrimaryTrack)
136 view =
Track(*thisTrack, style.Col(),style.Sty(),style.Siz() );
153 , Color_t col, Style_t sty, Size_t siz)
158 return Point(pnt.x(),pnt.y(),pnt.z(), col,sty,siz);
173 return TrackInOut(track, in, style.Col(),style.Sty(),style.Siz() );
236 Color_t colorResponce = 0;
237 int nTowers = emc.getNEndcapTowerADC();
238 for (
int i=0; i< nTowers; i++) {
239 int adc, isec, isub, ieta;
240 emc.getEndcapTowerADC(i,adc,isec,isub,ieta);
241 isec--; ieta--; isub--;
242 if (adc<=0)
continue;
244 float etaCenter =EndcapGeom()->
getEtaMean(ieta);
245 if (etaCenter <= 0)
continue;
246 float phiCenter =EndcapGeom()->
getPhiMean(isec,isub);
247 if (phiCenter <= 0)
continue;
250 static const float radius = 270.;
251 float energy = adc*60./4096-0.15;
252 if ( energy > 0.15 ) {
255 if ( energy < 0.3) { colorResponce = kBlue;
257 }
else if ( energy < 1.0 ) { colorResponce = kGreen;
259 }
else if ( energy < 4.0 ) { colorResponce = kYellow;
261 }
else colorResponce = kRed;
263 static const double maxSize = 400.;
264 static const double scale = 15;
265 double size =(energy > 0.3 ? scale : scale/30.)*energy;
266 if (size > maxSize) size = maxSize ;
273 SetComment(Form(
"Endcap eta=%f, phi=%f, energy=%f",etaCenter,phiCenter,energy));
291 StEmcGeom *emcGeom =StEmcGeom::getEmcGeom(detId);
293 Int_t softId=emcHitsSoftId;
296 emcGeom->getEtaPhi(softId,eta,phi);
297 Float_t etaStep = 1.0/emcGeom->NEta();
298 Float_t phiStep = TMath::Pi()/60;
299 static int entries = 0;
305 , col,sty+(strcmp(detId,
"bemc")?0:kBarrelStyle),siz);
307 LOG_ERROR << __FILE__ <<
": there is no geometry information for \"" << detId <<
"\"" << endm;
315 return EmcHit<StEmcTowerColor>(emcHitsSoftId, energy, detIdt);
326 StEmcTowerColor::StEmcTowerColor(
float energy)
328 Color_t colorResponce=0;
330 if (energy > 0 && energy < 30) {
333 colorResponce = kBlue;
336 }
else if ( energy < 1.0 ) colorResponce = kGreen;
338 else if ( energy < 4.0 ) colorResponce = kYellow;
340 else colorResponce = kRed;
342 static const double maxSize = 400.;
343 static const double scale = 200.;
344 size =(energy > 0.3 ? scale : scale/30.)*energy;
345 if (size > maxSize) size = maxSize ;
346 fStyle.SetCol(colorResponce);
static TObjArray * globalTracks()
returns pointer to the global tracks list
Double_t pt() const
Returns pT at point of dca to primary vertex.
virtual ~StuDraw3DMuEvent()
~StuDraw3DMuEvent( ) dtor
virtual const StDraw3DStyle & Style(EDraw3DStyle type) const
Return the reference to the predefined StDraw3DStyle object.
Double_t length() const
Returns length of track (cm) from primary vertex to last measured point.
Float_t getEtaHalfWidth(UInt_t eta) const
StDraw3DStyle maps "STAR event" EDraw3DStyle onto ROOT (color,style,size) attributes.
Class StuDraw3DMuEvent - to draw the StMuDst primitives like StMuTrack as 3D points and 3D lines deco...
static Color_t Pt2Color(double pt)
Maps the track pt to the STAR StTrack track color code.
virtual TObject * Tower(float radius, float lambda, float lambda1, float lambda2, float phi, float dphi, Color_t col, Style_t sty, Size_t siz)
This is an overloaded member function, provided for convenience.
virtual TObject * Line(int n, const double *xyz, Color_t col=Color_t(-1), Style_t sty=Style_t(-1), Size_t siz=Size_t(-1))
This is an overloaded member function, provided for convenience.
Class StDraw3D - to draw the 3D primitives like 3D points and 3D lines decorated with the STAR detect...
Float_t getPhiMean(UInt_t sec) const
StPhysicalHelixD helix() const
Returns inner helix (first measured point)
virtual TObject * TrackInOut(const StMuTrack &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 style, and siz size if provided.
const StThreeVectorF & firstPoint() const
Returns positions of first measured point.
virtual TObject * Track(const StMuTrack &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 style, and siz size if provided.
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
virtual void Tracks(StTrackType type=global)
Add all tracks of the given type from the current event to the display list.
static StMuEmcCollection * muEmcCollection()
returns pointer to current StMuEmcCollection
Float_t getPhiHalfWidth(UInt_t sec=0, UInt_t ssec=0) const
const StThreeVectorF & lastPoint() const
Returns positions of last measured point.
const StMuTrack * primaryTrack() const
Returns pointer to associated primary track. Null pointer if no global track available.
const StMuTrack * globalTrack() const
Returns pointer to associated global track. Null pointer if no global track available.
virtual TObject * EmcHit(Int_t emcHitsSoftId, Color_t col, Style_t sty, Size_t siz, const char *detIdt="bemc")
Add EMC hit defined emcHitsSoftId to the display list with the col color sty and size if provided...
StPhysicalHelixD outerHelix() const
Returns outer helix (last measured point)
static StuDraw3DMuEvent * Display()
virtual void Endcaps(Style_t sty=0)
Add the endcap towers to the list to display.
Float_t getEtaMean(UInt_t eta) const