CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DTTrigGeomUtils Class Reference

#include <DTTrigGeomUtils.h>

Public Member Functions

void computeSCCoordinates (const DTRecSegment4D *track, int &scsec, float &x, float &xdir, float &y, float &ydir)
 Compute track coordinates with SC sector numbering. More...
 
 DTTrigGeomUtils (edm::ESHandle< DTGeometry > muonGeom, bool dirInDeg=true)
 Constructor. More...
 
bool hasPosRF (int wh, int sec)
 Checks id the chamber has positive RF;. More...
 
void phiRange (const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
 Compute phi range in local chamber coordinates. More...
 
void thetaRange (const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
 Compute theta range in local chamber coordinates. More...
 
float trigDir (const L1MuDTChambPhDigi *trig)
 Return local direction (trigger RF) for a given trigger primitive. More...
 
float trigPos (const L1MuDTChambPhDigi *trig)
 Return local position (trigger RF) for a given trigger primitive. More...
 
void trigToSeg (int st, float &x, float dir)
 Compute Trigger x coordinate in chamber RF. More...
 
virtual ~DTTrigGeomUtils ()
 Destructor. More...
 

Private Attributes

edm::ESHandle< DTGeometrymuonGeom_
 
float radToDeg_
 
float xCenter_ [2]
 
float zcn_ [4]
 

Detailed Description

Definition at line 21 of file DTTrigGeomUtils.h.

Constructor & Destructor Documentation

◆ DTTrigGeomUtils()

DTTrigGeomUtils::DTTrigGeomUtils ( edm::ESHandle< DTGeometry muonGeom,
bool  dirInDeg = true 
)

Constructor.

Definition at line 30 of file DTTrigGeomUtils.cc.

30  : muonGeom_(muonGeom) {
31  radToDeg_ = dirInDeg ? 180. / Geom::pi() : 1;
32 
33  for (int ist = 1; ist <= 4; ++ist) {
34  const DTChamberId chId(-2, ist, 4);
35  const DTChamber* chamb = muonGeom_->chamber(chId);
36  const DTSuperLayer* sl1 = chamb->superLayer(DTSuperLayerId(chId, 1));
37  const DTSuperLayer* sl3 = chamb->superLayer(DTSuperLayerId(chId, 3));
38  zcn_[ist - 1] =
39  .5 * (chamb->surface().toLocal(sl1->position()).z() + chamb->surface().toLocal(sl3->position()).z());
40  }
41 
42  const DTChamber* chamb = muonGeom_->chamber(DTChamberId(-2, 4, 13));
43  const DTChamber* scchamb = muonGeom_->chamber(DTChamberId(-2, 4, 4));
44  xCenter_[0] = scchamb->toLocal(chamb->position()).x() * .5;
45  chamb = muonGeom_->chamber(DTChamberId(-2, 4, 14));
46  scchamb = muonGeom_->chamber(DTChamberId(-2, 4, 10));
47  xCenter_[1] = scchamb->toLocal(chamb->position()).x() * .5;
48 }

References DTGeometry::chamber(), muonGeom_, Geom::pi(), GeomDet::position(), radToDeg_, DTChamber::superLayer(), GeomDet::surface(), GeomDet::toLocal(), GloballyPositioned< T >::toLocal(), x, xCenter_, z, and zcn_.

◆ ~DTTrigGeomUtils()

DTTrigGeomUtils::~DTTrigGeomUtils ( )
virtual

Destructor.

Definition at line 50 of file DTTrigGeomUtils.cc.

50 {}

Member Function Documentation

◆ computeSCCoordinates()

void DTTrigGeomUtils::computeSCCoordinates ( const DTRecSegment4D track,
int &  scsec,
float &  x,
float &  xdir,
float &  y,
float &  ydir 
)

Compute track coordinates with SC sector numbering.

Definition at line 52 of file DTTrigGeomUtils.cc.

53  {
54  int sector = track->chamberId().sector();
55  int station = track->chamberId().station();
56  xdir = atan(track->localDirection().x() / track->localDirection().z()) * radToDeg_;
57  ydir = atan(track->localDirection().y() / track->localDirection().z()) * radToDeg_;
58 
59  scsec = sector > 12 ? sector == 13 ? 4 : 10 : sector;
60  float xcenter = (scsec == 4 || scsec == 10)
61  ? (sector - 12.9) / abs(sector - 12.9) * xCenter_[(sector == 10 || sector == 14)]
62  : 0.;
63  x = track->localPosition().x() + xcenter * (station == 4);
64  y = track->localPosition().y();
65 }

References funct::abs(), radToDeg_, relativeConstraints::station, HLT_FULL_cff::track, x, xCenter_, xdir, y, and ydir.

Referenced by DTLocalTriggerLutTask::analyze(), DTTriggerEfficiencyTask::analyze(), and DTLocalTriggerTask::runSegmentAnalysis().

◆ hasPosRF()

bool DTTrigGeomUtils::hasPosRF ( int  wh,
int  sec 
)
inline

Checks id the chamber has positive RF;.

Definition at line 48 of file DTTrigGeomUtils.h.

48 { return wh > 0 || (wh == 0 && sec % 4 > 1); };

Referenced by trigDir(), and trigPos().

◆ phiRange()

void DTTrigGeomUtils::phiRange ( const DTChamberId id,
float &  min,
float &  max,
int &  nbins,
float  step = 15 
)

Compute phi range in local chamber coordinates.

Definition at line 67 of file DTTrigGeomUtils.cc.

67  {
68  int station = id.station();
69  int sector = id.sector();
70 
71  const DTLayer* layer = muonGeom_->layer(DTLayerId(id, 1, 1));
72  const DTTopology& topo = layer->specificTopology();
73  double range = topo.channels() * topo.cellWidth();
74  min = -range * .5;
75  max = range * .5;
76 
77  if (station == 4 && (sector == 4 || sector == 10)) {
78  min = -range - 10;
79  max = range + 10;
80  }
81  nbins = static_cast<int>((max - min) / step);
82 
83  return;
84 }

References DTTopology::cellWidth(), DTTopology::channels(), DTGeometry::layer(), phase1PixelTopology::layer, SiStripPI::max, min(), muonGeom_, LaserClient_cfi::nbins, FastTimerService_cff::range, and relativeConstraints::station.

Referenced by DTTriggerEfficiencyTask::bookChamberHistos(), DTLocalTriggerEfficiencyTest::bookChambHistos(), DTLocalTriggerTask::bookHistos(), and DTLocalTriggerBaseTask::bookHistos().

◆ thetaRange()

void DTTrigGeomUtils::thetaRange ( const DTChamberId id,
float &  min,
float &  max,
int &  nbins,
float  step = 15 
)

Compute theta range in local chamber coordinates.

Definition at line 86 of file DTTrigGeomUtils.cc.

86  {
87  const DTLayer* layer = muonGeom_->layer(DTLayerId(id, 2, 1));
88  const DTTopology& topo = layer->specificTopology();
89  double range = topo.channels() * topo.cellWidth();
90  min = -range * .5;
91  max = range * .5;
92 
93  nbins = static_cast<int>((max - min) / step);
94 
95  return;
96 }

References DTTopology::cellWidth(), DTTopology::channels(), DTGeometry::layer(), phase1PixelTopology::layer, SiStripPI::max, min(), muonGeom_, LaserClient_cfi::nbins, and FastTimerService_cff::range.

Referenced by DTLocalTriggerEfficiencyTest::bookChambHistos(), and DTLocalTriggerTask::bookHistos().

◆ trigDir()

float DTTrigGeomUtils::trigDir ( const L1MuDTChambPhDigi trig)

Return local direction (trigger RF) for a given trigger primitive.

Definition at line 138 of file DTTrigGeomUtils.cc.

138  {
139  int wh = trig->whNum();
140  int sec = trig->scNum() + 1;
141  int phi = trig->phi();
142  int phib = trig->phiB();
143 
144  float dir = (phib / 512. + phi / 4096.) * radToDeg_;
145 
146  // change sign in case of negative wheels
147  if (!hasPosRF(wh, sec)) {
148  dir = -dir;
149  }
150 
151  return dir;
152 }

References DeadROC_duringRun::dir, hasPosRF(), phi, radToDeg_, fileinputsource_cfi::sec, and ClusterTask_cfi::trig.

Referenced by DTLocalTriggerLutTask::analyze(), DTLocalTriggerTask::runSegmentAnalysis(), DTLocalTriggerBaseTask::runTMAnalysis(), and DTLocalTriggerTask::runTMAnalysis().

◆ trigPos()

float DTTrigGeomUtils::trigPos ( const L1MuDTChambPhDigi trig)

Return local position (trigger RF) for a given trigger primitive.

Definition at line 98 of file DTTrigGeomUtils.cc.

98  {
99  int wh = trig->whNum();
100  int sec = trig->scNum() + 1;
101  int st = trig->stNum();
102  int phi = trig->phi();
103 
104  float phin = (sec - 1) * Geom::pi() / 6;
105  float phicenter = 0;
106  float r = 0;
107  float xcenter = 0;
108 
109  if (sec == 4 && st == 4) {
110  GlobalPoint gpos = phi > 0 ? muonGeom_->chamber(DTChamberId(wh, st, 13))->position()
111  : muonGeom_->chamber(DTChamberId(wh, st, 4))->position();
112  xcenter = phi > 0 ? xCenter_[0] : -xCenter_[0];
113  phicenter = gpos.phi();
114  r = gpos.perp();
115  } else if (sec == 10 && st == 4) {
116  GlobalPoint gpos = phi > 0 ? muonGeom_->chamber(DTChamberId(wh, st, 14))->position()
117  : muonGeom_->chamber(DTChamberId(wh, st, 10))->position();
118  xcenter = phi > 0 ? xCenter_[1] : -xCenter_[1];
119  phicenter = gpos.phi();
120  r = gpos.perp();
121  } else {
122  GlobalPoint gpos = muonGeom_->chamber(DTChamberId(wh, st, sec))->position();
123  phicenter = gpos.phi();
124  r = gpos.perp();
125  }
126 
127  float deltaphi = phicenter - phin;
128  float x = (tan(phi / 4096.) - tan(deltaphi)) *
129  (r * cos(deltaphi) - zcn_[st - 1]); //zcn is in local coordinates -> z invreases approching to vertex
130  if (hasPosRF(wh, sec)) {
131  x = -x;
132  } // change sign in case of positive wheels
133  x += xcenter;
134 
135  return x;
136 }

References DTGeometry::chamber(), funct::cos(), hasPosRF(), muonGeom_, PV3DBase< T, PVType, FrameType >::perp(), phi, PV3DBase< T, PVType, FrameType >::phi(), Geom::pi(), GeomDet::position(), alignCSCRings::r, fileinputsource_cfi::sec, funct::tan(), ClusterTask_cfi::trig, x, xCenter_, and zcn_.

Referenced by DTLocalTriggerLutTask::analyze(), DTLocalTriggerTask::runSegmentAnalysis(), DTLocalTriggerBaseTask::runTMAnalysis(), and DTLocalTriggerTask::runTMAnalysis().

◆ trigToSeg()

void DTTrigGeomUtils::trigToSeg ( int  st,
float &  x,
float  dir 
)
inline

Compute Trigger x coordinate in chamber RF.

Definition at line 45 of file DTTrigGeomUtils.h.

45 { x -= tan(dir / radToDeg_) * zcn_[st - 1]; };

References DeadROC_duringRun::dir, radToDeg_, funct::tan(), x, and zcn_.

Referenced by DTLocalTriggerLutTask::analyze(), and DTLocalTriggerTask::runSegmentAnalysis().

Member Data Documentation

◆ muonGeom_

edm::ESHandle<DTGeometry> DTTrigGeomUtils::muonGeom_
private

Definition at line 48 of file DTTrigGeomUtils.h.

Referenced by DTTrigGeomUtils(), phiRange(), thetaRange(), and trigPos().

◆ radToDeg_

float DTTrigGeomUtils::radToDeg_
private

Definition at line 53 of file DTTrigGeomUtils.h.

Referenced by computeSCCoordinates(), DTTrigGeomUtils(), trigDir(), and trigToSeg().

◆ xCenter_

float DTTrigGeomUtils::xCenter_[2]
private

Definition at line 54 of file DTTrigGeomUtils.h.

Referenced by computeSCCoordinates(), DTTrigGeomUtils(), and trigPos().

◆ zcn_

float DTTrigGeomUtils::zcn_[4]
private

Definition at line 52 of file DTTrigGeomUtils.h.

Referenced by DTTrigGeomUtils(), trigPos(), and trigToSeg().

GeomDet::position
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
DTSuperLayerId
Definition: DTSuperLayerId.h:12
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
DDAxes::y
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11724
DTTrigGeomUtils::xCenter_
float xCenter_[2]
Definition: DTTrigGeomUtils.h:54
step
step
Definition: StallMonitor.cc:94
min
T min(T a, T b)
Definition: MathUtil.h:58
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DTTrigGeomUtils::radToDeg_
float radToDeg_
Definition: DTTrigGeomUtils.h:53
DTChamber
Definition: DTChamber.h:24
DTTrigGeomUtils::muonGeom_
edm::ESHandle< DTGeometry > muonGeom_
Definition: DTTrigGeomUtils.h:48
DTTopology::channels
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:76
DTTrigGeomUtils::zcn_
float zcn_[4]
Definition: DTTrigGeomUtils.h:52
DDAxes::x
DTSuperLayer
Definition: DTSuperLayer.h:24
DTTopology::cellWidth
float cellWidth() const
Returns the cell width.
Definition: DTTopology.h:69
DTGeometry::chamber
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:90
ydir
Definition: DeviationsFromFileSensor2D.cc:15
DTTopology
Definition: DTTopology.h:28
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDAxes::z
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
Geom::pi
constexpr double pi()
Definition: Pi.h:31
Point3DBase< float, GlobalTag >
GeomDet::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
DTLayerId
Definition: DTLayerId.h:12
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
DTGeometry::layer
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
xdir
Definition: DeviationsFromFileSensor2D.cc:15
ClusterTask_cfi.trig
trig
Definition: ClusterTask_cfi.py:398
DTLayer
Definition: DTLayer.h:25
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:94
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DDAxes::phi
GloballyPositioned::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition: GloballyPositioned.h:98
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DTChamberId
Definition: DTChamberId.h:14
DTChamber::superLayer
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return the superlayer corresponding to the given id.
Definition: DTChamber.cc:53
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
DTTrigGeomUtils::hasPosRF
bool hasPosRF(int wh, int sec)
Checks id the chamber has positive RF;.
Definition: DTTrigGeomUtils.h:48