CMS 3D CMS Logo

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

#include <DTCalibValidationFromMuons.h>

Inheritance diagram for DTCalibValidationFromMuons:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup) override
 
void dqmBeginRun (const edm::Run &r, const edm::EventSetup &c) override
 BeginRun. More...
 
 DTCalibValidationFromMuons (const edm::ParameterSet &pset)
 Constructor. More...
 
 ~DTCalibValidationFromMuons () override
 Destructor. More...
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Member Functions

void bookHistos (DTSuperLayerId slId, int step)
 
void compute (const DTGeometry *dtGeom, const DTRecSegment4D &segment)
 
void fillHistos (DTSuperLayerId slId, float distance, float residualOnDistance, float position, float residualOnPosition, int step)
 
float recHitDistFromWire (const DTRecHit1DPair &hitPair, const DTLayer *layer)
 
float recHitDistFromWire (const DTRecHit1D &recHit, const DTLayer *layer)
 
float recHitPosition (const DTRecHit1DPair &hitPair, const DTLayer *layer, const DTChamber *chamber, float segmPos, int sl)
 
float recHitPosition (const DTRecHit1D &recHit, const DTLayer *layer, const DTChamber *chamber, float segmPos, int sl)
 

Private Attributes

edm::ESHandle< DTGeometrydtGeom
 
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
 
edm::EDGetTokenT< reco::MuonCollectionmuonToken_
 
int nevent
 
edm::ParameterSet parameters
 
int rightSegment
 
edm::EDGetTokenT< DTRecSegment4DCollectionsegment4DToken_
 
int wrongSegment
 

Detailed Description

Analysis on DT residuals to validate the kFactor

Author
G. Mila - INFN Torino

Definition at line 49 of file DTCalibValidationFromMuons.h.

Constructor & Destructor Documentation

DTCalibValidationFromMuons::DTCalibValidationFromMuons ( const edm::ParameterSet pset)

Constructor.

Definition at line 33 of file DTCalibValidationFromMuons.cc.

References nevent, and muonDTDigis_cfi::pset.

34  {
35 
36  parameters = pset;
37 
38  // the name of the 4D segments
39  segment4DToken_ = consumes<DTRecSegment4DCollection>(edm::InputTag(
40  parameters.getUntrackedParameter<string>("segment4DLabel")));
41  // muon collection for matching 4D segments to muons
42  muonToken_ = consumes<reco::MuonCollection>(
43  edm::InputTag(parameters.getUntrackedParameter<string>("muonLabel")));
44  // the counter of segments not used to compute residuals
45  wrongSegment = 0;
46  // the counter of segments used to compute residuals
47  rightSegment = 0;
48 
49  nevent = 0;
50 }
edm::EDGetTokenT< reco::MuonCollection > muonToken_
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
DTCalibValidationFromMuons::~DTCalibValidationFromMuons ( )
override

Destructor.

Definition at line 52 of file DTCalibValidationFromMuons.cc.

52  {
53 
54  // FR the following was previously in the endJob
55 
56  LogVerbatim("DTCalibValidationFromMuons")
57  << "Segments used to compute residuals: " << rightSegment;
58  LogVerbatim("DTCalibValidationFromMuons")
59  << "Segments not used to compute residuals: " << wrongSegment;
60 }

Member Function Documentation

void DTCalibValidationFromMuons::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 69 of file DTCalibValidationFromMuons.cc.

References bookConverter::compute(), runTauDisplay::dr, MuonSubdetId::DT, PVValHelper::dx, PVValHelper::dy, LogTrace, DetId::Muon, extraflags_cff::muons, nevent, edm::Handle< T >::product(), mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

