ATLAS Offline Software
Classes | Enumerations | Functions
FPTracker Namespace Reference

Classes

class  Beamline
 
class  Collimator
 
class  CollimatorData
 
class  ConfigData
 
class  DipoleBender
 
class  EmptySpaceElement
 
class  FPTrackerConstants
 
class  IBeamElement
 
class  IBender
 
class  IJunkElement
 
class  IParticle
 
class  IQuadFocuser
 
class  LineFormater
 
class  Magnet
 
struct  MagnetData
 
class  NullBender
 
class  Particle
 
class  ParticleTracker
 
class  Plane
 
class  Point
 
class  QuadFocuserHorizontal
 
class  QuadFocuserNull
 
class  QuadFocuserVertical
 
class  QuadrupoleBender
 
class  SelectBySide
 
class  SolenoidElement
 
class  Stringer
 
class  TransversePoint
 
class  ValueSetter
 
class  zPosNextElement
 

Enumerations

enum  Bendplane { hBendplane =0, vBendplane =1 }
 
enum  Side { beam1 = 1, beam2 = 0 }
 

Functions

std::ostream & operator<< (std::ostream &os, const Beamline &bl)
 
TransversePoint beamlineXPosition (double z)
 
std::ostream & operator<< (std::ostream &, const Collimator &)
 
std::ostream & operator<< (std::ostream &, const CollimatorData &)
 
Collimator::Container_t collSet (const CollimatorData &, Side)
 
std::ostream & operator<< (std::ostream &, const ConfigData &)
 
template<class Array1D >
std::string array1DToString (const Array1D &arr)
 
template<class Array2D >
std::string array2DToString (const Array2D &arr)
 
template<class Array3D >
std::string array3DToString (const Array3D &arr)
 
std::ostream & operator<< (std::ostream &, const Side &side)
 
std::shared_ptr< std::ifstream > getAlfaMagnetConfigFiles (const std::string &dir, const Side &side)
 
std::shared_ptr< std::ifstream > getConfigFile (const std::string &dir, const std::string &fn)
 
std::shared_ptr< std::ifstream > getMagnetConfigFiles (const std::string &dir, int IP, int magVer, const Side &side)
 
std::ostream & operator<< (std::ostream &, const IBeamElement &)
 
std::ostream & operator<< (std::ostream &, const IParticle &)
 
void junkCaller (int sideSelector)
 
std::ostream & operator<< (std::ostream &, const Magnet &)
 
std::ostream & operator<< (std::ostream &, const MagnetData &)
 
Magnet::Ptr_t magnetFactory (double x, double y, double center, double strength, double length, int apertype, double A1, double A2, double A3, double A4, double X, double pbeam0, Side side, Magnet::Type type)
 
Magnet::Container_t magnetSet (const ConfigData &, const Side &side, int magversion, std::shared_ptr< std::ifstream > magfile)
 
double magnetStrength (int type, double length, double strength, double Brho)
 
std::ostream & operator<< (std::ostream &, const Plane &)
 
Point operator+ (const Point &lhs, const Point &rhs)
 
Point operator- (const Point &lhs, const Point &rhs)
 
Point operator+ (const Point &lhs, const TransversePoint &rhs)
 
Point operator- (const Point &lhs, const TransversePoint &rhs)
 
Point operator* (double, const Point &lhs)
 
std::ostream & operator<< (std::ostream &, const Point &)
 
template<class Container >
void printCont (const Container &arr, int perline, int nele)
 
bool readConfigData (std::shared_ptr< std::ifstream > confDir, ConfigData &)
 
Beamline setupBeamline (const ConfigData &, const Side &, int magver, std::shared_ptr< std::ifstream >)
 
template<class PtrType >
bool absZGreater (const PtrType rhs, const PtrType lhs)
 
TransversePoint operator+ (const TransversePoint &lhs, const TransversePoint &rhs)
 
TransversePoint operator- (const TransversePoint &lhs, const TransversePoint &rhs)
 
TransversePoint operator* (double, const TransversePoint &lhs)
 
std::ostream & operator<< (std::ostream &, const TransversePoint &)
 
bool isEndMarker (const IBeamElement::ConstPtr_t &p)
 
IBeamElement::Iter_t findBeamLineEnd (IBeamElement::Container_t &container)
 
std::string fixLabel (const std::string &label)
 
std::string determineMagnetConfigFileName (int IP, const Side &side, int magver)
 
std::string typeToString (Magnet::Type type)
 
IQuadFocuser::Ptr_t quadFocuserFactory (Magnet::Type type)
 
IBender::ConstPtr_t benderFactory (Magnet::Type type, double length, double strength, double pbeam0, int side)
 
double findIPCentre (int magver, Side side, int ip)
 

Enumeration Type Documentation

◆ Bendplane

Enumerator
hBendplane 
vBendplane 

Definition at line 11 of file FPTrackerConstants.h.

11 {hBendplane=0, vBendplane=1};

◆ Side

Enumerator
beam1 
beam2 

