Public Member Functions | Private Member Functions | Private Attributes | List of all members
larg4::OpParamSD Class Reference

#include <OpParamSD.h>

Inheritance diagram for larg4::OpParamSD:

Public Member Functions

 OpParamSD (G4String name, std::string ModelName, int Orientation, std::vector< std::vector< double > > Parameters)
 
virtual ~OpParamSD ()
 
virtual void Initialize (G4HCofThisEvent *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
virtual void clear ()
 
virtual G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
virtual void DrawAll ()
 
virtual void PrintAll ()
 

Private Member Functions

G4bool G4BooleanRand (const G4double prob) const
 

Private Attributes

OpParamActionfOpa
 
std::map< G4int, boolfPhotonAlreadyCrossed
 

Detailed Description

Definition at line 48 of file OpParamSD.h.

Constructor & Destructor Documentation

larg4::OpParamSD::OpParamSD ( G4String  name,
std::string  ModelName,
int  Orientation,
std::vector< std::vector< double > >  Parameters 
)

Definition at line 28 of file OpParamSD.cxx.

29  : G4VSensitiveDetector(DetectorUniqueName)
30  {
31  // Register self with sensitive detector manager
32  G4SDManager::GetSDMpointer()->AddNewDetector(this);
33 
34  if(ModelName == "OverlaidWireplanes")
35  fOpa = new OverlaidWireplanesAction(ModelParameters, Orientation);
36 
37  else if(ModelName == "TransparentPlaneAction")
38  fOpa = new TransparentPlaneAction();
39 
40 // else if(ModelName == "SimpleWireplane")
41 // fOpa = new SimpleWireplaneAction(ModelParameters, Orientation);
42 
43 
44  // else if( your model here )
45 
46  else
47  {
48  throw cet::exception("OpParamSD")<<"Error: Optical parameterization model " << ModelName <<" not found.\n";
49  }
50 
51  }
OpParamAction * fOpa
Definition: OpParamSD.h:76
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
virtual larg4::OpParamSD::~OpParamSD ( )
inlinevirtual

Definition at line 54 of file OpParamSD.h.

54 {}

Member Function Documentation

virtual void larg4::OpParamSD::clear ( )
inlinevirtual

Definition at line 62 of file OpParamSD.h.

62 {}
virtual void larg4::OpParamSD::DrawAll ( )
inlinevirtual

Definition at line 69 of file OpParamSD.h.

69 {}
virtual void larg4::OpParamSD::EndOfEvent ( G4HCofThisEvent *  )
inlinevirtual

Definition at line 59 of file OpParamSD.h.

59 {}
G4bool larg4::OpParamSD::G4BooleanRand ( const G4double  prob) const
inlineprivate

Definition at line 84 of file OpParamSD.h.

85  {
86  /* Returns a random boolean variable with the specified probability */
87  return (G4UniformRand() < prob);
88  }
void larg4::OpParamSD::Initialize ( G4HCofThisEvent *  )
virtual

Definition at line 83 of file OpParamSD.cxx.

84  {
85  fPhotonAlreadyCrossed.clear();
86  }
std::map< G4int, bool > fPhotonAlreadyCrossed
Definition: OpParamSD.h:77
virtual void larg4::OpParamSD::PrintAll ( )
inlinevirtual

Definition at line 70 of file OpParamSD.h.

70 {}
G4bool larg4::OpParamSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
virtual

Definition at line 56 of file OpParamSD.cxx.

57  {
58 
59  const G4Track* aTrack = aStep->GetTrack();
60  const G4DynamicParticle* aParticle = aTrack->GetDynamicParticle();
61 
62 
63  G4ThreeVector mom = aParticle->GetMomentumDirection();
64  G4ThreeVector pos = aStep->GetPostStepPoint()->GetPosition();
65  if(!fPhotonAlreadyCrossed[aTrack->GetTrackID()])
66  {
68  {
69  // photon survives - let it carry on
70  fPhotonAlreadyCrossed[aTrack->GetTrackID()]=true;
71  }
72  else
73  {
74  // photon is absorbed
75  aStep->GetTrack()->SetTrackStatus(fStopAndKill);
76  }
77  }
78  return true;
79  }
G4bool G4BooleanRand(const G4double prob) const
Definition: OpParamSD.h:84
std::map< G4int, bool > fPhotonAlreadyCrossed
Definition: OpParamSD.h:77
virtual double GetAttenuationFraction(G4ThreeVector PhotonDirection, G4ThreeVector PhotonPosition)
OpParamAction * fOpa
Definition: OpParamSD.h:76

Member Data Documentation

OpParamAction* larg4::OpParamSD::fOpa
private

Definition at line 76 of file OpParamSD.h.

std::map<G4int, bool> larg4::OpParamSD::fPhotonAlreadyCrossed
private

Definition at line 77 of file OpParamSD.h.


The documentation for this class was generated from the following files: