740 TGeoShape *shape = vol->GetShape();
741 TClass *class_type = shape->IsA();
742 if (class_type == TGeoBBox::Class()) {
746 TGeoBBox *box = (TGeoBBox *)shape;
747 par.AddAt(box->GetDX(), 0);
748 par.AddAt(box->GetDY(), 1);
749 par.AddAt(box->GetDZ(), 2);
752 if (class_type == TGeoTrd1::Class()) {
756 TGeoTrd1 *trd1 = (TGeoTrd1 *)shape;
757 par.AddAt(trd1->GetDx1(), 0);
758 par.AddAt(trd1->GetDx2(), 1);
759 par.AddAt(trd1->GetDy(), 2);
760 par.AddAt(trd1->GetDz(), 3);
763 if (class_type == TGeoTrd2::Class()) {
767 TGeoTrd2 *trd2 = (TGeoTrd2 *)shape;
768 par.AddAt(trd2->GetDx1(), 0);
769 par.AddAt(trd2->GetDx2(), 1);
770 par.AddAt(trd2->GetDy1(), 2);
771 par.AddAt(trd2->GetDy2(), 3);
772 par.AddAt(trd2->GetDz(), 4);
775 if (class_type == TGeoTrap::Class()) {
779 TGeoTrap *trap = (TGeoTrap *)shape;
780 Double_t tth = TMath::Tan(trap->GetTheta() * TMath::DegToRad());
781 par.AddAt(trap->GetDz(), 0);
782 par.AddAt(tth * TMath::Cos(trap->GetPhi() * TMath::DegToRad()), 1);
783 par.AddAt(tth * TMath::Sin(trap->GetPhi() * TMath::DegToRad()), 2);
784 par.AddAt(trap->GetH1(), 3);
785 par.AddAt(trap->GetBl1(), 4);
786 par.AddAt(trap->GetTl1(), 5);
787 par.AddAt(TMath::Tan(trap->GetAlpha1() * TMath::DegToRad()), 6);
788 par.AddAt(trap->GetH2(), 7);
789 par.AddAt(trap->GetBl2(), 8);
790 par.AddAt(trap->GetTl2(), 9);
791 par.AddAt(TMath::Tan(trap->GetAlpha2() * TMath::DegToRad()), 10);
794 if (class_type == TGeoTube::Class()) {
798 TGeoTube *tube = (TGeoTube *)shape;
799 par.AddAt(tube->GetRmin(), 0);
800 par.AddAt(tube->GetRmax(), 1);
801 par.AddAt(tube->GetDz(), 2);
804 if (class_type == TGeoTubeSeg::Class()) {
808 TGeoTubeSeg *tubs = (TGeoTubeSeg *)shape;
809 par.AddAt(tubs->GetRmin(), 0);
810 par.AddAt(tubs->GetRmax(), 1);
811 par.AddAt(tubs->GetDz(), 2);
812 par.AddAt(tubs->GetPhi1(), 3);
813 par.AddAt(tubs->GetPhi2(), 4);
816 if (class_type == TGeoCone::Class()) {
820 TGeoCone *cone = (TGeoCone *)shape;
821 par.AddAt(cone->GetDz(), 0);
822 par.AddAt(cone->GetRmin1(), 1);
823 par.AddAt(cone->GetRmax1(), 2);
824 par.AddAt(cone->GetRmin2(), 3);
825 par.AddAt(cone->GetRmax2(), 4);
828 if (class_type == TGeoConeSeg::Class()) {
832 TGeoConeSeg *cons = (TGeoConeSeg *)shape;
833 par.AddAt(cons->GetDz(), 0);
834 par.AddAt(cons->GetRmin1(), 1);
835 par.AddAt(cons->GetRmax1(), 2);
836 par.AddAt(cons->GetRmin2(), 3);
837 par.AddAt(cons->GetRmax2(), 4);
838 par.AddAt(cons->GetPhi1(), 5);
839 par.AddAt(cons->GetPhi2(), 6);
842 if (class_type == TGeoSphere::Class()) {
846 TGeoSphere *sphe = (TGeoSphere *)shape;
847 par.AddAt(sphe->GetRmin(), 0);
848 par.AddAt(sphe->GetRmax(), 1);
849 par.AddAt(sphe->GetTheta1(), 2);
850 par.AddAt(sphe->GetTheta2(), 3);
851 par.AddAt(sphe->GetPhi1(), 4);
852 par.AddAt(sphe->GetPhi2(), 5);
855 if (class_type == TGeoPara::Class()) {
859 TGeoPara *para = (TGeoPara *)shape;
860 par.AddAt(para->GetX(), 0);
861 par.AddAt(para->GetY(), 1);
862 par.AddAt(para->GetZ(), 2);
863 par.AddAt(para->GetTxy(), 3);
864 par.AddAt(para->GetTxz(), 4);
865 par.AddAt(para->GetTyz(), 5);
868 if (class_type == TGeoPgon::Class()) {
870 TGeoPgon *pgon = (TGeoPgon *)shape;
871 Int_t nz = pgon->GetNz();
872 const Double_t *rmin = pgon->GetRmin();
873 const Double_t *rmax = pgon->GetRmax();
874 const Double_t *z = pgon->GetZ();
877 par.AddAt(pgon->GetPhi1(), 0);
878 par.AddAt(pgon->GetDphi(), 1);
879 par.AddAt(pgon->GetNedges(), 2);
880 par.AddAt(pgon->GetNz(), 3);
881 for (Int_t i = 0; i < nz; i++) {
882 par.AddAt(z[i], 4 + 3 * i);
883 par.AddAt(rmin[i], 4 + 3 * i + 1);
884 par.AddAt(rmax[i], 4 + 3 * i + 2);
888 if (class_type == TGeoPcon::Class()) {
890 TGeoPcon *pcon = (TGeoPcon *)shape;
891 Int_t nz = pcon->GetNz();
892 const Double_t *rmin = pcon->GetRmin();
893 const Double_t *rmax = pcon->GetRmax();
894 const Double_t *z = pcon->GetZ();
897 par.AddAt(pcon->GetPhi1(), 0);
898 par.AddAt(pcon->GetDphi(), 1);
899 par.AddAt(pcon->GetNz(), 2);
900 for (Int_t i = 0; i < nz; i++) {
901 par.AddAt(z[i], 3 + 3 * i);
902 par.AddAt(rmin[i], 3 + 3 * i + 1);
903 par.AddAt(rmax[i], 3 + 3 * i + 2);
907 if (class_type == TGeoEltu::Class()) {
911 TGeoEltu *eltu = (TGeoEltu *)shape;
912 par.AddAt(eltu->GetA(), 0);
913 par.AddAt(eltu->GetB(), 1);
914 par.AddAt(eltu->GetDz(), 2);
917 if (class_type == TGeoHype::Class()) {
921 TGeoHype *hype = (TGeoHype *)shape;
922 par.AddAt(TMath::Sqrt(hype->RadiusHypeSq(0., kTRUE)), 0);
923 par.AddAt(TMath::Sqrt(hype->RadiusHypeSq(0., kFALSE)), 1);
924 par.AddAt(hype->GetDZ(), 2);
925 par.AddAt(hype->GetStIn(), 3);
926 par.AddAt(hype->GetStOut(), 4);
929 if (class_type == TGeoGtra::Class()) {
933 TGeoGtra *trap = (TGeoGtra *)shape;
934 Double_t tth = TMath::Tan(trap->GetTheta() * TMath::DegToRad());
935 par.AddAt(trap->GetDz(), 0);
936 par.AddAt(tth * TMath::Cos(trap->GetPhi() * TMath::DegToRad()), 1);
937 par.AddAt(tth * TMath::Sin(trap->GetPhi() * TMath::DegToRad()), 2);
938 par.AddAt(trap->GetH1(), 3);
939 par.AddAt(trap->GetBl1(), 4);
940 par.AddAt(trap->GetTl1(), 5);
941 par.AddAt(TMath::Tan(trap->GetAlpha1() * TMath::DegToRad()), 6);
942 par.AddAt(trap->GetH2(), 7);
943 par.AddAt(trap->GetBl2(), 8);
944 par.AddAt(trap->GetTl2(), 9);
945 par.AddAt(TMath::Tan(trap->GetAlpha2() * TMath::DegToRad()), 10);
946 par.AddAt(trap->GetTwistAngle(), 11);
949 if (class_type == TGeoCtub::Class()) {
953 TGeoCtub *ctub = (TGeoCtub *)shape;
954 const Double_t *lx = ctub->GetNlow();
955 const Double_t *tx = ctub->GetNhigh();
956 par.AddAt(ctub->GetRmin(), 0);
957 par.AddAt(ctub->GetRmax(), 1);
958 par.AddAt(ctub->GetDz(), 2);
959 par.AddAt(ctub->GetPhi1(), 3);
960 par.AddAt(ctub->GetPhi2(), 4);
966 par.AddAt(tx[2], 10);
969 Error(
"GetShape",
"Getting shape parameters for shape %s not implemented", shape->ClassName());