43 St_g2t_tpc_hit *points = 0;
46 Color_t trackColor(Long_t geantId)
48 Color_t color = kYellow;
74 TCanvas *paveCanvas =
new TCanvas(
"x3d",
"X3D Help",500,20,540,220);
75 TPaveText *label =
new TPaveText(0,0,1,1);
76 const Char_t *myMessage[] = {
"Plot 3D view"
77 ,
"Note: Under Windows NT OpenGL will be used by default instead x3d for UNIX"
78 ,
"Select x3d windows and type \"m\" in there to get x3d HELP windows"
79 ,
"DON NOT FORGET to type \"q\" letter to terminate x3d widget"
80 ,
"to continue this session"};
83 lenMessage =
sizeof(myMessage)/4;
86 for (j=lenMessage-1;j>0;j--) {
87 label->InsertText(myMessage[j]);
90 paveCanvas->Modified();
97 gSystem->Load(
"St_base");
98 gSystem->Load(
"xdf2root");
99 gSystem->Load(
"St_Tables");
104 TCanvas *m_TreeD =
new TCanvas(
"STAF",
"Events",10,600,200,200);
113 TFile f(
"/star/u2a/fine/WWW/star.root");
115 TGeometry *star = f.Get(
"STAR");
117 printf(
"Sorry, STAR was not found !\n");
125 TList *listOfNode = gGeometry->GetListOfNodes();
129 listOfNode->Remove(hall);
142 St_XDFFile file(
"/disk00000/star/test/dev/trs_Linux/Fri/year_1b/set0352_01_35evts.dst.xdf");
145 if (skip)
delete skip;
154 const Char_t *table =
"event/geant/Event/g2t_tpc_hit";
155 const Char_t *trackTable =
"event/geant/Event/g2t_track";
168 points = (St_g2t_tpc_hit *)next(table);
174 g2t_tpc_hit_st *p = 0;
176 g2t_tpc_hit_st *p = points->GetTable();
178 printf(
"Error. The table <%s> was not found\n",table);
188 St_g2t_track *trackT = (St_g2t_track *)next(trackTable);
190 g2t_track_st *geTrack = trackT->GetTable();
215 const Int_t maxtracks = 5;
217 gBenchmark->Start(
"Fill time");
221 g2t_tpc_hit_st *hitPoint = 0;
222 printf(
" new track found:");
223 St_Node *thisTrack[7] = {0,0,0,0,0,0,0};
224 Int_t MaxRowtoCount = 5000;
225 Int_t MaxTracks = Track2Line->
CountKeys();
226 printf(
" Total tracks here %d \n",MaxTracks);
229 St_Node *allTracks =
new St_Node(
".hits",
"Global Hits", (TShape *)0);
230 if (!allTracks) { printf(
"Bug !!!\n");
return; }
233 hall->Add(allTracks);
234 for (i=0;i<Track2Line->GetNRows() && ntracks < MaxTracks ;i++)
236 hitPoint = p + Track2Line->
GetIndex(i);
237 newId = hitPoint->track_p;
239 if (newId != currentId) {
241 const Char_t *xName =
"x[0]";
242 const Char_t *yName =
"x[1]";
243 const Char_t *zName =
"x[2]";
244 track =
new St_Table3Points(Track2Line,(
const void *)&newId,xName,yName,zName);
248 trackShape->SetVisibility(1);
249 Int_t colorIndx = ntracks%7;
254 if (!thisTrack[colorIndx]) {
255 thisTrack[colorIndx] =
new St_Node(
"hits",
"hits",trackShape);
256 thisTrack[colorIndx]->Mark(); thisTrack[colorIndx]->
SetVisibility();
258 if (!pp) printf(
" no position %d\n",ntrack);
261 thisTrack[colorIndx]->Add(trackShape);
267 printf(
"%d tracks have been read\n",ntracks);
268 gBenchmark->Stop(
"Fill time");
270 printf(
" Now we will try to draw something \n");
272 gBenchmark->Stop(
"Draw time");
279 printf(
" drawing the STAR geometry sensible volumes and hits \n");
286 printf(
" drawing the HELP windows\n");
291 printf(
" Marking the current structure to create another simplified one\n");
294 if (shortView) shortView->Mark();
299 while (shortView = (
St_NodeView *) nextHits()) shortView->Mark();
301 nextHits.Reset(sensible);
303 if (strcmp(shortView->GetName(),
"ZCAL")==0)
continue;
308 printf(
" Creating a new structure simplified structure\n");
310 TCanvas *m_simpleD =
new TCanvas(
"Detector",
"Simple view and hits",500,500,400,400);
311 shortView->
Draw(
"L");
315 printf(
" Drawing the new structure simplified structure\n");
317 gBenchmark->Summary();
318 printf(
" Drawing 3d solid view of the last structure\n");
323 printf(
" The following global variables are available:\n");
324 printf(
"\tSt_Node *hall - \"closed\" full GEANT geometry structure\n");
325 printf(
"\tSt_NodeView *fullView - \"open\" full GEANT geometry structure\n");
326 printf(
"\tSt_NodeView *sensible - all \"sensible\" detector elements of the full GEANT structure\n");
327 printf(
"\tSt_NodeView *shortView - subset of the structure above\n");
333 TCanvas *ccc =
new TCanvas(
"STARTPC",
"Sectors",500,10,200,200);
335 singleSector->
Draw();
341 TVirtualPad *thisPad = gPad;
342 TView *view = thisPad->GetView();
344 view->SetRange(min,max);
virtual TDataSet * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual Size_t SetSizeAttribute(Size_t size)
to be documented
Int_t GetIndex(UInt_t sortedIndex) const
returns the original index of the row by its sorted index
virtual void Remove(TDataSet *set)
Remiove the "set" from this TDataSet.
virtual void SetVisibility(ENodeSEEN vis=TVolume::kBothVisible)
virtual TDataSet * FindByName(const Char_t *name, const Char_t *path="", Option_t *opt="")
to be documented
virtual Color_t SetColorAttribute(Color_t color)
to be documented
virtual TDataSet * FindByName(const char *name, const char *path="", Option_t *opt="") const
virtual void Draw(Option_t *depth="3")
Draw Referenced node with current parameters.
virtual Int_t GetGlobalRange(const TVolumeView *rootNode, Float_t *min, Float_t *max)
virtual void SetVisibility(Int_t vis=1)
to be documented
virtual Int_t CountKeys() const