File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -801,6 +801,14 @@ void TRestGeant4Metadata::InitFromConfigFile() {
801801 cout << " \" gdmlFile\" parameter is not defined!" << endl;
802802 exit (1 );
803803 }
804+ if (TRestTools::isURL (fGdmlFilename .Data ())) {
805+ fGeometryPath = " " ;
806+ fGdmlFilename = TRestTools::DownloadRemoteFile (fGdmlFilename .Data ());
807+ if (fGdmlFilename == " " ) {
808+ cout << " Error downloading geometry file from URL: " << fGdmlFilename << endl;
809+ exit (1 );
810+ }
811+ }
804812
805813 fGeometryPath = GetParameter (" geometryPath" , " " );
806814
@@ -818,7 +826,7 @@ void TRestGeant4Metadata::InitFromConfigFile() {
818826 // if "gdmlFile" is purely a file (without any path) and "geometryPath" is
819827 // defined, we recombine them together
820828 if ((((string)fGdmlFilename ).find_first_not_of (" ./~" ) == 0 ||
821- ((string)fGdmlFilename ).find (" / " ) == string::npos) &&
829+ ((string)fGdmlFilename ).find (' / ' ) == string::npos) &&
822830 fGeometryPath != " " ) {
823831 if (fGeometryPath [fGeometryPath .Length () - 1 ] == ' /' ) {
824832 fGdmlFilename = fGeometryPath + GetParameter (" gdmlFile" );
@@ -945,7 +953,7 @@ Double_t TRestGeant4Metadata::GetCosmicIntensityInCountsPerSecond() const {
945953
946954Double_t TRestGeant4Metadata::GetEquivalentSimulatedTime () const {
947955 const auto countsPerSecond = GetCosmicIntensityInCountsPerSecond ();
948- const auto seconds = fNEvents / countsPerSecond;
956+ const auto seconds = double ( fNEvents ) / countsPerSecond;
949957 return seconds;
950958}
951959
You can’t perform that action at this time.
0 commit comments