LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
OpParamSD.h
Go to the documentation of this file.
1 //
6 //
7 // This class represents a partially opaque, parameterized optical volume.
8 //
9 // The photon transmission probability is determined as a function of
10 // photon position and momentum direction by a derived class of
11 // OpParamAction. The particlar derived class to use is specified in a string given to
12 // the constructor, along with any parameters required to define that object.
13 // This implementation allows for generic extensions to new types of wireplanes
14 // or opaque surfaces for future liquid argon TPC detectors.
15 //
16 // On each step of a photon within this volume, the GetAttenuationFraction
17 // method of the OpParamAction derivative is called to get a photon
18 // transmission probability. A fraction of all photons are killed
19 // accordingly.
20 //
21 // This sensitive detector object is attached to physical volumes by the
22 // OpDetReadoutGeometry class.
23 //
24 //
25 // Ben Jones, MIT,2013
26 //
27 
28 
29 // LArSoft includes
30 
31 #include "Geant4/G4VSensitiveDetector.hh"
34 
35 
36 // Geant4 includes
37 
38 #include "Geant4/Randomize.hh"
39 #include "Geant4/G4RandomTools.hh"
40 
41 
42 #ifndef OpParamSD_h
43 #define OpParamSD_h 1
44 
45 class G4HCofThisEvent;
46 class G4TOuchableHistory;
47 class G4Step;
48 
49 namespace sim{
50  class SimPhotonsCollection;
51 }
52 
53 namespace larg4 {
54 
55  class OpDetLookup;
56  class OpDetPhotonTable;
57 
58  class OpParamSD : public G4VSensitiveDetector
59  {
60 
61 
62  public:
63  OpParamSD(G4String name, std::string ModelName, int Orientation, std::vector<std::vector<double> > Parameters);
64  virtual ~OpParamSD(){}
65 
66 
67  // Beginning and end of event
68  virtual void Initialize(G4HCofThisEvent*);
69  virtual void EndOfEvent(G4HCofThisEvent*){}
70 
71  // Tidy up event in abort
72  virtual void clear(){}
73 
74  // Run per step in sensitive volume
75  virtual G4bool ProcessHits( G4Step*, G4TouchableHistory*);
76 
77 
78  // Required but empty
79  virtual void DrawAll(){}
80  virtual void PrintAll(){}
81 
82 
83  private:
84  G4bool G4BooleanRand(const G4double prob) const;
85 
87  std::map<G4int, bool> fPhotonAlreadyCrossed;
88 
89  };
90 
91 
92 
93  inline
94  G4bool OpParamSD::G4BooleanRand(const G4double prob) const
95  {
96  /* Returns a random boolean variable with the specified probability */
97  return (G4UniformRand() < prob);
98  }
99 
100 
101 
102 }
103 
104 #endif
virtual void DrawAll()
Definition: OpParamSD.h:79
void Initialize()
Definition: errprop.cc:101
virtual void PrintAll()
Definition: OpParamSD.h:80
Geant4 interface.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
virtual ~OpParamSD()
Definition: OpParamSD.h:64
Monte Carlo Simulation.
std::map< G4int, bool > fPhotonAlreadyCrossed
Definition: OpParamSD.h:87
virtual void EndOfEvent(G4HCofThisEvent *)
Definition: OpParamSD.h:69
virtual void clear()
Definition: OpParamSD.h:72
OpParamAction * fOpa
Definition: OpParamSD.h:86
Tools and modules for checking out the basics of the Monte Carlo.