4 # include "StuDraw3DEvent.h"
9 # include "StFtpcHit.h"
10 # include "StTrackNode.h"
11 # include "StTrackGeometry.h"
12 # include "StFtpcHitCollection.h"
13 # include "StFtpcSectorHitCollection.h"
14 # include "StFtpcPlaneHitCollection.h"
15 # include "StMeasuredPoint.h"
16 # include "StTrackDetectorInfo.h"
32 std::vector<float> hitPoints;
34 if (ftpHits->numberOfHits()>0) {
36 for (n=0;n<ftpHits-> numberOfPlanes();++n ) {
37 for (m=0; m<ftpHits->plane(n)->numberOfSectors(); m++) {
38 for (h=0; h<ftpHits->plane(n)->sector(m)->hits().size(); h++) {
39 hit = ftpHits->plane(n)->sector(m)->hits()[h];
40 hitPoints.push_back( hit->position().x());
41 hitPoints.push_back( hit->position().y());
42 hitPoints.push_back( hit->position().z());
44 std::vector<float>::iterator xyz = hitPoints.begin();
46 gEdFtp->
Points(hitPoints.size()/3,&*xyz,kUnusedHit);
47 gEdFtp->SetComment(
"Unused FTPC hits");
49 printf(
" FTPC hits counter total : %d\n", hitPoints.size()/3);
57 Style_t sty = gEdFtp->
Style(kUsedHit).Sty();
58 Size_t siz = gEdFtp->
Style(kUsedHit).Siz();
60 Style_t styPnt = gEdFtp->
Style(kTrackBegin).Sty();
61 Size_t sizPnt = gEdFtp->
Style(kTrackBegin).Siz();
63 StTrackType type = global;
66 const StSPtrVecTrackNode& theNodes =
event->trackNodes();
67 for (
unsigned int i=0; i<theNodes.size(); i++) {
69 if (track && track->flag() > 0
70 && track->detectorInfo()
71 && ( track->detectorInfo()->numberOfPoints(kFtpcWestId) || track->detectorInfo()->numberOfPoints(kFtpcEastId) )
76 double pt = track->geometry()->momentum().perp();
80 gEdFtp->
Track(*track,trackColor);
81 gEdFtp->SetComment(Form(
"Pt=%f /Gev",pt));
82 gEdFtp->
TrackInOut(*track,
true, trackColor, styPnt, sizPnt);
83 gEdFtp->
TrackInOut(*track,
false, trackColor, styPnt, sizPnt);
87 gEdFtp->Hits(*track,trackColor,sty,siz);
100 if (clear) gEdFtp->
Clear();
106 void skip(
int nEvents=1) {
107 if(ftpChain) ftpChain->Skip(nEvents);
115 ftpChain->MakeEvent();
116 event = (
StEvent*)ftpChain->GetDataSet(
"StEvent");
117 if (event && !event->trackNodes().empty()) {
120 printf(
" event is empty %p\n", event);
126 void EdFtpc(
const char* file =
127 "/star/institutions/bnl/fine/testfiles/st_physics_10169042_raw_4030001.event.root"
128 ,
unsigned int nEvent=44,
const char * detectorNames=
"FTPC,StarFloor,StarCompass,StarBeam")
131 if ( gSystem->AccessPathName(file)) {
133 <<
"** Error ** : The input file: <"<< file <<
"> does not exist !!!"
138 gROOT->Macro(
"Load.C");
139 gSystem->Load(
"StDetectorDbMaker");
140 TString bfcchain = Form(
"bfc.C(0,\"doevents\",\"%s\")",file);
142 bfcchain = Form(
"bfc.C(%d,%d-1,\"doevents\",\"%s\")",nEvent,nEvent,file);
143 cout << bfcchain.Data() << endl;
144 gROOT->Macro(bfcchain.Data());
146 delete gEventDisplay;
147 ftpChain = (
StChain *)StMaker::GetChain();
virtual const StDraw3DStyle & Style(EDraw3DStyle type) const
Return the reference to the predefined StDraw3DStyle object.
virtual void SetBkColor(Color_t newBkColor)
Set the ROOT color as the widget background.
static Color_t Pt2Color(double pt)
Maps the track pt to the STAR StTrack track color code.
void rd(int hits=0, bool clear=false)
This function redraws all hits and/or tracks from the current event.
void ae(int tracks=-1, int hits=-1)
This function is to search for the next non-empty event and draw it by looping over StBFChain (readin...
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...
virtual void Clear(Option_t *opt="update")
Remove all objects from the list and update the screen if opt is "update".