CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Attributes
tt::SensorModule Class Reference

#include <SensorModule.h>

Public Types

enum  Type {
  BarrelPS, Barrel2S, DiskPS, Disk2S,
  NumTypes
}
 

Public Member Functions

bool barrel () const
 
double cosTilt () const
 
int dtcId () const
 
int encodedR () const
 
bool flipped () const
 
int layerId () const
 
int modId () const
 
int numColumns () const
 
int numRows () const
 
double offsetR () const
 
double offsetZ () const
 
double phi () const
 
double pitchCol () const
 
double pitchRow () const
 
bool psModule () const
 
double r () const
 
unsigned int ringId (const Setup *setup) const
 
 SensorModule (const Setup *setup, const DetId &detId, int dtcId, int modId)
 
double sep () const
 
bool side () const
 
bool signBend () const
 
bool signCol () const
 
bool signRow () const
 
double sinTilt () const
 
double tilt () const
 
double tiltCorrection (double cot) const
 
Type type () const
 
int windowSize () const
 
double z () const
 
 ~SensorModule ()
 

Private Types

enum  TypeTilt { nonBarrel = 0, tiltedMinus = 1, tiltedPlus = 2, flat = 3 }
 

Private Attributes

bool barrel_
 
double cosTilt_
 
DetId detId_
 
int dtcId_
 
int encodedR_
 
bool flipped_
 
int layerId_
 
int modId_
 
int numColumns_
 
int numRows_
 
double offsetR_
 
double offsetZ_
 
double phi_
 
double pitchCol_
 
double pitchRow_
 
bool psModule_
 
double r_
 
double sep_
 
bool side_
 
bool signBend_
 
bool signCol_
 
bool signRow_
 
double sinTilt_
 
double tilt_
 
double tiltCorrectionIntercept_
 
double tiltCorrectionSlope_
 
Type type_
 
int windowSize_
 
double z_
 

Detailed Description

Definition at line 11 of file SensorModule.h.

Member Enumeration Documentation

◆ Type

◆ TypeTilt

Enumerator
nonBarrel 
tiltedMinus 
tiltedPlus 
flat 

Definition at line 76 of file SensorModule.h.

Constructor & Destructor Documentation

◆ SensorModule()

tt::SensorModule::SensorModule ( const Setup setup,
const DetId detId,
int  dtcId,
int  modId 
)

Definition at line 15 of file SensorModule.cc.

References Matriplex::atan2(), Barrel2S, barrel_, BarrelPS, funct::cos(), cosTilt_, tt::deltaPhi(), hcalRecHitTable_cff::detId, Disk2S, DiskPS, dtcId_, encodedR_, flat, flipped_, TrackerGeometry::getDetectorType(), TrackerGeometry::idToDetUnit(), PVValHelper::ladder, TrackerTopology::layer(), layerId_, PV3DBase< T, PVType, FrameType >::mag(), mag(), numColumns_, numRows_, HLT_IsoTrack_cff::offset, offsetR_, offsetZ_, TrackerTopology::partnerDetId(), PV3DBase< T, PVType, FrameType >::perp(), TrackerGeometry::Ph2PSP, PV3DBase< T, PVType, FrameType >::phi(), Basic3DVector< T >::phi(), phi_, pitchCol_, pitchRow_, GeomDet::position(), position, psModule_, r_, nano_mu_digi_cff::region, relativeConstraints::ring, GloballyPositioned< T >::rotation(), sep_, singleTopDQM_cfi::setup, side_, signBend_, signCol_, signRow_, funct::sin(), sinTilt_, TrackerTopology::tidRing(), TrackerTopology::tidWheel(), tilt_, tiltCorrectionIntercept_, tiltCorrectionSlope_, tiltedMinus, tiltedPlus, StripSubdetector::TOB, TrackerTopology::tobRod(), TrackerTopology::tobSide(), type_, windowSize(), windowSize_, TkRotation< T >::x(), PV3DBase< T, PVType, FrameType >::z(), and z_.