Definition at line 12 of file FPTrackerConstants.h.

12 {beam1 = 1, beam2 = 0};

Function Documentation

◆ absZGreater()

template<class PtrType >
bool FPTracker::absZGreater ( const PtrType  rhs,
const PtrType  lhs 
)

Definition at line 22 of file FPTracker/FPTracker/STLHelpers.h.

23  {
24  return lhs->zabspos() > rhs->zabspos();
25  }

◆ array1DToString()

template<class Array1D >
std::string FPTracker::array1DToString ( const Array1D &  arr)

Definition at line 32 of file DataDumperHelpers.h.

32  {
33 
34  std::ostringstream dump;
35  LineFormater lf = std::for_each(arr.begin(), arr.end(), LineFormater(10));
36  dump<<lf.toString()+'\n';
37  return dump.str();
38  }

◆ array2DToString()

template<class Array2D >
std::string FPTracker::array2DToString ( const Array2D &  arr)

Definition at line 43 of file DataDumperHelpers.h.

43  {
44 
45  std::ostringstream dump;
46  for(std::size_t is=0; is<arr.size(); ++is){
47  dump << "side "<<is<<'\n';
48 
49  LineFormater lf = std::for_each(arr[is].begin(), arr[is].end(), LineFormater(10));
50  dump<<lf.toString()+'\n';
51  }
52  return dump.str();
53  }

◆ array3DToString()

template<class Array3D >
std::string FPTracker::array3DToString ( const Array3D &  arr)

Definition at line 56 of file DataDumperHelpers.h.

56  {
57 
58  std::ostringstream dump;
59  for(std::size_t is=0; is<arr.size(); ++is){
60  dump << "side "<<is<<'\n';
61  for (std::size_t ig=0; ig<arr[is].size(); ++ig){
62 
63  dump << "geom "<<ig<<'\n';
64  LineFormater lf = std::for_each(arr[is][ig].begin(), arr[is][ig].end(), LineFormater(10));
65  dump<<lf.toString()+'\n';
66 
67  }
68  }
69  return dump.str();
70  }

◆ beamlineXPosition()

TransversePoint FPTracker::beamlineXPosition ( double  z)

Definition at line 11 of file beamlineXPosition.cxx.

12  {
13  if (std::fabs(z)> FPTrackerConstants::zOfBeamSeparation)
14  {
15  TransversePoint tp(-FPTrackerConstants::xdis, FPTrackerConstants::ydis);
16  return tp;
17  }
18  TransversePoint tp( 0., 0. );
19  return tp;
20  }

◆ benderFactory()

IBender::ConstPtr_t FPTracker::benderFactory ( Magnet::Type  type,
double  length,
double  strength,
double  pbeam0,
int  side 
)

Definition at line 39 of file magnetFactory.cxx.

45  {
46  if( type == Magnet::hbDipole )
47  {
48  return IBender::ConstPtr_t(new DipoleBender(hBendplane,
49  length,
50  strength,
51  pbeam0,
52  side)
53  );
54  }
55 
56  if ( type == Magnet::vbDipole )
57  {
58  return IBender::ConstPtr_t(new DipoleBender(vBendplane,
59  length,
60  strength,
61  pbeam0,
62  side)
63  );
64  }
65 
66  if ( type == Magnet::hfQuadrupole )
67  {
68  return IBender::ConstPtr_t( new QuadrupoleBender(quadFocuserFactory(type),
69  length,
70  strength,
71  side)
72  );
73  }
74 
75  if ( type == Magnet::vfQuadrupole )
76  {
77  return IBender::ConstPtr_t( new QuadrupoleBender(quadFocuserFactory(type),
78  length,
79  strength,
80  side)
81  );
82  }
83 
84  throw std::logic_error("unknown magnet type");
85  }

◆ collSet()

Collimator::Container_t FPTracker::collSet ( const CollimatorData cData,
Side  side 
)

Definition at line 13 of file collSet.cxx.

13  {
14 
15  Collimator::Container_t collimators;
16  int ncoll = CollimatorData::ncoll;
17  double zsign = side == beam2 ? -1.:1.;
18  for(int i =0; i<ncoll; ++i){
19 
20  double zpos = zsign*cData.coll_z[side][i];
21  Collimator::Ptr_t col(new Collimator(zpos, cData.coll_xap[side][i], side));
22  // std::cout<<*col<<std::endl;
23  collimators.push_back(col);
24 
25  }
26 
27  std::sort(collimators.begin(), collimators.end(), absZGreater<Collimator::ConstPtr_t>);
28  return collimators;
29  }

◆ determineMagnetConfigFileName()

std::string FPTracker::determineMagnetConfigFileName ( int  IP,
const Side side,
int  magver 
)

Definition at line 15 of file getMagnetConfigFiles.cxx.

