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 (
type == GEMHitAndTrackArbitration) {
78 if (chamberMatch.gemHitMatches.empty())
80 matches += chamberMatch.gemHitMatches.size();
84 if (chamberMatch.segmentMatches.empty())
86 if (
type == NoArbitration) {
91 for (
auto& segmentMatch : chamberMatch.segmentMatches) {
92 if (
type == SegmentArbitration)
93 if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR)) {
97 if (
type == SegmentAndTrackArbitration)
98 if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR) &&
99 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
103 if (
type == SegmentAndTrackArbitrationCleaned)
104 if (segmentMatch.isMask(MuonSegmentMatch::BestInChamberByDR) &&
105 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
106 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
116 int Muon::numberOfMatchedStations(ArbitrationType
type)
const {
119 unsigned int theStationMask = stationMask(
type);
121 for (
int it = 0; it < 8; ++it)
122 if (theStationMask & 1 << it)
128 unsigned int Muon::expectedNnumberOfMatchedStations(
float minDistanceFromEdge)
const {
129 unsigned int stationMask = 0;
130 minDistanceFromEdge =
std::abs(minDistanceFromEdge);
131 for (
auto& chamberMatch : muMatches_) {
134 float edgeX = chamberMatch.edgeX;
135 float edgeY = chamberMatch.edgeY;
137 if (edgeX < 0 && -edgeX > minDistanceFromEdge && edgeY < 0 && -edgeY > minDistanceFromEdge)
138 stationMask |= 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
141 for (
unsigned int i = 0;
i < 8; ++
i)
142 if (stationMask & (1 <<
i))
147 unsigned int Muon::stationMask(ArbitrationType
type)
const {
148 unsigned int totMask(0);
149 unsigned int curMask(0);
151 for (
auto& chamberMatch : muMatches_) {
152 if (
type == RPCHitAndTrackArbitration) {
153 if (chamberMatch.rpcMatches.empty())
156 int rpcIndex = rollId.
region() == 0 ? 1 : 2;
157 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (rpcIndex - 1));
159 if (!(totMask & curMask))
164 if (chamberMatch.segmentMatches.empty())
166 if (
type == NoArbitration) {
167 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
169 if (!(totMask & curMask))
174 for (
auto& segmentMatch : chamberMatch.segmentMatches) {
175 if (
type == SegmentArbitration)
176 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR)) {
177 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
179 if (!(totMask & curMask))
183 if (
type == SegmentAndTrackArbitration)
184 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
185 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
186 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
188 if (!(totMask & curMask))
192 if (
type == SegmentAndTrackArbitrationCleaned)
193 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
194 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
195 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
196 curMask = 1 << ((chamberMatch.station() - 1) + 4 * (chamberMatch.detector() - 1));
198 if (!(totMask & curMask))
208 int Muon::numberOfMatchedRPCLayers(ArbitrationType
type)
const {
211 unsigned int theRPCLayerMask = RPClayerMask(
type);
213 for (
int it = 0; it < 10; ++it)
214 if (theRPCLayerMask & 1 << it)
220 unsigned int Muon::RPClayerMask(ArbitrationType
type)
const {
221 unsigned int totMask(0);
222 unsigned int curMask(0);
223 for (
auto& chamberMatch : muMatches_) {
224 if (chamberMatch.rpcMatches.empty())
239 curMask = 1 << (rpcLayer - 1);
241 if (!(totMask & curMask))
248 unsigned int Muon::stationGapMaskDistance(
float distanceCut)
const {
249 unsigned int totMask(0);
250 distanceCut =
std::abs(distanceCut);
251 for (
auto& chamberMatch : muMatches_) {
252 unsigned int curMask(0);
253 const int detectorIndex = chamberMatch.detector();
254 if (detectorIndex < 1 || detectorIndex >= 4)
257 if (stationIndex < 1 || stationIndex >= 5)
260 float edgeX = chamberMatch.edgeX;
261 float edgeY = chamberMatch.edgeY;
262 if (edgeX < 0 && -edgeX > distanceCut && edgeY < 0 &&
263 -edgeY > distanceCut)
266 if ((
std::abs(edgeX) < distanceCut && edgeY < distanceCut) ||
267 (
std::abs(edgeY) < distanceCut && edgeX < distanceCut))
268 curMask = 1 << ((
stationIndex - 1) + 4 * (detectorIndex - 1));
275 unsigned int Muon::stationGapMaskPull(
float sigmaCut)
const {
277 unsigned int totMask(0);
278 for (
auto& chamberMatch : muMatches_) {
279 unsigned int curMask(0);
280 const int detectorIndex = chamberMatch.detector();
281 if (detectorIndex < 1 || detectorIndex >= 4)
284 if (stationIndex < 1 || stationIndex >= 5)
287 float edgeX = chamberMatch.edgeX;
288 float edgeY = chamberMatch.edgeY;
289 float xErr = chamberMatch.xErr + 0.000001;
290 float yErr = chamberMatch.yErr + 0.000001;
291 if (edgeX < 0 &&
std::abs(edgeX / xErr) > sigmaCut && edgeY < 0 &&
295 if ((
std::abs(edgeX / xErr) < sigmaCut && edgeY < sigmaCut * yErr) ||
296 (
std::abs(edgeY / yErr) < sigmaCut && edgeX < sigmaCut * xErr))
297 curMask = 1 << ((
stationIndex - 1) + 4 * (detectorIndex - 1));
304 int Muon::nDigisInStation(
int station,
int muonSubdetId)
const {
306 std::map<int, int> me11DigisPerCh;
311 for (
auto& match : muMatches_) {
315 int nDigisInCh =
match.nDigisInRange;
321 int ring =
id.ring();
325 if (me11DigisPerCh.find(
chamber) == me11DigisPerCh.end())
328 me11DigisPerCh[
chamber] += nDigisInCh;
334 if (nDigisInCh > nDigis)
338 for (
const auto& me11DigisInCh : me11DigisPerCh) {
339 int nMe11DigisInCh = me11DigisInCh.second;
340 if (nMe11DigisInCh > nDigis)
341 nDigis = nMe11DigisInCh;
347 bool Muon::hasShowerInStation(
int station,
int muonSubdetId,
int nDtDigisCut,
int nCscDigisCut)
const {
350 auto nDigisCut = muonSubdetId ==
MuonSubdetId::DT ? nDtDigisCut : nCscDigisCut;
352 return nDigisInStation(
station, muonSubdetId) >= nDigisCut;
355 int Muon::numberOfShowers(
int nDtDigisCut,
int nCscDigisCut)
const {
367 int Muon::numberOfSegments(
int station,
int muonSubdetId, ArbitrationType
type)
const {
369 for (
auto& chamberMatch : muMatches_) {
370 if (chamberMatch.segmentMatches.empty())
372 if (chamberMatch.detector() != muonSubdetId || chamberMatch.station() !=
station)
375 if (
type == NoArbitration) {
376 segments += chamberMatch.segmentMatches.size();
380 for (
auto& segmentMatch : chamberMatch.segmentMatches) {
381 if (
type == SegmentArbitration)
382 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR)) {
386 if (
type == SegmentAndTrackArbitration)
387 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
388 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR)) {
392 if (
type == SegmentAndTrackArbitrationCleaned)
393 if (segmentMatch.isMask(MuonSegmentMatch::BestInStationByDR) &&
394 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
395 segmentMatch.isMask(MuonSegmentMatch::BelongsToTrackByCleaning)) {
406 std::vector<const MuonChamberMatch*>
chambers;
407 for (std::vector<MuonChamberMatch>::const_iterator chamberMatch = muMatches_.begin();
408 chamberMatch != muMatches_.end();
410 if (chamberMatch->detector() == muonSubdetId && chamberMatch->station() ==
station)
411 chambers.push_back(&(*chamberMatch));
415 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> Muon::pair(
416 const std::vector<const MuonChamberMatch*>&
chambers, ArbitrationType
type)
const {
419 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair(
m,
s);
422 return chamberSegmentPair;
423 for (std::vector<const MuonChamberMatch*>::const_iterator chamberMatch =
chambers.begin();
426 if ((*chamberMatch)->segmentMatches.empty())
428 if (
type == NoArbitration)
429 return std::make_pair(*chamberMatch, &((*chamberMatch)->segmentMatches.front()));
431 for (std::vector<MuonSegmentMatch>::const_iterator segmentMatch = (*chamberMatch)->segmentMatches.begin();
432 segmentMatch != (*chamberMatch)->segmentMatches.end();
434 if (
type == SegmentArbitration)
435 if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR))
436 return std::make_pair(*chamberMatch, &(*segmentMatch));
437 if (
type == SegmentAndTrackArbitration)
438 if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
439 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR))
440 return std::make_pair(*chamberMatch, &(*segmentMatch));
441 if (
type == SegmentAndTrackArbitrationCleaned)
442 if (segmentMatch->isMask(MuonSegmentMatch::BestInStationByDR) &&
443 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByDR) &&
444 segmentMatch->isMask(MuonSegmentMatch::BelongsToTrackByCleaning))
445 return std::make_pair(*chamberMatch, &(*segmentMatch));
449 return chamberSegmentPair;
452 float Muon::dX(
int station,
int muonSubdetId, ArbitrationType
type)
const {
453 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
455 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
457 if (!chamberSegmentPair.second->hasPhi())
459 return chamberSegmentPair.first->x - chamberSegmentPair.second->x;
462 float Muon::dY(
int station,
int muonSubdetId, ArbitrationType
type)
const {
465 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
467 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
469 if (!chamberSegmentPair.second->hasZed())
471 return chamberSegmentPair.first->y - chamberSegmentPair.second->y;
474 float Muon::dDxDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
475 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
477 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
479 if (!chamberSegmentPair.second->hasPhi())
481 return chamberSegmentPair.first->dXdZ - chamberSegmentPair.second->dXdZ;
484 float Muon::dDyDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
487 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
489 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
491 if (!chamberSegmentPair.second->hasZed())
493 return chamberSegmentPair.first->dYdZ - chamberSegmentPair.second->dYdZ;
496 float Muon::pullX(
int station,
int muonSubdetId, ArbitrationType
type,
bool includeSegmentError)
const {
497 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
499 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
501 if (!chamberSegmentPair.second->hasPhi())
503 if (includeSegmentError)
504 return (chamberSegmentPair.first->x - chamberSegmentPair.second->x) /
505 sqrt(
std::pow(chamberSegmentPair.first->xErr, 2) +
std::pow(chamberSegmentPair.second->xErr, 2));
506 return (chamberSegmentPair.first->x - chamberSegmentPair.second->x) / chamberSegmentPair.first->xErr;
509 float Muon::pullY(
int station,
int muonSubdetId, ArbitrationType
type,
bool includeSegmentError)
const {
512 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
514 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
516 if (!chamberSegmentPair.second->hasZed())
518 if (includeSegmentError)
519 return (chamberSegmentPair.first->y - chamberSegmentPair.second->y) /
520 sqrt(
std::pow(chamberSegmentPair.first->yErr, 2) +
std::pow(chamberSegmentPair.second->yErr, 2));
521 return (chamberSegmentPair.first->y - chamberSegmentPair.second->y) / chamberSegmentPair.first->yErr;
524 float Muon::pullDxDz(
int station,
int muonSubdetId, ArbitrationType
type,
bool includeSegmentError)
const {
525 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
527 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
529 if (!chamberSegmentPair.second->hasPhi())
531 if (includeSegmentError)
532 return (chamberSegmentPair.first->dXdZ - chamberSegmentPair.second->dXdZ) /
533 sqrt(
std::pow(chamberSegmentPair.first->dXdZErr, 2) +
std::pow(chamberSegmentPair.second->dXdZErr, 2));
534 return (chamberSegmentPair.first->dXdZ - chamberSegmentPair.second->dXdZ) / chamberSegmentPair.first->dXdZErr;
537 float Muon::pullDyDz(
int station,
int muonSubdetId, ArbitrationType
type,
bool includeSegmentError)
const {
540 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
542 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
544 if (!chamberSegmentPair.second->hasZed())
546 if (includeSegmentError)
547 return (chamberSegmentPair.first->dYdZ - chamberSegmentPair.second->dYdZ) /
548 sqrt(
std::pow(chamberSegmentPair.first->dYdZErr, 2) +
std::pow(chamberSegmentPair.second->dYdZErr, 2));
549 return (chamberSegmentPair.first->dYdZ - chamberSegmentPair.second->dYdZ) / chamberSegmentPair.first->dYdZErr;
552 float Muon::segmentX(
int station,
int muonSubdetId, ArbitrationType
type)
const {
553 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
555 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
557 if (!chamberSegmentPair.second->hasPhi())
559 return chamberSegmentPair.second->x;
562 float Muon::segmentY(
int station,
int muonSubdetId, ArbitrationType
type)
const {
565 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
567 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
569 if (!chamberSegmentPair.second->hasZed())
571 return chamberSegmentPair.second->y;
574 float Muon::segmentDxDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
575 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
577 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
579 if (!chamberSegmentPair.second->hasPhi())
581 return chamberSegmentPair.second->dXdZ;
584 float Muon::segmentDyDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
587 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
589 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
591 if (!chamberSegmentPair.second->hasZed())
593 return chamberSegmentPair.second->dYdZ;
596 float Muon::segmentXErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
597 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
599 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
601 if (!chamberSegmentPair.second->hasPhi())
603 return chamberSegmentPair.second->xErr;
606 float Muon::segmentYErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
609 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
611 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
613 if (!chamberSegmentPair.second->hasZed())
615 return chamberSegmentPair.second->yErr;
618 float Muon::segmentDxDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
619 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
621 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
623 if (!chamberSegmentPair.second->hasPhi())
625 return chamberSegmentPair.second->dXdZErr;
628 float Muon::segmentDyDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
631 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair =
633 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr)
635 if (!chamberSegmentPair.second->hasZed())
637 return chamberSegmentPair.second->dYdZErr;
640 float Muon::trackEdgeX(
int station,
int muonSubdetId, ArbitrationType
type)
const {
641 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
642 if (muonChambers.empty())
645 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
646 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
648 float supVar = 999999;
650 float currDist = muonChamber->dist();
651 if (currDist < dist) {
653 supVar = muonChamber->edgeX;
658 return chamberSegmentPair.first->edgeX;
661 float Muon::trackEdgeY(
int station,
int muonSubdetId, ArbitrationType
type)
const {
662 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
663 if (muonChambers.empty())
666 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
667 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
669 float supVar = 999999;
671 float currDist = muonChamber->dist();
672 if (currDist < dist) {
674 supVar = muonChamber->edgeY;
679 return chamberSegmentPair.first->edgeY;
682 float Muon::trackX(
int station,
int muonSubdetId, ArbitrationType
type)
const {
683 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
684 if (muonChambers.empty())
687 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
688 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
690 float supVar = 999999;
692 float currDist = muonChamber->dist();
693 if (currDist < dist) {
695 supVar = muonChamber->x;
700 return chamberSegmentPair.first->x;
703 float Muon::trackY(
int station,
int muonSubdetId, ArbitrationType
type)
const {
704 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
705 if (muonChambers.empty())
708 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
709 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
711 float supVar = 999999;
713 float currDist = muonChamber->dist();
714 if (currDist < dist) {
716 supVar = muonChamber->y;
721 return chamberSegmentPair.first->y;
724 float Muon::trackDxDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
725 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
726 if (muonChambers.empty())
729 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
730 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
732 float supVar = 999999;
734 float currDist = muonChamber->dist();
735 if (currDist < dist) {
737 supVar = muonChamber->dXdZ;
742 return chamberSegmentPair.first->dXdZ;
745 float Muon::trackDyDz(
int station,
int muonSubdetId, ArbitrationType
type)
const {
746 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
747 if (muonChambers.empty())
750 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
751 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
753 float supVar = 999999;
755 float currDist = muonChamber->dist();
756 if (currDist < dist) {
758 supVar = muonChamber->dYdZ;
763 return chamberSegmentPair.first->dYdZ;
766 float Muon::trackXErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
767 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
768 if (muonChambers.empty())
771 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
772 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
774 float supVar = 999999;
776 float currDist = muonChamber->dist();
777 if (currDist < dist) {
779 supVar = muonChamber->xErr;
784 return chamberSegmentPair.first->xErr;
787 float Muon::trackYErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
788 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
789 if (muonChambers.empty())
792 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
793 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
795 float supVar = 999999;
797 float currDist = muonChamber->dist();
798 if (currDist < dist) {
800 supVar = muonChamber->yErr;
805 return chamberSegmentPair.first->yErr;
808 float Muon::trackDxDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
809 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
810 if (muonChambers.empty())
813 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
814 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
816 float supVar = 999999;
818 float currDist = muonChamber->dist();
819 if (currDist < dist) {
821 supVar = muonChamber->dXdZErr;
826 return chamberSegmentPair.first->dXdZErr;
829 float Muon::trackDyDzErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
830 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
831 if (muonChambers.empty())
834 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
835 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
837 float supVar = 999999;
839 float currDist = muonChamber->dist();
840 if (currDist < dist) {
842 supVar = muonChamber->dYdZErr;
847 return chamberSegmentPair.first->dYdZErr;
850 float Muon::trackDist(
int station,
int muonSubdetId, ArbitrationType
type)
const {
851 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
852 if (muonChambers.empty())
855 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
856 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
859 float currDist = muonChamber->dist();
865 return chamberSegmentPair.first->dist();
868 float Muon::trackDistErr(
int station,
int muonSubdetId, ArbitrationType
type)
const {
869 const std::vector<const MuonChamberMatch*> muonChambers =
chambers(
station, muonSubdetId);
870 if (muonChambers.empty())
873 std::pair<const MuonChamberMatch*, const MuonSegmentMatch*> chamberSegmentPair = pair(muonChambers,
type);
874 if (chamberSegmentPair.first ==
nullptr || chamberSegmentPair.second ==
nullptr) {
876 float supVar = 999999;
878 float currDist = muonChamber->dist();
879 if (currDist < dist) {
881 supVar = muonChamber->distErr();
886 return chamberSegmentPair.first->distErr();
890 isolationR03_ = isoR03;
891 isolationR05_ = isoR05;
892 isolationValid_ =
true;
896 if (
label ==
"pfIsolationR03")
897 pfIsolationR03_ = deposit;
899 if (
label ==
"pfIsolationR04")
900 pfIsolationR04_ = deposit;
902 if (
label ==
"pfIsoMeanDRProfileR03")
903 pfIsoMeanDRR03_ = deposit;
905 if (
label ==
"pfIsoMeanDRProfileR04")
906 pfIsoMeanDRR04_ = deposit;
908 if (
label ==
"pfIsoSumDRProfileR03")
909 pfIsoSumDRR03_ = deposit;
911 if (
label ==
"pfIsoSumDRProfileR04")
912 pfIsoSumDRR04_ = deposit;
914 pfIsolationValid_ =
true;
919 type_ = type_ | PFMuon;
922 void Muon::setOuterTrack(
const TrackRef&
t) { outerTrack_ =
t; }
923 void Muon::setInnerTrack(
const TrackRef&
t) { innerTrack_ =
t; }
924 void Muon::setTrack(
const TrackRef&
t) { setInnerTrack(
t); }
925 void Muon::setStandAlone(
const TrackRef&
t) { setOuterTrack(
t); }
926 void Muon::setGlobalTrack(
const TrackRef&
t) { globalTrack_ =
t; }
927 void Muon::setCombined(
const TrackRef&
t) { setGlobalTrack(
t); }
929 bool Muon::isAValidMuonTrack(
const MuonTrackType&
type)
const {
return muonTrack(
type).isNonnull(); }
946 return muonTrackFromMap(
type);
962 refittedTrackMap_[
type] =
t;
const LorentzVector & p4() const final
four-momentum Lorentz vector
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > 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.
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)