198 bool computeResidual =
true;
201 vector<DTRecHit1D> recHits1D_S3;
208 if (phiRecHits.size() < 7) {
209 LogTrace(
"DTCalibValidationFromMuons")
210 <<
"[DTCalibValidationFromMuons] Phi segments has: " 211 << phiRecHits.size() <<
" hits, skipping";
212 computeResidual =
false;
214 copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
217 LogTrace(
"DTCalibValidationFromMuons")
218 <<
" [DTCalibValidationFromMuons] 4D segment has no phi segment! ";
219 computeResidual =
false;
226 if (zRecHits.size() != 4) {
227 LogTrace(
"DTCalibValidationFromMuons")
228 <<
"[DTCalibValidationFromMuons] Theta segments has: " 229 << zRecHits.size() <<
" hits, skipping";
230 computeResidual =
false;
232 copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
235 LogTrace(
"DTCalibValidationFromMuons")
236 <<
" [DTCalibValidationFromMuons] 4D segment has not the z segment! ";
237 computeResidual =
false;
241 if (!computeResidual)
244 if (computeResidual) {
248 for (vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin();
249 recHit1D != recHits1D_S3.end(); ++recHit1D) {
250 const DTWireId wireId = (*recHit1D).wireId();
260 LocalPoint wirePosInLay(wireX, (*recHit1D).localPosition().y(),
261 (*recHit1D).localPosition().z());
264 dtGeom->
chamber((*recHit1D).wireId().layerId().chamberId());
270 wirePosInChamber.
z() /
275 float SegmDistance = -1;
276 if (sl == 1 || sl == 3) {
278 SegmDistance = fabs(wirePosInChamber.
x() - segPosAtZWire.
x());
279 LogTrace(
"DTCalibValidationFromMuons")
280 <<
"SegmDistance: " << SegmDistance;
281 }
else if (sl == 2) {
283 SegmDistance = fabs(segPosAtZWire.
y() - wirePosInChamber.
y());
284 LogTrace(
"DTCalibValidationFromMuons")
285 <<
"SegmDistance: " << SegmDistance;
288 if (SegmDistance > 2.1)
289 LogTrace(
"DTCalibValidationFromMuons")
290 <<
" Warning: dist segment-wire: " << SegmDistance;
294 LogTrace(
"DTCalibValidationFromMuons")
295 <<
"recHitWireDist: " << recHitWireDist;
298 float residualOnDistance = recHitWireDist - SegmDistance;
299 LogTrace(
"DTCalibValidationFromMuons")
300 <<
"WireId: " << wireId
301 <<
" ResidualOnDistance: " << residualOnDistance;
302 float residualOnPosition = -1;
303 float recHitPos = -1;
304 if (sl == 1 || sl == 3) {
307 residualOnPosition = recHitPos - segPosAtZWire.
x();
311 residualOnPosition = recHitPos - segPosAtZWire.
y();
313 LogTrace(
"DTCalibValidationFromMuons")
314 <<
"WireId: " << wireId
315 <<
" ResidualOnPosition: " << residualOnPosition;
318 if (sl == 1 || sl == 3)
320 (wirePosInChamber.
x() - segPosAtZWire.
x()),
321 residualOnPosition, 3);
324 (wirePosInChamber.
y() - segPosAtZWire.
y()),
325 residualOnPosition, 3);
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.