Public Member Functions | Public Attributes | List of all members
LBNESurveyorMessenger Class Reference

#include <LBNESurveyor.hh>

Inheritance diagram for LBNESurveyorMessenger:

Public Member Functions

 LBNESurveyorMessenger ()
 
 LBNESurveyorMessenger (LBNESurveyedPt *aPts, const G4String &aName, const G4String &description)
 
 LBNESurveyorMessenger (LBNESurveyorMessenger const &other)
 
LBNESurveyorMessengeroperator= (LBNESurveyorMessenger const &other)
 
 ~LBNESurveyorMessenger ()
 
void SetNewValue (G4UIcommand *cmd, G4String val)
 

Public Attributes

std::string fFullName
 
LBNESurveyedPtfPoint
 
G4UIcmdWithABool * fSetPositionFromToleranceCmd
 
G4UIcmdWith3Vector * fToleranceCmd
 
G4UIcmdWith3Vector * fPositionCmd
 

Detailed Description

Definition at line 53 of file LBNESurveyor.hh.

Constructor & Destructor Documentation

LBNESurveyorMessenger::LBNESurveyorMessenger ( )

Definition at line 6 of file LBNESurveyor.cc.

6  :
8 fPoint(0),
10 fToleranceCmd(0),
11 fPositionCmd(0)
12 {
13 
14 }
G4UIcmdWith3Vector * fToleranceCmd
Definition: LBNESurveyor.hh:69
std::string string
Definition: nybbler.cc:12
LBNESurveyedPt * fPoint
Definition: LBNESurveyor.hh:67
G4UIcmdWith3Vector * fPositionCmd
Definition: LBNESurveyor.hh:70
G4UIcmdWithABool * fSetPositionFromToleranceCmd
Definition: LBNESurveyor.hh:68
LBNESurveyorMessenger::LBNESurveyorMessenger ( LBNESurveyedPt aPts,
const G4String &  aName,
const G4String &  description 
)

Definition at line 16 of file LBNESurveyor.cc.

16  :
17 fFullName(aName),
18 fPoint(aPts),
20 fToleranceCmd(0),
21 fPositionCmd(0)
22 {
23 
24 // std::cerr << " LBNESurveyorMessenger::LBNESurveyorMessenger for " << aName << std::endl;
25  std::string cmdPathTop=std::string(fFullName) + std::string("/");
26 
27  std::string cmdPathLTol(cmdPathTop); cmdPathLTol += std::string("SetByTolerance");
28  fSetPositionFromToleranceCmd = new G4UIcmdWithABool(cmdPathLTol.c_str(), this );
29  fSetPositionFromToleranceCmd->SetParameterName("SetByTolerance",true);
30  fSetPositionFromToleranceCmd->SetDefaultValue(true);
31 
32 // Units are always mm, default units in geant4.
33 
34  std::string cmdPathTol(cmdPathTop); cmdPathTol += std::string("Tolerance");
35  fToleranceCmd = new G4UIcmdWith3Vector(cmdPathTol.c_str(), this );
36  fToleranceCmd->SetParameterName("ToleranceX", "ToleranceY", "ToleranceZ", true);
37 
38  // Specific default values needs to be defined here, mechanical by mechanical elements..
39  // based on the name..
40 
41  fToleranceCmd->SetDefaultValue(G4ThreeVector(1.0e-6, 1.0e-6, 1.0e-6)); // one nanometer.
42 
43  std::string cmdPathPos(cmdPathTop); cmdPathPos += std::string("Position");
44  fPositionCmd = new G4UIcmdWith3Vector(cmdPathPos.c_str(), this );
45  fPositionCmd->SetParameterName("PositionX", "PositionY", "PositionZ", true);
46  fPositionCmd->SetDefaultValue(G4ThreeVector(0., 0., 0.));
47 //
48  fPositionCmd->SetGuidance(description.c_str());
49 // Furthermore...
50 
51  if (aName.find("UpstreamRightPin") != std::string::npos)
52  fToleranceCmd->SetGuidance(
53  " The elevation (Y) coordinate is not very accurate, however, the horizontal (X) was defined to 20 microns " );
54 
55 // std::cerr << " LBNESurveyorMessenger::LBNESurveyorMessenger for " << aName << " done " << std::endl;
56 
57 }
G4UIcmdWith3Vector * fToleranceCmd
Definition: LBNESurveyor.hh:69
std::string string
Definition: nybbler.cc:12
LBNESurveyedPt * fPoint
Definition: LBNESurveyor.hh:67
G4UIcmdWith3Vector * fPositionCmd
Definition: LBNESurveyor.hh:70
G4UIcmdWithABool * fSetPositionFromToleranceCmd
Definition: LBNESurveyor.hh:68
LBNESurveyorMessenger::LBNESurveyorMessenger ( LBNESurveyorMessenger const &  other)

Definition at line 58 of file LBNESurveyor.cc.

58  : G4UImessenger(other) {
59  std::cerr << " LBNESurveyorMessenger::LBNESurveyorMessenger copy constructor invoked... " << std::endl;
60  fFullName = other.fFullName;
61  fPoint = other.fPoint; // back pointer to the point in question... Could be null is this messenger is blank.
62  fSetPositionFromToleranceCmd = other.fSetPositionFromToleranceCmd;
63  fToleranceCmd = other.fToleranceCmd;
64  fPositionCmd = other.fPositionCmd;
65  std::cerr << " fPositionCmd " << (void *) fPositionCmd << " from " << (void *) other.fPositionCmd << std::endl;
66  // Test assignments..
67  fPositionCmd->SetDefaultValue(G4ThreeVector(1.0e-12, 1.0e-13, 1.0e-15));
68  std::cerr << " O.K. ! ... " << std::endl;
69 }
G4UIcmdWith3Vector * fToleranceCmd
Definition: LBNESurveyor.hh:69
STL namespace.
LBNESurveyedPt * fPoint
Definition: LBNESurveyor.hh:67
G4UIcmdWith3Vector * fPositionCmd
Definition: LBNESurveyor.hh:70
G4UIcmdWithABool * fSetPositionFromToleranceCmd
Definition: LBNESurveyor.hh:68
QTextStream & endl(QTextStream &s)
LBNESurveyorMessenger::~LBNESurveyorMessenger ( )

