24 m_chooseBroadestCluster(true)
26 declareInterface<Muon::IMuonCompetingClustersOnTrackCreator>(
this);
35 return StatusCode::SUCCESS;
38 std::unique_ptr<CompetingMuonClustersOnTrack>
40 ATH_MSG_VERBOSE(
"enter createBroadCluster: number of prds " << prds.size() );
47 if (!(*prds.begin())) {
63 for (std::list<const Trk::PrepRawData*>::const_iterator
p = prds.begin();
p != prds.end(); ++
p) {
73 if ((**p).detectorElement() != detectorElement) {
80 std::vector<const Muon::MuonClusterOnTrack*> rots =
createPrdRots(prds);
81 auto assocProbs = std::vector<double>(rots.size(), 0.);
85 std::list<int> limitingChannels;
86 std::list<const Muon::MuonClusterOnTrack*> limitingRots;
99 limitingChannels.clear();
103 return std::make_unique<CompetingMuonClustersOnTrack>(
104 std::move(
parameters), std::move(errorMatrix), surface, std::move(rots), std::move(assocProbs));
109 std::list<int>& limitingChannels,
110 std::list<const Muon::MuonClusterOnTrack*>& limitingRots)
const
113 int numClusters = limitingChannels.size()/2;
117 l != limitingChannels.end() &&
l != std::prev(limitingChannels.end());
129 l != limitingChannels.end() &&
l != std::prev(limitingChannels.end());
139 if (discard == limitingChannels.begin())
142 limitingRots.pop_front();
143 limitingRots.pop_front();
144 limitingChannels.pop_front();
145 limitingChannels.pop_front();
147 else if (discard != limitingChannels.end())
150 limitingRots.pop_back();
151 limitingRots.pop_back();
152 limitingChannels.pop_back();
153 limitingChannels.pop_back();
159 auto rots = std::vector<const Muon::MuonClusterOnTrack*>();
164 if (!(*prds.begin())) {
168 for (std::list<const Trk::PrepRawData*>::const_iterator
p = prds.begin();
p != prds.end(); ++
p) {
177 rots.push_back(cluster);
188 if (!(*prds.begin())) {
189 ATH_MSG_WARNING(
"makeClustersBySurface - first element of RPD list is nullptr");
192 std::vector<const Trk::PrepRawData*> usedPrd;
193 std::vector<const Muon::MuonClusterOnTrack*>::const_iterator
r = rots.begin();
194 for (std::list<const Trk::PrepRawData*>::const_iterator
p = prds.begin();
p != prds.end(); ++
p, ++
r) {
196 ATH_MSG_WARNING(
"makeClustersBySurface - current PrepRawData is nullptr, continuing");
199 if (
std::find(usedPrd.begin(),usedPrd.end(),*
p) != usedPrd.end())
continue;
200 usedPrd.push_back(*
p);
220 std::list<const Trk::PrepRawData*>::const_iterator
q =
p;
221 std::vector<const Muon::MuonClusterOnTrack*>::const_iterator
s =
r;
222 for (++
q, ++
s;
q != prds.end(); ++
q, ++
s) {
224 ATH_MSG_WARNING(
"makeClustersBySurface - current PrepRawData is nullptr, continuing");
230 usedPrd.push_back(*
q);
251 limitingChannels.push_back(channelMin);
252 limitingChannels.push_back(channelMax);
253 limitingRots.push_back(rotMin);
254 limitingRots.push_back(rotMax);
260 std::list<int>::const_iterator
l = limitingChannels.begin();
261 std::list<int>::const_iterator
m = limitingChannels.begin();
263 int size = abs(*
l - *(++
m));
264 for (std::vector<const Trk::PrepRawData*>::const_iterator
q = usedPrd.begin();
274 << std::setiosflags(std::ios::fixed)
276 << std::setw(8) << std::setprecision(1) << (**q).localPosition()[
Trk::locX]
277 << std::setw(8) << std::setprecision(1) << (**q).localPosition()[
Trk::locY]
283 <<
" station " <<
m_idHelperSvc->rpcIdHelper().stationNameString(stationIndex)
290 << std::setiosflags(std::ios::fixed)
292 << std::setw(8) << std::setprecision(1) << (**q).localPosition()[
Trk::locX]
293 << std::setw(8) << std::setprecision(1) << (**q).localPosition()[
Trk::locY]
296 <<
" station " <<
m_idHelperSvc->tgcIdHelper().stationNameString(stationIndex)
302 <<
" between channels " << *
l <<
" and " << *
m );
303 if (++
m != limitingChannels.end())
306 size = 1 + abs(*(++
l) - *(++
m));
318 std::list<int>& limitingChannels,
319 std::list<const Muon::MuonClusterOnTrack*>& limitingRots)
const
323 std::list<const Muon::MuonClusterOnTrack*>::const_iterator
r = limitingRots.begin();
332 r != limitingRots.end();
335 centre += (**r).associatedSurface().center();
336 covariance += (**r).localCovariance();
340 norm /=
static_cast<double>(limitingRots.size());
342 int firstChannel = *
l;
343 double width =
static_cast<double>(1 + abs(*(++
l) - firstChannel));
344 if (limitingRots.size() > 2)
346 int offset = abs(*(++
l) - firstChannel);
347 if (!isRpc &&
offset < 2) {
362 const Trk::Surface& surf = (**limitingRots.begin()).associatedSurface();
364 std::string shape =
"";
372 shape =
" RPC rectangle ";
377 shape =
" TGC trapezoid ";
384 shape =
" TGC rotatedTrapezoid ";
387 rottrapbds->
clone());
400 i != limitingChannels.end();