26 m_summary.isTrack =
true;
27 MuonFixedIdManipulator idManip;
29 MuonCalibTrackSummary::ChamberHitSummary* currentChamberSummary =
nullptr;
32 int type = hit->type();
35 ++m_summary.nscatters;
39 const MuonFixedId&
id = hit->identify();
45 if (hit->position().perp() < 200.) {
47 }
else if (hit->position().perp() < 540.) {
49 }
else if (hit->position().perp() < 1100.) {
50 if (std::abs(hit->position().z()) < 750.)
51 ++m_summary.ntrtBarrel;
53 ++m_summary.ntrtEndcap;
59 MuonFixedId chId = idManip.chamberIdentifier(
id);
61 bool measuresPhi = idManip.measuresPhi(
id);
62 bool isMdt =
id.is_mdt();
63 bool isFirst = isMdt ?
id.mdtMultilayer() == 1 : !measuresPhi;
66 if (!currentChamberSummary || currentChamberSummary->chId != chId) {
67 m_summary.chamberHitSummary.push_back(MuonCalibTrackSummary::ChamberHitSummary(chId));
68 currentChamberSummary = &m_summary.chamberHitSummary.back();
71 MuonCalibTrackSummary::ChamberHitSummary::Projection&
proj =
72 isFirst ? currentChamberSummary->etaProjection() : currentChamberSummary->phiProjection();
75 MuonFixedId chamberId = idManip.chamberIdentifier(
id);
80 }
else if (
type == 4) {
81 ++m_summary.noutliers;
83 }
else if (
type == 5) {
84 ++m_summary.noutliers;
88 if (hitPos == m_hitIdMap.end()) m_hitIdMap[
id] = hit;
89 m_hitsPerChamber[chamberId].emplace_back(hit);
94 if ((*hit).position().y() < 0.)
95 ++m_summary.nhitsLowerHemisphere;
97 ++m_summary.nhitsUpperHemisphere;
100 ++m_summary.nmdtHits;
101 m_mdtHitsPerStationIndex[stationIndex].emplace_back(hit);
102 if (idManip.isEndcap(
id)) {
104 m_summary.hasEndcapA =
true;
106 m_summary.hasEndcapC =
true;
109 m_summary.hasEndcapLayersWithTGC =
true;
111 m_summary.hasBarrel =
true;
113 m_summary.hasBarrelLayersWithRPC =
true;
116 m_summary.precisionStationLayers.insert(stationIndex);
117 if (currentChamberSummary->nMdtHitsMl1() > 0 && currentChamberSummary->nMdtHitsMl2() &&
118 currentChamberSummary->nhits() > 3) {
119 m_summary.goodPrecisionStationLayers.insert(stationIndex);
121 }
else if (
id.is_rpc()) {
123 ++m_summary.nrpcPhiHits;
125 ++m_summary.nrpcEtaHits;
127 m_rpcHitsPerStationIndex[stationIndex].emplace_back(hit);
128 m_summary.hasBarrel =
true;
131 if (measuresPhi) m_summary.phiStationLayers.insert(phiStationIndex);
132 if (currentChamberSummary->netaHits() > 0 && currentChamberSummary->nphiHits() > 0) {
133 m_summary.phiEtaStationLayers.insert(phiStationIndex);
135 }
else if (
id.is_tgc()) {
137 ++m_summary.ntgcPhiHits;
139 ++m_summary.ntgcEtaHits;
140 m_tgcHitsPerStationIndex[stationIndex].emplace_back(hit);
143 m_summary.hasEndcapA =
true;
145 m_summary.hasEndcapC =
true;
146 m_summary.hasEndcapLayersWithTGC =
true;
149 if (measuresPhi) m_summary.phiStationLayers.insert(phiStationIndex);
150 if (currentChamberSummary->netaHits() > 0 && currentChamberSummary->nphiHits() > 0) {
151 m_summary.phiEtaStationLayers.insert(phiStationIndex);
153 }
else if (
id.is_csc()) {
154 if (
id.cscMeasuresPhi())
155 ++m_summary.ncscPhiHits;
157 ++m_summary.ncscEtaHits;
158 m_cscHitsPerStationIndex[stationIndex].emplace_back(hit);
160 m_summary.hasEndcapA =
true;
162 m_summary.hasEndcapC =
true;
165 if (measuresPhi) { m_summary.phiStationLayers.insert(phiStationIndex); }
166 m_summary.precisionStationLayers.insert(stationIndex);
167 if (currentChamberSummary->netaHits() > 2 && currentChamberSummary->nphiHits() > 2) {
168 m_summary.goodPrecisionStationLayers.insert(stationIndex);
169 m_summary.phiEtaStationLayers.insert(phiStationIndex);
180 MuonCalibSimpleHoleSearch holeSearch;
185 for (; rit != rit_end; ++rit) {
186 m_intersectedLayers[rit->stationLayerId] = *rit;
187 const MuonFixedId& stId = rit->stationLayerId;
189 bool isEndcap = idManip.isEndcap(stId);
191 StationIndexHitsMap::const_iterator mdtIt = mdtStHitMap.find(stIndex);
192 unsigned int nmdtHits = mdtIt != mdtStHitMap.end() ? mdtIt->second.size() : 0;
194 StationIndexHitsMap::const_iterator rpcIt = rpcStHitMap.find(stIndex);
195 unsigned int nrpcHits = rpcIt != rpcStHitMap.end() ? rpcIt->second.size() : 0;
197 StationIndexHitsMap::const_iterator tgcIt = tgcStHitMap.find(stIndex);
198 unsigned int ntgcHits = tgcIt != tgcStHitMap.end() ? tgcIt->second.size() : 0;
200 StationIndexHitsMap::const_iterator cscIt = cscStHitMap.find(stIndex);
201 unsigned int ncscHits = cscIt != cscStHitMap.end() ? cscIt->second.size() : 0;
204 unsigned int ntrig = isEndcap ? ntgcHits : nrpcHits;
205 unsigned int nprec = nmdtHits + ncscHits;
206 if (nprec + ntrig == 0) m_intersectedLayersWithoutHits.insert(stIndex);
210 m_intersectedRpcLayerWithoutHits.insert(stIndex);
214 m_intersectedTgcLayerWithoutHits.insert(stIndex);
219 std::ostringstream sout;
225 std::ostringstream sout;
227 sout <<
"Author " << std::setw(4) <<
author() << std::setprecision(4) <<
" chi2 " <<
chi2() <<
" ndof " <<
ndof() <<
" r "
229 << std::setw(6) <<
" q*mom " << (
int)
p() *
sign <<
" pt " << std::setw(5) << (
int)
pt() <<
" association: segments "
235 std::ostringstream sout;
249 std::ostringstream sout;
254 unsigned int currentEntry = 0;
257 sout.setf(std::ios::left);
258 for (;
it != it_end; ++
it) {
261 bool isEndcap = idManip.
isEndcap(stId);
263 StationIndexHitsMap::const_iterator mdtIt = mdtStHitMap.find(stIndex);
264 unsigned int nmdtHits = mdtIt != mdtStHitMap.end() ? mdtIt->second.size() : 0;
266 StationIndexHitsMap::const_iterator rpcIt = rpcStHitMap.find(stIndex);
267 unsigned int nrpcHits = rpcIt != rpcStHitMap.end() ? rpcIt->second.size() : 0;
269 StationIndexHitsMap::const_iterator tgcIt = tgcStHitMap.find(stIndex);
270 unsigned int ntgcHits = tgcIt != tgcStHitMap.end() ? tgcIt->second.size() : 0;
272 StationIndexHitsMap::const_iterator cscIt = cscStHitMap.find(stIndex);
273 unsigned int ncscHits = cscIt != cscStHitMap.end() ? cscIt->second.size() : 0;
275 unsigned int ntrig = isEndcap ? ntgcHits : nrpcHits;
276 unsigned int nprec = nmdtHits + ncscHits;
278 sout <<
" " << std::setw(5) << printer.stationLayerIdentifier(stId);
279 if (nprec + ntrig != 0)
280 sout <<
" presicion hits " << std::setw(3) << nprec <<
" trigger hits " << std::setw(3) << ntrig;
282 sout << std::setw(36) <<
" no hits in layer";
283 sout <<
" intersect position " <<
it->second.intersectPosition;
287 if (currentEntry !=
nentries) sout << std::endl;
298 std::set<MuonFixedId> sharedChambers;
302 IdHitsMap::const_iterator
pos = chHitMap.find(rit.first);
303 if (
pos != chHitMap.end()) {
305 sharedChambers.insert(rit.first);
307 std::set<MuonFixedId> foundIds, sharedEtaLayers, sharedPhiLayers, firstEtaLayers, firstPhiLayers, secondEtaLayers,
314 MuonCalibTrack_E::HitVector::const_iterator hit =
315 std::find_if(
pos->second.begin(),
pos->second.end(),
317 if (hit !=
pos->second.end()) {
323 if (!(std::abs(calib_hit->driftRadius()) > 2. && std::abs(test_hit->driftRadius()) > 2. &&
324 calib_hit->driftRadius() * test_hit->driftRadius() < 0.))
325 sharedEtaLayers.insert(
id);
328 sharedPhiLayers.insert(layerId);
330 sharedEtaLayers.insert(layerId);
333 if (!
id.is_mdt() && foundIds.count(layerId))
continue;
335 firstPhiLayers.insert(layerId);
337 firstEtaLayers.insert(layerId);
343 if (!foundIds.count(
id)) {
346 secondPhiLayers.insert(
id);
348 secondEtaLayers.insert(
id);
352 if (rit.first.is_mdt()) {
353 eta_or = &overlap.
mdt;
354 }
else if (rit.first.is_rpc()) {
357 }
else if (rit.first.is_tgc()) {
360 }
else if (rit.first.is_csc()) {
365 (*eta_or).
shared += sharedEtaLayers.size();
367 (*eta_or).first += firstEtaLayers.size();
368 (*eta_or).second += secondEtaLayers.size();
371 (*phi_or).shared += sharedPhiLayers.size();
372 (*phi_or).first += firstPhiLayers.size();
373 (*phi_or).second += secondPhiLayers.size();
378 std::set<MuonFixedId> foundIds;
380 if (rit.first.is_mdt()) {
384 if (foundIds.count(
id))
continue;
388 if (rit.first.is_rpc()) {
393 }
else if (rit.first.is_tgc()) {
398 }
else if (rit.first.is_csc()) {
410 for (
const auto& rit : chHitMap) {
412 if (sharedChambers.count(rit.first))
continue;
413 std::set<MuonFixedId> foundIds;
415 if (rit.first.is_mdt()) {
419 if (foundIds.count(
id))
continue;
422 if (rit.first.is_rpc()) {
427 }
else if (rit.first.is_tgc()) {
432 }
else if (rit.first.is_csc()) {