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 | // File name: RadmonDetectorMultilayersLayoutCollection.cc |
---|
28 | // Creation date: Sep 2005 |
---|
29 | // Main author: Riccardo Capra <capra@ge.infn.it> |
---|
30 | // |
---|
31 | // Id: $Id: RadmonDetectorMultilayersLayoutCollection.cc,v 1.5 2006/06/29 16:14:09 gunter Exp $ |
---|
32 | // Tag: $Name: $ |
---|
33 | // |
---|
34 | |
---|
35 | // Include files |
---|
36 | #include "RadmonDetectorMultilayersLayoutCollection.hh" |
---|
37 | #include "RadmonDumpStyle.hh" |
---|
38 | #include <iomanip> |
---|
39 | |
---|
40 | |
---|
41 | |
---|
42 | G4int RadmonDetectorMultilayersLayoutCollection :: GetNMultilayers(void) const |
---|
43 | { |
---|
44 | return multilayersCollection.GetNItems(); |
---|
45 | } |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | G4bool RadmonDetectorMultilayersLayoutCollection :: Empty(void) const |
---|
50 | { |
---|
51 | return multilayersCollection.Empty(); |
---|
52 | } |
---|
53 | |
---|
54 | |
---|
55 | |
---|
56 | |
---|
57 | |
---|
58 | const RadmonDetectorMultilayerLayout & RadmonDetectorMultilayersLayoutCollection :: GetMultilayer(G4int index) const |
---|
59 | { |
---|
60 | return multilayersCollection.GetItem(index); |
---|
61 | } |
---|
62 | |
---|
63 | |
---|
64 | |
---|
65 | RadmonDetectorMultilayerLayout & RadmonDetectorMultilayersLayoutCollection :: GetMultilayer(G4int index) |
---|
66 | { |
---|
67 | return multilayersCollection.GetItem(index); |
---|
68 | } |
---|
69 | |
---|
70 | |
---|
71 | |
---|
72 | |
---|
73 | |
---|
74 | G4bool RadmonDetectorMultilayersLayoutCollection :: ExistsMultilayerByLabel(const G4String & label) const |
---|
75 | { |
---|
76 | return multilayersCollection.ExistsItemByLabel(label); |
---|
77 | } |
---|
78 | |
---|
79 | |
---|
80 | |
---|
81 | G4int RadmonDetectorMultilayersLayoutCollection :: MultiplicityMultilayerByLabel(const G4String & label) const |
---|
82 | { |
---|
83 | return multilayersCollection.MultiplicityItemByLabel(label); |
---|
84 | } |
---|
85 | |
---|
86 | |
---|
87 | |
---|
88 | |
---|
89 | |
---|
90 | const RadmonDetectorMultilayerLayout & RadmonDetectorMultilayersLayoutCollection :: FindMultilayerByLabel(const G4String & label, G4int count) const |
---|
91 | { |
---|
92 | return multilayersCollection.FindItemByLabel(label, count); |
---|
93 | } |
---|
94 | |
---|
95 | |
---|
96 | |
---|
97 | RadmonDetectorMultilayerLayout & RadmonDetectorMultilayersLayoutCollection :: FindMultilayerByLabel(const G4String & label, G4int count) |
---|
98 | { |
---|
99 | return multilayersCollection.FindItemByLabel(label, count); |
---|
100 | } |
---|
101 | |
---|
102 | |
---|
103 | |
---|
104 | |
---|
105 | |
---|
106 | RadmonDetectorMultilayerLayout & RadmonDetectorMultilayersLayoutCollection :: CreateMultilayer(void) |
---|
107 | { |
---|
108 | return multilayersCollection.AppendItem(); |
---|
109 | } |
---|
110 | |
---|
111 | |
---|
112 | |
---|
113 | |
---|
114 | |
---|
115 | void RadmonDetectorMultilayersLayoutCollection :: RemoveMultilayerByLabel(const G4String & label, G4int count) |
---|
116 | { |
---|
117 | multilayersCollection.RemoveItemByLabel(label, count); |
---|
118 | } |
---|
119 | |
---|
120 | |
---|
121 | |
---|
122 | void RadmonDetectorMultilayersLayoutCollection :: RemoveMultilayersByLabel(const G4String & label) |
---|
123 | { |
---|
124 | multilayersCollection.RemoveItemsByLabel(label); |
---|
125 | } |
---|
126 | |
---|
127 | |
---|
128 | |
---|
129 | void RadmonDetectorMultilayersLayoutCollection :: RemoveMultilayer(G4int index) |
---|
130 | { |
---|
131 | multilayersCollection.RemoveItem(index); |
---|
132 | } |
---|
133 | |
---|
134 | |
---|
135 | |
---|
136 | void RadmonDetectorMultilayersLayoutCollection :: RemoveAllMultilayers(void) |
---|
137 | { |
---|
138 | multilayersCollection.RemoveAllItems(); |
---|
139 | } |
---|
140 | |
---|
141 | |
---|
142 | |
---|
143 | |
---|
144 | |
---|
145 | void RadmonDetectorMultilayersLayoutCollection :: DumpLayout(std::ostream & out, const G4String & indent) const |
---|
146 | { |
---|
147 | const G4int n(multilayersCollection.GetNItems()); |
---|
148 | |
---|
149 | if (n==0) |
---|
150 | { |
---|
151 | out << indent << "No multilayers defined.\n"; |
---|
152 | return; |
---|
153 | } |
---|
154 | |
---|
155 | G4String indent2(indent); |
---|
156 | indent2.prepend(" "); |
---|
157 | |
---|
158 | for(G4int i(0); i<n; i++) |
---|
159 | { |
---|
160 | if (i!=0) |
---|
161 | out << '\n'; |
---|
162 | |
---|
163 | out << indent << "Multilayer # " << i << '\n'; |
---|
164 | |
---|
165 | GetMultilayer(i).DumpLayout(out, indent2); |
---|
166 | } |
---|
167 | } |
---|