70  {
71 
72  ++nevent;
73  LogTrace("DTCalibValidationFromMuons")
74  << "[DTCalibValidationFromMuons] Analyze #Run: " << event.id().run()
75  << " #Event: " << nevent;
76 
77  // RecHit mapping at Step 3 ---------------------------------
78  LogTrace("DTCalibValidationFromMuons") << " -- DTRecHit S3: begin analysis:";
79  // Get the 4D rechits from the event
81  event.getByToken(muonToken_, muonH);
82  const vector<reco::Muon> *muons = muonH.product();
83 
84  // Get the 4D rechits from the event
86  event.getByToken(segment4DToken_, segment4Ds);
87 
88  vector<const DTRecSegment4D *> selectedSegment4Ds;
89 
90  for (auto &imuon : *muons) {
91  for (const auto &ch : imuon.matches()) {
92  DetId chId(ch.id.rawId());
93  if (chId.det() != DetId::Muon)
94  continue;
95  if (chId.subdetId() != MuonSubdetId::DT)
96  continue;
97  if (imuon.pt() < 15)
98  continue;
99  if (!imuon.isGlobalMuon())
100  continue;
101 
102  int nsegs = ch.segmentMatches.size();
103  if (!nsegs)
104  continue;
105 
106  // get the DT segments that were used to construct the muon
107  DTChamberId matchId = ch.id();
108  DTRecSegment4DCollection::range segs = segment4Ds->get(matchId);
109  for (DTRecSegment4DCollection::const_iterator segment = segs.first;
110  segment != segs.second; ++segment) {
111  LocalPoint posHit = segment->localPosition();
112  float dx = (posHit.x() ? posHit.x() - ch.x : 0);
113  float dy = (posHit.y() ? posHit.y() - ch.y : 0);
114  float dr = sqrt(dx * dx + dy * dy);
115  if (dr < 5)
116  selectedSegment4Ds.push_back(&(*segment));
117  }
118  }
119  }
120 
121  // Loop over all 4D segments
122  for (auto segment : selectedSegment4Ds) {
123  LogTrace("DTCalibValidationFromMuons") << "Anlysis on recHit at step 3";
124  compute(dtGeom.product(), *segment);
125  }
126 }
edm::ESHandle< DTGeometry > dtGeom
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
T y() const
Definition: PV3DBase.h:63
edm::EDGetTokenT< reco::MuonCollection > muonToken_
void compute(const DTGeometry *dtGeom, const DTRecSegment4D &segment)
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
T sqrt(T t)
Definition: SSEVec.h:18
#define LogTrace(id)
Definition: DetId.h:18
T const * product() const
Definition: Handle.h:74
static constexpr int DT
Definition: MuonSubdetId.h:12
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
T x() const
Definition: PV3DBase.h:62
T const * product() const
Definition: ESHandle.h:86
void DTCalibValidationFromMuons::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 330 of file DTCalibValidationFromMuons.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), plotFactory::histos, LogTrace, DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, cmsPerfCommons::Step, DTSuperLayerId::superlayer(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

332  {
333 
334  // FR substitute the DQMStore instance by ibooker
335  ibooker.setCurrentFolder("DT/DTCalibValidationFromMuons");
336 
337  DTSuperLayerId slId;
338 
339  // Loop over all the chambers
340  vector<const DTChamber *>::const_iterator ch_it = dtGeom->chambers().begin();
341  vector<const DTChamber *>::const_iterator ch_end = dtGeom->chambers().end();
342  for (; ch_it != ch_end; ++ch_it) {
343  vector<const DTSuperLayer *>::const_iterator sl_it =
344  (*ch_it)->superLayers().begin();
345  vector<const DTSuperLayer *>::const_iterator sl_end =
346  (*ch_it)->superLayers().end();
347  // Loop over the SLs
348  for (; sl_it != sl_end; ++sl_it) {
349  slId = (*sl_it)->id();
350 
351  // TODO! fix this is a leftover
352  int firstStep = 3;
353  // Loop over the 3 steps
354  for (int step = firstStep; step <= 3; ++step) {
355 
356  LogTrace("DTCalibValidationFromMuons")
357  << " Booking histos for SL: " << slId;
358 
359  // Compose the chamber name
360  stringstream wheel;
361  wheel << slId.wheel();
362  stringstream station;
363  station << slId.station();
364  stringstream sector;
365  sector << slId.sector();
366  stringstream superLayer;
367  superLayer << slId.superlayer();
368  // Define the step
369  stringstream Step;
370  Step << step;
371 
372  string slHistoName = "_STEP" + Step.str() + "_W" + wheel.str() + "_St" +
373  station.str() + "_Sec" + sector.str() + "_SL" +
374  superLayer.str();
375 
376  ibooker.setCurrentFolder("DT/DTCalibValidationFromMuons/Wheel" +
377  wheel.str() + "/Station" + station.str() +
378  "/Sector" + sector.str());
379  // Create the monitor elements
380  vector<MonitorElement *> histos;
381  // Note the order matters
382  histos.push_back(ibooker.book1D(
383  "hResDist" + slHistoName,
384  "Residuals on the distance from wire (rec_hit - segm_extr) (cm)",
385  200, -0.4, 0.4));
386  histos.push_back(
387  ibooker.book2D("hResDistVsDist" + slHistoName,
388  "Residuals on the distance (cm) from wire (rec_hit "
389  "- segm_extr) vs distance (cm)",
390  100, 0, 2.5, 200, -0.4, 0.4));
391 
392  histosPerSL[make_pair(slId, step)] = histos;
393  }
394  }
395  }
396 }
edm::ESHandle< DTGeometry > dtGeom
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:102
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
#define LogTrace(id)
int superlayer() const
Return the superlayer number (deprecated method name)
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
int sector() const
Definition: DTChamberId.h:61
step
Definition: StallMonitor.cc:94
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
void DTCalibValidationFromMuons::bookHistos ( DTSuperLayerId  slId,
int  step 
)
private
void DTCalibValidationFromMuons::compute ( const DTGeometry dtGeom,
const DTRecSegment4D segment 
)
private

Definition at line 195 of file DTCalibValidationFromMuons.cc.

References relativeConstraints::chamber, DTGeometry::chamber(), popcon2dropbox::copy(), funct::cos(), DTRecSegment4D::dimension(), DTGeometry::layer(), DTRecSegment4D::localDirection(), DTRecSegment4D::localPosition(), LogTrace, DTRecSegment4D::phiSegment(), DTRecSegment2D::specificRecHits(), DTLayer::specificTopology(), DTSuperLayerId::superlayer(), DTLayerId::superlayerId(), PV3DBase< T, PVType, FrameType >::theta(), GeomDet::toGlobal(), GeomDet::toLocal(), DTWireId::wire(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and DTRecSegment4D::zSegment().

196  {
197 
198  bool computeResidual = true;
199 
200  // Get all 1D RecHits at step 3 within the 4D segment
201  vector<DTRecHit1D> recHits1D_S3;
202 
203  // Get 1D RecHits at Step 3 and select only events with
204  // >=7 hits in phi and 4 hits in theta (if any)
205  const DTChamberRecSegment2D *phiSeg = segment.phiSegment();
206  if (phiSeg) {
207  vector<DTRecHit1D> phiRecHits = phiSeg->specificRecHits();
208  if (phiRecHits.size() < 7) {
209  LogTrace("DTCalibValidationFromMuons")
210  << "[DTCalibValidationFromMuons] Phi segments has: "
211  << phiRecHits.size() << " hits, skipping"; // FIXME: info output
212  computeResidual = false;
213  }
214  copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
215  }
216  if (!phiSeg) {
217  LogTrace("DTCalibValidationFromMuons")
218  << " [DTCalibValidationFromMuons] 4D segment has no phi segment! ";
219  computeResidual = false;
220  }
221 
222  if (segment.dimension() == 4) {
223  const DTSLRecSegment2D *zSeg = segment.zSegment();
224  if (zSeg) {
225  vector<DTRecHit1D> zRecHits = zSeg->specificRecHits();
226  if (zRecHits.size() != 4) {
227  LogTrace("DTCalibValidationFromMuons")
228  << "[DTCalibValidationFromMuons] Theta segments has: "
229  << zRecHits.size() << " hits, skipping"; // FIXME: info output
230  computeResidual = false;
231  }
232  copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
233  }
234  if (!zSeg) {
235  LogTrace("DTCalibValidationFromMuons")
236  << " [DTCalibValidationFromMuons] 4D segment has not the z segment! ";
237  computeResidual = false;
238  }
239  }
240 
241  if (!computeResidual)
242  ++wrongSegment;
243 
244  if (computeResidual) {
245  ++rightSegment;
246 
247  // Loop over 1D RecHit inside 4D segment
248  for (vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin();
249  recHit1D != recHits1D_S3.end(); ++recHit1D) {
250  const DTWireId wireId = (*recHit1D).wireId();
251 
252  // Get the layer and the wire position
253  const DTLayer *layer = dtGeom->layer(wireId);
254  float wireX = layer->specificTopology().wirePosition(wireId.wire());
255 
256  // Extrapolate the segment to the z of the wire
257  // Get wire position in chamber RF
258  // (y and z must be those of the hit to be coherent in the transf. of RF
259  // in case of rotations of the layer alignment)
260  LocalPoint wirePosInLay(wireX, (*recHit1D).localPosition().y(),
261  (*recHit1D).localPosition().z());
262  GlobalPoint wirePosGlob = layer->toGlobal(wirePosInLay);
263  const DTChamber *chamber =
264  dtGeom->chamber((*recHit1D).wireId().layerId().chamberId());
265  LocalPoint wirePosInChamber = chamber->toLocal(wirePosGlob);
266 
267  // Segment position at Wire z in chamber local frame
268  LocalPoint segPosAtZWire =
269  segment.localPosition() + segment.localDirection() *
270  wirePosInChamber.z() /
271  cos(segment.localDirection().theta());
272 
273  // Compute the distance of the segment from the wire
274  int sl = wireId.superlayer();
275  float SegmDistance = -1;
276  if (sl == 1 || sl == 3) {
277  // RPhi SL
278  SegmDistance = fabs(wirePosInChamber.x() - segPosAtZWire.x());
279  LogTrace("DTCalibValidationFromMuons")
280  << "SegmDistance: " << SegmDistance;
281  } else if (sl == 2) {
282  // RZ SL
283  SegmDistance = fabs(segPosAtZWire.y() - wirePosInChamber.y());
284  LogTrace("DTCalibValidationFromMuons")
285  << "SegmDistance: " << SegmDistance;
286  }
287 
288  if (SegmDistance > 2.1)
289  LogTrace("DTCalibValidationFromMuons")
290  << " Warning: dist segment-wire: " << SegmDistance;
291 
292  // Compute the distance of the recHit from the wire
293  float recHitWireDist = recHitDistFromWire(*recHit1D, layer);
294  LogTrace("DTCalibValidationFromMuons")
295  << "recHitWireDist: " << recHitWireDist;
296 
297  // Compute the residuals
298  float residualOnDistance = recHitWireDist - SegmDistance;
299  LogTrace("DTCalibValidationFromMuons")
300  << "WireId: " << wireId
301  << " ResidualOnDistance: " << residualOnDistance;
302  float residualOnPosition = -1;
303  float recHitPos = -1;
304  if (sl == 1 || sl == 3) {
305  recHitPos =
306  recHitPosition(*recHit1D, layer, chamber, segPosAtZWire.x(), sl);
307  residualOnPosition = recHitPos - segPosAtZWire.x();
308  } else {
309  recHitPos =
310  recHitPosition(*recHit1D, layer, chamber, segPosAtZWire.y(), sl);
311  residualOnPosition = recHitPos - segPosAtZWire.y();
312  }
313  LogTrace("DTCalibValidationFromMuons")
314  << "WireId: " << wireId
315  << " ResidualOnPosition: " << residualOnPosition;
316 
317  // Fill the histos
318  if (sl == 1 || sl == 3)
319  fillHistos(wireId.superlayerId(), SegmDistance, residualOnDistance,
320  (wirePosInChamber.x() - segPosAtZWire.x()),
321  residualOnPosition, 3);
322  else
323  fillHistos(wireId.superlayerId(), SegmDistance, residualOnDistance,
324  (wirePosInChamber.y() - segPosAtZWire.y()),
325  residualOnPosition, 3);
326  }
327  }
328 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
int dimension() const override
Dimension (in parameter space)
LocalPoint localPosition() const override
Local position in Chamber frame.
def copy(args, dbName)
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:117
LocalVector localDirection() const override
Local direction in Chamber frame.
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
T y() const
Definition: PV3DBase.h:63
void fillHistos(DTSuperLayerId slId, float distance, float residualOnDistance, float position, float residualOnPosition, int step)
float recHitPosition(const DTRecHit1DPair &hitPair, const DTLayer *layer, const DTChamber *chamber, float segmPos, int sl)
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:59
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define LogTrace(id)
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
int wire() const
Return the wire number.
Definition: DTWireId.h:56
int superlayer() const
Return the superlayer number (deprecated method name)
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:127
T x() const
Definition: PV3DBase.h:62
void DTCalibValidationFromMuons::dqmBeginRun ( const edm::Run r,
const edm::EventSetup c 
)
override

BeginRun.

Definition at line 62 of file DTCalibValidationFromMuons.cc.

References edm::EventSetup::get().

63  {
64 
65  // get the geometry
66  setup.get<MuonGeometryRecord>().get(dtGeom);
67 }
edm::ESHandle< DTGeometry > dtGeom
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
void DTCalibValidationFromMuons::fillHistos ( DTSuperLayerId  slId,
float  distance,
float  residualOnDistance,
float  position,
float  residualOnPosition,
int  step 
)
private

Definition at line 399 of file DTCalibValidationFromMuons.cc.

References plotFactory::histos.

403  {
404  // FIXME: optimization of the number of searches
405  vector<MonitorElement *> histos = histosPerSL[make_pair(slId, step)];
406  histos[0]->Fill(residualOnDistance);
407  histos[1]->Fill(distance, residualOnDistance);
408 }
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
step
Definition: StallMonitor.cc:94
float DTCalibValidationFromMuons::recHitDistFromWire ( const DTRecHit1DPair hitPair,
const DTLayer layer 
)
private

Definition at line 129 of file DTCalibValidationFromMuons.cc.

References DTEnums::Left, DTRecHit1DPair::localPosition(), DTEnums::Right, and PV3DBase< T, PVType, FrameType >::x().

130  {
131  return fabs(hitPair.localPosition(DTEnums::Left).x() -
132  hitPair.localPosition(DTEnums::Right).x()) /
133  2.;
134 }
LocalPoint localPosition() const override
T x() const
Definition: PV3DBase.h:62
float DTCalibValidationFromMuons::recHitDistFromWire ( const DTRecHit1D recHit,
const DTLayer layer 
)
private

Definition at line 137 of file DTCalibValidationFromMuons.cc.

References DTRecHit1D::localPosition(), DTLayer::specificTopology(), DTWireId::wire(), DTRecHit1D::wireId(), DTTopology::wirePosition(), and PV3DBase< T, PVType, FrameType >::x().

138  {
139  return fabs(recHit.localPosition().x() -
140  layer->specificTopology().wirePosition(recHit.wireId().wire()));
141 }
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:60
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
int wire() const
Return the wire number.
Definition: DTWireId.h:56
T x() const
Definition: PV3DBase.h:62
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:107
float DTCalibValidationFromMuons::recHitPosition ( const DTRecHit1DPair hitPair,
const DTLayer layer,
const DTChamber chamber,
float  segmPos,
int  sl 
)
private

Definition at line 144 of file DTCalibValidationFromMuons.cc.

References DTEnums::Left, DTRecHit1DPair::localPosition(), DTEnums::Right, GeomDet::toGlobal(), GeomDet::toLocal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

147  {
148 
149  // Get the layer and the wire position
150  GlobalPoint hitPosGlob_right =
151  layer->toGlobal(hitPair.localPosition(DTEnums::Right));
152  LocalPoint hitPosInChamber_right = chamber->toLocal(hitPosGlob_right);
153  GlobalPoint hitPosGlob_left =
154  layer->toGlobal(hitPair.localPosition(DTEnums::Left));
155  LocalPoint hitPosInChamber_left = chamber->toLocal(hitPosGlob_left);
156 
157  float recHitPos = -1;
158  if (sl != 2) {
159  if (fabs(hitPosInChamber_left.x() - segmentPos) <
160  fabs(hitPosInChamber_right.x() - segmentPos))
161  recHitPos = hitPosInChamber_left.x();
162  else
163  recHitPos = hitPosInChamber_right.x();
164  } else {
165  if (fabs(hitPosInChamber_left.y() - segmentPos) <
166  fabs(hitPosInChamber_right.y() - segmentPos))
167  recHitPos = hitPosInChamber_left.y();
168  else
169  recHitPos = hitPosInChamber_right.y();
170  }
171 
172  return recHitPos;
173 }
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
T y() const
Definition: PV3DBase.h:63
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
LocalPoint localPosition() const override
T x() const
Definition: PV3DBase.h:62
float DTCalibValidationFromMuons::recHitPosition ( const DTRecHit1D recHit,
const DTLayer layer,
const DTChamber chamber,
float  segmPos,
int  sl 
)
private

Definition at line 176 of file DTCalibValidationFromMuons.cc.

References DTRecHit1D::localPosition(), GeomDet::toGlobal(), GeomDet::toLocal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

179  {
180 
181  // Get the layer and the wire position
182  GlobalPoint recHitPosGlob = layer->toGlobal(recHit.localPosition());
183  LocalPoint recHitPosInChamber = chamber->toLocal(recHitPosGlob);
184 
185  float recHitPos = -1;
186  if (sl != 2)
187  recHitPos = recHitPosInChamber.x();
188  else
189  recHitPos = recHitPosInChamber.y();
190 
191  return recHitPos;
192 }
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:60
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
T y() const
Definition: PV3DBase.h:63
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
T x() const
Definition: PV3DBase.h:62

Member Data Documentation

edm::ESHandle<DTGeometry> DTCalibValidationFromMuons::dtGeom
private

Definition at line 78 of file DTCalibValidationFromMuons.h.

std::map<std::pair<DTSuperLayerId,int>, std::vector<MonitorElement*> > DTCalibValidationFromMuons::histosPerSL
private

Definition at line 108 of file DTCalibValidationFromMuons.h.

edm::EDGetTokenT<reco::MuonCollection> DTCalibValidationFromMuons::muonToken_
private

Definition at line 84 of file DTCalibValidationFromMuons.h.

int DTCalibValidationFromMuons::nevent
private

Definition at line 76 of file DTCalibValidationFromMuons.h.

edm::ParameterSet DTCalibValidationFromMuons::parameters
private
int DTCalibValidationFromMuons::rightSegment
private

Definition at line 75 of file DTCalibValidationFromMuons.h.

edm::EDGetTokenT<DTRecSegment4DCollection> DTCalibValidationFromMuons::segment4DToken_
private

Definition at line 81 of file DTCalibValidationFromMuons.h.

int DTCalibValidationFromMuons::wrongSegment
private

Definition at line 74 of file DTCalibValidationFromMuons.h.