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) {
261 recHitPos =
recHitPosition(*recHit1D, layer, chamber, segPosAtZWire.
x(), sl);
262 residualOnPosition = recHitPos - segPosAtZWire.
x();
264 recHitPos =
recHitPosition(*recHit1D, layer, chamber, segPosAtZWire.
y(), sl);
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()),
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
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.
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.
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.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Geom::Theta< T > theta() const
const DTTopology & specificTopology() const
float recHitDistFromWire(const DTRecHit1DPair &hitPair, const DTLayer *layer)
Cos< T >::type cos(const T &t)
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
int wire() const
Return the wire number.
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.