/* Generated by Together */ #include "FairGeoLoader.h" #include "FairGeoInterface.h" #include "FairGeoRootBuilder.h" #include "FairRuntimeDb.h" #include "TObjArray.h" #include "FairRun.h" #include "FairGeoVolume.h" #include "FairGeoNode.h" #include "R3BTarget.h" #include "R3BGeoPassivePar.h" //#include "R3BGeoTarget.h" // includes for modeling #include "TGeoManager.h" #include "TParticle.h" #include "TVirtualMC.h" #include "TGeoMatrix.h" #include "TGeoMaterial.h" #include "TGeoMedium.h" #include "TGeoBBox.h" #include "TGeoPara.h" #include "TGeoSphere.h" #include "TGeoPcon.h" #include "TGeoTube.h" #include "TGeoBoolNode.h" #include "TGeoCompositeShape.h" #include "TGeoManager.h" #include using namespace std; R3BTarget::~R3BTarget() { if (fTargetName ) delete fTargetName; } R3BTarget::R3BTarget() { fTargetName=NULL; } R3BTarget::R3BTarget(const char * name, const char * title) : R3BModule(name ,title) { fTargetName = new TString(name); } void R3BTarget::ConstructGeometry(){ if (*fTargetName == "LeadTarget") return ConstructGeometry1(); if (*fTargetName == "Para") return ConstructGeometry2(); if (*fTargetName == "Para45") return ConstructGeometry3(); if (*fTargetName == "LiH") return ConstructGeometry4(); if (*fTargetName == "H2") return ConstructGeometry5(); } void R3BTarget::ConstructGeometry1(){ cout << endl; cout << "-I- R3BTarget:: ConstructGeometry() "<< endl; cout << "-I- R3BTarget Target type:lead target (200mg/cm2) "<< endl; cout << endl; // test of out-of-file geometry definition Double_t dx, dy, dz; Double_t thx, thy, thz; Double_t phx, phy, phz; Double_t a, z, density; //Double_t par[20]; Int_t numed; TGeoMaterial *pMat=NULL; TGeoMedium *pMed=NULL; if (gGeoManager->GetMedium("Lead") ){ cout << "-I- TGeoManager: Lead Medium already defined " << endl; pMed = gGeoManager->GetMedium("Lead"); }else{ // Material definition // Material: Lead a = 207.190000; z = 82.000000; density = 11.350000; pMat = new TGeoMaterial("Lead", a,z,density); pMat->SetIndex(600); // Medium: Lead numed = 26; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pMed = new TGeoMedium("Lead", numed,pMat, par); } // TRANSFORMATION MATRICES // Combi transformation: dx = 0.000000; dy = 0.000000; dz = 0.000000; // Rotation: thx = 90.000000; phx = 0.000000; thy = 90.000000; phy = 90.000000; thz = 0.000000; phz = 0.000000; TGeoRotation *pRot = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix = new TGeoCombiTrans("", dx,dy,dz,pRot); // Shape: LeadTarget type: TGeoBBox dx = 1.600000; dy = 1.200000; dz = 0.008810; TGeoShape *pLeadTarget = new TGeoBBox("LeadTarget", dx,dy,dz); // Volume: leadTarget_log TGeoVolume* pleadTarget_log = new TGeoVolume("leadTarget_log",pLeadTarget, pMed); pleadTarget_log->SetVisLeaves(kTRUE); TGeoVolume *top = gGeoManager->GetTopVolume(); TGeoCombiTrans* pGlobal = GetGlobalPosition(pMatrix); top->AddNode(pleadTarget_log, 0, pGlobal); } void R3BTarget::ConstructGeometry2(){ cout << endl; cout << "-I- R3BTarget:: ConstructGeometry() "<< endl; cout << "-I- R3BTarget Target type: Parafine @ 0 deg "<< endl; cout << endl; Double_t dx,dy,dz; Double_t a; Double_t thx, phx, thy, phy, thz, phz; Double_t phi1, phi2; Double_t z, density, w; Int_t nel, numed; // MATERIALS, MIXTURES AND TRACKING MEDIA TGeoMedium * pMed2=NULL; if (gGeoManager->GetMedium("Air") ){ pMed2=gGeoManager->GetMedium("Air"); }else{ // Mixture: Air nel = 2; density = 0.001290; TGeoMixture* pMat2 = new TGeoMixture("Air", nel,density); a = 14.006740; z = 7.000000; w = 0.700000; // N pMat2->DefineElement(0,a,z,w); a = 15.999400; z = 8.000000; w = 0.300000; // O pMat2->DefineElement(1,a,z,w); pMat2->SetIndex(1); numed = 14; Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pMed2 = new TGeoMedium("Air", numed,pMat2,par); } // Mixture: CH2 TGeoMedium * pMed16=NULL; if (gGeoManager->GetMedium("CH2") ){ cout << "-I- TGeoManager: CH2 Medium already defined " << endl; pMed16=gGeoManager->GetMedium("CH2"); }else{ nel = 2; density = 0.930000; TGeoMixture* pMat16 = new TGeoMixture("CH2", nel,density); a = 12.010700; z = 6.000000; w = 0.856281; // C pMat16->DefineElement(0,a,z,w); a = 1.007940; z = 1.000000; w = 0.143719; // H pMat16->DefineElement(1,a,z,w); pMat16->SetIndex(15); // Medium: CH2 numed = 15; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pMed16 = new TGeoMedium("CH2", numed,pMat16, par); } // TRANSFORMATION MATRICES // Combi transformation: dx = 0.000000; dy = 0.000000; dz = 0.000000; // Rotation: thx = 90.000000; phx = 0.000000; thy = 90.000000; phy = 90.000000; thz = 0.000000; phz = 0.000000; TGeoRotation *pMatrix3 = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix2 = new TGeoCombiTrans("", dx,dy,dz,pMatrix3); TGeoVolume *top = gGeoManager->GetTopVolume(); // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY // Shape: Parafin0deg type: TGeoTubeSeg Double_t rmin = 0.000000; Double_t rmax = 1.000000; dz = 0.005500; phi1 = 0.000000; phi2 = 360.000000; TGeoShape *pParafin0deg = new TGeoTubeSeg("Parafin0deg",rmin,rmax,dz,phi1,phi2); // Volume: Parafin0deg TGeoVolume* pParafin0deg_log = new TGeoVolume("Parafin0deg",pParafin0deg, pMed16); pParafin0deg_log->SetVisLeaves(kTRUE); TGeoCombiTrans* pGlobal = GetGlobalPosition(pMatrix2); top->AddNode(pParafin0deg_log, 0, pGlobal); } void R3BTarget::ConstructGeometry3(){ cout << endl; cout << "-I- R3BTarget:: ConstructGeometry() "<< endl; cout << "-I- R3BTarget Target type; Parafine @ 45 deg "<< endl; cout << endl; Double_t dx,dy,dz; Double_t theta, phi; Double_t a; Double_t thx, phx, thy, phy, thz, phz; Double_t alpha; Double_t z, density, w; Int_t nel, numed; // MATERIALS, MIXTURES AND TRACKING MEDIA // Mixture: Air TGeoMedium * pMed2=NULL; if (gGeoManager->GetMedium("Air") ){ pMed2=gGeoManager->GetMedium("Air"); }else{ nel = 2; density = 0.001290; TGeoMixture* pMat2 = new TGeoMixture("Air", nel,density); a = 14.006740; z = 7.000000; w = 0.700000; // N pMat2->DefineElement(0,a,z,w); a = 15.999400; z = 8.000000; w = 0.300000; // O pMat2->DefineElement(1,a,z,w); pMat2->SetIndex(1); // Medium: Air numed = 1; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pMed2 = new TGeoMedium("Air", numed,pMat2, par); } // Mixture: CH2 TGeoMedium * pMed16=NULL; if (gGeoManager->GetMedium("CH2") ){ pMed16=gGeoManager->GetMedium("CH2"); }else{ nel = 2; density = 0.930000; TGeoMixture* pMat16 = new TGeoMixture("CH2", nel,density); a = 12.010700; z = 6.000000; w = 0.856281; // C pMat16->DefineElement(0,a,z,w); a = 1.007940; z = 1.000000; w = 0.143719; // H pMat16->DefineElement(1,a,z,w); pMat16->SetIndex(15); // Medium: CH2 numed = 15; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pMed16 = new TGeoMedium("CH2", numed,pMat16, par); } // TRANSFORMATION MATRICES // Combi transformation: dx = 0.000000; dy = 0.000000; dz = 0.000000; // Rotation: thx = 135.000000; phx = 0.000000; thy = 90.000000; phy = 90.000000; thz = 45.000000; phz = 0.000000; TGeoRotation *pMatrix3 = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix2 = new TGeoCombiTrans("", dx,dy,dz,pMatrix3); TGeoVolume *top = gGeoManager->GetTopVolume(); // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY // Shape: Para45deg type: TGeoPara dx = 1.450000; dy = 1.000000; dz = 0.005500; alpha = 0.000000; theta = 45.000000; phi = -180.000000; TGeoShape *pPara45deg = new TGeoPara("Para45deg",dx,dy,dz,alpha,theta,phi); // Volume: Para45deg TGeoVolume* pPara45deg_log = new TGeoVolume("Para45deg",pPara45deg, pMed16); pPara45deg_log->SetVisLeaves(kTRUE); TGeoCombiTrans* pGlobal = GetGlobalPosition(pMatrix2); top->AddNode(pPara45deg_log, 0, pGlobal); } void R3BTarget::ConstructGeometry4(){ cout << endl; cout << "-I- R3BTarget:: ConstructGeometry() "<< endl; cout << "-I- R3BTarget Target type: LiH "<< endl; cout << endl; Double_t dx,dy,dz; Double_t a; Double_t thx, phx, thy, phy, thz, phz; Double_t phi1, phi2; Double_t z, density, radl, absl, w; Int_t nel, numed; // MATERIALS, MIXTURES AND TRACKING MEDIA // Mixture: Air TGeoMedium * pMed2=NULL; if (gGeoManager->GetMedium("Air") ){ pMed2=gGeoManager->GetMedium("Air"); }else{ nel = 2; density = 0.001290; TGeoMixture* pMat2 = new TGeoMixture("Air", nel,density); a = 14.006740; z = 7.000000; w = 0.700000; // N pMat2->DefineElement(0,a,z,w); a = 15.999400; z = 8.000000; w = 0.300000; // O pMat2->DefineElement(1,a,z,w); pMat2->SetIndex(1); // Medium: Air numed = 1; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pMed2 = new TGeoMedium("Air", numed,pMat2, par); } // Mixture: Mylar TGeoMedium * pMed15=NULL; if (gGeoManager->GetMedium("Mylar") ){ pMed15=gGeoManager->GetMedium("Mylar"); }else{ nel = 3; density = 1.397000; TGeoMixture* pMat15 = new TGeoMixture("Mylar", nel,density); a = 12.010700; z = 6.000000; w = 0.625010; // C pMat15->DefineElement(0,a,z,w); a = 1.007940; z = 1.000000; w = 0.041961; // H pMat15->DefineElement(1,a,z,w); a = 15.999400; z = 8.000000; w = 0.333029; // O pMat15->DefineElement(2,a,z,w); pMat15->SetIndex(14); // Medium: Mylar numed = 14; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pMed15 = new TGeoMedium("Mylar", numed,pMat15,par); } // Material: H2 TGeoMedium * pMed3=NULL; if (gGeoManager->GetMedium("H2") ){ pMed3=gGeoManager->GetMedium("H2"); }else{ a = 1.007940; z = 1.000000; density = 0.070800; radl = 816.908193; absl = 4956.556132; TGeoMaterial* pMat3 = new TGeoMaterial("H2", a,z,density,radl,absl); pMat3->SetIndex(2); // Medium: H2 numed = 2; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pMed3 = new TGeoMedium("H2", numed,pMat3,par); } // TRANSFORMATION MATRICES // Combi transformation: dx = 0.000000; dy = 0.000000; dz = 0.000000; // Rotation: thx = 90.000000; phx = 0.000000; thy = 90.000000; phy = 90.000000; thz = 0.000000; phz = 0.000000; TGeoRotation *pMatrix3 = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix2 = new TGeoCombiTrans("", dx,dy,dz,pMatrix3); // Combi transformation: dx = 0.000000; dy = 0.000000; dz = 1.765000; // Rotation: thx = 90.000000; phx = 0.000000; thy = 90.000000; phy = 90.000000; thz = 0.000000; phz = 0.000000; TGeoRotation *pMatrix5 = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix4 = new TGeoCombiTrans("", dx,dy,dz,pMatrix5); // Combi transformation: dx = 0.000000; dy = 0.000000; dz = 0.007500; // Rotation: thx = 90.000000; phx = 0.000000; thy = 90.000000; phy = 90.000000; thz = 0.000000; phz = 0.000000; TGeoRotation *pMatrix7 = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix6 = new TGeoCombiTrans("", dx,dy,dz,pMatrix7); // Combi transformation: dx = 0.000000; dy = 0.000000; dz = 0.007500; // Rotation: thx = 90.000000; phx = 0.000000; thy = 90.000000; phy = 90.000000; thz = 0.000000; phz = 0.000000; TGeoRotation *pMatrix9 = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix8 = new TGeoCombiTrans("", dx,dy,dz,pMatrix9); // Combi transformation: dx = 0.000000; dy = 0.000000; dz = 3.522500; // Rotation: thx = 90.000000; phx = 0.000000; thy = 90.000000; phy = 90.000000; thz = 0.000000; phz = 0.000000; TGeoRotation *pMatrix11 = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix10 = new TGeoCombiTrans("", dx,dy,dz,pMatrix11); TGeoVolume *top = gGeoManager->GetTopVolume(); // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY // Shape: TargetEnveloppe type: TGeoTubeSeg Double_t rmin = 0.000000; Double_t rmax = 1.015000; dz = 7.045000; phi1 = 0.000000; phi2 = 360.000000; TGeoShape *pTargetEnveloppe = new TGeoTubeSeg("TargetEnveloppe",rmin,rmax,dz,phi1,phi2); // Volume: TargetEnveloppe TGeoVolume* pTargetEnveloppe_log = new TGeoVolume("TargetEnveloppe",pTargetEnveloppe, pMed2); pTargetEnveloppe_log->SetVisLeaves(kTRUE); // Position Mother Volume TGeoCombiTrans* pGlobal = GetGlobalPosition(pMatrix2); top->AddNode(pTargetEnveloppe_log, 0, pGlobal); // Shape: Target1 type: TGeoTubeSeg rmin = 1.000000; rmax = 1.015000; dz = 1.750000; phi1 = 0.000000; phi2 = 360.000000; TGeoShape *pTarget1 = new TGeoTubeSeg("Target1",rmin,rmax,dz,phi1,phi2); // Volume: Target1 TGeoVolume* pTarget1_log = new TGeoVolume("Target1",pTarget1, pMed15); pTarget1_log->SetVisLeaves(kTRUE); pTargetEnveloppe_log->AddNode(pTarget1_log, 0, pMatrix4); // Shape: Target2 type: TGeoTubeSeg rmin = 0.000000; rmax = 1.000000; dz = 1.750000; phi1 = 0.000000; phi2 = 360.000000; TGeoShape *pTarget2 = new TGeoTubeSeg("Target2",rmin,rmax,dz,phi1,phi2); // Volume: Target2 TGeoVolume* pTarget2_log = new TGeoVolume("Target2",pTarget2, pMed3); pTarget2_log->SetVisLeaves(kTRUE); pTargetEnveloppe_log->AddNode(pTarget2_log, 0, pMatrix6); // Shape: Target3 type: TGeoTubeSeg rmin = 0.000000; rmax = 1.015000; dz = 0.007500; phi1 = 0.000000; phi2 = 360.000000; TGeoShape *pTarget3 = new TGeoTubeSeg("Target3",rmin,rmax,dz,phi1,phi2); // Volume: Target3 TGeoVolume* pTarget3_log = new TGeoVolume("Target3",pTarget3, pMed15); pTarget3_log->SetVisLeaves(kTRUE); pTargetEnveloppe_log->AddNode(pTarget3_log, 0, pMatrix8); pTargetEnveloppe_log->AddNode(pTarget3_log, 1, pMatrix10); } void R3BTarget::ConstructGeometry5(){ cout << endl; cout << "-I- R3BTarget::ConstructGeometry5() "<< endl; cout << "-I- R3BTarget - Sofia experiment Target type: H2 "<< endl; cout << endl; Double_t dx,dy,dz,dz1,dz2,dz3; Double_t a; Double_t thx, phx, thy, phy, thz, phz; Double_t phi1, phi2; Double_t z, density, w; Int_t nel, numed; // MATERIALS, MIXTURES AND TRACKING MEDIA // -- Material: Iron Double_t radl = 0.; Double_t absl = 0.; TGeoMedium * pMedFe=NULL; if (gGeoManager->GetMedium("Iron") ){ pMedFe=gGeoManager->GetMedium("Iron"); }else{ w = 0.; a = 55.850000; z = 26.000000; density = 7.870000; TGeoMaterial* pMatFe = new TGeoMaterial("Iron", a,z,density); pMatFe->SetIndex(701); // Medium: Fe numed = 23; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000000; // epsil par[7] = 0.000000; // stmin pMedFe = new TGeoMedium("Iron", numed,pMatFe, par); } // Material: H2 TGeoMedium * pMedH2=NULL; if (gGeoManager->GetMedium("H2") ){ pMedH2=gGeoManager->GetMedium("H2"); }else{ a = 1.007940; z = 1.000000; density = 0.087; TGeoMaterial* pMatH2 = new TGeoMaterial("H2", a,z,density); pMatH2->SetIndex(2); // Medium: H2 numed = 2; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pMedH2 = new TGeoMedium("H2", numed,pMatH2,par); } // Material: Vacuum TGeoMedium * pMedVac=NULL; if (gGeoManager->GetMedium("vacuum") ){ cout << "-I- TGeoManager: Vacuum Medium already defined " << endl; pMedVac=gGeoManager->GetMedium("vacuum"); }else{ a = 1.e-16; z = 1.e-16; density = 1.e-16; TGeoMaterial* pMat17 = new TGeoMaterial("vacuum", a,z,density); pMat17->SetIndex(150); numed = 150; // medium number Double_t par[8]; par[0] = 0.000000; // isvol par[1] = 0.000000; // ifield par[2] = 0.000000; // fieldm par[3] = 0.000000; // tmaxfd par[4] = 0.000000; // stemax par[5] = 0.000000; // deemax par[6] = 0.000100; // epsil par[7] = 0.000000; // stmin pMedVac = new TGeoMedium("vacuum", numed,pMat17, par); } //WORLD TGeoVolume *pAWorld = gGeoManager->GetTopVolume(); // Defintion of the Mother Volume TGeoShape *pCBWorld = new TGeoBBox("H2_box", 30.0/2.0, 200.0/2.0, 30./2.0); TGeoVolume* top = new TGeoVolume("TargetH2_World",pCBWorld, pMedVac); TGeoCombiTrans *t0 = new TGeoCombiTrans(0,0,0,0); TGeoCombiTrans *pGlobalc = GetGlobalPosition(t0); // add the sphere as Mother Volume pAWorld->AddNodeOverlap(top, 0, pGlobalc); // TRANSFORMATION MATRICES // Combi transformation: dx = 0.00000; dy = 0.00000; dz = 0.00000; // Rotation: thx = 90.000; phx = 0.000000; thy = 90.000; phy = 90.000000; thz = 0.000; phz = 0.0000; TGeoRotation *pRot6 = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix6 = new TGeoCombiTrans("", dx,dy,dz,pRot6); // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY // Shape: TargetEnveloppe type: TGeoTubeSeg Double_t rmin = 1.4998; Double_t rmax = 1.5; dz = 1.200000; phi1 = 0.000000; phi2 = 360.0000; TGeoShape *pTargetEnveloppe = new TGeoTubeSeg("TargetEnveloppe",rmin,rmax,dz/2.,phi1,phi2); // Volume: TargetEnveloppe TGeoVolume* pTargetEnveloppe_log = new TGeoVolume("TargetEnveloppe",pTargetEnveloppe, pMedFe); pTargetEnveloppe_log->SetVisLeaves(kTRUE); pTargetEnveloppe_log ->SetLineColor(17); // Position Mother Volume TGeoCombiTrans* pGlobal6 = GetGlobalPosition(pMatrix6); top->AddNode(pTargetEnveloppe_log, 0, pGlobal6); // TRANSFORMATION MATRICES // Combi transformation: dx = 0.00000; dy = 0.00000; dz = 0.00000; // Rotation: thx = 90.000; phx = 0.000000; thy = 90.000; phy = 90.000000; thz = 0.000; phz = 0.0000; TGeoRotation *pRot7 = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix7 = new TGeoCombiTrans("", dx,dy,dz,pRot7); // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY // Shape: TargetEnveloppe type: TGeoTubeSeg rmin = 0.0000; rmax = 1.4998; dz = 1.000000; phi1 = 0.000000; phi2 = 360.0000; TGeoShape *pTargetEnveloppe2 = new TGeoTubeSeg("TargetEnveloppe",rmin,rmax,dz/2.,phi1,phi2); // Volume: TargetEnveloppe TGeoVolume* pTargetEnveloppe_log2 = new TGeoVolume("TargetEnveloppe",pTargetEnveloppe2, pMedH2); pTargetEnveloppe_log2->SetVisLeaves(kTRUE); // Position Mother Volume TGeoCombiTrans* pGlobal7 = GetGlobalPosition(pMatrix7); top->AddNode(pTargetEnveloppe_log2, 0, pGlobal7); // TRANSFORMATION MATRICES // Combi transformation: dx = 0.00000; dy = 0.00000; dz = -21.950; // Rotation: thx = 90.000; phx = 0.000000; thy = 90.000; phy = 90.000000; thz = 0.000; phz = 0.0000; TGeoRotation *pRot8 = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix8 = new TGeoCombiTrans("", dx,dy,dz,pRot8); // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY // Shape: TargetEnveloppe type: TGeoTubeSeg rmin = 22.5000; rmax = 22.59980; phi1 = 0.000000; phi2 = 360.0000; TGeoShape *pTargetEnveloppe3 = new TGeoSphere("Esfera",rmin,rmax,0.,3.714,phi1,phi2); // Volume: TargetEnveloppe TGeoVolume* pTargetEnveloppe_log3 = new TGeoVolume("Target",pTargetEnveloppe3, pMedH2); pTargetEnveloppe_log3->SetVisLeaves(kTRUE); // Position Mother Volume TGeoCombiTrans* pGlobal8 = GetGlobalPosition(pMatrix8); top->AddNode(pTargetEnveloppe_log3, 0, pGlobal8); // TRANSFORMATION MATRICES // Combi transformation: dx = 0.00000; dy = 0.00000; dz = -21.940; // Rotation: thx = 90.000; phx = 0.000000; thy = 90.000; phy = 90.000000; thz = 0.000; phz = 0.0000; TGeoRotation *pRot9 = new TGeoRotation("",thx,phx,thy,phy,thz,phz); TGeoCombiTrans* pMatrix9 = new TGeoCombiTrans("", dx,dy,dz,pRot9); // SHAPES, VOLUMES AND GEOMETRICAL HIERARCHY // Shape: TargetEnveloppe type: TGeoTubeSeg rmin = 22.59980; rmax = 22.60000; phi1 = 0.000000; phi2 = 360.0000; TGeoShape *pTargetEnveloppe4 = new TGeoSphere("Esfera",rmin,rmax,0.,3.814,phi1,phi2); // Volume: TargetEnveloppe TGeoVolume* pTargetEnveloppe_log4 = new TGeoVolume("Target",pTargetEnveloppe4, pMedFe); pTargetEnveloppe_log4->SetVisLeaves(kTRUE); pTargetEnveloppe_log4->SetLineColor(17); // Position Mother Volume TGeoCombiTrans* pGlobal9 = GetGlobalPosition(pMatrix9); top->AddNode(pTargetEnveloppe_log4, 0, pGlobal9); TGeoRotation *rot_t = new TGeoRotation("rot"); rot_t->RotateX(90.0); // TRANSFORMATION MATRICES // Combi transformation: dx = 0.00000; dy = 6.95000; dz = 0.000; TGeoCombiTrans* pMatrix24 = new TGeoCombiTrans("", dx,dy,dz,rot_t); // Shape: sofia24 type: TGeoTubeSeg rmin = 8.50000; rmax = 9.00000; dz = 33.5000; phi1 = 0.00000; phi2 = 360.000; TGeoShape *dec2 = new TGeoTubeSeg("dec2",rmin,rmax,dz/2.,phi1,phi2); // Volume: TGeoVolume* dec_log2 = new TGeoVolume("dec_log2",dec2, pMedFe); dec_log2->SetVisLeaves(kTRUE); dec_log2->SetLineColor(17); // Position Volume TGeoCombiTrans* pGlobal24 = GetGlobalPosition(pMatrix24); // top->AddNode(dec_log2, 0, pGlobal24); // TRANSFORMATION MATRICES // Combi transformation: dx = 0.00000; dy = 0.00000; dz = 0.00000; TGeoRotation *rot_t2 = new TGeoRotation("rot2"); rot_t2->RotateX(0.0); TGeoCombiTrans* pMatrix25 = new TGeoCombiTrans("", dx,dy,dz,rot_t2); // Shape: sofia24 type: TGeoTubeSeg rmin = 0.00000; rmax = 2.80000; dz = 29.0000; phi1 = 0.00000; phi2 = 360.000; TGeoShape *dec3 = new TGeoTubeSeg("dec3",rmin,rmax,dz/2.,phi1,phi2); // Volume: TGeoVolume* dec_log3 = new TGeoVolume("dec_log3",dec3, pMedFe); dec_log3->SetVisLeaves(kTRUE); dec_log3->SetLineColor(17); // Position Volume TGeoCombiTrans* pGlobal25 = GetGlobalPosition(pMatrix25); //top->AddNode(dec_log3, 0, pGlobal25); TGeoSubtraction* sub = new TGeoSubtraction(dec2,dec3,pMatrix24,pMatrix25); TGeoShape *kam = new TGeoCompositeShape("GE", sub); TGeoVolume* kammer_log25 = new TGeoVolume("",kam, pMedFe); kammer_log25->SetVisLeaves(kTRUE); kammer_log25->SetLineColor(4); // top->AddNode(kammer_log25, 0, 0); // Shape: sofia24 type: TGeoTubeSeg rmin = 2.50000; rmax = 2.80000; dz = 6.5000; phi1 = 0.00000; phi2 = 360.000; TGeoShape *dec4 = new TGeoTubeSeg("dec4",rmin,rmax,dz/2.,phi1,phi2); TGeoRotation *rot_t3 = new TGeoRotation("rot3"); rot_t3->RotateX(0.0); TGeoCombiTrans* pMatrix26 = new TGeoCombiTrans("", 0.0,0.0,11.75,rot_t3); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode8 = new TGeoUnion(kam,dec4,0,pMatrix26); TGeoShape *pBoolNode9 = new TGeoCompositeShape("GE", pBoolNode8); //TGeoVolume* //Detector_1 = new TGeoVolume("Detect",pBoolNode9, pMedFe); //Detector_1->SetVisLeaves(kTRUE); //Detector_1->SetLineColor(2); // top->AddNode(Detector_1, 0, 0); TGeoCombiTrans* pMatrix27 = new TGeoCombiTrans("", 0.0,0.0,-11.75,rot_t3); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode18 = new TGeoUnion(pBoolNode9,dec4,0,pMatrix27); TGeoShape *pBoolNode19 = new TGeoCompositeShape("GE", pBoolNode18); // TGeoVolume* // Detector_1 = new TGeoVolume("Detect",pBoolNode19, pMedFe); // Detector_1->SetVisLeaves(kTRUE); // Detector_1->SetLineColor(2); // top->AddNode(Detector_1, 0, 0); TGeoRotation *rot_t4 = new TGeoRotation("rot4"); rot_t4->RotateX(90.0); TGeoCombiTrans* pMatrix28 = new TGeoCombiTrans("", 0.0,-9.55,0.0,rot_t4); // Shape: sofia24 type: TGeoTubeSeg rmin = 0.00000; rmax = 8.50000; dz = 0.50000; phi1 = 0.00000; phi2 = 360.000; TGeoShape *dec5 = new TGeoTubeSeg("dec5",rmin,rmax,dz/2.,phi1,phi2); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode28 = new TGeoUnion(pBoolNode19,dec5,0,pMatrix28); TGeoShape *pBoolNode29 = new TGeoCompositeShape("GE", pBoolNode28); //TGeoVolume* //Detector_1 = new TGeoVolume("Detect",pBoolNode29, pMedFe); //Detector_1->SetVisLeaves(kTRUE); //Detector_1->SetLineColor(2); //top->AddNode(Detector_1, 0, 0); TGeoCombiTrans* pMatrix29 = new TGeoCombiTrans("", 0.0,36.2,0.0,rot_t4); // Shape: sofia24 type: TGeoTubeSeg rmin = 7.5000; rmax = 8.0000; dz = 25.000; phi1 = 0.0000; phi2 = 360.00; TGeoShape *dec6 = new TGeoTubeSeg("dec5",rmin,rmax,dz/2.,phi1,phi2); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode38 = new TGeoUnion(pBoolNode29,dec6,0,pMatrix29); TGeoShape *pBoolNode39 = new TGeoCompositeShape("GE", pBoolNode38); // TGeoVolume* // Detector_1 = new TGeoVolume("Detect",pBoolNode39, pMedFe); // Detector_1->SetVisLeaves(kTRUE); // Detector_1->SetLineColor(2); // top->AddNode(Detector_1, 0, 0); TGeoCombiTrans* pMatrix30 = new TGeoCombiTrans("", 0.0,48.45,0.0,rot_t4); // Shape: sofia24 type: TGeoTubeSeg rmin = 8.0000; rmax = 18.000; dz = 0.5000; phi1 = 0.0000; phi2 = 360.00; TGeoShape *dec7 = new TGeoTubeSeg("dec5",rmin,rmax,dz/2.,phi1,phi2); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode48 = new TGeoUnion(pBoolNode39,dec7,0,pMatrix30); TGeoShape *pBoolNode49 = new TGeoCompositeShape("GE", pBoolNode48); //TGeoVolume* //Detector_1 = new TGeoVolume("De",pBoolNode49, pMedFe); //Detector_1->SetVisLeaves(kTRUE); //Detector_1->SetLineColor(17); // top->AddNode(Detector_1, 0, 0); TGeoCombiTrans* pMatrix31 = new TGeoCombiTrans("", 0.0,83.7,0.0,rot_t4); // Shape: sofia24 type: TGeoTubeSeg rmin = 17.500; rmax = 18.000; dz = 70.000; phi1 = 0.0000; phi2 = 360.00; TGeoShape *dec8 = new TGeoTubeSeg("dec8",rmin,rmax,dz/2.,phi1,phi2); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode58 = new TGeoUnion(pBoolNode49,dec8,0,pMatrix31); TGeoShape *pBoolNode59 = new TGeoCompositeShape("GE", pBoolNode58); //TGeoVolume* //Detector_1 = new TGeoVolume("De",pBoolNode59, pMedFe); //Detector_1->SetVisLeaves(kTRUE); //Detector_1->SetLineColor(17); // top->AddNode(Detector_1, 0, 0); TGeoCombiTrans* pMatrix32 = new TGeoCombiTrans("", 0.0,83.7+35.0-0.25,0.0,rot_t4); // Shape: sofia24 type: TGeoTubeSeg rmin = 0.0000; rmax = 17.500; dz = 0.5000; phi1 = 0.0000; phi2 = 360.00; TGeoShape *dec9 = new TGeoTubeSeg("dec9",rmin,rmax,dz/2.,phi1,phi2); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode68 = new TGeoUnion(pBoolNode59,dec9,0,pMatrix32); TGeoShape *pBoolNode69 = new TGeoCompositeShape("GE", pBoolNode68); //TGeoVolume* //Detector_1 = new TGeoVolume("De",pBoolNode69, pMedFe); //Detector_1->SetVisLeaves(kTRUE); //Detector_1->SetLineColor(17); //top->AddNode(Detector_1, 0, 0); TGeoCombiTrans* pMatrix33 = new TGeoCombiTrans("", 0.0,23.7-0.25,0.0,rot_t4); // Shape: sofia24 type: TGeoTubeSeg rmin = 8.0000; rmax = 8.5000; dz = 0.5000; phi1 = 0.0000; phi2 = 360.00; TGeoShape *dec10 = new TGeoTubeSeg("dec10",rmin,rmax,dz/2.,phi1,phi2); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode78 = new TGeoUnion(pBoolNode69,dec10,0,pMatrix33); TGeoShape *pBoolNode79 = new TGeoCompositeShape("GE", pBoolNode78); //TGeoVolume* //Detector_1 = new TGeoVolume("De",pBoolNode79, pMedFe); //Detector_1->SetVisLeaves(kTRUE); //Detector_1->SetLineColor(17); //top->AddNode(Detector_1, 0, 0); TGeoCombiTrans* pMatrix34 = new TGeoCombiTrans("", 0.0,57.2,0.0,rot_t4); // Shape: sofia24 type: TGeoTubeSeg rmin = 18.000; rmax = 20.500; dz = 2.0000; phi1 = 0.0000; phi2 = 360.00; TGeoShape *dec11 = new TGeoTubeSeg("dec11",rmin,rmax,dz/2.,phi1,phi2); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode88 = new TGeoUnion(pBoolNode79,dec11,0,pMatrix34); TGeoShape *pBoolNode89 = new TGeoCompositeShape("GE", pBoolNode88); //TGeoVolume* //Detector_1 = new TGeoVolume("De",pBoolNode89, pMedFe); //Detector_1->SetVisLeaves(kTRUE); // Detector_1->SetLineColor(17); // top->AddNode(Detector_1, 0, 0); TGeoCombiTrans* pMatrix34b = new TGeoCombiTrans("", 0.0,57.2+2.4,0.0,rot_t4); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode88b = new TGeoUnion(pBoolNode89,dec11,0,pMatrix34b); TGeoShape *pBoolNode89b = new TGeoCompositeShape("GE", pBoolNode88b); //TGeoVolume* // Detector_1 = new TGeoVolume("De",pBoolNode89b, pMedFe); // Detector_1->SetVisLeaves(kTRUE); // Detector_1->SetLineColor(17); // top->AddNode(Detector_1, 0, 0); TGeoCombiTrans* pMatrix34c = new TGeoCombiTrans("", 0.0,106.2 ,0.0,rot_t4); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode88c = new TGeoUnion(pBoolNode89b,dec11,0,pMatrix34c); TGeoShape *pBoolNode89c = new TGeoCompositeShape("GE", pBoolNode88c); //TGeoVolume* //Detector_1 = new TGeoVolume("Des",pBoolNode89c, pMedFe); //Detector_1->SetVisLeaves(kTRUE); //Detector_1->SetLineColor(17); //top->AddNode(Detector_1, 1, 0); TGeoCombiTrans* pMatrix34d = new TGeoCombiTrans("", 0.0,106.2+2.4,0.0,rot_t4); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode88d = new TGeoUnion(pBoolNode89c,dec11,0,pMatrix34d); TGeoShape *pBoolNode89d = new TGeoCompositeShape("GE", pBoolNode88d); //TGeoVolume* //Detector_1 = new TGeoVolume("Des",pBoolNode89d, pMedFe); //Detector_1->SetVisLeaves(kTRUE); //Detector_1->SetLineColor(17); //top->AddNode(Detector_1, 0, 0); TGeoRotation *rot_t5 = new TGeoRotation("rot5"); rot_t5->RotateX(0.0); TGeoCombiTrans* pMatrix35 = new TGeoCombiTrans("", 0.0,0.0,9.0+6.0-0.2,rot_t5); // Shape: sofia24 type: TGeoTubeSeg rmin = 2.8000; rmax = 3.7000; dz = 0.4000; phi1 = 0.0000; phi2 = 360.00; TGeoShape *dec12 = new TGeoTubeSeg("dec12",rmin,rmax,dz/2.,phi1,phi2); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode98 = new TGeoUnion(pBoolNode89d,dec12,0,pMatrix35); TGeoShape *pBoolNode99 = new TGeoCompositeShape("GE", pBoolNode98); //TGeoVolume* //Detector_1 = new TGeoVolume("De",pBoolNode99, pMedFe); //Detector_1->SetVisLeaves(kTRUE); //Detector_1->SetLineColor(17); //top->AddNode(Detector_1, 0, 0); TGeoCombiTrans* pMatrix35b = new TGeoCombiTrans("", 0.0,0.0,-(9.0+6.0-0.2),rot_t5); // Shape: Blinda3 type: TGeoTubeSeg TGeoUnion* pBoolNode98b = new TGeoUnion(pBoolNode99,dec12,0,pMatrix35b); TGeoShape *pBoolNode99b = new TGeoCompositeShape("GE", pBoolNode98b); TGeoVolume* Detector_1 = new TGeoVolume("De",pBoolNode99b, pMedFe); Detector_1->SetVisLeaves(kTRUE); Detector_1->SetLineColor(17); top->AddNode(Detector_1, 0, 0); } ClassImp(R3BTarget)