16  {
17  // Find twiss magnet configuration files used by P Bussey up until 12/08
18 
19  bool argsOK = (IP == 1 || IP == 5) && (side == beam1 || side == beam2);
20  if (!argsOK)
21  {
22  std::stringstream ss;
23  ss<<"Legal side arg values = beam1 or beam2, is "<<side<<" Legal IP arg values = 1 or 5, is "<<IP<<'\n';
24 
25  throw std::runtime_error(ss.str().c_str());
26  }
27 
28 
29  if(magver == 1)
30  {
31  if (side == beam2){return "twiss_65_b2_old.txt";}
32  return "twiss_65_b1_old.txt";
33  }
34  else
35  if ( IP==1 )
36  {
37  if( side==beam2 ) { return "LHCB2IR1_6500";}
38  return "LHCB1IR1_6500";
39  }
40  else
41  {
42  if( side==beam2 ) { return "LHCB2IR5_6500";}
43  return "LHCB1IR5_6500";
44  }
45 
46  }

◆ findBeamLineEnd()

IBeamElement::Iter_t FPTracker::findBeamLineEnd ( IBeamElement::Container_t container)

Definition at line 22 of file FPTracker/src/Beamline.cxx.

22  {
23  IBeamElement::Iter_t ei = find_if(container.begin(),
24  container.end(),
26  );
27 
28  if (ei != container.end()) ++ei;
29  else {
30  std::string s("Could not find the end of the beamline.");
31  throw std::runtime_error(s);
32  }
33  return ei;
34  }

◆ findIPCentre()

double FPTracker::findIPCentre ( int  magver,
Side  side,
int  ip 
)

Definition at line 23 of file magnetSet.cxx.

24  {
25  if ( magver == 1 )
26  {
27  if ( (side == beam2) && (ip == 1) ) { return 26658.88320;}
28  if ( (side == beam2) && (ip == 5) ) { return 13329.593967;}
29  if ( (side == beam1) && (ip == 1) ) { return 0.;}
30  if ( (side == beam1) && (ip == 5) ) { return 13329.289233;}
31  assert(false);
32  }
33 
34 
35 
36  if ( magver == 2 )
37  {
38  if ( (side == beam2) && (ip == 1) ) { return 13329.28923;}
39  if ( (side == beam2) && (ip == 5) ) { return 13329.59397;}
40  if ( (side == beam1) && (ip == 1) ) { return 13329.59397;}
41  if ( (side == beam1) && (ip == 5) ) { return 13329.28923;}
42  assert(false);
43  }
44 
45  if ( magver == 3 ) //ALFA, from D Pelikan
46  {
47  if ( (side == beam2) && (ip == 1) ) { return 0.;}
48  if ( (side == beam2) && (ip == 5) ) { return 13329.593967;}
49  if ( (side == beam1) && (ip == 1) ) { return 0.;}
50  if ( (side == beam1) && (ip == 5) ) { return 13329.289233;}
51  assert(false);
52  }
53  // check that the argument values are in have expected values
54  assert(false);
55 
56  return 0;
57  }

◆ fixLabel()

std::string FPTracker::fixLabel ( const std::string &  label)

Definition at line 139 of file FPTracker/src/Beamline.cxx.

139  {
140  std::string s = label;
141  std::size_t tsize = 30 - label.size();
142  if (tsize>0){ s += std::string(tsize, ' ');}
143  return s;
144  }

◆ getAlfaMagnetConfigFiles()

std::shared_ptr< std::ifstream > FPTracker::getAlfaMagnetConfigFiles ( const std::string &  dir,
const Side side 
)

Definition at line 14 of file getAlfaMagnetConfigFiles.cxx.

15  {
16  std::string fn = (side == beam1) ? "alfaTwiss1.txt":"alfaTwiss2.txt";
17  return getConfigFile( dir, fn );
18  }

◆ getConfigFile()

std::shared_ptr< std::ifstream > FPTracker::getConfigFile ( const std::string &  dir,
const std::string &  fn 
)

Definition at line 11 of file getConfigFile.cxx.

12  {
13  std::ifstream infile;
14  std::shared_ptr<std::ifstream> pfile(new std::ifstream);
16  return pfile;
17  }

◆ getMagnetConfigFiles()

std::shared_ptr< std::ifstream > FPTracker::getMagnetConfigFiles ( const std::string &  dir,
int  IP,
int  magVer,
const Side side 
)

Definition at line 51 of file getMagnetConfigFiles.cxx.

52  {
53  return getConfigFile( dir, determineMagnetConfigFileName(IP, side, magVer) );
54  }

◆ isEndMarker()

bool FPTracker::isEndMarker ( const IBeamElement::ConstPtr_t p)

Definition at line 20 of file FPTracker/src/Beamline.cxx.

20 {return p->isEndElement();}

◆ junkCaller()

void FPTracker::junkCaller ( int  sideSelector)

◆ magnetFactory()

Magnet::Ptr_t FPTracker::magnetFactory ( double  x,
double  y,
double  center,
double  strength,
double  length,
int  apertype,
double  A1,
double  A2,
double  A3,
double  A4,
double  X,
double  pbeam0,
Side  side,
Magnet::Type  type 
)

