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:
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...
 
 DTCalibValidationFromMuons (const edm::ParameterSet &pset)
 Constructor. More...
 
 ~DTCalibValidationFromMuons () 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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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)
 
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

const DTGeometrydtGeom
 
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordmuonGeomToken_
 
edm::EDGetTokenT< reco::MuonCollectionmuonToken_
 
int nevent
 
edm::ParameterSet parameters
 
int rightSegment
 
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 >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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 44 of file DTCalibValidationFromMuons.h.

Constructor & Destructor Documentation

◆ DTCalibValidationFromMuons()

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

Constructor.

Definition at line 31 of file DTCalibValidationFromMuons.cc.

References edm::ParameterSet::getUntrackedParameter(), HLT_2022v15_cff::InputTag, muonToken_, nevent, parameters, muonDTDigis_cfi::pset, rightSegment, segment4DToken_, and wrongSegment.

32  : muonGeomToken_(esConsumes<edm::Transition::BeginRun>()) {
33  parameters = pset;
34 
35  // the name of the 4D segments
37  consumes<DTRecSegment4DCollection>(edm::InputTag(parameters.getUntrackedParameter<string>("segment4DLabel")));
38  // muon collection for matching 4D segments to muons
39  muonToken_ = consumes<reco::MuonCollection>(edm::InputTag(parameters.getUntrackedParameter<string>("muonLabel")));
40  // the counter of segments not used to compute residuals
41  wrongSegment = 0;
42  // the counter of segments used to compute residuals
43  rightSegment = 0;
44 
45  nevent = 0;
46 }
edm::EDGetTokenT< reco::MuonCollection > muonToken_
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_

◆ ~DTCalibValidationFromMuons()

DTCalibValidationFromMuons::~DTCalibValidationFromMuons ( )
override

Destructor.

Definition at line 48 of file DTCalibValidationFromMuons.cc.

References rightSegment, and wrongSegment.

48  {
49  // FR the following was previously in the endJob
50 
51  LogVerbatim("DTCalibValidationFromMuons") << "Segments used to compute residuals: " << rightSegment;
52  LogVerbatim("DTCalibValidationFromMuons") << "Segments not used to compute residuals: " << wrongSegment;
53 }
Log< level::Info, true > LogVerbatim

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 60 of file DTCalibValidationFromMuons.cc.

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

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

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 288 of file DTCalibValidationFromMuons.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), DTGeometry::chambers(), dtGeom, combine::histos, histosPerSL, LogTrace, hgcalTBTopologyTester_cfi::sector, DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

290  {
291  // FR substitute the DQMStore instance by ibooker
292  ibooker.setCurrentFolder("DT/DTCalibValidationFromMuons");
293 
294  DTSuperLayerId slId;
295 
296  // Loop over all the chambers
297  vector<const DTChamber *>::const_iterator ch_it = dtGeom->chambers().begin();
298  vector<const DTChamber *>::const_iterator ch_end = dtGeom->chambers().end();
299  for (; ch_it != ch_end; ++ch_it) {
300  vector<const DTSuperLayer *>::const_iterator sl_it = (*ch_it)->superLayers().begin();
301  vector<const DTSuperLayer *>::const_iterator sl_end = (*ch_it)->superLayers().end();
302  // Loop over the SLs
303  for (; sl_it != sl_end; ++sl_it) {
304  slId = (*sl_it)->id();
305 
306  // TODO! fix this is a leftover
307  int firstStep = 3;
308  // Loop over the 3 steps
309  for (int step = firstStep; step <= 3; ++step) {
310  LogTrace("DTCalibValidationFromMuons") << " Booking histos for SL: " << slId;
311 
312  // Compose the chamber name
313  stringstream wheel;
314  wheel << slId.wheel();
315  stringstream station;
316  station << slId.station();
317  stringstream sector;
318  sector << slId.sector();
319  stringstream superLayer;
320  superLayer << slId.superlayer();
321  // Define the step
322  stringstream Step;
323  Step << step;
324 
325  string slHistoName = "_STEP" + Step.str() + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +
326  "_SL" + superLayer.str();
327 
328  ibooker.setCurrentFolder("DT/DTCalibValidationFromMuons/Wheel" + wheel.str() + "/Station" + station.str() +
329  "/Sector" + sector.str());
330  // Create the monitor elements
331  vector<MonitorElement *> histos;
332  // Note the order matters
333  histos.push_back(ibooker.book1D(
334  "hResDist" + slHistoName, "Residuals on the distance from wire (rec_hit - segm_extr) (cm)", 200, -0.4, 0.4));
335  histos.push_back(ibooker.book2D("hResDistVsDist" + slHistoName,
336  "Residuals on the distance (cm) from wire (rec_hit "
337  "- segm_extr) vs distance (cm)",
338  100,
339  0,
340  2.5,
341  200,
342  -0.4,
343  0.4));
344 
345  histosPerSL[make_pair(slId, step)] = histos;
346  }
347  }
348  }
349 }
int station() const
Return the station number.
Definition: DTChamberId.h:42
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
#define LogTrace(id)
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
int superlayer() const
Return the superlayer number (deprecated method name)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
histos
Definition: combine.py:4
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int sector() const
Definition: DTChamberId.h:49
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
step
Definition: StallMonitor.cc:98
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ bookHistos()

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

