CMS 3D CMS Logo

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

#include <DTCalibValidation.h>

Inheritance diagram for DTCalibValidation:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

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...
 
 DTCalibValidation (const edm::ParameterSet &pset)
 Constructor. More...
 
 ~DTCalibValidation () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Member Functions

void bookHistos (DTSuperLayerId slId, int step)
 
template<typename type >
void compute (const DTGeometry *dtGeom, const DTRecSegment4D &segment, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
 
void fillHistos (DTSuperLayerId slId, float distance, float residualOnDistance, float position, float residualOnPosition, int step)
 
template<typename type >
const typefindBestRecHit (const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
 
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire (const DTRecHitCollection *dt1DRecHitPairs)
 
std::map< DTWireId, std::vector< DTRecHit1D > > map1DRecHitsPerWire (const DTRecSegment2DCollection *segment2Ds)
 
std::map< DTWireId, std::vector< DTRecHit1D > > map1DRecHitsPerWire (const DTRecSegment4DCollection *segment4Ds)
 
float recHitDistFromWire (const DTRecHit1D &recHit, const DTLayer *layer)
 
float recHitDistFromWire (const DTRecHit1DPair &hitPair, const DTLayer *layer)
 
float recHitPosition (const DTRecHit1D &recHit, const DTLayer *layer, const DTChamber *chamber, float segmPos, int sl)
 
float recHitPosition (const DTRecHit1DPair &hitPair, const DTLayer *layer, const DTChamber *chamber, float segmPos, int sl)
 

Private Attributes

bool detailedAnalysis
 
edm::ESHandle< DTGeometrydtGeom
 
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
 
int nevent
 
edm::ParameterSet parameters
 
edm::EDGetTokenT< DTRecHitCollectionrecHits1DToken_
 
int rightSegment
 
edm::EDGetTokenT< DTRecSegment2DCollectionsegment2DToken_
 
edm::EDGetTokenT< DTRecSegment4DCollectionsegment4DToken_
 
int wrongSegment
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Analysis on DT residuals to validate the kFactor

Author
G. Mila - INFN Torino

Definition at line 39 of file DTCalibValidation.h.

Constructor & Destructor Documentation

◆ DTCalibValidation()

DTCalibValidation::DTCalibValidation ( const edm::ParameterSet pset)

Constructor.

Definition at line 31 of file DTCalibValidation.cc.

31  {
32  parameters = pset;
33 
34  //FR the following was previously in the beginJob
35 
36  // the name of the rechits collection at step 1
38  consumes<DTRecHitCollection>(edm::InputTag(parameters.getUntrackedParameter<string>("recHits1DLabel")));
39  // the name of the 2D segments
41  consumes<DTRecSegment2DCollection>(edm::InputTag(parameters.getUntrackedParameter<string>("segment2DLabel")));
42  // the name of the 4D segments
44  consumes<DTRecSegment4DCollection>(edm::InputTag(parameters.getUntrackedParameter<string>("segment4DLabel")));
45  // the counter of segments not used to compute residuals
46  wrongSegment = 0;
47  // the counter of segments used to compute residuals
48  rightSegment = 0;
49  // the analysis type
50  detailedAnalysis = parameters.getUntrackedParameter<bool>("detailedAnalysis", false);
51 
52  nevent = 0;
53 }

References dtNoiseAnalysis_cfi::detailedAnalysis, nevent, and muonDTDigis_cfi::pset.

◆ ~DTCalibValidation()

DTCalibValidation::~DTCalibValidation ( )
override

Destructor.

Definition at line 55 of file DTCalibValidation.cc.

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

Member Function Documentation

◆ analyze()

void DTCalibValidation::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 67 of file DTCalibValidation.cc.

67  {
68  ++nevent;
69  LogTrace("DTCalibValidation") << "[DTCalibValidation] Analyze #Run: " << event.id().run() << " #Event: " << nevent;
70 
71  // RecHit mapping at Step 1 -------------------------------
72  map<DTWireId, vector<DTRecHit1DPair> > recHitsPerWire_1S;
73 
74  // RecHit mapping at Step 2 ------------------------------
75  map<DTWireId, vector<DTRecHit1D> > recHitsPerWire_2S;
76 
77  if (detailedAnalysis) {
78  LogTrace("DTCalibValidation") << " -- DTRecHit S1: begin analysis:";
79  // Get the rechit collection from the event
81  event.getByToken(recHits1DToken_, dtRecHits);
82  recHitsPerWire_1S = map1DRecHitsPerWire(dtRecHits.product());
83 
84  LogTrace("DTCalibValidation") << " -- DTRecHit S2: begin analysis:";
85  // Get the 2D rechits from the event
87  event.getByToken(segment2DToken_, segment2Ds);
88  recHitsPerWire_2S = map1DRecHitsPerWire(segment2Ds.product());
89  }
90 
91  // RecHit mapping at Step 3 ---------------------------------
92  LogTrace("DTCalibValidation") << " -- DTRecHit S3: begin analysis:";
93  // Get the 4D rechits from the event
95  event.getByToken(segment4DToken_, segment4Ds);
96  map<DTWireId, vector<DTRecHit1D> > recHitsPerWire_3S = map1DRecHitsPerWire(segment4Ds.product());
97 
98  // Loop over all 4D segments
99  for (DTRecSegment4DCollection::const_iterator segment = segment4Ds->begin(); segment != segment4Ds->end();
100  ++segment) {
101  if (detailedAnalysis) {
102  LogTrace("DTCalibValidation") << "Anlysis on recHit at step 1";
103  compute(dtGeom.product(), (*segment), recHitsPerWire_1S, 1);
104 
105  LogTrace("DTCalibValidation") << "Anlysis on recHit at step 2";
106  compute(dtGeom.product(), (*segment), recHitsPerWire_2S, 2);
107  }
108 
109  LogTrace("DTCalibValidation") << "Anlysis on recHit at step 3";
110  compute(dtGeom.product(), (*segment), recHitsPerWire_3S, 3);
111  }
112 }

References bookConverter::compute(), dtNoiseAnalysis_cfi::detailedAnalysis, LogTrace, nevent, and edm::Handle< T >::product().

◆ bookHistograms()

void DTCalibValidation::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 374 of file DTCalibValidation.cc.

376  {
377  //FR substitute the DQMStore instance by ibooker
378  ibooker.setCurrentFolder("DT/DTCalibValidation");
379 
380  DTSuperLayerId slId;
381 
382  // Loop over all the chambers
383  vector<const DTChamber*>::const_iterator ch_it = dtGeom->chambers().begin();
384  vector<const DTChamber*>::const_iterator ch_end = dtGeom->chambers().end();
385  for (; ch_it != ch_end; ++ch_it) {
386  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
387  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
388  // Loop over the SLs
389  for (; sl_it != sl_end; ++sl_it) {
390  slId = (*sl_it)->id();
391 
392  int firstStep = 1;
393  if (!detailedAnalysis)
394  firstStep = 3;
395  // Loop over the 3 steps
396  for (int step = firstStep; step <= 3; ++step) {
397  LogTrace("DTCalibValidation") << " Booking histos for SL: " << slId;
398 
399  // Compose the chamber name
400  stringstream wheel;
401  wheel << slId.wheel();
402  stringstream station;
403  station << slId.station();
404  stringstream sector;
405  sector << slId.sector();
406  stringstream superLayer;
407  superLayer << slId.superlayer();
408  // Define the step
409  stringstream Step;
410  Step << step;
411 
412  string slHistoName = "_STEP" + Step.str() + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +
413  "_SL" + superLayer.str();
414 
415  ibooker.setCurrentFolder("DT/DTCalibValidation/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" +
416  sector.str());
417  // Create the monitor elements
418  vector<MonitorElement*> histos;
419  // Note the order matters
420  histos.push_back(ibooker.book1D(
421  "hResDist" + slHistoName, "Residuals on the distance from wire (rec_hit - segm_extr) (cm)", 200, -0.4, 0.4));
422  histos.push_back(
423  ibooker.book2D("hResDistVsDist" + slHistoName,
424  "Residuals on the distance (cm) from wire (rec_hit - segm_extr) vs distance (cm)",
425  100,
426  0,
427  2.5,
428  200,
429  -0.4,
430  0.4));
431  if (detailedAnalysis) {
432  histos.push_back(ibooker.book1D("hResPos" + slHistoName,
433  "Residuals on the position from wire (rec_hit - segm_extr) (cm)",
434  200,
435  -0.4,
436  0.4));
437  histos.push_back(
438  ibooker.book2D("hResPosVsPos" + slHistoName,
439  "Residuals on the position (cm) from wire (rec_hit - segm_extr) vs distance (cm)",
440  200,
441  -2.5,
442  2.5,
443  200,
444  -0.4,
445  0.4));
446  }
447 
448  histosPerSL[make_pair(slId, step)] = histos;
449  }
450  }
451  }
452 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dtNoiseAnalysis_cfi::detailedAnalysis, combine::histos, LogTrace, DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

◆ bookHistos()

void DTCalibValidation::bookHistos ( DTSuperLayerId  slId,
int  step 
)
private

◆ compute()

template<typename type >
void DTCalibValidation::compute ( const DTGeometry dtGeom,
const DTRecSegment4D segment,
const std::map< DTWireId, std::vector< type > > &  recHitsPerWire,
int  step 
)
private

Definition at line 241 of file DTCalibValidation.cc.

244  {
245  bool computeResidual = true;
246 
247  // Get all 1D RecHits at step 3 within the 4D segment
248  vector<DTRecHit1D> recHits1D_S3;
249 
250  // Get 1D RecHits at Step 3 and select only events with
251  // 8 hits in phi and 4 hits in theta (if any)
252  const DTChamberRecSegment2D* phiSeg = segment.phiSegment();
253  if (phiSeg) {
254  vector<DTRecHit1D> phiRecHits = phiSeg->specificRecHits();
255  if (phiRecHits.size() != 8) {
256  LogTrace("DTCalibValidation") << "[DTCalibValidation] Phi segments has: " << phiRecHits.size()
257  << " hits, skipping"; // FIXME: info output
258  computeResidual = false;
259  }
260  copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
261  }
262  if (!phiSeg) {
263  LogTrace("DTCalibValidation") << " [DTCalibValidation] 4D segment has not the phi segment! ";
264  computeResidual = false;
265  }
266 
267  if (segment.dimension() == 4) {
268  const DTSLRecSegment2D* zSeg = segment.zSegment();
269  if (zSeg) {
270  vector<DTRecHit1D> zRecHits = zSeg->specificRecHits();
271  if (zRecHits.size() != 4) {
272  LogTrace("DTCalibValidation") << "[DTCalibValidation] Theta segments has: " << zRecHits.size()
273  << " hits, skipping"; // FIXME: info output
274  computeResidual = false;
275  }
276  copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
277  }
278  if (!zSeg) {
279  LogTrace("DTCalibValidation") << " [DTCalibValidation] 4D segment has not the z segment! ";
280  computeResidual = false;
281  }
282  }
283 
284  if (!computeResidual)
285  ++wrongSegment;
286  if (computeResidual) {
287  ++rightSegment;
288  // Loop over 1D RecHit inside 4D segment
289  for (vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin(); recHit1D != recHits1D_S3.end();
290  ++recHit1D) {
291  const DTWireId wireId = (*recHit1D).wireId();
292 
293  // Get the layer and the wire position
294  const DTLayer* layer = dtGeom->layer(wireId);
295  float wireX = layer->specificTopology().wirePosition(wireId.wire());
296 
297  // Extrapolate the segment to the z of the wire
298  // Get wire position in chamber RF
299  // (y and z must be those of the hit to be coherent in the transf. of RF in case of rotations of the layer alignment)
300  LocalPoint wirePosInLay(wireX, (*recHit1D).localPosition().y(), (*recHit1D).localPosition().z());
301  GlobalPoint wirePosGlob = layer->toGlobal(wirePosInLay);
302  const DTChamber* chamber = dtGeom->chamber((*recHit1D).wireId().layerId().chamberId());
303  LocalPoint wirePosInChamber = chamber->toLocal(wirePosGlob);
304 
305  // Segment position at Wire z in chamber local frame
306  LocalPoint segPosAtZWire = segment.localPosition() + segment.localDirection() * wirePosInChamber.z() /
307  cos(segment.localDirection().theta());
308 
309  // Compute the distance of the segment from the wire
310  int sl = wireId.superlayer();
311  float SegmDistance = -1;
312  if (sl == 1 || sl == 3) {
313  // RPhi SL
314  SegmDistance = fabs(wirePosInChamber.x() - segPosAtZWire.x());
315  LogTrace("DTCalibValidation") << "SegmDistance: " << SegmDistance;
316  } else if (sl == 2) {
317  // RZ SL
318  SegmDistance = fabs(segPosAtZWire.y() - wirePosInChamber.y());
319  LogTrace("DTCalibValidation") << "SegmDistance: " << SegmDistance;
320  }
321  if (SegmDistance > 2.1)
322  LogTrace("DTCalibValidation") << " Warning: dist segment-wire: " << SegmDistance;
323 
324  // Look for RecHits in the same cell
325  if (recHitsPerWire.find(wireId) == recHitsPerWire.end()) {
326  LogTrace("DTCalibValidation") << " No RecHit found at Step: " << step << " in cell: " << wireId;
327  } else {
328  const vector<type>& recHits = recHitsPerWire.at(wireId);
329  LogTrace("DTCalibValidation") << " " << recHits.size() << " RecHits, Step " << step
330  << " in channel: " << wireId;
331 
332  // Get the layer
333  const DTLayer* layer = dtGeom->layer(wireId);
334  // Find the best RecHits
335  const type* theBestRecHit = findBestRecHit(layer, wireId, recHits, SegmDistance);
336  // Compute the distance of the recHit from the wire
337  float recHitWireDist = recHitDistFromWire(*theBestRecHit, layer);
338  LogTrace("DTCalibValidation") << "recHitWireDist: " << recHitWireDist;
339 
340  // Compute the residuals
341  float residualOnDistance = recHitWireDist - SegmDistance;
342  LogTrace("DTCalibValidation") << "WireId: " << wireId << " ResidualOnDistance: " << residualOnDistance;
343  float residualOnPosition = -1;
344  float recHitPos = -1;
345  if (sl == 1 || sl == 3) {
346  recHitPos = recHitPosition(*theBestRecHit, layer, chamber, segPosAtZWire.x(), sl);
347  residualOnPosition = recHitPos - segPosAtZWire.x();
348  } else {
349  recHitPos = recHitPosition(*theBestRecHit, layer, chamber, segPosAtZWire.y(), sl);
350  residualOnPosition = recHitPos - segPosAtZWire.y();
351  }
352  LogTrace("DTCalibValidation") << "WireId: " << wireId << " ResidualOnPosition: " << residualOnPosition;
353 
354  // Fill the histos
355  if (sl == 1 || sl == 3)
356  fillHistos(wireId.superlayerId(),
357  SegmDistance,
358  residualOnDistance,
359  (wirePosInChamber.x() - segPosAtZWire.x()),
360  residualOnPosition,
361  step);
362  else
363  fillHistos(wireId.superlayerId(),
364  SegmDistance,
365  residualOnDistance,
366  (wirePosInChamber.y() - segPosAtZWire.y()),
367  residualOnPosition,
368  step);
369  }
370  }
371  }
372 }

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

◆ dqmBeginRun()

void DTCalibValidation::dqmBeginRun ( const edm::Run r,
const edm::EventSetup c 
)
overridevirtual

BeginRun.

Reimplemented from DQMEDAnalyzer.

Definition at line 62 of file DTCalibValidation.cc.

62  {
63  // get the geometry
65 }

References edm::get(), and singleTopDQM_cfi::setup.

◆ fillHistos()

void DTCalibValidation::fillHistos ( DTSuperLayerId  slId,
float  distance,
float  residualOnDistance,
float  position,
float  residualOnPosition,
int  step 
)
private

Definition at line 455 of file DTCalibValidation.cc.

456  {
457  // FIXME: optimization of the number of searches
458  vector<MonitorElement*> histos = histosPerSL[make_pair(slId, step)];
459  histos[0]->Fill(residualOnDistance);
460  histos[1]->Fill(distance, residualOnDistance);
461  if (detailedAnalysis) {
462  histos[2]->Fill(residualOnPosition);
463  histos[3]->Fill(position, residualOnPosition);
464  }
465 }

References dtNoiseAnalysis_cfi::detailedAnalysis, HLT_2018_cff::distance, combine::histos, and position.

◆ findBestRecHit()

template<typename type >
const type * DTCalibValidation::findBestRecHit ( const DTLayer layer,
DTWireId  wireId,
const std::vector< type > &  recHits,
const float  simHitDist 
)
private

Definition at line 170 of file DTCalibValidation.cc.

173  {
174  float res = 99999;
175  const type* theBestRecHit = nullptr;
176  // Loop over RecHits within the cell
177  for (typename vector<type>::const_iterator recHit = recHits.begin(); recHit != recHits.end(); ++recHit) {
178  float distTmp = recHitDistFromWire(*recHit, layer);
179  if (fabs(distTmp - segmDist) < res) {
180  res = fabs(distTmp - segmDist);
181  theBestRecHit = &(*recHit);
182  }
183  } // End of loop over RecHits within the cell
184 
185  return theBestRecHit;
186 }

References rpcPointValidation_cfi::recHit, and FastTrackerRecHitMaskProducer_cfi::recHits.

◆ map1DRecHitsPerWire() [1/3]

map< DTWireId, vector< DTRecHit1DPair > > DTCalibValidation::map1DRecHitsPerWire ( const DTRecHitCollection dt1DRecHitPairs)
private

Definition at line 115 of file DTCalibValidation.cc.

116  {
117  map<DTWireId, vector<DTRecHit1DPair> > ret;
118 
119  for (DTRecHitCollection::const_iterator rechit = dt1DRecHitPairs->begin(); rechit != dt1DRecHitPairs->end();
120  ++rechit) {
121  ret[(*rechit).wireId()].push_back(*rechit);
122  }
123 
124  return ret;
125 }

References runTheMatrix::ret.

◆ map1DRecHitsPerWire() [2/3]

map< DTWireId, vector< DTRecHit1D > > DTCalibValidation::map1DRecHitsPerWire ( const DTRecSegment2DCollection segment2Ds)
private

Definition at line 128 of file DTCalibValidation.cc.

128  {
129  map<DTWireId, vector<DTRecHit1D> > ret;
130 
131  // Loop over all 2D segments
132  for (DTRecSegment2DCollection::const_iterator segment = segment2Ds->begin(); segment != segment2Ds->end();
133  ++segment) {
134  vector<DTRecHit1D> component1DHits = (*segment).specificRecHits();
135  // Loop over all component 1D hits
136  for (vector<DTRecHit1D>::const_iterator hit = component1DHits.begin(); hit != component1DHits.end(); ++hit) {
137  ret[(*hit).wireId()].push_back(*hit);
138  }
139  }
140  return ret;
141 }

References runTheMatrix::ret.

◆ map1DRecHitsPerWire() [3/3]

map< DTWireId, std::vector< DTRecHit1D > > DTCalibValidation::map1DRecHitsPerWire ( const DTRecSegment4DCollection segment4Ds)
private

Definition at line 144 of file DTCalibValidation.cc.

145  {
146  map<DTWireId, vector<DTRecHit1D> > ret;
147  // Loop over all 4D segments
148  for (DTRecSegment4DCollection::const_iterator segment = segment4Ds->begin(); segment != segment4Ds->end();
149  ++segment) {
150  // Get component 2D segments
151  vector<const TrackingRecHit*> segment2Ds = (*segment).recHits();
152  // Loop over 2D segments:
153  for (vector<const TrackingRecHit*>::const_iterator segment2D = segment2Ds.begin(); segment2D != segment2Ds.end();
154  ++segment2D) {
155  // Get 1D component rechits
156  vector<const TrackingRecHit*> hits = (*segment2D)->recHits();
157  // Loop over them
158  for (vector<const TrackingRecHit*>::const_iterator hit = hits.begin(); hit != hits.end(); ++hit) {
159  const DTRecHit1D* hit1D = dynamic_cast<const DTRecHit1D*>(*hit);
160  ret[hit1D->wireId()].push_back(*hit1D);
161  }
162  }
163  }
164 
165  return ret;
166 }

References hfClusterShapes_cfi::hits, runTheMatrix::ret, and DTRecHit1D::wireId().

◆ recHitDistFromWire() [1/2]

float DTCalibValidation::recHitDistFromWire ( const DTRecHit1D recHit,
const DTLayer layer 
)
private

Definition at line 194 of file DTCalibValidation.cc.

194  {
195  return fabs(recHit.localPosition().x() - layer->specificTopology().wirePosition(recHit.wireId().wire()));
196 }

References rpcPointValidation_cfi::recHit, DTLayer::specificTopology(), and DTTopology::wirePosition().

◆ recHitDistFromWire() [2/2]

float DTCalibValidation::recHitDistFromWire ( const DTRecHit1DPair hitPair,
const DTLayer layer 
)
private

Definition at line 189 of file DTCalibValidation.cc.

189  {
190  return fabs(hitPair.localPosition(DTEnums::Left).x() - hitPair.localPosition(DTEnums::Right).x()) / 2.;
191 }

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

◆ recHitPosition() [1/2]

float DTCalibValidation::recHitPosition ( const DTRecHit1D recHit,
const DTLayer layer,
const DTChamber chamber,
float  segmPos,
int  sl 
)
private

Definition at line 224 of file DTCalibValidation.cc.

225  {
226  // Get the layer and the wire position
227  GlobalPoint recHitPosGlob = layer->toGlobal(recHit.localPosition());
228  LocalPoint recHitPosInChamber = chamber->toLocal(recHitPosGlob);
229 
230  float recHitPos = -1;
231  if (sl != 2)
232  recHitPos = recHitPosInChamber.x();
233  else
234  recHitPos = recHitPosInChamber.y();
235 
236  return recHitPos;
237 }

References relativeConstraints::chamber, rpcPointValidation_cfi::recHit, GeomDet::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

◆ recHitPosition() [2/2]

float DTCalibValidation::recHitPosition ( const DTRecHit1DPair hitPair,
const DTLayer layer,
const DTChamber chamber,
float  segmPos,
int  sl 
)
private

Definition at line 199 of file DTCalibValidation.cc.

200  {
201  // Get the layer and the wire position
202  GlobalPoint hitPosGlob_right = layer->toGlobal(hitPair.localPosition(DTEnums::Right));
203  LocalPoint hitPosInChamber_right = chamber->toLocal(hitPosGlob_right);
204  GlobalPoint hitPosGlob_left = layer->toGlobal(hitPair.localPosition(DTEnums::Left));
205  LocalPoint hitPosInChamber_left = chamber->toLocal(hitPosGlob_left);
206 
207  float recHitPos = -1;
208  if (sl != 2) {
209  if (fabs(hitPosInChamber_left.x() - segmentPos) < fabs(hitPosInChamber_right.x() - segmentPos))
210  recHitPos = hitPosInChamber_left.x();
211  else
212  recHitPos = hitPosInChamber_right.x();
213  } else {
214  if (fabs(hitPosInChamber_left.y() - segmentPos) < fabs(hitPosInChamber_right.y() - segmentPos))
215  recHitPos = hitPosInChamber_left.y();
216  else
217  recHitPos = hitPosInChamber_right.y();
218  }
219 
220  return recHitPos;
221 }

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

Member Data Documentation

◆ detailedAnalysis

bool DTCalibValidation::detailedAnalysis
private

Definition at line 64 of file DTCalibValidation.h.

◆ dtGeom

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

Definition at line 66 of file DTCalibValidation.h.

◆ histosPerSL

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

Definition at line 117 of file DTCalibValidation.h.

◆ nevent

int DTCalibValidation::nevent
private

Definition at line 62 of file DTCalibValidation.h.

◆ parameters

edm::ParameterSet DTCalibValidation::parameters
private

Definition at line 59 of file DTCalibValidation.h.

◆ recHits1DToken_

edm::EDGetTokenT<DTRecHitCollection> DTCalibValidation::recHits1DToken_
private

Definition at line 69 of file DTCalibValidation.h.

◆ rightSegment

int DTCalibValidation::rightSegment
private

Definition at line 61 of file DTCalibValidation.h.

◆ segment2DToken_

edm::EDGetTokenT<DTRecSegment2DCollection> DTCalibValidation::segment2DToken_
private

Definition at line 71 of file DTCalibValidation.h.

◆ segment4DToken_

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

Definition at line 73 of file DTCalibValidation.h.

◆ wrongSegment

int DTCalibValidation::wrongSegment
private

Definition at line 60 of file DTCalibValidation.h.

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
DTSLRecSegment2D
Definition: DTSLRecSegment2D.h:15
DTSuperLayerId
Definition: DTSuperLayerId.h:12
DTWireId::wire
int wire() const
Return the wire number.
Definition: DTWireId.h:42
DTRecSegment4D::dimension
int dimension() const override
Dimension (in parameter space)
Definition: DTRecSegment4D.h:79
DTRecSegment4D::localDirection
LocalVector localDirection() const override
Local direction in Chamber frame.
Definition: DTRecSegment4D.h:67
edm::Handle::product
T const * product() const
Definition: Handle.h:70
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
step
step
Definition: StallMonitor.cc:94
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DTCalibValidation::segment2DToken_
edm::EDGetTokenT< DTRecSegment2DCollection > segment2DToken_
Definition: DTCalibValidation.h:71
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
DTChamber
Definition: DTChamber.h:24
DTRecHit1D
Definition: DTRecHit1D.h:25
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
DTSuperLayerId::superlayer
int superlayer() const
Return the superlayer number (deprecated method name)
Definition: DTSuperLayerId.h:42
edm::Handle< DTRecHitCollection >
DTRecSegment4D::localPosition
LocalPoint localPosition() const override
Local position in Chamber frame.
Definition: DTRecSegment4D.h:61
DTRecSegment4D::zSegment
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
Definition: DTRecSegment4D.h:99
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
DTGeometry::chamber
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:90
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
DTCalibValidation::compute
void compute(const DTGeometry *dtGeom, const DTRecSegment4D &segment, const std::map< DTWireId, std::vector< type > > &recHitsPerWire, int step)
Definition: DTCalibValidation.cc:241
DTTopology::wirePosition
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:59
DTRecHit1D::wireId
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:76
DTEnums::Left
Definition: DTEnums.h:15
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DTWireId
Definition: DTWireId.h:12
DTCalibValidation::dtGeom
edm::ESHandle< DTGeometry > dtGeom
Definition: DTCalibValidation.h:66
DTGeometry::chambers
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
Point3DBase< float, LocalTag >
DTCalibValidation::map1DRecHitsPerWire
std::map< DTWireId, std::vector< DTRecHit1DPair > > map1DRecHitsPerWire(const DTRecHitCollection *dt1DRecHitPairs)
Definition: DTCalibValidation.cc:115
DTCalibValidation::fillHistos
void fillHistos(DTSuperLayerId slId, float distance, float residualOnDistance, float position, float residualOnPosition, int step)
Definition: DTCalibValidation.cc:455
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
DTGeometry::layer
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
DTCalibValidation::segment4DToken_
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
Definition: DTCalibValidation.h:73
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTChamberRecSegment2D
Definition: DTChamberRecSegment2D.h:31
edm::LogVerbatim
Definition: MessageLogger.h:297
DTCalibValidation::nevent
int nevent
Definition: DTCalibValidation.h:62
get
#define get
res
Definition: Electron.h:6
DTLayer
Definition: DTLayer.h:25
combine.histos
histos
Definition: combine.py:4
DTEnums::Right
Definition: DTEnums.h:15
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
type
type
Definition: HCALResponse.h:21
DTCalibValidation::detailedAnalysis
bool detailedAnalysis
Definition: DTCalibValidation.h:64
DTRecHit1DPair::localPosition
LocalPoint localPosition() const override
Definition: DTRecHit1DPair.cc:29
DTCalibValidation::histosPerSL
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
Definition: DTCalibValidation.h:117
DTCalibValidation::wrongSegment
int wrongSegment
Definition: DTCalibValidation.h:60
DTCalibValidation::recHits1DToken_
edm::EDGetTokenT< DTRecHitCollection > recHits1DToken_
Definition: DTCalibValidation.h:69
DTRecSegment2D::specificRecHits
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
Definition: DTRecSegment2D.cc:104
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
DTLayer::specificTopology
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
DTCalibValidation::rightSegment
int rightSegment
Definition: DTCalibValidation.h:61
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
DTCalibValidation::findBestRecHit
const type * findBestRecHit(const DTLayer *layer, DTWireId wireId, const std::vector< type > &recHits, const float simHitDist)
Definition: DTCalibValidation.cc:170
DTRecSegment4D::phiSegment
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
Definition: DTRecSegment4D.h:96
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
DTCalibValidation::recHitDistFromWire
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
Definition: DTCalibValidation.cc:189
DTCalibValidation::recHitPosition
float recHitPosition(const DTRecHit1DPair &hitPair, const DTLayer *layer, const DTChamber *chamber, float segmPos, int sl)
Definition: DTCalibValidation.cc:199
edm::InputTag
Definition: InputTag.h:15
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42
hit
Definition: SiStripHitEffFromCalibTree.cc:88
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27