49 for (
unsigned int i = 0;
i < 4;
i++) {
75 ibooker.
book1D(
"hMuonTimeTimeAtIpInOutErr",
"MuonTime TimeAtIpInOutErr", 100, 0., 8.);
78 ibooker.
book1D(
"hMuonTimeTimeAtIpOutInErr",
"MuonTime TimeAtIpOutInErr", 100, 0., 8.);
80 ibooker.
book1D(
"hMuonTimeExtraCombinedNDOF",
"MuonTimeExtra Combined NDOF", 52, -1.5, 50.5);
82 ibooker.
book1D(
"hMuonTimeExtraCombinedTimeAtIpInOut",
"MuonTimeExtra Combined TimeAtIpInOut", 100, -20., 20.);
84 "hMuonTimeExtraCombinedTimeAtIpInOutErr",
"MuonTimeExtra Combined TimeAtIpInOutErr", 100, 0., 8.);
86 ibooker.
book1D(
"hMuonTimeExtraCombinedTimeAtIpOutIn",
"MuonTimeExtra Combined TimeAtIpOutIn", 100, -1., 75.);
88 "hMuonTimeExtraCombinedTimeAtIpOutInErr",
"MuonTimeExtra Combined TimeAtIpOutInErr", 100, 0., 8.);
91 ibooker.
book1D(
"hMuonTimeExtraCSCTimeAtIpInOut",
"MuonTimeExtra CSC TimeAtIpInOut", 100, -20., 20.);
93 ibooker.
book1D(
"hMuonTimeExtraCSCTimeAtIpInOutErr",
"MuonTimeExtra CSC TimeAtIpInOutErr", 100, 0., 8.);
95 ibooker.
book1D(
"hMuonTimeExtraCSCTimeAtIpOutIn",
"MuonTimeExtra CSC TimeAtIpOutIn", 100, -1., 75.);
97 ibooker.
book1D(
"hMuonTimeExtraCSCTimeAtIpOutInErr",
"MuonTimeExtra CSC TimeAtIpOutInErr", 100, 0., 8.);
100 ibooker.
book1D(
"hMuonTimeExtraDTTimeAtIpInOut",
"MuonTimeExtra DT TimeAtIpInOut", 100, -20., 20.);
102 ibooker.
book1D(
"hMuonTimeExtraDTTimeAtIpInOutErr",
"MuonTimeExtra DT TimeAtIpInOutErr", 100, 0., 8.);
104 ibooker.
book1D(
"hMuonTimeExtraDTTimeAtIpOutIn",
"MuonTimeExtra DT TimeAtIpOutIn", 100, -1., 75.);
106 ibooker.
book1D(
"hMuonTimeExtraDTTimeAtIpOutInErr",
"MuonTimeExtra DT TimeAtIpOutInErr", 100, 0., 8.);
109 hCaloCompat[
i] = ibooker.
book1D(
"hCaloCompat",
"Calo Compatibility", 101, -0.05, 1.05);
113 "hCaloSegmentCompat",
"Calo Compatibility vs. Segment Compatibility", 101, -0.05, 1.05, 101, -0.05, 1.05);
118 ibooker.
book1D(
"hGlobalMuonPromptTightBool",
"GlobalMuonPromptTight Boolean", 2, -0.5, 1.5);
122 ibooker.
book1D(
"hTM2DCompatibilityLooseBool",
"TM2DCompatibilityLoose Boolean", 2, -0.5, 1.5);
124 ibooker.
book1D(
"hTM2DCompatibilityTightBool",
"TM2DCompatibilityTight Boolean", 2, -0.5, 1.5);
128 "hTMLastStationOptimizedLowPtLooseBool",
"TMLastStationOptimizedLowPtLoose Boolean", 2, -0.5, 1.5);
130 "hTMLastStationOptimizedLowPtTightBool",
"TMLastStationOptimizedLowPtTight Boolean", 2, -0.5, 1.5);
132 ibooker.
book1D(
"hGMTkChiCompatibilityBool",
"GMTkChiCompatibility Boolean", 2, -0.5, 1.5);
134 ibooker.
book1D(
"hGMStaChiCompatibilityBool",
"GMStaChiCompatibility Boolean", 2, -0.5, 1.5);
137 ibooker.
book1D(
"hTMLastStationAngLooseBool",
"TMLastStationAngLoose Boolean", 2, -0.5, 1.5);
139 ibooker.
book1D(
"hTMLastStationAngTightBool",
"TMLastStationAngTight Boolean", 2, -0.5, 1.5);
141 ibooker.
book1D(
"hTMOneStationAngLooseBool",
"TMOneStationAngLoose Boolean", 2, -0.5, 1.5);
143 ibooker.
book1D(
"hTMOneStationAngTightBool",
"TMOneStationAngTight Boolean", 2, -0.5, 1.5);
145 "hTMLastStationOptimizedBarrelLowPtLooseBool",
"TMLastStationOptimizedBarrelLowPtLoose Boolean", 2, -0.5, 1.5);
147 "hTMLastStationOptimizedBarrelLowPtTightBool",
"TMLastStationOptimizedBarrelLowPtTight Boolean", 2, -0.5, 1.5);
151 ibooker.
book1D(
"hCombinedCosmicCompat",
"hCombinedCosmicCompatibility float", 40, 0., 10.);
161 sprintf(
title,
"Station %i Transverse Cluster Size",
station + 1);
167 sprintf(
title,
"Station %i Number of 1D DT or 2D CSC RecHits",
station + 1);
169 sprintf(
name,
"hMuonHitsFromSegments%i",
station + 1);
170 sprintf(
title,
"Station %i Hits used by 4D DT or 3D CSC Segments",
station + 1);
172 sprintf(
name,
"hMuonUncorrelatedHits%i",
station + 1);
173 sprintf(
title,
"Station %i Uncorrelated Hits",
station + 1);
178 sprintf(
title,
"DT Station %i Pull X w/ Propagation Error Only",
station + 1);
181 sprintf(
name,
"hDT%iPulldXdZPropErr",
station + 1);
182 sprintf(
title,
"DT Station %i Pull DxDz w/ Propagation Error Only",
station + 1);
187 sprintf(
title,
"DT Station %i Pull Y w/ Propagation Error Only",
station + 1);
190 sprintf(
name,
"hDT%iPulldYdZPropErr",
station + 1);
191 sprintf(
title,
"DT Station %i Pull DyDz w/ Propagation Error Only",
station + 1);
195 sprintf(
name,
"hDT%iDistWithSegment",
station + 1);
196 sprintf(
title,
"DT Station %i Dist When There Is A Segment",
station + 1);
199 sprintf(
name,
"hDT%iDistWithNoSegment",
station + 1);
200 sprintf(
title,
"DT Station %i Dist When There Is No Segment",
station + 1);
203 sprintf(
name,
"hDT%iPullDistWithSegment",
station + 1);
204 sprintf(
title,
"DT Station %i Pull Dist When There Is A Segment",
station + 1);
207 sprintf(
name,
"hDT%iPullDistWithNoSegment",
station + 1);
208 sprintf(
title,
"DT Station %i Pull Dist When There Is No Segment",
station + 1);
212 sprintf(
title,
"CSC Station %i Pull X w/ Propagation Error Only",
station + 1);
215 sprintf(
name,
"hCSC%iPulldXdZPropErr",
station + 1);
216 sprintf(
title,
"CSC Station %i Pull DxDz w/ Propagation Error Only",
station + 1);
220 sprintf(
title,
"CSC Station %i Pull Y w/ Propagation Error Only",
station + 1);
223 sprintf(
name,
"hCSC%iPulldYdZPropErr",
station + 1);
224 sprintf(
title,
"CSC Station %i Pull DyDz w/ Propagation Error Only",
station + 1);
227 sprintf(
name,
"hCSC%iDistWithSegment",
station + 1);
228 sprintf(
title,
"CSC Station %i Dist When There Is A Segment",
station + 1);
231 sprintf(
name,
"hCSC%iDistWithNoSegment",
station + 1);
232 sprintf(
title,
"CSC Station %i Dist When There Is No Segment",
station + 1);
235 sprintf(
name,
"hCSC%iPullDistWithSegment",
station + 1);
236 sprintf(
title,
"CSC Station %i Pull Dist When There Is A Segment",
station + 1);
239 sprintf(
name,
"hCSC%iPullDistWithNoSegment",
station + 1);
240 sprintf(
title,
"CSC Station %i Pull Dist When There Is No Segment",
station + 1);
248 ibooker.
book2D(
"hSegmentIsAssociatedRZ",
"R-Z of Associated Segments", 2140, -1070., 1070., 850, 0., 850.);
250 ibooker.
book2D(
"hSegmentIsAssociatedXY",
"X-Y of Associated Segments", 1700, -850., 850., 1700, -850., 850.);
252 "hSegmentIsNotAssociatedRZ",
"R-Z of Not Associated Segments", 2140, -1070., 1070., 850, 0., 850.);
254 "hSegmentIsNotAssociatedXY",
"X-Y of Not Associated Segments", 1700, -850., 850., 1700, -850., 850.);
256 "R-Z of Best in Station by #DeltaR Associated Segments",
264 "X-Y of Best in Station by #DeltaR Associated Segments",
272 "R-Z of Best in Station by #DeltaR Not Associated Segments",
280 "X-Y of Best in Station by #DeltaR Not Associated Segments",
297 for (
int sector = 0; sector < 14; ++sector) {
299 sprintf(
title,
"DT Chamber Delta X: Station %i Wheel %i Sector %i",
station + 1,
wheel - 2, sector + 1);
304 sprintf(
title,
"DT Chamber Delta Y: Station %i Wheel %i Sector %i",
station + 1,
wheel - 2, sector + 1);
308 sprintf(
name,
"hDTChamberEdgeXWithSegment_%i_%i_%i",
station + 1,
wheel - 2, sector + 1);
310 "DT Chamber Edge X When There Is A Segment: Station %i Wheel "
317 sprintf(
name,
"hDTChamberEdgeXWithNoSegment_%i_%i_%i",
station + 1,
wheel - 2, sector + 1);
319 "DT Chamber Edge X When There Is No Segment: Station %i "
320 "Wheel %i Sector %i",
326 sprintf(
name,
"hDTChamberEdgeYWithSegment_%i_%i_%i",
station + 1,
wheel - 2, sector + 1);
328 "DT Chamber Edge Y When There Is A Segment: Station %i Wheel "
335 sprintf(
name,
"hDTChamberEdgeYWithNoSegment_%i_%i_%i",
station + 1,
wheel - 2, sector + 1);
337 "DT Chamber Edge Y When There Is No Segment: Station %i "
338 "Wheel %i Sector %i",
354 "CSC Chamber Delta X: Endcap %i Station %i Ring %i Chamber %i",
363 "CSC Chamber Delta Y: Endcap %i Station %i Ring %i Chamber %i",
372 "CSC Chamber Edge X When There Is A Segment: Endcap %i "
373 "Station %i Ring %i Chamber %i",
382 "CSC Chamber Edge X When There Is No Segment: Endcap %i "
383 "Station %i Ring %i Chamber %i",
392 "CSC Chamber Edge Y When There Is A Segment: Endcap %i "
393 "Station %i Ring %i Chamber %i",
402 "CSC Chamber Edge Y When There Is No Segment: Endcap %i "
403 "Station %i Ring %i Chamber %i",
418 using namespace reco;
435 for (
unsigned int i = 0;
i < 4;
i++) {
447 if (fabs(
muon->eta()) > 1.479)
452 if (fabs(
muon->eta()) > 1.4)
457 if (fabs(
muon->eta()) < 1.26)
462 if (
muon->isTimeValid()) {
471 MuonTimeExtra combinedMuonTimeExtra = (*combinedMuonTimeExtraValueMapH_)[muonRef];
472 MuonTimeExtra cscMuonTimeExtra = (*cscMuonTimeExtraValueMapH_)[muonRef];
473 MuonTimeExtra dtMuonTimeExtra = (*dtMuonTimeExtraValueMapH_)[muonRef];
492 if (
muon->isCaloCompatibilityValid())
497 if (
muon->isQualityValid()) {
599 for (std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
600 chamberMatch !=
muon->matches().end();
602 int station = chamberMatch->station();
606 int wheel = dtId.wheel();
607 int sector = dtId.sector();
609 if (chamberMatch->segmentMatches.empty()) {
616 for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
617 segmentMatch != chamberMatch->segmentMatches.end();
619 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
632 CSCDetId cscId(chamberMatch->id.rawId());
633 int endcap = cscId.endcap();
634 int ring = cscId.ring();
637 if (chamberMatch->segmentMatches.empty()) {
644 for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
645 segmentMatch != chamberMatch->segmentMatches.end();
647 if (segmentMatch->isMask(MuonSegmentMatch::BestInChamberByDR)) {
666 LocalPoint segmentLocalPosition = segment->localPosition();
667 LocalVector segmentLocalDirection = segment->localDirection();
668 LocalError segmentLocalPositionError = segment->localPositionError();
669 LocalError segmentLocalDirectionError = segment->localDirectionError();
672 bool segmentFound =
false;
673 bool segmentBestDrFound =
false;
676 if (!
muon->isMatchesValid())
679 for (std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
680 chamberMatch !=
muon->matches().end();
682 for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
683 segmentMatch != chamberMatch->segmentMatches.end();
685 if (fabs(segmentMatch->x - segmentLocalPosition.
x()) < 1E-6 &&
686 fabs(segmentMatch->y - segmentLocalPosition.
y()) < 1E-6 &&
687 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x() / segmentLocalDirection.
z()) < 1E-6 &&
688 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y() / segmentLocalDirection.
z()) < 1E-6 &&
689 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx())) < 1E-6 &&
690 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy())) < 1E-6 &&
691 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx())) < 1E-6 &&
692 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy())) < 1E-6) {
695 segmentBestDrFound =
true;
710 if (segmentBestDrFound) {
725 LocalPoint segmentLocalPosition = segment->localPosition();
726 LocalVector segmentLocalDirection = segment->localDirection();
727 LocalError segmentLocalPositionError = segment->localPositionError();
728 LocalError segmentLocalDirectionError = segment->localDirectionError();
731 bool segmentFound =
false;
732 bool segmentBestDrFound =
false;
735 if (!
muon->isMatchesValid())
738 for (std::vector<MuonChamberMatch>::const_iterator chamberMatch =
muon->matches().begin();
739 chamberMatch !=
muon->matches().end();
741 for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin();
742 segmentMatch != chamberMatch->segmentMatches.end();
744 if (fabs(segmentMatch->x - segmentLocalPosition.
x()) < 1E-6 &&
745 fabs(segmentMatch->y - segmentLocalPosition.
y()) < 1E-6 &&
746 fabs(segmentMatch->dXdZ - segmentLocalDirection.
x() / segmentLocalDirection.
z()) < 1E-6 &&
747 fabs(segmentMatch->dYdZ - segmentLocalDirection.
y() / segmentLocalDirection.
z()) < 1E-6 &&
748 fabs(segmentMatch->xErr -
sqrt(segmentLocalPositionError.
xx())) < 1E-6 &&
749 fabs(segmentMatch->yErr -
sqrt(segmentLocalPositionError.
yy())) < 1E-6 &&
750 fabs(segmentMatch->dXdZErr -
sqrt(segmentLocalDirectionError.
xx())) < 1E-6 &&
751 fabs(segmentMatch->dYdZErr -
sqrt(segmentLocalDirectionError.
yy())) < 1E-6) {
754 segmentBestDrFound =
true;
769 if (segmentBestDrFound) {
783 if (fabs(
f) > 900000)