17  const TrackerGeometry* trackerGeometry = setup->trackerGeometry();
18  const TrackerTopology* trackerTopology = setup->trackerTopology();
19  const GeomDetUnit* geomDetUnit = trackerGeometry->idToDetUnit(detId);
21  dynamic_cast<const PixelTopology*>(&(dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit)->specificTopology()));
22  const Plane& plane = dynamic_cast<const PixelGeomDetUnit*>(geomDetUnit)->surface();
23  const GlobalPoint pos0 = GlobalPoint(geomDetUnit->position());
24  const GlobalPoint pos1 =
25  GlobalPoint(trackerGeometry->idToDetUnit(trackerTopology->partnerDetId(detId))->position());
26  // detector region [0-8]
27  const int region = dtcId_ / setup->numDTCsPerRegion();
28  // module radius in cm
29  r_ = pos0.perp();
30  // module phi w.r.t. detector region_ centre in rad
31  phi_ = deltaPhi(pos0.phi() - (region + .5) * setup->baseRegion());
32  // module z in cm
33  z_ = pos0.z();
34  // sensor separation in cm
35  sep_ = (pos1 - pos0).mag();
36  // sensor pitch in cm [strip=.009,pixel=.01]
37  pitchRow_ = pixelTopology->pitch().first;
38  // sensor length in cm [strip=5,pixel=.15625]
39  pitchCol_ = pixelTopology->pitch().second;
40  // number of columns [2S=2,PS=8]
41  numColumns_ = pixelTopology->ncolumns();
42  // number of rows [2S=8*127,PS=8*120]
43  numRows_ = pixelTopology->nrows();
44  // +z or -z
45  side_ = pos0.z() >= 0.;
46  // main sensor inside or outside
47  flipped_ = pos0.mag() > pos1.mag();
48  // barrel or endcap
49  barrel_ = detId.subdetId() == StripSubdetector::TOB;
50  // Pixel-Strip or 2Strip module
52  // module tilt angle measured w.r.t. beam axis (0=barrel), tk layout measures w.r.t. radial axis
53  tilt_ = flipped_ ? atan2(pos1.z() - pos0.z(), pos0.perp() - pos1.perp())
54  : atan2(pos0.z() - pos1.z(), pos1.perp() - pos0.perp());
55  // sinus of module tilt measured w.r.t. beam axis (0=barrel), tk layout measures w.r.t. radial axis
57  // cosinus of module tilt measured w.r.t. beam axis (+-1=endcap), tk layout measures w.r.t. radial axis
59  // layer id [barrel: 0-5, endcap: 0-4]
60  const int layer =
61  (barrel_ ? trackerTopology->layer(detId) : trackerTopology->tidWheel(detId)) - setup->offsetLayerId();
62  // layer id [1-6,11-15]
63  layerId_ = layer + setup->offsetLayerId() + (barrel_ ? 0 : setup->offsetLayerDisks());
64  // TTStub row needs flip of sign
65  signRow_ = signbit(deltaPhi(plane.rotation().x().phi() - pos0.phi()));
66  // TTStub col needs flip of sign
67  signCol_ = !barrel_ && !side_;
68  // TTStub bend needs flip of sign
69  signBend_ = barrel_ || (!barrel_ && side_);
70  // determing sensor type
71  if (barrel_ && psModule_)
72  type_ = BarrelPS;
73  if (barrel_ && !psModule_)
74  type_ = Barrel2S;
75  if (!barrel_ && psModule_)
76  type_ = DiskPS;
77  if (!barrel_ && !psModule_)
78  type_ = Disk2S;
79  // encoding for 2S endcap radii
80  encodedR_ = -1;
81  if (type_ == Disk2S) {
82  const int offset = setup->hybridNumRingsPS(layer);
83  const int ring = trackerTopology->tidRing(detId);
85  }
86  // r and z offsets
87  if (barrel_) {
88  offsetR_ = setup->hybridLayerR(layer);
89  offsetZ_ = 0.;
90  } else {
91  offsetR_ = 0.;
92  offsetZ_ = side_ ? setup->hybridDiskZ(layer) : -setup->hybridDiskZ(layer);
93  }
94  const TypeTilt typeTilt = static_cast<TypeTilt>(trackerTopology->tobSide(detId));
95  // getting bend window size
96  double windowSize(-1.);
97  if (barrel_) {
98  if (typeTilt == flat)
99  windowSize = setup->windowSizeBarrelLayer(layerId_);
100  else {
101  int ladder = trackerTopology->tobRod(detId);
102  if (typeTilt == tiltedMinus)
103  // Corrected ring number, bet 0 and barrelNTilt.at(layer), in ascending |z|
104  ladder = 1 + setup->numTiltedLayerRing(layerId_) - ladder;
105  windowSize = setup->windowSizeTiltedLayerRing(layerId_, ladder);
106  }
107  } else {
108  const int ring = trackerTopology->tidRing(detId);
109  const int lay = layer + setup->offsetLayerId();
110  windowSize = setup->windowSizeEndcapDisksRing(lay, ring);
111  }
112  windowSize_ = windowSize / setup->baseWindowSize();
113  // calculate tilt correction parameter used to project r to z uncertainty
114  tiltCorrectionSlope_ = barrel_ ? 0. : 1.;
115  tiltCorrectionIntercept_ = barrel_ ? 1. : 0.;
116  if (typeTilt == tiltedMinus || typeTilt == tiltedPlus) {
117  tiltCorrectionSlope_ = setup->tiltApproxSlope();
118  tiltCorrectionIntercept_ = setup->tiltApproxIntercept();
119  }
120  }
double tiltCorrectionIntercept_
Definition: SensorModule.h:134
T perp() const
Definition: PV3DBase.h:69
unsigned int tobSide(const DetId &id) const
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
T z() const
Definition: PV3DBase.h:61
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
unsigned int tidWheel(const DetId &id) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Definition: Plane.h:16
unsigned int layer(const DetId &id) const
int modId() const
Definition: SensorModule.h:23
Basic3DVector< T > x() const
double tiltCorrectionSlope_
Definition: SensorModule.h:132
ModuleType getDetectorType(DetId) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
T mag() const
Definition: PV3DBase.h:64
int dtcId() const
Definition: SensorModule.h:21
DetId partnerDetId(const DetId &id) const
static constexpr auto TOB
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
unsigned int tobRod(const DetId &id) const
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
int windowSize() const
Definition: SensorModule.h:69
static int position[264][3]
Definition: ReadPGInfo.cc:289
double deltaPhi(double lhs, double rhs=0.)
Definition: Setup.h:37
unsigned int tidRing(const DetId &id) const
const RotationType & rotation() const
Geom::Phi< T > phi() const
MPlex< T, D1, D2, N > atan2(const MPlex< T, D1, D2, N > &y, const MPlex< T, D1, D2, N > &x)
Definition: Matriplex.h:648

