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