Definition at line 87 of file magnetFactory.cxx.

101  {
102 
103  IBender::ConstPtr_t bender( benderFactory(type, length, strength, pbeam0, side) );
104  std::string label( typeToString(type) );
105 
106  return Magnet::Ptr_t(new Magnet( x,
107  y,
108  center,
109  strength,
110  length,
111  apertype,
112  A1,
113  A2,
114  A3,
115  A4,
116  X,
117  side,
118  bender,
119  label
120  )
121  );
122 
123  }

◆ magnetSet()

Magnet::Container_t FPTracker::magnetSet ( const ConfigData cData,
const Side side,
int  magversion,
std::shared_ptr< std::ifstream >  magfile 
)

Definition at line 60 of file magnetSet.cxx.

61  {
62  // Coordinate system: take z = forwards, x= to left , y = up.
63  // For quadrupoles, input the quantity K1L. type = 1,2 if K1L is +,-ve.
64  // Input type = 3 here to let the program decide.
65  // HKICK and VKICK are read and treated as bending magnets.
66 
67 
68 
69  //-------- Arrange to read the magnet data from CERN files.
70  // twiss_b1.txt and twiss_b2.txt for beam 1 and beam 2
71  // beam 2 is on side=0 here and beam 1 is on side=1
72  // Read through the files to pick up the requested magnets.
73 
74 
75  const int& IP = cData.IP;
76  const double& apermb = cData.apermb;
77  const double& brho = cData.brho;
78  const float& absZMagMax = cData.absZMagMax;
79 
80  Magnet::Container_t magnets;
81 
82  double centreIP = findIPCentre(magver, side, IP);
83 
84  std::ifstream& myMags = *magfile;
85 
86 
87  //std::cout<<"Open magnets file for beam "<<ifile<<std::endl;
88  //--- Skip introductory material, indicated by the 1st character of a record.
89  while (myMags.peek() =='@' || myMags.peek() =='*' || myMags.peek() =='$')
90  {
91  myMags.ignore(1000,'\n');
92  }
93 
94  // side 1 == direction to +ve s of IP == beam 1.
95  // NB "dist" is -Delta(s) but magcen, i.e. z, is then -dist.
96 
97  while(true)
98  {
99 
100  double endpos=0, maglength=0, K0L=0, K1L=0, K2L=0, K3L=0, HKICK=0, VKICK=0;
101  float BETX=0,ALFX=0,MUX=0,DX=0,DPX=0,X=0,PX=0,BETY=0,ALFY=0,MUY=0,DY=0,DPY=0,Y=0,PY=0,A1=0,A2=0,A3=0,A4=0;
102 
103  std::string magname,magsort, basicmag ;
104 
105  std::string aperture;
106 
107  if( magver==1 )
108  {
109  myMags>>magname>>magsort>>endpos>>maglength>>K0L>>K1L>>K2L>>K3L>>HKICK>>VKICK
110  >>BETX>>ALFX>>MUX>>DX>>DPX>>X>>PX>>BETY>>ALFY>>MUY>>DY>>DPY>>Y>>PY
111  >>aperture>>A1>>A2>>A3>>A4;
112  }
113  else if( magver==2 or magver==3 )
114  {
115  myMags>>magname>>magsort>>basicmag>>endpos>>maglength>>HKICK>>VKICK>>K0L
116  >>K1L>>K2L>>K3L>>X>>Y>>PX>>PY>>BETX>>BETY>>ALFX>>ALFY
117  >>MUX>>MUY>>DX>>DY>>DPX>>DPY>>aperture>>A1>>A2>>A3>>A4;
118  }
119  else
120  {
121  assert(false);
122  }
123 
124  if(magver==1)
125  { // Some more fudges to give more precision
126  if(std::fabs(K0L)==0.000188) K0L=K0L*188.175/188.0 ;
127  if(std::fabs(K0L)==0.001129) K0L=K0L*1129.049/1129. ;
128  if(std::fabs(K1L)==0.055577) K0L=K0L*55576.561/55577. ;
129  if(std::fabs(K1L)==0.047986) K0L=K0L*47986.041/47986. ;
130  if(std::fabs(VKICK)==0.00020) VKICK=VKICK*20.171/20. ;
131  if(std::fabs(VKICK)==0.00019) VKICK=VKICK*19.17/19. ;
132  }
133 
134  double dist = centreIP - endpos + 0.5*maglength ;
135 
136  float adist=std::fabs(dist) ;
137 
138  // decide how to progress down the magnet files
139  // the file formats are not constant. first
140  // consider the magver=1 or 2 (these are two formats used by AFP.
141  if ( magver == 1 or magver == 2 )
142  {
143  if (side == beam1)
144  {
145  if( dist > 0. ) {continue;}
146  if( adist > absZMagMax ) {break;}
147  }
148  else
149  {
150  if( adist > absZMagMax ) {continue;}
151  if ( dist <= 0. ) {break;}
152  }
153  }
154  else if( magver == 3 ) //ALFA. from D. Pelikan
155  {
156  if( dist > 0. ) {continue;}
157  if( adist > absZMagMax ) {break;}
158  }
159 
160  Magnet::Type mmagtype = Magnet::notAMagnet;
161  double magstrength = 0;
162  if (K0L != 0.)
163  {
164  mmagtype = Magnet::hbDipole; //type = 0
165  magstrength = K0L;
166  if(side == beam2)
167  {
168  magstrength = -magstrength;
169  }
170 
171  }
172  else if(K1L != 0.)
173  {
174  magstrength = K1L;
175  mmagtype = magstrength >= 0 ? Magnet::hfQuadrupole:Magnet::vfQuadrupole; // type = 3 ->1,2
176  assert(maglength > 0.);
177  magstrength = std::fabs(brho*magstrength/maglength);
178  }
179  else if(HKICK != 0.)
180  {
181  mmagtype = Magnet::hbDipole; // type = 0
182  magstrength = -HKICK;
183  }
184  else if(VKICK != 0.)
185  {
186  mmagtype = Magnet::vbDipole; // type = 4
187  magstrength = VKICK;
188  }
189 
190  if(mmagtype == Magnet::notAMagnet) {continue;} // --(not a magnet)
191 
192 
193  double mmagcen = -dist;
194 
195 
196  // more differences between AFP and ALFA files (from D. Pelikan)
197  if (magver == 3)
198  {
199  if (side == beam2 ){ mmagcen = dist; }
200 
201  }
202 
203 
204  int mmagapertype = 0;
205  // CLassify apertures.
206  if(aperture == "\"NONE\"")
207  {
208  mmagapertype = 0;
209  }
210  else if(aperture == "\"CIRCLE\"" && A1 == 0.)
211  {
212  mmagapertype =0;
213  }
214  else if(aperture == "\"CIRCLE\"" && A1 > 0.)
215  {
216  mmagapertype =1;
217  }
218  else if(aperture == "\"RECTELLIPSE\"")
219  {
220  mmagapertype =2;
221  }
222  else if(aperture == "\"OCTAGON\"")
223  {
224  mmagapertype =3;
225  }
226  else
227  {
228  std::stringstream sstr;
229  sstr<<" Unknown magnet aperture type "<<aperture<<'\n' ;
230  throw std::runtime_error(sstr.str().c_str());
231  }
232 
233  /*
234  std::cout<<magname<<" "<<endpos<<" "<<maglength<<" "<<K0L<<" "<<K1L<<" "
235  <<" --> "<<mmagcen<<" "<<maglength
236  <<" "<<magstrength
237  <<" A1 "<<A1
238  <<" A2 "<<A2
239  <<" A3 "<<A3
240  <<" A4 "<<A4
241  <<std::endl;
242  */
243 
244 
245  if(apermb > 0)
246  { // -------alter the MB apertures
247  int pos = magname.find("MB.");
248  if(pos==1)
249  {
250  A3=apermb; A4=apermb;
251  }
252  }
253 
254  // note the sign convention for xdis. This shift of the magnet
255  // x location accounts for the splitting of the beams somewhere
256  // around 155. m. The x coordinate is wrt to beamline position,
257  // and not the magnet center.
258  double mmagnet_x = beamlineXPosition(mmagcen)[0];
259  double mmagnet_y = beamlineXPosition(mmagcen)[1];
260 
261  Magnet::Ptr_t mptr = magnetFactory(mmagnet_x,
262  mmagnet_y,
263  mmagcen,
264  magstrength,
265  maglength,
266  mmagapertype,
267  A1,
268  A2,
269  A3,
270  A4,
271  X,
272  cData.pbeam0,
273  side,
274  mmagtype);
275  // std::cout<<*mptr<<std::endl;
276  magnets.push_back(mptr);
277  }
278  std::sort(magnets.begin(), magnets.end(), absZGreater< Magnet::ConstPtr_t >);
279  return magnets;
280  }

