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