Back to home page

EIC code displayed by LXR

 
 

    


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

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 // G4HCIOcatalog
0027 //
0028 // Class Description:
0029 //
0030 // Catalog for the I/O manager of hits collection for each detector.
0031 
0032 // Author: Youhei Morita, 12.09.2001
0033 // --------------------------------------------------------------------
0034 #ifndef G4HCIOCATALOG_HH
0035 #define G4HCIOCATALOG_HH 1
0036 
0037 #include <map>
0038 #include "G4Types.hh"
0039 #include "G4String.hh"
0040 #include "G4VPHitsCollectionIO.hh"
0041 
0042 class G4VHCIOentry;
0043 
0044 using HCIOmap = std::map<std::string, G4VHCIOentry*, std::less<std::string>>;
0045 
0046 using HCIOstore = std::map<G4String, G4VPHitsCollectionIO*,
0047                            std::less<G4String>>;
0048 
0049 class G4HCIOcatalog
0050 {
0051   public:
0052 
0053     G4HCIOcatalog();
0054       // Constructor
0055 
0056     virtual ~G4HCIOcatalog() {}
0057       // Destructor
0058 
0059     static G4HCIOcatalog* GetHCIOcatalog();
0060       // Construct G4HCIOcatalog and returns the pointer
0061 
0062     void SetVerboseLevel(G4int v) { m_verbose = v; }
0063       // Set verbose level
0064 
0065     void RegisterEntry(G4VHCIOentry* d);
0066       // Register I/O manager entry
0067 
0068     void RegisterHCIOmanager(G4VPHitsCollectionIO* d);
0069       // Register I/O manager
0070 
0071     G4VHCIOentry* GetEntry(const G4String& name);
0072       // Returns the I/O manager entry
0073 
0074     G4VPHitsCollectionIO* GetHCIOmanager(const G4String& name);
0075       // Returns the registered I/O manager entry
0076 
0077     void PrintEntries();
0078       // Prints the list of I/O manager entries
0079 
0080     G4String CurrentHCIOmanager();
0081       // Returns the list of I/O managers
0082 
0083     void PrintHCIOmanager();
0084       // Prints the list of I/O managers
0085 
0086     std::size_t NumberOfHCIOmanager() { return theStore.size(); }
0087       // Returns the number of registered I/O managers.
0088 
0089     G4VPHitsCollectionIO* GetHCIOmanager(G4int n);
0090       // Returns the n-th registered I/O manager entry
0091 
0092   private:
0093 
0094     G4int m_verbose = 0;
0095     static G4ThreadLocal G4HCIOcatalog* f_thePointer;
0096     HCIOmap theCatalog;
0097     HCIOstore theStore;
0098 };
0099 
0100 #endif