◆ compute()

void DTCalibValidationFromMuons::compute ( const DTGeometry dtGeom,
const DTRecSegment4D segment 
)
private

Definition at line 167 of file DTCalibValidationFromMuons.cc.

References relativeConstraints::chamber, DTGeometry::chamber(), filterCSVwithJSON::copy, funct::cos(), DTRecSegment4D::dimension(), dtGeom, fillHistos(), DTGeometry::layer(), pixelTopology::layer, DTRecSegment4D::localDirection(), DTRecSegment4D::localPosition(), LogTrace, DTRecSegment4D::phiSegment(), recHitDistFromWire(), recHitPosition(), rightSegment, DTRecSegment2D::specificRecHits(), DTSuperLayerId::superlayer(), DTLayerId::superlayerId(), PV3DBase< T, PVType, FrameType >::theta(), DTWireId::wire(), wrongSegment, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and DTRecSegment4D::zSegment().

Referenced by analyze().

167  {
168  bool computeResidual = true;
169 
170  // Get all 1D RecHits at step 3 within the 4D segment
171  vector<DTRecHit1D> recHits1D_S3;
172 
173  // Get 1D RecHits at Step 3 and select only events with
174  // >=7 hits in phi and 4 hits in theta (if any)
175  const DTChamberRecSegment2D *phiSeg = segment.phiSegment();
176  if (phiSeg) {
177  vector<DTRecHit1D> phiRecHits = phiSeg->specificRecHits();
178  if (phiRecHits.size() < 7) {
179  LogTrace("DTCalibValidationFromMuons") << "[DTCalibValidationFromMuons] Phi segments has: " << phiRecHits.size()
180  << " hits, skipping"; // FIXME: info output
181  computeResidual = false;
182  }
183  copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
184  }
185  if (!phiSeg) {
186  LogTrace("DTCalibValidationFromMuons") << " [DTCalibValidationFromMuons] 4D segment has no phi segment! ";
187  computeResidual = false;
188  }
189 
190  if (segment.dimension() == 4) {
191  const DTSLRecSegment2D *zSeg = segment.zSegment();
192  if (zSeg) {
193  vector<DTRecHit1D> zRecHits = zSeg->specificRecHits();
194  if (zRecHits.size() != 4) {
195  LogTrace("DTCalibValidationFromMuons") << "[DTCalibValidationFromMuons] Theta segments has: " << zRecHits.size()
196  << " hits, skipping"; // FIXME: info output
197  computeResidual = false;
198  }
199  copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
200  }
201  if (!zSeg) {
202  LogTrace("DTCalibValidationFromMuons") << " [DTCalibValidationFromMuons] 4D segment has not the z segment! ";
203  computeResidual = false;
204  }
205  }
206 
207  if (!computeResidual)
208  ++wrongSegment;
209 
210  if (computeResidual) {
211  ++rightSegment;
212 
213  // Loop over 1D RecHit inside 4D segment
214  for (vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin(); recHit1D != recHits1D_S3.end();
215  ++recHit1D) {
216  const DTWireId wireId = (*recHit1D).wireId();
217 
218  // Get the layer and the wire position
219  const DTLayer *layer = dtGeom->layer(wireId);
220  float wireX = layer->specificTopology().wirePosition(wireId.wire());
221 
222  // Extrapolate the segment to the z of the wire
223  // Get wire position in chamber RF
224  // (y and z must be those of the hit to be coherent in the transf. of RF
225  // in case of rotations of the layer alignment)
226  LocalPoint wirePosInLay(wireX, (*recHit1D).localPosition().y(), (*recHit1D).localPosition().z());
227  GlobalPoint wirePosGlob = layer->toGlobal(wirePosInLay);
228  const DTChamber *chamber = dtGeom->chamber((*recHit1D).wireId().layerId().chamberId());
229  LocalPoint wirePosInChamber = chamber->toLocal(wirePosGlob);
230 
231  // Segment position at Wire z in chamber local frame
232  LocalPoint segPosAtZWire = segment.localPosition() + segment.localDirection() * wirePosInChamber.z() /
233  cos(segment.localDirection().theta());
234 
235  // Compute the distance of the segment from the wire
236  int sl = wireId.superlayer();
237  float SegmDistance = -1;
238  if (sl == 1 || sl == 3) {
239  // RPhi SL
240  SegmDistance = fabs(wirePosInChamber.x() - segPosAtZWire.x());
241  LogTrace("DTCalibValidationFromMuons") << "SegmDistance: " << SegmDistance;
242  } else if (sl == 2) {
243  // RZ SL
244  SegmDistance = fabs(segPosAtZWire.y() - wirePosInChamber.y());
245  LogTrace("DTCalibValidationFromMuons") << "SegmDistance: " << SegmDistance;
246  }
247 
248  if (SegmDistance > 2.1)
249  LogTrace("DTCalibValidationFromMuons") << " Warning: dist segment-wire: " << SegmDistance;
250 
251  // Compute the distance of the recHit from the wire
252  float recHitWireDist = recHitDistFromWire(*recHit1D, layer);
253  LogTrace("DTCalibValidationFromMuons") << "recHitWireDist: " << recHitWireDist;
254 
255  // Compute the residuals
256  float residualOnDistance = recHitWireDist - SegmDistance;
257  LogTrace("DTCalibValidationFromMuons") << "WireId: " << wireId << " ResidualOnDistance: " << residualOnDistance;
258  float residualOnPosition = -1;
259  float recHitPos = -1;
260  if (sl == 1 || sl == 3) {
261  recHitPos = recHitPosition(*recHit1D, layer, chamber, segPosAtZWire.x(), sl);
262  residualOnPosition = recHitPos - segPosAtZWire.x();
263  } else {
264  recHitPos = recHitPosition(*recHit1D, layer, chamber, segPosAtZWire.y(), sl);
265  residualOnPosition = recHitPos - segPosAtZWire.y();
266  }
267  LogTrace("DTCalibValidationFromMuons") << "WireId: " << wireId << " ResidualOnPosition: " << residualOnPosition;
268 
269  // Fill the histos
270  if (sl == 1 || sl == 3)
271  fillHistos(wireId.superlayerId(),
272  SegmDistance,
273  residualOnDistance,
274  (wirePosInChamber.x() - segPosAtZWire.x()),
275  residualOnPosition,
276  3);
277  else
278  fillHistos(wireId.superlayerId(),
279  SegmDistance,
280  residualOnDistance,
281  (wirePosInChamber.y() - segPosAtZWire.y()),
282  residualOnPosition,
283  3);
284  }
285  }
286 }
int wire() const
Return the wire number.
Definition: DTWireId.h:42
T z() const
Definition: PV3DBase.h:61
LocalVector localDirection() const override
Local direction in Chamber frame.
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)
int dimension() const override
Dimension (in parameter space)
LocalPoint localPosition() const override
Local position in Chamber frame.
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
#define LogTrace(id)
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int superlayer() const
Return the superlayer number (deprecated method name)
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:45
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:90
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96

