Import Geant4 8.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:44:26 +02:00
parent 8a51e0bc40
commit 216a75eeb1
8717 changed files with 360418 additions and 141343 deletions
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4AuxiliaryNavServices.cc,v 1.2 2003/11/03 17:15:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4AuxiliaryNavServices.cc,v 1.3 2006/06/29 18:36:32 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// --------------------------------------------------------------------
+16 -13
View File
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4DrawVoxels.cc,v 1.3 2005/09/19 10:35:59 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4DrawVoxels.cc,v 1.4 2006/06/29 18:36:34 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// class G4DrawVoxels
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GeomTestErrorList.cc,v 1.2 2003/11/03 17:15:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4GeomTestErrorList.cc,v 1.3 2006/06/29 18:36:36 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class source file
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GeomTestOverlapList.cc,v 1.2 2003/11/03 17:15:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4GeomTestOverlapList.cc,v 1.3 2006/06/29 18:36:39 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class source file
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GeomTestOvershootList.cc,v 1.2 2003/11/03 17:15:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4GeomTestOvershootList.cc,v 1.3 2006/06/29 18:36:41 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class source file
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GeomTestPoint.cc,v 1.2 2003/11/03 17:15:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4GeomTestPoint.cc,v 1.3 2006/06/29 18:36:44 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class source file
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GeomTestSegment.cc,v 1.4 2004/09/02 14:44:11 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4GeomTestSegment.cc,v 1.5 2006/06/29 18:36:46 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class source file
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GeomTestStreamLogger.cc,v 1.2 2003/11/03 17:15:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4GeomTestStreamLogger.cc,v 1.3 2006/06/29 18:36:49 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class source file
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GeomTestVolPoint.cc,v 1.2 2003/11/03 17:15:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4GeomTestVolPoint.cc,v 1.3 2006/06/29 18:36:52 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class source file
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GeomTestVolume.cc,v 1.4 2004/12/02 09:31:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4GeomTestVolume.cc,v 1.5 2006/06/29 18:36:55 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class source file
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GeometryMessenger.cc,v 1.4 2004/03/11 13:09:28 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4GeometryMessenger.cc,v 1.5 2006/06/29 18:36:57 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// --------------------------------------------------------------------
// GEANT 4 class source file
+16 -13
View File
@@ -1,27 +1,30 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4Navigator.cc,v 1.18 2005/11/24 17:31:03 japost Exp $
// $Id: G4Navigator.cc,v 1.21 2006/06/29 18:36:59 gunter Exp $
// GEANT4 tag $ Name: $
//
// class G4Navigator Implementation
@@ -41,7 +44,7 @@
// ********************************************************************
//
G4Navigator::G4Navigator()
: fWasLimitedByGeometry(false), fTopPhysical(0),
: fActive(false), fWasLimitedByGeometry(false), fTopPhysical(0),
fCheck(false), fPushed(false), fVerbose(0)
{
ResetStackAndState();
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4NormalNavigation.cc,v 1.7 2004/09/10 15:38:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4NormalNavigation.cc,v 1.8 2006/06/29 18:37:01 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// class G4NormalNavigation Implementation
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4ParameterisedNavigation.cc,v 1.9 2005/11/24 17:49:37 japost Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4ParameterisedNavigation.cc,v 1.10 2006/06/29 18:37:03 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// class G4ParameterisedNavigation Implementation
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4PropagatorInField.cc,v 1.20 2004/12/02 09:31:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4PropagatorInField.cc,v 1.23 2006/06/29 18:37:06 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// This class implements an algorithm to track a particle in a
@@ -464,7 +467,13 @@ G4PropagatorInField::LocateIntersectionPoint(
G4bool restoredFullEndpoint= false;
G4int substep_no = 0;
const G4int max_substeps= 100;
// Limits for substep number
const G4int max_substeps= 10000; // Test 120 (old value 100 )
const G4int warn_substeps= 1000; // 100
// Statistics for substeps
static G4int max_no_seen= -1;
static G4int trigger_substepno_print= warn_substeps - 20 ;
do{ // REPEAT
@@ -653,23 +662,107 @@ G4PropagatorInField::LocateIntersectionPoint(
} // EndIf ( E is close enough to the curve, ie point F. )
// tests ChordAF_Vector.mag() <= maximum_lateral_displacement
#ifdef G4DEBUG_LOCATE_INTERSECTION
// #ifdef G4VERBOSE
if( substep_no >= trigger_substepno_print ) {
G4cout << "Difficulty in converging in G4PropagatorInField::LocateIntersectionPoint:"
<< " Substep no = " << substep_no << G4endl;
if( substep_no == trigger_substepno_print ){
printStatus( CurveStartPointVelocity, CurveEndPointVelocity,
-1.0, NewSafety, 0, 0);
}
G4cout << " State of point A: ";
printStatus( CurrentA_PointVelocity, CurrentA_PointVelocity,
-1.0, NewSafety, substep_no-1, 0);
G4cout << " State of point B: ";
printStatus( CurrentA_PointVelocity, CurrentB_PointVelocity,
-1.0, NewSafety, substep_no, 0);
}
#endif
substep_no++;
} while ( ( ! found_approximate_intersection )
&& ( ! there_is_no_intersection )
&& ( substep_no++ < max_substeps) ); // UNTIL found or failed
&& ( substep_no <= max_substeps) ); // UNTIL found or failed
if( substep_no > max_no_seen ) {
max_no_seen = substep_no;
if( max_no_seen > warn_substeps ) {
trigger_substepno_print= max_no_seen - 20; // Want to see that last 20 steps
}
}
if( ( substep_no >= max_substeps) && !there_is_no_intersection && !found_approximate_intersection ) {
#ifdef G4VERBOSE
if( substep_no >= max_substeps ) {
G4cerr << "Problem in G4PropagatorInField::LocateIntersectionPoint:"
<< " Convergence is requiring too many substeps: " << substep_no;
G4cerr << " Will abandon effort to intersect. " << G4endl;
G4cerr << " Abandoning effort to intersect. " << G4endl;
G4cerr << " Information on start & current step follows in cout: " << G4endl;
printStatus( CurrentA_PointVelocity, CurrentA_PointVelocity,
G4cout << "Problem in G4PropagatorInField::LocateIntersectionPoint:"
<< " Convergence is requiring too many substeps: " << substep_no << G4endl;
G4cout << " found intersection= " << found_approximate_intersection
<< " intersection exists = " << ! there_is_no_intersection << G4endl;
G4cout << G4endl;
G4cout << " Start and Endpoint of Requested Step " << G4endl;
printStatus( CurveStartPointVelocity, CurveEndPointVelocity,
-1.0, NewSafety, 0, 0);
G4cout << G4endl;
G4cout << " 'Bracketing' starting and endpoint of current Sub-Step " << G4endl;
printStatus( CurrentA_PointVelocity, CurrentA_PointVelocity,
-1.0, NewSafety, substep_no-1, 0);
printStatus( CurrentA_PointVelocity, CurrentB_PointVelocity,
-1.0, NewSafety, substep_no, 0);
}
G4cout << G4endl;
// #ifdef G4DEBUG_LOCATE_INTERSECTION
// #ifdef G4VERBOSE
// #endif
// G4Exception("G4PropagatorInField::LocateIntersectionPoint()", "UnableToLocateIntersection",
// FatalException, "Too many substeps while trying to locate intersection.");
#ifdef FUTURE_CORRECTION
// Attempt to correct the results of the method // FIX - TODO
if ( ! found_approximate_intersection ){
recalculatedEndPoint= true;
// Return the further valid intersection point -- potentially A ?? JA/19 Jan 2006
IntersectedOrRecalculatedFT = CurrentA_PointVelocity;
G4cout << "G4PropagatorInField::LocateIntersectionPoint:"
<< " did not convergence after " << substep_no << " substeps." << G4endl;
G4cout << " The endpoint was adjused to pointA resulting from the last substep: "
<< CurrentA_PointVelocity
<< G4endl;
}
#endif
G4cout.precision( 10 );
G4double done_len= CurrentA_PointVelocity.GetCurveLength();
G4double full_len= CurveEndPointVelocity.GetCurveLength();
G4cout << " G4PropagatorInField::LocateIntersectionPoint(): " << G4endl
<< " Undertaken only length " << done_len
<< " out of " << full_len << " required." << G4endl;
G4cout << " Remaining length = " << full_len - done_len << " " << G4endl;
G4Exception("G4PropagatorInField::LocateIntersectionPoint()", "UnableToLocateIntersection",
FatalException, "Too many substeps while trying to locate intersection.");
}
else if( substep_no >= warn_substeps ) {
int oldprc= G4cout.precision( 10 );
G4cout << " G4PropagatorInField::LocateIntersectionPoint(): Undertaken length "
<< CurrentB_PointVelocity.GetCurveLength();
G4cout << " Needed " << substep_no << " substeps. Warning level= " << warn_substeps
<< " and maximum substeps= " << max_substeps << G4endl;
G4Exception("G4PropagatorInField::LocateIntersectionPoint()", "DifficultyToLocateIntersection",
JustWarning, "Many substeps while trying to locate intersection.");
G4cout.precision( oldprc );
}
return !there_is_no_intersection; // Success or failure
}
@@ -694,7 +787,7 @@ G4PropagatorInField::printStatus( const G4FieldTrack& StartFT,
G4double step_len = CurrentFT.GetCurveLength() - StartFT.GetCurveLength();
if( ((stepNo == 0) && (verboseLevel <3))
|| (verboseLevel == 3) )
|| (verboseLevel >= 3) )
{
static G4int noPrecision= 4;
G4cout.precision(noPrecision);
@@ -702,20 +795,25 @@ G4PropagatorInField::printStatus( const G4FieldTrack& StartFT,
G4cout << std::setw( 6) << " "
<< std::setw( 25) << " Current Position and Direction" << " "
<< G4endl;
G4cout << std::setw( 5) << "Step#" << " "
G4cout << std::setw( 5) << "Step#"
<< std::setw(10) << " s " << " "
<< std::setw(10) << "X(mm)" << " "
<< std::setw(10) << "Y(mm)" << " "
<< std::setw(10) << "Z(mm)" << " "
<< std::setw( 7) << " N_x " << " "
<< std::setw( 7) << " N_y " << " "
<< std::setw( 7) << " N_z " << " "
<< std::setw( 7) << " N_z " << " " ;
// << G4endl;
G4cout // << " >>> "
<< std::setw( 7) << " Delta|N|" << " "
// << std::setw( 7) << " Delta(N_z) " << " "
<< std::setw( 9) << "StepLen" << " "
<< std::setw(12) << "StartSafety" << " "
<< std::setw( 9) << "PhsStep" << " "
<< std::setw(18) << "NextVolume" << " "
<< G4endl;
<< std::setw( 9) << "PhsStep" << " ";
if( startVolume ) {
G4cout << std::setw(18) << "NextVolume" << " ";
}
G4cout << G4endl;
}
if((stepNo == 0) && (verboseLevel <=3)){
// Recurse to print the start values
@@ -724,18 +822,23 @@ G4PropagatorInField::printStatus( const G4FieldTrack& StartFT,
}
if( verboseLevel <= 3 )
{
G4cout.precision(8);
if( stepNo >= 0)
G4cout << std::setw( 5) << stepNo << " ";
G4cout << std::setw( 4) << stepNo << " ";
else
G4cout << std::setw( 5) << "Start" << " ";
G4cout << std::setw( 5) << "Start" ;
G4cout.precision(8);
G4cout << std::setw(10) << CurrentFT.GetCurveLength() << " ";
G4cout.precision(8);
G4cout << std::setw(10) << CurrentPosition.x() << " "
<< std::setw(10) << CurrentPosition.y() << " "
<< std::setw(10) << CurrentPosition.z() << " "
<< std::setw( 7) << CurrentUnitVelocity.x() << " "
<< std::setw(10) << CurrentPosition.z() << " ";
G4cout.precision(4);
G4cout << std::setw( 7) << CurrentUnitVelocity.x() << " "
<< std::setw( 7) << CurrentUnitVelocity.y() << " "
<< std::setw( 7) << CurrentUnitVelocity.z() << " ";
G4cout.precision(2);
// G4cout << G4endl;
// G4cout << " >>> " ;
G4cout.precision(3);
G4cout << std::setw( 7) << CurrentFT.GetMomentum().mag()- StartFT.GetMomentum().mag() << " ";
// << std::setw( 7) << CurrentUnitVelocity.z() - InitialUnitVelocity.z() << " ";
G4cout << std::setw( 9) << step_len << " ";
@@ -749,6 +852,7 @@ G4PropagatorInField::printStatus( const G4FieldTrack& StartFT,
{
G4cout << std::setw(12) << startVolume->GetName() << " ";
}
#if 0
else
{
if( step_len != -1 )
@@ -756,6 +860,7 @@ G4PropagatorInField::printStatus( const G4FieldTrack& StartFT,
else
G4cout << std::setw(12) << "NotGiven" << " ";
}
#endif
G4cout << G4endl;
}
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4ReplicaNavigation.cc,v 1.10 2004/12/10 16:20:22 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4ReplicaNavigation.cc,v 1.11 2006/06/29 18:37:09 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// class G4ReplicaNavigation Implementation
@@ -1,53 +1,73 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4TransportationManager.cc,v 1.4 2003/12/05 17:08:27 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4TransportationManager.cc,v 1.14 2006/06/29 18:37:11 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// G4TransportationManager
//
// Author: J.Apostolakis (John.Apostolakis@cern.ch), 1997
// Created : J.Apostolakis, 1997
// Reviewed: G.Cosmo, 2006
//
// --------------------------------------------------------------------
#include "G4TransportationManager.hh"
#include <algorithm>
#include "G4GeometryMessenger.hh"
#include "G4PropagatorInField.hh"
#include "G4FieldManager.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
// Initialise the static instance of the singleton
//
G4TransportationManager* G4TransportationManager::fTransportationManager=0;
// ----------------------------------------------------------------------------
// Constructor
//
G4TransportationManager::G4TransportationManager()
{
if (!fTransportationManager)
{
fGeomMessenger= new G4GeometryMessenger(this);
fNavigatorForTracking= new G4Navigator() ;
fFieldManager= new G4FieldManager() ;
fPropagatorInField= new G4PropagatorInField( fNavigatorForTracking,
fFieldManager);
// Create the navigator for tracking and activate it; add to collections
//
G4Navigator* trackingNavigator = new G4Navigator();
trackingNavigator->Activate(true);
fNavigators.push_back(trackingNavigator);
fActiveNavigators.push_back(trackingNavigator);
fWorlds.push_back(trackingNavigator->GetWorldVolume()); // NULL registered
fGeomMessenger = new G4GeometryMessenger(this);
fFieldManager = new G4FieldManager();
fPropagatorInField = new G4PropagatorInField(trackingNavigator,
fFieldManager);
}
else
{
@@ -59,14 +79,22 @@ G4TransportationManager::G4TransportationManager()
}
}
// ----------------------------------------------------------------------------
// Destructor
//
G4TransportationManager::~G4TransportationManager()
{
delete fGeomMessenger;
delete fNavigatorForTracking;
delete fPropagatorInField;
delete fFieldManager;
delete fPropagatorInField;
ClearNavigators();
delete fGeomMessenger;
}
// ----------------------------------------------------------------------------
// GetTransportationManager()
//
// Retrieve the static instance of the singleton
//
G4TransportationManager* G4TransportationManager::GetTransportationManager()
{
static G4TransportationManager theInstance;
@@ -76,12 +104,328 @@ G4TransportationManager* G4TransportationManager::GetTransportationManager()
return fTransportationManager;
}
// ----------------------------------------------------------------------------
// SetFieldManager()
//
// Set the associated field manager.
//
void G4TransportationManager::SetFieldManager(G4FieldManager* newFieldManager)
{
fFieldManager = newFieldManager;
// Message the PropagatorInField,
// which also maintains this information (to be reviewed)
// which also maintains this information (to be reviewed)
//
if( fPropagatorInField )
{
fPropagatorInField -> SetDetectorFieldManager( newFieldManager );
}
}
// ----------------------------------------------------------------------------
// ClearNavigators()
//
// Clear collection of navigators and delete allocated objects.
// Called only by the class destructor.
//
void G4TransportationManager::ClearNavigators()
{
std::vector<G4Navigator*>::iterator pNav;
for (pNav=fNavigators.begin(); pNav!=fNavigators.end(); pNav++)
{
delete *pNav;
}
fNavigators.clear();
fActiveNavigators.clear();
fWorlds.clear();
}
// ----------------------------------------------------------------------------
// GetParallelWorld()
//
// Provided the name of a world volume, returns the associated world pointer.
// If not existing, create (allocate) and register it in the collection.
//
G4VPhysicalVolume*
G4TransportationManager::GetParallelWorld( const G4String& worldName )
{
G4VPhysicalVolume* wPV = IsWorldExisting(worldName);
if (!wPV)
{
wPV = GetNavigatorForTracking()->GetWorldVolume();
G4LogicalVolume* wLV = wPV->GetLogicalVolume();
wLV = new G4LogicalVolume(wLV->GetSolid(), 0,
worldName);
wPV = new G4PVPlacement (wPV->GetRotation(),
wPV->GetTranslation(),
wLV, worldName, 0, false, 0);
RegisterWorld(wPV);
}
return wPV;
}
// ----------------------------------------------------------------------------
// GetNavigator()
//
// Provided the name of a world volume, returns the associated navigator.
// If not existing, create it and register it in the collection, throw an
// exception if the associated parallel world does not exist.
//
G4Navigator* G4TransportationManager::GetNavigator( const G4String& worldName )
{
// If already existing, return the stored pointer to the navigator
//
std::vector<G4Navigator*>::iterator pNav;
for (pNav=fNavigators.begin(); pNav!=fNavigators.end(); pNav++)
{
if ((*pNav)->GetWorldVolume()->GetName() == worldName) { return *pNav; }
}
// Check if world of that name already exists,
// create a navigator and register it
//
G4Navigator* aNavigator = 0;
G4VPhysicalVolume* aWorld = IsWorldExisting(worldName);
if(aWorld)
{
aNavigator = new G4Navigator();
aNavigator->SetWorldVolume(aWorld);
fNavigators.push_back(aNavigator);
}
else
{
G4String message
= "World volume with name -" + worldName
+ "- does not exist. Create it first by GetParallelWorld() method!";
G4Exception("G4TransportationManager::GetNavigator(name)",
"InvalidSetup", FatalException, message);
}
return aNavigator;
}
// ----------------------------------------------------------------------------
// GetNavigator()
//
// Provided a pointer to a world volume, returns the associated navigator.
// Create it in case not existing and add it to the collection.
// If world volume not existing, issue an exception.
//
G4Navigator* G4TransportationManager::GetNavigator( G4VPhysicalVolume* aWorld )
{
std::vector<G4Navigator*>::iterator pNav;
for (pNav=fNavigators.begin(); pNav!=fNavigators.end(); pNav++)
{
if ((*pNav)->GetWorldVolume() == aWorld) { return *pNav; }
}
G4Navigator* aNavigator = 0;
std::vector<G4VPhysicalVolume*>::iterator pWorld =
std::find(fWorlds.begin(), fWorlds.end(), aWorld);
if (pWorld != fWorlds.end())
{
aNavigator = new G4Navigator();
aNavigator->SetWorldVolume(aWorld);
fNavigators.push_back(aNavigator);
}
else
{
G4String message
= "World volume with name -" + aWorld->GetName()
+ "- does not exist. Create it first by GetParallelWorld() method!";
G4Exception("G4TransportationManager::GetNavigator(pointer)",
"InvalidSetup", FatalException, message);
}
return aNavigator;
}
// ----------------------------------------------------------------------------
// DeRegisterNavigator()
//
// Provided a pointer to an already allocated navigator object, removes the
// associated entry in the navigators collection (remove pair) but does not
// delete the actual pointed object, which is still owned by the caller.
// The navigator for tracking -cannot- be deregistered.
//
void G4TransportationManager::DeRegisterNavigator( G4Navigator* aNavigator )
{
if (aNavigator == fNavigators[0])
{
G4Exception("G4TransportationManager::DeRegisterNavigator()",
"InvalidCall", FatalException,
"The navigator for tracking CANNOT be deregistered!");
}
std::vector<G4Navigator*>::iterator pNav =
std::find(fNavigators.begin(), fNavigators.end(), aNavigator);
if (pNav != fNavigators.end())
{
// Deregister associated world volume
//
DeRegisterWorld((*pNav)->GetWorldVolume());
// Deregister the navigator
//
fNavigators.erase(pNav);
}
else
{
G4String message
= "Navigator for volume -" + aNavigator->GetWorldVolume()->GetName()
+ "- not found in memory!";
G4Exception("G4TransportationManager::DeRegisterNavigator()",
"NoEffect", JustWarning, message);
}
}
// ----------------------------------------------------------------------------
// ActivateNavigator()
//
// Provided a pointer to an already allocated navigator object, set to 'true'
// the associated activation flag for the navigator in the collection.
// If the provided navigator is not already registered, issue a warning
// Return the index of the activated navigator. This index should be used for
// ComputeStep() method of G4PathFinder.
//
G4int G4TransportationManager::ActivateNavigator( G4Navigator* aNavigator )
{
std::vector<G4Navigator*>::iterator pNav =
std::find(fNavigators.begin(), fNavigators.end(), aNavigator);
if (pNav == fNavigators.end())
{
G4String message
= "Navigator for volume -" + aNavigator->GetWorldVolume()->GetName()
+ "- not found in memory!";
G4Exception("G4TransportationManager::ActivateNavigator()",
"NoEffect", JustWarning, message);
return -1;
}
aNavigator->Activate(true);
G4int id = 0;
std::vector<G4Navigator*>::iterator pActiveNav;
for(pActiveNav=fActiveNavigators.begin();
pActiveNav!=fActiveNavigators.end(); pActiveNav++)
{
if (*pActiveNav == aNavigator) { return id; }
id++;
}
fActiveNavigators.push_back(aNavigator);
return id;
}
// ----------------------------------------------------------------------------
// DeActivateNavigator()
//
// Provided a pointer to an already allocated navigator object, set to 'false'
// the associated activation flag in the navigators collection.
// If the provided navigator is not already registered, issue a warning.
//
void G4TransportationManager::DeActivateNavigator( G4Navigator* aNavigator )
{
std::vector<G4Navigator*>::iterator pNav =
std::find(fNavigators.begin(), fNavigators.end(), aNavigator);
if (pNav == fNavigators.end())
{
G4String message
= "Navigator for volume -" + aNavigator->GetWorldVolume()->GetName()
+ "- not found in memory!";
G4Exception("G4TransportationManager::DeActivateNavigator()",
"NoEffect", JustWarning, message);
}
else
{
(*pNav)->Activate(false);
}
std::vector<G4Navigator*>::iterator pActiveNav =
std::find(fActiveNavigators.begin(), fActiveNavigators.end(), aNavigator);
if (pActiveNav != fActiveNavigators.end())
{
fActiveNavigators.erase(pActiveNav);
}
}
// ----------------------------------------------------------------------------
// InactivateAll()
//
// Inactivate all the navigators except for the tracking one, and clear the
// store of active navigators.
//
void G4TransportationManager::InactivateAll( )
{
std::vector<G4Navigator*>::iterator pNav;
for (pNav=fActiveNavigators.begin(); pNav!=fActiveNavigators.end(); pNav++)
{
(*pNav)->Activate(false);
}
fActiveNavigators.clear();
// Restore status for the navigator for tracking
//
fNavigators[0]->Activate(true);
fActiveNavigators.push_back(fNavigators[0]);
}
// ----------------------------------------------------------------------------
// IsWorldExisting()
//
// Verify existance or not of an istance of the world volume with
// same name in the collection. Return the world pointer if existing.
//
G4VPhysicalVolume*
G4TransportationManager::IsWorldExisting ( const G4String& name )
{
std::vector<G4VPhysicalVolume*>::iterator pWorld = fWorlds.begin();
if (*pWorld==0) { *pWorld=fNavigators[0]->GetWorldVolume(); }
for (pWorld=fWorlds.begin(); pWorld!=fWorlds.end(); pWorld++)
{
if ((*pWorld)->GetName() == name ) { return *pWorld; }
}
return 0;
}
// ----------------------------------------------------------------------------
// RegisterWorld()
//
// Provided a pointer to an already allocated world object, check and add the
// associated entry in the worlds collection. Return 'true' if registration
// succeeds and the new entry is created.
//
G4bool G4TransportationManager::RegisterWorld( G4VPhysicalVolume* aWorld )
{
G4bool done = false;
std::vector<G4VPhysicalVolume*>::iterator pWorld =
std::find(fWorlds.begin(), fWorlds.end(), aWorld);
if (pWorld == fWorlds.end())
{
fWorlds.push_back(aWorld);
done = true;
}
return done;
}
// ----------------------------------------------------------------------------
// DeRegisterWorld()
//
// Provided a pointer to an already allocated world object, removes the
// associated entry in the worlds collection but does not delete the actual
// pointed object, which is still owned by the caller.
//
void G4TransportationManager::DeRegisterWorld( G4VPhysicalVolume* aWorld )
{
std::vector<G4VPhysicalVolume*>::iterator pWorld =
std::find(fWorlds.begin(), fWorlds.end(), aWorld);
if (pWorld != fWorlds.end())
{
fWorlds.erase(pWorld);
}
else
{
G4String message
= "World volume -" + aWorld->GetName() + "- not found in memory!";
G4Exception("G4TransportationManager::DeRegisterWorld()",
"InvalidSetup", FatalException, message);
}
}
@@ -1,28 +1,31 @@
//
// ********************************************************************
// * DISCLAIMER *
// * License and Disclaimer *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4VoxelNavigation.cc,v 1.5 2004/09/10 15:38:47 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// $Id: G4VoxelNavigation.cc,v 1.6 2006/06/29 18:37:13 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
//
// class G4VoxelNavigation Implementation