00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 {
00014
00015
00016
00017
00018 TCanvas *m_TreeD = new TCanvas("STAF","Events",10,600,200,200);
00019 TFile f("/star/u2a/fine/WWW/star.root");
00020
00021
00022 TGeometry *star = f.Get("STAR");
00023 if (!star) {
00024 printf("Sorry, STAR was not found !\n");
00025 return;
00026 }
00027 TList *listOfNode = star->GetListOfNodes();
00028 St_Node *hall = listOfNode->First();
00029
00030 listOfNode->Remove(hall);
00031 listOfNode->Remove(hall);
00032 St_DataSetIter volume(hall);
00033
00034
00035
00036
00037
00038 St_Node *thisTrack = 0;
00039
00040 StTrackCollection *tracks = ((StEvent *)Event)->trackCollection();
00041 if (tracks) {
00042 StGlobalTrackIterator next(tracks);
00043 StGlobalTrack *globTrack = 0;
00044 Int_t trackCounter = 0;
00045 while (globTrack = (StGlobalTrack *)next() && trackCounter < 50) {
00046 printf ("Track %d\n",trackCounter);
00047 StVecPtrTpcHit *hits = globTrack->tpcHits();
00048 StHits3DPoints *hitPoints = new StHits3DPoints(hits);
00049 StHelix3DPoints *helixPoints = new StHelix3DPoints(globTrack,globTrack->length(),30);
00050 if (hitPoints->Size()>1) {
00051 St_PolyLineShape *trackShape = new St_PolyLineShape(hitPoints);
00052 trackShape->SetVisibility(1); trackShape->SetColorAttribute(kYellow);
00053 trackShape->SetLineStyle(1); trackShape->SetSizeAttribute(1);
00054 }
00055 Int_t colorIndx = trackCounter%7;
00056 St_PolyLineShape *helixShape = new St_PolyLineShape(helixPoints,"L");
00057 helixShape->SetVisibility(1); helixShape->SetColorAttribute(colorIndx+kGreen);
00058 helixShape->SetLineStyle(1); helixShape->SetSizeAttribute(2);
00059
00060 thisTrack = new St_Node("hits","hits",helixShape);
00061 thisTrack->Mark(); thisTrack->SetVisibility();
00062
00063 thisTrack->Add(trackShape);
00064 St_NodePosition *pp = hall->Add(thisTrack);
00065 trackCounter++;
00066 if (!pp)
00067 printf(" no position %d\n",trackCounter);
00068 }
00069 printf(" %d tracks has been found\n",trackCounter);
00070 }
00071
00072
00073
00074 gBenchmark->Stop("Draw time");
00075
00076 fullView = new St_NodeView(*hall);
00077
00078 sensible = new St_NodeView(fullView);
00079 printf(" drawing the STAR geometry sensible volumes and hits \n");
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 printf(" Marking the current structure to create another simplified one\n");
00092 sensible->Mark();
00093 shortView = (St_NodeView *)sensible->FindByName("TPGV");
00094 if (shortView) shortView->Mark();
00095
00096
00097
00098
00099
00100 St_DataSetIter nextHits(sensible);
00101 while (shortView = (St_NodeView *) nextHits()) {
00102 if (strcmp(shortView->GetName(),"ZCAL")==0) continue;
00103 shortView->Mark();
00104 }
00105
00106
00107
00108
00109
00110 printf(" Creating a new structure simplified structure\n");
00111 shortView = new St_NodeView(sensible);
00112 TCanvas *m_simpleD = new TCanvas("Detector","Simple view and hits",500,500,400,400);
00113 shortView->Draw("L");
00114
00115
00116
00117
00118
00119
00120
00121 printf(" Drawing the new structure simplified structure\n");
00122 gPad->Update();
00123 gBenchmark->Summary();
00124 printf(" Drawing 3d solid view of the last structure\n");
00125
00126 }