◆ dqmBeginRun()

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

BeginRun.

Reimplemented from DQMEDAnalyzer.

Definition at line 55 of file DTCalibValidationFromMuons.cc.

References dtGeom, muonGeomToken_, and singleTopDQM_cfi::setup.

55  {
56  // get the geometry
57  dtGeom = &setup.getData(muonGeomToken_);
58 }
edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeomToken_

◆ fillHistos()

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

Definition at line 352 of file DTCalibValidationFromMuons.cc.

References HLT_2022v15_cff::distance, combine::histos, and histosPerSL.

Referenced by compute().

353  {
354  // FIXME: optimization of the number of searches
355  vector<MonitorElement *> histos = histosPerSL[make_pair(slId, step)];
356  histos[0]->Fill(residualOnDistance);
357  histos[1]->Fill(distance, residualOnDistance);
358 }
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
histos
Definition: combine.py:4
step
Definition: StallMonitor.cc:98

◆ recHitDistFromWire() [1/2]

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

Definition at line 116 of file DTCalibValidationFromMuons.cc.

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

Referenced by compute().

116  {
117  return fabs(hitPair.localPosition(DTEnums::Left).x() - hitPair.localPosition(DTEnums::Right).x()) / 2.;
118 }
LocalPoint localPosition() const override
T x() const
Definition: PV3DBase.h:59

