[1208] | 1 | <HTML> |
---|
| 2 | <TITLE> |
---|
| 3 | </TITLE> |
---|
| 4 | <!-- Created by: Makoto Asai, 24-Nov-2006 --> |
---|
| 5 | |
---|
| 6 | <BODY> |
---|
| 7 | <TABLE WIDTH="100%"><TR> |
---|
| 8 | <TD> |
---|
| 9 | |
---|
| 10 | |
---|
| 11 | <A HREF="index.html"> |
---|
| 12 | <IMG SRC="../../../../resources/html/IconsGIF/Contents.gif" ALT="Contents"></A> |
---|
| 13 | <A HREF="persistency.html"> |
---|
| 14 | <IMG SRC="../../../../resources/html/IconsGIF/Previous.gif" ALT="Previous"></A> |
---|
| 15 | <A HREF="index.html"> |
---|
| 16 | <IMG SRC="../../../../resources/html/IconsGIF/Next.gif" ALT="Next"></A> |
---|
| 17 | </TD> |
---|
| 18 | <TD ALIGN="Right"> |
---|
| 19 | <FONT SIZE="-1" COLOR="#238E23"> |
---|
| 20 | <B>Geant4 User's Guide</B> |
---|
| 21 | <BR> |
---|
| 22 | <B>For Application Developers</B> |
---|
| 23 | <BR> |
---|
| 24 | <B>Detector Definition and Response</B> |
---|
| 25 | </FONT> |
---|
| 26 | </TD> |
---|
| 27 | </TR></TABLE> |
---|
| 28 | <BR><BR> |
---|
| 29 | |
---|
| 30 | <P ALIGN="Center"> |
---|
| 31 | <FONT SIZE="+3" COLOR="#238E23"> |
---|
| 32 | <B>4.7 Parallel Geometries</B> |
---|
| 33 | </FONT> |
---|
| 34 | <BR><BR> |
---|
| 35 | |
---|
| 36 | <HR ALIGN="Center" SIZE="7%"> |
---|
| 37 | <p> |
---|
| 38 | <font color="#ff0000">Notice</font><br> |
---|
| 39 | As of Geant4 release 8.2, this functionality for defining parallel geometries |
---|
| 40 | is still in <i>beta</i> release. We appreciate your feedback. |
---|
| 41 | </p> |
---|
| 42 | <HR ALIGN="Center" SIZE="7%"> |
---|
| 43 | |
---|
| 44 | <a name="4.7.1"> |
---|
| 45 | <H2>4.7.1 A parallel world</H2></a> |
---|
| 46 | <p> |
---|
| 47 | Occasionally, it is not straightforward to define geometries for sensitive |
---|
| 48 | detectors, importance geometries or envelopes for shower parameterization to |
---|
| 49 | be coherently assigned to volumes in the tracking (mass) geometry. |
---|
| 50 | The new parallel navigation functionality allows the user to define more than |
---|
| 51 | one worlds simultaneously. The new <tt>G4Transportation</tt> process will see |
---|
| 52 | all worlds simultaneously; steps will be limited by both boundaries of |
---|
| 53 | the mass geometry and parallel geometries.<br> |
---|
| 54 | In a parallel world, the user can define volumes in arbitrary manner with |
---|
| 55 | sensitivity, regions, shower parameterization setups, and/or importance weight |
---|
| 56 | for biasing. Volumes in different worlds can overlap. |
---|
| 57 | </p> |
---|
| 58 | <p> |
---|
| 59 | Here are restrictions to be considered for the parallel geometry: |
---|
| 60 | <ul> |
---|
| 61 | <li>Materials, production thresholds and EM field are used only from the mass |
---|
| 62 | geometry. Even if such <i>physical</i> quantities are defined in a parallel |
---|
| 63 | world, they do not affect to the simulation.</li> |
---|
| 64 | <li>Although all worlds will be comprehensively taken care by the |
---|
| 65 | <tt>G4Transportation</tt> process for the navigation, each parallel world |
---|
| 66 | must have its own process assigned to achieve its purpose. |
---|
| 67 | For example: in case the user defines a sensitive detector to a parallel |
---|
| 68 | world, a process dedicated to the parallel world is responsible to invoke |
---|
| 69 | this detector. The <tt>G4SteppingManager</tt> treats only the detectors in |
---|
| 70 | the mass geometry. For this case of detector sensitivity defined in a |
---|
| 71 | parallel world, a <tt>G4ParallelWorldScoringProcess</tt> process must be |
---|
| 72 | defined in the physics list (see <a href=#4.7.3>section 4.7.3</a>). |
---|
| 73 | </ul> |
---|
| 74 | </p> |
---|
| 75 | |
---|
| 76 | <a name="4.7.2"> |
---|
| 77 | <H2>4.7.2 Defining a parallel world</H2></a> |
---|
| 78 | <p> |
---|
| 79 | A parallel world should be defined in the <tt>Construct()</tt> virtual |
---|
| 80 | method of the user's class derived from the abstract base class |
---|
| 81 | <i>G4VUserParallelWorld</i>. |
---|
| 82 | </p> |
---|
| 83 | <p> |
---|
| 84 | <center> |
---|
| 85 | <table border=2 cellpadding=10> |
---|
| 86 | <tr> |
---|
| 87 | <td> |
---|
| 88 | <pre> |
---|
| 89 | #ifndef MyParallelWorld_h |
---|
| 90 | #define MyParallelWorld_h 1 |
---|
| 91 | |
---|
| 92 | #include "globals.hh" |
---|
| 93 | #include "G4VUserParallelWorld.hh" |
---|
| 94 | |
---|
| 95 | class MyParallelWorld : <font color="#ff0000">public G4VUserParallelWorld</font> |
---|
| 96 | { |
---|
| 97 | public: |
---|
| 98 | MyParallelWorld(G4String worldName); |
---|
| 99 | virtual ~MyParallelWorld(); |
---|
| 100 | |
---|
| 101 | public: |
---|
| 102 | <font color="#ff0000">virtual void Construct();</font> |
---|
| 103 | }; |
---|
| 104 | |
---|
| 105 | #endif |
---|
| 106 | </pre> |
---|
| 107 | </td> |
---|
| 108 | </tr> |
---|
| 109 | <tr> |
---|
| 110 | <td align=center> |
---|
| 111 | Source listing 4.7.1<BR> |
---|
| 112 | An example header file of a concrete user parallel world class. |
---|
| 113 | </td> |
---|
| 114 | </tr> |
---|
| 115 | </table></center> |
---|
| 116 | </p> |
---|
| 117 | <p> |
---|
| 118 | A parallel world must have its unique name, which should be set to the |
---|
| 119 | <tt>G4VUserParallelWorld</tt> base class as an argument of the base class |
---|
| 120 | constructor. |
---|
| 121 | </p> |
---|
| 122 | <p> |
---|
| 123 | The world physical volume of the parallel world is provided by the |
---|
| 124 | <tt>G4RunManager</tt> as a clone of the mass geometry. |
---|
| 125 | In the <tt>Construct()</tt> virtual method of the user's class, the pointer |
---|
| 126 | to this cloned world physical volume is available through the |
---|
| 127 | <tt>GetWorld()</tt> method defined in the base class. The user |
---|
| 128 | should fill the volumes in the parallel world by using this provided |
---|
| 129 | world volume. For a logical volume in a parallel world, the material pointer |
---|
| 130 | can be <tt>NULL</tt>. Even if specified a valid material pointer, it will not |
---|
| 131 | be taken into account by any physics process. |
---|
| 132 | </p> |
---|
| 133 | <p> |
---|
| 134 | <center> |
---|
| 135 | <table border=2 cellpadding=10> |
---|
| 136 | <tr> |
---|
| 137 | <td> |
---|
| 138 | <pre> |
---|
| 139 | |
---|
| 140 | #include "MyParallelWorld.hh" |
---|
| 141 | #include "G4LogicalVolume.hh" |
---|
| 142 | #include "G4VPhysicalVolume.hh" |
---|
| 143 | #include "G4Box.hh" |
---|
| 144 | #include "G4PVPlacement.hh" |
---|
| 145 | |
---|
| 146 | MyParallelWorld::MyParallelWorld(G4String worldName) |
---|
| 147 | <font color="#ff0000">:G4VUserParallelWorld(worldName)</font> |
---|
| 148 | {;} |
---|
| 149 | |
---|
| 150 | MyParallelWorld::~MyParallelWorld() |
---|
| 151 | {;} |
---|
| 152 | |
---|
| 153 | void MyParallelWorld::Construct() |
---|
| 154 | { |
---|
| 155 | G4VPhysicalVolume* ghostWorld = <font color="#ff0000">GetWorld();</font> |
---|
| 156 | G4LogicalVolume* worldLogical = ghostWorld->GetLogicalVolume(); |
---|
| 157 | |
---|
| 158 | // place volumes in the parallel world here. For example ... |
---|
| 159 | // |
---|
| 160 | G4Box * ghostSolid = new G4Box("GhostdBox", 60.*cm, 60.*cm, 60.*cm); |
---|
| 161 | G4LogicalVolume * ghostLogical |
---|
| 162 | = new G4LogicalVolume(ghostSolid, 0, "GhostLogical", 0, 0, 0); |
---|
| 163 | new G4PVPlacement(0, G4ThreeVector(), ghostLogical, |
---|
| 164 | "GhostPhysical", worldLogical, 0, 0); |
---|
| 165 | } |
---|
| 166 | |
---|
| 167 | </pre> |
---|
| 168 | </td> |
---|
| 169 | </tr> |
---|
| 170 | <tr> |
---|
| 171 | <td align=center> |
---|
| 172 | Source listing 4.7.2<BR> |
---|
| 173 | An example source code of a concrete user parallel world class. |
---|
| 174 | </td> |
---|
| 175 | </tr> |
---|
| 176 | </table></center> |
---|
| 177 | </p> |
---|
| 178 | <p> |
---|
| 179 | In case the user needs to define more than one parallel worlds, each of them |
---|
| 180 | must be implemented through its dedicated class. |
---|
| 181 | Each parallel world should be registered to the mass geometry class using the |
---|
| 182 | method <tt>RegisterParallelWorld()</tt> available through the class |
---|
| 183 | <tt>G4VUserDetectorConstruction</tt>. The registration must be done -before- |
---|
| 184 | the mass world is registed to the <tt>G4RunManager</tt>. |
---|
| 185 | </p> |
---|
| 186 | <p> |
---|
| 187 | <center> |
---|
| 188 | <table border=2 cellpadding=10> |
---|
| 189 | <tr> |
---|
| 190 | <td> |
---|
| 191 | <pre> |
---|
| 192 | // RunManager construction |
---|
| 193 | // |
---|
| 194 | G4RunManager* runManager = new G4RunManager; |
---|
| 195 | |
---|
| 196 | // mass world |
---|
| 197 | // |
---|
| 198 | MyDetectorConstruction* massWorld = new MyDetectorConstruction; |
---|
| 199 | |
---|
| 200 | // parallel world |
---|
| 201 | // |
---|
| 202 | massWorld-><font color="#ff0000">RegisterParallelWorld</font>(new MyParallelWorld("ParallelScoringWorld")); |
---|
| 203 | |
---|
| 204 | // set mass world to run manager |
---|
| 205 | // |
---|
| 206 | runManager->SetUserInitialization(massWorld); |
---|
| 207 | </pre> |
---|
| 208 | </td> |
---|
| 209 | </tr> |
---|
| 210 | <tr> |
---|
| 211 | <td align=center> |
---|
| 212 | Source listing 4.7.3<BR> |
---|
| 213 | Typical implementation in the <tt>main()</tt> to define a parallel world. |
---|
| 214 | </td> |
---|
| 215 | </tr> |
---|
| 216 | </table></center> |
---|
| 217 | </p> |
---|
| 218 | |
---|
| 219 | <a name="4.7.3"> |
---|
| 220 | <H2>4.7.3 Detector sensitivity in a parallel world</H2></a> |
---|
| 221 | <p> |
---|
| 222 | Any kind of <ttG4VSensitiveDetector</tt> object can be defined in volumes in a |
---|
| 223 | parallel world, exactly at the same manner for the mass geometry. Once the user |
---|
| 224 | defines the sensitive detector in a parallel world, he/she must define a process |
---|
| 225 | which takes care of these detectors.<br> |
---|
| 226 | The <tt>G4ParallelWorldScoringProcess</tt> is the class provided for this |
---|
| 227 | purpose. This process must be defined to all kinds of particles which need to |
---|
| 228 | be "detected". This process must be ordered <font color="#ff0000">just after |
---|
| 229 | <tt>G4Transporation</tt> and prior to any other physics processes</font>. |
---|
| 230 | The name of the parallel world where the <tt>G4ParallelWorldScoringProcess</tt> |
---|
| 231 | is responsible for, must be defined through the method <tt>SetParallelWorld()</tt> |
---|
| 232 | available from the class <tt>G4ParallelWorldScoringProcess</tt>. |
---|
| 233 | If the user has more than one parallel worlds with detectors, for each of |
---|
| 234 | the parallel worlds, dedicated <tt>G4ParallelWorldScoringProcess</tt> objects |
---|
| 235 | must be instantiated with the name of each parallel world respectively and |
---|
| 236 | registered to the particles. |
---|
| 237 | </p> |
---|
| 238 | <p> |
---|
| 239 | <center> |
---|
| 240 | <table border=2 cellpadding=10> |
---|
| 241 | <tr> |
---|
| 242 | <td> |
---|
| 243 | <pre> |
---|
| 244 | // Add parallel world scoring process |
---|
| 245 | // |
---|
| 246 | G4ParallelWorldScoringProcess* theParallelWorldScoringProcess |
---|
| 247 | = new <font color="#ff0000">G4ParallelWorldScoringProcess</font>("ParaWorldScoringProc"); |
---|
| 248 | theParallelWorldScoringProcess-><font color="#ff0000">SetParallelWorld</font>("ParallelScoringWorld"); |
---|
| 249 | |
---|
| 250 | theParticleIterator->reset(); |
---|
| 251 | while( (*theParticleIterator)() ) |
---|
| 252 | { |
---|
| 253 | G4ParticleDefinition* particle = theParticleIterator->value(); |
---|
| 254 | if (!particle->IsShortLived()) |
---|
| 255 | { |
---|
| 256 | G4ProcessManager* pmanager = particle->GetProcessManager(); |
---|
| 257 | pmanager->AddProcess(theParallelWorldScoringProcess); |
---|
| 258 | pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxAtRest); |
---|
| 259 | pmanager->SetProcessOrdering(theParallelWorldScoringProcess, idxAlongStep, 1); |
---|
| 260 | pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxPostStep); |
---|
| 261 | } |
---|
| 262 | } |
---|
| 263 | </pre> |
---|
| 264 | </td> |
---|
| 265 | </tr> |
---|
| 266 | <tr> |
---|
| 267 | <td align=center> |
---|
| 268 | Source listing 4.7.4<BR> |
---|
| 269 | Define <tt>G4ParallelWorldScoringProcess</tt>. |
---|
| 270 | </td> |
---|
| 271 | </tr> |
---|
| 272 | </table></center> |
---|
| 273 | </p> |
---|
| 274 | <p> |
---|
| 275 | At the end of processing an event, all hits collections made for the parallel |
---|
| 276 | world are stored in <tt>G4HCofThisEvent</tt> as well as those for the mass |
---|
| 277 | geometry. |
---|
| 278 | </p> |
---|
| 279 | |
---|
| 280 | <hr> |
---|
| 281 | <a href="../../../../Authors/html/subjectsToAuthors.html"> |
---|
| 282 | <i>About the authors</i></a> |
---|
| 283 | |
---|
| 284 | </body> |
---|
| 285 | </html> |
---|