// ******** Implementation of class to build HypGe Triple Cluster Geometry ************* // by steinen@kph.uni-mainz.de #include "PndGeoHypGeTripleCluster.h" //#include "PndGeoHypGeCrystal.h" #include using namespace std; ClassImp(PndGeoHypGeTripleCluster) // ----- Default constructor ------------------------------------------- PndGeoHypGeTripleCluster::PndGeoHypGeTripleCluster() { // Constructor } PndGeoHypGeTripleCluster::PndGeoHypGeTripleCluster(TGeoMedium *ExtGe, TGeoMedium *ExtAl,Int_t ExtClusterNumber) { Ge = ExtGe; Al = ExtAl; ClusterNumber= ExtClusterNumber; StartClusterNumber = ExtClusterNumber; //ClusterAssembly = new TGeoVolumeAssembly("ClusterAssembly"); } // ------- destructor -------------- PndGeoHypGeTripleCluster::~PndGeoHypGeTripleCluster() { cout << "Destrucor called" << endl; }; // --------------- build the crystals -------------------------- void PndGeoHypGeTripleCluster::BuildCrystals(Int_t *CrystalNumber) { //create 3 crystal objects. The copy number of a crystal is composed of the number of the cluster and a running number for every placed crystal like e.g.: cluster 4, crystal 9: 409 ; cluster 11, crystal 32: 1132 Crystal1Number = *CrystalNumber; *CrystalNumber+=1; Crystal2Number = *CrystalNumber; *CrystalNumber+=1; Crystal3Number = *CrystalNumber; *CrystalNumber+=1; Crystal1 = new PndGeoHypGeCrystal(Ge,Al,100*ClusterNumber+Crystal1Number); Crystal2 = new PndGeoHypGeCrystal(Ge,Al,100*ClusterNumber+Crystal2Number); Crystal3 = new PndGeoHypGeCrystal(Ge,Al,100*ClusterNumber+Crystal3Number); //set positions of the 3 crystals TripleXOffset = -3.53/2-0.2; TripleYOffset = -6.1386/2; Crystal1Rotation = new TGeoRotation("Crystal1Rotation", -30,-4.62,30); //angles measured in CAD drawing Crystal1Rotation ->RegisterYourself(); Crystal2Rotation = new TGeoRotation("Crystal2Rotation", 90,-4.62,-90); Crystal2Rotation ->RegisterYourself(); Crystal3Rotation = new TGeoRotation("Crystal2Rotation", 30,4.62,-30); Crystal3Rotation ->RegisterYourself(); Crystal1Position = new TGeoCombiTrans(0+TripleXOffset,0+TripleYOffset,-(0.45+0.2843),Crystal1Rotation); Crystal1Position->RegisterYourself(); Crystal2Position = new TGeoCombiTrans(5.3162+TripleXOffset,6.1386/2+TripleYOffset,-(0.45+0.2843),Crystal2Rotation); Crystal2Position->RegisterYourself(); Crystal3Position = new TGeoCombiTrans(0+TripleXOffset,6.1386+TripleYOffset,-(0.45+0.2843),Crystal3Rotation); Crystal3Position->RegisterYourself(); Crystal1->PlaceCrystal(ClusterAssembly,Crystal1Position); Crystal2->PlaceCrystal(ClusterAssembly,Crystal2Position); Crystal3->PlaceCrystal(ClusterAssembly,Crystal3Position); } // --------------- build the cryostat -------------------------- void PndGeoHypGeTripleCluster::BuildCryostat() { // the cryostat is a combination of 22 TArb8 + 1 TGeoXtru. The coordinates are taken from CAD drawings. The lower part is build by CryostatOuter... - CryostatInner ... . The upper part is build of 12 single TArb8. The top is 1 TGeoXtru CryostatHeight = 12.95; CryostatFrontThickness = 0.15; CryostatUpperPartHeight = 5; // lets start with the outer part //Tarb8 needs one array of coordinates: {x1,y1 , x2,y2 , ... , x8,y8} CryostatOuterArb8XY_1 = new Double_t[16] { 5.1211,-3.9906 , 2.5693,-7.0666 , -1.40290,-6.3389 , -2.5436,-3.0401, 6.5119,-5.1633 , 3.2569,-9.0480 , -1.7273,-8.1289 , -3.2443,-3.8387}; CryostatOuterArb8XY_2 = new Double_t[16] { -2.5693,-3.0401 , -6.0164,-2.4697 , -7.3916,1.3304 , -4.7881,4.3843 , -3.2443,-3.8387 , -7.7274,-3.0578 , -9.4641,1.7035 , -6.1761,5.5903}; CryostatOuterArb8XY_3 = new Double_t[16] { 5.1211,-3.9906 , -2.5693,-3.0401 , -4.7881,4.3843 , -1.3481,3.7451 , 6.5119,-5.1633 , -3.2443,-3.8387 , -6.1761,5.5603 , -1.7021,4.7290}; CryostatOuterArb8XY_4 = new Double_t[16] { 5.1211,-3.9906 , -1.3481,3.7451 , 0.8954,6.4301 , 3.9175,-0.7051 , 6.5119,-5.1633 , -1.7021,4.7290 , 1.2156,8.2210 , 4.9466,-0.8905}; CryostatOuterArb8XY_5 = new Double_t[16] { 0.8954,6.4301 , 4.8480,5.7361 , 6.1610,1.9544 , 3.9175,-0.7051 , 1.2156,8.2210 , 6.2074,7.3444 , 7.9036,2.5685 , 4.9466,-0.8905}; CryostatOuterArb8_1 = new TGeoArb8 ("CryostatOuterArb8_1",CryostatHeight/2,CryostatOuterArb8XY_1) ; CryostatOuterArb8_2= new TGeoArb8 ("CryostatOuterArb8_2",CryostatHeight/2,CryostatOuterArb8XY_2) ; CryostatOuterArb8_3= new TGeoArb8 ("CryostatOuterArb8_3",CryostatHeight/2,CryostatOuterArb8XY_3) ; CryostatOuterArb8_4= new TGeoArb8 ("CryostatOuterArb8_4",CryostatHeight/2,CryostatOuterArb8XY_4) ; CryostatOuterArb8_5= new TGeoArb8 ("CryostatOuterArb8_5",CryostatHeight/2,CryostatOuterArb8XY_5) ; // now the inner part CryostatInnerArb8XY_1 = new Double_t[16] { -2.4572,-2.9075 , 4.9505,-3.9607 , 2.4849,-6.9033 , -1.2905,-6.2072 , -3.1322,-3.7060 , 6.3412,-5.1334 , 3.1981,-8.8846 , -1.6148,-7.9972 }; CryostatInnerArb8XY_2 = new Double_t[16] { -2.4572,-2.9075 , -5.9053,-2.3069 , -7.2208,1.2997 , -4.7303,4.2211 , -3.1322,-3.7060 , -7.6162,-2.9250, -9.2933,1.6727, -6.1183,5.3971 }; CryostatInnerArb8XY_3 = new Double_t[16] { -2.4572,-2.9075 , -4.7303,4.2211 , -1.2893,3.5817 , 4.9505,-3.9607 , -3.1322,-3.7060 , -6.1183,5.3971 , -1.6433,4.5655, 6.3412,-5.1334}; CryostatInnerArb8XY_4 = new Double_t[16] { 4.9505,-3.9607 , -1.2893,3.5817 , 0.9549,6.2675, 3.7466,-0.4744 , 6.3412,-5.1334 , -1.6433,4.5655, 1.2751,8.0583, 4.7756,-0.8597 }; CryostatInnerArb8XY_5 = new Double_t[16] { 3.7466,-0.4744 , 0.9549,6.2675 , 4.7360,5.6035 , 6.0208,1.9859 , 4.7756,-0.8597 , 1.2751,8.0583, 6.0953,7.2118 , 7.7332,2.6000 }; CryostatInnerArb8_1 = new TGeoArb8 ("CryostatInnerArb8_1",(CryostatHeight-CryostatFrontThickness)/2,CryostatInnerArb8XY_1) ; CryostatInnerArb8_2= new TGeoArb8 ("CryostatInnerArb8_2",(CryostatHeight-CryostatFrontThickness)/2,CryostatInnerArb8XY_2) ; CryostatInnerArb8_3= new TGeoArb8 ("CryostatInnerArb8_3",(CryostatHeight-CryostatFrontThickness)/2,CryostatInnerArb8XY_3) ; CryostatInnerArb8_4= new TGeoArb8 ("CryostatInnerArb8_4",(CryostatHeight-CryostatFrontThickness)/2,CryostatInnerArb8XY_4) ; CryostatInnerArb8_5= new TGeoArb8 ("CryostatInnerArb8_5",(CryostatHeight-CryostatFrontThickness)/2,CryostatInnerArb8XY_5) ; //now the upper part CryostatUpperArb8XY_1 = new Double_t[16] { 6.5119,-5.1633 , 3.2569,-9.0480 , 3.1981,-8.8846 , 6.3412,-5.1334 , 6.9097,-5.2329 , 3.3939,-9.4288 , 3.1981,-8.8846 , 6.3412,-5.1334}; CryostatUpperArb8XY_2 = new Double_t[16] { 3.2569,-9.0480 , -1.7273,-8.1289 , -1.6148,-7.9972 , 3.1981,-8.8846 , 3.3939,-9.4288 , -1.9896,-8.4361 , -1.6148,-7.9972 , 3.1981,-8.8846}; CryostatUpperArb8XY_3 = new Double_t[16] { -1.7273,-8.1289 , -3.2443,-3.8387 , -3.1322,-3.7060 , -1.6148,-7.9972 , -1.9896,-8.4361 , -3.5050,-4.1481 , -3.1322,-3.7060 , -1.6148,-7.9972}; CryostatUpperArb8XY_4 = new Double_t[16] { -3.2443,-3.8387 , -7.7274,-3.0578 , -7.6162,-2.9250 , -3.1322,-3.7060 , -3.5050,-4.1481 , -7.9866,-3.3866 , -7.6162,-2.9250 , -3.1322,-3.7060}; CryostatUpperArb8XY_5 = new Double_t[16] { -7.7274,-3.0578 , -9.4641,1.7035 , -9.2933,1.6727 , -7.6162,-2.9250 , -7.9866,-3.3866 , -9.8624,1.7752 , -9.2933,1.6727 , -7.6162,-2.9250 }; CryostatUpperArb8XY_6 = new Double_t[16] { -9.4641,1.7035 , -6.1761,5.5603 , -6.1183,5.3971 , -9.2933,1.6727 , -9.8624,1.7752 , -6.3111,5.9410 , -6.1183,5.3971 , -9.2933,1.6727}; CryostatUpperArb8XY_7 = new Double_t[16] { -6.1761,5.5603 , -1.7021,4.7290 , -1.6433,4.5655 , -6.1183,5.3971 , -6.3111,5.9410 , -1.8393,5.1101 , -1.6433,4.5655 , -6.1183,5.3971}; CryostatUpperArb8XY_8 = new Double_t[16] { -1.7021,4.7290 , 1.2156,8.2210 , 1.2751,8.0583 , -1.6433,4.5655 , -1.8393,5.1101 , 1.0770,8.6003 , 1.2751,8.0583 , -1.6433,4.5655}; CryostatUpperArb8XY_9 = new Double_t[16] { 1.2156,8.2210 , 6.2074,7.3444 , 6.0953,7.2118 , 1.2751,8.0583 , 1.0770,8.6003 , 6.4686,7.6535 , 6.0953,7.2118 , 1.2751,8.0583}; CryostatUpperArb8XY_10 = new Double_t[16] { 6.2074,7.3444 , 7.9036,2.5685 , 7.7332,2.6000 , 6.0953,7.2118 , 6.4686,7.6535 , 8.3007,2.4950 , 7.7332,2.6000 , 6.0953,7.2118}; CryostatUpperArb8XY_11 = new Double_t[16] { 7.9036,2.5685 , 4.9466,-0.8905 , 4.7756,-0.8597 , 7.7332,2.6000 , 8.3007,2.4950 , 5.3453,-0.9622 , 4.7756,-0.8597 , 7.7332,2.6000}; CryostatUpperArb8XY_12 = new Double_t[16] { 4.9466,-0.8905 , 6.5119,-5.1633 , 6.3412,-5.1334 , 4.7756,-0.8597 , 5.3453,-0.9622 , 6.9097,-5.2329 , 6.3412,-5.1334 , 4.7756,-0.8597}; CryostatUpperArb8_1 = new TGeoArb8("CryostatUpperArb8_1",CryostatUpperPartHeight/2, CryostatUpperArb8XY_1); CryostatUpperArb8_2 = new TGeoArb8("CryostatUpperArb8_2",CryostatUpperPartHeight/2, CryostatUpperArb8XY_2); CryostatUpperArb8_3 = new TGeoArb8("CryostatUpperArb8_3",CryostatUpperPartHeight/2, CryostatUpperArb8XY_3); CryostatUpperArb8_4 = new TGeoArb8("CryostatUpperArb8_4",CryostatUpperPartHeight/2, CryostatUpperArb8XY_4); CryostatUpperArb8_5 = new TGeoArb8("CryostatUpperArb8_5",CryostatUpperPartHeight/2, CryostatUpperArb8XY_5); CryostatUpperArb8_6= new TGeoArb8("CryostatUpperArb8_6",CryostatUpperPartHeight/2, CryostatUpperArb8XY_6); CryostatUpperArb8_7 = new TGeoArb8("CryostatUpperArb8_7",CryostatUpperPartHeight/2, CryostatUpperArb8XY_7); CryostatUpperArb8_8 = new TGeoArb8("CryostatUpperArb8_8",CryostatUpperPartHeight/2, CryostatUpperArb8XY_8); CryostatUpperArb8_9 = new TGeoArb8("CryostatUpperArb8_9",CryostatUpperPartHeight/2, CryostatUpperArb8XY_9); CryostatUpperArb8_10 = new TGeoArb8("CryostatUpperArb8_10",CryostatUpperPartHeight/2, CryostatUpperArb8XY_10); CryostatUpperArb8_11 = new TGeoArb8("CryostatUpperArb8_11",CryostatUpperPartHeight/2, CryostatUpperArb8XY_11); CryostatUpperArb8_12 = new TGeoArb8("CryostatUpperArb8_12",CryostatUpperPartHeight/2, CryostatUpperArb8XY_12); //combine the cryostat CryostatInnerZTranslation = new TGeoTranslation("CryostatInnerZTranslation",0,0,CryostatFrontThickness); CryostatInnerZTranslation->RegisterYourself(); CryostatUpperPartsZTranslation = new TGeoTranslation("CryostatUpperPartsZTranslation",0,0,(CryostatHeight+CryostatUpperPartHeight)/2); CryostatUpperPartsZTranslation->RegisterYourself(); CryostatShape = new TGeoCompositeShape("CryostatShape", "(CryostatOuterArb8_1+CryostatOuterArb8_2+CryostatOuterArb8_3+CryostatOuterArb8_4+CryostatOuterArb8_5)-(CryostatInnerArb8_1:CryostatInnerZTranslation+CryostatInnerArb8_2:CryostatInnerZTranslation+CryostatInnerArb8_3:CryostatInnerZTranslation+CryostatInnerArb8_4:CryostatInnerZTranslation+CryostatInnerArb8_5:CryostatInnerZTranslation)+(CryostatUpperArb8_1:CryostatUpperPartsZTranslation+CryostatUpperArb8_2:CryostatUpperPartsZTranslation+CryostatUpperArb8_3:CryostatUpperPartsZTranslation+CryostatUpperArb8_4:CryostatUpperPartsZTranslation+CryostatUpperArb8_5:CryostatUpperPartsZTranslation+CryostatUpperArb8_6:CryostatUpperPartsZTranslation+CryostatUpperArb8_7:CryostatUpperPartsZTranslation+CryostatUpperArb8_8:CryostatUpperPartsZTranslation+CryostatUpperArb8_9:CryostatUpperPartsZTranslation+CryostatUpperArb8_10:CryostatUpperPartsZTranslation+CryostatUpperArb8_11:CryostatUpperPartsZTranslation+CryostatUpperArb8_12:CryostatUpperPartsZTranslation)"); //(CryostatOuter) -(CryostatInner)+(CryostatUpperParts) Cryostat = new TGeoVolume("Cryostat",CryostatShape,Al); //bring the cryostat in the right position CryostatCombiTrans = new TGeoCombiTrans("CryostatCombiTrans",0,0,-CryostatHeight/2,new TGeoRotation("CryostatRotation",0,180,180+10.2)); CryostatCombiTrans->RegisterYourself(); //finally: the top of the cryostat //TGeoXTrun needs 2 separate arrays of coordinate values (!= TArb8) CryostatTopXCoordinates = new Double_t[12] {6.9097,3.3939,-1.9896,-3.5058,-7.9866,-9.8624,-6.3111,-1.8393,1.0770,6.4686,8.3007,5.3453}; CryostatTopYCoordinates = new Double_t[12] {-5.2329,-9.4288,-8.4361,-4.1481,-3.3866,1.7752,5.9410,5.1101,8.6003,7.6535,2.4950,-0.9622}; CryostatTopThickness = 0.5; CryostatTopShape = new TGeoXtru(2); CryostatTopShape->DefinePolygon(12,CryostatTopXCoordinates,CryostatTopYCoordinates); CryostatTopShape->DefineSection(0,-(CryostatHeight+CryostatUpperPartHeight+CryostatTopThickness),0,0,1); CryostatTopShape->DefineSection(1,-(CryostatHeight+CryostatUpperPartHeight),0,0,1); CryostatTop = new TGeoVolume("CryostatTop",CryostatTopShape,Al); CryostatTopCombiTrans = new TGeoCombiTrans("CryostatCombiTrans",0,0,0,new TGeoRotation("CryostatRotation",0,0,180+10.2)); CryostatTopCombiTrans->RegisterYourself(); ClusterAssembly->AddNode(Cryostat,ClusterNumber,CryostatCombiTrans); ClusterAssembly->AddNode(CryostatTop,ClusterNumber,CryostatTopCombiTrans); }; // --------------- Prints the nodes of a cluster ----------------- void PndGeoHypGeTripleCluster::PrintNodes(Int_t nLevels ) { if (nLevels == 0) { cout << "Nothing to Print, use higher number to go deeper in the tree." << endl; } if (nLevels > 0) { cout << "Printing the content of the cluster assembly." << endl; cout <GetNdaughters() << endl; ClusterAssembly->PrintNodes(); } if (nLevels > 1) { cout << "Printing the content of the crystal assemblies." << endl; cout <GetNdaughters() << endl; Crystal1->PrintNodes(); cout <GetNdaughters() << endl; Crystal2->PrintNodes(); cout <GetNdaughters() << endl; Crystal3->PrintNodes(); } }