CMS 3D CMS Logo

MultipleScatteringGeometry.cc
Go to the documentation of this file.
4 
7 
8 using namespace GeomDetEnumerators;
9 using namespace std;
10 
11 //------------------------------------------------------------------------------
12 const float MultipleScatteringGeometry::beamPipeR = 2.94;
14 const float MultipleScatteringGeometry::supportR = 19.;
15 
16 //------------------------------------------------------------------------------
18  vector<BarrelDetLayer const *> barrelLayers = tracker.barrelLayers();
19  vector<BarrelDetLayer const *>::const_iterator ib;
20  vector<ForwardDetLayer const *> forwardPosLayers = tracker.posForwardLayers();
21  vector<ForwardDetLayer const *> forwardNegLayers = tracker.negForwardLayers();
22  vector<ForwardDetLayer const *>::const_iterator ie;
23  // barrelLayers = accessor.barrelLayers();
24  for (ib = barrelLayers.begin(); ib != barrelLayers.end(); ib++)
25  theLayers.push_back(*ib);
26 
27  // forwardLayers = accessor.negativeEndcapLayers();
28  for (ie = forwardPosLayers.begin(); ie != forwardPosLayers.end(); ie++)
29  theLayers.push_back(*ie);
30  for (ie = forwardNegLayers.begin(); ie != forwardNegLayers.end(); ie++)
31  theLayers.push_back(*ie);
32 }
33 
34 //------------------------------------------------------------------------------
35 vector<MSLayer> MultipleScatteringGeometry::detLayers() const {
36  vector<MSLayer> result;
37  vector<const DetLayer *>::const_iterator il;
38  for (il = theLayers.begin(); il != theLayers.end(); il++)
39  result.push_back(MSLayer(*il));
40  return result;
41 }
42 
43 //------------------------------------------------------------------------------
44 vector<MSLayer> MultipleScatteringGeometry::detLayers(float eta, float z, const MagneticField &bfield) const {
45  vector<MSLayer> result;
46  GlobalPoint zero(0, 0, z);
47  float r = 1;
48  float dirZ = r * sinh(eta);
49  GlobalVector dir(r, 0., dirZ);
52  vector<const DetLayer *>::const_iterator il;
54  for (il = theLayers.begin(); il != theLayers.end(); il++) {
55  bool contains = false;
56  // if ((*il)->subDetector() != PixelBarrel && (*il)->subDetector()!= PixelEndcap) continue;
57 
58  if ((*il)->location() == barrel) {
59  const BarrelDetLayer *bl = dynamic_cast<const BarrelDetLayer *>(*il);
60  if (!bl)
61  continue;
62  tsos = propagator.propagate(fts, bl->specificSurface());
63  if (!tsos.isValid())
64  continue;
65  float r = bl->specificSurface().radius();
66  float dr = bl->specificSurface().bounds().thickness();
67  float z = bl->position().z();
68  float dz = bl->specificSurface().bounds().length();
69  PixelRecoRange<float> rRange(r - dr / 2., r + dr / 2.);
70  PixelRecoRange<float> zRange(z - dz / 2., z + dz / 2.);
71  contains = rRange.inside(tsos.globalPosition().perp()) && zRange.inside(tsos.globalPosition().z());
72  // contains = bl->contains((*il)->toLocal(tsos.globalPosition()));
73  } else if ((*il)->location() == endcap) {
74  const ForwardDetLayer *fl = dynamic_cast<const ForwardDetLayer *>(*il);
75  if (!fl)
76  continue;
77  if (fl->position().z() * eta < 0)
78  continue;
79  const BoundDisk &disk = fl->specificSurface();
80  tsos = propagator.propagate(fts, disk);
81  if (!tsos.isValid())
82  continue;
83  float zMin = disk.position().z() - disk.bounds().thickness() / 2;
84  float zMax = disk.position().z() + disk.bounds().thickness() / 2;
85  PixelRecoRange<float> rRange(disk.innerRadius(), disk.outerRadius());
87  contains = rRange.inside(tsos.globalPosition().perp()) && zRange.inside(tsos.globalPosition().z());
88  // contains = fl->contains(fl->toLocal(tsos.globalPosition()));
89  }
90  if (contains)
91  result.push_back(MSLayer(*il));
92  }
93  return result;
94 }
95 //------------------------------------------------------------------------------
96 vector<MSLayer> MultipleScatteringGeometry::otherLayers(float eta) const {
97  vector<MSLayer> result;
98  // zero
99  // MSLayer zero(barrel, 0., MSLayer::Range(-15,15));
100  // result.push_back(zero);
101 
102  // beampipe
103  MSLayer beampipe(barrel, beamPipeR, MSLayer::Range(-100, 100));
104 
105  result.push_back(beampipe);
106 
107  // endflanges
108  PixelRecoPointRZ endfPoint = (eta > 0) ? PixelRecoPointRZ(endflangesZ / sinh(eta), endflangesZ)
109  : PixelRecoPointRZ(-endflangesZ / sinh(eta), -endflangesZ);
110  if (0 < endfPoint.r() && endfPoint.r() < supportR) {
111  MSLayer endflanges(endcap, endfPoint.z(), MSLayer::Range(0.1, supportR - 0.1));
112  result.push_back(endflanges);
113  }
114 
115  // support
116  MSLayer support(barrel, supportR, MSLayer::Range(-280, 280));
117  result.push_back(support);
118 
119  return result;
120 }
virtual const Surface::PositionType & position() const
Returns position of the surface.
T perp() const
Definition: PV3DBase.h:69
bool inside(const T &value) const
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:37
T z() const
Definition: PV3DBase.h:61
GlobalPoint globalPosition() const
std::vector< MSLayer > detLayers() const
float r() const
MultipleScatteringGeometry(const GeometricSearchTracker &tracker)
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
std::vector< MSLayer > otherLayers(float eta) const
virtual const BoundDisk & specificSurface() const final
float z() const
PixelRecoRange< float > Range
Definition: MSLayer.h:15
ib
Definition: cuy.py:661