◆ magnetStrength()

double FPTracker::magnetStrength ( int  type,
double  length,
double  strength,
double  Brho 
)

Definition at line 8 of file magnetStrength.cxx.

8  {
9  // calculate qpole gradient from formula g = K1L brho /L
10  // K1L from CERN database
11  // brho = 23349. = 3.345*7000 - now pbeam0/speedOflight (12//11/09)
12  // L = mag length
13 
14  assert(type>=0 and type<5);
15 
16  if(type==0 || type==4) return strength;
17  strength = brho*strength/length;
18 
19  if (type == 1){ return strength;}
20  if (type == 2){ return -strength;}
21  //itype == 3 only remains....
22  return strength >=0. ? strength:-strength;
23 
24  // strength = bend angle for dipoles, -> gradient for quadrupoles
25  // type = 0 for dipole,
26  // 1 for hor focussing qpoles,
27  // 2 for vert focussing qpoles.
28  }

◆ operator*() [1/2]

Point FPTracker::operator* ( double  scalar,
const Point lhs 
)

Definition at line 123 of file FPTracker/src/Point.cxx.

123  {
124  Point p = point;
125  return p*=scalar;
126  }

◆ operator*() [2/2]

TransversePoint FPTracker::operator* ( double  scalar,
const TransversePoint lhs 
)

