CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Attributes
trackerDTC::SensorModule Class Reference

#include <SensorModule.h>

Public Types

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

Public Member Functions

bool barrel () const
 
double cos () const
 
int dtcId () const
 
int encodedLayerId () 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
 
 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 sin () const
 
double tilt () const
 
Type type () const
 
int windowSize () const
 
double z () const
 
 ~SensorModule ()
 

Private Attributes

bool barrel_
 
double cos_
 
DetId detId_
 
int dtcId_
 
int encodedLayerId_
 
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 sin_
 
double tilt_
 
Type type_
 
int windowSize_
 
double z_
 

Detailed Description

Definition at line 11 of file SensorModule.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 15 of file SensorModule.cc.

References Barrel2S, barrel_, BarrelPS, trackerDTC::Setup::baseRegion(), trackerDTC::Setup::baseWindowSize(), funct::cos(), cos_, trackerDTC::deltaPhi(), Disk2S, DiskPS, HLT_FULL_cff::distance, dtcId_, encodedLayerId_, encodedR_, trackerDTC::Setup::encodingLayerId(), spr::find(), flipped_, TrackerGeometry::getDetectorType(), trackerDTC::Setup::hybridDiskZ(), trackerDTC::Setup::hybridLayerR(), trackerDTC::Setup::hybridNumRingsPS(), TrackerGeometry::idToDetUnit(), PVValHelper::ladder, phase1PixelTopology::layer, TrackerTopology::layer(), layerId_, PV3DBase< T, PVType, FrameType >::mag(), mag(), PixelTopology::ncolumns(), PixelTopology::nrows(), numColumns_, trackerDTC::Setup::numDTCsPerRegion(), numRows_, trackerDTC::Setup::numTiltedLayerRing(), hltrates_dqm_sourceclient-live_cfg::offset, trackerDTC::Setup::offsetLayerDisks(), trackerDTC::Setup::offsetLayerId(), offsetR_, offsetZ_, TrackerTopology::partnerDetId(), PV3DBase< T, PVType, FrameType >::perp(), TrackerGeometry::Ph2PSP, PV3DBase< T, PVType, FrameType >::phi(), Basic3DVector< T >::phi(), phi_, PixelTopology::pitch(), pitchCol_, pitchRow_, GeomDet::position(), position, psModule_, r_, HLT_FULL_cff::region, relativeConstraints::ring, GloballyPositioned< T >::rotation(), sep_, side_, signBend_, signCol_, signRow_, funct::sin(), sin_, DetId::subdetId(), TrackerTopology::tidRing(), TrackerTopology::tidWheel(), tilt_, StripSubdetector::TOB, TrackerTopology::tobRod(), TrackerTopology::tobSide(), trackerDTC::Setup::trackerGeometry(), trackerDTC::Setup::trackerTopology(), type_, windowSize(), windowSize_, trackerDTC::Setup::windowSizeBarrelLayer(), trackerDTC::Setup::windowSizeEndcapDisksRing(), trackerDTC::Setup::windowSizeTiltedLayerRing(), TkRotation< T >::x(), PV3DBase< T, PVType, FrameType >::z(), and z_.

