CMS 3D CMS Logo

Geometry.h
Go to the documentation of this file.
1 #ifndef FASTSIM_GEOMETRY_H
2 #define FASTSIM_GEOMETRY_H
3 
14 
16 // Author: L. Vanelderen, S. Kurz
17 // Date: 29 May 2017
19 
20 #include <vector>
21 
22 namespace fastsim {
23  class InteractionModel;
24 
26 
30  class Geometry {
31  public:
34 
36  ~Geometry();
37 
39 
45  void update(const edm::EventSetup& iSetup, const std::map<std::string, InteractionModel*>& interactionModelMap);
46 
48 
54 
56 
60  const std::vector<std::unique_ptr<BarrelSimplifiedGeometry>>& barrelLayers() const { return barrelLayers_; }
61 
63 
67  const std::vector<std::unique_ptr<ForwardSimplifiedGeometry>>& forwardLayers() const { return forwardLayers_; }
68 
70 
74  double getMaxRadius() { return maxRadius_; }
75 
77 
81  double getMaxZ() { return maxZ_; }
82 
84  friend std::ostream& operator<<(std::ostream& o, const fastsim::Geometry& geometry);
85 
87 
93  if (layer == nullptr) {
94  return nullptr;
95  }
96  unsigned nextLayerIndex = layer->index() + 1;
97  return nextLayerIndex < barrelLayers_.size() ? barrelLayers_[nextLayerIndex].get() : nullptr;
98  }
99 
101 
107  if (layer == nullptr) {
108  return nullptr;
109  }
110  unsigned nextLayerIndex = layer->index() + 1;
111  return nextLayerIndex < forwardLayers_.size() ? forwardLayers_[nextLayerIndex].get() : nullptr;
112  }
113 
115 
121  if (layer == nullptr) {
122  return barrelLayers_.back().get();
123  }
124  return layer->index() > 0 ? barrelLayers_[layer->index() - 1].get() : nullptr;
125  }
126 
128 
134  if (layer == nullptr) {
135  return forwardLayers_.back().get();
136  }
137  return layer->index() > 0 ? forwardLayers_[layer->index() - 1].get() : nullptr;
138  }
139 
140  private:
141  std::vector<std::unique_ptr<BarrelSimplifiedGeometry>>
143  std::vector<std::unique_ptr<ForwardSimplifiedGeometry>>
145  std::unique_ptr<MagneticField>
147 
150 
154  const double fixedMagneticFieldZ_;
155  const bool
158  const std::vector<edm::ParameterSet>
160  const std::vector<edm::ParameterSet>
162  const double maxRadius_;
163  const double maxZ_;
164 
165  const bool barrelBoundary_;
166  const bool forwardBoundary_;
169 
172  };
173  std::ostream& operator<<(std::ostream& os, const fastsim::Geometry& geometry);
174 } // namespace fastsim
175 
176 #endif
const bool useTrackerRecoGeometryRecord_
Use GeometricSearchTracker (active layers/reco geometry). Can be used to get position/radius of track...
Definition: Geometry.h:156
unsigned long long cacheIdentifierTrackerRecoGeometry_
Check interval of validity of the tracker geometry.
Definition: Geometry.h:148
Implementation of a forward detector layer (disk).
friend std::ostream & operator<<(std::ostream &o, const fastsim::Geometry &geometry)
Provides some basic output for e.g. debugging.
double getMaxRadius()
Upper bound of the radius of the whole tracker geometry.
Definition: Geometry.h:74
std::vector< std::unique_ptr< BarrelSimplifiedGeometry > > barrelLayers_
The vector of barrel layers (increasing radius)
Definition: Geometry.h:142
const ForwardSimplifiedGeometry * nextLayer(const ForwardSimplifiedGeometry *layer) const
Helps to navigate through the vector of forward layers.
Definition: Geometry.h:106
const ForwardSimplifiedGeometry * previousLayer(const ForwardSimplifiedGeometry *layer) const
Helps to navigate through the vector of forward layers.
Definition: Geometry.h:133
void update(const edm::EventSetup &iSetup, const std::map< std::string, InteractionModel *> &interactionModelMap)
Initializes the tracker geometry.
Definition: Geometry.cc:55
const GeometricSearchTracker * geometricSearchTracker_
Definition: Geometry.h:151
const BarrelSimplifiedGeometry * previousLayer(const BarrelSimplifiedGeometry *layer) const
Helps to navigate through the vector of barrel layers.
Definition: Geometry.h:120
const MagneticField * magneticField_
The tracker geometry.
Definition: Geometry.h:152
const std::vector< std::unique_ptr< BarrelSimplifiedGeometry > > & barrelLayers() const
Return the vector of barrel layers.
Definition: Geometry.h:60
const std::vector< edm::ParameterSet > forwardLayerCfg_
The config in which all parameters of the forward layers are defined.
Definition: Geometry.h:161
Implementation of a barrel detector layer (cylindrical).
const std::vector< edm::ParameterSet > barrelLayerCfg_
The config in which all parameters of the barrel layers are defined.
Definition: Geometry.h:159
const double fixedMagneticFieldZ_
Use a uniform magnetic field or non-uniform from MagneticFieldRecord.
Definition: Geometry.h:154
const double maxZ_
Upper bound of the radius of the whole tracker geometry.
Definition: Geometry.h:163
const edm::ParameterSet trackerForwardBoundaryCfg_
Hack to interface "old" calo to "new" tracking.
Definition: Geometry.h:168
const std::string trackerAlignmentLabel_
The tracker alignment label.
Definition: Geometry.h:157
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
std::unique_ptr< MagneticField > ownedMagneticField_
Needed to create a uniform magnetic field if speciefied in config.
Definition: Geometry.h:146
edm::ESGetToken< GeometricSearchTracker, TrackerRecoGeometryRecord > geometricSearchTrackerESToken_
Definition: Geometry.h:170
std::ostream & operator<<(std::ostream &os, const fastsim::Geometry &geometry)
Definition: Geometry.cc:160
const bool forwardBoundary_
Hack to interface "old" calo to "new" tracking.
Definition: Geometry.h:166
double getMaxZ()
Upper bound of the length/2 (0 to +Z) of the whole tracker geometry.
Definition: Geometry.h:81
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldESToken_
Definition: Geometry.h:171
const edm::ParameterSet trackerBarrelBoundaryCfg_
Hack to interface "old" calo to "new" tracking.
Definition: Geometry.h:167
const std::vector< std::unique_ptr< ForwardSimplifiedGeometry > > & forwardLayers() const
Return the vector of forward layers (disks).
Definition: Geometry.h:67
Definition the tracker geometry (vectors of forward/barrel layers).
Definition: Geometry.h:30
Geometry(const edm::ParameterSet &, edm::ConsumesCollector &&)
Constructor.
Definition: Geometry.cc:22
double getMagneticFieldZ(const math::XYZTLorentzVector &position) const
Initializes the tracker geometry.
Definition: Geometry.cc:156
const double maxRadius_
Definition: Geometry.h:162
static int position[264][3]
Definition: ReadPGInfo.cc:289
std::vector< std::unique_ptr< ForwardSimplifiedGeometry > > forwardLayers_
The vector of forward layers (increasing Z-position)
Definition: Geometry.h:144
const BarrelSimplifiedGeometry * nextLayer(const BarrelSimplifiedGeometry *layer) const
Helps to navigate through the vector of barrel layers.
Definition: Geometry.h:92
const bool useFixedMagneticFieldZ_
Needed to create a uniform magnetic field if speciefied in config.
Definition: Geometry.h:153
~Geometry()
Default destructor.
Definition: Geometry.cc:20
const bool barrelBoundary_
Upper bound of the length/2 (0 to +Z) of the whole tracker geometry.
Definition: Geometry.h:165
unsigned long long cacheIdentifierIdealMagneticField_
Check interval of validity of the magnetic field.
Definition: Geometry.h:149