00001 {
00002
00003 StTpcHitCollection *t = ((StEvent *)Event)->tpcHitCollection();
00004 if (!t) {
00005 printf(" No colection have been found!\n Did you forget to run <EventRead.C> macro first ?\n");
00006 return;
00007 }
00008 TCanvas *m_TreeD = new TCanvas("STAF","Events",10,600,200,200);
00009 TFile f("/star/u2a/fine/WWW/STAR");
00010
00011 TGeometry *star = f.Get("STAR");
00012 if (!star) {
00013 printf("Sorry, STAR was not found !\n");
00014 return;
00015 }
00016 TList *listOfNode = star->GetListOfNodes();
00017 St_Node *hall = listOfNode->First();
00018
00019 listOfNode->Remove(hall);
00020 listOfNode->Remove(hall);
00021 St_DataSetIter volume(hall);
00022
00023 St_Node *thisTrack = 0;
00024
00025 StHits3DPoints hitPoints(t);
00026 St_PolyLineShape *trackShape = new St_PolyLineShape(&hitPoints);
00027 trackShape->SetVisibility(1);
00028 trackShape->SetLineColor(kYellow);
00029 trackShape->SetLineStyle(1);
00030 trackShape->SetLineWidth(2);
00031
00032 if (!thisTrack) {
00033 thisTrack = new St_Node("hits","hits",trackShape);
00034 thisTrack->Mark();
00035 thisTrack->SetVisibility();
00036 St_NodePosition *pp = hall->Add(thisTrack);
00037 if (!pp) printf(" no position %d\n",ntrack);
00038 }
00039
00040
00041 gBenchmark->Stop("Draw time");
00042
00043 fullView = new St_NodeView(*hall);
00044
00045 sensible = new St_NodeView(fullView);
00046 printf(" drawing the STAR geometry sensible volumes and hits \n");
00047 sensible->Draw();
00048
00049
00050
00051 gPad->Update();
00052
00053 printf(" drawing the HELP windows\n");
00054
00055
00056
00057
00058 printf(" Marking the current structure to create another simplified one\n");
00059 sensible->Mark();
00060 shortView = (St_NodeView *)sensible->FindByName("TPGV");
00061 if (shortView) shortView->Mark();
00062
00063
00064 St_DataSetIter nextHits(sensible);
00065 while (shortView = (St_NodeView *) nextHits()) {
00066 if (strcmp(shortView->GetName(),"ZCAL")==0) continue;
00067 shortView->Mark();
00068 }
00069
00070
00071 printf(" Creating a new structure simplified structure\n");
00072 shortView = new St_NodeView(sensible);
00073 TCanvas *m_simpleD = new TCanvas("Detector","Simple view and hits",500,500,400,400);
00074 shortView->Draw("L");
00075
00076
00077
00078 printf(" Drawing the new structure simplified structure\n");
00079 gPad->Update();
00080 gBenchmark->Summary();
00081 printf(" Drawing 3d solid view of the last structure\n");
00082
00083 }