Definition at line 85 of file FPTracker/src/TransversePoint.cxx.

85  {
86  TransversePoint p = point;
87  return p*=scalar;
88  }

◆ operator+() [1/3]

Point FPTracker::operator+ ( const Point lhs,
const Point rhs 
)

Definition at line 98 of file FPTracker/src/Point.cxx.

98  {
99  Point point(lhs);
100  return point += rhs;
101  }

◆ operator+() [2/3]

Point FPTracker::operator+ ( const Point lhs,
const TransversePoint rhs 
)

Definition at line 108 of file FPTracker/src/Point.cxx.

108  {
109  Point point(lhs);
110  return point += rhs;
111  }

◆ operator+() [3/3]

TransversePoint FPTracker::operator+ ( const TransversePoint lhs,
const TransversePoint rhs 
)

Definition at line 71 of file FPTracker/src/TransversePoint.cxx.

71  {
72  TransversePoint point(lhs);
73  return point += rhs;
74  }

◆ operator-() [1/3]

Point FPTracker::operator- ( const Point lhs,
const Point rhs 
)

Definition at line 103 of file FPTracker/src/Point.cxx.

103  {
104  Point point(lhs);
105  return point -= rhs;
106  }

◆ operator-() [2/3]

Point FPTracker::operator- ( const Point lhs,
const TransversePoint rhs 
)

Definition at line 113 of file FPTracker/src/Point.cxx.

113  {
114  Point point(lhs);
115  return point -= rhs;
116  }

◆ operator-() [3/3]

TransversePoint FPTracker::operator- ( const TransversePoint lhs,
const TransversePoint rhs 
)

Definition at line 76 of file FPTracker/src/TransversePoint.cxx.

76  {
77  TransversePoint point(lhs);
78  return point -= rhs;
79  }

◆ operator<<() [1/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const Collimator coll 
)

Definition at line 88 of file FPTracker/src/Collimator.cxx.

88  {
89  os<<coll.str();
90  return os;
91  }

◆ operator<<() [2/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const CollimatorData cData 
)

Definition at line 38 of file FPTracker/src/CollimatorData.cxx.

38  {
39  os<<cData.toString();
40  return os;
41  }

◆ operator<<() [3/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const ConfigData cd 
)

Definition at line 58 of file FPTracker/src/ConfigData.cxx.

58  {
59  os<<cd.toString();
60  return os;
61  }

◆ operator<<() [4/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const IBeamElement ibe 
)

Definition at line 10 of file FPTracker/src/IBeamElement.cxx.

11  {
12  os<<ibe.str();
13  return os;
14  }

◆ operator<<() [5/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const IParticle p 
)

Definition at line 10 of file ForwardDetectors/FPTracker/src/IParticle.cxx.

11  {
12  os<<p.str();
13  return os;
14  }

◆ operator<<() [6/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const Magnet mag 
)

Definition at line 230 of file FPTracker/src/Magnet.cxx.

230  {
231  os << mag.str();
232  return os;
233  }

◆ operator<<() [7/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const MagnetData md 
)

Definition at line 75 of file MagnetData.cxx.

75  {
76  os<<md.toString();
77  return os;
78  }

◆ operator<<() [8/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const Plane p 
)

Definition at line 66 of file FPTracker/src/Plane.cxx.

66  {
67  os<<p.str();
68  return os;
69  }

◆ operator<<() [9/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const Point p 
)

Definition at line 118 of file FPTracker/src/Point.cxx.

118  {
119  os<<p.str();
120  return os;
121  }

◆ operator<<() [10/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const Side side 
)

Definition at line 16 of file FPTrackerConstants.cxx.

16  {
17  std::string label = side == beam1 ? " beam1 ":" beam2 ";
18  os << label;
19  return os;
20  }

◆ operator<<() [11/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const TransversePoint p 
)

Definition at line 80 of file FPTracker/src/TransversePoint.cxx.

80  {
81  os<<p.str();
82  return os;
83  }

◆ operator<<() [12/12]

std::ostream & FPTracker::operator<< ( std::ostream &  os,
const Beamline bl 
)

Definition at line 163 of file FPTracker/src/Beamline.cxx.

163  {
164  os<<bl.str()<<std::endl;
165  return os;
166  }

◆ printCont()

template<class Container >
void FPTracker::printCont ( const Container arr,
int  perline,
int  nele 
)

Definition at line 10 of file printCont.h.

10  {
11  int linecount = 0;
12  for(int i = 0; i<nele; ++i){
13  std::cout<<" "<<arr[i];
14  if(++linecount == perline){
15  linecount = 0;
16  std::cout<<'\n';
17  }
18  }
19  std::cout<<'\n';
20  }

◆ quadFocuserFactory()