Definition at line 87 of file LBNESurveyor.cc.

87  {
88  std::cerr << " LBNESurveyorMessenger::~LBNESurveyorMessenger invoked " << std::endl;
89  //
90  // The pointer to the Surveyed point is not owned by this messenger!
91  //
92 // delete fSetPositionFromToleranceCmd;
93 // delete fToleranceCmd;
94 // delete fPositionCmd;
95 // Can't delete them, these are not smart pointers.
96 
97 }
QTextStream & endl(QTextStream &s)

Member Function Documentation

LBNESurveyorMessenger & LBNESurveyorMessenger::operator= ( LBNESurveyorMessenger const &  other)

Definition at line 70 of file LBNESurveyor.cc.

70  {
71 
72  std::cerr << " LBNESurveyorMessenger::LBNESurveyorMessenger operator =... " << std::endl;
73  // This assignment operator seems broken. Suspect the base class not working right
74  fFullName = other.fFullName;
75  fPoint = other.fPoint; // back pointer to the point in question... Could be null is this messenger is blank.
76  fSetPositionFromToleranceCmd = other.fSetPositionFromToleranceCmd;
77  fToleranceCmd = other.fToleranceCmd;
78  fPositionCmd = other.fPositionCmd;
79  std::cerr << " fPositionCmd " << (void *) fPositionCmd << " from " << (void *) other.fPositionCmd << std::endl;
80  // Test assignments..
81  fPositionCmd->SetDefaultValue(G4ThreeVector(1.0e-12, 1.0e-13, 1.0e-15));
82  std::cerr << " O.K. ! ... " << std::endl;
83  return *this;
84 }
G4UIcmdWith3Vector * fToleranceCmd
Definition: LBNESurveyor.hh:69
STL namespace.
LBNESurveyedPt * fPoint
Definition: LBNESurveyor.hh:67
G4UIcmdWith3Vector * fPositionCmd
Definition: LBNESurveyor.hh:70
G4UIcmdWithABool * fSetPositionFromToleranceCmd
Definition: LBNESurveyor.hh:68
QTextStream & endl(QTextStream &s)
void LBNESurveyorMessenger::SetNewValue ( G4UIcommand *  cmd,
G4String  val 
)

Definition at line 99 of file LBNESurveyor.cc.

100 {
101  std::cerr << " LBNESurveyorMessenger::SetNewValue, Position, And quit ! " << std::endl; exit(2);
103  G4UIcmdWithABool *cmdB = reinterpret_cast <G4UIcmdWithABool*> (cmd);
104  fPoint->SetPositionByTolerance(cmdB->GetNewBoolValue(newValue.c_str()));
105  }
106  if (cmd == fToleranceCmd) {
107  G4UIcmdWith3Vector *cmdB = reinterpret_cast <G4UIcmdWith3Vector*> (cmd);
108  fPoint->SetTolerance(cmdB->GetNew3VectorValue(newValue.c_str()));
109  }
110  if (cmd == fPositionCmd) {
111  G4UIcmdWith3Vector *cmdB = reinterpret_cast <G4UIcmdWith3Vector*> (cmd);
112  std::cerr << " About to displace " << fPoint->GetName() << " by " << cmdB->GetNew3VectorValue(newValue.c_str()) << std::endl;
113  fPoint->SetPosition(cmdB->GetNew3VectorValue(newValue.c_str()));
114  std::cerr << " And quit " << std::endl; exit(2);
115  }
116 }
G4UIcmdWith3Vector * fToleranceCmd
Definition: LBNESurveyor.hh:69
void SetPosition(const G4ThreeVector &pos)
Definition: LBNESurveyor.hh:92
const std::string & GetName() const
Definition: LBNESurveyor.hh:90
LBNESurveyedPt * fPoint
Definition: LBNESurveyor.hh:67
G4UIcmdWith3Vector * fPositionCmd
Definition: LBNESurveyor.hh:70
list cmd
Definition: getreco.py:22
void SetTolerance(const G4ThreeVector &tolerance)
Definition: LBNESurveyor.hh:91
void SetPositionByTolerance(bool t)
G4UIcmdWithABool * fSetPositionFromToleranceCmd
Definition: LBNESurveyor.hh:68
QTextStream & endl(QTextStream &s)

Member Data Documentation

std::string LBNESurveyorMessenger::fFullName

Definition at line 66 of file LBNESurveyor.hh.

LBNESurveyedPt* LBNESurveyorMessenger::fPoint

Definition at line 67 of file LBNESurveyor.hh.

G4UIcmdWith3Vector* LBNESurveyorMessenger::fPositionCmd

Definition at line 70 of file LBNESurveyor.hh.

G4UIcmdWithABool* LBNESurveyorMessenger::fSetPositionFromToleranceCmd

Definition at line 68 of file LBNESurveyor.hh.

G4UIcmdWith3Vector* LBNESurveyorMessenger::fToleranceCmd

Definition at line 69 of file LBNESurveyor.hh.


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