// ------ // Author: Jose Luis Rodriguez ------ // ------ // Last Update: 29/09/11 ------ //---------------------------------------------------------------------------- /* 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 "R3Btubevacuum.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 "TGeoTube.h" #include "TGeoSphere.h" #include "TGeoPcon.h" #include "TGeoBoolNode.h" #include "TGeoPgon.h" #include using namespace std; R3Btubevacuum::~R3Btubevacuum() { if (fTargetName ) delete fTargetName; } R3Btubevacuum::R3Btubevacuum() { fTargetName=NULL; } R3Btubevacuum::R3Btubevacuum(const char * name, const char * title) : R3BModule(name ,title) { fTargetName = new TString(name); } void R3Btubevacuum::ConstructGeometry(){ if (*fTargetName == "VacuumPipe") return ConstructGeometry1(); } void R3Btubevacuum::ConstructGeometry1(){ cout << endl; cout << "-I- R3Btubevacuum:: ConstructGeometry1() "<< endl; cout << "-I- R3Btubevacuum Pipe type: Vacuum "<< endl; cout << endl; Double_t dx,dy,dz,dz1,dz2,dz3; Double_t a, rmax, rmin; 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 TGeoMedium * pMedFe=NULL; if (gGeoManager->GetMedium("Iron") ){ pMedFe=gGeoManager->GetMedium("Iron"); }else{ a = 12.850000; z = 6.000000; density = 3.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.000100; // epsil par[7] = 0.000000; // stmin pMedFe = new TGeoMedium("Iron", numed,pMatFe, par); } // Mixture: Air TGeoMedium * pAirMedium=NULL; if (gGeoManager->GetMedium("Air") ){ pAirMedium=gGeoManager->GetMedium("Air"); }else{ nel = 2; density = 0.001290; TGeoMixture* pAirMaterial = new TGeoMixture("Air", nel,density); a = 14.006740; z = 7.000000; w = 0.700000; // N pAirMaterial->DefineElement(0,a,z,w); a = 15.999400; z = 8.000000; w = 0.300000; // O pAirMaterial->DefineElement(1,a,z,w); pAirMaterial->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 pAirMedium = new TGeoMedium("Air", numed,pAirMaterial, par); } // Mixture: Mylar TGeoMedium * pMedMylar=NULL; if (gGeoManager->GetMedium("mylar") ){ pMedMylar=gGeoManager->GetMedium("mylar"); }else{ nel = 3; density = 1.390000; TGeoMixture* pMylarMaterial = new TGeoMixture("Mylar", nel,density); a = 12.010700; z = 6.000000; w = 0.363636; // C pMylarMaterial->DefineElement(0,a,z,w); a = 1.007940; z = 1.000000; w = 0.454545; // H pMylarMaterial->DefineElement(1,a,z,w); a = 15.999400; z = 8.000000; w = 0.181818; // O pMylarMaterial->DefineElement(2,a,z,w); // Medium: Mylar numed = 805; // medium number pMylarMaterial->SetIndex(numed); 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 pMedMylar = new TGeoMedium("Mylar", numed, pMylarMaterial, 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); } // Material: Helium TGeoMedium * pMedHe=NULL; if (gGeoManager->GetMedium("He") ){ pMedHe=gGeoManager->GetMedium("He"); }else{ a = 4.0026; z = 2.000000; density = 0.000166; TGeoMaterial* pMatHe = new TGeoMaterial("He", a,z,density); pMatHe->SetIndex(766); numed =766; // 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 pMedHe = new TGeoMedium("He", numed,pMatHe,par); } //WORLD TGeoVolume *pAWorld = gGeoManager->GetTopVolume(); TGeoRotation *rot_t = new TGeoRotation("rot"); rot_t->RotateY(0.0); // Defintion of the Mother Volume TGeoShape *pCBWorld = new TGeoBBox("box", 10.0, 10.0, 61.0); TGeoVolume* top = new TGeoVolume("Vacuum_pipe",pCBWorld, pAirMedium); TGeoCombiTrans *t0 = new TGeoCombiTrans(0.0,0.0,60.0+16.0,rot_t);// TGeoCombiTrans *pGlobalc = GetGlobalPosition(t0); // add the sphere as Mother Volume pAWorld->AddNodeOverlap(top, 0,pGlobalc); //******* Beam line ****************************** // TRANSFORMATION MATRICES // Combi transformation: dx = 0.000000; dy = 0.000000; dz = 0.000000; TGeoCombiTrans* pMatrix1 = new TGeoCombiTrans("", dx,dy,dz,0); // Shape: vacuum_1 type: TGeoTubeSeg rmin = 7.704000*0.71; rmax = 8.415000*0.71; dz = 120.0000; phi1 = 0.000000; phi2 = 360.0000; TGeoShape *vacuum_1 = new TGeoTubeSeg("vacuum_1",rmin,rmax,dz/2.,phi1,phi2); // Volume: TGeoVolume* vacuumlog_1 = new TGeoVolume("vacuumlog_1",vacuum_1, pMedFe); vacuumlog_1->SetVisLeaves(kTRUE); vacuumlog_1->SetLineColor(17); // Position Volume TGeoCombiTrans* pGlobal1 = GetGlobalPosition(pMatrix1); top->AddNode(vacuumlog_1, 0, pGlobal1); // Shape: vacuum_2 type: TGeoTubeSeg rmin = 0.000000; rmax = 7.704000*0.71; dz = 120.0000; phi1 = 0.000000; phi2 = 360.0000; TGeoShape *vacuum_2 = new TGeoTubeSeg("vacuum_2",rmin,rmax,dz/2.,phi1,phi2); // Volume: TGeoVolume* vacuumlog_2 = new TGeoVolume("vacuumlog_2",vacuum_2, pMedVac); vacuumlog_2->SetVisLeaves(kTRUE); vacuumlog_2->SetLineColor(2); // Position Volume top->AddNode(vacuumlog_2, 0, pGlobal1); // TRANSFORMATION MATRICES // Combi transformation: dx = 0.000000; dy = 0.000000; dz = 60.6; TGeoCombiTrans* pMatrix2 = new TGeoCombiTrans("", dx,dy,dz,0); // Shape: vacuum_3 type: TGeoTubeSeg rmin = 8.415000*0.71; rmax = 13.75000*0.71; dz = 1.200000; phi1 = 0.000000; phi2 = 360.0000; TGeoShape *vacuum_3 = new TGeoTubeSeg("vacuum_3",rmin,rmax,dz/2.,phi1,phi2); // Volume: TGeoVolume* vacuumlog_3 = new TGeoVolume("vacuumlog_3",vacuum_3, pMedFe); vacuumlog_3->SetVisLeaves(kTRUE); vacuumlog_3->SetLineColor(17); // Position Volume TGeoCombiTrans* pGlobal2 = GetGlobalPosition(pMatrix2); top->AddNode(vacuumlog_3, 0, pGlobal2); // TRANSFORMATION MATRICES // Combi transformation: dx = 0.000000; dy = 0.000000; dz = -60.6; TGeoCombiTrans* pMatrix3 = new TGeoCombiTrans("", dx,dy,dz,0); // Shape: vacuum_4 type: TGeoTubeSeg rmin = 8.415000*0.71; rmax = 13.75000*0.71; dz = 1.200000; phi1 = 0.000000; phi2 = 360.0000; TGeoShape *vacuum_4 = new TGeoTubeSeg("vacuum_4",rmin,rmax,dz/2.,phi1,phi2); // Volume: TGeoVolume* vacuumlog_4 = new TGeoVolume("vacuumlog_4",vacuum_4, pMedFe); vacuumlog_4->SetVisLeaves(kTRUE); vacuumlog_4->SetLineColor(17); // Position Volume TGeoCombiTrans* pGlobal3 = GetGlobalPosition(pMatrix3); top->AddNode(vacuumlog_4, 0, pGlobal3); // Shape: vacuum_5 type: TGeoTubeSeg rmin = 0.000000; rmax = 8.415000*0.71; dz = 0.005000; phi1 = 0.000000; phi2 = 360.0000; TGeoShape *vacuum_5 = new TGeoTubeSeg("vacuum_5",rmin,rmax,dz/2.,phi1,phi2); // Volume: TGeoVolume* vacuumlog_5 = new TGeoVolume("vacuumlog_5",vacuum_5, pMedMylar); vacuumlog_5->SetVisLeaves(kTRUE); vacuumlog_5->SetLineColor(28); // Position Volume top->AddNode(vacuumlog_5, 0, pGlobal3); // Shape: vacuum_6 type: TGeoTubeSeg rmin = 0.000000; rmax = 8.415000*0.71; dz = 0.005000; phi1 = 0.000000; phi2 = 360.0000; TGeoShape *vacuum_6 = new TGeoTubeSeg("vacuum_6",rmin,rmax,dz/2.,phi1,phi2); // Volume: TGeoVolume* vacuumlog_6 = new TGeoVolume("vacuumlog_6",vacuum_6, pMedMylar); vacuumlog_6->SetVisLeaves(kTRUE); vacuumlog_6->SetLineColor(28); // Position Volume top->AddNode(vacuumlog_6, 0, pGlobal2); } ClassImp(R3Btubevacuum)