ATLAS Offline Software
setupBeamline.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "FPTracker/STLHelpers.h"
7 #include "FPTracker/ConfigData.h"
8 #include "FPTracker/magnetSet.h"
10 #include "FPTracker/Magnet.h"
13 #include "FPTracker/Collimator.h"
14 #include "FPTracker/collSet.h"
15 #include "FPTracker/Plane.h"
16 #include "FPTracker/Beamline.h"
18 #include "FPTracker/IBeamElement.h"
19 #include "FPTracker/Particle.h"
20 #include <memory>
21 #include <algorithm>
22 //#include <cassert>
23 #include <iostream>
24 
25 namespace FPTracker{
26 
28  const ConfigData& configData,
29  const Side& side,
30  int magver,
31  std::shared_ptr< std::ifstream> magfile
32  )
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  (
55  new EmptySpaceElement(
56  0.,
57  (*current)->frontFace(),
59  (*current)->side()
60  )
61  )
62  );
63  ++current;
64 
65  for(; current != last; ++current){
67  --previous;
68  elements.insert(current,
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  }
89 }
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
FPTracker::Beamline::calibrate
void calibrate(IParticle &)
Definition: FPTracker/src/Beamline.cxx:110
FPTracker::IBeamElement::List_t
std::list< Ptr_t > List_t
Definition: FPTracker/FPTracker/IBeamElement.h:47
ConfigData.h
FPTracker::magnetSet
Magnet::Container_t magnetSet(const ConfigData &, const Side &side, int magversion, std::shared_ptr< std::ifstream > magfile)
Definition: magnetSet.cxx:60
STLHelpers.h
FPTracker::collSet
Collimator::Container_t collSet(const CollimatorData &, Side)
Definition: collSet.cxx:13
FPTracker::setupBeamline
Beamline setupBeamline(const ConfigData &, const Side &, int magver, std::shared_ptr< std::ifstream >)
Definition: setupBeamline.cxx:27
xAOD::Particle
Particle_v1 Particle
Define the latest version of the particle class.
Definition: Event/xAOD/xAODParticleEvent/xAODParticleEvent/Particle.h:17
FPTracker::Beamline
Definition: FPTracker/FPTracker/Beamline.h:15
magnetSet.h
TRT::Hit::side
@ side
Definition: HitInfo.h:83
FPTracker::beam1
@ beam1
Definition: FPTrackerConstants.h:12
CollimatorData.h
FPTracker::Collimator::Container_t
std::vector< Ptr_t > Container_t
Definition: FPTracker/FPTracker/Collimator.h:41
readConfigData.h
FPTracker::beamlineXPosition
TransversePoint beamlineXPosition(double z)
Definition: beamlineXPosition.cxx:11
FPTracker::Magnet::Container_t
std::vector< Ptr_t > Container_t
Definition: FPTracker/FPTracker/Magnet.h:62
Side
Definition: WaferTree.h:36
FPTracker::EmptySpaceElement
Definition: EmptySpaceElement.h:18
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
FPTracker::Plane
Definition: FPTracker/FPTracker/Plane.h:19
EmptySpaceElement.h
setupBeamline.h
FPTracker::ConfigData::pbeam0
double pbeam0
Definition: FPTracker/FPTracker/ConfigData.h:18
FPTracker::ConfigData::endMarker
float endMarker
Definition: FPTracker/FPTracker/ConfigData.h:21
FPTracker::IBeamElement::ListIter_t
List_t::iterator ListIter_t
Definition: FPTracker/FPTracker/IBeamElement.h:48
Plane.h
Beamline.h
FPTracker::IBeamElement::Ptr_t
std::shared_ptr< IBeamElement > Ptr_t
Definition: FPTracker/FPTracker/IBeamElement.h:41
IBeamElement.h
Collimator.h
beamlineXPosition.h
FPTracker::ConfigData
Definition: FPTracker/FPTracker/ConfigData.h:9
collSet.h
Particle.h
FPTracker
Definition: FPTracker/FPTracker/Beamline.h:12
Magnet.h
FPTracker::CollimatorData
Definition: FPTracker/FPTracker/CollimatorData.h:13
Trk::previous
@ previous
Definition: BinningData.h:32