mcr/geom/ImportGeometry.C

00001 // @(#)fROOT/STEER:$Name:  $:$Id: ImportGeometry.C,v 1.1 2007/09/05 16:34:22 Diego_Faso Exp $
00002 // Author: Diego Faso <mailto:faso@to.infn.it>, 2007/09/05
00003 
00005 //                                                                       //
00006 //  --- ---                                                              //
00007 //  If you want to import the geometry from the FORTRAN Montecarlo code: //
00008 //     (within the fidarc/mc environment) [ new tcsh shell ]             //
00009 //     # cd $INP                                                         //
00010 //     # comment the "FIGEOM" card                                       //
00011 //     # set to 2003 geometry the "fidamc.dat" file                      //
00012 //     # $SCI/fidamc                                                     //
00013 //      (select workstation type = 1)                                    //
00014 //     # rz/file 21 fin_spec_geom_2003.geom on                           //
00015 //     # exit                                                            //
00016 //     # mv fin_spec_2003.geom <here>                                    //
00017 //                                                                       //
00018 //  --- repeat the whole procedure for 2006 geometry ---                 //
00019 //                                                                       //
00020 //  Now you should have into $PWD both:                                  //
00021 //     - fin_spec_geom_2003.root                                         //
00022 //     - fin_spec_geom_2006.root                                         //
00023 //
00024 //   see the "TFndGeometry.cxx" class description
00025 //   last imported geometry: fidamc-603 (Sept 05, 2007)
00026 //                                                                       //
00028 
00029 #include "TFndGeometry.h"
00030 
00031 TString root_geom_filename="";
00032 TString geant3_geom_path="";
00033 Bool_t CleanTmp=kTRUE;
00034 
00035 TString base_geoname = "fin_spec_geom";
00036 
00037 void Import_2003(){
00038   
00039   root_geom_filename.Form( "%s_2003.root",base_geoname.Data() );
00040   geant3_geom_path.Form(   "%s_2003.geom",base_geoname.Data() );
00041   
00042   if(gSystem->AccessPathName( geant3_geom_path.Data() ) ){
00043     gROOT->Warning("Import_2003","Could not import geometry: file \"%s\" missing...",geant3_geom_path.Data());
00044     return;
00045   }
00046   
00047   //   cout << "=> \"" << root_geom_filename.Data() << "\"." << endl;
00048   //   cout << "=> \"" << geant3_geom_path.Data() << "\"." << endl;
00049   TFndGeometry::ConvertFromGeant3( root_geom_filename, geant3_geom_path, CleanTmp);
00050 }
00051 
00052 void Import_2006(){
00053   
00054   root_geom_filename.Form( "%s_2006.root",base_geoname.Data() );
00055   geant3_geom_path.Form(   "%s_2006.geom",base_geoname.Data() );
00056   
00057   if(gSystem->AccessPathName( geant3_geom_path.Data() ) ){
00058     gROOT->Warning("Import_2006","Could not import geometry: file \"%s\" missing...",geant3_geom_path.Data());
00059     return;
00060   }
00061   
00062   //   cout << "===> \"" << root_geom_filename.Data() << "\"." << endl;
00063   //   cout << "===> \"" << geant3_geom_path.Data() << "\"." << endl;
00064   TFndGeometry::ConvertFromGeant3( root_geom_filename, geant3_geom_path, CleanTmp);
00065 }
00066 
00067 void ImportGeometry(){
00068   //Import_2003();
00069   Import_2006();
00070   
00071   
00072 }

Generated on Tue Oct 16 15:40:47 2007 by  doxygen 1.5.2