◆ recHitDistFromWire() [2/2]

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

Definition at line 121 of file DTCalibValidationFromMuons.cc.

References pixelTopology::layer, and rpcPointValidation_cfi::recHit.

121  {
122  return fabs(recHit.localPosition().x() - layer->specificTopology().wirePosition(recHit.wireId().wire()));
123 }
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer

◆ recHitPosition() [1/2]

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

Definition at line 126 of file DTCalibValidationFromMuons.cc.

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

Referenced by compute().

127  {
128  // Get the layer and the wire position
129  GlobalPoint hitPosGlob_right = layer->toGlobal(hitPair.localPosition(DTEnums::Right));
130  LocalPoint hitPosInChamber_right = chamber->toLocal(hitPosGlob_right);
131  GlobalPoint hitPosGlob_left = layer->toGlobal(hitPair.localPosition(DTEnums::Left));
132  LocalPoint hitPosInChamber_left = chamber->toLocal(hitPosGlob_left);
133 
134  float recHitPos = -1;
135  if (sl != 2) {
136  if (fabs(hitPosInChamber_left.x() - segmentPos) < fabs(hitPosInChamber_right.x() - segmentPos))
137  recHitPos = hitPosInChamber_left.x();
138  else
139  recHitPos = hitPosInChamber_right.x();
140  } else {
141  if (fabs(hitPosInChamber_left.y() - segmentPos) < fabs(hitPosInChamber_right.y() - segmentPos))
142  recHitPos = hitPosInChamber_left.y();
143  else
144  recHitPos = hitPosInChamber_right.y();
145  }
146 
147  return recHitPos;
148 }
LocalPoint localPosition() const override
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60

◆ recHitPosition() [2/2]

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

Definition at line 151 of file DTCalibValidationFromMuons.cc.

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

152  {
153  // Get the layer and the wire position
154  GlobalPoint recHitPosGlob = layer->toGlobal(recHit.localPosition());
155  LocalPoint recHitPosInChamber = chamber->toLocal(recHitPosGlob);
156 
157  float recHitPos = -1;
158  if (sl != 2)
159  recHitPos = recHitPosInChamber.x();
160  else
161  recHitPos = recHitPosInChamber.y();
162 
163  return recHitPos;
164 }
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60

Member Data Documentation

◆ dtGeom

const DTGeometry* DTCalibValidationFromMuons::dtGeom
private

Definition at line 70 of file DTCalibValidationFromMuons.h.

Referenced by analyze(), bookHistograms(), compute(), and dqmBeginRun().

◆ histosPerSL

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

Definition at line 101 of file DTCalibValidationFromMuons.h.

Referenced by bookHistograms(), and fillHistos().

◆ muonGeomToken_

edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTCalibValidationFromMuons::muonGeomToken_
private

Definition at line 69 of file DTCalibValidationFromMuons.h.

Referenced by dqmBeginRun().

◆ muonToken_

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

Definition at line 76 of file DTCalibValidationFromMuons.h.

Referenced by analyze(), and DTCalibValidationFromMuons().

◆ nevent

int DTCalibValidationFromMuons::nevent
private

Definition at line 67 of file DTCalibValidationFromMuons.h.

Referenced by analyze(), and DTCalibValidationFromMuons().

◆ parameters

edm::ParameterSet DTCalibValidationFromMuons::parameters
private

Definition at line 64 of file DTCalibValidationFromMuons.h.

Referenced by DTCalibValidationFromMuons().

◆ rightSegment

int DTCalibValidationFromMuons::rightSegment
private

◆ segment4DToken_

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

Definition at line 73 of file DTCalibValidationFromMuons.h.

Referenced by analyze(), and DTCalibValidationFromMuons().

◆ wrongSegment

int DTCalibValidationFromMuons::wrongSegment
private