◆ ~SensorModule()

tt::SensorModule::~SensorModule ( )
inline

Definition at line 14 of file SensorModule.h.

14 {}

Member Function Documentation

◆ barrel()

bool tt::SensorModule::barrel ( ) const
inline

Definition at line 27 of file SensorModule.h.

References barrel_.

27 { return barrel_; }

◆ cosTilt()

double tt::SensorModule::cosTilt ( ) const
inline

Definition at line 61 of file SensorModule.h.

References cosTilt_.

61 { return cosTilt_; }

◆ dtcId()

int tt::SensorModule::dtcId ( ) const
inline

Definition at line 21 of file SensorModule.h.

References dtcId_.

21 { return dtcId_; }

◆ encodedR()

int tt::SensorModule::encodedR ( ) const
inline

Definition at line 63 of file SensorModule.h.

References encodedR_.

63 { return encodedR_; }

◆ flipped()

bool tt::SensorModule::flipped ( ) const
inline

Definition at line 31 of file SensorModule.h.

References flipped_.

31 { return flipped_; }

◆ layerId()

int tt::SensorModule::layerId ( ) const
inline

Definition at line 43 of file SensorModule.h.

References layerId_.

Referenced by trackerDTC::Stub::formatTMTT().

43 { return layerId_; }

◆ modId()

int tt::SensorModule::modId ( ) const
inline

Definition at line 23 of file SensorModule.h.

References modId_.

23 { return modId_; }

◆ numColumns()

int tt::SensorModule::numColumns ( ) const
inline

Definition at line 39 of file SensorModule.h.

References numColumns_.

39 { return numColumns_; }

◆ numRows()

int tt::SensorModule::numRows ( ) const
inline

Definition at line 41 of file SensorModule.h.

References numRows_.

41 { return numRows_; }

◆ offsetR()

double tt::SensorModule::offsetR ( ) const
inline

Definition at line 65 of file SensorModule.h.

References offsetR_.

65 { return offsetR_; }

◆ offsetZ()

double tt::SensorModule::offsetZ ( ) const
inline

Definition at line 67 of file SensorModule.h.

References offsetZ_.

67 { return offsetZ_; }

◆ phi()

double tt::SensorModule::phi ( void  ) const
inline

◆ pitchCol()

double tt::SensorModule::pitchCol ( ) const
inline

Definition at line 55 of file SensorModule.h.

References pitchCol_.

55 { return pitchCol_; }

◆ pitchRow()

double tt::SensorModule::pitchRow ( ) const
inline

Definition at line 53 of file SensorModule.h.

References pitchRow_.

53 { return pitchRow_; }

◆ psModule()

