CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
ForwardDiskSectorBuilderFromWedges Class Reference

#include <ForwardDiskSectorBuilderFromWedges.h>

Public Member Functions

BoundDiskSectoroperator() (const std::vector< const TECWedge * > &wedges) const
 

Private Member Functions

std::pair< DiskSectorBounds *, GlobalVectorcomputeBounds (const std::vector< const TECWedge * > &wedges) const
 
Surface::RotationType computeRotation (const std::vector< const TECWedge * > &wedges, Surface::PositionType pos) const
 

Detailed Description

As it's name indicates, it's a builder of a BoundDiskSector from a collection of Wedges (of one petal). The disk sector has the minimal size fully containing all wedges.

Definition at line 15 of file ForwardDiskSectorBuilderFromWedges.h.

Member Function Documentation

◆ computeBounds()

pair< DiskSectorBounds *, GlobalVector > ForwardDiskSectorBuilderFromWedges::computeBounds ( const std::vector< const TECWedge * > &  wedges) const
private

Definition at line 42 of file ForwardDiskSectorBuilderFromWedges.cc.

43  {
44  // compute maximum and minimum radius and phi
45  float rmin((**(wedges.begin())).specificSurface().innerRadius());
46  float rmax(rmin);
47  float zmin((**(wedges.begin())).surface().position().z());
48  float zmax(zmin);
49  float phimin((**(wedges.begin())).surface().position().phi());
50  float phimax(phimin);
51 
52  for (vector<const TECWedge*>::const_iterator iw = wedges.begin(); iw != wedges.end(); iw++) {
53  // edm::LogInfo(TkDetLayers) << "---------------------------------------------" ;
54  // edm::LogInfo(TkDetLayers) << " Builder: Position of wedge :" << (**iw).position() ;
55  float ri = (**iw).specificSurface().innerRadius();
56  float ro = (**iw).specificSurface().outerRadius();
57  float zmi = (**iw).surface().position().z() - (**iw).specificSurface().bounds().thickness() / 2.;
58  float zma = (**iw).surface().position().z() + (**iw).specificSurface().bounds().thickness() / 2.;
59  float phi1 = (**iw).surface().position().phi() - (**iw).specificSurface().phiHalfExtension();
60  float phi2 = (**iw).surface().position().phi() + (**iw).specificSurface().phiHalfExtension();
61  rmin = min(rmin, ri);
62  rmax = max(rmax, ro);
63  zmin = min(zmin, zmi);
64  zmax = max(zmax, zma);
65  if (Geom::phiLess(phi1, phimin))
66  phimin = phi1;
67  if (Geom::phiLess(phimax, phi2))
68  phimax = phi2;
69  }
70 
72  edm::LogError("TkDetLayers") << " ForwardDiskSectorBuilderFromWedges : "
73  << "Something went wrong with Phi Sorting !";
74  float zPos = (zmax + zmin) / 2.;
75  float phiWin = phimax - phimin;
76  float phiPos = (phimax + phimin) / 2.;
77  float rmed = (rmin + rmax) / 2.;
78  if (phiWin < 0.) {
79  if ((phimin < Geom::pi() / 2.) || (phimax > -Geom::pi() / 2.)) {
80  edm::LogError("TkDetLayers") << " Debug: something strange going on, please check ";
81  }
82  // edm::LogInfo(TkDetLayers) << " Petal at pi: phi " << phimin << " " << phimax << " " << phiWin
83  // << " " << 2.*Geom::pi()+phiWin << " " ;
84  phiWin += 2. * Geom::pi();
85  phiPos += Geom::pi();
86  }
87 
88  GlobalVector pos(rmed * cos(phiPos), rmed * sin(phiPos), zPos);
89  return make_pair(new DiskSectorBounds(rmin, rmax, zmin - zPos, zmax - zPos, phiWin), pos);
90 }

References funct::cos(), SiStripPI::max, min(), Geom::phiLess(), phimax, phimin, Geom::pi(), funct::sin(), SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

◆ computeRotation()

Surface::RotationType ForwardDiskSectorBuilderFromWedges::computeRotation ( const std::vector< const TECWedge * > &  wedges,
Surface::PositionType  pos 
) const
private

Definition at line 92 of file ForwardDiskSectorBuilderFromWedges.cc.