IQuadFocuser::Ptr_t FPTracker::quadFocuserFactory ( Magnet::Type  type)

Definition at line 29 of file magnetFactory.cxx.

30  {
31 
32  if ( type == Magnet::hfQuadrupole ){return IQuadFocuser::Ptr_t(new QuadFocuserHorizontal);}
33  if ( type == Magnet::vfQuadrupole ){return IQuadFocuser::Ptr_t(new QuadFocuserVertical);}
34 
35  throw std::logic_error("bad magnet type for QuadFocuser");
36  }

◆ readConfigData()

bool FPTracker::readConfigData ( std::shared_ptr< std::ifstream >  confDir,
ConfigData configData 
)

Definition at line 59 of file readConfigData.cxx.

59  {
60  // ConfigData readConfigData(std::string& dir){
61  // Read data cards from Data.txt file
62 
63 
64  std::ifstream& in = *p_mydata;
65  std::string line;
66  ValueSetter vs;
67 
68  boost::char_separator<char> sep(" \f\t\v");
69  typedef boost::tokenizer<boost::char_separator<char> > Tokenizer;
70 
71 
72  std::ostringstream ost;
73  while( std::getline(in, line) )
74  {
75  Tokenizer tok(line, sep);
76  std::vector< std::string > tokens(tok.begin(), tok.end());
77 
78  if ( tokens.size() > 1 )
79  {
80  ost<<tokens[0]<<" "<<tokens[1]<<'\n';
81  std::string& dataname = tokens[0];
82  std::string& svalue = tokens[1];
83  if(dataname == "IP" ) vs.setValue(configData.IP, svalue);
84  if(dataname == "APER") vs.setValue(configData.useaper, svalue);
85  if(dataname == "MBAP") vs.setValue(configData.apermb, svalue);
86  if(dataname == "COL1") vs.setValue(configData.xcol1, svalue);
87  if(dataname == "COL2") vs.setValue(configData.xcol2, svalue);
88  if(dataname == "ZMAX") vs.setValue(configData.absZMagMax, svalue);
89  if(dataname == "ENDM") vs.setValue(configData.endMarker, svalue);
90 
91  if(dataname == "PBEA") {
92  float pbeam;
93  if ( vs.setValue(pbeam, svalue) ){configData.setpbeam(pbeam);}
94  }
95 
96 
97  }
98 
99  }
100 
101  return !vs.errors();
102  }

◆ setupBeamline()

Beamline FPTracker::setupBeamline ( const ConfigData configData,
const Side side,
int  magver,
std::shared_ptr< std::ifstream >  magfile 
)

Definition at line 27 of file setupBeamline.cxx.

33  {
34 
35  Magnet::Container_t magnets = magnetSet(configData, side, magver, magfile);
36  Plane::Ptr_t endPlane( new Plane(configData.endMarker, side) );
37  CollimatorData collimatorData(configData);
38  Collimator::Container_t collimators = collSet(collimatorData, side);
39 
40  IBeamElement::List_t elements;
41  //elements.reserve( 2*(magnets.size()+collimators.size()+planes.size()) );
42  elements.assign(magnets.begin(), magnets.end());
43  elements.push_back(endPlane);
44  elements.insert(elements.end(), collimators.begin(), collimators.end());
45  //std::sort(elements.begin(), elements.end(), absZGreater<IBeamElement>);
46  elements.sort(absZGreater< IBeamElement::ConstPtr_t >);
47 
48 
49  IBeamElement::ListIter_t current = elements.begin();
50  IBeamElement::ListIter_t last = elements.end();
51 
52  elements.push_front
53  (
54  EmptySpaceElement::Ptr_t(
55  new EmptySpaceElement(
56  0.,
57  (*current)->frontFace(),
59  (*current)->side()
60  )
61  )
62  );
63  ++current;
64 
65  for(; current != last; ++current){
66  IBeamElement::ListIter_t previous = current;
67  --previous;
68  elements.insert(current,
69  EmptySpaceElement::Ptr_t(
70  new EmptySpaceElement(
71  *previous,
72  *current
73  )
74  )
75  );
76  }
77 
78  Beamline beamline(elements.begin(), elements.end());
79 
80  double pbeam = configData.pbeam0;
81  std::shared_ptr<IParticle> ip = (side == beam1) ?
82  std::shared_ptr<IParticle>(new Particle(0., 0., 0., 0., 0., pbeam) ):
83  std::shared_ptr<IParticle>(new Particle(0., 0., 0., 0., 0., -1.*pbeam) );
84  beamline.calibrate( *ip );
85 
86 
87  return beamline;
88  }

◆ typeToString()

std::string FPTracker::typeToString ( Magnet::Type  type)

Definition at line 20 of file magnetFactory.cxx.