bool tt::SensorModule::psModule ( ) const
inline

Definition at line 29 of file SensorModule.h.

References psModule_.

29 { return psModule_; }

◆ r()

double tt::SensorModule::r ( ) const
inline

Definition at line 45 of file SensorModule.h.

References r_.

Referenced by trklet::TrackletLUT::getSensorModules(), and trackerTFP::LayerEncoding::LayerEncoding().

45 { return r_; }

◆ ringId()

unsigned int tt::SensorModule::ringId ( const Setup setup) const

Definition at line 122 of file SensorModule.cc.

References barrel_, detId_, flat, TrackerTopology::layer(), nonBarrel, singleTopDQM_cfi::setup, TrackerTopology::tidRing(), tiltedMinus, tiltedPlus, TrackerTopology::tobRod(), and TrackerTopology::tobSide().

122  {
123  // In barrel PS: Tilted module ring no. (Increasing 1 to 12 as |z| increases)
124  // In barrel 2S: 0
125  // In disk: Endcap module ring number (1-15) in endcap disks
126 
127  // See https://github.com/cms-sw/cmssw/tree/master/Geometry/TrackerNumberingBuilder
128  const TrackerTopology* trackerTopology = setup->trackerTopology();
129  enum TypeBarrel { nonBarrel = 0, tiltedMinus = 1, tiltedPlus = 2, flat = 3 };
130  const TypeBarrel type = static_cast<TypeBarrel>(trackerTopology->tobSide(detId_));
131  bool tiltedBarrel = barrel_ && (type == tiltedMinus || type == tiltedPlus);
132  unsigned int ringId = 0;
133  // Tilted module ring no. (Increasing 1 to 12 as |z| increases).
134  if (tiltedBarrel) {
135  ringId = trackerTopology->tobRod(detId_);
136  if (type == tiltedMinus) {
137  unsigned int layp1 = trackerTopology->layer(detId_);
138  unsigned int nTilted = setup->numTiltedLayerRing(layp1);
139  ringId = 1 + nTilted - ringId;
140  }
141  } else {
142  ringId = barrel_ ? 0 : trackerTopology->tidRing(detId_);
143  }
144  return ringId;
145  }
unsigned int tobSide(const DetId &id) const
unsigned int layer(const DetId &id) const
unsigned int tobRod(const DetId &id) const
unsigned int tidRing(const DetId &id) const
unsigned int ringId(const Setup *setup) const

◆ sep()

double tt::SensorModule::sep ( ) const
inline

Definition at line 51 of file SensorModule.h.

References sep_.

51 { return sep_; }

◆ side()

bool tt::SensorModule::side ( ) const
inline

Definition at line 25 of file SensorModule.h.

References side_.

25 { return side_; }

◆ signBend()

bool tt::SensorModule::signBend ( ) const
inline

Definition at line 37 of file SensorModule.h.

References signBend_.

37 { return signBend_; }

◆ signCol()

bool tt::SensorModule::signCol ( ) const
inline

Definition at line 35 of file SensorModule.h.

References signCol_.

35 { return signCol_; }

◆ signRow()

bool tt::SensorModule::signRow ( ) const
inline

Definition at line 33 of file SensorModule.h.

References signRow_.

33 { return signRow_; }

◆ sinTilt()

double tt::SensorModule::sinTilt ( ) const
inline

Definition at line 59 of file SensorModule.h.

References sinTilt_.

59 { return sinTilt_; }

◆ tilt()

double tt::SensorModule::tilt ( ) const
inline

Definition at line 57 of file SensorModule.h.

References tilt_.

57 { return tilt_; }

◆ tiltCorrection()

double tt::SensorModule::tiltCorrection ( double  cot) const
inline

Definition at line 71 of file SensorModule.h.

References funct::abs(), tiltCorrectionIntercept_, and tiltCorrectionSlope_.

double tiltCorrectionIntercept_
Definition: SensorModule.h:134
double tiltCorrectionSlope_
Definition: SensorModule.h:132
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ type()

Type tt::SensorModule::type ( ) const
inline

Definition at line 19 of file SensorModule.h.

References type_.

Referenced by trackerDTC::Stub::formatHybrid().

19 { return type_; }

◆ windowSize()

int tt::SensorModule::windowSize ( ) const
inline

Definition at line 69 of file SensorModule.h.

References windowSize_.

Referenced by SensorModule().

69 { return windowSize_; }

◆ z()

double tt::SensorModule::z ( ) const
inline

Member Data Documentation

◆ barrel_

bool tt::SensorModule::barrel_
private

