source: trunk/examples/extended/geometry/olap/include/OlapEventAction.hh@ 1343

Last change on this file since 1343 was 1342, checked in by garnier, 15 years ago

update ti head

File size: 3.5 KB
Line 
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.5 2010/10/27 10:29:12 gcosmo Exp $
28// GEANT4 tag $Name: examples-V09-03-09 $
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
48class OlapRunAction;
49class OlapDetConstr;
50
51// class to collect detected overlaps
52class OlapInfo
53{
54public:
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 originalMother(original)
63 {};
64
65 ~OlapInfo();
66
67 G4bool operator==(const OlapInfo &);
68
69 G4NavigationHistory hist1, hist2;
70 G4ThreeVector v1, v2;
71 G4int axis;
72 // geantino ray travelling parallel to that axis detected the olap
73 std::vector<OlapStepInfo *> stAB;
74 std::vector<OlapStepInfo *> stBA;
75 G4String info;
76 G4int probNot ;
77 G4LogicalVolume* originalMother;
78};
79
80std::ostream &
81 operator<<(std::ostream& flux, OlapInfo & oi);
82
83
84// ------------==============-------------==============----------------
85
86
87class OlapEventAction : public G4UserEventAction
88{
89public:
90 OlapEventAction(OlapRunAction*);
91 ~OlapEventAction();
92
93 void BeginOfEventAction(const G4Event* anEvent);
94 void EndOfEventAction(const G4Event* anEvent);
95
96 // returns true, if new olverlap was detected!
97 G4bool InsertOI(OlapInfo *);
98
99 OlapRunAction * theRunAction;
100 OlapDetConstr * theDet;
101 std::vector<OlapStepInfo*> ABSteps;
102 std::vector<OlapStepInfo*> BASteps;
103 G4bool dontDelete;
104};
105#endif
Note: See TracBrowser for help on using the repository browser.