#include #include void CreateGDMLfile_ExtMirrOct2015(float pmt_pos_y_addend = 10, float pmt_pos_z_addend = 80, int RotMir=-10, float PMTrotX=5, float PMTrotY=5 , float EnlargedPMTWidth=4., float EnlargedPMTHight=2.){ ////////////////////////////////////// //Define variables float Delta_pmt_width=EnlargedPMTWidth; float Delta_pmt_height=EnlargedPMTHight; float Delta_RICH_height=2.2*Delta_pmt_height;//1900; float Delta_RICH_entrance_width=2.2*Delta_pmt_width;//950; float Delta_RICH_exit_width=2.2*Delta_pmt_width; float Delta_RICH_length=0.;//800; float Delta_RICH_position_from_IP=0.;//-800.;//==Delta_RICH_length float Delta_sens_plane_pos=1200.;//1220.; float Delta_sens_plane_area=0.1; //////////////////////////////////// float RICH_trapezoid_angle = 116.; float RICH_entrance_width = 2551.17 + Delta_RICH_entrance_width; float RICH_exit_width = 5136. + Delta_RICH_exit_width; float RICH_height = 4100. + Delta_RICH_height; float RICH_length = 1899.5 + Delta_RICH_length; float RICH_covering_thickness = 5.; float entrance_width_addend = 2.; float RICH_pipe_entrance_r = 103.5; float RICH_pipe_exit_r = 205.; float RICH_pipe_entrance_thickness = 3.; float RICH_pipe_exit_thickness = 5.; float RICH_pipe_angle = 0.; float RICH_position_from_IP = 1800. + Delta_RICH_position_from_IP; float RICH_mirror_position_from_IP = 3500.; float RICH_mirror_r = 3000.; float RICH_mirror_thickness = 6.; float mirror_cont_supp_addend_out = 6.; float pmt_width = 1000. + Delta_pmt_width; float pmt_height = 600. + Delta_pmt_height; float pmt_thickness = 0.5; float TTT = 1500.; float RICH_mirror_Y_shift = 805.; float RICH_mirror_angle = RotMir; float pmt_pos_x_addend = 0.; float sens_plane_pos = RICH_mirror_position_from_IP-RICH_position_from_IP-Delta_sens_plane_pos; float DefaultRotX=32.952765; float DefaultRotY=18.477;//for rotmir=-10 if(RotMir==1){DefaultRotX=10.952765.;} if(RotMir==-1){DefaultRotX=14.952765.;} //if(RotMir==-7){DefaultRotX=14.952765.;} float pmt_rot_x_addend = PMTrotX-DefaultRotX;//-27.952765; float pmt_rot_y_addend = PMTrotY-DefaultRotY;//-13.477; char GeoFileName[256]; // char* InFileLower="CreateGeo/2015_minus10deg_LowerPart_ModAug2015.gdml"; char* InFileLower="CreateGeo/minus10deg_ext_mirror_LowerPart.gdml"; //char* InFileLower="minus10deg_ext_mirror_LowerPart.gdml"; cout< lines; std::ofstream OutFile_GDML (OutFile_GDML_Ch); OutFile_GDML <<" " << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; // OutFile_GDML <<"" << std::endl; // OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML <<""; OutFile_GDML << " " << std::endl; OutFile_GDML <<""; OutFile_GDML << " " << std::endl; OutFile_GDML <<"" << std::endl; OutFile_GDML << " " << std::endl; string line; //std::vector lines; while ( getline (infile2,line) ){OutFile_GDML << line<Getenv("VMCWORKDIR")); TGeoManager *gdml = new TGeoManager("gdml", "FAIRGeom"); TGDMLParse parser; // Define your input GDML file HERE TGeoVolume* gdmlTop = parser.GDMLReadFile (vmcDir + OutFile_GDML_Str); TGeoVolume* rootTop = new TGeoVolumeAssembly("TOP"); gGeoManager->SetTopVolume(rootTop); // Define your position HERE TGeoRotation* rot = new TGeoRotation ("rot", 0., 0., 0.); TGeoCombiTrans* posrot = new TGeoCombiTrans (0., 0., 270., rot); rootTop->AddNode (gdmlTop, 1, posrot); gGeoManager->CloseGeometry(); // Define you output ROOT file HERE TFile* outfile = new TFile(vmcDir + OutFile_ROOT, "RECREATE"); rootTop->Write(); outfile->Close(); }