Definition at line 86 of file SensorModule.h.

Referenced by barrel(), ringId(), and SensorModule().

◆ cosTilt_

double tt::SensorModule::cosTilt_
private

Definition at line 120 of file SensorModule.h.

Referenced by cosTilt(), and SensorModule().

◆ detId_

DetId tt::SensorModule::detId_
private

Definition at line 78 of file SensorModule.h.

Referenced by ringId().

◆ dtcId_

int tt::SensorModule::dtcId_
private

Definition at line 80 of file SensorModule.h.

Referenced by dtcId(), and SensorModule().

◆ encodedR_

int tt::SensorModule::encodedR_
private

Definition at line 124 of file SensorModule.h.

Referenced by encodedR(), and SensorModule().

◆ flipped_

bool tt::SensorModule::flipped_
private

Definition at line 90 of file SensorModule.h.

Referenced by flipped(), and SensorModule().

◆ layerId_

int tt::SensorModule::layerId_
private

Definition at line 102 of file SensorModule.h.

Referenced by layerId(), and SensorModule().

◆ modId_

int tt::SensorModule::modId_
private

Definition at line 82 of file SensorModule.h.

Referenced by modId().

◆ numColumns_

int tt::SensorModule::numColumns_
private

Definition at line 98 of file SensorModule.h.

Referenced by numColumns(), and SensorModule().

◆ numRows_

int tt::SensorModule::numRows_
private

Definition at line 100 of file SensorModule.h.

Referenced by numRows(), and SensorModule().

◆ offsetR_

double tt::SensorModule::offsetR_
private

Definition at line 126 of file SensorModule.h.

Referenced by offsetR(), and SensorModule().

◆ offsetZ_

double tt::SensorModule::offsetZ_
private

Definition at line 128 of file SensorModule.h.

Referenced by offsetZ(), and SensorModule().

◆ phi_

double tt::SensorModule::phi_
private

Definition at line 106 of file SensorModule.h.

Referenced by phi(), and SensorModule().

◆ pitchCol_

double tt::SensorModule::pitchCol_
private

Definition at line 114 of file SensorModule.h.

Referenced by pitchCol(), and SensorModule().

◆ pitchRow_

double tt::SensorModule::pitchRow_
private

Definition at line 112 of file SensorModule.h.

Referenced by pitchRow(), and SensorModule().

◆ psModule_

bool tt::SensorModule::psModule_
private

Definition at line 88 of file SensorModule.h.

Referenced by psModule(), and SensorModule().

◆ r_

double tt::SensorModule::r_
private

Definition at line 104 of file SensorModule.h.

Referenced by r(), and SensorModule().

◆ sep_

double tt::SensorModule::sep_
private

Definition at line 110 of file SensorModule.h.

Referenced by SensorModule(), and sep().

◆ side_

bool tt::SensorModule::side_
private

Definition at line 84 of file SensorModule.h.

Referenced by SensorModule(), and side().

◆ signBend_

bool tt::SensorModule::signBend_
private

Definition at line 96 of file SensorModule.h.

Referenced by SensorModule(), and signBend().

◆ signCol_

bool tt::SensorModule::signCol_
private

Definition at line 94 of file SensorModule.h.

Referenced by SensorModule(), and signCol().

◆ signRow_

bool tt::SensorModule::signRow_
private

Definition at line 92 of file SensorModule.h.

Referenced by SensorModule(), and signRow().

◆ sinTilt_

double tt::SensorModule::sinTilt_
private

Definition at line 118 of file SensorModule.h.

Referenced by SensorModule(), and sinTilt().

◆ tilt_

double tt::SensorModule::tilt_
private

Definition at line 116 of file SensorModule.h.

Referenced by SensorModule(), and tilt().

◆ tiltCorrectionIntercept_

double tt::SensorModule::tiltCorrectionIntercept_
private

Definition at line 134 of file SensorModule.h.

Referenced by SensorModule(), and tiltCorrection().

◆ tiltCorrectionSlope_

double tt::SensorModule::tiltCorrectionSlope_
private

Definition at line 132 of file SensorModule.h.

Referenced by SensorModule(), and tiltCorrection().

◆ type_

Type tt::SensorModule::type_
private

◆ windowSize_

int tt::SensorModule::windowSize_
private

Definition at line 130 of file SensorModule.h.

Referenced by SensorModule(), and windowSize().

◆ z_

double tt::SensorModule::z_
private

Definition at line 108 of file SensorModule.h.

Referenced by SensorModule(), and z().