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 for (
auto& segmentMatch : chamberMatch.gemMatches) {
72 if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR) &&
73 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
81 if (
type == GEMHitAndTrackArbitration) {
82 if (chamberMatch.gemHitMatches.empty())
84 matches += chamberMatch.gemHitMatches.size();
88 if (chamberMatch.gemMatches.empty() and chamberMatch.segmentMatches.empty())
90 if (
type == NoArbitration) {
95 if (chamberMatch.segmentMatches.empty())
97 for (
auto& segmentMatch : chamberMatch.segmentMatches) {
98 if (
type == SegmentArbitration)
99 if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR)) {
103 if (
type == SegmentAndTrackArbitration)
104 if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR) &&
105 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
109 if (
type == SegmentAndTrackArbitrationCleaned)
110 if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR) &&
111 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
112 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
122 int Muon::numberOfMatchedStations(ArbitrationType
type)
const {
125 unsigned int theStationMask = stationMask(
type);
127 for (
int it = 0;
it < 8; ++
it)
128 if (theStationMask & 1 <<
it)
134 unsigned int Muon::expectedNnumberOfMatchedStations(
float minDistanceFromEdge)
const {
135 unsigned int stationMask = 0;
136 minDistanceFromEdge =
std::abs(minDistanceFromEdge);
137 for (
auto& chamberMatch : muMatches_) {
140 float edgeX = chamberMatch.edgeX;
141 float edgeY = chamberMatch.edgeY;
143 if (edgeX < 0 && -edgeX > minDistanceFromEdge && edgeY < 0 && -edgeY > minDistanceFromEdge)
144 stationMask |= 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
147 for (
unsigned int i = 0;
i < 8; ++
i)
148 if (stationMask & (1 <<
i))
153 unsigned int Muon::stationMask(ArbitrationType
type)
const {
154 unsigned int totMask(0);
155 unsigned int curMask(0);
157 for (
auto& chamberMatch : muMatches_) {
158 if (
type == RPCHitAndTrackArbitration) {
159 if (chamberMatch.rpcMatches.empty())
162 int rpcIndex = rollId.
region() == 0 ? 1 : 2;
163 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (rpcIndex - 1));
165 if (!(totMask & curMask))
170 if (chamberMatch.segmentMatches.empty())
172 if (
type == NoArbitration) {
173 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
175 if (!(totMask & curMask))
180 for (
auto& segmentMatch : chamberMatch.segmentMatches) {
181 if (
type == SegmentArbitration)
182 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR)) {
183 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
185 if (!(totMask & curMask))
189 if (
type == SegmentAndTrackArbitration)
190 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
191 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
192 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
194 if (!(totMask & curMask))
198 if (
type == SegmentAndTrackArbitrationCleaned)
199 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
200 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
201 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
202 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
204 if (!(totMask & curMask))
214 int Muon::numberOfMatchedRPCLayers(ArbitrationType
type)
const {
217 unsigned int theRPCLayerMask = RPClayerMask(
type);
219 for (
int it = 0;
it < 10; ++
it)
220 if (theRPCLayerMask & 1 <<
it)
226 unsigned int Muon::RPClayerMask(ArbitrationType
type)
const {
227 unsigned int totMask(0);
228 unsigned int curMask(0);
229 for (
auto& chamberMatch : muMatches_) {
230 if (chamberMatch.rpcMatches.empty())
245 curMask = 1 << (rpcLayer - 1);
247 if (!(totMask & curMask))
254 unsigned int Muon::stationGapMaskDistance(
float distanceCut)
const {
255 unsigned int totMask(0);
256 distanceCut =
std::abs(distanceCut);
257 for (
auto& chamberMatch : muMatches_) {
258 unsigned int curMask(0);
259 const int detectorIndex = chamberMatch.detector();
260 if (detectorIndex < 1 || detectorIndex >= 4)
263 if (stationIndex < 1 || stationIndex >= 5)
266 float edgeX = chamberMatch.edgeX;
267 float edgeY = chamberMatch.edgeY;
268 if (edgeX < 0 && -edgeX > distanceCut && edgeY < 0 &&
269 -edgeY > distanceCut)
272 if ((
std::abs(edgeX) < distanceCut && edgeY < distanceCut) ||
273 (
std::abs(edgeY) < distanceCut && edgeX < distanceCut))
274 curMask = 1 << ((
stationIndex - 1) + 4 * (detectorIndex - 1));
281 unsigned int Muon::stationGapMaskPull(
float sigmaCut)
const {
283 unsigned int totMask(0);
284 for (
auto& chamberMatch : muMatches_) {
285 unsigned int curMask(0);
286 const int detectorIndex = chamberMatch.detector();
287 if (detectorIndex < 1 || detectorIndex >= 4)
290 if (stationIndex < 1 || stationIndex >= 5)
293 float edgeX = chamberMatch.edgeX;
294 float edgeY = chamberMatch.edgeY;
295 float xErr = chamberMatch.xErr + 0.000001;
296 float yErr = chamberMatch.yErr + 0.000001;
297 if (edgeX < 0 &&
std::abs(edgeX / xErr) > sigmaCut && edgeY < 0 &&
301 if ((
std::abs(edgeX / xErr) < sigmaCut && edgeY < sigmaCut * yErr) ||
302 (
std::abs(edgeY / yErr) < sigmaCut && edgeX < sigmaCut * xErr))
303 curMask = 1 << ((
stationIndex - 1) + 4 * (detectorIndex - 1));
310 int Muon::nDigisInStation(
int station,
int muonSubdetId)
const {
312 std::map<int, int> me11DigisPerCh;
317 for (
auto& match : muMatches_) {
321 int nDigisInCh =
match.nDigisInRange;
327 int ring =
id.ring();
331 if (me11DigisPerCh.find(
chamber) == me11DigisPerCh.end())
334 me11DigisPerCh[
chamber] += nDigisInCh;
340 if (nDigisInCh > nDigis)
344 for (
const auto& me11DigisInCh : me11DigisPerCh) {
345 int nMe11DigisInCh = me11DigisInCh.second;
346 if (nMe11DigisInCh > nDigis)
347 nDigis = nMe11DigisInCh;
353 bool Muon::hasShowerInStation(
int station,
int muonSubdetId,
int nDtDigisCut,
int nCscDigisCut)
const {
356 auto nDigisCut = muonSubdetId ==
MuonSubdetId::DT ? nDtDigisCut : nCscDigisCut;
358 return nDigisInStation(
station, muonSubdetId) >= nDigisCut;
361 int Muon::numberOfShowers(
int nDtDigisCut,
int nCscDigisCut)
const {
373 int Muon::numberOfSegments(
int station,
int muonSubdetId, ArbitrationType
type)
const {
375 for (
auto& chamberMatch : muMatches_) {
376 if (chamberMatch.segmentMatches.empty())
378 if (chamberMatch.detector() != muonSubdetId || chamberMatch.station() !=
station)
381 if (
type == NoArbitration) {
382 segments += chamberMatch.segmentMatches.size();
386 for (
auto& segmentMatch : chamberMatch.segmentMatches) {
387 if (
type == SegmentArbitration)
388 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR)) {
392 if (
type == SegmentAndTrackArbitration)
393 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
394 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
398 if (
type == SegmentAndTrackArbitrationCleaned)
399 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
400 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
401 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
412 std::vector<const MuonChamberMatch*>
chambers;
413 for (std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
414 chamberMatch != muMatches_.end();
416 if (chamberMatch->detector() == muonSubdetId && chamberMatch->station() ==
station)
417 chambers.push_back(&(*chamberMatch));
421 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> Muon::pair(
422 const std::vector<const MuonChamberMatch*>&
chambers, ArbitrationType
type)
const {
425 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair(
m,
s);
428 return chamberSegmentPair;
429 for (std::vector<const MuonChamberMatch*>::const_iterator chamberMatch =
chambers.begin();
432 if ((*chamberMatch)->segmentMatches.empty())
434 if (
type == NoArbitration)
435 return std::make_pair(*chamberMatch, &((*chamberMatch)->segmentMatches.front()));
437 for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = (*chamberMatch)->segmentMatches.begin();
438 segmentMatch != (*chamberMatch)->segmentMatches.end();
440 if (
type == SegmentArbitration)
441 if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR))
442 return std::make_pair(*chamberMatch, &(*segmentMatch));
443 if (
type == SegmentAndTrackArbitration)
444 if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
445 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR))
446 return std::make_pair(*chamberMatch, &(*segmentMatch));
447 if (
type == SegmentAndTrackArbitrationCleaned)
448 if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
449 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
450 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning))
451 return std::make_pair(*chamberMatch, &(*segmentMatch));
455 return chamberSegmentPair;
459 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
461 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
463 if (!chamberSegmentPair.second->hasPhi())
465 return chamberSegmentPair.first->x - chamberSegmentPair.second->x;
471 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
473 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
475 if (!chamberSegmentPair.second->hasZed())
477 return chamberSegmentPair.first->y - chamberSegmentPair.second->y;
480 float Muon::dDxDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
481 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
483 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
485 if (!chamberSegmentPair.second->hasPhi())
487 return chamberSegmentPair.first->dXdZ - chamberSegmentPair.second->dXdZ;
490 float Muon::dDyDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
493 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
495 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
497 if (!chamberSegmentPair.second->hasZed())
499 return chamberSegmentPair.first->dYdZ - chamberSegmentPair.second->dYdZ;
503 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
505 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
507 if (!chamberSegmentPair.second->hasPhi())
509 if (includeSegmentError)
510 return (chamberSegmentPair.first->x - chamberSegmentPair.second->x) /
511 sqrt(
std::pow(chamberSegmentPair.first->xErr, 2) +
std::pow(chamberSegmentPair.second->xErr, 2));
512 return (chamberSegmentPair.first->x - chamberSegmentPair.second->x) / chamberSegmentPair.first->xErr;
518 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
520 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
522 if (!chamberSegmentPair.second->hasZed())
524 if (includeSegmentError)
525 return (chamberSegmentPair.first->y - chamberSegmentPair.second->y) /
526 sqrt(
std::pow(chamberSegmentPair.first->yErr, 2) +
std::pow(chamberSegmentPair.second->yErr, 2));
527 return (chamberSegmentPair.first->y - chamberSegmentPair.second->y) / chamberSegmentPair.first->yErr;
531 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
533 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
535 if (!chamberSegmentPair.second->hasPhi())
537 if (includeSegmentError)
538 return (chamberSegmentPair.first->dXdZ - chamberSegmentPair.second->dXdZ) /
539 sqrt(
std::pow(chamberSegmentPair.first->dXdZErr, 2) +
std::pow(chamberSegmentPair.second->dXdZErr, 2));
540 return (chamberSegmentPair.first->dXdZ - chamberSegmentPair.second->dXdZ) / chamberSegmentPair.first->dXdZErr;
546 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
548 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
550 if (!chamberSegmentPair.second->hasZed())
552 if (includeSegmentError)
553 return (chamberSegmentPair.first->dYdZ - chamberSegmentPair.second->dYdZ) /
554 sqrt(
std::pow(chamberSegmentPair.first->dYdZErr, 2) +
std::pow(chamberSegmentPair.second->dYdZErr, 2));
555 return (chamberSegmentPair.first->dYdZ - chamberSegmentPair.second->dYdZ) / chamberSegmentPair.first->dYdZErr;
558 float Muon::segmentX(
int station,
int muonSubdetId, ArbitrationType
type)
const {
559 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
561 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
563 if (!chamberSegmentPair.second->hasPhi())
565 return chamberSegmentPair.second->x;
568 float Muon::segmentY(
int station,
int muonSubdetId, ArbitrationType
type)
const {
571 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
573 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
575 if (!chamberSegmentPair.second->hasZed())
577 return chamberSegmentPair.second->y;
580 float Muon::segmentDxDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
581 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
583 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
585 if (!chamberSegmentPair.second->hasPhi())
587 return chamberSegmentPair.second->dXdZ;
590 float Muon::segmentDyDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
593 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
595 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
597 if (!chamberSegmentPair.second->hasZed())
599 return chamberSegmentPair.second->dYdZ;
602 float Muon::segmentXErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
603 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
605 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
607 if (!chamberSegmentPair.second->hasPhi())
609 return chamberSegmentPair.second->xErr;
612 float Muon::segmentYErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
615 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
617 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
619 if (!chamberSegmentPair.second->hasZed())
621 return chamberSegmentPair.second->yErr;
624 float Muon::segmentDxDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
625 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
627 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
629 if (!chamberSegmentPair.second->hasPhi())
631 return chamberSegmentPair.second->dXdZErr;
634 float Muon::segmentDyDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
637 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
639 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
641 if (!chamberSegmentPair.second->hasZed())
643 return chamberSegmentPair.second->dYdZErr;
646 float Muon::trackEdgeX(
int station,
int muonSubdetId, ArbitrationType
type)
const {
647 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
648 if (muonChambers.empty())
651 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
652 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
654 float supVar = 999999;
656 float currDist = muonChamber->dist();
657 if (currDist < dist) {
659 supVar = muonChamber->edgeX;
664 return chamberSegmentPair.first->edgeX;
667 float Muon::trackEdgeY(
int station,
int muonSubdetId, ArbitrationType
type)
const {
668 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
669 if (muonChambers.empty())
672 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
673 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
675 float supVar = 999999;
677 float currDist = muonChamber->dist();
678 if (currDist < dist) {
680 supVar = muonChamber->edgeY;
685 return chamberSegmentPair.first->edgeY;
688 float Muon::trackX(
int station,
int muonSubdetId, ArbitrationType
type)
const {
689 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
690 if (muonChambers.empty())
693 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
694 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
696 float supVar = 999999;
698 float currDist = muonChamber->dist();
699 if (currDist < dist) {
701 supVar = muonChamber->x;
706 return chamberSegmentPair.first->x;
709 float Muon::trackY(
int station,
int muonSubdetId, ArbitrationType
type)
const {
710 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
711 if (muonChambers.empty())
714 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
715 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
717 float supVar = 999999;
719 float currDist = muonChamber->dist();
720 if (currDist < dist) {
722 supVar = muonChamber->y;
727 return chamberSegmentPair.first->y;
730 float Muon::trackDxDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
731 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
732 if (muonChambers.empty())
735 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
736 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
738 float supVar = 999999;
740 float currDist = muonChamber->dist();
741 if (currDist < dist) {
743 supVar = muonChamber->dXdZ;
748 return chamberSegmentPair.first->dXdZ;
751 float Muon::trackDyDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
752 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
753 if (muonChambers.empty())
756 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
757 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
759 float supVar = 999999;
761 float currDist = muonChamber->dist();
762 if (currDist < dist) {
764 supVar = muonChamber->dYdZ;
769 return chamberSegmentPair.first->dYdZ;
772 float Muon::trackXErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
773 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
774 if (muonChambers.empty())
777 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
778 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
780 float supVar = 999999;
782 float currDist = muonChamber->dist();
783 if (currDist < dist) {
785 supVar = muonChamber->xErr;
790 return chamberSegmentPair.first->xErr;
793 float Muon::trackYErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
794 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
795 if (muonChambers.empty())
798 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
799 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
801 float supVar = 999999;
803 float currDist = muonChamber->dist();
804 if (currDist < dist) {
806 supVar = muonChamber->yErr;
811 return chamberSegmentPair.first->yErr;
814 float Muon::trackDxDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
815 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
816 if (muonChambers.empty())
819 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
820 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
822 float supVar = 999999;
824 float currDist = muonChamber->dist();
825 if (currDist < dist) {
827 supVar = muonChamber->dXdZErr;
832 return chamberSegmentPair.first->dXdZErr;
835 float Muon::trackDyDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
836 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
837 if (muonChambers.empty())
840 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
841 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
843 float supVar = 999999;
845 float currDist = muonChamber->dist();
846 if (currDist < dist) {
848 supVar = muonChamber->dYdZErr;
853 return chamberSegmentPair.first->dYdZErr;
856 float Muon::trackDist(
int station,
int muonSubdetId, ArbitrationType
type)
const {
857 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
858 if (muonChambers.empty())
861 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
862 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
865 float currDist = muonChamber->dist();
871 return chamberSegmentPair.first->dist();
874 float Muon::trackDistErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
875 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
876 if (muonChambers.empty())
879 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
880 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
882 float supVar = 999999;
884 float currDist = muonChamber->dist();
885 if (currDist < dist) {
887 supVar = muonChamber->distErr();
892 return chamberSegmentPair.first->distErr();
896 isolationR03_ = isoR03;
897 isolationR05_ = isoR05;
898 isolationValid_ =
true;
902 if (
label ==
"pfIsolationR03")
903 pfIsolationR03_ = deposit;
905 if (
label ==
"pfIsolationR04")
906 pfIsolationR04_ = deposit;
908 if (
label ==
"pfIsoMeanDRProfileR03")
909 pfIsoMeanDRR03_ = deposit;
911 if (
label ==
"pfIsoMeanDRProfileR04")
912 pfIsoMeanDRR04_ = deposit;
914 if (
label ==
"pfIsoSumDRProfileR03")
915 pfIsoSumDRR03_ = deposit;
917 if (
label ==
"pfIsoSumDRProfileR04")
918 pfIsoSumDRR04_ = deposit;
920 pfIsolationValid_ =
true;
925 type_ = type_ | PFMuon;
928 void Muon::setOuterTrack(
const TrackRef&
t) { outerTrack_ =
t; }
929 void Muon::setInnerTrack(
const TrackRef&
t) { innerTrack_ =
t; }
930 void Muon::setTrack(
const TrackRef&
t) { setInnerTrack(
t); }
931 void Muon::setStandAlone(
const TrackRef&
t) { setOuterTrack(
t); }
932 void Muon::setGlobalTrack(
const TrackRef&
t) { globalTrack_ =
t; }
933 void Muon::setCombined(
const TrackRef&
t) { setGlobalTrack(
t); }
935 bool Muon::isAValidMuonTrack(
const MuonTrackType&
type)
const {
return muonTrack(
type).isNonnull(); }
952 return muonTrackFromMap(
type);
968 refittedTrackMap_[
type] =
t;
const LorentzVector & p4() const final
four-momentum Lorentz vector
float pullDyDz(const MatchPair &match)
float pullDxDz(const MatchPair &match)
Abs< T >::type abs(const T &t)
math::XYZTLorentzVector LorentzVector
bool overlap(const Candidate &) const override
check overlap with another Candidate
float dX(const MatchPair &match)
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.
LeafCandidate * clone() const override
returns a clone of the Candidate object
static char chambers[264][20]
float pullY(const MatchPair &match)
Power< A, B >::type pow(const A &a, const B &b)
float pullX(const MatchPair &match)
float dY(const MatchPair &match)