16  : detId_(detId), dtcId_(dtcId), modId_(modId) {
17  const TrackerGeometry* trackerGeometry = setup.trackerGeometry();
18  const TrackerTopology* trackerTopology = setup.trackerTopology();
19  const GeomDetUnit* geomDetUnit = trackerGeometry->idToDetUnit(detId);
20  const PixelTopology* pixelTopology =
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
50  // Pixel-Strip or 2Strip module
52  // module tilt 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
56  sin_ = std::sin(tilt_);
57  // cosinus of module tilt measured w.r.t. beam axis (+-1=endcap), tk layout measures w.r.t. radial axis
58  cos_ = std::cos(tilt_);
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);
84  encodedR_ = numColumns_ * (ring - offset);
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  // getting bend window size
95  double windowSize(-1.);
96  if (barrel_) {
97  enum TypeBarrel { nonBarrel = 0, tiltedMinus = 1, tiltedPlus = 2, flat = 3 };
98  const TypeBarrel type = static_cast<TypeBarrel>(trackerTopology->tobSide(detId));
99  if (type == flat)
100  windowSize = setup.windowSizeBarrelLayer(layerId_);
101  else {
102  int ladder = trackerTopology->tobRod(detId);
103  if (type == tiltedMinus)
104  // Corrected ring number, bet 0 and barrelNTilt.at(layer), in ascending |z|
105  ladder = 1 + setup.numTiltedLayerRing(layerId_) - ladder;
106  windowSize = setup.windowSizeTiltedLayerRing(layerId_, ladder);
107  }
108  } else {
109  const int ring = trackerTopology->tidRing(detId);
110  const int lay = layer + setup.offsetLayerId();
111  windowSize = setup.windowSizeEndcapDisksRing(lay, ring);
112  }
113  windowSize_ = windowSize / setup.baseWindowSize();
114  // getting encoded layer id
115  const vector<int>& encodingLayerId = setup.encodingLayerId(dtcId_);
116  const auto pos = find(encodingLayerId.begin(), encodingLayerId.end(), layerId_);
117  encodedLayerId_ = distance(encodingLayerId.begin(), pos);
118  }
T perp() const
Definition: PV3DBase.h:69
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
unsigned int tidRing(const DetId &id) const
virtual int ncolumns() const =0
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
virtual int nrows() const =0
unsigned int tidWheel(const DetId &id) const
Geom::Phi< T > phi() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Definition: Plane.h:16
double deltaPhi(double lhs, double rhs=0.)
Definition: Setup.h:35
Basic3DVector< T > x() const
DetId partnerDetId(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize > layer
T mag() const
Definition: PV3DBase.h:64
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
T z() const
Definition: PV3DBase.h:61
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
unsigned int tobSide(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
ModuleType getDetectorType(DetId) const
unsigned int layer(const DetId &id) const
static int position[264][3]
Definition: ReadPGInfo.cc:289
const RotationType & rotation() const
virtual std::pair< float, float > pitch() const =0
unsigned int tobRod(const DetId &id) const
trackerDTC::SensorModule::~SensorModule ( )
inline

Definition at line 14 of file SensorModule.h.

14 {}

Member Function Documentation

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

Definition at line 27 of file SensorModule.h.

References barrel_.

27 { return barrel_; }
double trackerDTC::SensorModule::cos ( ) const
inline

Definition at line 61 of file SensorModule.h.

References cos_.

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

61 { return cos_; }
int trackerDTC::SensorModule::dtcId ( ) const
inline

Definition at line 21 of file SensorModule.h.

References dtcId_.

Referenced by trackerDTC::ProducerED::produce().

21 { return dtcId_; }
int trackerDTC::SensorModule::encodedLayerId ( ) const
inline

Definition at line 65 of file SensorModule.h.

References encodedLayerId_.

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

65 { return encodedLayerId_; }
int trackerDTC::SensorModule::encodedR ( ) const
inline

Definition at line 63 of file SensorModule.h.

References encodedR_.

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

63 { return encodedR_; }
bool trackerDTC::SensorModule::flipped ( ) const
inline

Definition at line 31 of file SensorModule.h.

References flipped_.

31 { return flipped_; }
int trackerDTC::SensorModule::layerId ( ) const
inline

Definition at line 43 of file SensorModule.h.

References layerId_.

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

43 { return layerId_; }
int trackerDTC::SensorModule::modId ( ) const
inline

Definition at line 23 of file SensorModule.h.

References modId_.

Referenced by trackerDTC::ProducerED::produce().

23 { return modId_; }
int trackerDTC::SensorModule::numColumns ( ) const
inline

Definition at line 39 of file SensorModule.h.

References numColumns_.

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

39 { return numColumns_; }
int trackerDTC::SensorModule::numRows ( ) const
inline

Definition at line 41 of file SensorModule.h.

References numRows_.

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

41 { return numRows_; }
double trackerDTC::SensorModule::offsetR ( ) const
inline

Definition at line 67 of file SensorModule.h.

References offsetR_.

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

67 { return offsetR_; }
double trackerDTC::SensorModule::offsetZ ( ) const
inline

Definition at line 69 of file SensorModule.h.

References offsetZ_.

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

69 { return offsetZ_; }
double trackerDTC::SensorModule::phi ( void  ) const
inline

Definition at line 47 of file SensorModule.h.

References phi_.

Referenced by Particle.Particle::__str__(), ntupleDataFormat.Track::phiPull(), and trackerDTC::Stub::Stub().

47 { return phi_; }
double trackerDTC::SensorModule::pitchCol ( ) const
inline

Definition at line 55 of file SensorModule.h.

References pitchCol_.

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

55 { return pitchCol_; }
double trackerDTC::SensorModule::pitchRow ( ) const
inline

Definition at line 53 of file SensorModule.h.

References pitchRow_.

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

53 { return pitchRow_; }
bool trackerDTC::SensorModule::psModule ( ) const
inline

Definition at line 29 of file SensorModule.h.

References psModule_.

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

29 { return psModule_; }
double trackerDTC::SensorModule::r ( ) const
inline

Definition at line 45 of file SensorModule.h.

References r_.

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

45 { return r_; }
double trackerDTC::SensorModule::sep ( ) const
inline

Definition at line 51 of file SensorModule.h.

References sep_.

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

51 { return sep_; }
bool trackerDTC::SensorModule::side ( ) const
inline

Definition at line 25 of file SensorModule.h.

References side_.

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

25 { return side_; }
bool trackerDTC::SensorModule::signBend ( ) const
inline

Definition at line 37 of file SensorModule.h.

References signBend_.

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

37 { return signBend_; }
bool trackerDTC::SensorModule::signCol ( ) const
inline

Definition at line 35 of file SensorModule.h.

References signCol_.

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

35 { return signCol_; }
bool trackerDTC::SensorModule::signRow ( ) const
inline

Definition at line 33 of file SensorModule.h.

References signRow_.

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

33 { return signRow_; }
double trackerDTC::SensorModule::sin ( ) const
inline

Definition at line 59 of file SensorModule.h.

References sin_.

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

59 { return sin_; }
double trackerDTC::SensorModule::tilt ( ) const
inline

Definition at line 57 of file SensorModule.h.

References tilt_.

57 { return tilt_; }
Type trackerDTC::SensorModule::type ( ) const
inline

Definition at line 19 of file SensorModule.h.

References type_.

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

19 { return type_; }
int trackerDTC::SensorModule::windowSize ( ) const
inline

Definition at line 71 of file SensorModule.h.

References windowSize_.

Referenced by SensorModule(), and trackerDTC::Stub::Stub().

71 { return windowSize_; }
double trackerDTC::SensorModule::z ( ) const
inline

Definition at line 49 of file SensorModule.h.

References z_.

Referenced by geometryXMLparser.Alignable::pos(), ntupleDataFormat._HitObject::r3D(), and trackerDTC::Stub::Stub().

49 { return z_; }

Member Data Documentation

bool trackerDTC::SensorModule::barrel_
private

Definition at line 83 of file SensorModule.h.

Referenced by barrel(), and SensorModule().

double trackerDTC::SensorModule::cos_
private

Definition at line 117 of file SensorModule.h.

Referenced by cos(), and SensorModule().

DetId trackerDTC::SensorModule::detId_
private

Definition at line 75 of file SensorModule.h.

int trackerDTC::SensorModule::dtcId_
private

Definition at line 77 of file SensorModule.h.

Referenced by dtcId(), and SensorModule().

int trackerDTC::SensorModule::encodedLayerId_
private

Definition at line 123 of file SensorModule.h.

Referenced by encodedLayerId(), and SensorModule().

int trackerDTC::SensorModule::encodedR_
private

Definition at line 121 of file SensorModule.h.

Referenced by encodedR(), and SensorModule().

bool trackerDTC::SensorModule::flipped_
private

Definition at line 87 of file SensorModule.h.

Referenced by flipped(), and SensorModule().

int trackerDTC::SensorModule::layerId_
private

Definition at line 99 of file SensorModule.h.

Referenced by layerId(), and SensorModule().

int trackerDTC::SensorModule::modId_
private

Definition at line 79 of file SensorModule.h.

Referenced by modId().

int trackerDTC::SensorModule::numColumns_
private

Definition at line 95 of file SensorModule.h.

Referenced by numColumns(), and SensorModule().

int trackerDTC::SensorModule::numRows_
private

Definition at line 97 of file SensorModule.h.

Referenced by numRows(), and SensorModule().

double trackerDTC::SensorModule::offsetR_
private

Definition at line 125 of file SensorModule.h.

Referenced by offsetR(), and SensorModule().

double trackerDTC::SensorModule::offsetZ_
private

Definition at line 127 of file SensorModule.h.

Referenced by offsetZ(), and SensorModule().

double trackerDTC::SensorModule::phi_
private

Definition at line 103 of file SensorModule.h.

Referenced by phi(), and SensorModule().

double trackerDTC::SensorModule::pitchCol_
private

Definition at line 111 of file SensorModule.h.

Referenced by pitchCol(), and SensorModule().

double trackerDTC::SensorModule::pitchRow_
private

Definition at line 109 of file SensorModule.h.

Referenced by pitchRow(), and SensorModule().

bool trackerDTC::SensorModule::psModule_
private

Definition at line 85 of file SensorModule.h.

Referenced by psModule(), and SensorModule().

double trackerDTC::SensorModule::r_
private

Definition at line 101 of file SensorModule.h.

Referenced by r(), and SensorModule().

double trackerDTC::SensorModule::sep_
private

Definition at line 107 of file SensorModule.h.

Referenced by SensorModule(), and sep().

bool trackerDTC::SensorModule::side_
private

Definition at line 81 of file SensorModule.h.

Referenced by SensorModule(), and side().

bool trackerDTC::SensorModule::signBend_
private

Definition at line 93 of file SensorModule.h.

Referenced by SensorModule(), and signBend().

bool trackerDTC::SensorModule::signCol_
private

Definition at line 91 of file SensorModule.h.

Referenced by SensorModule(), and signCol().

bool trackerDTC::SensorModule::signRow_
private

Definition at line 89 of file SensorModule.h.

Referenced by SensorModule(), and signRow().

double trackerDTC::SensorModule::sin_
private

Definition at line 115 of file SensorModule.h.

Referenced by SensorModule(), and sin().

double trackerDTC::SensorModule::tilt_
private

Definition at line 113 of file SensorModule.h.

Referenced by SensorModule(), and tilt().

Type trackerDTC::SensorModule::type_
private
int trackerDTC::SensorModule::windowSize_
private

Definition at line 129 of file SensorModule.h.

Referenced by SensorModule(), and windowSize().

double trackerDTC::SensorModule::z_
private

Definition at line 105 of file SensorModule.h.

Referenced by SensorModule(), and z().