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 | // $Id: OlapEventAction.hh,v 1.3 2006/06/29 17:22:02 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: $ |
---|
29 | // |
---|
30 | // |
---|
31 | // -------------------------------------------------------------- |
---|
32 | // OlapEventAction |
---|
33 | // |
---|
34 | // Author: Martin Liendl - Martin.Liendl@cern.ch |
---|
35 | // |
---|
36 | // -------------------------------------------------------------- |
---|
37 | // |
---|
38 | #ifndef OlapEventAction_h |
---|
39 | #define OlapEventAction_h |
---|
40 | |
---|
41 | #include <vector> |
---|
42 | #include "G4UserEventAction.hh" |
---|
43 | #include "globals.hh" |
---|
44 | #include "G4ThreeVector.hh" |
---|
45 | #include "G4NavigationHistory.hh" |
---|
46 | #include "OlapSteppingAction.hh" |
---|
47 | |
---|
48 | class OlapRunAction; |
---|
49 | class OlapDetConstr; |
---|
50 | |
---|
51 | // class to collect detected overlaps |
---|
52 | class OlapInfo |
---|
53 | { |
---|
54 | public: |
---|
55 | OlapInfo(G4NavigationHistory & h1, |
---|
56 | G4NavigationHistory & h2, |
---|
57 | G4ThreeVector & p1, |
---|
58 | G4ThreeVector & p2, |
---|
59 | G4int a=0, |
---|
60 | G4LogicalVolume* original=0) : |
---|
61 | hist1(h1), hist2(h2), v1(p1), v2(p2),axis(a) |
---|
62 | {}; |
---|
63 | |
---|
64 | ~OlapInfo(); |
---|
65 | |
---|
66 | G4bool operator==(const OlapInfo &); |
---|
67 | |
---|
68 | G4NavigationHistory hist1, hist2; |
---|
69 | G4ThreeVector v1, v2; |
---|
70 | G4int axis; |
---|
71 | // geantino ray travelling parallel to that axis detected the olap |
---|
72 | std::vector<OlapStepInfo *> stAB; |
---|
73 | std::vector<OlapStepInfo *> stBA; |
---|
74 | G4String info; |
---|
75 | G4int probNot ; |
---|
76 | G4LogicalVolume* originalMother; |
---|
77 | }; |
---|
78 | |
---|
79 | std::ostream & |
---|
80 | operator<<(std::ostream& flux, OlapInfo & oi); |
---|
81 | |
---|
82 | |
---|
83 | // ------------==============-------------==============---------------- |
---|
84 | |
---|
85 | |
---|
86 | class OlapEventAction : public G4UserEventAction |
---|
87 | { |
---|
88 | public: |
---|
89 | OlapEventAction(OlapRunAction*); |
---|
90 | ~OlapEventAction(); |
---|
91 | |
---|
92 | void BeginOfEventAction(const G4Event* anEvent); |
---|
93 | void EndOfEventAction(const G4Event* anEvent); |
---|
94 | |
---|
95 | // returns true, if new olverlap was detected! |
---|
96 | G4bool InsertOI(OlapInfo *); |
---|
97 | |
---|
98 | OlapRunAction * theRunAction; |
---|
99 | OlapDetConstr * theDet; |
---|
100 | std::vector<OlapStepInfo*> ABSteps; |
---|
101 | std::vector<OlapStepInfo*> BASteps; |
---|
102 | G4bool dontDelete; |
---|
103 | }; |
---|
104 | #endif |
---|