ATLAS Offline Software
ForwardRegionFieldSvc.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <fstream>
8 
9 #include "CLHEP/Geometry/Transform3D.h"
10 
11 #include "GaudiKernel/IIncidentSvc.h"
12 
14 
15 //comments kept as a reference
16 // static ForwardRegionMgField q1("Q1",ForwardRegionField::Q1);
17 // static ForwardRegionMgField q2("Q2",ForwardRegionField::Q2);
18 // static ForwardRegionMgField q3("Q3",ForwardRegionField::Q3);
19 // static ForwardRegionMgField d1("D1",ForwardRegionField::D1);
20 // static ForwardRegionMgField d2("D2",ForwardRegionField::D2);
21 // static ForwardRegionMgField q4("Q4",ForwardRegionField::Q4);
22 // static ForwardRegionMgField q5("Q5",ForwardRegionField::Q5);
23 // static ForwardRegionMgField q6("Q6",ForwardRegionField::Q6);
24 // static ForwardRegionMgField q7("Q7",ForwardRegionField::Q7);
25 // static ForwardRegionMgField q1hkick("Q1HKick",ForwardRegionField::Q1HKick);
26 // static ForwardRegionMgField q1vkick("Q1VKick",ForwardRegionField::Q1VKick);
27 // static ForwardRegionMgField q2hkick("Q2HKick",ForwardRegionField::Q2HKick);
28 // static ForwardRegionMgField q2vkick("Q2VKick",ForwardRegionField::Q2VKick);
29 // static ForwardRegionMgField q3hkick("Q3HKick",ForwardRegionField::Q3HKick);
30 // static ForwardRegionMgField q3vkick("Q3VKick",ForwardRegionField::Q3VKick);
31 // static ForwardRegionMgField q4vkickA("Q4VKickA",ForwardRegionField::Q4VKickA);
32 // static ForwardRegionMgField q4hkick("Q4HKick",ForwardRegionField::Q4HKick);
33 // static ForwardRegionMgField q4vkickB("Q4VKickB",ForwardRegionField::Q4VKickB);
34 // static ForwardRegionMgField q5hkick("Q5HKick",ForwardRegionField::Q5HKick);
35 // static ForwardRegionMgField q6vkick("Q6VKick",ForwardRegionField::Q6VKick);
36 
38  base_class(name,svc),
39  m_magnet(-1),
40  m_magDataType(0),
41  m_MQXA_DataFile(""), //"MQXA_NOMINAL.dat" if name = Q1 or Q3
42  m_MQXB_DataFile(""), //"MQXB_NOMINAL.dat" if name = Q2
43  m_properties("ForwardRegionProperties")
44 {
45 
46  declareProperty("Magnet", m_magnet, "integer property");
47  declareProperty("MQXA_DataFile", m_MQXA_DataFile, "");
48  declareProperty("MQXB_DataFile", m_MQXB_DataFile, "");
49  declareProperty("ForwardRegionProperties", m_properties);
50  m_Config.clear();
51 
52  if(!m_MQXA_DataFile.empty())
53  {
54  const int fileMQXACols(7); //TODO make this a property
55 
56  // load field map MQXA
57  std::vector<std::vector<std::string> > loadedDataFile = loadDataFile(m_MQXA_DataFile.c_str(),fileMQXACols);
58 
59  ATH_MSG_DEBUG("Field map MQXA loaded");
60 
61  // initialize magnetic induction mesh
62  for(int j=0; j < s_colsMQXA; j++)
63  {
64  for(int i=0; i < s_rowsMQXA; i++)
65  {
66  m_magIndMQXA[i][j][0] = atof(loadedDataFile[i+j*s_colsMQXA][4].c_str());
67  m_magIndMQXA[i][j][1] = atof(loadedDataFile[i+j*s_colsMQXA][5].c_str());
68  }
69  }
70  }
71 
72  if(!m_MQXB_DataFile.empty())
73  {
74  const int fileMQXBCols(7); //TODO make this a property
75 
76  // load field map MQXB
77  std::vector<std::vector<std::string> > loadedDataFileB = loadDataFile(m_MQXB_DataFile.c_str(),fileMQXBCols);
78 
79  ATH_MSG_DEBUG("Field map MQXB loaded");
80 
81  // initialize magnetic induction mesh
82  for(int j=0; j < s_colsMQXB; j++)
83  {
84  for(int i=0; i < s_rowsMQXB; i++)
85  {
86  m_magIndMQXB[i][j][0] = atof(loadedDataFileB[i+j*s_colsMQXB][4].c_str());
87  m_magIndMQXB[i][j][1] = atof(loadedDataFileB[i+j*s_colsMQXB][5].c_str());
88  }
89  }
90  }
91 
92 
93 }
94 
96 {
97  ATH_CHECK(m_properties.retrieve());
98 
99  ATH_MSG_INFO("Postponing magnet strengths initialization of " << this->name() << " till the begin of run");
100  ServiceHandle<IIncidentSvc> incidentSvc("IncidentSvc", this->name());
101  ATH_CHECK(incidentSvc.retrieve());
102  incidentSvc->addListener( this, IncidentType::BeginRun );
103  ATH_MSG_INFO("Added listener to BeginRun incident");
104  return StatusCode::SUCCESS;
105 }
106 
107 // Handle incident function - if BeginRun happens, initialize mag. fields
108 void MagField::ForwardRegionFieldSvc::handle(const Incident& runIncident)
109 {
110  ATH_MSG_INFO("handling incidents ..."); //FIXME drop to DEBUG level
111  if (runIncident.type() == IncidentType::BeginRun)
112  {
113  InitMagData();
114  }
115  ATH_MSG_INFO("BeginRun incident handled");
116 }
117 
118 
123 void MagField::ForwardRegionFieldSvc::getField(const double *xyz, double *bxyz, double*) const
124 {
125  G4ThreeVector f = this->FieldValue(G4ThreeVector(xyz[0],xyz[1],xyz[2]));
126  bxyz[0] = f[0];
127  bxyz[1] = f[1];
128  bxyz[2] = f[2];
129 }
130 
135 void MagField::ForwardRegionFieldSvc::getFieldZR(const double*, double*, double*) const
136 {
137  throw std::logic_error("MagField::ForwardRegionFieldSvc::getFieldZR should not be called"); //FIXME not supported yet.
138 }
139 
140 G4ThreeVector MagField::ForwardRegionFieldSvc::FieldValue(G4ThreeVector Point) const
141 {
142  int beam;
143  if(Point[2] < 0) beam = 1;
144  else beam = 2;
145 
146 
147  HepGeom::Point3D<double> pointMagStart;
148  HepGeom::Point3D<double> pointMagEnd;
149  double rotZ = 0;
150 
151  getMagnetTransformParams(beam, m_magnet, Point, pointMagStart, pointMagEnd, rotZ);
152 
153  G4ThreeVector field;
154 
155  // are points defined (non-zero)? If not, only rotation around Z will be applied (if any)
156  bool pointsNotDefined = (pointMagStart.distance2() == 0 || pointMagEnd.distance2() == 0);
157 
158  // calculate x and y shifts -- for quadrupoles only, no effect in dipoles (magnet borders to be solved in GeoModel)
159  double xShift = pointsNotDefined ? getMagXOff(m_magnet) : (pointMagStart[0]+pointMagEnd[0])*0.5;
160  double yShift = pointsNotDefined ? getMagYOff(m_magnet) : (pointMagStart[1]+pointMagEnd[1])*0.5;
161 
162  if(m_magnet <= s_Q3){ // inner triplet
163  if(m_Config.bUseFLUKAMapsForInnerTriplet)
164  field = getMagInd(Point,m_magnet, beam);
165  else {
166  double gradB = getMag(m_magnet,beam)*CLHEP::tesla/CLHEP::m*pow(-1.0,beam);
167  field = G4ThreeVector(gradB*(Point[1]-yShift),gradB*(Point[0]-xShift),0);
168  }
169  }
170  else if(m_magnet <= s_D2) // dipoles
171  field = G4ThreeVector(0,getMag(m_magnet,beam)*CLHEP::tesla,0);
172  else if(m_magnet <= s_Q7) // other quadrupoles
173  {
174  double gradB = getMag(m_magnet,beam)*CLHEP::tesla/CLHEP::m*pow(-1.0,beam);
175  field = G4ThreeVector(gradB*(Point[1]-yShift),gradB*(Point[0]-xShift),0);
176  }
177  else // kickers
178  return getKick(beam);
179 
180  // No points defined, check if there is rotation around magnet axis, else return unchanged field
181  if(pointsNotDefined){
182  if(rotZ == 0) return field;
183  return HepGeom::RotateZ3D(rotZ)*(HepGeom::Vector3D<double>)field;
184  }
185 
186  // Determine rotation from start and end points, shift is already taken care of
187  HepGeom::Point3D<double> pointMagEndNoShift(pointMagEnd[0]-xShift, pointMagEnd[1]-yShift, pointMagEnd[2]);
188 
189  HepGeom::Point3D<double> pointMagRotCenter(0,0,(pointMagStart[2]+pointMagEnd[2])/2);
190 
191  HepGeom::Vector3D<double> vecNoRot(0,0,pointMagEnd[2]-pointMagRotCenter[2]);
192  HepGeom::Vector3D<double> vecRot = pointMagEndNoShift - pointMagRotCenter;
193 
194  HepGeom::Vector3D<double> vecRotAxis = vecNoRot.cross(vecRot);
195  double angle = vecNoRot.angle(vecRot);
196 
197  HepGeom::Transform3D rotateField = HepGeom::Rotate3D(angle, vecRotAxis);
198 
199  field = rotateField*HepGeom::RotateZ3D(rotZ)*(HepGeom::Vector3D<double>)field;
200  return field;
201 }
202 
203 
204 
205 
206 
207 
208 
209 
210 
211 
212 // The main initialization - initialization of fields based on twiss files or magnets.dat
214 {
215  ATH_MSG_INFO("Initializing magnetic field");
216 
217  m_Config = *(m_properties->getConf());
218 
219  if(m_Config.twissFileB1 == "" || m_Config.twissFileB2 == "" || m_Config.momentum == 0){
220  m_magDataType = 0;
221 
222  ATH_MSG_INFO("Using magnets.dat as the field settings source");
223 
224  const std::string fileMagnets("magnets.dat");
225  m_magnets = loadDataFile(fileMagnets.c_str(),5);
226  }
227  else
228  {
229  m_magDataType = 1;
230 
231  ATH_MSG_INFO("Using twiss files (" << m_Config.twissFileB1 << ", " << m_Config.twissFileB2 << ") as the field settings source");
232 
233  std::string headerB1;
234  std::string headerB2;
235  // Load twiss files and calculate field values for magnets
236  std::vector<std::vector<std::string> > loadedTwissFileB1 = loadDataFileNLines(m_Config.twissFileB1.c_str(),30,200,headerB1);
237  std::vector<std::vector<std::string> > loadedTwissFileB2 = loadDataFileNLines(m_Config.twissFileB2.c_str(),30,200,headerB2);
238 
239  // Beam 1
240  InitMagDataFromTwiss(loadedTwissFileB1, 1, m_Config.momentum);
241 
242  // Beam 2
243  InitMagDataFromTwiss(loadedTwissFileB2, 2, m_Config.momentum);
244 
245  //writeOutTwiss(loadedTwissFileB1,1,headerB1);
246  //writeOutTwiss(loadedTwissFileB2,2,headerB2);
247  ATH_MSG_INFO("Field initialized.");
248  }
249 }
250 
251 void MagField::ForwardRegionFieldSvc::InitMagDataFromTwiss(const std::vector<std::vector<std::string> >& loadedTwissFile, int beam, double momentum)
252 {
253  int textIndex = 0;
254  int lengthIndex = 4;
255  int hkick = 5;
256  int vkick = 6;
257  int k0LIndex = 7;
258  int k1LIndex = 8;
259 
260  bool dipole = false;
261  bool quadrupole = false;
262  bool kicker = false;
263  double length;
264 
265  // init offsets (Q4--Q7 have dx=-97 mm, others 0), do not apply to kickers
266  if(m_magnet <= s_Q7) {
267  if(m_magnet >= s_Q4)
268  m_magData[2] = -97*CLHEP::mm;
269  else
270  m_magData[2] = 0;
271 
272  m_magData[3] = 0;
273  }
274 
275  for(int i=0; i < 150; i++)
276  {
277  // dipoles
278  dipole = (m_magnet == s_D1 && (loadedTwissFile[i][textIndex] == "\"MBXW.A4R1\"" || loadedTwissFile[i][textIndex] == "\"MBXW.A4L1\""))
279  || (m_magnet == s_D2 && (loadedTwissFile[i][textIndex] == "\"MBRC.4R1.B1\"" || loadedTwissFile[i][textIndex] == "\"MBRC.4L1.B2\""));
280  if(dipole){
281  m_magData[beam-1] = kLToB(atof(loadedTwissFile[i][k0LIndex].c_str()), atof(loadedTwissFile[i][lengthIndex].c_str()), momentum);
282  return;
283  }
284 
285  //quadrupoles
286  quadrupole = (m_magnet == s_Q1 && (loadedTwissFile[i][textIndex] == "\"MQXA.1R1\"" || loadedTwissFile[i][textIndex] == "\"MQXA.1L1\""))
287  || (m_magnet == s_Q2 && (loadedTwissFile[i][textIndex] == "\"MQXB.A2R1\"" || loadedTwissFile[i][textIndex] == "\"MQXB.A2L1\""))
288  || (m_magnet == s_Q3 && (loadedTwissFile[i][textIndex] == "\"MQXA.3R1\"" || loadedTwissFile[i][textIndex] == "\"MQXA.3L1\""))
289  || (m_magnet == s_Q4 && (loadedTwissFile[i][textIndex] == "\"MQY.4R1.B1\"" || loadedTwissFile[i][textIndex] == "\"MQY.4L1.B2\""))
290  || (m_magnet == s_Q5 && (loadedTwissFile[i][textIndex] == "\"MQML.5R1.B1\"" || loadedTwissFile[i][textIndex] == "\"MQML.5L1.B2\""))
291  || (m_magnet == s_Q6 && (loadedTwissFile[i][textIndex] == "\"MQML.6R1.B1\"" || loadedTwissFile[i][textIndex] == "\"MQML.6L1.B2\""))
292  || (m_magnet == s_Q7 && (loadedTwissFile[i][textIndex] == "\"MQM.A7R1.B1\"" || loadedTwissFile[i][textIndex] == "\"MQM.A7L1.B2\""));
293  if(quadrupole){
294  m_magData[beam-1] = kLToB(atof(loadedTwissFile[i][k1LIndex].c_str()), atof(loadedTwissFile[i][lengthIndex].c_str()), momentum);
295  return;
296  }
297 
298  // kickers
299  kicker = (m_magnet == s_Q1HKick && (loadedTwissFile[i][textIndex] == "\"MCBXH.1R1\"" || loadedTwissFile[i][textIndex] == "\"MCBXH.1L1\""))
300  || (m_magnet == s_Q1VKick && (loadedTwissFile[i][textIndex] == "\"MCBXV.1R1\"" || loadedTwissFile[i][textIndex] == "\"MCBXV.1L1\""))
301  || (m_magnet == s_Q2HKick && (loadedTwissFile[i][textIndex] == "\"MCBXH.2R1\"" || loadedTwissFile[i][textIndex] == "\"MCBXH.2L1\""))
302  || (m_magnet == s_Q2VKick && (loadedTwissFile[i][textIndex] == "\"MCBXV.2R1\"" || loadedTwissFile[i][textIndex] == "\"MCBXV.2L1\""))
303  || (m_magnet == s_Q3HKick && (loadedTwissFile[i][textIndex] == "\"MCBXH.3R1\"" || loadedTwissFile[i][textIndex] == "\"MCBXH.3L1\""))
304  || (m_magnet == s_Q3VKick && (loadedTwissFile[i][textIndex] == "\"MCBXV.3R1\"" || loadedTwissFile[i][textIndex] == "\"MCBXV.3L1\""))
305  || (m_magnet == s_Q4VKickA && (loadedTwissFile[i][textIndex] == "\"MCBYV.A4R1.B1\"" || loadedTwissFile[i][textIndex] == "\"MCBYV.A4L1.B2\""))
306  || (m_magnet == s_Q4HKick && (loadedTwissFile[i][textIndex] == "\"MCBYH.4R1.B1\"" || loadedTwissFile[i][textIndex] == "\"MCBYH.4L1.B2\""))
307  || (m_magnet == s_Q4VKickB && (loadedTwissFile[i][textIndex] == "\"MCBYV.B4R1.B1\"" || loadedTwissFile[i][textIndex] == "\"MCBYV.B4L1.B2\""))
308  || (m_magnet == s_Q5HKick && (loadedTwissFile[i][textIndex] == "\"MCBCH.5R1.B1\"" || loadedTwissFile[i][textIndex] == "\"MCBCH.5L1.B2\""))
309  || (m_magnet == s_Q6VKick && (loadedTwissFile[i][textIndex] == "\"MCBCV.6R1.B1\"" || loadedTwissFile[i][textIndex] == "\"MCBCV.6L1.B2\""));
310 
311  if(kicker){
312  // length of s_Q1--s_Q3 kickers in twiss files is zero -> it is set to 0.001 m (also the length of corresponding GeoModel volumes)
313  length = atof(loadedTwissFile[i][lengthIndex].c_str()) ? atof(loadedTwissFile[i][lengthIndex].c_str()) : 0.001;
314  // calculation of the B from deflection angle --- beam going down at the IP
315  m_magData[beam-1] = pow(-1.0, beam+1)*kLToB(atof(loadedTwissFile[i][vkick].c_str()), length, momentum);
316  m_magData[beam+1] = kLToB(atof(loadedTwissFile[i][hkick].c_str()), length, momentum);
317  return;
318  }
319  }
320 }
321 
322 
324 // get magnetic induction vector in certain point inside MQXA (MQXAB = 0) or MQXB (MQXAB = 1) (uses bilinear interpolation), q=0 - s_Q1, q=1 - Q2a, q=2 - Q2b, q=3 - s_Q3
325 G4ThreeVector MagField::ForwardRegionFieldSvc::getMagInd(G4ThreeVector Point, int q, int beam) const
326 {
327  int MQXAB = 0;
328  if(q == 1) MQXAB = 1;
329 
330  //magnet gradient and offsets
331  double gradMQX = getMag(q,beam);
332  double xOffMQX = getMagXOff(q);
333  double yOffMQX = getMagYOff(q);
334 
335  //mapfile parameters
336  double minMQXA = -24*CLHEP::cm;
337  double maxMQXA = 24*CLHEP::cm;
338  double minMQXB = -26*CLHEP::cm;
339  double maxMQXB = 26*CLHEP::cm;
340 
341  double x,y,x1,y1,x2,y2,xstep,ystep;
342  int i1,i2,j1,j2;
343 
344  G4ThreeVector B(0,0,0);
345  if(MQXAB == 0) // field in MQXA
346  {
347  x = Point[0] - xOffMQX;
348  y = Point[1] - yOffMQX;
349 
350  xstep = (maxMQXA - minMQXA)/(s_rowsMQXA-1);
351  ystep = (maxMQXA - minMQXA)/(s_colsMQXA-1);
352 
353 
354  i2 = ceil(x/xstep)+ceil(s_rowsMQXA/2.);
355  j2 = ceil(y/ystep)+ceil(s_colsMQXA/2.);
356  i1 = i2 - 1;
357  j1 = j2 - 1;
358  x2 = (i2-ceil(s_rowsMQXA/2.))*xstep;
359  y2 = (j2-ceil(s_colsMQXA/2.))*ystep;
360  x1 = x2 - xstep;
361  y1 = y2 - ystep;
362 
363  if(x < maxMQXA && x > minMQXA && y < maxMQXA && y > minMQXA) // field in MQXA
364  {
365  B[0] = (m_magIndMQXA[i1][j1][0]*(x2-x)*(y2-y) + m_magIndMQXA[i2][j1][0]*(x-x1)*(y2-y) + m_magIndMQXA[i1][j2][0]*(x2-x)*(y-y1) + m_magIndMQXA[i2][j2][0]*(x-x1)*(y-y1))/xstep/ystep*CLHEP::tesla;
366  B[1] = (m_magIndMQXA[i1][j1][1]*(x2-x)*(y2-y) + m_magIndMQXA[i2][j1][1]*(x-x1)*(y2-y) + m_magIndMQXA[i1][j2][1]*(x2-x)*(y-y1) + m_magIndMQXA[i2][j2][1]*(x-x1)*(y-y1))/xstep/ystep*CLHEP::tesla;
367  B[0] = B[0]*pow(-1.0,beam)*(gradMQX/224.29);
368  B[1] = B[1]*pow(-1.0,beam)*(gradMQX/224.29);
369  }
370  }
371  if(MQXAB == 1) // field in MQXB
372  {
373  x = Point[0] - xOffMQX;
374  y = Point[1] - yOffMQX;
375 
376  xstep = (maxMQXB - minMQXB)/(s_rowsMQXB-1);
377  ystep = (maxMQXB - minMQXB)/(s_colsMQXB-1);
378 
379  i2 = ceil(x/xstep)+ceil(s_rowsMQXB/2);
380  j2 = ceil(y/ystep)+ceil(s_colsMQXB/2);
381  i1 = i2 - 1;
382  j1 = j2 - 1;
383  x2 = (i2-ceil(s_rowsMQXB/2))*xstep;
384  y2 = (j2-ceil(s_colsMQXB/2))*ystep;
385  x1 = x2 - xstep;
386  y1 = y2 - ystep;
387 
388  if(x < maxMQXB && x > minMQXB && y < maxMQXB && y > minMQXB) // field in MQXB
389  {
390  B[0] = (m_magIndMQXB[i1][j1][0]*(x2-x)*(y2-y) + m_magIndMQXB[i2][j1][0]*(x-x1)*(y2-y) + m_magIndMQXB[i1][j2][0]*(x2-x)*(y-y1) + m_magIndMQXB[i2][j2][0]*(x-x1)*(y-y1))/xstep/ystep*CLHEP::tesla;
391  B[1] = (m_magIndMQXB[i1][j1][1]*(x2-x)*(y2-y) + m_magIndMQXB[i2][j1][1]*(x-x1)*(y2-y) + m_magIndMQXB[i1][j2][1]*(x2-x)*(y-y1) + m_magIndMQXB[i2][j2][1]*(x-x1)*(y-y1))/xstep/ystep*CLHEP::tesla;
392  B[0] = B[0]*pow(-1.0,beam)*(gradMQX/216.1787104);
393  B[1] = B[1]*pow(-1.0,beam)*(gradMQX/216.1787104);
394  }
395  }
396  return B;
397 }
398 
399 double MagField::ForwardRegionFieldSvc::getMag(int magnet, int beam) const
400 {
401  if(m_magDataType == 1) return m_magData[beam-1];
402  return atof(m_magnets[magnet][beam].c_str());
403 }
404 
406 {
407  if(m_magDataType == 1) return G4ThreeVector(m_magData[beam-1]*CLHEP::tesla,m_magData[beam+1]*CLHEP::tesla,0);
408  return G4ThreeVector(0,0,0); // magnets.dat does not contain kickers
409 }
410 
412 {
413  if(m_magDataType == 1) return m_magData[2];
414  return atof(m_magnets[magnet][3].c_str())*CLHEP::mm;
415 }
416 
418 {
419  if(m_magDataType == 1) return m_magData[3];
420  return atof(m_magnets[magnet][4].c_str())*CLHEP::mm;
421 }
422 
423 // Load data from file into 2D array of strings. Input is filename, wanted number of columns and max number of lines (in original file) to be loaded (N=0 means all)
424 std::vector<std::vector<std::string> > MagField::ForwardRegionFieldSvc::loadDataFileNLines(const char * fileName, int cols, int N, std::string& header)
425 {
426  std::vector<std::vector<std::string> > loadedData;
427 
428  header = "";
429 
430  MsgStream LogStream(Athena::getMessageSvc(), "MagField::ForwardRegionFieldSvc::loadDataFile()");
431 
432  std::ifstream file (fileName);
433  if(!file){
435  LogStream << MSG::DEBUG << "File " << fileName << " not found in run directory, trying to load it from DATAPATH" << endmsg;
436  file.open(datapath.c_str());
437  }
438 
439  if(!file)
440  LogStream << MSG::FATAL << "Unable to load " << fileName << endmsg;
441 
442  if(file.is_open())
443  {
444  std::vector<std::string> row (cols);
445  char c;
446  char temp[1024];
447 
448  bool unlimited = false;
449  if(N==0) unlimited = true;
450  int i = 0;
451  while(file.get(c) && (i < N || unlimited))
452  {
453  if(c != '@' && c != '#' && c != '*' && c != '$' && c != '%' && c!='\n')
454  {
455  file.unget();
456  for(int i = 0; i<cols; i++) // load desired columns
457  {
458  file >> row[i];
459  }
460  loadedData.push_back(row); //store them
461  file.ignore(1024,'\n'); // discard rest of line
462  }
463  else if(c == '@')
464  {
465  file.unget();
466  file.getline(temp,1024);
467  header.append(temp);
468  header.append("\n");
469  }
470  else if(c == '*')
471  {
472  file.unget();
473  file.getline(temp,1024);
474  header.append(temp);
475  header.append(" PosXStart");
476  header.append(" PosYStart");
477  header.append(" PosZStart");
478  header.append(" PosXEnd ");
479  header.append(" PosYEnd ");
480  header.append(" PosZEnd ");
481  header.append(" RotZ");
482  header.append("\n");
483  }
484  else if(c == '$')
485  {
486  file.unget();
487  file.getline(temp,1024);
488  header.append(temp);
489  header.append(" %le ");
490  header.append(" %le ");
491  header.append(" %le ");
492  header.append(" %le ");
493  header.append(" %le ");
494  header.append(" %le ");
495  header.append(" %le ");
496  header.append("\n");
497  }
498  else
499  file.ignore(1024, '\n'); // discard commented lines
500  i++;
501  }
502  LogStream << MSG::INFO << "File " << fileName << " succesfully loaded." << endmsg;
503  file.close();
504  }
505  return loadedData;
506 }
507 
508 std::vector<std::vector<std::string> > MagField::ForwardRegionFieldSvc::loadDataFile(const char * fileName, int cols)
509 {
510  std::string header;
511  return loadDataFileNLines(fileName, cols, 0, header);
512 }
513 
514 // Calculate magnetic induction value / gradient from K*L values, same relation holds for induction value from deviation angle (hkick, vkick)
515 double MagField::ForwardRegionFieldSvc::kLToB(double kL, double length, double momentum)
516 {
517  return kL*momentum/length/0.299792458;
518 }
519 
520 void MagField::ForwardRegionFieldSvc::writeOutTwiss(const std::vector<std::vector<std::string>>& loadedTwissFile, int beam, const std::string& header)
521 {
522  MsgStream LogStream(Athena::getMessageSvc(), "MagField::ForwardRegionFieldSvc::writeOutTwiss()");
523 
524 
525  std::ostringstream fileName;
526  fileName << "alfaTwiss" << beam << ".txt";
527  std::ofstream file (fileName.str().c_str());
528  int magID;
529  HepGeom::Point3D<double> pointMagStart;
530  HepGeom::Point3D<double> pointMagEnd;
531  double rotZ = 0;
532  double PointZ;
533  G4ThreeVector Point;
534 
535  if(!file)
536  LogStream << MSG::ERROR << "Unable to write to " << fileName.str() << endmsg;
537 
538  if(file.is_open())
539  {
540  file << header;
541  int fileSize = loadedTwissFile.size();
542  int rowSize = 0;
543  for(int i=0; i < fileSize;i++)
544  {
545  rowSize = loadedTwissFile[i].size();
546  for(int j=0; j<rowSize; j++)
547  {
548  if(j < 3) file << std::left;
549  else file << std::right;
550  file << std::setw(20) << loadedTwissFile[i][j];
551  }
552  magID = getMagNumFromName(loadedTwissFile[i][0]);
553  if(magID >= 0){
554  PointZ = atof(loadedTwissFile[i][3].c_str())*CLHEP::m;
555  Point.set(0,0,PointZ);
556  getMagnetTransformParams(beam, magID, Point, pointMagStart, pointMagEnd, rotZ);
557  file << std::setw(20) << pointMagStart[0]/CLHEP::m;
558  file << std::setw(20) << pointMagStart[1]/CLHEP::m;
559  file << std::setw(20) << pointMagStart[2]/CLHEP::m;
560  file << std::setw(20) << pointMagEnd[0]/CLHEP::m;
561  file << std::setw(20) << pointMagEnd[1]/CLHEP::m;
562  file << std::setw(20) << pointMagEnd[2]/CLHEP::m;
563  file << std::setw(20) << rotZ;
564  }
565  else {
566  file << std::setw(20) << 0;
567  file << std::setw(20) << 0;
568  file << std::setw(20) << 0;
569  file << std::setw(20) << 0;
570  file << std::setw(20) << 0;
571  file << std::setw(20) << 0;
572  file << std::setw(20) << 0;
573  }
574 
575  file << std::endl;
576  }
577  }
578  file.close();
579 }
580 
582 {
583  // dipoles
584  if (name == "\"MBXW.A4R1\"" || name == "\"MBXW.A4L1\"") return s_D1;
585  if (name == "\"MBXW.B4R1\"" || name == "\"MBXW.B4L1\"") return s_D1;
586  if (name == "\"MBXW.C4R1\"" || name == "\"MBXW.C4L1\"") return s_D1;
587  if (name == "\"MBXW.D4R1\"" || name == "\"MBXW.D4L1\"") return s_D1;
588  if (name == "\"MBXW.E4R1\"" || name == "\"MBXW.E4L1\"") return s_D1;
589  if (name == "\"MBXW.F4R1\"" || name == "\"MBXW.F4L1\"") return s_D1;
590  if (name == "\"MBRC.4R1.B1\"" || name == "\"MBRC.4L1.B2\"") return s_D2;
591 
592  //quadrupoles
593  if(name == "\"MQXA.1R1\"" || name == "\"MQXA.1L1\"") return s_Q1;
594  if(name == "\"MQXB.A2R1\"" || name == "\"MQXB.A2L1\"") return s_Q2;
595  if(name == "\"MQXB.B2R1\"" || name == "\"MQXB.B2L1\"") return s_Q2;
596  if(name == "\"MQXA.3R1\"" || name == "\"MQXA.3L1\"") return s_Q3;
597  if(name == "\"MQY.4R1.B1\"" || name == "\"MQY.4L1.B2\"") return s_Q4;
598  if(name == "\"MQML.5R1.B1\"" || name == "\"MQML.5L1.B2\"") return s_Q5;
599  if(name == "\"MQML.6R1.B1\"" || name == "\"MQML.6L1.B2\"") return s_Q6;
600  if(name == "\"MQM.A7R1.B1\"" || name == "\"MQM.A7L1.B2\"") return s_Q7;
601  if(name == "\"MQM.B7R1.B1\"" || name == "\"MQM.B7L1.B2\"") return s_Q7;
602 
603  // kickers
604  if(name == "\"MCBXH.1R1\"" || name == "\"MCBXH.1L1\"") return s_Q1HKick;
605  if(name == "\"MCBXV.1R1\"" || name == "\"MCBXV.1L1\"") return s_Q1VKick;
606  if(name == "\"MCBXH.2R1\"" || name == "\"MCBXH.2L1\"") return s_Q2HKick;
607  if(name == "\"MCBXV.2R1\"" || name == "\"MCBXV.2L1\"") return s_Q2VKick;
608  if(name == "\"MCBXH.3R1\"" || name == "\"MCBXH.3L1\"") return s_Q3HKick;
609  if(name == "\"MCBXV.3R1\"" || name == "\"MCBXV.3L1\"") return s_Q3VKick;
610  if(name == "\"MCBYV.A4R1.B1\"" || name == "\"MCBYV.A4L1.B2\"") return s_Q4VKickA;
611  if(name == "\"MCBYH.4R1.B1\"" || name == "\"MCBYH.4L1.B2\"") return s_Q4HKick;
612  if(name == "\"MCBYV.B4R1.B1\"" || name == "\"MCBYV.B4L1.B2\"") return s_Q4VKickB;
613  if(name == "\"MCBCH.5R1.B1\"" || name == "\"MCBCH.5L1.B2\"") return s_Q5HKick;
614  if(name == "\"MCBCV.6R1.B1\"" || name == "\"MCBCV.6L1.B2\"") return s_Q6VKick;
615  return -1;
616 }
617 
618 void MagField::ForwardRegionFieldSvc::getMagnetTransformParams(int beam, int magnet, G4ThreeVector Point, HepGeom::Point3D<double> &pointMagStart,HepGeom::Point3D<double> &pointMagEnd, double &rotZ) const
619 {
620  // find out which magnet we are in and get corresponding displacements
621  switch(magnet){
622  case s_Q1:
623  pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ1Start[(beam-1)*3],m_Config.pointQ1Start[(beam-1)*3+1],m_Config.pointQ1Start[(beam-1)*3+2]);
624  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ1End[(beam-1)*3],m_Config.pointQ1End[(beam-1)*3+1],m_Config.pointQ1End[(beam-1)*3+2]);
625  rotZ = m_Config.fQ1RotZ[beam-1];
626  break;
627  case s_Q2:
628  if(std::abs(Point[2]) < 38*CLHEP::m){
629  pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ2aStart[(beam-1)*3],m_Config.pointQ2aStart[(beam-1)*3+1],m_Config.pointQ2aStart[(beam-1)*3+2]);
630  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ2aEnd[(beam-1)*3],m_Config.pointQ2aEnd[(beam-1)*3+1],m_Config.pointQ2aEnd[(beam-1)*3+2]);
631  rotZ = m_Config.fQ2aRotZ[beam-1];
632  }
633  else
634  {
635  pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ2bStart[(beam-1)*3],m_Config.pointQ2bStart[(beam-1)*3+1],m_Config.pointQ2bStart[(beam-1)*3+2]);
636  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ2bEnd[(beam-1)*3],m_Config.pointQ2bEnd[(beam-1)*3+1],m_Config.pointQ2bEnd[(beam-1)*3+2]);
637  rotZ = m_Config.fQ2bRotZ[beam-1];
638  }
639  break;
640  case s_Q3:
641  pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ3Start[(beam-1)*3],m_Config.pointQ3Start[(beam-1)*3+1],m_Config.pointQ3Start[(beam-1)*3+2]);
642  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ3End[(beam-1)*3],m_Config.pointQ3End[(beam-1)*3+1],m_Config.pointQ3End[(beam-1)*3+2]);
643  rotZ = m_Config.fQ3RotZ[beam-1];
644  break;
645  case s_Q4:
646  pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ4Start[(beam-1)*3],m_Config.pointQ4Start[(beam-1)*3+1],m_Config.pointQ4Start[(beam-1)*3+2]);
647  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ4End[(beam-1)*3],m_Config.pointQ4End[(beam-1)*3+1],m_Config.pointQ4End[(beam-1)*3+2]);
648  rotZ = m_Config.fQ4RotZ[beam-1];
649  break;
650  case s_Q5:
651  pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ5Start[(beam-1)*3],m_Config.pointQ5Start[(beam-1)*3+1],m_Config.pointQ5Start[(beam-1)*3+2]);
652  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ5End[(beam-1)*3],m_Config.pointQ5End[(beam-1)*3+1],m_Config.pointQ5End[(beam-1)*3+2]);
653  rotZ = m_Config.fQ5RotZ[beam-1];
654  break;
655  case s_Q6:
656  pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ6Start[(beam-1)*3],m_Config.pointQ6Start[(beam-1)*3+1],m_Config.pointQ6Start[(beam-1)*3+2]);
657  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ6End[(beam-1)*3],m_Config.pointQ6End[(beam-1)*3+1],m_Config.pointQ6End[(beam-1)*3+2]);
658  rotZ = m_Config.fQ6RotZ[beam-1];
659  break;
660  case s_Q7:
661  if(std::abs(Point[2]) < 263.5*CLHEP::m){
662  pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ7aStart[(beam-1)*3],m_Config.pointQ7aStart[(beam-1)*3+1],m_Config.pointQ7aStart[(beam-1)*3+2]);
663  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ7aEnd[(beam-1)*3],m_Config.pointQ7aEnd[(beam-1)*3+1],m_Config.pointQ7aEnd[(beam-1)*3+2]);
664  rotZ = m_Config.fQ7aRotZ[beam-1];
665  }
666  else
667  {
668  pointMagStart = HepGeom::Point3D<double>(m_Config.pointQ7bStart[(beam-1)*3],m_Config.pointQ7bStart[(beam-1)*3+1],m_Config.pointQ7bStart[(beam-1)*3+2]);
669  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointQ7bEnd[(beam-1)*3],m_Config.pointQ7bEnd[(beam-1)*3+1],m_Config.pointQ7bEnd[(beam-1)*3+2]);
670  rotZ = m_Config.fQ7bRotZ[beam-1];
671  }
672  break;
673  case s_D1:
674  if(std::abs(Point[2]) < 63.5*CLHEP::m){
675  pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1aStart[(beam-1)*3],m_Config.pointD1aStart[(beam-1)*3+1],m_Config.pointD1aStart[(beam-1)*3+2]);
676  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1aEnd[(beam-1)*3],m_Config.pointD1aEnd[(beam-1)*3+1],m_Config.pointD1aEnd[(beam-1)*3+2]);
677  rotZ = m_Config.fD1aRotZ[beam-1];
678  }
679  else if(std::abs(Point[2]) < 67.5*CLHEP::m){
680  pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1bStart[(beam-1)*3],m_Config.pointD1bStart[(beam-1)*3+1],m_Config.pointD1bStart[(beam-1)*3+2]);
681  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1bEnd[(beam-1)*3],m_Config.pointD1bEnd[(beam-1)*3+1],m_Config.pointD1bEnd[(beam-1)*3+2]);
682  rotZ = m_Config.fD1bRotZ[beam-1];
683  }
684 
685  else if(std::abs(Point[2]) < 72*CLHEP::m){
686  pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1cStart[(beam-1)*3],m_Config.pointD1cStart[(beam-1)*3+1],m_Config.pointD1cStart[(beam-1)*3+2]);
687  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1cEnd[(beam-1)*3],m_Config.pointD1cEnd[(beam-1)*3+1],m_Config.pointD1cEnd[(beam-1)*3+2]);
688  rotZ = m_Config.fD1cRotZ[beam-1];
689  }
690 
691  else if(std::abs(Point[2]) < 76*CLHEP::m){
692  pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1dStart[(beam-1)*3],m_Config.pointD1dStart[(beam-1)*3+1],m_Config.pointD1dStart[(beam-1)*3+2]);
693  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1dEnd[(beam-1)*3],m_Config.pointD1dEnd[(beam-1)*3+1],m_Config.pointD1dEnd[(beam-1)*3+2]);
694  rotZ = m_Config.fD1dRotZ[beam-1];
695  }
696 
697  else if(std::abs(Point[2]) < 80.5*CLHEP::m){
698  pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1eStart[(beam-1)*3],m_Config.pointD1eStart[(beam-1)*3+1],m_Config.pointD1eStart[(beam-1)*3+2]);
699  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1eEnd[(beam-1)*3],m_Config.pointD1eEnd[(beam-1)*3+1],m_Config.pointD1eEnd[(beam-1)*3+2]);
700  rotZ = m_Config.fD1eRotZ[beam-1];
701  }
702 
703  else {
704  pointMagStart = HepGeom::Point3D<double>(m_Config.pointD1fStart[(beam-1)*3],m_Config.pointD1fStart[(beam-1)*3+1],m_Config.pointD1fStart[(beam-1)*3+2]);
705  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD1fEnd[(beam-1)*3],m_Config.pointD1fEnd[(beam-1)*3+1],m_Config.pointD1fEnd[(beam-1)*3+2]);
706  rotZ = m_Config.fD1fRotZ[beam-1];
707  }
708  break;
709  case s_D2:
710  pointMagStart = HepGeom::Point3D<double>(m_Config.pointD2Start[(beam-1)*3],m_Config.pointD2Start[(beam-1)*3+1],m_Config.pointD2Start[(beam-1)*3+2]);
711  pointMagEnd = HepGeom::Point3D<double>(m_Config.pointD2End[(beam-1)*3],m_Config.pointD2End[(beam-1)*3+1],m_Config.pointD2End[(beam-1)*3+2]);
712  rotZ = m_Config.fD2RotZ[beam-1];
713  break;
714  }
715 }
query_example.row
row
Definition: query_example.py:24
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
PathResolver::RecursiveSearch
@ RecursiveSearch
Definition: PathResolver.h:28
header
Definition: hcg.cxx:526
MagField::ForwardRegionFieldSvc::handle
void handle(const Incident &runIncident) override final
IIncidentListener interface methods.
Definition: ForwardRegionFieldSvc.cxx:108
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
MagField::ForwardRegionFieldSvc::getMagnetTransformParams
void getMagnetTransformParams(int beam, int magnet, G4ThreeVector Point, HepGeom::Point3D< double > &pointMagStart, HepGeom::Point3D< double > &pointMagEnd, double &rotZ) const
Definition: ForwardRegionFieldSvc.cxx:618
MagField::ForwardRegionFieldSvc::loadDataFile
std::vector< std::vector< std::string > > loadDataFile(const char *fileName, int cols)
Definition: ForwardRegionFieldSvc.cxx:508
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MagField::ForwardRegionFieldSvc::m_magIndMQXA
double m_magIndMQXA[s_rowsMQXA][s_colsMQXA][2]
Definition: ForwardRegionFieldSvc.h:117
MagField::ForwardRegionFieldSvc::s_rowsMQXA
static const int s_rowsMQXA
Definition: ForwardRegionFieldSvc.h:112
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
MagField::ForwardRegionFieldSvc::m_properties
ToolHandle< IForwardRegionProperties > m_properties
Definition: ForwardRegionFieldSvc.h:132
MagField::ForwardRegionFieldSvc::getMag
double getMag(int magnet, int beam) const
Definition: ForwardRegionFieldSvc.cxx:399
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
MagField::ForwardRegionFieldSvc::m_magnet
int m_magnet
Definition: ForwardRegionFieldSvc.h:71
xyz
#define xyz
MagField::ForwardRegionFieldSvc::ForwardRegionFieldSvc
ForwardRegionFieldSvc(const std::string &name, ISvcLocator *svc)
Constructor with parameters.
Definition: ForwardRegionFieldSvc.cxx:37
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
MagField::ForwardRegionFieldSvc::getMagInd
G4ThreeVector getMagInd(G4ThreeVector Point, int q, int beam) const
Non-inherited public methods FIXME - add new interface?
Definition: ForwardRegionFieldSvc.cxx:325
MagField::ForwardRegionFieldSvc::kLToB
double kLToB(double kL, double lenght, double momentum)
Definition: ForwardRegionFieldSvc.cxx:515
MagField::ForwardRegionFieldSvc::m_magIndMQXB
double m_magIndMQXB[s_rowsMQXB][s_colsMQXB][2]
Definition: ForwardRegionFieldSvc.h:118
MagField::ForwardRegionFieldSvc::getFieldZR
virtual void getFieldZR(const double *xyz, double *bxyz, double *deriv=nullptr) const override final
get B field value on the z-r plane at given position
Definition: ForwardRegionFieldSvc.cxx:135
x
#define x
MagField::ForwardRegionFieldSvc::s_colsMQXA
static const int s_colsMQXA
Definition: ForwardRegionFieldSvc.h:113
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
MagField::ForwardRegionFieldSvc::s_colsMQXB
static const int s_colsMQXB
Definition: ForwardRegionFieldSvc.h:115
ForwardRegionFieldSvc.h
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
MagField::ForwardRegionFieldSvc::m_MQXA_DataFile
std::string m_MQXA_DataFile
Definition: ForwardRegionFieldSvc.h:85
beamspotnt.cols
list cols
Definition: bin/beamspotnt.py:1114
MagField::ForwardRegionFieldSvc::getField
virtual void getField(const double *xyz, double *bxyz, double *deriv=nullptr) const override final
IMagFieldSvc interface methods.
Definition: ForwardRegionFieldSvc.cxx:123
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
MagField::ForwardRegionFieldSvc::loadDataFileNLines
std::vector< std::vector< std::string > > loadDataFileNLines(const char *fileName, int cols, int N, std::string &header)
Definition: ForwardRegionFieldSvc.cxx:424
MagField::ForwardRegionFieldSvc::getMagNumFromName
int getMagNumFromName(const std::string &name) const
Definition: ForwardRegionFieldSvc.cxx:581
doubleTestComp.j1
j1
Definition: doubleTestComp.py:21
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
MagField::ForwardRegionFieldSvc::m_MQXB_DataFile
std::string m_MQXB_DataFile
Definition: ForwardRegionFieldSvc.h:86
lumiFormat.i
int i
Definition: lumiFormat.py:85
python.html.AtlRunQueryDQSummary.datapath
datapath
Definition: AtlRunQueryDQSummary.py:1205
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MagField::ForwardRegionFieldSvc::getKick
G4ThreeVector getKick(int beam) const
Definition: ForwardRegionFieldSvc.cxx:405
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MagField::ForwardRegionFieldSvc::m_Config
FWDMg_CONFIGURATION m_Config
Definition: ForwardRegionFieldSvc.h:130
file
TFile * file
Definition: tile_monitor.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
hist_file_dump.f
f
Definition: hist_file_dump.py:135
_FWDMg_CONFIGURATION::clear
void clear()
Definition: IForwardRegionProperties.h:72
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
jobOptions.beam
beam
Definition: jobOptions.SuperChic_ALP2.py:16
CxxUtils::atof
double atof(std::string_view str)
Converts a string into a double / float.
Definition: Control/CxxUtils/Root/StringUtils.cxx:91
PathResolver.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ChargedTracksWeightFilter::Spline::Point
Linear spline representation of a function used to calculate weights.
Definition: ChargedTracksWeightFilter.h:28
python.SystemOfUnits.tesla
int tesla
Definition: SystemOfUnits.py:228
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
MagField::ForwardRegionFieldSvc::InitMagData
void InitMagData()
Definition: ForwardRegionFieldSvc.cxx:213
MagField::ForwardRegionFieldSvc::getMagXOff
double getMagXOff(int magnet) const
Definition: ForwardRegionFieldSvc.cxx:411
y
#define y
MagField::ForwardRegionFieldSvc::getMagYOff
double getMagYOff(int magnet) const
Definition: ForwardRegionFieldSvc.cxx:417
DEBUG
#define DEBUG
Definition: page_access.h:11
extractSporadic.q
list q
Definition: extractSporadic.py:98
MagField::ForwardRegionFieldSvc::writeOutTwiss
void writeOutTwiss(const std::vector< std::vector< std::string >> &loadedTwissFile, int beam, const std::string &header)
Definition: ForwardRegionFieldSvc.cxx:520
makeTOC.header
header
Definition: makeTOC.py:28
MagField::ForwardRegionFieldSvc::InitMagDataFromTwiss
void InitMagDataFromTwiss(const std::vector< std::vector< std::string > > &loadedTwissFile, int beam, double momentum)
Definition: ForwardRegionFieldSvc.cxx:251
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
python.compressB64.c
def c
Definition: compressB64.py:93
MagField::ForwardRegionFieldSvc::initialize
StatusCode initialize() override final
AthService interface methods.
Definition: ForwardRegionFieldSvc.cxx:95
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
MagField::ForwardRegionFieldSvc::s_rowsMQXB
static const int s_rowsMQXB
Definition: ForwardRegionFieldSvc.h:114
doubleTestComp.j2
j2
Definition: doubleTestComp.py:22
MagField::ForwardRegionFieldSvc::FieldValue
G4ThreeVector FieldValue(G4ThreeVector Point) const
Definition: ForwardRegionFieldSvc.cxx:140
ServiceHandle< IIncidentSvc >