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::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

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 ( const edm::ParameterSet pset)

Constructor.

Definition at line 32 of file DTCalibValidationFromMuons.cc.

References HLT_2018_cff::InputTag, nevent, and muonDTDigis_cfi::pset.

32  {
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_
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
DTCalibValidationFromMuons::~DTCalibValidationFromMuons ( )
override

Destructor.

Definition at line 48 of file DTCalibValidationFromMuons.cc.

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 }

Member Function Documentation

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

Definition at line 60 of file DTCalibValidationFromMuons.cc.

References bookConverter::compute(), flavorHistoryFilter_cfi::dr, MuonSubdetId::DT, PVValHelper::dx, PVValHelper::dy, LogTrace, DetId::Muon, PDWG_BPHSkim_cff::muons, nevent, edm::Handle< T >::product(), 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.product(), *segment);
112  }
113 }
edm::ESHandle< DTGeometry > dtGeom
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
T y() const
Definition: PV3DBase.h:60
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:19
#define LogTrace(id)
Definition: DetId.h:17
T const * product() const
Definition: Handle.h:69
static constexpr int DT
Definition: MuonSubdetId.h:11
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
T x() const
Definition: PV3DBase.h:59
T const * product() const
Definition: ESHandle.h:86
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::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), combine::histos, LogTrace, DTChamberId::sector(), dqm::dqmstoreimpl::DQMStore::IBooker::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 }
edm::ESHandle< DTGeometry > dtGeom
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
#define LogTrace(id)
int superlayer() const
Return the superlayer number (deprecated method name)
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
histos
Definition: combine.py:4
int sector() const
Definition: DTChamberId.h:49
step
Definition: StallMonitor.cc:94
int station() const
Return the station number.
Definition: DTChamberId.h:42
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
void DTCalibValidationFromMuons::bookHistos ( DTSuperLayerId  slId,
int  step 
)
private
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(), 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().

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 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:59
int dimension() const override
Dimension (in parameter space)
LocalPoint localPosition() const override
Local position in Chamber frame.
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:90
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:49
T y() const
Definition: PV3DBase.h:60
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:58
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:45
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
T z() const
Definition: PV3DBase.h:61
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:42
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:96
T x() const
Definition: PV3DBase.h:59
void DTCalibValidationFromMuons::dqmBeginRun ( const edm::Run r,
const edm::EventSetup c 
)
override

BeginRun.

Definition at line 55 of file DTCalibValidationFromMuons.cc.

References edm::EventSetup::get().

55  {
56  // get the geometry
57  setup.get<MuonGeometryRecord>().get(dtGeom);
58 }
edm::ESHandle< DTGeometry > dtGeom
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 combine::histos.

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:94
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().

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
float DTCalibValidationFromMuons::recHitDistFromWire ( const DTRecHit1D recHit,
const DTLayer layer 
)
private

Definition at line 121 of file DTCalibValidationFromMuons.cc.

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

121  {
122  return fabs(recHit.localPosition().x() - layer->specificTopology().wirePosition(recHit.wireId().wire()));
123 }
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:47
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:59
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
int wire() const
Return the wire number.
Definition: DTWireId.h:42
T x() const
Definition: PV3DBase.h:59
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:76
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 DTEnums::Left, DTRecHit1DPair::localPosition(), DTEnums::Right, GeomDet::toGlobal(), GeomDet::toLocal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

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 }
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
T y() const
Definition: PV3DBase.h:60
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
LocalPoint localPosition() const override
T x() const
Definition: PV3DBase.h:59
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 DTRecHit1D::localPosition(), GeomDet::toGlobal(), GeomDet::toLocal(), 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 }
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:47
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
T y() const
Definition: PV3DBase.h:60
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
T x() const
Definition: PV3DBase.h:59

Member Data Documentation

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

Definition at line 69 of file DTCalibValidationFromMuons.h.

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

Definition at line 100 of file DTCalibValidationFromMuons.h.

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

Definition at line 75 of file DTCalibValidationFromMuons.h.

int DTCalibValidationFromMuons::nevent
private

Definition at line 67 of file DTCalibValidationFromMuons.h.

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

Definition at line 66 of file DTCalibValidationFromMuons.h.

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

Definition at line 72 of file DTCalibValidationFromMuons.h.

int DTCalibValidationFromMuons::wrongSegment
private

Definition at line 65 of file DTCalibValidationFromMuons.h.