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

#include <OpParamAction.h>

Inheritance diagram for larg4::OverlaidWireplanesAction:
larg4::OpParamAction

Public Member Functions

 OverlaidWireplanesAction (std::vector< std::vector< double > >, int)
 
 ~OverlaidWireplanesAction ()
 
double GetAttenuationFraction (G4ThreeVector PhotonDirection, G4ThreeVector PhotonPosition)
 
- Public Member Functions inherited from larg4::OpParamAction
 OpParamAction ()
 
virtual ~OpParamAction ()
 

Private Attributes

G4ThreeVector fPlaneNormal
 
std::vector< G4ThreeVector > fWireDirections
 
std::vector< double > fDPRatios
 

Detailed Description

Definition at line 95 of file OpParamAction.h.

Constructor & Destructor Documentation

larg4::OverlaidWireplanesAction::OverlaidWireplanesAction ( std::vector< std::vector< double > >  InputVectors,
int  Orientation 
)

Definition at line 79 of file OpParamAction.cxx.

80  {
81 
82  G4ThreeVector WireBasis1, WireBasis2;
83 
84  if(Orientation==0)
85  {
86  fPlaneNormal=G4ThreeVector(1,0,0);
87  WireBasis1 =G4ThreeVector(0,1,0);
88  WireBasis2 =G4ThreeVector(0,0,1);
89  }
90  else if(Orientation==1)
91  {
92  fPlaneNormal=G4ThreeVector(0,1,0);
93  WireBasis1 =G4ThreeVector(1,0,0);
94  WireBasis2 =G4ThreeVector(0,0,1);
95  }
96  else if(Orientation==2)
97  {
98  fPlaneNormal=G4ThreeVector(0,0,1);
99  WireBasis1 =G4ThreeVector(0,1,0);
100  WireBasis2 =G4ThreeVector(0,0,1);
101  }
102  else
103  {
104  throw cet::exception("OpParamAction") << "Unrecognized wireplane orientation. Options are 1=Xdrift, 2=Ydrift, 3=Zdrift\n";
105  }
106  for(size_t i=0; i!=InputVectors.size(); ++i)
107  {
108  if(InputVectors.at(i).size()!=3)
109  {
110  throw cet::exception("OpParamAction") << "Unrecognized wireplane parameter format. Expected vector(3)'s with v[0] = wire angle, v[1] = wire pitch, v[2] = wire diameter\n";
111  }
112  else
113  {
114  double theta = InputVectors[i][0]*3.142/180.;
115  fWireDirections.push_back(cos(theta)*WireBasis1 + sin(theta)*WireBasis2);
116  fDPRatios.push_back(InputVectors[i][2]/InputVectors[i][1]);
117  }
118  }
119  }
std::vector< double > fDPRatios
std::vector< G4ThreeVector > fWireDirections
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
larg4::OverlaidWireplanesAction::~OverlaidWireplanesAction ( )

Definition at line 124 of file OpParamAction.cxx.

125  {
126  }

Member Function Documentation

double larg4::OverlaidWireplanesAction::GetAttenuationFraction ( G4ThreeVector  PhotonDirection,
G4ThreeVector  PhotonPosition 
)
virtual

Reimplemented from larg4::OpParamAction.

Definition at line 131 of file OpParamAction.cxx.

132  {
133 
134  double AttenFraction=1.;
135 
136  for(size_t i=0; i!=fWireDirections.size(); ++i)
137  {
138  G4ThreeVector ProjDirection = PhotonDirection - fWireDirections.at(i) * (fWireDirections.at(i).dot(PhotonDirection.unit()));
139 
140  // fWireDirections.at(i).cross(PhotonDirection.cross(fWireDirections.at(i)).unit());
141  double CosTheta = (ProjDirection.mag() > 0 ? std::abs(fPlaneNormal.dot(ProjDirection))/ProjDirection.mag() : 1.0);
142  if(CosTheta < fDPRatios.at(i))
143  return 0;
144  else
145  AttenFraction *= (1.0 - fDPRatios.at(i) / CosTheta);
146  }
147  return AttenFraction;
148  }
std::vector< double > fDPRatios
T abs(T value)
std::vector< G4ThreeVector > fWireDirections

Member Data Documentation

std::vector<double> larg4::OverlaidWireplanesAction::fDPRatios
private

Definition at line 107 of file OpParamAction.h.

G4ThreeVector larg4::OverlaidWireplanesAction::fPlaneNormal
private

Definition at line 105 of file OpParamAction.h.

std::vector<G4ThreeVector> larg4::OverlaidWireplanesAction::fWireDirections
private

Definition at line 106 of file OpParamAction.h.


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