31 return StatusCode::SUCCESS;
36 if (!muons.isValid()) {
38 return StatusCode::FAILURE;
46 if (
mu->primaryTrackParticle() ==
mu->trackParticle(xAOD::Muon::InnerDetectorTrackParticle))
continue;
48 if (
mu->primaryTrackParticle() ==
mu->trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle))
continue;
50 const std::vector<std::vector<unsigned int>>& chIds = acc_alignEffectChId(*ptp);
51 const std::vector<float>& alignEffSDT = acc_alligSigmaDeltaTrans(*ptp);
56 uint8_t nBadPrec{0}, nBadBar{0}, nBadSmall{0}, nBadLarge{0}, nGoodBar{0}, nGoodLarge{0}, nGoodSmall{0};
58 std::map<Muon::MuonStationIndex::ChIndex, int> chamberQual;
59 for (
unsigned int i = 0;
i < chIds.size(); ++
i) {
60 for (
unsigned int j = 0; j < chIds[
i].size(); ++j) {
62 if (alignEffSDT[
i] >= 0.5) {
63 if ((chamberQual.count(currInd) && chIds[
i].size() > 1) || !chamberQual.count(currInd)) {
66 chamberQual[currInd] = 2;
69 if ((chamberQual.count(currInd) && chIds[
i].size() > 1) || !chamberQual.count(currInd)) {
72 chamberQual[currInd] = 1;
77 for (
const auto&
it : chamberQual) {
78 const int chnum =
it.first;
79 const bool is_barrel = chnum < 7;
80 const bool is_small = !(chnum %2);
85 nBadLarge+= !is_small;
88 nGoodLarge+= !is_small;
89 nGoodSmall+= is_small;
92 const uint8_t nGoodPrec = nTotPrec - nBadPrec;
93 const uint8_t nBadEnd = nBadPrec - nBadBar;
94 const uint8_t nGoodEnd = nGoodPrec - nGoodBar;
95 const bool countHits = (nGoodSmall == nGoodLarge) || (nBadSmall == nBadLarge);
97 uint8_t isSmall = (nGoodPrec >= nBadPrec&& nGoodSmall > nGoodLarge) || (nGoodPrec < nBadPrec&& nBadSmall > nBadLarge);
98 const uint8_t isEnd = (nGoodPrec >= nBadPrec&& nGoodEnd > nGoodBar) || (nGoodPrec < nBadPrec && nBadEnd >nBadBar );
106 mu->summaryValue(sumval,
sum);
109 const int nSmallHits =
std::accumulate(small_sectors.begin(), small_sectors.end(),0 ,accumulator);
110 const int nLargeHits =
std::accumulate(large_sectors.begin(), large_sectors.end(),0 ,accumulator);
111 isSmall = (nSmallHits > nLargeHits);
113 acc_precLayers(*
mu) = nGoodPrec;
114 acc_isSmallGood(*
mu) = isSmall;
115 acc_isEndcapGood(*
mu) = isEnd;
117 return StatusCode::SUCCESS;