48 for (
unsigned int i = 0;
i < 4;
i++) {
74 ibooker.
book1D(
"hMuonTimeTimeAtIpInOutErr",
"MuonTime TimeAtIpInOutErr", 100, 0., 8.);
77 ibooker.
book1D(
"hMuonTimeTimeAtIpOutInErr",
"MuonTime TimeAtIpOutInErr", 100, 0., 8.);
79 ibooker.
book1D(
"hMuonTimeExtraCombinedNDOF",
"MuonTimeExtra Combined NDOF", 52, -1.5, 50.5);
81 ibooker.
book1D(
"hMuonTimeExtraCombinedTimeAtIpInOut",
"MuonTimeExtra Combined TimeAtIpInOut", 100, -20., 20.);
83 "hMuonTimeExtraCombinedTimeAtIpInOutErr",
"MuonTimeExtra Combined TimeAtIpInOutErr", 100, 0., 8.);
85 ibooker.
book1D(
"hMuonTimeExtraCombinedTimeAtIpOutIn",
"MuonTimeExtra Combined TimeAtIpOutIn", 100, -1., 75.);
87 "hMuonTimeExtraCombinedTimeAtIpOutInErr",
"MuonTimeExtra Combined TimeAtIpOutInErr", 100, 0., 8.);
90 ibooker.
book1D(
"hMuonTimeExtraCSCTimeAtIpInOut",
"MuonTimeExtra CSC TimeAtIpInOut", 100, -20., 20.);
92 ibooker.
book1D(
"hMuonTimeExtraCSCTimeAtIpInOutErr",
"MuonTimeExtra CSC TimeAtIpInOutErr", 100, 0., 8.);
94 ibooker.
book1D(
"hMuonTimeExtraCSCTimeAtIpOutIn",
"MuonTimeExtra CSC TimeAtIpOutIn", 100, -1., 75.);
96 ibooker.
book1D(
"hMuonTimeExtraCSCTimeAtIpOutInErr",
"MuonTimeExtra CSC TimeAtIpOutInErr", 100, 0., 8.);
99 ibooker.
book1D(
"hMuonTimeExtraDTTimeAtIpInOut",
"MuonTimeExtra DT TimeAtIpInOut", 100, -20., 20.);
101 ibooker.
book1D(
"hMuonTimeExtraDTTimeAtIpInOutErr",
"MuonTimeExtra DT TimeAtIpInOutErr", 100, 0., 8.);
103 ibooker.
book1D(
"hMuonTimeExtraDTTimeAtIpOutIn",
"MuonTimeExtra DT TimeAtIpOutIn", 100, -1., 75.);
105 ibooker.
book1D(
"hMuonTimeExtraDTTimeAtIpOutInErr",
"MuonTimeExtra DT TimeAtIpOutInErr", 100, 0., 8.);
108 hCaloCompat[
i] = ibooker.
book1D(
"hCaloCompat",
"Calo Compatibility", 101, -0.05, 1.05);
112 "hCaloSegmentCompat",
"Calo Compatibility vs. Segment Compatibility", 101, -0.05, 1.05, 101, -0.05, 1.05);
117 ibooker.
book1D(
"hGlobalMuonPromptTightBool",
"GlobalMuonPromptTight Boolean", 2, -0.5, 1.5);
121 ibooker.
book1D(
"hTM2DCompatibilityLooseBool",
"TM2DCompatibilityLoose Boolean", 2, -0.5, 1.5);
123 ibooker.
book1D(
"hTM2DCompatibilityTightBool",
"TM2DCompatibilityTight Boolean", 2, -0.5, 1.5);
127 "hTMLastStationOptimizedLowPtLooseBool",
"TMLastStationOptimizedLowPtLoose Boolean", 2, -0.5, 1.5);
129 "hTMLastStationOptimizedLowPtTightBool",
"TMLastStationOptimizedLowPtTight Boolean", 2, -0.5, 1.5);
131 ibooker.
book1D(
"hGMTkChiCompatibilityBool",
"GMTkChiCompatibility Boolean", 2, -0.5, 1.5);
133 ibooker.
book1D(
"hGMStaChiCompatibilityBool",
"GMStaChiCompatibility Boolean", 2, -0.5, 1.5);
136 ibooker.
book1D(
"hTMLastStationAngLooseBool",
"TMLastStationAngLoose Boolean", 2, -0.5, 1.5);
138 ibooker.
book1D(
"hTMLastStationAngTightBool",
"TMLastStationAngTight Boolean", 2, -0.5, 1.5);
140 ibooker.
book1D(
"hTMOneStationAngLooseBool",
"TMOneStationAngLoose Boolean", 2, -0.5, 1.5);
142 ibooker.
book1D(
"hTMOneStationAngTightBool",
"TMOneStationAngTight Boolean", 2, -0.5, 1.5);
144 "hTMLastStationOptimizedBarrelLowPtLooseBool",
"TMLastStationOptimizedBarrelLowPtLoose Boolean", 2, -0.5, 1.5);
146 "hTMLastStationOptimizedBarrelLowPtTightBool",
"TMLastStationOptimizedBarrelLowPtTight Boolean", 2, -0.5, 1.5);
150 ibooker.
book1D(
"hCombinedCosmicCompat",
"hCombinedCosmicCompatibility float", 40, 0., 10.);
160 sprintf(
title,
"Station %i Transverse Cluster Size",
station + 1);
166 sprintf(
title,
"Station %i Number of 1D DT or 2D CSC RecHits",
station + 1);
168 sprintf(
name,
"hMuonHitsFromSegments%i",
station + 1);
169 sprintf(
title,
"Station %i Hits used by 4D DT or 3D CSC Segments",
station + 1);
171 sprintf(
name,
"hMuonUncorrelatedHits%i",
station + 1);
172 sprintf(
title,
"Station %i Uncorrelated Hits",
station + 1);
177 sprintf(
title,
"DT Station %i Pull X w/ Propagation Error Only",
station + 1);
180 sprintf(
name,
"hDT%iPulldXdZPropErr",
station + 1);
181 sprintf(
title,
"DT Station %i Pull DxDz w/ Propagation Error Only",
station + 1);
186 sprintf(
title,
"DT Station %i Pull Y w/ Propagation Error Only",
station + 1);
189 sprintf(
name,
"hDT%iPulldYdZPropErr",
station + 1);
190 sprintf(
title,
"DT Station %i Pull DyDz w/ Propagation Error Only",
station + 1);
194 sprintf(
name,
"hDT%iDistWithSegment",
station + 1);
195 sprintf(
title,
"DT Station %i Dist When There Is A Segment",
station + 1);
198 sprintf(
name,
"hDT%iDistWithNoSegment",
station + 1);
199 sprintf(
title,
"DT Station %i Dist When There Is No Segment",
station + 1);
202 sprintf(
name,
"hDT%iPullDistWithSegment",
station + 1);
203 sprintf(
title,
"DT Station %i Pull Dist When There Is A Segment",
station + 1);
206 sprintf(
name,
"hDT%iPullDistWithNoSegment",
station + 1);
207 sprintf(
title,
"DT Station %i Pull Dist When There Is No Segment",
station + 1);
211 sprintf(
title,
"CSC Station %i Pull X w/ Propagation Error Only",
station + 1);
214 sprintf(
name,
"hCSC%iPulldXdZPropErr",
station + 1);
215 sprintf(
title,
"CSC Station %i Pull DxDz w/ Propagation Error Only",
station + 1);
219 sprintf(
title,
"CSC Station %i Pull Y w/ Propagation Error Only",
station + 1);
222 sprintf(
name,
"hCSC%iPulldYdZPropErr",
station + 1);
223 sprintf(
title,
"CSC Station %i Pull DyDz w/ Propagation Error Only",
station + 1);
226 sprintf(
name,
"hCSC%iDistWithSegment",
station + 1);
227 sprintf(
title,
"CSC Station %i Dist When There Is A Segment",
station + 1);
230 sprintf(
name,
"hCSC%iDistWithNoSegment",
station + 1);
231 sprintf(
title,
"CSC Station %i Dist When There Is No Segment",
station + 1);
234 sprintf(
name,
"hCSC%iPullDistWithSegment",
station + 1);
235 sprintf(
title,
"CSC Station %i Pull Dist When There Is A Segment",
station + 1);
238 sprintf(
name,
"hCSC%iPullDistWithNoSegment",
station + 1);
239 sprintf(
title,
"CSC Station %i Pull Dist When There Is No Segment",
station + 1);
247 ibooker.
book2D(
"hSegmentIsAssociatedRZ",
"R-Z of Associated Segments", 2140, -1070., 1070., 850, 0., 850.);
249 ibooker.
book2D(
"hSegmentIsAssociatedXY",
"X-Y of Associated Segments", 1700, -850., 850., 1700, -850., 850.);
251 "hSegmentIsNotAssociatedRZ",
"R-Z of Not Associated Segments", 2140, -1070., 1070., 850, 0., 850.);
253 "hSegmentIsNotAssociatedXY",
"X-Y of Not Associated Segments", 1700, -850., 850., 1700, -850., 850.);
255 "R-Z of Best in Station by #DeltaR Associated Segments",
263 "X-Y of Best in Station by #DeltaR Associated Segments",
271 "R-Z of Best in Station by #DeltaR Not Associated Segments",
279 "X-Y of Best in Station by #DeltaR Not Associated Segments",
296 for (
int sector = 0; sector < 14; ++sector) {
298 sprintf(
title,
"DT Chamber Delta X: Station %i Wheel %i Sector %i",
station + 1,
wheel - 2, sector + 1);
303 sprintf(
title,
"DT Chamber Delta Y: Station %i Wheel %i Sector %i",
station + 1,
wheel - 2, sector + 1);
307 sprintf(
name,
"hDTChamberEdgeXWithSegment_%i_%i_%i",
station + 1,
wheel - 2, sector + 1);
309 "DT Chamber Edge X When There Is A Segment: Station %i Wheel "
316 sprintf(
name,
"hDTChamberEdgeXWithNoSegment_%i_%i_%i",
station + 1,
wheel - 2, sector + 1);
318 "DT Chamber Edge X When There Is No Segment: Station %i "
319 "Wheel %i Sector %i",
325 sprintf(
name,
"hDTChamberEdgeYWithSegment_%i_%i_%i",
station + 1,
wheel - 2, sector + 1);
327 "DT Chamber Edge Y When There Is A Segment: Station %i Wheel "
334 sprintf(
name,
"hDTChamberEdgeYWithNoSegment_%i_%i_%i",
station + 1,
wheel - 2, sector + 1);
336 "DT Chamber Edge Y When There Is No Segment: Station %i "
337 "Wheel %i Sector %i",
353 "CSC Chamber Delta X: Endcap %i Station %i Ring %i Chamber %i",
362 "CSC Chamber Delta Y: Endcap %i Station %i Ring %i Chamber %i",
371 "CSC Chamber Edge X When There Is A Segment: Endcap %i "
372 "Station %i Ring %i Chamber %i",
381 "CSC Chamber Edge X When There Is No Segment: Endcap %i "
382 "Station %i Ring %i Chamber %i",
391 "CSC Chamber Edge Y When There Is A Segment: Endcap %i "
392 "Station %i Ring %i Chamber %i",
401 "CSC Chamber Edge Y When There Is No Segment: Endcap %i "
402 "Station %i Ring %i Chamber %i",
417 using namespace reco;
434 for (
unsigned int i = 0;
i < 4;
i++) {
446 if (fabs(
muon->eta()) > 1.479)
451 if (fabs(
muon->eta()) > 1.4)
456 if (fabs(
muon->eta()) < 1.26)
461 if (
muon->isTimeValid()) {
470 MuonTimeExtra combinedMuonTimeExtra = (*combinedMuonTimeExtraValueMapH_)[muonRef];
471 MuonTimeExtra cscMuonTimeExtra = (*cscMuonTimeExtraValueMapH_)[muonRef];
472 MuonTimeExtra dtMuonTimeExtra = (*dtMuonTimeExtraValueMapH_)[muonRef];
491 if (
muon->isCaloCompatibilityValid())
496 if (
muon->isQualityValid()) {
598 for (std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
599 chamberMatch !=
muon->matches().end();
601 int station = chamberMatch->station();
605 int wheel = dtId.wheel();
606 int sector = dtId.sector();
608 if (chamberMatch->segmentMatches.empty()) {
615 for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
616 segmentMatch != chamberMatch->segmentMatches.end();
618 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
631 CSCDetId cscId(chamberMatch->id.rawId());
632 int endcap = cscId.endcap();
633 int ring = cscId.ring();
636 if (chamberMatch->segmentMatches.empty()) {
643 for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
644 segmentMatch != chamberMatch->segmentMatches.end();
646 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
665 LocalPoint segmentLocalPosition = segment->localPosition();
666 LocalVector segmentLocalDirection = segment->localDirection();
667 LocalError segmentLocalPositionError = segment->localPositionError();
668 LocalError segmentLocalDirectionError = segment->localDirectionError();
671 bool segmentFound =
false;
672 bool segmentBestDrFound =
false;
675 if (!
muon->isMatchesValid())
678 for (std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
679 chamberMatch !=
muon->matches().end();
681 for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
682 segmentMatch != chamberMatch->segmentMatches.end();
684 if (fabs(segmentMatch->x - segmentLocalPosition.
x()) < 1E-6 &&
685 fabs(segmentMatch->y - segmentLocalPosition.
y()) < 1E-6 &&
686 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x() / segmentLocalDirection.
z()) < 1E-6 &&
687 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y() / segmentLocalDirection.
z()) < 1E-6 &&
688 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx())) < 1E-6 &&
689 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy())) < 1E-6 &&
690 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx())) < 1E-6 &&
691 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy())) < 1E-6) {
694 segmentBestDrFound =
true;
709 if (segmentBestDrFound) {
724 LocalPoint segmentLocalPosition = segment->localPosition();
725 LocalVector segmentLocalDirection = segment->localDirection();
726 LocalError segmentLocalPositionError = segment->localPositionError();
727 LocalError segmentLocalDirectionError = segment->localDirectionError();
730 bool segmentFound =
false;
731 bool segmentBestDrFound =
false;
734 if (!
muon->isMatchesValid())
737 for (std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
738 chamberMatch !=
muon->matches().end();
740 for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
741 segmentMatch != chamberMatch->segmentMatches.end();
743 if (fabs(segmentMatch->x - segmentLocalPosition.
x()) < 1E-6 &&
744 fabs(segmentMatch->y - segmentLocalPosition.
y()) < 1E-6 &&
745 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x() / segmentLocalDirection.
z()) < 1E-6 &&
746 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y() / segmentLocalDirection.
z()) < 1E-6 &&
747 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx())) < 1E-6 &&
748 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy())) < 1E-6 &&
749 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx())) < 1E-6 &&
750 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy())) < 1E-6) {
753 segmentBestDrFound =
true;
768 if (segmentBestDrFound) {
782 if (fabs(
f) > 900000)