21  {
22  if ( type == Magnet::hbDipole ) { return "hbDipole"; }
23  if ( type == Magnet::vbDipole ) { return "vbDipole"; }
24  if ( type == Magnet::hfQuadrupole ){ return "hfQuad"; }
25  if ( type == Magnet::vfQuadrupole) { return "vfQuad"; }
26  throw std::logic_error("unknown magnet type");
27  }
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
ForwardTracker::vBendplane
@ vBendplane
Definition: ForwardTrackerConstants.h:12
checkFileSG.line
line
Definition: checkFileSG.py:75
ForwardTracker::beam1
@ beam1
Definition: ForwardTrackerConstants.h:13
FPTracker::findIPCentre
double findIPCentre(int magver, Side side, int ip)
Definition: magnetSet.cxx:23
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
python.trigbs_prescaleL1.ost
ost
Definition: trigbs_prescaleL1.py:104
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
run.infile
string infile
Definition: run.py:13
ForwardTracker::beam2
@ beam2
Definition: ForwardTrackerConstants.h:13
LArNewCalib_Delay_OFC_Cali.pfile
string pfile
Definition: LArNewCalib_Delay_OFC_Cali.py:173
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
FPTracker::magnetSet
Magnet::Container_t magnetSet(const ConfigData &, const Side &side, int magversion, std::shared_ptr< std::ifstream > magfile)
Definition: magnetSet.cxx:60
ParticleTest.tp
tp
Definition: ParticleTest.py:25
FPTracker::benderFactory
IBender::ConstPtr_t benderFactory(Magnet::Type type, double length, double strength, double pbeam0, int side)
Definition: magnetFactory.cxx:39
python.TriggerAPI.TriggerAPISession.lf
lf
Definition: TriggerAPISession.py:390
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
FPTracker::collSet
Collimator::Container_t collSet(const CollimatorData &, Side)
Definition: collSet.cxx:13
x
#define x
xAOD::Particle
Particle_v1 Particle
Define the latest version of the particle class.
Definition: Event/xAOD/xAODParticleEvent/xAODParticleEvent/Particle.h:17
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
run_Egamma1_LArStrip_Fex.dump
dump
Definition: run_Egamma1_LArStrip_Fex.py:88
TRT::Hit::side
@ side
Definition: HitInfo.h:83
FPTracker::beam1
@ beam1
Definition: FPTrackerConstants.h:12
ForwardTracker::openFile
void openFile(const std::string &fname, streamptr &strm)
Definition: ForwardTracker/ForwardTracker/STLHelpers.h:17
Type
RootType Type
Definition: TrigTSerializer.h:30
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
FPTracker::hBendplane
@ hBendplane
Definition: FPTrackerConstants.h:11
python.getCurrentFolderTag.fn
fn
Definition: getCurrentFolderTag.py:65
FPTracker::beam2
@ beam2
Definition: FPTrackerConstants.h:12
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
FPTracker::beamlineXPosition
TransversePoint beamlineXPosition(double z)
Definition: beamlineXPosition.cxx:11
CP::DetailSelectionExprParser::Tokenizer
boost::tokenizer< Separator > Tokenizer
Definition: SelectionExprParser.h:34
ForwardTracker::hBendplane
@ hBendplane
Definition: ForwardTrackerConstants.h:12
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
FPTracker::quadFocuserFactory
IQuadFocuser::Ptr_t quadFocuserFactory(Magnet::Type type)
Definition: magnetFactory.cxx:29
FPTracker::isEndMarker
bool isEndMarker(const IBeamElement::ConstPtr_t &p)
Definition: FPTracker/src/Beamline.cxx:20
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
beamspotman.dir
string dir
Definition: beamspotman.py:623
FPTracker::vBendplane
@ vBendplane
Definition: FPTrackerConstants.h:11
Monitored::Y
@ Y
Definition: HistogramFillerUtils.h:24
grepfile.sep
sep
Definition: grepfile.py:38
ChargedTracksWeightFilter::Spline::Point
Linear spline representation of a function used to calculate weights.
Definition: ChargedTracksWeightFilter.h:28
FPTracker::magnetFactory
Magnet::Ptr_t magnetFactory(double x, double y, double center, double strength, double length, int apertype, double A1, double A2, double A3, double A4, double X, double pbeam0, Side side, Magnet::Type type)
Definition: magnetFactory.cxx:87
query_example.col
col
Definition: query_example.py:7
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
FPTracker::typeToString
std::string typeToString(Magnet::Type type)
Definition: magnetFactory.cxx:20
y
#define y
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
FPTracker::getConfigFile
std::shared_ptr< std::ifstream > getConfigFile(const std::string &dir, const std::string &fn)
Definition: getConfigFile.cxx:11
calibdata.cd
cd
Definition: calibdata.py:51
atlasStyleMacro.tsize
float tsize
Definition: atlasStyleMacro.py:37
FPTracker::determineMagnetConfigFileName
std::string determineMagnetConfigFileName(int IP, const Side &side, int magver)
Definition: getMagnetConfigFiles.cxx:15
xAOD::Plane
@ Plane
Definition: TrackingPrimitives.h:556
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26
Trk::previous
@ previous
Definition: BinningData.h:32