93  {
94  GlobalVector yAxis = (GlobalVector(pos.x(), pos.y(), 0.)).unit();
95 
96  GlobalVector zAxis(0., 0., 1.);
97  GlobalVector xAxis = yAxis.cross(zAxis);
98 
100 }

References unit(), HLT_2018_cff::xAxis, HLT_2018_cff::yAxis, and HLT_2018_cff::zAxis.

◆ operator()()

BoundDiskSector * ForwardDiskSectorBuilderFromWedges::operator() ( const std::vector< const TECWedge * > &  wedges) const

Warning, remember to assign this pointer to a ReferenceCountingPointer! Should be changed to return a ReferenceCountingPointer<BoundDisk>

Definition at line 9 of file ForwardDiskSectorBuilderFromWedges.cc.

9  {
10  // check first that all wedges are about at the same phi and z !
11  float phiStart = wedges.front()->position().phi();
12  float zStart = wedges.front()->position().z();
13  float wphimin, wphimax;
14  for (vector<const TECWedge*>::const_iterator i = wedges.begin(); i != wedges.end(); i++) {
15  float zdiff = (**i).surface().position().z() - zStart;
16  if (std::abs(zdiff) > 5.)
17  edm::LogError("TkDetLayers") << " ForwardDiskSectorBuilderFromWedges: Trying to build "
18  << "Petal from Wedges at different z ! Delta Z = " << zdiff;
19  float wphi = (**i).surface().position().phi();
20  if (Geom::phiLess(phiStart, wphi)) {
21  wphimin = phiStart;
22  wphimax = wphi;
23  } else {
24  wphimin = wphi;
25  wphimax = phiStart;
26  }
27  float phidiff = wphimax - wphimin;
28  if (phidiff < 0.)
29  phidiff += 2. * Geom::pi();
30  if (phidiff > 0.3)
31  edm::LogError("TkDetLayers") << " ForwardDiskSectorBuilderFromWedges: Trying to build "
32  << "Petal from Wedges at different phi ! Delta phi = " << phidiff;
33  }
34 
35  auto bo = computeBounds(wedges);
36 
37  Surface::PositionType pos(bo.second.x(), bo.second.y(), bo.second.z());
39  return new BoundDiskSector(pos, rot, bo.first);
40 }

References funct::abs(), mps_fire::i, PV3DBase< T, PVType, FrameType >::phi(), hitfit::phidiff(), Geom::phiLess(), Geom::pi(), GloballyPositioned< T >::position(), and makeMuonMisalignmentScenario::rot.

Vector3DBase
Definition: Vector3DBase.h:8
TkRotation< float >
mps_fire.i
i
Definition: mps_fire.py:355
DiskSectorBounds
Definition: DiskSectorBounds.h:12
min
T min(T a, T b)
Definition: MathUtil.h:58
phimin
float phimin
Definition: ReggeGribovPartonMCHadronizer.h:107
pos
Definition: PixelAliasList.h:18
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
GloballyPositioned< float >::RotationType
TkRotation< float > RotationType
Definition: GloballyPositioned.h:22
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
Geom::pi
constexpr double pi()
Definition: Pi.h:31
Point3DBase< float, GlobalTag >
edm::LogError
Definition: MessageLogger.h:183
Geom::phiLess
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:18
ForwardDiskSectorBuilderFromWedges::computeRotation
Surface::RotationType computeRotation(const std::vector< const TECWedge * > &wedges, Surface::PositionType pos) const
Definition: ForwardDiskSectorBuilderFromWedges.cc:92
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
hitfit::phidiff
double phidiff(double phi)
Normalized difference in azimuthal angles to a range between .
Definition: fourvec.cc:220
ForwardDiskSectorBuilderFromWedges::computeBounds
std::pair< DiskSectorBounds *, GlobalVector > computeBounds(const std::vector< const TECWedge * > &wedges) const
Definition: ForwardDiskSectorBuilderFromWedges.cc:42
unit
Basic3DVector unit() const
Definition: Basic3DVectorLD.h:162
BoundDiskSector
Definition: BoundDiskSector.h:8
phimax
float phimax
Definition: ReggeGribovPartonMCHadronizer.h:106
HLT_2018_cff.xAxis
xAxis
Definition: HLT_2018_cff.py:44410
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HLT_2018_cff.yAxis
yAxis
Definition: HLT_2018_cff.py:44412
HLT_2018_cff.zAxis
zAxis
Definition: HLT_2018_cff.py:44411