[807] | 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: RadmonAnalysisSensitiveDetectorTypeLayout.cc |
---|
| 28 | // Creation date: Sep 2005 |
---|
| 29 | // Main author: Riccardo Capra <capra@ge.infn.it> |
---|
| 30 | // |
---|
| 31 | // Id: $Id: RadmonAnalysisSensitiveDetectorTypeLayout.cc,v 1.3 2006/06/29 16:07:41 gunter Exp $ |
---|
| 32 | // Tag: $Name: $ |
---|
| 33 | // |
---|
| 34 | |
---|
| 35 | // Include files |
---|
| 36 | #include "RadmonAnalysisSensitiveDetectorTypeLayout.hh" |
---|
| 37 | #include "RadmonDumpStyle.hh" |
---|
| 38 | #include "G4UnitsTable.hh" |
---|
| 39 | |
---|
| 40 | #include <iomanip> |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | RadmonAnalysisSensitiveDetectorTypeLayout :: RadmonAnalysisSensitiveDetectorTypeLayout(const RadmonAnalysisSensitiveDetectorTypeLayout & copy) |
---|
| 45 | : |
---|
| 46 | sensitiveDetectorLabel(copy.sensitiveDetectorLabel), |
---|
| 47 | dataAnalysesCollection(copy.dataAnalysesCollection) |
---|
| 48 | { |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | RadmonAnalysisSensitiveDetectorTypeLayout & RadmonAnalysisSensitiveDetectorTypeLayout :: operator=(const RadmonAnalysisSensitiveDetectorTypeLayout & copy) |
---|
| 56 | { |
---|
| 57 | sensitiveDetectorLabel=copy.sensitiveDetectorLabel; |
---|
| 58 | dataAnalysesCollection=copy.dataAnalysesCollection; |
---|
| 59 | |
---|
| 60 | return (*this); |
---|
| 61 | } |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | G4int RadmonAnalysisSensitiveDetectorTypeLayout :: GetNDataAnalyses(void) const |
---|
| 68 | { |
---|
| 69 | return dataAnalysesCollection.GetNItems(); |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | |
---|
| 74 | G4bool RadmonAnalysisSensitiveDetectorTypeLayout :: Empty(void) const |
---|
| 75 | { |
---|
| 76 | return dataAnalysesCollection.Empty(); |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | const RadmonDataAnalysisLayout & RadmonAnalysisSensitiveDetectorTypeLayout :: GetDataAnalysis(G4int index) const |
---|
| 84 | { |
---|
| 85 | return dataAnalysesCollection.GetItem(index); |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | RadmonDataAnalysisLayout & RadmonAnalysisSensitiveDetectorTypeLayout :: GetDataAnalysis(G4int index) |
---|
| 91 | { |
---|
| 92 | return dataAnalysesCollection.GetItem(index); |
---|
| 93 | } |
---|
| 94 | |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | |
---|
| 99 | G4bool RadmonAnalysisSensitiveDetectorTypeLayout :: ExistsDataAnalysisByLabel(const G4String & dataAnalysisLabel) const |
---|
| 100 | { |
---|
| 101 | return dataAnalysesCollection.ExistsItemByLabel(dataAnalysisLabel); |
---|
| 102 | } |
---|
| 103 | |
---|
| 104 | |
---|
| 105 | |
---|
| 106 | G4int RadmonAnalysisSensitiveDetectorTypeLayout :: MultiplicityDataAnalysisByLabel(const G4String & dataAnalysisLabel) const |
---|
| 107 | { |
---|
| 108 | return dataAnalysesCollection.MultiplicityItemByLabel(dataAnalysisLabel); |
---|
| 109 | } |
---|
| 110 | |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | |
---|
| 114 | |
---|
| 115 | const RadmonDataAnalysisLayout & RadmonAnalysisSensitiveDetectorTypeLayout :: FindDataAnalysisByLabel(const G4String & dataAnalysisLabel, G4int count) const |
---|
| 116 | { |
---|
| 117 | return dataAnalysesCollection.FindItemByLabel(dataAnalysisLabel, count); |
---|
| 118 | } |
---|
| 119 | |
---|
| 120 | |
---|
| 121 | |
---|
| 122 | RadmonDataAnalysisLayout & RadmonAnalysisSensitiveDetectorTypeLayout :: FindDataAnalysisByLabel(const G4String & dataAnalysisLabel, G4int count) |
---|
| 123 | { |
---|
| 124 | return dataAnalysesCollection.FindItemByLabel(dataAnalysisLabel, count); |
---|
| 125 | } |
---|
| 126 | |
---|
| 127 | |
---|
| 128 | |
---|
| 129 | |
---|
| 130 | |
---|
| 131 | RadmonDataAnalysisLayout & RadmonAnalysisSensitiveDetectorTypeLayout :: AppendDataAnalysis(void) |
---|
| 132 | { |
---|
| 133 | return dataAnalysesCollection.AppendItem(); |
---|
| 134 | } |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | |
---|
| 138 | RadmonDataAnalysisLayout & RadmonAnalysisSensitiveDetectorTypeLayout :: PrependDataAnalysis(void) |
---|
| 139 | { |
---|
| 140 | return dataAnalysesCollection.PrependItem(); |
---|
| 141 | } |
---|
| 142 | |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | |
---|
| 146 | |
---|
| 147 | void RadmonAnalysisSensitiveDetectorTypeLayout :: RemoveDataAnalysisByLabel(const G4String & dataAnalysisLabel, G4int count) |
---|
| 148 | { |
---|
| 149 | dataAnalysesCollection.RemoveItemByLabel(dataAnalysisLabel, count); |
---|
| 150 | } |
---|
| 151 | |
---|
| 152 | |
---|
| 153 | |
---|
| 154 | void RadmonAnalysisSensitiveDetectorTypeLayout :: RemoveDataAnalysesByLabel(const G4String & dataAnalysisLabel) |
---|
| 155 | { |
---|
| 156 | dataAnalysesCollection.RemoveItemsByLabel(dataAnalysisLabel); |
---|
| 157 | } |
---|
| 158 | |
---|
| 159 | |
---|
| 160 | |
---|
| 161 | void RadmonAnalysisSensitiveDetectorTypeLayout :: RemoveDataAnalysis(G4int index) |
---|
| 162 | { |
---|
| 163 | dataAnalysesCollection.RemoveItem(index); |
---|
| 164 | } |
---|
| 165 | |
---|
| 166 | |
---|
| 167 | |
---|
| 168 | void RadmonAnalysisSensitiveDetectorTypeLayout :: RemoveDataAnalysesByRange(G4int first, G4int last) |
---|
| 169 | { |
---|
| 170 | dataAnalysesCollection.RemoveItemsByRange(first, last); |
---|
| 171 | } |
---|
| 172 | |
---|
| 173 | |
---|
| 174 | |
---|
| 175 | void RadmonAnalysisSensitiveDetectorTypeLayout :: RemoveAllDataAnalyses(void) |
---|
| 176 | { |
---|
| 177 | dataAnalysesCollection.RemoveAllItems(); |
---|
| 178 | } |
---|
| 179 | |
---|
| 180 | |
---|
| 181 | |
---|
| 182 | |
---|
| 183 | |
---|
| 184 | void RadmonAnalysisSensitiveDetectorTypeLayout :: DumpLayout(std::ostream & out, const G4String & indent) const |
---|
| 185 | { |
---|
| 186 | G4int width(RADMONDUMP_INDENT_WIDTH-indent.length()); |
---|
| 187 | if (width<0) |
---|
| 188 | width=0; |
---|
| 189 | |
---|
| 190 | out << indent << std::setw(width); out.setf(std::ostream::left, std::ostream::adjustfield); out << "Label"; out.setf(std::ostream::right, std::ostream::adjustfield); out << " = \"" << sensitiveDetectorLabel << "\"\n"; |
---|
| 191 | |
---|
| 192 | G4String indent2(indent); |
---|
| 193 | indent2.prepend(" "); |
---|
| 194 | |
---|
| 195 | const G4int n(dataAnalysesCollection.GetNItems()); |
---|
| 196 | |
---|
| 197 | if (n==0) |
---|
| 198 | { |
---|
| 199 | out << indent2 << "No data analyses defined.\n"; |
---|
| 200 | return; |
---|
| 201 | } |
---|
| 202 | |
---|
| 203 | G4String indent3(indent2); |
---|
| 204 | indent3.prepend(" "); |
---|
| 205 | |
---|
| 206 | for(G4int i(0); i<n; i++) |
---|
| 207 | { |
---|
| 208 | out << indent2 << "Data analysis # " << i << '\n'; |
---|
| 209 | |
---|
| 210 | GetDataAnalysis(i).DumpLayout(out, indent3); |
---|
| 211 | } |
---|
| 212 | } |
---|