musrsim/include/musrUniformField.hh
Kamil Sedlak fcd5eea567 Kamil Sedlak 2009-05-18
This is the first version of the muSR simulation code (musrSim)
based on the merged codes of Kamil Sedlak and Toni Shiroka.
It should be a running version of the simulation code, however 
it has not been very well tested, therefore it will probably
need some further development.
2009-05-18 09:59:52 +00:00

46 lines
1.2 KiB
C++

// Geant4 simulation for MuSR
// AUTHOR: Toni SHIROKA, Paul Scherrer Institut, PSI
// DATE : 2008-05
//
#ifndef UNIFORM_BFIELD_HH
#define UNIFORM_BFIELD_HH
#include "G4LogicalVolume.hh"
#include "G4Box.hh"
#include "F04ElementField.hh"
#include "F04GlobalField.hh"
// UniformField implements a constant electromagnetic field in any direction. TS
class musrUniformField : public F04ElementField
{
public:
musrUniformField(G4double EMF[6], G4double half_X, G4double half_Y, G4double half_Z, G4LogicalVolume*, G4ThreeVector);
virtual ~musrUniformField() {}
// TS: Define the two newly added VIRTUAL functions of F04ElementField
G4double GetNominalFieldValue();
void SetNominalFieldValue(G4double newFieldValue);
virtual G4double getLength() { return fieldLength; }
virtual G4double getWidth() { return fieldWidth; }
virtual G4double getHeight() { return fieldHeight; }
G4bool isOutside(G4ThreeVector& local) const;
G4bool isWithin (G4ThreeVector& local) const;
void addFieldValue(const G4double point[4], G4double field[6]) const;
private:
G4double EMfield[6];
G4double fieldLength;
G4double fieldWidth;
G4double fieldHeight;
};
#endif