Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:04

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 // -------------------------------------------------------------------
0028 //
0029 // GEANT4 Class header file
0030 //
0031 //
0032 // File name:    G4CrossSectionDataSetRegistry
0033 //
0034 // Author  V.Ivanchenko  24.01.2009
0035 //
0036 // Modifications:
0037 //
0038  
0039 //
0040 // Class Description
0041 // This is a singleton keeping pointers to all cross section data sets
0042 // Class Description - End
0043 
0044 #ifndef G4CrossSectionDataSetRegistry_h
0045 #define G4CrossSectionDataSetRegistry_h 1
0046 
0047 #include <vector>
0048 #include <map>
0049 #include "globals.hh"
0050 #include "G4ThreadLocalSingleton.hh"
0051 
0052 class G4VCrossSectionDataSet;
0053 class G4VComponentCrossSection;
0054 
0055 class G4CrossSectionDataSetRegistry
0056 {
0057 friend class G4ThreadLocalSingleton<G4CrossSectionDataSetRegistry>;
0058 
0059 public:
0060 
0061   static G4CrossSectionDataSetRegistry* Instance();
0062   // access 
0063   
0064   ~G4CrossSectionDataSetRegistry();
0065   
0066   void Register(G4VCrossSectionDataSet*);
0067   //register new cross section
0068 
0069   void DeRegister(G4VCrossSectionDataSet*);
0070   //deregister cross section
0071 
0072   void Register(G4VComponentCrossSection*);
0073   //register new cross section component
0074 
0075   void DeRegister(G4VComponentCrossSection*);
0076   //deregister cross section component
0077 
0078   void DeleteComponent(G4VComponentCrossSection*);
0079   //deregister and delete cross section component
0080 
0081   void Clean();
0082   //clean the store
0083       
0084   G4VCrossSectionDataSet* GetCrossSectionDataSet(const G4String& name, 
0085                                                  G4bool warning=false);
0086   
0087   G4VComponentCrossSection* GetComponentCrossSection(const G4String& name);
0088   
0089 private:
0090 
0091   G4CrossSectionDataSetRegistry();
0092 
0093   static G4ThreadLocal G4CrossSectionDataSetRegistry* instance;
0094   
0095   std::vector <G4VCrossSectionDataSet*>   xSections;
0096   std::vector <G4VComponentCrossSection*> xComponents;
0097 };
0098 
0099 #endif