ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4CascadeChannelTables.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4CascadeChannelTables.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // Factory class to return pointer to Bertini cross-section table based on
28 // collision initial state (hadron type codes).
29 //
30 // Author: Michael Kelsey (SLAC)
31 //
32 // 20110728 M. Kelsey -- Use static instance() function to work around
33 // "disappearance" bug on Linux (GCC 4.1.2).
34 // 20110915 M. Kelsey -- Move static implementations (won't work on Windows);
35 // Add local table instantiating function (to replace self-reg)
36 // 20110923 M. Kelsey -- Add optional stream& argument to printTable().
37 // 20130129 M. Kelsey -- Drop load-on-demand interfaces, fill in ctor
38 // 20130306 M. Kelsey -- Add inclusive printing of all tables here
39 // 20130429 M. Kelsey -- Change instance to thread-local pointer.
40 // 20141121 M. Kelsey -- Dtor must be public for end-of-job cleanup.
41 
42 #ifndef G4_CASCADE_CHANNEL_TABLES_HH
43 #define G4_CASCADE_CHANNEL_TABLES_HH
44 
45 #include "globals.hh"
46 #include <iosfwd>
47 #include <map>
48 
49 class G4CascadeChannel;
50 
51 
53 public:
54  // Argument is interaction code, product of G4InuclEP types
55  static const G4CascadeChannel* GetTable(G4int initialState);
56 
57  // Arguments are individual G4InuclElementaryParticle types
58  static const G4CascadeChannel* GetTable(G4int had1, G4int had2);
59 
60  // Convenience functions for diagnostic output
61  static void Print(std::ostream& os=G4cout);
62  static void PrintTable(G4int initialState, std::ostream& os=G4cout);
63 
64 public:
66 
67 private:
68  static const G4CascadeChannelTables& instance(); // Singleton
70 
72 
73  // Fetch table from map if already registered, or return null
74  const G4CascadeChannel* FindTable(G4int initialState) const;
75 
76  typedef std::map<G4int, G4CascadeChannel*> TableMap;
78 };
79 
80 #endif /* G4_CASCADE_CHANNEL_TABLES_HH */