#include #include void CreateGDMLfile_April2015_ModAug2015(float pmt_pos_y_addend = 0, float pmt_pos_z_addend = 0, int RotMir=-10, float PMTrotX=5, float PMTrotY=5 , int DefaultDims=0, int DefaultDims_LargePMT=0){ ////////////////////////////////////// //Define variables float pmt_pos_z_MyAddend =0.; float Delta_pmt_width=800.; float Delta_pmt_height=600.; 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=800; float Delta_RICH_position_from_IP=-800.;//==Delta_RICH_length float Delta_sens_plane_pos=1220.; float Delta_sens_plane_area=0.1; if(DefaultDims==1){ Delta_pmt_width=0.; Delta_pmt_height=0.; if(DefaultDims_LargePMT==1){Delta_pmt_width=400.; Delta_pmt_height=300.;} Delta_RICH_height=2.2*Delta_pmt_height; Delta_RICH_entrance_width=2.2*Delta_pmt_width; Delta_RICH_exit_width=2.2*Delta_pmt_width; pmt_pos_z_MyAddend=0.; Delta_RICH_length=0; Delta_RICH_position_from_IP=0.; Delta_sens_plane_pos=1200.; } //////////////////////////////////// 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 + pmt_pos_z_MyAddend; float RICH_covering_thickness = 5.; float entrance_width_addend = 2.; float RICH_pipe_entrance_r = 103.5; float RICH_pipe_exit_r = 170.; 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. + pmt_pos_z_MyAddend; float sens_plane_pos = RICH_mirror_position_from_IP-RICH_position_from_IP-Delta_sens_plane_pos; 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 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; float pmt_pos_x_addend = 0.; // float pmt_pos_y_addend = 0.; // float pmt_pos_z_addend = 0.; ////////////// char RotMirText[256]; if(RotMir<0){sprintf( RotMirText,"RotMir_m%d",RotMir*-1);} else{sprintf( RotMirText,"RotMir_p%d",RotMir);} char GeoFileName[256]; char* InFileUpper="CreateGeo/2015_minus10deg_UpperPart.gdml";//[256];//not used //char* InFileLower="CreateGeo/2015_minus10deg_LowerPart.gdml";//[256]; char* InFileLower="CreateGeo/2015_minus10deg_LowerPart_ModAug2015.gdml";//[256]; cout< lines; std::ofstream OutFile_GDML (OutFile_GDML_Ch); //get upper part // while ( getline (infile1,line) ){OutFile_GDML << line< " << 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 <<"" << 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(); }