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