+++ /dev/null
-// $Id$
-// Category: physics
-//
-// See the class description in the header file.
-
-#include "TG4FlagVector.h"
-#include "TG4CutVector.h"
-#include "TG4G3Defaults.h"
-#include "TG4Globals.h"
-
-#include <G4VProcess.hh>
-
-#include <math.h>
-
-TG4FlagVector::TG4FlagVector()
-{
- // initialize fFlagVector
- fFlagVector = new TG3FlagVector;
- for (G4int i=0; i<kNoG3Flags; i++) fFlagVector->insert(kUnset);
-}
-
-TG4FlagVector::TG4FlagVector(const TG4FlagVector& right)
-{
- // copy fFlagVector
- fFlagVector = new TG3FlagVector;
- for (G4int i=0; i<kNoG3Flags; i++) {
- fFlagVector->insert((*right.fFlagVector)[i]);
- }
-}
-
-TG4FlagVector::~TG4FlagVector() {
-//
- delete fFlagVector;
-}
-
-// operators
-
-TG4FlagVector& TG4FlagVector::operator=(const TG4FlagVector& right)
-{
- // check assignement to self
- if (this == &right) return *this;
-
- // initialize fFlagVector
- fFlagVector->clear();
- for (G4int i=0; i<kNoG3Flags; i++) {
- fFlagVector->insert((*right.fFlagVector)[i]);
- }
-
- return *this;
-}
-
-G4double TG4FlagVector::operator[](G4int index) const
-{
-//
- if (index < kNoG3Flags)
- return (*fFlagVector)[index];
- else {
- TG4Globals::Exception(
- "TG4FlagVector::operator[]: index out of the vector scope");
- return 0.;
- }
-}
-
-// public methods
-
-void TG4FlagVector::SetG3Flag(TG3Flag g3Flag, G4double flagValue)
-{
-// Sets the flagValue for the specified flag.
-// ---
-
- if (g3Flag<kNoG3Flags) {
- // conversion G4double -> G3FlagValue
- if (abs(flagValue - kUnset) < 0.01) {
- (*fFlagVector)[g3Flag] = kUnset ;
- }
- else if (abs(flagValue - kInActivate) < 0.01) {
- (*fFlagVector)[g3Flag] = kInActivate;
- }
- else if (abs(flagValue - kActivate) < 0.01) {
- (*fFlagVector)[g3Flag] = kActivate;
- }
- else if (abs(flagValue - kActivate2) < 0.01) {
- (*fFlagVector)[g3Flag] = kActivate2;
- }
- else {
- G4String text = "TG4FlagVector::SetG3Flag:\n ";
- text = text + "Inconsistent/Not-yet-implemented flag has been ignored.";
- TG4Globals::Warning(text);
- }
- }
-}
-
-void TG4FlagVector::SetG3Defaults()
-{
-// Sets G3 default values for all flags.
-// ---
-
- for (G4int i=0; i<kNoG3Flags; i++) {
- (*fFlagVector)[i] = TG4G3Defaults::FlagValue(i);
- }
-}
-
-G4int TG4FlagVector::GetFlag(G4VProcess* process) const
-{
-// Returns the flag value for the particle associated with
-// the specified process.
-// ---
-
- G4String name = process->GetProcessName();
- if (name == "conv") return (*fFlagVector)(kPAIR);
- else if (name == "compt") return (*fFlagVector)(kCOMP);
- else if (name == "phot") return (*fFlagVector)(kPHOT);
- // else if (name == "??") return (*fFlagVector)(kPFIS);
- else if ((name == "eIoni") ||
- (name == "IeIoni") ||
- (name == "eIoni+") ||
- (name == "MuIoni") ||
- (name == "IMuIonisation") ||
- (name == "hIoni") ||
- (name == "IhIoni"))
- return (*fFlagVector)(kDRAY);
- else if (name == "annihil") return (*fFlagVector)(kANNI);
- else if ((name == "eBrem") ||
- (name == "eBrem+") ||
- (name == "IeBrems") ||
- (name == "MuBrems") ||
- (name == "IMuBremsstrahlung"))
- return (*fFlagVector)(kBREM);
- // else if (name == "??") return (*fFlagVector)(kHADR);
- else if (name == "MuNucl") return (*fFlagVector)(kMUNU);
- else if (name == "Decay") return (*fFlagVector)(kDCAY);
- // else if (name == "??") return (*fFlagVector)(kLOSS);
- // !!! not yet implemented
- else if ((name == "msc") ||
- (name == "Imsc")) return (*fFlagVector)(kMULS);
- else return kUnset;
-}
+++ /dev/null
-// $Id$
-// Category: physics
-//
-// Vector of control process flag values
-// with convenient set/get methods
-
-#ifndef TG4_FLAG_VECTOR_H
-#define TG4_FLAG_VECTOR_H
-
-#include "TG4Globals.h"
-#include "TG3Flag.h"
-
-class G4VProcess;
-
-class TG4FlagVector
-{
- typedef G4RWTValOrderedVector<TG3FlagValue> TG3FlagVector;
-
- public:
- TG4FlagVector();
- TG4FlagVector(const TG4FlagVector& right);
- virtual ~TG4FlagVector();
-
- // operators
- TG4FlagVector& operator=(const TG4FlagVector& right);
- G4double operator[](G4int index) const;
-
- // set methods
- void SetG3Flag(TG3Flag g3Flag, G4double flagValue);
- void SetG3Defaults();
-
- // get methods
- G4int GetFlag(G4VProcess* process) const;
-
- private:
- // data members
- TG3FlagVector* fFlagVector; //vector of control process flag values
-};
-
-#endif //TG4_FLAG_VECTOR_H
-
-
-
--- /dev/null
+// $Id$
+// Category: global
+//
+// See the class description in the header file.
+
+#include "TG4G3ControlVector.h"
+#include "TG4G3Defaults.h"
+#include "TG4Globals.h"
+
+#include <G4VProcess.hh>
+
+#include <math.h>
+
+TG4G3ControlVector::TG4G3ControlVector()
+{
+ // initialize fControlVector
+ fControlVector = new TG4ControlValueVector;
+ for (G4int i=0; i<kNoG3Controls; i++) fControlVector->insert(kUnset);
+}
+
+TG4G3ControlVector::TG4G3ControlVector(const TG4G3ControlVector& right)
+{
+ // copy fControlVector
+ fControlVector = new TG4ControlValueVector;
+ for (G4int i=0; i<kNoG3Controls; i++) {
+ fControlVector->insert((*right.fControlVector)[i]);
+ }
+}
+
+TG4G3ControlVector::~TG4G3ControlVector() {
+//
+ delete fControlVector;
+}
+
+// operators
+
+TG4G3ControlVector& TG4G3ControlVector::operator=(
+ const TG4G3ControlVector& right)
+{
+ // check assignement to self
+ if (this == &right) return *this;
+
+ // initialize fControlVector
+ fControlVector->clear();
+ for (G4int i=0; i<kNoG3Controls; i++) {
+ fControlVector->insert((*right.fControlVector)[i]);
+ }
+
+ return *this;
+}
+
+G4double TG4G3ControlVector::operator[](G4int index) const
+{
+//
+ if (index < kNoG3Controls)
+ return (*fControlVector)[index];
+ else {
+ TG4Globals::Exception(
+ "TG4G3ControlVector::operator[]: index out of the vector scope");
+ return 0.;
+ }
+}
+
+// public methods
+
+void TG4G3ControlVector::SetG3Control(TG4G3Control control,
+ G4double controlValue)
+{
+// Sets the controlValue for the specified process control.
+// ---
+
+ if (control<kNoG3Controls) {
+ // conversion G4double -> G3ControlValue
+ if (abs(controlValue - kUnset) < 0.01) {
+ (*fControlVector)[control] = kUnset ;
+ }
+ else if (abs(controlValue - kInActivate) < 0.01) {
+ (*fControlVector)[control] = kInActivate;
+ }
+ else if (abs(controlValue - kActivate) < 0.01) {
+ (*fControlVector)[control] = kActivate;
+ }
+ else if (abs(controlValue - kActivate2) < 0.01) {
+ (*fControlVector)[control] = kActivate2;
+ }
+ else {
+ G4String text = "TG4G3ControlVector::SetG3Control:\n ";
+ text = text + "Inconsistent/Not-yet-implemented control has been ignored.";
+ TG4Globals::Warning(text);
+ }
+ }
+}
+
+void TG4G3ControlVector::SetG3Defaults()
+{
+// Sets G3 default values for all controls.
+// ---
+
+ for (G4int i=0; i<kNoG3Controls; i++) {
+ (*fControlVector)[i] = TG4G3Defaults::ControlValue(i);
+ }
+}
+
+G4int TG4G3ControlVector::GetControl(G4VProcess* process) const
+{
+// Returns the control value for the particle associated with
+// the specified process.
+// ---
+
+ G4String name = process->GetProcessName();
+ if (name == "conv") return (*fControlVector)(kPAIR);
+ else if (name == "compt") return (*fControlVector)(kCOMP);
+ else if (name == "phot") return (*fControlVector)(kPHOT);
+ // else if (name == "??") return (*fControlVector)(kPFIS);
+ else if ((name == "eIoni") ||
+ (name == "IeIoni") ||
+ (name == "eIoni+") ||
+ (name == "MuIoni") ||
+ (name == "IMuIonisation") ||
+ (name == "hIoni") ||
+ (name == "IhIoni"))
+ return (*fControlVector)(kDRAY);
+ else if (name == "annihil") return (*fControlVector)(kANNI);
+ else if ((name == "eBrem") ||
+ (name == "eBrem+") ||
+ (name == "IeBrems") ||
+ (name == "MuBrems") ||
+ (name == "IMuBremsstrahlung"))
+ return (*fControlVector)(kBREM);
+ // else if (name == "??") return (*fControlVector)(kHADR);
+ else if (name == "MuNucl") return (*fControlVector)(kMUNU);
+ else if (name == "Decay") return (*fControlVector)(kDCAY);
+ // else if (name == "??") return (*fControlVector)(kLOSS);
+ // !!! not yet implemented
+ else if ((name == "msc") ||
+ (name == "Imsc")) return (*fControlVector)(kMULS);
+ else return kUnset;
+}
--- /dev/null
+// $Id$
+// Category: global
+//
+// Vector of control process values
+// with convenient set/get methods
+
+#ifndef TG4_G3_CONTROL_VECTOR_H
+#define TG4_G3_CONTROL_VECTOR_H
+
+#include "TG4Globals.h"
+#include "TG4G3Control.h"
+
+class G4VProcess;
+
+class TG4G3ControlVector
+{
+ typedef G4RWTValOrderedVector<TG4G3ControlValue> TG4ControlValueVector;
+
+ public:
+ TG4G3ControlVector();
+ TG4G3ControlVector(const TG4G3ControlVector& right);
+ virtual ~TG4G3ControlVector();
+
+ // operators
+ TG4G3ControlVector& operator=(const TG4G3ControlVector& right);
+ G4double operator[](G4int index) const;
+
+ // set methods
+ void SetG3Control(TG4G3Control control, G4double controlValue);
+ void SetG3Defaults();
+
+ // get methods
+ G4int GetControl(G4VProcess* process) const;
+
+ private:
+ // data members
+ TG4ControlValueVector* fControlVector; //vector of control process values
+};
+
+#endif //TG4_G3_CONTROL_VECTOR_H
+
+
+