CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MultipleScatteringGeometry.cc
Go to the documentation of this file.
4 
12 
13 using namespace GeomDetEnumerators;
14 using namespace std;
15 
16 //------------------------------------------------------------------------------
17 const float MultipleScatteringGeometry::beamPipeR = 2.94;
19 const float MultipleScatteringGeometry::supportR = 19.;
20 
21 //------------------------------------------------------------------------------
23 {
24 
26  iSetup.get<TrackerRecoGeometryRecord>().get( track );
27 
28  vector<BarrelDetLayer*> barrelLayers=track->barrelLayers();
29  vector<BarrelDetLayer*>::const_iterator ib;
30  vector<ForwardDetLayer*> forwardPosLayers=track->posForwardLayers();
31  vector<ForwardDetLayer*> forwardNegLayers=track->negForwardLayers();
32  vector<ForwardDetLayer*>::const_iterator ie;
33  // barrelLayers = accessor.barrelLayers();
34  for (ib = barrelLayers.begin(); ib != barrelLayers.end(); ib++)
35  theLayers.push_back(*ib);
36 
37 // forwardLayers = accessor.negativeEndcapLayers();
38  for (ie = forwardPosLayers.begin(); ie != forwardPosLayers.end(); ie++)
39  theLayers.push_back(*ie);
40  for (ie = forwardNegLayers.begin(); ie != forwardNegLayers.end(); ie++)
41  theLayers.push_back(*ie);
42 
43 }
44 
45 //------------------------------------------------------------------------------
46 vector<MSLayer> MultipleScatteringGeometry::detLayers(const edm::EventSetup &iSetup) const
47 {
48  vector<MSLayer> result;
49  vector<const DetLayer*>::const_iterator il;
50  for (il=theLayers.begin();il!=theLayers.end();il++) result.push_back(MSLayer(*il));
51  return result;
52 }
53 
54 //------------------------------------------------------------------------------
55 vector<MSLayer> MultipleScatteringGeometry::detLayers(float eta, float z,const edm::EventSetup &iSetup) const
56 {
57  vector<MSLayer> result;
58  GlobalPoint zero(0,0,z);
59  float r=1; float dirZ = r*sinh(eta);
60  GlobalVector dir(r,0.,dirZ);
62  iSetup.get<IdealMagneticFieldRecord>().get(pSetup);
63  FreeTrajectoryState fts( GlobalTrajectoryParameters(zero,dir,1,&(*pSetup)) );
65  vector<const DetLayer*>::const_iterator il;
67  for (il = theLayers.begin(); il != theLayers.end(); il++) {
68  bool contains=false;
69 // if ((*il)->subDetector() != PixelBarrel && (*il)->subDetector()!= PixelEndcap) continue;
70 
71  if ( (*il)->location() == barrel ) {
72  const BarrelDetLayer * bl = dynamic_cast<const BarrelDetLayer*>(*il);
73  if (!bl) continue;
74  tsos = propagator.propagate(fts, bl->specificSurface());
75  if (!tsos.isValid()) continue;
76  float r=bl->specificSurface().radius();
77  float dr = bl->specificSurface().bounds().thickness();
78  float z=bl->position().z();
79  float dz = bl->specificSurface().bounds().length();
80  PixelRecoRange<float> rRange(r-dr/2., r+dr/2.);
81  PixelRecoRange<float> zRange(z-dz/2., z+dz/2.);
82  contains = rRange.inside(tsos.globalPosition().perp())
83  && zRange.inside(tsos.globalPosition().z());
84  // contains = bl->contains((*il)->toLocal(tsos.globalPosition()));
85  }
86  else if ((*il)->location() == endcap) {
87  const ForwardDetLayer * fl = dynamic_cast<const ForwardDetLayer*>(*il);
88  if (!fl) continue;
89  if (fl->position().z() * eta < 0) continue;
90  const BoundDisk & disk = fl->specificSurface();
91  tsos = propagator.propagate(fts, disk);
92  if (!tsos.isValid()) continue;
93  float zMin = disk.position().z()-disk.bounds().thickness()/2;
94  float zMax = disk.position().z()+disk.bounds().thickness()/2;
95  PixelRecoRange<float> rRange(disk.innerRadius(), disk.outerRadius());
96  PixelRecoRange<float> zRange(zMin, zMax);
97  contains = rRange.inside(tsos.globalPosition().perp())
98  && zRange.inside(tsos.globalPosition().z());
99  // contains = fl->contains(fl->toLocal(tsos.globalPosition()));
100  }
101  if (contains) result.push_back(MSLayer(*il));
102  }
103  return result;
104 }
105 //------------------------------------------------------------------------------
106 vector<MSLayer> MultipleScatteringGeometry::otherLayers(float eta,const edm::EventSetup &iSetup) const
107 {
108  vector<MSLayer> result;
109  // zero
110  // MSLayer zero(barrel, 0., MSLayer::Range(-15,15));
111  // result.push_back(zero);
112 
113  // beampipe
114  MSLayer beampipe(barrel, beamPipeR, MSLayer::Range(-100,100));
115 
116  result.push_back(beampipe);
117 
118  // endflanges
119  PixelRecoPointRZ endfPoint = (eta > 0) ?
120  PixelRecoPointRZ(endflangesZ/sinh(eta), endflangesZ)
121  : PixelRecoPointRZ(-endflangesZ/sinh(eta), -endflangesZ);
122  if (0 < endfPoint.r() && endfPoint.r() < supportR) {
123  MSLayer endflanges(endcap,endfPoint.z(),MSLayer::Range(0.1,supportR-0.1));
124  result.push_back(endflanges);
125  }
126 
127  // support
128  MSLayer support( barrel,supportR, MSLayer::Range(-280,280));
129  result.push_back(support);
130 
131  return result;
132 }
133 
134 
135 
int ib
Definition: cuy.py:660
T perp() const
Definition: PV3DBase.h:72
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
std::vector< MSLayer > otherLayers(float eta, const edm::EventSetup &iSetup) const
GlobalPoint globalPosition() const
T eta() const
float float float z
T z() const
Definition: PV3DBase.h:64
tuple result
Definition: query.py:137
std::vector< MSLayer > detLayers(float eta, float z, const edm::EventSetup &iSetup) const
float z() const
virtual const Surface::PositionType & position() const
Returns position of the surface.
const T & get() const
Definition: EventSetup.h:55
bool inside(const T &value) const
virtual const BoundDisk & specificSurface() const GCC11_FINAL
float r() const
dbl *** dir
Definition: mlp_gen.cc:35
PixelRecoRange< float > Range
Definition: MSLayer.h:16
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.
MultipleScatteringGeometry(const edm::EventSetup &iSetup)