LBNESurveyor.cc
Go to the documentation of this file.
1 // #include "LBNESubVolume.hh" Independent from this.
2 #include "LBNESurveyor.hh"
3 #include "Randomize.hh"
4 #include "G4SystemOfUnits.hh"
5 
7 fFullName(std::string("")),
8 fPoint(0),
9 fSetPositionFromToleranceCmd(0),
10 fToleranceCmd(0),
11 fPositionCmd(0)
12 {
13 
14 }
15 
16 LBNESurveyorMessenger::LBNESurveyorMessenger(LBNESurveyedPt* aPts, const G4String &aName, const G4String &description):
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 }
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.
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 }
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.
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 }
85 
86 
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 }
98 
99 void LBNESurveyorMessenger::SetNewValue(G4UIcommand* cmd, G4String newValue)
100 {
101  std::cerr << " LBNESurveyorMessenger::SetNewValue, Position, And quit ! " << std::endl; exit(2);
102  if (cmd == fSetPositionFromToleranceCmd) {
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 }
117 
119 fName(""),
120 fPositionSetByTolerance(false),
121 fTolerance(1.0e-6, 1.0e-6, 1.0e-6),
122 fPosition(0., 0., 0.) // messenger undefined if point is not named.
123 {}
124 
126 fName(aName),
128 fTolerance(1.0e-6, 1.0e-6, 1.0e-6),
129 fPosition(0., 0., 0.)
130 {
131  defineMessenger();
132 }
133 
134 LBNESurveyedPt::LBNESurveyedPt(const std::string &aName, const G4ThreeVector &tolerance) :
135 fName(aName),
137 fTolerance(tolerance),
138 fPosition(0., 0., 0.)
139 {
140  defineMessenger();
141 }
142 
144 
145  /*
146  // This does not work: the G4UIcommand does not appropriate copy constructors.
147  // or assignment operator...
148  std::string descr("Surveyed Position of the ");
149  std::string fullName("/LBNE/Surveyor/");
150  fullName += fName;
151  descr += fName;
152  if (fName.find("Horn1") != std::string::npos) {
153  if (fName.find("UpstreamLeftBall") != std::string::npos)
154  descr += std::string(" Surveyed Position of the upstream, left side alignment Ball for Horn1 ") ;
155  if (fName.find("UpstreamRightBall") != std::string::npos)
156  descr += std::string(" Surveyed Position of the upstream, side side alignment Ball for Horn1 ") ;
157  if (fName.find("DowstreamAnchor") != std::string::npos)
158  descr += std::string(" Surveyed Position downstream fixed point for Horn1 ") ;
159  }
160  if (fName.find("TargetCanister") != std::string::npos) {
161  descr += std::string(", ");
162  if (fName.find("Upstream") != std::string::npos) descr += " Upstream, ";
163  else if (fName.find("ownstream") != std::string::npos) descr += " Downstream, ";
164  if (fName.find("Left") != std::string::npos) descr += " left side ";
165  else if (fName.find("Right") != std::string::npos) descr += " right side ";
166  descr += std::string("alignment pin for the target canister ") ;
167  }
168 
169  fMessenger = LBNESurveyorMessenger(this, fullName, descr);
170  */
171 }
172 
173 
176  if (!t) return;
177  //
178  // Set the position. Assume a flat distribution within tolerance.. for now...
179  //
180  for (size_t k=0; k!=3; ++k) fPosition[k] = 2.0*fTolerance[k]*(G4RandFlat::shoot() -0.5);
181 }
182 
185  if (fInstance == 0) fInstance = new LBNESurveyor();
186  return fInstance;
187 }
188 
190 {
191 
192 // std::cerr << " LBNESurveyor::LBNESurveyor, start ... " << std::endl;
193  fAllMessenger = new LBNEAllSurveyorMessenger();
194  SetThings();
195 }
196 void LBNESurveyor::SetIt() { // Randomize, perhaps.. Not commissioned..
197 /*
198  for(std::vector<LBNESurveyedPt>::iterator itPt=fData.begin(); itPt != fData.end(); ++itPt) {
199  if (itPt->IsPositionSetByTolerance()) itPt->SetPositionByTolerance(false);
200  }
201  SetThings(); // a place holder for now..
202  const double toleranceTarget= 0.1; // This parameter will most likely have a G4Messenger associated to it.
203 // TieTargetSegments(toleranceTarget);
204 */
205 }
207 
208 //
209 // Setting real aligned placements by tolerance, i.e. assign random position of objects, was
210 // viewed as "strange and not really needed" by Jim Hylen and Tom Junk. So, leave on the back burner
211 // and install a few points for only for the target, and Horn1
212 //
213 
214  AddPoint(std::string("UpstreamLeftPinTargetCanister"));
215  AddPoint(std::string("UpstreamRightPinTargetCanister"));
216  AddPoint(std::string("DownstreamLeftPinTargetCanister"));
217  AddPoint(std::string("DownstreamRightPinTargetCanister"));
218 //
219  AddPoint(std::string("UpstreamLeftPinTargetHeTube"));
220  AddPoint(std::string("UpstreamRightPinTargetHeTube"));
221  AddPoint(std::string("DownstreamLeftPinTargetHeTube"));
222  AddPoint(std::string("DownstreamRightPinTargetHeTube"));
223 
224  AddPoint(std::string("UpstreamLeftBallHorn1"));
225  AddPoint(std::string("UpstreamRightBallHorn1"));
226  AddPoint(std::string("DownstreamLeftBallHorn1"));
227  AddPoint(std::string("DownstreamRightBallHorn1"));
228 
229  AddPoint(std::string("UpstreamLeftBallHorn2"));
230  AddPoint(std::string("UpstreamRightBallHorn2"));
231  AddPoint(std::string("DownstreamLeftBallHorn2"));
232  AddPoint(std::string("DownstreamRightBallHorn2"));
233 
234  AddPoint(std::string("UpstreamLeftBallHorn3"));
235  AddPoint(std::string("UpstreamRightBallHorn3"));
236  AddPoint(std::string("DownstreamLeftBallHorn3"));
237  AddPoint(std::string("DownstreamRightBallHorn3"));
238 
239  AddPoint(std::string("UpstreamLeftDecayPipe"));
240  AddPoint(std::string("UpstreamRightDecayPipe"));
241  AddPoint(std::string("DownstreamLeftDecayPipe"));
242  AddPoint(std::string("DownstreamRightDecayPipe"));
243 
244  fAllMessenger->defineAllCommds();
245 
246 }
248 
249  fSurvDir = new G4UIdirectory("/LBNE/Surveyor/");
250  fSurvDir->SetGuidance("Implement controlled misalignments ");
251 
252 }
254 
279  delete fSurvDir;
280 
281 }
283 
284  if (amDefined) return;
285  fSurvPosUpstreamLeftPinTargetCanister = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamLeftPinTargetCanister", this);
286  fSurvPosUpstreamRightPinTargetCanister = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamRightPinTargetCanister", this);
287  fSurvPosDownstreamLeftPinTargetCanister = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamLeftPinTargetCanister", this);
288  fSurvPosDownstreamRightPinTargetCanister = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamRightPinTargetCanister", this);
289  fSurvPosUpstreamLeftPinTargetHeTube = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamLeftPinTargetHeTube", this);
290  fSurvPosUpstreamRightPinTargetHeTube = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamRightPinTargetHeTube", this);
291  fSurvPosDownstreamLeftPinTargetHeTube = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamLeftPinTargetHeTube", this);
292  fSurvPosDownstreamRightPinTargetHeTube = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamRightPinTargetHeTube", this);
293  fSurvPosUpstreamLeftBallHorn1 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamLeftBallHorn1", this);
294  fSurvPosUpstreamRightBallHorn1 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamRightBallHorn1", this);
295  fSurvPosDownstreamLeftBallHorn1 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamLeftBallHorn1", this);
296  fSurvPosDownstreamRightBallHorn1 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamRightBallHorn1", this);
297  fSurvPosUpstreamLeftBallHorn2 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamLeftBallHorn2", this);
298  fSurvPosUpstreamRightBallHorn2 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamRightBallHorn2", this);
299  fSurvPosDownstreamLeftBallHorn2 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamLeftBallHorn2", this);
300  fSurvPosDownstreamRightBallHorn2 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamRightBallHorn2", this);
301  fSurvPosUpstreamLeftBallHorn3 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamLeftBallHorn3", this);
302  fSurvPosUpstreamRightBallHorn3 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamRightBallHorn3", this);
303  fSurvPosDownstreamLeftBallHorn3 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamLeftBallHorn3", this);
304  fSurvPosDownstreamRightBallHorn3 = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamRightBallHorn3", this);
305  fSurvPosUpstreamLeftDecayPipe = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamLeftDecayPipe", this);
306  fSurvPosUpstreamRightDecayPipe = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosUpstreamRightDecayPipe", this);
307  fSurvPosDownstreamLeftDecayPipe = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamLeftDecayPipe", this);
308  fSurvPosDownstreamRightDecayPipe = new G4UIcmdWith3Vector("/LBNE/Surveyor/PosDownstreamRightDecayPipe", this);
309 
310  fSurvPosUpstreamLeftPinTargetCanister->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
311  fSurvPosUpstreamRightPinTargetCanister->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
312  fSurvPosDownstreamLeftPinTargetCanister->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
313  fSurvPosDownstreamRightPinTargetCanister->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
314  fSurvPosUpstreamLeftPinTargetHeTube->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
315  fSurvPosUpstreamRightPinTargetHeTube->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
316  fSurvPosDownstreamLeftPinTargetHeTube->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
317  fSurvPosDownstreamRightPinTargetHeTube->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
318  fSurvPosUpstreamLeftBallHorn1->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
319  fSurvPosUpstreamRightBallHorn1->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
320  fSurvPosDownstreamLeftBallHorn1->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
321  fSurvPosDownstreamRightBallHorn1->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
322  fSurvPosUpstreamLeftBallHorn2->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
323  fSurvPosUpstreamRightBallHorn2->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
324  fSurvPosDownstreamLeftBallHorn2->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
325  fSurvPosDownstreamRightBallHorn2->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
326  fSurvPosUpstreamLeftBallHorn3->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
327  fSurvPosUpstreamRightBallHorn3->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
328  fSurvPosDownstreamLeftBallHorn3->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
329  fSurvPosDownstreamRightBallHorn3->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
330  fSurvPosUpstreamLeftDecayPipe->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
331  fSurvPosUpstreamRightDecayPipe->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
332  fSurvPosDownstreamLeftDecayPipe->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
333  fSurvPosDownstreamRightDecayPipe->SetDefaultValue(G4ThreeVector(1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm, 1.0e-6*CLHEP::mm));
334 
335  fSurvPosUpstreamLeftPinTargetCanister->AvailableForStates(G4State_PreInit);
336  fSurvPosUpstreamRightPinTargetCanister->AvailableForStates(G4State_PreInit);
337  fSurvPosDownstreamLeftPinTargetCanister->AvailableForStates(G4State_PreInit);
338  fSurvPosDownstreamRightPinTargetCanister->AvailableForStates(G4State_PreInit);
339  fSurvPosUpstreamLeftPinTargetHeTube->AvailableForStates(G4State_PreInit);
340  fSurvPosUpstreamRightPinTargetHeTube->AvailableForStates(G4State_PreInit);
341  fSurvPosDownstreamLeftPinTargetHeTube->AvailableForStates(G4State_PreInit);
342  fSurvPosDownstreamRightPinTargetHeTube->AvailableForStates(G4State_PreInit);
343  fSurvPosUpstreamLeftBallHorn1->AvailableForStates(G4State_PreInit);
344  fSurvPosUpstreamRightBallHorn1->AvailableForStates(G4State_PreInit);
345  fSurvPosDownstreamLeftBallHorn1->AvailableForStates(G4State_PreInit);
346  fSurvPosDownstreamRightBallHorn1->AvailableForStates(G4State_PreInit);
347  fSurvPosUpstreamLeftBallHorn2->AvailableForStates(G4State_PreInit);
348  fSurvPosUpstreamRightBallHorn2->AvailableForStates(G4State_PreInit);
349  fSurvPosDownstreamLeftBallHorn2->AvailableForStates(G4State_PreInit);
350  fSurvPosDownstreamRightBallHorn2->AvailableForStates(G4State_PreInit);
351  fSurvPosUpstreamLeftBallHorn3->AvailableForStates(G4State_PreInit);
352  fSurvPosUpstreamRightBallHorn3->AvailableForStates(G4State_PreInit);
353  fSurvPosDownstreamLeftBallHorn3->AvailableForStates(G4State_PreInit);
354  fSurvPosDownstreamRightBallHorn3->AvailableForStates(G4State_PreInit);
355  fSurvPosUpstreamLeftDecayPipe->AvailableForStates(G4State_PreInit);
356  fSurvPosUpstreamRightDecayPipe->AvailableForStates(G4State_PreInit);
357  fSurvPosDownstreamLeftDecayPipe->AvailableForStates(G4State_PreInit);
358  fSurvPosDownstreamRightDecayPipe->AvailableForStates(G4State_PreInit);
359 
360  amDefined=true;
361 
362 }
363 void LBNEAllSurveyorMessenger::SetNewValue(G4UIcommand* cmd,G4String newValues) {
364 
367  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
368  theSurv->setPointPosition(G4String("UpstreamLeftPinTargetCanister"),
369  cmdT->GetNew3VectorValue(newValues.c_str()));
370  return;
371  }
373  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
374  theSurv->setPointPosition(G4String("UpstreamRightPinTargetCanister"),
375  cmdT->GetNew3VectorValue(newValues.c_str()));
376  return;
377  }
379  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
380  theSurv->setPointPosition(G4String("DownstreamLeftPinTargetCanister"),
381  cmdT->GetNew3VectorValue(newValues.c_str()));
382  return;
383  }
385  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
386  theSurv->setPointPosition(G4String("DownstreamRightPinTargetCanister"),
387  cmdT->GetNew3VectorValue(newValues.c_str()));
388  return;
389  }
390  //
392  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
393  theSurv->setPointPosition(G4String("UpstreamLeftPinTargetHeTube"),
394  cmdT->GetNew3VectorValue(newValues.c_str()));
395  return;
396  }
398  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
399  theSurv->setPointPosition(G4String("UpstreamRightPinTargetHeTube"),
400  cmdT->GetNew3VectorValue(newValues.c_str()));
401  return;
402  }
404  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
405  theSurv->setPointPosition(G4String("DownstreamLeftPinTargetHeTube"),
406  cmdT->GetNew3VectorValue(newValues.c_str()));
407  return;
408  }
410  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
411  theSurv->setPointPosition(G4String("DownstreamRightPinTargetHeTube"),
412  cmdT->GetNew3VectorValue(newValues.c_str()));
413  return;
414  }
415  //
416 
417  if (cmd == fSurvPosUpstreamLeftBallHorn1) {
418  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
419  theSurv->setPointPosition(G4String("UpstreamLeftBallHorn1"),
420  cmdT->GetNew3VectorValue(newValues.c_str()));
421  return;
422  }
423  if (cmd == fSurvPosUpstreamRightBallHorn1) {
424  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
425  theSurv->setPointPosition(G4String("UpstreamRightBallHorn1"),
426  cmdT->GetNew3VectorValue(newValues.c_str()));
427  return;
428  }
429  if (cmd == fSurvPosDownstreamLeftBallHorn1) {
430  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
431  theSurv->setPointPosition(G4String("DownstreamLeftBallHorn1"),
432  cmdT->GetNew3VectorValue(newValues.c_str()));
433  return;
434  }
436  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
437  theSurv->setPointPosition(G4String("DownstreamRightBallHorn1"),
438  cmdT->GetNew3VectorValue(newValues.c_str()));
439  return;
440  }
441  //
442 
443  if (cmd == fSurvPosUpstreamLeftBallHorn2) {
444  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
445  theSurv->setPointPosition(G4String("UpstreamLeftBallHorn2"),
446  cmdT->GetNew3VectorValue(newValues.c_str()));
447  return;
448  }
449  if (cmd == fSurvPosUpstreamRightBallHorn2) {
450  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
451  theSurv->setPointPosition(G4String("UpstreamRightBallHorn2"),
452  cmdT->GetNew3VectorValue(newValues.c_str()));
453  return;
454  }
455  if (cmd == fSurvPosDownstreamLeftBallHorn2) {
456  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
457  theSurv->setPointPosition(G4String("DownstreamLeftBallHorn2"),
458  cmdT->GetNew3VectorValue(newValues.c_str()));
459  return;
460  }
462  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
463  theSurv->setPointPosition(G4String("DownstreamRightBallHorn2"),
464  cmdT->GetNew3VectorValue(newValues.c_str()));
465  return;
466  }
467  //
468 // ??? Same for Horn3...
469 //
470  if (cmd == fSurvPosUpstreamLeftBallHorn3) {
471  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
472  theSurv->setPointPosition(G4String("UpstreamLeftBallHorn3"),
473  cmdT->GetNew3VectorValue(newValues.c_str()));
474  return;
475  }
476  if (cmd == fSurvPosUpstreamRightBallHorn3) {
477  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
478  theSurv->setPointPosition(G4String("UpstreamRightBallHorn3"),
479  cmdT->GetNew3VectorValue(newValues.c_str()));
480  return;
481  }
482  if (cmd == fSurvPosDownstreamLeftBallHorn3) {
483  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
484  theSurv->setPointPosition(G4String("DownstreamLeftBallHorn3"),
485  cmdT->GetNew3VectorValue(newValues.c_str()));
486  return;
487  }
489  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
490  theSurv->setPointPosition(G4String("DownstreamRightBallHorn3"),
491  cmdT->GetNew3VectorValue(newValues.c_str()));
492  return;
493  }
494  if (cmd == fSurvPosUpstreamLeftDecayPipe) {
495  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
496  theSurv->setPointPosition(G4String("UpstreamLeftDecayPipe"),
497  cmdT->GetNew3VectorValue(newValues.c_str()));
498  return;
499  }
500  if (cmd == fSurvPosUpstreamRightDecayPipe) {
501  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
502  theSurv->setPointPosition(G4String("UpstreamRightDecayPipe"),
503  cmdT->GetNew3VectorValue(newValues.c_str()));
504  return;
505  }
506  if (cmd == fSurvPosDownstreamLeftDecayPipe) {
507  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
508  theSurv->setPointPosition(G4String("DownstreamLeftDecayPipe"),
509  cmdT->GetNew3VectorValue(newValues.c_str()));
510  return;
511  }
513  G4UIcmdWith3Vector *cmdT = dynamic_cast<G4UIcmdWith3Vector*>(cmd);
514  theSurv->setPointPosition(G4String("DownstreamRightDecayPipe"),
515  cmdT->GetNew3VectorValue(newValues.c_str()));
516  return;
517  }
518  //
519 
520 
521 }
G4UIcmdWith3Vector * fSurvPosUpstreamRightPinTargetHeTube
G4UIcmdWith3Vector * fToleranceCmd
Definition: LBNESurveyor.hh:69
G4UIcmdWith3Vector * fSurvPosDownstreamLeftPinTargetHeTube
G4UIcmdWith3Vector * fSurvPosUpstreamRightDecayPipe
G4UIcmdWith3Vector * fSurvPosDownstreamLeftPinTargetCanister
G4UIcmdWith3Vector * fSurvPosUpstreamLeftBallHorn1
std::string string
Definition: nybbler.cc:12
double const tolerance
void SetNewValue(G4UIcommand *cmd, G4String val)
Definition: LBNESurveyor.cc:99
G4UIcmdWith3Vector * fSurvPosDownstreamRightBallHorn3
G4UIcmdWith3Vector * fSurvPosUpstreamLeftBallHorn3
void SetNewValue(G4UIcommand *, G4String)
STL namespace.
void SetThings()
void SetPosition(const G4ThreeVector &pos)
Definition: LBNESurveyor.hh:92
G4UIcmdWith3Vector * fSurvPosUpstreamRightBallHorn1
std::string fName
Definition: LBNESurveyor.hh:81
G4ThreeVector fPosition
Definition: LBNESurveyor.hh:86
G4UIcmdWith3Vector * fSurvPosDownstreamRightBallHorn1
G4UIcmdWith3Vector * fSurvPosDownstreamLeftDecayPipe
G4UIcmdWith3Vector * fSurvPosUpstreamRightPinTargetCanister
const std::string & GetName() const
Definition: LBNESurveyor.hh:90
G4UIcmdWith3Vector * fSurvPosUpstreamLeftDecayPipe
static LBNESurveyor * Instance()
G4UIcmdWith3Vector * fSurvPosUpstreamLeftPinTargetHeTube
G4UIcmdWith3Vector * fSurvPosDownstreamRightPinTargetCanister
LBNESurveyedPt * fPoint
Definition: LBNESurveyor.hh:67
G4UIcmdWith3Vector * fSurvPosDownstreamLeftBallHorn1
G4UIcmdWith3Vector * fSurvPosDownstreamLeftBallHorn3
G4ThreeVector fTolerance
Definition: LBNESurveyor.hh:83
G4UIcmdWith3Vector * fSurvPosUpstreamRightBallHorn3
bool fPositionSetByTolerance
Definition: LBNESurveyor.hh:82
G4UIcmdWith3Vector * fPositionCmd
Definition: LBNESurveyor.hh:70
G4UIcmdWith3Vector * fSurvPosUpstreamRightBallHorn2
void defineMessenger()
G4UIcmdWith3Vector * fSurvPosUpstreamLeftBallHorn2
void setPointPosition(const std::string &aName, const G4ThreeVector &position)
G4UIdirectory * fSurvDir
G4UIcmdWith3Vector * fSurvPosDownstreamRightBallHorn2
list cmd
Definition: getreco.py:22
LBNESurveyorMessenger & operator=(LBNESurveyorMessenger const &other)
Definition: LBNESurveyor.cc:70
static LBNESurveyor * fInstance
G4UIcmdWith3Vector * fSurvPosDownstreamRightPinTargetHeTube
void SetTolerance(const G4ThreeVector &tolerance)
Definition: LBNESurveyor.hh:91
void SetPositionByTolerance(bool t)
G4UIcmdWith3Vector * fSurvPosUpstreamLeftPinTargetCanister
G4UIcmdWithABool * fSetPositionFromToleranceCmd
Definition: LBNESurveyor.hh:68
G4UIcmdWith3Vector * fSurvPosDownstreamRightDecayPipe
QTextStream & endl(QTextStream &s)
G4UIcmdWith3Vector * fSurvPosDownstreamLeftBallHorn2