|
|
#include <DTCalibValidationFromMuons.h>
|
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 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) |
|
Analysis on DT residuals to validate the kFactor
- Author
- G. Mila - INFN Torino
Definition at line 44 of file DTCalibValidationFromMuons.h.
◆ DTCalibValidationFromMuons()
DTCalibValidationFromMuons::DTCalibValidationFromMuons |
( |
const edm::ParameterSet & |
pset | ) |
|
◆ ~DTCalibValidationFromMuons()
DTCalibValidationFromMuons::~DTCalibValidationFromMuons |
( |
| ) |
|
|
override |
◆ analyze()
Reimplemented from DQMEDAnalyzer.
Definition at line 60 of file DTCalibValidationFromMuons.cc.
62 LogTrace(
"DTCalibValidationFromMuons") <<
"[DTCalibValidationFromMuons] Analyze #Run: " <<
event.id().run()
66 LogTrace(
"DTCalibValidationFromMuons") <<
" -- DTRecHit S3: begin analysis:";
76 vector<const DTRecSegment4D *> selectedSegment4Ds;
78 for (
auto &imuon : *
muons) {
79 for (
const auto &ch : imuon.matches()) {
80 DetId chId(ch.id.rawId());
87 if (!imuon.isGlobalMuon())
90 int nsegs = ch.segmentMatches.size();
99 float dx = (posHit.
x() ? posHit.
x() - ch.x : 0);
100 float dy = (posHit.
y() ? posHit.
y() - ch.y : 0);
103 selectedSegment4Ds.push_back(&(*segment));
109 for (
auto segment : selectedSegment4Ds) {
110 LogTrace(
"DTCalibValidationFromMuons") <<
"Anlysis on recHit at step 3";
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().
◆ bookHistograms()
Implements DQMEDAnalyzer.
Definition at line 288 of file DTCalibValidationFromMuons.cc.
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();
303 for (; sl_it != sl_end; ++sl_it) {
304 slId = (*sl_it)->id();
310 LogTrace(
"DTCalibValidationFromMuons") <<
" Booking histos for SL: " << slId;
319 stringstream superLayer;
325 string slHistoName =
"_STEP" + Step.str() +
"_W" +
wheel.str() +
"_St" +
station.str() +
"_Sec" + sector.str() +
326 "_SL" + superLayer.str();
329 "/Sector" + sector.str());
331 vector<MonitorElement *>
histos;
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)",
References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), combine::histos, LogTrace, DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.
◆ bookHistos()
void DTCalibValidationFromMuons::bookHistos |
( |
DTSuperLayerId |
slId, |
|
|
int |
step |
|
) |
| |
|
private |
◆ compute()
Definition at line 167 of file DTCalibValidationFromMuons.cc.
168 bool computeResidual =
true;
171 vector<DTRecHit1D> recHits1D_S3;
178 if (phiRecHits.size() < 7) {
179 LogTrace(
"DTCalibValidationFromMuons") <<
"[DTCalibValidationFromMuons] Phi segments has: " << phiRecHits.size()
180 <<
" hits, skipping";
181 computeResidual =
false;
183 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
186 LogTrace(
"DTCalibValidationFromMuons") <<
" [DTCalibValidationFromMuons] 4D segment has no phi segment! ";
187 computeResidual =
false;
194 if (zRecHits.size() != 4) {
195 LogTrace(
"DTCalibValidationFromMuons") <<
"[DTCalibValidationFromMuons] Theta segments has: " << zRecHits.size()
196 <<
" hits, skipping";
197 computeResidual =
false;
199 copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
202 LogTrace(
"DTCalibValidationFromMuons") <<
" [DTCalibValidationFromMuons] 4D segment has not the z segment! ";
203 computeResidual =
false;
207 if (!computeResidual)
210 if (computeResidual) {
214 for (vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin(); recHit1D != recHits1D_S3.end();
216 const DTWireId wireId = (*recHit1D).wireId();
226 LocalPoint wirePosInLay(wireX, (*recHit1D).localPosition().y(), (*recHit1D).localPosition().z());
237 float SegmDistance = -1;
238 if (sl == 1 || sl == 3) {
240 SegmDistance = fabs(wirePosInChamber.
x() - segPosAtZWire.
x());
241 LogTrace(
"DTCalibValidationFromMuons") <<
"SegmDistance: " << SegmDistance;
242 }
else if (sl == 2) {
244 SegmDistance = fabs(segPosAtZWire.
y() - wirePosInChamber.
y());
245 LogTrace(
"DTCalibValidationFromMuons") <<
"SegmDistance: " << SegmDistance;
248 if (SegmDistance > 2.1)
249 LogTrace(
"DTCalibValidationFromMuons") <<
" Warning: dist segment-wire: " << SegmDistance;
253 LogTrace(
"DTCalibValidationFromMuons") <<
"recHitWireDist: " << recHitWireDist;
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) {
262 residualOnPosition = recHitPos - segPosAtZWire.
x();
265 residualOnPosition = recHitPos - segPosAtZWire.
y();
267 LogTrace(
"DTCalibValidationFromMuons") <<
"WireId: " << wireId <<
" ResidualOnPosition: " << residualOnPosition;
270 if (sl == 1 || sl == 3)
274 (wirePosInChamber.
x() - segPosAtZWire.
x()),
281 (wirePosInChamber.
y() - segPosAtZWire.
y()),
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(), DTWireId::wire(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and DTRecSegment4D::zSegment().
◆ dqmBeginRun()
◆ fillHistos()
void DTCalibValidationFromMuons::fillHistos |
( |
DTSuperLayerId |
slId, |
|
|
float |
distance, |
|
|
float |
residualOnDistance, |
|
|
float |
position, |
|
|
float |
residualOnPosition, |
|
|
int |
step |
|
) |
| |
|
private |
◆ recHitDistFromWire() [1/2]
float DTCalibValidationFromMuons::recHitDistFromWire |
( |
const DTRecHit1D & |
recHit, |
|
|
const DTLayer * |
layer |
|
) |
| |
|
private |
◆ recHitDistFromWire() [2/2]
float DTCalibValidationFromMuons::recHitDistFromWire |
( |
const DTRecHit1DPair & |
hitPair, |
|
|
const DTLayer * |
layer |
|
) |
| |
|
private |
◆ recHitPosition() [1/2]
float DTCalibValidationFromMuons::recHitPosition |
( |
const DTRecHit1D & |
recHit, |
|
|
const DTLayer * |
layer, |
|
|
const DTChamber * |
chamber, |
|
|
float |
segmPos, |
|
|
int |
sl |
|
) |
| |
|
private |
◆ recHitPosition() [2/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.
134 float recHitPos = -1;
136 if (fabs(hitPosInChamber_left.
x() - segmentPos) < fabs(hitPosInChamber_right.
x() - segmentPos))
137 recHitPos = hitPosInChamber_left.
x();
139 recHitPos = hitPosInChamber_right.
x();
141 if (fabs(hitPosInChamber_left.
y() - segmentPos) < fabs(hitPosInChamber_right.
y() - segmentPos))
142 recHitPos = hitPosInChamber_left.
y();
144 recHitPos = hitPosInChamber_right.
y();
References relativeConstraints::chamber, DTEnums::Left, DTRecHit1DPair::localPosition(), DTEnums::Right, GeomDet::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().
◆ dtGeom
◆ histosPerSL
◆ muonToken_
◆ nevent
int DTCalibValidationFromMuons::nevent |
|
private |
◆ parameters
◆ rightSegment
int DTCalibValidationFromMuons::rightSegment |
|
private |
◆ segment4DToken_
◆ wrongSegment
int DTCalibValidationFromMuons::wrongSegment |
|
private |
T const * product() const
int wire() const
Return the wire number.
int dimension() const override
Dimension (in parameter space)
LocalVector localDirection() const override
Local direction in Chamber frame.
T const * product() const
edm::ParameterSet parameters
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Geom::Theta< T > theta() const
virtual void setCurrentFolder(std::string const &fullpath)
void compute(const DTGeometry *dtGeom, const DTRecSegment4D &segment)
T getUntrackedParameter(std::string const &, T const &) const
int superlayer() const
Return the superlayer number (deprecated method name)
LocalPoint localPosition() const override
Local position in Chamber frame.
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
edm::ESHandle< DTGeometry > dtGeom
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Cos< T >::type cos(const T &t)
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)
std::map< std::pair< DTSuperLayerId, int >, std::vector< MonitorElement * > > histosPerSL
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
C::const_iterator const_iterator
constant access iterator type
std::pair< const_iterator, const_iterator > range
iterator range
edm::EDGetTokenT< DTRecSegment4DCollection > segment4DToken_
LocalPoint localPosition() const override
Log< level::Info, true > LogVerbatim
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
const DTTopology & specificTopology() const
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
int wheel() const
Return the wheel number.
int station() const
Return the station number.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())