11 matchesValid_ =
false;
12 isolationValid_ =
false;
13 pfIsolationValid_ =
false;
14 qualityValid_ =
false;
15 caloCompatibility_ = -9999.;
24 matchesValid_ =
false;
25 isolationValid_ =
false;
26 pfIsolationValid_ =
false;
27 qualityValid_ =
false;
28 caloCompatibility_ = -9999.;
44 int Muon::numberOfChambersCSCorDT()
const {
46 int nAll = numberOfChambers();
47 for (
int iC = 0; iC < nAll; ++iC) {
55 int Muon::numberOfMatches(ArbitrationType
type)
const {
57 for (
auto& chamberMatch : muMatches_) {
58 if (
type == RPCHitAndTrackArbitration) {
59 if (chamberMatch.rpcMatches.empty())
61 matches += chamberMatch.rpcMatches.size();
64 if (
type == ME0SegmentAndTrackArbitration) {
65 if (chamberMatch.me0Matches.empty())
67 matches += chamberMatch.me0Matches.size();
70 if (
type == GEMSegmentAndTrackArbitration) {
71 if (chamberMatch.gemMatches.empty())
73 matches += chamberMatch.gemMatches.size();
77 if (chamberMatch.segmentMatches.empty())
79 if (
type == NoArbitration) {
84 for (
auto& segmentMatch : chamberMatch.segmentMatches) {
85 if (
type == SegmentArbitration)
86 if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR)) {
90 if (
type == SegmentAndTrackArbitration)
91 if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR) &&
92 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
96 if (
type == SegmentAndTrackArbitrationCleaned)
97 if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR) &&
98 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
99 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
109 int Muon::numberOfMatchedStations(ArbitrationType
type)
const {
112 unsigned int theStationMask = stationMask(
type);
114 for (
int it = 0; it < 8; ++it)
115 if (theStationMask & 1 << it)
121 unsigned int Muon::expectedNnumberOfMatchedStations(
float minDistanceFromEdge)
const {
122 unsigned int stationMask = 0;
123 minDistanceFromEdge =
std::abs(minDistanceFromEdge);
124 for (
auto& chamberMatch : muMatches_) {
127 float edgeX = chamberMatch.edgeX;
128 float edgeY = chamberMatch.edgeY;
130 if (edgeX < 0 && -edgeX > minDistanceFromEdge && edgeY < 0 && -edgeY > minDistanceFromEdge)
131 stationMask |= 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
134 for (
unsigned int i = 0;
i < 8; ++
i)
135 if (stationMask & (1 <<
i))
140 unsigned int Muon::stationMask(ArbitrationType
type)
const {
141 unsigned int totMask(0);
142 unsigned int curMask(0);
144 for (
auto& chamberMatch : muMatches_) {
145 if (
type == RPCHitAndTrackArbitration) {
146 if (chamberMatch.rpcMatches.empty())
149 int rpcIndex = rollId.
region() == 0 ? 1 : 2;
150 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (rpcIndex - 1));
152 if (!(totMask & curMask))
157 if (chamberMatch.segmentMatches.empty())
159 if (
type == NoArbitration) {
160 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
162 if (!(totMask & curMask))
167 for (
auto& segmentMatch : chamberMatch.segmentMatches) {
168 if (
type == SegmentArbitration)
169 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR)) {
170 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
172 if (!(totMask & curMask))
176 if (
type == SegmentAndTrackArbitration)
177 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
178 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
179 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
181 if (!(totMask & curMask))
185 if (
type == SegmentAndTrackArbitrationCleaned)
186 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
187 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
188 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
189 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
191 if (!(totMask & curMask))
201 int Muon::numberOfMatchedRPCLayers(ArbitrationType
type)
const {
204 unsigned int theRPCLayerMask = RPClayerMask(
type);
206 for (
int it = 0; it < 10; ++it)
207 if (theRPCLayerMask & 1 << it)
213 unsigned int Muon::RPClayerMask(ArbitrationType
type)
const {
214 unsigned int totMask(0);
215 unsigned int curMask(0);
216 for (
auto& chamberMatch : muMatches_) {
217 if (chamberMatch.rpcMatches.empty())
232 curMask = 1 << (rpcLayer - 1);
234 if (!(totMask & curMask))
241 unsigned int Muon::stationGapMaskDistance(
float distanceCut)
const {
242 unsigned int totMask(0);
243 distanceCut =
std::abs(distanceCut);
244 for (
auto& chamberMatch : muMatches_) {
245 unsigned int curMask(0);
246 const int detectorIndex = chamberMatch.detector();
247 if (detectorIndex < 1 || detectorIndex >= 4)
250 if (stationIndex < 1 || stationIndex >= 5)
253 float edgeX = chamberMatch.edgeX;
254 float edgeY = chamberMatch.edgeY;
255 if (edgeX < 0 && -edgeX > distanceCut && edgeY < 0 &&
256 -edgeY > distanceCut)
259 if ((
std::abs(edgeX) < distanceCut && edgeY < distanceCut) ||
260 (
std::abs(edgeY) < distanceCut && edgeX < distanceCut))
261 curMask = 1 << ((
stationIndex - 1) + 4 * (detectorIndex - 1));
268 unsigned int Muon::stationGapMaskPull(
float sigmaCut)
const {
270 unsigned int totMask(0);
271 for (
auto& chamberMatch : muMatches_) {
272 unsigned int curMask(0);
273 const int detectorIndex = chamberMatch.detector();
274 if (detectorIndex < 1 || detectorIndex >= 4)
277 if (stationIndex < 1 || stationIndex >= 5)
280 float edgeX = chamberMatch.edgeX;
281 float edgeY = chamberMatch.edgeY;
282 float xErr = chamberMatch.xErr + 0.000001;
283 float yErr = chamberMatch.yErr + 0.000001;
290 curMask = 1 << ((
stationIndex - 1) + 4 * (detectorIndex - 1));
297 int Muon::nDigisInStation(
int station,
int muonSubdetId)
const {
299 std::map<int, int> me11DigisPerCh;
304 for (
auto&
match : muMatches_) {
308 int nDigisInCh =
match.nDigisInRange;
314 int ring =
id.ring();
318 if (me11DigisPerCh.find(
chamber) == me11DigisPerCh.end())
321 me11DigisPerCh[
chamber] += nDigisInCh;
327 if (nDigisInCh > nDigis)
331 for (
const auto& me11DigisInCh : me11DigisPerCh) {
332 int nMe11DigisInCh = me11DigisInCh.second;
333 if (nMe11DigisInCh > nDigis)
334 nDigis = nMe11DigisInCh;
340 bool Muon::hasShowerInStation(
int station,
int muonSubdetId,
int nDtDigisCut,
int nCscDigisCut)
const {
343 auto nDigisCut = muonSubdetId ==
MuonSubdetId::DT ? nDtDigisCut : nCscDigisCut;
345 return nDigisInStation(
station, muonSubdetId) >= nDigisCut;
348 int Muon::numberOfShowers(
int nDtDigisCut,
int nCscDigisCut)
const {
360 int Muon::numberOfSegments(
int station,
int muonSubdetId, ArbitrationType
type)
const {
362 for (
auto& chamberMatch : muMatches_) {
363 if (chamberMatch.segmentMatches.empty())
365 if (chamberMatch.detector() != muonSubdetId || chamberMatch.station() !=
station)
368 if (
type == NoArbitration) {
369 segments += chamberMatch.segmentMatches.size();
373 for (
auto& segmentMatch : chamberMatch.segmentMatches) {
374 if (
type == SegmentArbitration)
375 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR)) {
379 if (
type == SegmentAndTrackArbitration)
380 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
381 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
385 if (
type == SegmentAndTrackArbitrationCleaned)
386 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
387 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
388 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
399 std::vector<const MuonChamberMatch*>
chambers;
400 for (std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
401 chamberMatch != muMatches_.end();
403 if (chamberMatch->detector() == muonSubdetId && chamberMatch->station() ==
station)
404 chambers.push_back(&(*chamberMatch));
408 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> Muon::pair(
409 const std::vector<const MuonChamberMatch*>&
chambers, ArbitrationType
type)
const {
412 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair(
m,
s);
415 return chamberSegmentPair;
416 for (std::vector<const MuonChamberMatch*>::const_iterator chamberMatch =
chambers.begin();
419 if ((*chamberMatch)->segmentMatches.empty())
421 if (
type == NoArbitration)
422 return std::make_pair(*chamberMatch, &((*chamberMatch)->segmentMatches.front()));
424 for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = (*chamberMatch)->segmentMatches.begin();
425 segmentMatch != (*chamberMatch)->segmentMatches.end();
427 if (
type == SegmentArbitration)
428 if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR))
429 return std::make_pair(*chamberMatch, &(*segmentMatch));
430 if (
type == SegmentAndTrackArbitration)
431 if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
432 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR))
433 return std::make_pair(*chamberMatch, &(*segmentMatch));
434 if (
type == SegmentAndTrackArbitrationCleaned)
435 if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
436 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
437 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning))
438 return std::make_pair(*chamberMatch, &(*segmentMatch));
442 return chamberSegmentPair;
445 float Muon::dX(
int station,
int muonSubdetId, ArbitrationType
type)
const {
446 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
448 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
450 if (!chamberSegmentPair.second->hasPhi())
452 return chamberSegmentPair.first->x - chamberSegmentPair.second->x;
455 float Muon::dY(
int station,
int muonSubdetId, ArbitrationType
type)
const {
458 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
460 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
462 if (!chamberSegmentPair.second->hasZed())
464 return chamberSegmentPair.first->y - chamberSegmentPair.second->y;
467 float Muon::dDxDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
468 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
470 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
472 if (!chamberSegmentPair.second->hasPhi())
474 return chamberSegmentPair.first->dXdZ - chamberSegmentPair.second->dXdZ;
477 float Muon::dDyDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
480 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
482 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
484 if (!chamberSegmentPair.second->hasZed())
486 return chamberSegmentPair.first->dYdZ - chamberSegmentPair.second->dYdZ;
489 float Muon::pullX(
int station,
int muonSubdetId, ArbitrationType
type,
bool includeSegmentError)
const {
490 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
492 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
494 if (!chamberSegmentPair.second->hasPhi())
496 if (includeSegmentError)
497 return (chamberSegmentPair.first->x - chamberSegmentPair.second->x) /
498 sqrt(
std::pow(chamberSegmentPair.first->xErr, 2) +
std::pow(chamberSegmentPair.second->xErr, 2));
499 return (chamberSegmentPair.first->x - chamberSegmentPair.second->x) / chamberSegmentPair.first->xErr;
502 float Muon::pullY(
int station,
int muonSubdetId, ArbitrationType
type,
bool includeSegmentError)
const {
505 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
507 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
509 if (!chamberSegmentPair.second->hasZed())
511 if (includeSegmentError)
512 return (chamberSegmentPair.first->y - chamberSegmentPair.second->y) /
513 sqrt(
std::pow(chamberSegmentPair.first->yErr, 2) +
std::pow(chamberSegmentPair.second->yErr, 2));
514 return (chamberSegmentPair.first->y - chamberSegmentPair.second->y) / chamberSegmentPair.first->yErr;
517 float Muon::pullDxDz(
int station,
int muonSubdetId, ArbitrationType
type,
bool includeSegmentError)
const {
518 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
520 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
522 if (!chamberSegmentPair.second->hasPhi())
524 if (includeSegmentError)
525 return (chamberSegmentPair.first->dXdZ - chamberSegmentPair.second->dXdZ) /
526 sqrt(
std::pow(chamberSegmentPair.first->dXdZErr, 2) +
std::pow(chamberSegmentPair.second->dXdZErr, 2));
527 return (chamberSegmentPair.first->dXdZ - chamberSegmentPair.second->dXdZ) / chamberSegmentPair.first->dXdZErr;
530 float Muon::pullDyDz(
int station,
int muonSubdetId, ArbitrationType
type,
bool includeSegmentError)
const {
533 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
535 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
537 if (!chamberSegmentPair.second->hasZed())
539 if (includeSegmentError)
540 return (chamberSegmentPair.first->dYdZ - chamberSegmentPair.second->dYdZ) /
541 sqrt(
std::pow(chamberSegmentPair.first->dYdZErr, 2) +
std::pow(chamberSegmentPair.second->dYdZErr, 2));
542 return (chamberSegmentPair.first->dYdZ - chamberSegmentPair.second->dYdZ) / chamberSegmentPair.first->dYdZErr;
545 float Muon::segmentX(
int station,
int muonSubdetId, ArbitrationType
type)
const {
546 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
548 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
550 if (!chamberSegmentPair.second->hasPhi())
552 return chamberSegmentPair.second->x;
555 float Muon::segmentY(
int station,
int muonSubdetId, ArbitrationType
type)
const {
558 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
560 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
562 if (!chamberSegmentPair.second->hasZed())
564 return chamberSegmentPair.second->y;
567 float Muon::segmentDxDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
568 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
570 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
572 if (!chamberSegmentPair.second->hasPhi())
574 return chamberSegmentPair.second->dXdZ;
577 float Muon::segmentDyDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
580 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
582 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
584 if (!chamberSegmentPair.second->hasZed())
586 return chamberSegmentPair.second->dYdZ;
589 float Muon::segmentXErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
590 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
592 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
594 if (!chamberSegmentPair.second->hasPhi())
596 return chamberSegmentPair.second->xErr;
599 float Muon::segmentYErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
602 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
604 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
606 if (!chamberSegmentPair.second->hasZed())
608 return chamberSegmentPair.second->yErr;
611 float Muon::segmentDxDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
612 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
614 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
616 if (!chamberSegmentPair.second->hasPhi())
618 return chamberSegmentPair.second->dXdZErr;
621 float Muon::segmentDyDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
624 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
626 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
628 if (!chamberSegmentPair.second->hasZed())
630 return chamberSegmentPair.second->dYdZErr;
633 float Muon::trackEdgeX(
int station,
int muonSubdetId, ArbitrationType
type)
const {
634 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
635 if (muonChambers.empty())
638 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
639 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
641 float supVar = 999999;
643 float currDist = muonChamber->dist();
644 if (currDist < dist) {
646 supVar = muonChamber->edgeX;
651 return chamberSegmentPair.first->edgeX;
654 float Muon::trackEdgeY(
int station,
int muonSubdetId, ArbitrationType
type)
const {
655 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
656 if (muonChambers.empty())
659 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
660 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
662 float supVar = 999999;
664 float currDist = muonChamber->dist();
665 if (currDist < dist) {
667 supVar = muonChamber->edgeY;
672 return chamberSegmentPair.first->edgeY;
675 float Muon::trackX(
int station,
int muonSubdetId, ArbitrationType
type)
const {
676 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
677 if (muonChambers.empty())
680 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
681 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
683 float supVar = 999999;
685 float currDist = muonChamber->dist();
686 if (currDist < dist) {
688 supVar = muonChamber->x;
693 return chamberSegmentPair.first->x;
696 float Muon::trackY(
int station,
int muonSubdetId, ArbitrationType
type)
const {
697 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
698 if (muonChambers.empty())
701 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
702 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
704 float supVar = 999999;
706 float currDist = muonChamber->dist();
707 if (currDist < dist) {
709 supVar = muonChamber->y;
714 return chamberSegmentPair.first->y;
717 float Muon::trackDxDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
718 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
719 if (muonChambers.empty())
722 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
723 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
725 float supVar = 999999;
727 float currDist = muonChamber->dist();
728 if (currDist < dist) {
730 supVar = muonChamber->dXdZ;
735 return chamberSegmentPair.first->dXdZ;
738 float Muon::trackDyDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
739 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
740 if (muonChambers.empty())
743 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
744 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
746 float supVar = 999999;
748 float currDist = muonChamber->dist();
749 if (currDist < dist) {
751 supVar = muonChamber->dYdZ;
756 return chamberSegmentPair.first->dYdZ;
759 float Muon::trackXErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
760 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
761 if (muonChambers.empty())
764 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
765 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
767 float supVar = 999999;
769 float currDist = muonChamber->dist();
770 if (currDist < dist) {
772 supVar = muonChamber->xErr;
777 return chamberSegmentPair.first->xErr;
780 float Muon::trackYErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
781 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
782 if (muonChambers.empty())
785 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
786 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
788 float supVar = 999999;
790 float currDist = muonChamber->dist();
791 if (currDist < dist) {
793 supVar = muonChamber->yErr;
798 return chamberSegmentPair.first->yErr;
801 float Muon::trackDxDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
802 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
803 if (muonChambers.empty())
806 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
807 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
809 float supVar = 999999;
811 float currDist = muonChamber->dist();
812 if (currDist < dist) {
814 supVar = muonChamber->dXdZErr;
819 return chamberSegmentPair.first->dXdZErr;
822 float Muon::trackDyDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
823 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
824 if (muonChambers.empty())
827 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
828 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
830 float supVar = 999999;
832 float currDist = muonChamber->dist();
833 if (currDist < dist) {
835 supVar = muonChamber->dYdZErr;
840 return chamberSegmentPair.first->dYdZErr;
843 float Muon::trackDist(
int station,
int muonSubdetId, ArbitrationType
type)
const {
844 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
845 if (muonChambers.empty())
848 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
849 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
852 float currDist = muonChamber->dist();
858 return chamberSegmentPair.first->dist();
861 float Muon::trackDistErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
862 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
863 if (muonChambers.empty())
866 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
867 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
869 float supVar = 999999;
871 float currDist = muonChamber->dist();
872 if (currDist < dist) {
874 supVar = muonChamber->distErr();
879 return chamberSegmentPair.first->distErr();
883 isolationR03_ = isoR03;
884 isolationR05_ = isoR05;
885 isolationValid_ =
true;
889 if (
label ==
"pfIsolationR03")
890 pfIsolationR03_ = deposit;
892 if (
label ==
"pfIsolationR04")
893 pfIsolationR04_ = deposit;
895 if (
label ==
"pfIsoMeanDRProfileR03")
896 pfIsoMeanDRR03_ = deposit;
898 if (
label ==
"pfIsoMeanDRProfileR04")
899 pfIsoMeanDRR04_ = deposit;
901 if (
label ==
"pfIsoSumDRProfileR03")
902 pfIsoSumDRR03_ = deposit;
904 if (
label ==
"pfIsoSumDRProfileR04")
905 pfIsoSumDRR04_ = deposit;
907 pfIsolationValid_ =
true;
912 type_ = type_ | PFMuon;
915 void Muon::setOuterTrack(
const TrackRef&
t) { outerTrack_ =
t; }
916 void Muon::setInnerTrack(
const TrackRef&
t) { innerTrack_ =
t; }
917 void Muon::setTrack(
const TrackRef&
t) { setInnerTrack(
t); }
918 void Muon::setStandAlone(
const TrackRef&
t) { setOuterTrack(
t); }
919 void Muon::setGlobalTrack(
const TrackRef&
t) { globalTrack_ =
t; }
920 void Muon::setCombined(
const TrackRef&
t) { setGlobalTrack(
t); }
922 bool Muon::isAValidMuonTrack(
const MuonTrackType&
type)
const {
return muonTrack(
type).isNonnull(); }
939 return muonTrackFromMap(
type);
955 refittedTrackMap_[
type] =
t;
const LorentzVector & p4() const final
four-momentum Lorentz vector
constexpr std::array< uint8_t, layerIndexSize > layer
Abs< T >::type abs(const T &t)
math::XYZTLorentzVector LorentzVector
bool overlap(const Candidate &) const override
check overlap with another Candidate
constexpr uint32_t rawId() const
get the raw id
math::XYZTLorentzVector LorentzVector
Lorentz vector.
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
def checkOverlap(process)
Structure Point Contains parameters of Gaussian fits to DMRs.
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
LeafCandidate * clone() const override
returns a clone of the Candidate object
static char chambers[264][20]
Power< A, B >::type pow(const A &a, const B &b)