]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant3/THIGZ.cxx
Modifications for alpha OSF1.
[u/mrichter/AliRoot.git] / TGeant3 / THIGZ.cxx
1 ///////////////////////////////////////////////////////////////////////////////
2 //                                                                           //
3 //  Interface to the HIGZ package for the GEANT drawing package              //
4 //                                                                           //
5 //Begin_Html
6 /*
7 <img src="gif/THIGZClass.gif">
8 */
9 //End_Html
10 //                                                                           //
11 //                                                                           //
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include "TROOT.h"
15 #include "THIGZ.h"
16 #include "TGeant3.h"
17 #include "TGraph.h"
18 #include "TColor.h"
19 #include "TLine.h"
20 #include "TPolyLine.h"
21 #include "TPolyMarker.h"
22 #include "TPaveLabel.h"
23 #include "TText.h"
24 #include "Rtypes.h" 
25 #include "AliCallf77.h" 
26 #include "TPaveTree.h" 
27 #include <string.h> 
28 #include <ctype.h> 
29    
30 #ifndef WIN32
31 # define hplint hplint_
32 # define hplend hplend_
33 # define hplfra hplfra_
34 # define igmeta igmeta_
35 # define iselnt iselnt_
36 # define igiwty igiwty_
37 # define igqwk  igqwk_
38
39 # define iacwk  iacwk_
40 # define iclrwk iclrwk_
41 # define iclwk  iclwk_
42 # define idawk  idawk_
43 # define ifa    ifa_
44 # define igbox  igbox_
45 # define ightor ightor_
46 # define igpave igpave_
47 # define igpid  igpid_
48 # define igq    igq_
49 # define igrng  igrng_
50 # define igsa   igsa_
51 # define igset  igset_
52 # define igterm igterm_
53 # define iopwk  iopwk_
54 # define ipl    ipl_
55 # define ipm    ipm_
56 # define irqlc  irqlc_
57 # define iscr   iscr_
58 # define isfaci isfaci_
59 # define isfais isfais_
60 # define isln   isln_
61 # define ismk   ismk_
62 # define islwsc islwsc_
63 # define isplci isplci_
64 # define ispmci ispmci_
65 # define istxci istxci_
66 # define isvp   isvp_
67 # define iswn   iswn_
68 # define itx    itx_
69  
70 #else
71 # define iacwk  IACWK
72 # define iclrwk ICLRWK
73 # define iclwk  ICLWK
74 # define idawk  IDAWK
75 # define ifa    IFA
76 # define igbox  IGBOX
77 # define ightor IGHTOR
78 # define igpave IGPAVE
79 # define igpid  IGPID
80 # define igq    IGQ
81 # define igrng  IGRNG
82 # define igsa   IGSA
83 # define igset  IGSET
84 # define igterm IGTERM
85 # define iopwk  IOPWK
86 # define ipl    IPL
87 # define ipm    IPM
88 # define irqlc  IRQLC
89 # define iscr   ISCR
90 # define isfaci ISFACI
91 # define isfais ISFAIS
92 # define isln   ISLN
93 # define ismk   ISMK
94 # define islwsc ISLWSC
95 # define isplci ISPLCI
96 # define ispmci ISPMCI
97 # define istxci ISTXCI
98 # define isvp   ISVP
99 # define iswn   ISWN
100 # define itx    ITX
101 #endif
102
103 static Int_t npid = 0;
104 static char cpar[1200];
105
106 THIGZ *higz = 0;
107
108 ClassImp(THIGZ)
109    
110 //_______________________________________________________________
111 THIGZ::THIGZ()
112       :TCanvas()
113 {
114 }
115    
116 //_______________________________________________________________
117 THIGZ::THIGZ(Int_t size)
118       :TCanvas("higz","higz",size,size)
119 {
120    higz = this;
121    Reset();
122    SetFillColor(10);
123 }
124 //_______________________________________________________________
125 THIGZ::~THIGZ()
126 {
127 }
128 //_______________________________________________________________
129 Float_t THIGZ::Get(const char *name)
130 {
131    if (!strcmp(name,"FAIS")) return fFAIS;
132    if (!strcmp(name,"FASI")) return fFASI;
133    if (!strcmp(name,"LTYP")) return fLTYP;
134    if (!strcmp(name,"BASL")) return fBASL;
135    if (!strcmp(name,"LWID")) return fLWID;
136    if (!strcmp(name,"MTYP")) return fMTYP;
137    if (!strcmp(name,"MSCF")) return fMSCF;
138    if (!strcmp(name,"PLCI")) return fPLCI;
139    if (!strcmp(name,"PMCI")) return fPMCI;
140    if (!strcmp(name,"FACI")) return fFACI;
141    if (!strcmp(name,"TXCI")) return fTXCI;
142    if (!strcmp(name,"TXAL")) return fTXAL;
143    if (!strcmp(name,"CHHE")) return fCHHE*fY2;
144    if (!strcmp(name,"TANG")) return fTANG;
145    if (!strcmp(name,"TXFP")) return fTXFP;
146    if (!strcmp(name,"BORD")) return fBORD;
147    if (!strcmp(name,"NCOL")) return fNCOL;
148    if (!strcmp(name,"DRMD")) return fDRMD;
149    if (!strcmp(name,"SYNC")) return fSYNC;
150    if (!strcmp(name,"CLIP")) return fCLIP;
151    if (!strcmp(name,"2BUF")) return f2BUF;
152    return -1;
153 }
154 //_______________________________________________________________
155 void THIGZ::Set(const char *name, Float_t val)
156 {
157    if (!strcmp(name,"FAIS")) {fFAIS = Int_t(val); return;}
158    if (!strcmp(name,"FASI")) {fFASI = Int_t(val); return;}
159    if (!strcmp(name,"LTYP")) {fLTYP = Int_t(val); return;}
160    if (!strcmp(name,"BASL")) {fBASL = val; return;}
161    if (!strcmp(name,"LWID")) {fLWID = val; if (val <= 0) fLWID=1; return;}
162    if (!strcmp(name,"MTYP")) {fMTYP = Int_t(val); return;}
163    if (!strcmp(name,"MSCF")) {fMSCF = val; return;}
164    if (!strcmp(name,"PLCI")) {fPLCI = Int_t(val); return;}
165    if (!strcmp(name,"PMCI")) {fPMCI = Int_t(val); return;}
166    if (!strcmp(name,"FACI")) {fFACI = Int_t(val)%1000; return;}
167    if (!strcmp(name,"TXCI")) {fTXCI = Int_t(val); return;}
168    if (!strcmp(name,"TXAL")) {
169       Int_t align = Int_t(val); 
170       Int_t aligh = align/10;
171       Int_t aligv = align%10;
172       Int_t ah = aligh;
173       Int_t av = aligv;
174       if (aligh == 0) ah = 1;
175       if (aligv == 1 || aligh == 2) av = 3;
176       if (aligv == 3)               av = 2;
177       if (aligv == 0)               av = 1;
178       fTXAL = 10*ah + av;
179       return;
180    }
181    if (!strcmp(name,"CHHE")) {fCHHE = val/fY2; if (fCHHE <= 0) fCHHE = 0.03; return;}
182    if (!strcmp(name,"TANG")) {fTANG = val; return;}
183    if (!strcmp(name,"TXFP")) {fTXFP = Int_t(val); return;}
184    if (!strcmp(name,"BORD")) {fBORD = Int_t(val); return;}
185    if (!strcmp(name,"NCOL")) {fNCOL = Int_t(val); return;}
186    if (!strcmp(name,"DRMD")) {fDRMD = Int_t(val); return;}
187    if (!strcmp(name,"SYNC")) {fSYNC = Int_t(val); return;}
188    if (!strcmp(name,"CLIP")) {fCLIP = Int_t(val); return;}
189    if (!strcmp(name,"2BUF")) {f2BUF = Int_t(val); return;}
190 }
191 //_______________________________________________________________
192 void THIGZ::Reset(Option_t *)
193 {
194    fFAIS = 0;
195    fFASI = 1;
196    fLTYP = 1;
197    fBASL = 1;
198    fLWID = 1;
199    fMTYP = 1;
200    fMSCF = 1;
201    fPLCI = 1;
202    fPMCI = 1;
203    fFACI = 1;
204    fTXCI = 1;
205    fTXAL = 12;
206    fCHHE = 0.03;
207    fTANG = 0;
208    fTXFP = 62;
209    fBORD = 0;
210    fNCOL = 8;
211    fDRMD = 1;
212    fSYNC = 1;
213    fCLIP = 0;
214    f2BUF = 0;
215    fPID  = 0;
216    fPname= "";
217 }
218 //___________________________________________ 
219 void THIGZ::Gsatt(const char *name, const char *att, Int_t val)
220
221 //  NAME   Volume name
222 //  IOPT   Name of the attribute to be set
223 //  IVAL   Value to which the attribute is to be set
224 //
225 //  name= "*" stands for all the volumes.
226 //  iopt can be chosen among the following :
227 //     see TGeant3::Gsatt for more details
228 //
229
230    AliMC* pMC = AliMC::GetMC(); 
231    pMC->Gsatt(name,att,val);
232 }
233
234 //___________________________________________ 
235 void THIGZ::Gdopt(const char *name,const char *value)
236
237 //  NAME   Option name
238 //  VALUE  Option value
239 //
240 //  To set/modify the drawing options.
241 //     see TGeant3::Gdopt for more details
242 //
243    AliMC* pMC = AliMC::GetMC(); 
244    pMC->Gdopt(name,value);
245 }
246
247  
248 //___________________________________________ 
249 void THIGZ::Gdraw(const char *name,Float_t theta, Float_t phi, Float_t psi,Float_t u0,Float_t v0,Float_t ul,Float_t vl)
250
251 //  NAME   Volume name
252 //  +
253 //  THETA  Viewing angle theta (for 3D projection)
254 //  PHI    Viewing angle phi (for 3D projection)
255 //  PSI    Viewing angle psi (for 2D rotation)
256 //  U0     U-coord. (horizontal) of volume origin
257 //  V0     V-coord. (vertical) of volume origin
258 //  SU     Scale factor for U-coord.
259 //  SV     Scale factor for V-coord.
260 //     see TGeant3::Gdraw for more details
261 //
262
263    AliMC* pMC = AliMC::GetMC(); 
264    pMC->Gdraw(name,theta,phi,psi,u0,v0,ul,vl);
265 }
266
267  
268 //___________________________________________ 
269 void THIGZ::Gdrawc(const char *name,Int_t axis, Float_t cut,Float_t u0,Float_t v0,Float_t ul,Float_t vl)
270
271 //  NAME   Volume name
272 //  CAXIS  Axis value
273 //  CUTVAL Cut plane distance from the origin along the axis
274 //  +
275 //  U0     U-coord. (horizontal) of volume origin
276 //  V0     V-coord. (vertical) of volume origin
277 //  SU     Scale factor for U-coord.
278 //  SV     Scale factor for V-coord.
279 //     see TGeant3::Gdrawc for more details
280 //
281  
282    TGeant3 *geant3=(TGeant3*)AliMC::GetMC();
283    geant3->Gdrawc(name,axis,cut,u0,v0,ul,vl);
284 }
285
286  
287 //___________________________________________ 
288 void THIGZ::Gdspec(const char *name)
289
290 //  NAME   Volume name
291 //
292 //  Shows 3 views of the volume (two cut-views and a 3D view), together with
293 //  its geometrical specifications. The 3D drawing will
294 //  be performed according the current values of the options HIDE and
295 //  SHAD and according the current CVOL clipping parameters for that
296 //  volume.
297 //     see TGeant3::Gdspec for more details
298 //
299
300    TGeant3 *geant3=(TGeant3*)AliMC::GetMC();
301    geant3->Gdspec(name);
302 }
303
304  
305 //___________________________________________ 
306 void THIGZ::Gdtree(const char *name,Int_t levmax, Int_t isel)
307
308 //  NAME   Volume name
309 //  LEVMAX Depth level
310 //  ISELT  Options
311 //
312 //  This function draws the logical tree,
313 //  Each volume in the tree is represented by a TPaveTree object.
314 //  Double-clicking on a TPaveTree draws the specs of the corresponding volume.
315 //  Use TPaveTree pop-up menu to select:
316 //    - drawing specs
317 //    - drawing tree
318 //    - drawing tree of parent
319 //
320
321    TGeant3 *geant3=(TGeant3*)AliMC::GetMC();
322    geant3->Gdtree(name,levmax,isel);
323 }
324
325  
326 //______________________________________________________________________________
327 void THIGZ::SetBOMB(Float_t boom)
328 {
329 //  BOOM  : Exploding factor for volumes position 
330 // 
331 //  To 'explode' the detector. If BOOM is positive (values smaller
332 //  than 1. are suggested, but any value is possible)
333 //  all the volumes are shifted by a distance
334 //  proportional to BOOM along the direction between their centre
335 //  and the origin of the MARS; the volumes which are symmetric
336 //  with respect to this origin are simply not shown.
337 //  BOOM equal to 0 resets the normal mode.
338 //  A negative (greater than -1.) value of
339 //  BOOM will cause an 'implosion'; for even lower values of BOOM
340 //  the volumes' positions will be reflected respect to the origin.
341 //  This command can be useful to improve the 3D effect for very
342 //  complex detectors. The following commands will make explode the
343 //  detector:
344
345    TGeant3 *geant3=(TGeant3*)AliMC::GetMC();
346    geant3->SetBOMB(boom);
347 }
348
349 //_______________________________________________________________
350 extern "C" void type_of_call iacwk(Int_t &)
351 {
352 //   printf("iacwk called,wid=%d\n",wid);
353 }
354
355 //_______________________________________________________________
356 extern "C" void type_of_call iclrwk(Int_t &,Int_t &)
357 {
358 //   printf("iclrwk called\n");
359    higz->Clear();
360 }
361
362 //_______________________________________________________________
363 extern "C" void type_of_call iclwk(Int_t &,Int_t &)
364 {
365 //   printf("iclwk called\n");
366
367 }
368
369 //_______________________________________________________________
370 extern "C" void type_of_call idawk(Int_t &)
371 {
372 //   printf("idawk called\n");
373 }
374
375 //_______________________________________________________________
376 extern "C" void type_of_call ifa(Int_t &n,Float_t *x, Float_t *y)
377 {
378 //   printf("ifa called, n=%d, pname=%s, pid=%d, x1=%f, y1=%f,x2=%f, y2=%f, x3=%f, y3=%f\n",n,higz->fPname.Data(),higz->fPID,x[0],y[0],x[1],y[1],x[2],y[2]);
379    TGraph *gr = new TGraph(n,x,y);
380    gr->SetFillColor(higz->fFACI);
381    gr->Draw("f");
382 }
383
384 //_______________________________________________________________
385 extern "C" void type_of_call igbox(Float_t &x1,Float_t &x2,Float_t &y1,Float_t &y2)
386 {
387    printf("igbox called, x1=%f, y1=%f, x2=%f, y2=%f\n",x1,y1,x2,y2);
388    TBox *box = new TBox(x1,y1,x2,y2);
389    box->SetLineColor(higz->fPLCI);
390    box->SetFillColor(higz->fFACI);
391    box->SetFillStyle(higz->fFASI);
392    box->Draw();
393 }
394
395 //_______________________________________________________________
396 extern "C" void type_of_call ightor(Float_t &h,Float_t &l,Float_t &s,Float_t &r,Float_t &g,Float_t &b)
397 {
398 //   printf("ightor called\n");
399    TColor *col1 = gROOT->GetColor(1);
400    if (col1) col1->HLStoRGB(h,l,s,r,g,b);
401 }
402
403 //_______________________________________________________________
404 extern "C" void type_of_call igpave(Float_t &x1,Float_t &x2,Float_t &yy1,Float_t &yy2,Float_t &,Int_t &isbox,Int_t &isfram,const char *, const Int_t)
405 {
406    char text[5];
407    strncpy(text,(char*)&higz->fPID,4);
408    text[4] = 0;
409    Float_t y1 = yy1;
410    Float_t y2 = yy2;
411    if (y1 > y2) { y1 = yy2; y2 = yy1;}
412    Float_t y = 0.5*(y1+y2);
413    Float_t dymax = 0.06*(higz->GetY2()-higz->GetY1());
414    Float_t dymin = -higz->PixeltoY(12);
415    if (y2-y1 > dymax) {
416       y1 = y - 0.5*dymax;
417       y2 = y + 0.5*dymax;
418    }
419    if (y2-y1 < dymin) {
420       y1 = y - 0.5*dymin;
421       y2 = y + 0.5*dymin;
422    }
423    TPaveTree *pt = new TPaveTree(x1,y1,x2,y2,text);
424    pt->SetTextColor(5);
425    pt->SetFillColor(isbox%1000);
426    pt->SetLineColor(isfram%1000);
427    pt->Draw();
428 //   printf("igpave called, text=%s, Pname=%s, x1=%f, y1=%f, x2=%f, y2=%f, isbox=%d, isfram=%d\n",text,higz->fPname.Data(),x1,y1,x2,y2,isbox,isfram);
429 }
430
431 //_______________________________________________________________
432 #ifndef WIN32
433 extern "C" void type_of_call igpid(Int_t &,const char *name,Int_t &pid,const char *, const Int_t l1, const Int_t)
434 #else
435 extern "C" void type_of_call igpid(Int_t &,const char *name,const Int_t l1, Int_t &pid,const char *, const Int_t)
436 #endif
437 {
438    npid++;
439 //   if(npid&100 == 0) printf("igpid called, npid=%d\n",npid);
440    strncpy(cpar,name,l1); cpar[l1] = 0;
441    higz->fPname = cpar;
442    higz->fPID = pid;
443       
444 //   char text[5];
445 //   strncpy(text,(char*)&higz->fPID,4);
446 //   text[4] = 0;
447 //   printf("igpid called, level=%d, name=%s, pid=%d, cpid=%s\n",level,cpar,pid,text);
448 }
449
450 //_______________________________________________________________
451 #ifndef WIN32
452 extern "C" void type_of_call igq(const char *name,Float_t &rval, const Int_t l1)
453 #else
454 extern "C" void type_of_call igq(const char *name,const Int_t l1, Float_t &rval)
455 #endif
456 {
457    strncpy(cpar,name,l1); cpar[l1] = 0;
458 //   printf("igq called, name=%s\n",cpar);
459    rval = higz->Get(cpar);
460 }
461
462 //_______________________________________________________________
463 extern "C" void type_of_call igrng(Float_t &xsize,Float_t &ysize)
464 {
465 //   printf("igrng called, xsize=%f, ysize=%f\n",xsize,ysize);
466    higz->Range(0,0,xsize,ysize);
467 }
468
469 //_______________________________________________________________
470 extern "C" void type_of_call igsa(Int_t &)
471 {
472 //   printf("igsa called, iwk=%d\n",iwk);
473 }
474
475 //_______________________________________________________________
476 #ifndef WIN32
477 extern "C" void type_of_call igset(const char *name,Float_t &rval, const Int_t l1)
478 #else
479 extern "C" void type_of_call igset(const char *name, const Int_t l1,Float_t &rval)
480 #endif
481 {
482    strncpy(cpar,name,l1); cpar[l1] = 0;
483 //   printf("igset called, name=%s, rval=%f\n",cpar,rval);
484    higz->Set(cpar,rval);
485 }
486
487 //_______________________________________________________________
488 extern "C" void type_of_call igterm()
489 {
490    printf("igterm called\n");
491 }
492
493 //_______________________________________________________________
494 extern "C" void type_of_call iopwk(Int_t &iwkid,Int_t &iconid,Int_t &iwtypi)
495 {
496    printf("iopwk called, iwkid=%d, iconid=%d, iwtypi=%d\n",iwkid,iconid,iwtypi);
497 }
498
499 //_______________________________________________________________
500 extern "C" void type_of_call ipl(Int_t &n,Float_t *x,Float_t *y)
501 {
502 //   printf("ipl called, n=%d, x[0]=%f,y[0]=%f, x[1]=%f, y[1]=%f\n",n,x[0],y[0],x[1],y[1]);
503    if (n <= 2) {
504       TLine *l = new TLine(x[0],y[0],x[1],y[1]);
505       l->SetLineColor(higz->fPLCI);
506       l->SetLineStyle(higz->fLTYP);
507       l->SetLineWidth(Short_t(higz->fLWID));
508       l->Draw();
509    } else {
510       TPolyLine *pl = new TPolyLine(n,x,y);
511       pl->SetLineColor(higz->fPLCI);
512       pl->SetLineStyle(higz->fLTYP);
513       pl->SetLineWidth(Short_t(higz->fLWID));
514       pl->Draw();
515    }
516 }
517
518 //_______________________________________________________________
519 extern "C" void type_of_call ipm(Int_t &n,Float_t *x,Float_t *y)
520 {
521    printf("ipm called, n=%d\n",n);
522    TPolyMarker *pm = new TPolyMarker(n,x,y);
523    pm->SetMarkerColor(higz->fPMCI);
524    pm->SetMarkerStyle(higz->fMTYP);
525    pm->SetMarkerSize(higz->fMSCF);
526    pm->Draw();
527 }
528
529 //_______________________________________________________________
530 extern "C" void type_of_call irqlc(Int_t&, Int_t&, Int_t&, Int_t&, Float_t&, Float_t&)
531
532 {
533    printf("irqlc called\n");
534 }
535
536 //_______________________________________________________________
537 extern "C" void type_of_call iscr(Int_t &,Int_t &ici,Float_t &r,Float_t &g,Float_t &b)
538 {
539 //   printf("iscr called, ici=%d, r=%f, g=%f, b=%f\n",ici,r,g,b);
540    Int_t color = ici;
541 //   if (color > 10) color += 35;
542    TColor *col = gROOT->GetColor(color);
543    if (!col) {
544       col = new TColor(color,r,g,b);
545       return;
546    } else {
547       col->SetRGB(r,g,b);
548    }
549 }
550
551 //_______________________________________________________________
552 extern "C" void type_of_call isfaci(Int_t &col)
553 {
554 //   printf("isfaci called, col=%d\n",col);
555    Int_t color = col%1000;
556 //   if (color > 10) color += 35;
557    higz->fFACI = color;
558 }
559
560 //_______________________________________________________________
561 extern "C" void type_of_call isfais(Int_t &is)
562 {
563 //   printf("isfais called, is=%d\n",is);
564    higz->fFAIS = is;
565 }
566
567 //_______________________________________________________________
568 extern "C" void type_of_call isln(Int_t &ln)
569 {
570 //   printf("isln called, ln=%d\n",ln);
571    higz->fLTYP = ln;
572 }
573
574 //_______________________________________________________________
575 extern "C" void type_of_call ismk(Int_t &mk)
576 {
577 //   printf("ismk called, mk=%d\n",mk);
578    higz->fMTYP = mk;
579 }
580
581 //_______________________________________________________________
582 extern "C" void type_of_call islwsc(Float_t &wl)
583 {
584 //   printf("islwsc called, wl=%f\n",wl);
585    higz->fLWID = wl;
586 }
587
588 //_______________________________________________________________
589 extern "C" void type_of_call isplci(Int_t &col)
590 {
591 //   printf("isplci called, col=%d\n",col);
592    Int_t color = col%1000;
593 //   if (color > 10) color += 35;
594    higz->fPLCI = color;
595 }
596
597 //_______________________________________________________________
598 extern "C" void type_of_call ispmci(Int_t &col)
599 {
600 //   printf("ispmci called, col=%d\n",col);
601    Int_t color = col%1000;
602 //   if (color > 10) color += 35;
603    higz->fPMCI = color;
604 }
605
606 //_______________________________________________________________
607 extern "C" void type_of_call istxci(Int_t &col)
608 {
609 //   printf("istxci called, col=%d\n",col);
610    Int_t color = col%1000;
611 //   if (color > 10) color += 35;
612    higz->fTXCI = color;
613 }
614
615 //_______________________________________________________________
616 extern "C" void type_of_call isvp(Int_t &,Float_t &,Float_t &,Float_t &,Float_t &)
617 {
618 //   printf("isvp called, nt=%d, x1=%f, y1=%f, x2=%f, y2=%f\n",nt,x1,y1,x2,y2);
619 }
620
621 //_______________________________________________________________
622 extern "C" void type_of_call iswn(Int_t &,Float_t &x1,Float_t &x2,Float_t &y1,Float_t &y2)
623
624 {
625 //   printf("iswn called, nt=%d, x1=%f, y1=%f, x2=%f, y2=%f\n",nt,x1,y1,x2,y2);
626    higz->Range(x1,y1,x2,y2);
627 }
628
629 //_______________________________________________________________
630 extern "C" void type_of_call itx(Float_t &x,Float_t &y,const char *ptext, const Int_t l1p)
631 {
632    if (higz->fPname == "Tree") return;
633    Int_t l1=l1p;
634    strncpy(cpar,ptext,l1); cpar[l1] = 0;
635 //printf("itx called, x=%f, y=%f, text=%s, l1=%d\n",x,y,cpar,l1);
636    while(l1) {
637       if (cpar[l1-1] != ' ' && cpar[l1-1] != '$') break;
638       l1--;
639       cpar[l1] = 0;
640    }
641    char *small = strstr(cpar,"<");
642    while(small && *small) {
643       small[0] = tolower(small[1]);
644       small++;
645    }
646    TText *text = new TText(x,y,cpar);
647    text->SetTextColor(higz->fTXCI);
648    text->SetTextSize(higz->fCHHE);
649    text->SetTextFont(higz->fTXFP);
650    text->SetTextAlign(higz->fTXAL);
651    text->SetTextAngle(higz->fTANG);
652    text->Draw();   
653 }
654
655 //_______________________________________________________________
656 extern "C" void type_of_call hplint(Int_t &)
657 {
658    printf("hplint called\n");
659    new THIGZ(600);
660 }
661
662 //_______________________________________________________________
663 extern "C" void type_of_call hplend()
664 {
665    printf("hplend called\n");
666 }
667
668 //_______________________________________________________________
669 extern "C" void type_of_call hplfra(Float_t &x1,Float_t &x2,Float_t &y1, Float_t &y2,const char *, const Int_t)
670 {
671 //   printf("hplfra called, x1=%f, y1=%f, x2=%f, y2=%f\n",x1,y1,x2,y2);
672    higz->Clear();
673    higz->Range(x1,y1,x2,y2);
674 }
675
676 //_______________________________________________________________
677 extern "C" void type_of_call igmeta(Int_t &, Int_t &)
678 {
679    printf("igmeta called\n");
680 }
681
682 //_______________________________________________________________
683 extern "C" void type_of_call iselnt(Int_t &)
684 {
685 //   printf("iselnt called, nt=%d\n",nt);
686 }
687
688 //_______________________________________________________________
689 extern "C" Int_t type_of_call igiwty(Int_t &)
690 {
691 //   printf("igiwty called, wid=%d\n",wid);
692    return 1;
693 }
694
695 //_______________________________________________________________
696 extern "C" void type_of_call igqwk(Int_t &, const char *name, Float_t &rval, const Int_t l1)
697 {
698    strncpy(cpar,name,l1); cpar[l1] = 0;
699 //   printf("igqwk called, wid=%d, pname=%s\n",wid,cpar);
700    rval = higz->Get(cpar);
701 }
702