]> git.uio.no Git - u/mrichter/AliRoot.git/blame - GEODB/AliGEODB.cxx
Cosmetics
[u/mrichter/AliRoot.git] / GEODB / AliGEODB.cxx
CommitLineData
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$
65fb704d 18Revision 1.3 1999/11/03 13:17:05 fca
19Have ProdProcess return const char*
20
6a935c13 21Revision 1.2 1999/09/29 09:24:19 fca
22Introduction of the Copyright and cvs Log
23
4c039060 24*/
25
ab2f6604 26//////////////////////////////////////////////////////
27// C++ dummy interface to Geant3 basic routines //
28//////////////////////////////////////////////////////
29
30#include <iostream.h>
31#include <TBrowser.h>
32#include <TCanvas.h>
33#include "AliGEODB.h"
34#include "AliGNode.h"
35#include "AliGShape.h"
36#include "AliGMaterial.h"
37#include "AliGTransform.h"
38#include "AliGTube.h"
39#include "AliGBox.h"
40#include "AliGTRD1.h"
41#include "AliGPCone.h"
42#include "AliGeometry.h"
43
44//---------------------------------------------------------
45
46#define MAXMAT 1000
47
48struct Mater{
49 char* fName;
50 Float_t fA;
51 Float_t fZ;
52 Float_t fDens;
53 Float_t fRadl;
54 Float_t fAbsl;
55 Float_t* fBuf;
56 Int_t fNwbuf;
57};
58
59Mater* AliMaterials[MAXMAT]; // Array of Mater structs containing the AliMaterial parameters.
60
61struct Med{
62 char* fName;
63 Int_t fNmat;
64 Int_t fIsvol;
65 Int_t fIfield;
66 Float_t fFieldm;
67 Float_t fTmaxfd;
68 Float_t fStemax;
69 Float_t fDeemax;
70 Float_t fEpsil;
71 Float_t fStmin;
72 Float_t* fUbuf;
73 Int_t fNbuf;
74};
75
76Med* AliMediums[MAXMAT]; // Array of Med structs containing the AliMedium parameters.
77
78struct NodePosp{
79 char* name;
80 char* shape;
81 Int_t nmed;
82};
83
84NodePosp* Posp[MAXMAT];
85
86AliGMaterial* Mat[MAXMAT]; // List of Pointers to my AliGMaterials created
87
88Int_t MateCount = 0;
89Int_t MedCount = 0;
90Int_t MatrCount = 0;
91Int_t PospCount = 0;
92Int_t Color = 2;
93
94TList* listNodes = new TList(); // List of Nodes
95TList* listTransf = new TList();
96TList* listShapes = new TList();
97TList* listMaterials = new TList();
98
99AliGNode* TopNode = NULL;
100
101/***********************************************************************/
102
103ClassImp(AliGEODB)
104
105/***********************************************************************/
106
107AliGEODB::AliGEODB(const char *title, Int_t) : AliMC("AliGEODB",title)
108{
109 //cout << " AliGEODB" << endl;
110}
111
112/***********************************************************************/
113
114void AliGEODB::DefaultRange()
115{
116 cout << " DefaultRange" << endl;
117}
118
119//=======================functions from GBASE
120
121/***********************************************************************/
122
123void AliGEODB::Gfile(const char*, const char*)
124{
125 cout << " Gfile" << endl;
126}
127
128/***********************************************************************/
129
130void AliGEODB::GeomIter()
131{
132 cout << " GeomIter" << endl;
133}
134
135/***********************************************************************/
136
137Int_t AliGEODB::CurrentMaterial(Float_t &, Float_t &, Float_t &, Float_t &, Float_t &) const
138{
139 cout << " CurrentMaterial" << endl;
140 return 0;
141}
142
143/***********************************************************************/
144
145Int_t AliGEODB::NextVolUp(Text_t*, Int_t&)
146{
147 cout << " NextVolUp" << endl;
148 return 0;
149}
150
151/***********************************************************************/
152
153Int_t AliGEODB::CurrentVol(Text_t*, Int_t&) const
154{
155 cout << " CurrentVol" << endl;
156 return 0;
157}
158
159/***********************************************************************/
160
161Int_t AliGEODB::NofVolumes() const
162{
163 cout << " NofVolumes" << endl;
164 return 0;
165}
166
167/***********************************************************************/
168
169Int_t AliGEODB::CurrentVolOff(Int_t, Text_t*, Int_t&) const
170{
171 cout << " CurrentVolOff" << endl;
172 return 0;
173}
174
175/***********************************************************************/
176
177void AliGEODB::TrackPosition(Float_t*) const
178{
179 cout << " TrackPosition" << endl;
180}
181
182/***********************************************************************/
183
184void AliGEODB::TrackMomentum(Float_t*) const
185{
186 cout << " TrackMomentum" << endl;
187}
188
189/***********************************************************************/
190
191Int_t AliGEODB::VolId( Text_t* name ) const
192{
193 cout << " VolId" << endl;
194 return 0;
195}
196
197/***********************************************************************/
198
199const char* AliGEODB::VolName(Int_t ) const
200{
201 cout << " VolName" << endl;
202 return 0;
203}
204
205/***********************************************************************/
206
207Float_t AliGEODB::TrackCharge() const
208{
209 cout << " TrackCharge" << endl;
210 return 0;
211}
212
213/***********************************************************************/
214
215Float_t AliGEODB::TrackMass() const
216{
217 cout << " TrackMass" << endl;
218 return 0;
219}
220
221/***********************************************************************/
222
223Bool_t AliGEODB::TrackInside() const
224{
225 cout << " TrackInside" << endl;
226 return 0;
227}
228
229/***********************************************************************/
230
231Bool_t AliGEODB::TrackEntering() const
232{
233 cout << " TrackEntering" << endl;
234 return 0;
235}
236
237/***********************************************************************/
238
239Bool_t AliGEODB::TrackExiting() const
240{
241 cout << " TrackExiting" << endl;
242 return 0;
243}
244
245/***********************************************************************/
246
247Bool_t AliGEODB::TrackOut() const
248{
249 cout << " TrackOut" << endl;
250 return 0;
251}
252
253/***********************************************************************/
254
255Bool_t AliGEODB::TrackDisappear() const
256{
257 cout << " TrackDisappear" << endl;
258 return 0;
259}
260
261/***********************************************************************/
262
263Bool_t AliGEODB::TrackStop() const
264{
265 cout << " TrackStop" << endl;
266 return 0;
267}
268
269/***********************************************************************/
270
271Int_t AliGEODB::NSecondaries() const
272{
273 cout << " NSecondaries" << endl;
274 return 0;
275}
276
277/***********************************************************************/
278
65fb704d 279AliMCProcess AliGEODB::ProdProcess() const
ab2f6604 280{
281 cout << " ProdProcess" << endl;
6a935c13 282 return 0;
ab2f6604 283}
284
285/***********************************************************************/
286
287void AliGEODB::GetSecondary(Int_t, Int_t&, Float_t*, Float_t*)
288{
289 cout << " GetSecondary" << endl;
290}
291
292/***********************************************************************/
293
294Float_t AliGEODB::MaxStep() const
295{
296 cout << " MaxStep" << endl;
297 return 0;
298}
299
300/***********************************************************************/
301
302void AliGEODB::SetMaxStep(Float_t )
303{
304 cout << " SetMaxStep" << endl;
305}
306
307/***********************************************************************/
308
309void AliGEODB::GetParticle(const Int_t, char*, Float_t&) const
310{
311 cout << " GetParticle" << endl;
312}
313
314/***********************************************************************/
315
316Int_t AliGEODB::CurrentEvent() const
317{
318 cout << " CurrentEvent" << endl;
319 return 0;
320}
321
322/***********************************************************************/
323
324Int_t AliGEODB::GetMedium() const
325{
326 cout << " GetMedium" << endl;
327 return 0;
328}
329
330/***********************************************************************/
331
332Float_t AliGEODB::Edep() const
333{
334 cout << " Edep" << endl;
335 return 0;
336}
337
338/***********************************************************************/
339
340Float_t AliGEODB::Etot() const
341{
342 cout << " Etot" << endl;
343 return 0;
344}
345
346/***********************************************************************/
347
348void AliGEODB::Rndm(Float_t*, const Int_t) const
349{
350 cout << " Rndm" << endl;
351}
352
353/***********************************************************************/
354
355Float_t AliGEODB::TrackStep() const
356{
357 cout << " TrackStep" << endl;
358 return 0;
359}
360
361/***********************************************************************/
362
363Float_t AliGEODB::TrackLength() const
364{
365 cout << " TrackLength" << endl;
366 return 0;
367}
368
369/***********************************************************************/
370
371Float_t AliGEODB::TrackTime() const
372{
373 cout << " TrackTime" << endl;
374 return 0;
375}
376
377/***********************************************************************/
378
379Int_t AliGEODB::TrackPid() const
380{
381 cout << " TrackPid" << endl;
382 return 0;
383}
384
385/***********************************************************************/
386
387Bool_t AliGEODB::TrackAlive() const
388{
389 cout << " TrackAlive" << endl;
390 return 0;
391}
392
393/***********************************************************************/
394
395void AliGEODB::StopTrack()
396{
397 cout << " StopTrack" << endl;
398}
399
400/***********************************************************************/
401
402void AliGEODB::StopEvent()
403{
404 cout << " StopEvent" << endl;
405}
406
407/***********************************************************************/
408
409void AliGEODB::SetMaxNStep(Int_t)
410{
411 cout << " SetMaxNStep" << endl;
412}
413
414/***********************************************************************/
415
416void AliGEODB::SetColors()
417{
418 cout << " SetColors" << endl;
419}
420
421/***********************************************************************/
422
423Int_t AliGEODB::GetMaxNStep() const
424{
425 cout << " GetMaxNStep" << endl;
426 return 0;
427}
428
429/***********************************************************************/
430
431void AliGEODB::Material( Int_t& kmat, const char* name, Float_t a, Float_t z, Float_t dens, Float_t radl, Float_t absl,Float_t* buf, Int_t nwbuf )
432{
433 if( MateCount >= MAXMAT ) {
434 printf( " ERROR: Material number: %d bigger that MAXMAT: %d => Out of array\n", MateCount, MAXMAT );
435 exit(0);
436 }
437
438 Mater* AliMat = new Mater;
439 char* fname = new char[strlen(name)+1];
440 Float_t* fbuf = new Float_t[nwbuf];
441
442 strcpy( fname, name );
443 fname[strlen(name)] = '\x0';
444
445 AliMat->fName = fname;
446 AliMat->fA = a;
447 AliMat->fZ = z;
448 AliMat->fDens = dens;
449 AliMat->fRadl = radl;
450 AliMat->fAbsl = absl;
451 AliMat->fNwbuf = nwbuf;
452
453 for( int i=0; i<nwbuf; i++ )
454 fbuf[i] = buf[i];
455
456 AliMat->fBuf = fbuf;
457
458 AliMaterials[MateCount] = AliMat;
459
460 kmat = MateCount++;
461}
462
463/***********************************************************************/
464
465void AliGEODB::Mixture( Int_t& imat, const char* name, Float_t* a, Float_t* z, Float_t dens, Int_t nlmat, Float_t* wmat )
466{
467 if( MateCount >= MAXMAT ) {
468 printf( " ERROR: Mixture number: %d bigger that MAXMAT: %d => Out of array\n", MateCount, MAXMAT );
469 exit(0);
470 }
471
472 Mater* AliMat = new Mater;
473 char* fname = new char[strlen(name)+1];
474
475 strcpy( fname, name );
476 fname[strlen(name)] = '\x0';
477
478 AliMat->fName = fname;
479 Float_t MidA = 0.;
480 Float_t MidZ = 0.;
481 Float_t SUMwmat = 0.;
482
483 for( int i=0; i<nlmat; i++ ) {
484 MidA += wmat[i]*a[i];
485 MidZ += wmat[i]*z[i];
486 SUMwmat += wmat[i];
487 }
488
489 MidA = MidA/SUMwmat;
490 MidZ = MidZ/SUMwmat;
491
492 AliMat->fA = MidA;
493 AliMat->fZ = MidZ;
494 AliMat->fDens = dens;
495 AliMat->fRadl = 0.;
496 AliMat->fAbsl = 0.;
497 AliMat->fNwbuf = 0;
498
499 AliMat->fBuf = NULL;
500
501 AliMaterials[MateCount] = AliMat;
502
503 imat = MateCount++;
504}
505
506/***********************************************************************/
507
508void AliGEODB::Medium( Int_t& numed, const char* name, Int_t nmat, Int_t isvol, Int_t ifield, Float_t fieldm, Float_t tmaxfd, Float_t stemax, Float_t deemax, Float_t epsil, Float_t stmin, Float_t* ubuf, Int_t nbuf )
509{
510 if( MedCount >= MAXMAT ) {
511 printf( " ERROR: Medium number: %d bigger that MAXMAT: %d => Out of array\n", MedCount, MAXMAT );
512 exit(0);
513 }
514
515 Med* AliMed = new Med;
516 char* fname = new char[strlen(name)+1];
517 Float_t* fUbuf = new Float_t[nbuf];
518
519 strcpy( fname, name );
520 fname[strlen(name)] = '\x0';
521
522 AliMed->fName = fname;
523 AliMed->fNmat = nmat;
524 AliMed->fIsvol = isvol;
525 AliMed->fIfield = ifield;
526 AliMed->fFieldm = fieldm;
527 AliMed->fTmaxfd = tmaxfd;
528 AliMed->fStemax = stemax;
529 AliMed->fDeemax = deemax;
530 AliMed->fEpsil = epsil;
531 AliMed->fStmin = stmin;
532 AliMed->fNbuf = nbuf;
533
534 for( int i=0; i<nbuf; i++ )
535 fUbuf[i] = ubuf[i];
536
537 AliMed->fUbuf = fUbuf;
538
539 AliMediums[MedCount] = AliMed;
540
541 numed = MedCount++;
542}
543
544/***********************************************************************/
545
546void AliGEODB::Matrix( Int_t &nmate , Float_t theta1, Float_t phi1, Float_t theta2, Float_t phi2, Float_t theta3, Float_t phi3 )
547{
548 char* transname = new char[10];
549 sprintf(transname, "%s%d", "tra", MatrCount);
550
551 AliGTransform* tra = new AliGTransform( transname, transname, theta1, phi1, theta2, phi2, theta3, phi3 );
552
553 //printf( " Created new AliGTransform( %s, %s, %f, %f, %f, %f, %f, %f );\n", transname, transname, theta1, phi1, theta2, phi2, theta3, phi3 );
554
555 listTransf->AddAt( tra, MatrCount );
556
557 nmate = ++MatrCount;
558
559}
560
561/***********************************************************************/
562
563void AliGEODB::WriteEuclid(const char*, const char*, Int_t, Int_t)
564{
565 cout << " WriteEuclid" << endl;
566}
567
568/***********************************************************************/
569
570void AliGEODB::Gpcxyz()
571{
572 cout << " Gpcxyz " << endl;
573}
574
575/***********************************************************************/
576
577void AliGEODB::Ggclos()
578{
579
580 for( int i=0; i<listNodes->GetSize(); i++ ) {
581 AliGNode* node = (AliGNode*) listNodes->At(i);
582 char* name = new char[strlen(node->GetName())+1];
583 strcpy(name, node->GetName());
584 name[strlen(node->GetName())] = '\x0';
585 node->AddConfig(name, name,"detail",981201,991201);
586 }
587
588 printf( " Total number of nodes = %d\n", listNodes->GetSize() );
589
590 SetVisibility( "TPC_1", 1 );
591 SetVisibility( "TGAS_1", 1 );
592 SetVisibility( "TPSG_1", 1 );
593 SetVisibility( "TPHV_1", 1 );
594 SetVisibility( "TRCS_1", 1 );
595 SetVisibility( "TSGA_1", 1 );
596 SetVisibility( "TRCL_1", 1 );
597 SetVisibility( "TLGA_1", 1 );
598 SetVisibility( "TSST_1", 1 );
599 SetVisibility( "TSST_2", 1 );
600 SetVisibility( "TSST_3", 1 );
601 SetVisibility( "TSST_4", 1 );
602 SetVisibility( "TSST_5", 1 );
603 SetVisibility( "TSST_6", 1 );
604 SetVisibility( "TSST_7", 1 );
605 SetVisibility( "TSST_8", 1 );
606 SetVisibility( "TSST_9", 1 );
607 SetVisibility( "TSST_10", 1 );
608 SetVisibility( "TSST_11", 1 );
609 SetVisibility( "TSST_12", 1 );
610 SetVisibility( "TSST_13", 1 );
611 SetVisibility( "TSST_14", 1 );
612 SetVisibility( "TSST_15", 1 );
613 SetVisibility( "TSST_16", 1 );
614 SetVisibility( "TSST_17", 1 );
615 SetVisibility( "TSST_18", 1 );
616 SetVisibility( "TSST_19", 1 );
617 SetVisibility( "TSST_20", 1 );
618 SetVisibility( "TSST_21", 1 );
619 SetVisibility( "TSST_22", 1 );
620 SetVisibility( "TSST_23", 1 );
621 SetVisibility( "TLST_1", 1 );
622 SetVisibility( "TLST_2", 1 );
623 SetVisibility( "TLST_3", 1 );
624 SetVisibility( "TLST_4", 1 );
625 SetVisibility( "TLST_5", 1 );
626 SetVisibility( "TLST_6", 1 );
627 SetVisibility( "TLST_7", 1 );
628 SetVisibility( "TLST_8", 1 );
629 SetVisibility( "TLST_9", 1 );
630 SetVisibility( "TLST_10", 1 );
631 SetVisibility( "TLST_11", 1 );
632 SetVisibility( "TLST_12", 1 );
633 SetVisibility( "TLST_13", 1 );
634 SetVisibility( "TLST_14", 1 );
635 SetVisibility( "TLST_15", 1 );
636 SetVisibility( "TLST_16", 1 );
637 SetVisibility( "TLST_17", 1 );
638 SetVisibility( "TLST_18", 1 );
639 SetVisibility( "TLST_19", 1 );
640 SetVisibility( "TLST_20", 1 );
641 SetVisibility( "TLST_21", 1 );
642 SetVisibility( "TLST_22", 1 );
643 SetVisibility( "TLST_23", 1 );
644 SetVisibility( "TLST_24", 1 );
645 SetVisibility( "TLST_25", 1 );
646 SetVisibility( "TLST_26", 1 );
647 SetVisibility( "TLST_27", 1 );
648 SetVisibility( "TLST_28", 1 );
649 SetVisibility( "TLST_29", 1 );
650 SetVisibility( "TLST_30", 1 );
651 SetVisibility( "TLST_31", 1 );
652 SetVisibility( "TLST_32", 1 );
653 SetVisibility( "TLST_33", 1 );
654 SetVisibility( "TLST_34", 1 );
655 SetVisibility( "TLST_35", 1 );
656 SetVisibility( "TLST_36", 1 );
657 SetVisibility( "TLST_37", 1 );
658 SetVisibility( "TLST_38", 1 );
659 SetVisibility( "TLST_39", 1 );
660 SetVisibility( "TLST_40", 1 );
661 SetVisibility( "TLST_41", 1 );
662 SetVisibility( "TLST_42", 1 );
663 SetVisibility( "TLST_43", 1 );
664 SetVisibility( "TLST_44", 1 );
665 SetVisibility( "TLST_45", 1 );
666 SetVisibility( "TLST_46", 1 );
667 SetVisibility( "TLST_47", 1 );
668 SetVisibility( "TLST_48", 1 );
669 SetVisibility( "TLST_49", 1 );
670 SetVisibility( "TLST_50", 1 );
671 SetVisibility( "TLST_51", 1 );
672 SetVisibility( "TLST_52", 1 );
673 SetVisibility( "TSWS_1", 1 );
674 SetVisibility( "TSWS_2", 1 );
675 SetVisibility( "TSWS_3", 1 );
676 SetVisibility( "TPW1_1", 1 );
677 SetVisibility( "TPW2_1", 1 );
678 SetVisibility( "TPW3_1", 1 );
679 SetVisibility( "TPW4_1", 1 );
680 SetVisibility( "TSPI_1", 1 );
681 SetVisibility( "TSP1_1", 1 );
682 SetVisibility( "TSPO_1", 1 );
683 SetVisibility( "TSP2_1", 1 );
684 SetVisibility( "TSWH_1", 1 );
685 SetVisibility( "TSW1_1", 1 );
686 SetVisibility( "TCOV_1", 1 );
687 SetVisibility( "TPOI_1", 1 );
688 SetVisibility( "TSWS_4", 1 );
689 SetVisibility( "TSWS_5", 1 );
690 SetVisibility( "TSWS_6", 1 );
691 SetVisibility( "TSWS_7", 1 );
692 SetVisibility( "TSWS_8", 1 );
693 SetVisibility( "TSWS_9", 1 );
694 SetVisibility( "TSWS_10", 1 );
695 SetVisibility( "TSWS_11", 1 );
696 SetVisibility( "TSWS_12", 1 );
697 SetVisibility( "TSWS_13", 1 );
698 SetVisibility( "TPIV_1", 1 );
699 SetVisibility( "TPVD_1", 1 );
700
701 printf( " Visibilities activated \n" );
702
703 AliGeometry* Geom1 = new AliGeometry( "Geom1", "Geom1", TopNode, 0 );
704
705 TCanvas* c1 = new TCanvas( "TPC", "Geometry Shapes", 100, 100, 750, 750 );
706 c1->Range(0,0,1,1);
707 c1->SetFillColor(32); // Light Green
708 c1->SetBorderSize(3);
709 c1->SetBorderMode(0); // -1 (down) 0 (no) 1 (up)
710
711 TopNode->Draw("same");
712
713 TFile* file1 = new TFile( "GeoDB.root", "RECREATE" );
714 cout << endl << " Storing GeoDB.root file. Please, be patient... :-)" << endl;
715 TopNode->SaveAll(file1);
716
717 file1->cd();
718
719 if( Geom1 ) {
720 Geom1->Write();
721 cout << " Geometry saved in disk " << endl;
722 }
723
724 file1->Write();
725 file1->Close();
726
727 TFile* file2 = new TFile( "GeoDB.root", "READ" );
728 file2->cd();
729 AliGeometry* Geom2 = new AliGeometry( (AliGeometry*) file2->Get("Geom1") );
730
731 // Retrieve the memory tree structure from AliGeoDB.root and stores it in memory, being tree_root the top node
732 AliGNode* tree_root = new AliGNode( Geom2->FileToMemTree( file2 ) );
733 //AliGNode* tree_root = new AliGNode( Geom2->FileToMemTree( "GeoDB.root", "Geom1" ) );
734
735 TFile* file3 = new TFile( "GeoDB2.root", "RECREATE" );
736 cout << " Storing GeoDB2.root file. Please, be patient again... :-)" << endl;
737 tree_root->SaveAll( file3 ); // Memory tree structure saved in disk (second time)
738
739 file3->cd();
740
741 if( Geom2 ) {
742 Geom2->Write();
743 cout << " Geometry saved in disk " << endl;
744 }
745
746 file3->Write();
747 file3->Close();
748
749 file2->Close();
750
751 cout << " The two databases are stored in disk." << endl;
752
753 TFile* file4 = new TFile( "GeoDB.root" , "READ" );
754 TFile* file5 = new TFile( "GeoDB2.root", "READ" );
755
756 TBrowser* a = new TBrowser();
757
758 //DrawTree( TopNode, 0 );
759}
760
761/***********************************************************************/
762
763void AliGEODB::SetVisibility(Text_t* name, Int_t val)
764{
765 AliGNode* node = (AliGNode*) listNodes->FindObject( name );
766
767 if( node )
768 node->SetVis(val);
769 else
770 printf( " ERROR!!! I couldn't find the node %s in the listNodes.\n", name );
771}
772
773/***********************************************************************/
774
775void AliGEODB::DrawTree( AliGNode* topnode, Int_t tabs )
776{
777
778 for( int i=0; topnode->GetNodeFromfNode(i); i++ ) {
779 for( int j=0; j<tabs; j++ )
780 cout << " ";
781 cout << topnode->GetNodeFromfNode(i)->GetName() << endl;
782 tabs+=5;
783 DrawTree( topnode->GetNodeFromfNode(i), tabs );
784 tabs-=5;
785 }
786
787}
788
789/***********************************************************************/
790
791void AliGEODB::Glast()
792{
793 cout << " Glast " << endl;
794}
795
796/***********************************************************************/
797
798void AliGEODB::Gprint(const char*)
799{
800 cout << " Gprint " << endl;
801}
802
803/***********************************************************************/
804
805void AliGEODB::Grun()
806{
807 cout << " Grun " << endl;
808}
809
810/***********************************************************************/
811
812void AliGEODB::Gtrig()
813{
814 cout << " Gtrig " << endl;
815}
816
817/***********************************************************************/
818
819void AliGEODB::Gtrigc()
820{
821 cout << " Gtrigc " << endl;
822}
823
824/***********************************************************************/
825
826void AliGEODB::Gtrigi()
827{
828 cout << " Gtrigi " << endl;
829}
830
831/***********************************************************************/
832
833void AliGEODB::Gwork(Int_t)
834{
835 cout << " Gwork " << endl;
836}
837
838/***********************************************************************/
839
840void AliGEODB::Gzinit()
841{
842 cout << " Gzinit " << endl;
843}
844
845//=======================functions from GCONS
846
847/***********************************************************************/
848
849void AliGEODB::Gfmate(Int_t, char*, Float_t&, Float_t&, Float_t&, Float_t&, Float_t&, Float_t*, Int_t&)
850{
851 cout << " Gfmate " << endl;
852}
853
854/***********************************************************************/
855
856void AliGEODB::Gfpart(Int_t, char*, Int_t&, Float_t&, Float_t&, Float_t&)
857{
858 cout << " Gfpart " << endl;
859}
860
861/***********************************************************************/
862
863void AliGEODB::Gftmed(Int_t, char*, Int_t&, Int_t&, Int_t&, Float_t&, Float_t&,Float_t&, Float_t&, Float_t&, Float_t&, Float_t*, Int_t*)
864{
865 cout << " Gftmed " << endl;
866}
867
868/***********************************************************************/
869
870void AliGEODB::Gmate() {
871 cout << " Gmate " << endl;
872}
873
874/***********************************************************************/
875
876void AliGEODB::Gpart()
877{
878 AliGTransform* Identity = new AliGTransform("Identity","Identity","rot 0. 0. 0.");
879 //printf( " Created new AliGTransform( Identity, Identity, rot 0. 0. 0. );\n" );
880
881 listTransf->AddAt( Identity, MatrCount );
882 MatrCount++;
883
884 AliGBox* box = new AliGBox("box","box", 400,400,400);
885 AliGNode* ALIC = new AliGNode( "ALIC", 1,"ALIC", box);
886 TopNode = ALIC;
887
888 listNodes->Add(ALIC);
889}
890
891/***********************************************************************/
892
893void AliGEODB::Gsdk(Int_t, Float_t*, Int_t*) {
894 cout << " Gsdk " << endl;
895}
896
897/***********************************************************************/
898
899void AliGEODB::Gsmate(Int_t, const char*, Float_t, Float_t, Float_t, Float_t, Float_t) {
900 cout << " Gsmate " << endl;
901}
902
903/***********************************************************************/
904
905void AliGEODB::Gsmixt(Int_t, const char*, Float_t*, Float_t*, Float_t, Int_t, Float_t*) {
906 cout << " Gsmixt " << endl;
907}
908
909/***********************************************************************/
910
911void AliGEODB::Gspart(Int_t, const char*, Int_t, Float_t, Float_t, Float_t) {
912 cout << " Gspart " << endl;
913}
914
915/***********************************************************************/
916
917void AliGEODB::Gstmed(Int_t, const char*, Int_t, Int_t, Int_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t) {
918 cout << " Gstmed " << endl;
919}
920
921/***********************************************************************/
922
923void AliGEODB::Gstpar(Int_t, const char*, Float_t)
924{
925 //cout << " Gstpar " << endl;
926}
927
928/***********************************************************************/
929
930void AliGEODB::Gsckov(Int_t, Int_t, Float_t *, Float_t *, Float_t *, Float_t *)
931{
932 cout << " Gsclov " << endl;
933}
934
935/***********************************************************************/
936
937//=======================functions from GKINE
938
939void AliGEODB::Gfkine(Int_t, Float_t*, Float_t*, Int_t&, Int_t&)
940{
941 cout << " Gfkine" << endl;
942}
943
944/***********************************************************************/
945
946void AliGEODB::Gfvert(Int_t, Float_t*, Int_t&, Int_t&, Float_t&)
947{
948 cout << " Gfvert" << endl;
949}
950
951/***********************************************************************/
952
953Int_t AliGEODB::Gskine(Float_t*, Int_t, Int_t, Float_t*, Int_t)
954{
955 cout << " Gskine" << endl;
956 return 0;
957}
958
959/***********************************************************************/
960
961Int_t AliGEODB::Gsvert(Float_t*, Int_t, Int_t, Float_t*, Int_t)
962{
963 cout << " Gsvert" << endl;
964 return 0;
965}
966
967/***********************************************************************/
968
969//=======================functions from GPHYS
970
971void AliGEODB::Gphysi()
972{
973 cout << " Gphysi" << endl;
974}
975
976/***********************************************************************/
977
978//=======================functions from GTRAK
979
980void AliGEODB::Gdebug()
981{
982 cout << " Gdebug" << endl;
983}
984
985/***********************************************************************/
986
987void AliGEODB::Gekbin()
988{
989 cout << " Gekbin" << endl;
990}
991
992/***********************************************************************/
993
994void AliGEODB::Gfinds()
995{
996 cout << " Gfinds" << endl;
997}
998
999/***********************************************************************/
1000
1001void AliGEODB::Gsking(Int_t)
1002{
1003 cout << " Gsking" << endl;
1004}
1005
1006/***********************************************************************/
1007
1008void AliGEODB::Gskpho(Int_t)
1009{
1010 cout << " Gskpho" << endl;
1011}
1012
1013/***********************************************************************/
1014
1015void AliGEODB::Gsstak(Int_t)
1016{
1017 cout << " Gsstak" << endl;
1018}
1019
1020/***********************************************************************/
1021
1022void AliGEODB::Gsxyz()
1023{
1024 cout << " Gsxyz" << endl;
1025}
1026
1027/***********************************************************************/
1028
1029void AliGEODB::Gtrack()
1030{
1031 cout << " Gtrack" << endl;
1032}
1033
1034/***********************************************************************/
1035
1036void AliGEODB::Gtreve()
1037{
1038 cout << " Gtreve" << endl;
1039}
1040
1041/***********************************************************************/
1042
1043void AliGEODB::Grndm(Float_t*, const Int_t) const
1044{
1045 cout << " Grndm" << endl;
1046}
1047
1048/***********************************************************************/
1049
1050void AliGEODB::Grndmq(Int_t&, Int_t&, const Int_t, const Text_t*)
1051{
1052 cout << " Grndmq" << endl;
1053}
1054
1055/***********************************************************************/
1056
1057//=======================functions from GDRAW
1058
1059void AliGEODB::Gdxyz(Int_t )
1060{
1061 cout << " Gdxyz" << endl;
1062}
1063
1064/***********************************************************************/
1065
1066void AliGEODB::Gdcxyz()
1067{
1068 cout << " Gdcxyz" << endl;
1069}
1070
1071/***********************************************************************/
1072
1073//=======================functions from GGEOM
1074
1075void AliGEODB::Gdtom(Float_t*, Float_t*, Int_t)
1076{
1077 printf( " Gdtom.\n" );
1078}
1079
1080/***********************************************************************/
1081
1082void AliGEODB::Glmoth(const char*, Int_t, Int_t&, Int_t*, Int_t*)
1083{
1084 printf( " Glmoth.\n" );
1085
1086}
1087
1088/***********************************************************************/
1089
1090void AliGEODB::Gmedia(Float_t*, Int_t&)
1091{
1092 printf( " Gmedia.\n" );
1093}
1094
1095/***********************************************************************/
1096
1097void AliGEODB::Gmtod(Float_t*, Float_t*, Int_t)
1098{
1099 printf( " Gmtod.\n" );
1100}
1101
1102/***********************************************************************/
1103
1104void AliGEODB::Gsdvn(const char* name, const char* parentname, Int_t ndiv, Int_t iaxis)
1105{
1106 cout << " Inside Gsdvn " << endl;
1107 /* Divides one node in Ndiv nodes in the iaxis direction*/
1108
1109 char* transfname = new char[10];
1110 char* nodename = new char[10];
1111
1112 AliGNode* parent = (AliGNode*) listNodes->FindObject(parentname);
1113
1114 /* Find the shape that will result from the division*/
1115
1116 /* BOX */
1117 if( parent->GetShape()->ClassName() == "AliGBox" ) {
1118 AliGMaterial* material = new AliGMaterial(parent->GetMaterial());
1119
1120 Float_t Dx, Dy, Dz;
1121
1122 switch (iaxis) {
1123 case 1 : Dx = ((AliGBox*)(parent->GetShape()))->GetX() / ndiv;
1124 Dy = ((AliGBox*)(parent->GetShape()))->GetY();
1125 Dz = ((AliGBox*)(parent->GetShape()))->GetZ();
1126 break;
1127
1128 case 2 : Dx = ((AliGBox*)(parent->GetShape()))->GetX() ;
1129 Dy = ((AliGBox*)(parent->GetShape()))->GetY()/ ndiv;
1130 Dz = ((AliGBox*)(parent->GetShape()))->GetZ();
1131 break;
1132
1133 case 3 : Dx = ((AliGBox*)(parent->GetShape()))->GetX() ;
1134 Dy = ((AliGBox*)(parent->GetShape()))->GetY();
1135 Dz = ((AliGBox*)(parent->GetShape()))->GetZ()/ ndiv;
1136 break;
1137
1138 default: Dx = Dy = Dz = 0.;
1139 };
1140
1141 AliGBox* box = new AliGBox("box","box", Dx, Dy, Dz);
1142
1143 /* Create the nodes son*/
1144
1145 Float_t x, y, z;
1146 Text_t* expression;
1147
1148 for( int i=0; i<ndiv; i++ ) {
1149 //nodename = "Node";
1150 nodename[4] = '\x0';
1151 sprintf( nodename, "%s%d", nodename, i );
1152 transfname = "trans";
1153 transfname[5] = '\x0';
1154 sprintf( transfname, "%s%d", transfname, i );
1155
1156 switch (iaxis) {
1157 case 'X' :
1158 case 'x' : x = ndiv *i;
1159 y = 0;
1160 z = 0;
1161 break;
1162 case 'Y' :
1163 case 'y' : x = 0;
1164 y = ndiv *i;
1165 z = 0;
1166 break;
1167
1168 case 'Z' :
1169 case 'z' : x = 0;
1170 y = 0;
1171 z = ndiv *i;
1172 break;
1173 };
1174
1175 /* Positioning the sons (only translations) and adding them to the parent*/
1176
1177 sprintf( expression, "%s %f %f %f", "tra", x, y, z );
1178 AliGTransform* tran = new AliGTransform( transfname, transfname, expression );
1179
1180 char* nodname = new char[strlen(name)];
1181 strcpy( nodname, name );
1182 AliGNode* son = new AliGNode( nodname, i, nodname, box, material );
1183 if( nodname ) delete [] nodname;
1184
1185 parent->Add( son, tran );
1186 parent->AddConfig("","");
1187 listNodes->AddLast(son);
1188 }
1189 }
1190}
1191
1192/***********************************************************************/
1193
1194void AliGEODB::Gsdvn2(const char*, const char*, Int_t, Int_t, Float_t, Int_t)
1195{
1196 printf( " Gsdvn2.\n" );
1197}
1198
1199/***********************************************************************/
1200
1201void AliGEODB::Gsdvs(const char*, const char*, Float_t, Int_t, Int_t)
1202{
1203 printf( " Gsdvs.\n" );
1204}
1205
1206/***********************************************************************/
1207
1208void AliGEODB::Gsdvs2(const char*, const char*, Float_t, Int_t, Float_t, Int_t)
1209{
1210 printf( " Gsdvs2.\n" );
1211}
1212
1213/***********************************************************************/
1214
1215void AliGEODB::Gsdvt(const char*, const char*, Float_t, Int_t, Int_t, Int_t)
1216{
1217 printf( " Gsdvt.\n" );
1218}
1219
1220/***********************************************************************/
1221
1222void AliGEODB::Gsdvt2(const char *, const char *, Float_t, Int_t, Float_t, Int_t, Int_t)
1223{
1224 printf( " Gsdvt2.\n" );
1225}
1226
1227/***********************************************************************/
1228
1229void AliGEODB::Gsord(const char*, Int_t)
1230{
1231 // Aqui entra pero dice Federico que Dummy.
1232}
1233
1234/***********************************************************************/
1235
1236void AliGEODB::Gspos( const char *name, Int_t nr, const char *mother, Float_t x, Float_t y, Float_t z, Int_t irot, const char* konly )
1237{
1238
1239 if( !strcmp(mother, "ALIC") )
1240 mother = "ALIC_1";
1241
1242 AliGNode* son = NULL;
1243 AliGNode* parent = NULL;
1244
1245 char* nodename = new char[strlen(name)+1];
1246 strcpy( nodename, name );
1247 nodename[strlen(name)] = '\x0';
1248
1249 TObjLink *lnk = listNodes->FirstLink();
1250 int quit=0;
1251
1252 while( (lnk) && (!quit) ) {
1253 TObject *obj = lnk->GetObject();
1254
1255 if( obj->GetName() ) {
1256 char* NodeName = new char[strlen(obj->GetName())+1];
1257 strcpy( NodeName, obj->GetName() );
1258 NodeName[strlen(obj->GetName())] = '\x0';
1259
1260 int i;
1261 for( i=0; NodeName[i]!='_'; i++ );
1262
1263 if( !strncmp(nodename, NodeName, i) )
1264 son = (AliGNode*) obj;
1265 else
1266 if( !strncmp(mother, NodeName, i) )
1267 parent = (AliGNode*) obj;
1268
1269 if( NodeName ) delete [] NodeName;
1270
1271 if( (son != NULL) && (parent != NULL) )
1272 quit = 1;
1273 }
1274
1275 lnk = lnk->Next();
1276 }
1277
1278 if( son == NULL ) {
1279 cout << " ERROR in Gspos. Couldn't find node " << nodename << " inside listNodes." << endl;
1280 exit(1);
1281 }
1282 else
1283 if( parent == NULL) {
1284 cout << " ERROR in Gspos. Couldn't find node " << mother << " inside listNodes." << endl;
1285 exit(1);
1286 }
1287
1288 AliGTransform* tra = (AliGTransform*)listTransf->At(MatrCount - 1);
1289
1290 TVector* matrix = tra->GetMatrix();
1291 char* transname = new char[10];
1292 sprintf(transname, "%s%d", "tra", MatrCount );
1293
1294 TVector &mat = *matrix;
1295 AliGTransform* newtra = new AliGTransform(transname, transname, mat(0), mat(1), mat(2), mat(4), mat(5), mat(6),mat(8), mat(9), mat(10), x, y, z);
1296
1297 //printf( "\n Created new AliGTransform( %s, %s, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f );\n", transname, transname, mat(0), mat(1), mat(2), mat(4), mat(5), mat(6), mat(8), mat(9), mat(10), x, y, z );
1298
1299 listTransf->AddAt(newtra, MatrCount);
1300 MatrCount++;
1301
1302 parent->Add(son, newtra);
1303 //printf( " %s->Add( %s, %s );\n", parent->GetName(), son->GetName(), newtra->GetName() );
1304}
1305
1306/***********************************************************************/
1307
1308void AliGEODB::Gsposp( const char* nodename, Int_t nr, const char* mother, Float_t x, Float_t y, Float_t z, Int_t irot, const char* konly, Float_t* upar, Int_t np )
1309{
1310 //printf( "\n" );
1311
1312 Int_t i;
1313
1314 for( i=0; i<PospCount; i++ )
1315 if( !strcmp(Posp[i]->name, nodename) )
1316 break;
1317
1318 char* shapename = Posp[i]->shape;
1319 Int_t nmed = Posp[i]->nmed;
1320
1321 char* fnodename = new char[strlen(nodename)+1];
1322 strcpy(fnodename, nodename);
1323 fnodename[strlen(nodename)] = '\x0';
1324
1325 char* fmother = new char[strlen(mother)+1];
1326 strcpy(fmother, mother);
1327 fmother[strlen(mother)] = '\x0';
1328
1329 AliGNode* parent = NULL;
1330
1331 TObjLink *lnk = listNodes->FirstLink();
1332 int quit=0;
1333
1334 while( (lnk) && (!quit) ) {
1335 TObject *obj = lnk->GetObject();
1336
1337 if( obj->GetName() ) {
1338 char* NodeName = new char[strlen(obj->GetName())];
1339 strcpy( NodeName, obj->GetName() );
1340
1341 int i;
1342 for( i=0; NodeName[i]!='_'; i++ );
1343
1344 if( !strncmp(fmother, NodeName, i) )
1345 parent = (AliGNode*) obj ;
1346
1347 if( NodeName ) delete [] NodeName;
1348
1349 if( parent != NULL )
1350 quit = 1;
1351 }
1352
1353 lnk = lnk->Next();
1354 }
1355
1356 if( parent == NULL) {
1357 cout << " ERROR in Gsposp. Couldn't find node " << mother << " inside listNodes." << endl;
1358 exit(1);
1359 }
1360
1361 Int_t nmat = AliMediums[nmed]->fNmat;
1362
1363 AliGMaterial* MyMaterial = NULL;
1364
1365 for( int j=0; j<listMaterials->GetSize(); j++ )
1366 if( ((AliGMaterial*) listMaterials->At(j))->GetfImat() == nmat ) {
1367 MyMaterial = (AliGMaterial*) listMaterials->At(j);
1368 /*printf( " AliGMaterial( %d, %s, %s, %d, %d, %f, %f, %f, %f, %f, %f, *fUbuf, %d, %f, %f, %f, %f, %f, *fBuf, %d ); already existed.\n", nmat,AliMaterials[nmat]->fName, AliMaterials[nmat]->fName, AliMediums[nmed]->fIsvol, AliMediums[nmed]->fIfield, AliMediums[nmed]->fFieldm, AliMediums[nmed]->fTmaxfd, AliMediums[nmed]->fStemax, AliMediums[nmed]->fDeemax, AliMediums[nmed]->fEpsil, AliMediums[nmed]->fStmin, AliMediums[nmed]->fNbuf, AliMaterials[nmat]->fA, AliMaterials[nmat]->fZ, AliMaterials[nmat]->fDens, AliMaterials[nmat]->fRadl, AliMaterials[nmat]->fAbsl, AliMaterials[nmat]->fNwbuf );*/
1369 break;
1370 }
1371
1372 if( MyMaterial == NULL ) {
1373 MyMaterial = new AliGMaterial( nmat, AliMaterials[nmat]->fName, AliMaterials[nmat]->fName, AliMediums[nmed]->fIsvol, AliMediums[nmed]->fIfield, AliMediums[nmed]->fFieldm, AliMediums[nmed]->fTmaxfd, AliMediums[nmed]->fStemax, AliMediums[nmed]->fDeemax, AliMediums[nmed]->fEpsil, AliMediums[nmed]->fStmin, AliMediums[nmed]->fUbuf, AliMediums[nmed]->fNbuf, AliMaterials[nmat]->fA, AliMaterials[nmat]->fZ, AliMaterials[nmat]->fDens, AliMaterials[nmat]->fRadl, AliMaterials[nmat]->fAbsl, AliMaterials[nmat]
1374->fBuf, AliMaterials[nmat]->fNwbuf );
1375
1376 /*printf( " Created new AliGMaterial( %d, %s, %s, %d, %d, %f, %f, %f, %f, %f, %f, *fUbuf, %d, %f, %f, %f, %f, %f, *fBuf, %d );\n", nmat,AliMaterials[nmat]->fName, AliMaterials[nmat]->fName, AliMediums[nmed]->fIsvol, AliMediums[nmed]->fIfield, AliMediums[nmed]->fFieldm, AliMediums[nmed]->fTmaxfd, AliMediums[nmed]->fStemax, AliMediums[nmed]->fDeemax, AliMediums[nmed]->fEpsil, AliMediums[nmed]->fStmin, AliMediums[nmed]->fNbuf, AliMaterials[nmat]->fA, AliMaterials[nmat]->fZ, AliMaterials[nmat]->fDens, AliMaterials[nmat]->fRadl, AliMaterials[nmat]->fAbsl, AliMaterials[nmat]->fNwbuf );*/
1377
1378 listMaterials->Add( MyMaterial );
1379 }
1380
1381 AliGNode* son = NULL;
1382
1383 // Different constructor depending on the shape
1384 if( !strncmp(shapename, "TUBE", 4) ) {
1385
1386 AliGTube* Shape = NULL;
1387
1388 for( int j=0; j<listShapes->GetSize(); j++ )
1389 if( ((AliGShape*) listShapes->At(j))->GetName() == shapename ) {
1390 Shape = (AliGTube*) listShapes->At(j);
1391 //printf( " AliGTube( %s, %s, %f, %f, %f ); already existed.\n", shapename, shapename, upar[0], upar[1], upar[2] );
1392 break;
1393 }
1394
1395 if( Shape == NULL ) {
1396 Shape = new AliGTube( shapename, shapename, upar[0], upar[1], upar[2] );
1397 //printf( " Created new AliGTube( %s, %s, %f, %f, %f );\n", shapename, shapename, upar[0], upar[1], upar[2] );
1398 listShapes->Add(Shape);
1399 }
1400
1401 Shape->SetCol(Color);
1402 son = new AliGNode( fnodename, nr, fnodename, Shape, MyMaterial );
1403 }
1404 else
1405 if( !strncmp(shapename, "BOX", 3) ) {
1406
1407 AliGBox* Shape = NULL;
1408
1409 for( int j=0; j<listShapes->GetSize(); j++ )
1410 if( ((AliGShape*) listShapes->At(j))->GetName() == shapename ) {
1411 Shape = (AliGBox*) listShapes->At(j);
1412 //printf( " AliGBox( %s, %s, %f, %f, %f ); already existed.\n", shapename, shapename, upar[0], upar[1], upar[2] );
1413 break;
1414 }
1415
1416 if( Shape == NULL ) {
1417 Shape = new AliGBox( shapename, shapename, upar[0], upar[1], upar[2] );
1418 //printf( " Created new AliGBox( %s, %s, %f, %f, %f );\n", shapename, shapename, upar[0], upar[1], upar[2] );
1419 listShapes->Add(Shape);
1420 }
1421
1422 Shape->SetCol(Color);
1423 son = new AliGNode( fnodename, nr, fnodename, Shape, MyMaterial );
1424 }
1425 else
1426 if( !strncmp(shapename, "TRD1", 4) ) {
1427
1428 AliGTRD1* Shape = NULL;
1429
1430 for( int j=0; j<listShapes->GetSize(); j++ )
1431 if( ((AliGShape*) listShapes->At(j))->GetName() == shapename ) {
1432 Shape = (AliGTRD1*) listShapes->At(j);
1433 //printf( " AliGTRD1( %s, %s, %f, %f, %f, %f ); already existed.\n", shapename, shapename, upar[0], upar[1], upar[2], upar[3] );
1434 break;
1435 }
1436
1437 if( Shape == NULL ) {
1438 Shape = new AliGTRD1( shapename, shapename, upar[0], upar[1], upar[2], upar[3] );
1439 //printf( " Created new AliGTRD1( %s, %s, %f, %f, %f, %f );\n", shapename, shapename, upar[0], upar[1], upar[2], upar[3] );
1440 listShapes->Add(Shape);
1441 }
1442
1443 Shape->SetCol(Color);
1444 son = new AliGNode( fnodename, nr, fnodename, Shape, MyMaterial );
1445 }
1446 else
1447 if( !strncmp(shapename, "PCON", 4) ) {
1448
1449 AliGPCone* Shape = NULL;
1450
1451 for( int j=0; j<listShapes->GetSize(); j++ )
1452 if( ((AliGShape*) listShapes->At(j))->GetName() == shapename ) {
1453 Shape = (AliGPCone*) listShapes->At(j);
1454 //printf( " AliGPCone( %s, %s, %f, %f, %f ); already existed.\n", shapename, shapename, upar[0], upar[1], upar[2] );
1455 break;
1456 }
1457
1458 if( Shape == NULL ) {
1459 Shape = new AliGPCone( shapename, shapename, upar, np );
1460 //printf( " Created new AliGPCone( %s, %s, %f, %f, %f );\n", shapename, shapename, upar[0], upar[1], upar[2] );
1461 listShapes->Add(Shape);
1462 }
1463
1464 Shape->SetCol(Color);
1465 son = new AliGNode( fnodename, nr, fnodename, Shape, MyMaterial );
1466 }
1467
1468 Color++;
1469 if( Color == 50 )
1470 Color = 0;
1471
1472 AliGTransform* tra = (AliGTransform*) listTransf->At(0);
1473
1474 TVector* matrix = tra->GetMatrix();
1475
1476 char* transname = new char[10];
1477 sprintf( transname, "%s%d", "tra", MatrCount );
1478
1479 TVector &mat = *matrix;
1480 AliGTransform* newtra = new AliGTransform(transname, transname, mat(0), mat(1), mat(2), mat(4), mat(5), mat(6), mat(8), mat(9), mat(10), x, y, z);
1481
1482 //printf( " Created new AliGTransform( %s, %s, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f );\n", transname, transname, mat(0), mat(1), mat(2), mat(4), mat(5), mat(6), mat(8), mat(9), mat(10), x, y, z );
1483
1484 listTransf->AddAt(newtra, MatrCount);
1485 MatrCount++;
1486
1487 parent->Add(son, newtra);
1488
1489 //printf( " %s->Add( %s, %s );\n", parent->GetName(), son->GetName(), newtra->GetName() );
1490
1491 listNodes->Add(son);
1492}
1493
1494/***********************************************************************/
1495
1496void AliGEODB::Gsrotm(Int_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t)
1497{
1498 printf( " Gsrotm.\n" );
1499}
1500
1501/***********************************************************************/
1502
1503void AliGEODB::Gprotm(Int_t)
1504{
1505 printf( " Gprotm.\n" );
1506}
1507
1508/***********************************************************************/
1509
1510Int_t AliGEODB::Gsvolu(const char* vname, const char* shape, Int_t nmed, Float_t* upar, Int_t np)
1511{
1512 Int_t lenvname = strlen(vname);
1513
1514 char* nodename = new char[lenvname+1];
1515 strcpy( nodename, vname );
1516 nodename[lenvname] = '\x0';
1517
1518 int pos;
1519 for( pos=0; pos<lenvname; pos++ )
1520 if( (nodename[pos] == '\x0') || (nodename[pos] == ' ') )
1521 break;
1522
1523 if( pos < lenvname ) {
1524 if( nodename ) delete [] nodename;
1525 nodename = new char[pos+1];
1526 strncpy( nodename, vname, pos );
1527 nodename[pos] = '\x0';
1528 }
1529
1530 char* shapename = new char[strlen(shape)+1];
1531 strcpy( shapename, shape );
1532 shapename[strlen(shape)] = '\x0';
1533
1534 //printf( "\n Trying to build node: %s with shape: %s, nmed: %d, upar[0]: %f and np: %d\n", nodename, shapename, nmed, upar[0], np );
1535
1536 if( !np ) {
1537 /* if number of parameters is 0, stores the nodename, shapename and nmed to be used in GSPOSP */
1538 NodePosp* AliPosp = new NodePosp;
1539 AliPosp->name = nodename;
1540 AliPosp->shape = shapename;
1541 AliPosp->nmed = nmed;
1542 Posp[PospCount] = AliPosp;
1543 PospCount++;
1544 return 0;
1545 }
1546
1547 if( (listNodes) && (listNodes->FindObject(nodename)) ) { // Trying to find the node inside listNodes
1548 // The node existed in listNodes.
1549 printf( "\n ERROR!!! Node %s already existed in listNodes\n", nodename );
1550 exit(1);
1551 }
1552 else {
1553 // It's a new node.
1554 Int_t nmat = AliMediums[nmed]->fNmat;
1555
1556 AliGMaterial* MyMaterial = NULL;
1557
1558 for( int j=0; j<listMaterials->GetSize(); j++ )
1559 if( ((AliGMaterial*) listMaterials->At(j))->GetfImat() == nmat ) {
1560 MyMaterial = (AliGMaterial*) listMaterials->At(j);
1561 /*printf( " AliGMaterial( %d, %s, %s, %d, %d, %f, %f, %f, %f, %f, %f, *fUbuf, %d, %f, %f, %f, %f, %f, *fBuf, %d ); already existed.\n", nmat,AliMaterials[nmat]->fName, AliMaterials[nmat]->fName, AliMediums[nmed]->fIsvol, AliMediums[nmed]->fIfield, AliMediums[nmed]->fFieldm, AliMediums[nmed]->fTmaxfd, AliMediums[nmed]->fStemax, AliMediums[nmed]->fDeemax, AliMediums[nmed]->fEpsil, AliMediums[nmed]->fStmin, AliMediums[nmed]->fNbuf, AliMaterials[nmat]->fA, AliMaterials[nmat]->fZ, AliMaterials[nmat]->fDens, AliMaterials[nmat]->fRadl, AliMaterials[nmat]->fAbsl, AliMaterials[nmat]->fNwbuf );*/
1562 break;
1563 }
1564
1565 if( MyMaterial == NULL ) {
1566 MyMaterial = new AliGMaterial( nmat, AliMaterials[nmat]->fName, AliMaterials[nmat]->fName, AliMediums[nmed]->fIsvol, AliMediums[nmed]->fIfield, AliMediums[nmed]->fFieldm, AliMediums[nmed]->fTmaxfd, AliMediums[nmed]->fStemax, AliMediums[nmed]->fDeemax, AliMediums[nmed]->fEpsil, AliMediums[nmed]->fStmin, AliMediums[nmed]->fUbuf, AliMediums[nmed]->fNbuf, AliMaterials[nmat]->fA, AliMaterials[nmat]->fZ, AliMaterials[nmat]->fDens, AliMaterials[nmat]->fRadl, AliMaterials[nmat]->fAbsl, AliMaterials[nmat]->fBuf, AliMaterials[nmat]->fNwbuf );
1567
1568 listMaterials->Add( MyMaterial );
1569
1570 /*printf( " Created new AliGMaterial( %d, %s, %s, %d, %d, %f, %f, %f, %f, %f, %f, *fUbuf, %d, %f, %f, %f, %f, %f, *fBuf, %d );\n", nmat,AliMaterials[nmat]->fName, AliMaterials[nmat]->fName, AliMediums[nmed]->fIsvol, AliMediums[nmed]->fIfield, AliMediums[nmed]->fFieldm, AliMediums[nmed]->fTmaxfd, AliMediums[nmed]->fStemax, AliMediums[nmed]->fDeemax, AliMediums[nmed]->fEpsil, AliMediums[nmed]->fStmin, AliMediums[nmed]->fNbuf, AliMaterials[nmat]->fA, AliMaterials[nmat]->fZ, AliMaterials[nmat]->fDens, AliMaterials[nmat]->fRadl, AliMaterials[nmat]->fAbsl, AliMaterials[nmat]->fNwbuf );*/
1571 }
1572
1573 // Different constructor depending on the shape
1574 AliGNode* node = NULL;
1575
1576 if( !strncmp(shapename, "TUBE", 4) ) {
1577
1578 AliGTube* Shape = NULL;
1579
1580 for( int j=0; j<listShapes->GetSize(); j++ )
1581 if( ((AliGShape*) listShapes->At(j))->GetName() == shapename ) {
1582 Shape = (AliGTube*) listShapes->At(j);
1583 printf( " AliGTube( %s, %s, %f, %f, %f ); already existed.\n", shapename, shapename, upar[0], upar[1], upar[2] );
1584 break;
1585 }
1586
1587 if( Shape == NULL ) {
1588 Shape = new AliGTube( shapename, shapename, upar[0], upar[1], upar[2] );
1589 //printf( " Created new AliGTube( %s, %s, %f, %f, %f );\n", shapename, shapename, upar[0], upar[1], upar[2] );
1590 listShapes->Add(Shape);
1591 }
1592
1593 Shape->SetCol(Color);
1594 node = new AliGNode( nodename, 1, nodename, Shape, MyMaterial );
1595 }
1596 else
1597 if( !strncmp(shapename, "BOX", 3) ) {
1598
1599 AliGBox* Shape = NULL;
1600
1601 for( int j=0; j<listShapes->GetSize(); j++ )
1602 if( ((AliGShape*) listShapes->At(j))->GetName() == shapename ) {
1603 Shape = (AliGBox*) listShapes->At(j);
1604 printf( " AliGBox( %s, %s, %f, %f, %f ); already existed.\n", shapename, shapename, upar[0], upar[1], upar[2] );
1605 break;
1606 }
1607
1608 if( Shape == NULL ) {
1609 Shape = new AliGBox( shapename, shapename, upar[0], upar[1], upar[2] );
1610 //printf( " Created new AliGBox( %s, %s, %f, %f, %f );\n", shapename, shapename, upar[0], upar[1], upar[2] );
1611 listShapes->Add(Shape);
1612 }
1613
1614 Shape->SetCol(Color);
1615 node = new AliGNode( nodename, 1, nodename, Shape, MyMaterial );
1616 }
1617 else
1618 if( !strncmp(shapename, "TRD1", 4) ) {
1619
1620 AliGTRD1* Shape = NULL;
1621
1622 for( int j=0; j<listShapes->GetSize(); j++ )
1623 if( ((AliGShape*) listShapes->At(j))->GetName() == shapename ) {
1624 Shape = (AliGTRD1*) listShapes->At(j);
1625
1626 break;
1627 }
1628
1629 if( Shape == NULL ) {
1630 Shape = new AliGTRD1( shapename, shapename, upar[0], upar[1], upar[2], upar[3] );
1631 //printf( " Created new AliGTRD1( %s, %s, %f, %f, %f, %f );\n", shapename, shapename, upar[0], upar[1], upar[2], upar[3] );
1632 listShapes->Add(Shape);
1633 }
1634
1635 Shape->SetCol(Color);
1636 node = new AliGNode( nodename, 1, nodename, Shape, MyMaterial );
1637 }
1638 else
1639 if( !strncmp(shapename, "PCON", 4) ) {
1640
1641 AliGPCone* Shape = NULL;
1642
1643 for( int j=0; j<listShapes->GetSize(); j++ )
1644 if( ((AliGShape*) listShapes->At(j))->GetName() == shapename ) {
1645 Shape = (AliGPCone*) listShapes->At(j);
1646 break;
1647 }
1648
1649 if( Shape == NULL ) {
1650 Shape = new AliGPCone( shapename, shapename, upar, np );
1651 //printf( " Created new AliGPCone( %s, %s, %f, %f, %f );\n", shapename, shapename, upar[0], upar[1], upar[2] );
1652 listShapes->Add(Shape);
1653 }
1654
1655 Shape->SetCol(Color);
1656 node = new AliGNode( nodename, 1, nodename, Shape, MyMaterial );
1657 }
1658
1659 //printf( " Created new AliGNode( %s, %d, %s, %s, %s );\n", nodename, 1+listNodes->GetSize(), nodename, shapename, MyMaterial->GetName() );
1660
1661 listNodes->Add(node);
1662
1663 //printf( " node->fShape->Color = %d\n", node->GetShape()->GetCol() );
1664
1665 Color++;
1666 if( Color == 50 )
1667 Color = 1;
1668 }
1669
1670 return 0;
1671}
1672
1673/***********************************************************************/
1674
1675void AliGEODB::Gsatt(const char*, const char*, Int_t)
1676{
1677 printf( " Gsatt.\n" );
1678}
1679
1680/***********************************************************************/
1681
1682void AliGEODB::Gfpara(const char*, Int_t, Int_t, Int_t&, Int_t&, Float_t*, Float_t*)
1683{
1684 printf( " Gfpara.\n" );
1685}
1686
1687/***********************************************************************/
1688
1689void AliGEODB::Gckpar(Int_t, Int_t, Float_t*)
1690{
1691 printf( " Gckpar.\n" );
1692}
1693
1694/***********************************************************************/
1695
1696void AliGEODB::Gckmat(Int_t, char*)
1697{
1698 printf( " Gckmat.\n" );
1699}
1700
1701/***********************************************************************/
1702
1703//=======================DRAW functions
1704
1705void AliGEODB::InitHIGZ()
1706{
1707 printf( "InitHIGZ.\n" );
1708}
1709
1710/***********************************************************************/
1711
1712void AliGEODB::Gdopen(Int_t)
1713{
1714 printf( "Gdopen.\n" );
1715}
1716
1717/***********************************************************************/
1718
1719void AliGEODB::Gdclose()
1720{
1721 printf( "Gdclose.\n" );
1722}
1723
1724/***********************************************************************/
1725
1726void AliGEODB::Gdelete(Int_t)
1727{
1728 cout << " Gdelete" << endl;
1729}
1730
1731/***********************************************************************/
1732
1733void AliGEODB::Gdshow(Int_t)
1734{
1735 cout << " Gdshow" << endl;
1736}
1737
1738/***********************************************************************/
1739
1740void AliGEODB::Gdopt(const char *,const char *)
1741{
1742 cout << " Gdopt" << endl;
1743}
1744
1745/***********************************************************************/
1746
1747void AliGEODB::Gdraw(const char *,Float_t, Float_t, Float_t,Float_t,Float_t,Float_t,Float_t)
1748{
1749 cout << " Gdraw" << endl;
1750}
1751
1752/***********************************************************************/
1753
1754void AliGEODB::Gdrawc(const char *,Int_t, Float_t,Float_t,Float_t,Float_t,Float_t)
1755{
1756 cout << " Gdrawc" << endl;
1757}
1758
1759/***********************************************************************/
1760
1761void AliGEODB::Gdrawx(const char *,Float_t, Float_t, Float_t, Float_t, Float_t,Float_t,Float_t,Float_t,Float_t)
1762{
1763 cout << " Gdrawx" << endl;
1764}
1765
1766/***********************************************************************/
1767
1768void AliGEODB::Gdhead(Int_t, const char *, Float_t)
1769{
1770 cout << " Gdhead" << endl;
1771}
1772
1773/***********************************************************************/
1774
1775void AliGEODB::Gdman(Float_t, Float_t, const char *)
1776{
1777 cout << " Gdman" << endl;
1778}
1779
1780/***********************************************************************/
1781
1782void AliGEODB::Gdspec(const char *)
1783{
1784 cout << " Gdspec" << endl;
1785}
1786
1787/***********************************************************************/
1788
1789void AliGEODB::DrawOneSpec(const char *)
1790{
1791 cout << " DrawOneSpec" << endl;
1792}
1793
1794/***********************************************************************/
1795
1796void AliGEODB::Gdtree(const char *,Int_t,Int_t)
1797{
1798 cout << " Gdtree" << endl;
1799}
1800
1801/***********************************************************************/
1802
1803void AliGEODB::GdtreeParent(const char *,Int_t,Int_t)
1804{
1805 cout << " GdtreeParent" << endl;
1806}
1807
1808/***********************************************************************/
1809
1810//=======================Set functions
1811
1812void AliGEODB::SetABAN(Int_t)
1813{
1814 cout << " SetABAN" << endl;
1815}
1816
1817/***********************************************************************/
1818
1819void AliGEODB::SetANNI(Int_t)
1820{
1821 cout << " SetANNI" << endl;
1822}
1823
1824/***********************************************************************/
1825
1826void AliGEODB::SetAUTO(Int_t)
1827{
1828 cout << " SetAUTO" << endl;
1829}
1830
1831/***********************************************************************/
1832
1833void AliGEODB::SetBOMB(Float_t)
1834{
1835 cout << " SetBOMB" << endl;
1836}
1837
1838/***********************************************************************/
1839
1840void AliGEODB::SetBREM(Int_t)
1841{
1842 cout << " SetBREM" << endl;
1843}
1844
1845/***********************************************************************/
1846
1847void AliGEODB::SetCKOV(Int_t)
1848{
1849 cout << " SetCKOV" << endl;
1850}
1851
1852/***********************************************************************/
1853
1854void AliGEODB::SetClipBox(const char *,Float_t,Float_t, Float_t,Float_t,Float_t,Float_t)
1855{
1856 cout << " SetClipBox" << endl;
1857}
1858
1859/***********************************************************************/
1860
1861void AliGEODB::SetCOMP(Int_t)
1862{
1863 cout << " SetCOMP" << endl;
1864}
1865
1866/***********************************************************************/
1867
1868void AliGEODB::SetCUTS( Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t )
1869{
1870 cout << " SetCUTS" << endl;
1871}
1872
1873/***********************************************************************/
1874
1875void AliGEODB::SetDCAY(Int_t)
1876{
1877 cout << " SetDCAY" << endl;
1878}
1879
1880/***********************************************************************/
1881
1882void AliGEODB::SetDEBU(Int_t, Int_t, Int_t)
1883{
1884 cout << " SetDEBU" << endl;
1885}
1886
1887/***********************************************************************/
1888
1889void AliGEODB::SetDRAY(Int_t)
1890{
1891 cout << " SetDRAY" << endl;
1892}
1893
1894/***********************************************************************/
1895
1896void AliGEODB::SetHADR(Int_t)
1897{
1898 cout << " SetHADR" << endl;
1899}
1900
1901/***********************************************************************/
1902
1903void AliGEODB::SetKINE(Int_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,Float_t )
1904{
1905 cout << " SetKINE" << endl;
1906}
1907
1908/***********************************************************************/
1909
1910void AliGEODB::SetLOSS(Int_t)
1911{
1912 cout << " SetLOSS" << endl;
1913}
1914
1915/***********************************************************************/
1916
1917void AliGEODB::SetMULS(Int_t)
1918{
1919 cout << " SetMULS" << endl;
1920}
1921
1922/***********************************************************************/
1923
1924void AliGEODB::SetMUNU(Int_t)
1925{
1926 cout << " SetMUNU" << endl;
1927}
1928
1929/***********************************************************************/
1930
1931void AliGEODB::SetOPTI(Int_t)
1932{
1933 cout << " SetOPTI" << endl;
1934}
1935
1936/***********************************************************************/
1937
1938void AliGEODB::SetPAIR(Int_t)
1939{
1940 cout << " SetPAIR" << endl;
1941}
1942
1943/***********************************************************************/
1944
1945void AliGEODB::SetPFIS(Int_t)
1946{
1947 cout << " SetPFIS" << endl;
1948}
1949
1950/***********************************************************************/
1951
1952void AliGEODB::SetPHOT(Int_t)
1953{
1954 cout << " SetPHOT" << endl;
1955}
1956
1957/***********************************************************************/
1958
1959void AliGEODB::SetRAYL(Int_t)
1960{
1961 cout << " SetRAYL" << endl;
1962}
1963
1964/***********************************************************************/
1965
1966void AliGEODB::SetSWIT(Int_t , Int_t)
1967{
1968 cout << " SetSWIT" << endl;
1969}
1970
1971/***********************************************************************/
1972
1973void AliGEODB::SetTRIG(Int_t)
1974{
1975 cout << " SetTRIG" << endl;
1976}
1977
1978/***********************************************************************/
1979
1980void AliGEODB::Vname(const char *, char *)
1981{
1982 cout << " Vname" << endl;
1983}
1984
1985/***********************************************************************/
1986
1987void AliGEODB::InitLego()
1988{
1989 cout << " InitLego" << endl;
1990}
1991
1992/***********************************************************************/
1993
1994extern "C" void sxpart_(){}