ATLAS Offline Software
EventHandler.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <iostream>
8 #include <sstream>
9 #include <utility>
10 
12 #include "GaudiKernel/MsgStream.h"
32 
33 namespace MuonCalib {
34 
35  EventHandler::EventHandler() : m_event(nullptr), m_mooreIndices(4, 0), m_muonboyIndices(3, 100), m_debug(false) {}
36 
38 
40  AuthorTrackVecMap::const_iterator itr = m_extendedTracks.find(author);
41  if (itr != m_extendedTracks.end()) return itr->second;
42  static const TrackVec dummy_vec;
43  return dummy_vec;
44  }
45 
48  AuthorSegmentVecMap::const_iterator itr = m_extendedSegments.find(author);
49  if (itr != m_extendedSegments.end()) return itr->second;
50  static const SegmentVec dummy_vec;
51  return dummy_vec;
52  }
53 
56 
58  const MuonCalibEvent_E& EventHandler::event() const { return *m_event; }
59 
62 
65 
66  void EventHandler::setdbg(const bool dbg_on) { m_debug = dbg_on; }
67 
69  m_extendedTracks.clear();
70  m_extendedSegments.clear();
71  }
72 
73  void EventHandler::setEvent(std::shared_ptr<const MuonCalibEvent_E> event) {
74  // reset previous event and set new event
75  clear();
76  m_event = std::move(event);
77 
78  // create extended tracks
80 
81  // create extended truth tracks
83 
84  // create extended tracks
86 
87  // create extended raw hits
89 
92  for (; mit != mit_end; ++mit) {
93  if (mit->first < 500) linkTracks(mit->first);
94 
95  // associate segments with tracks
96  if (mit->first < 99)
98  else
100  }
101  }
102 
103  std::string EventHandler::dumpRawHits() const {
104  std::ostringstream sout;
105  sout << m_extendedRawHits.dumpMdtHits();
106  return sout.str();
107  }
108 
109  std::string EventHandler::dumpTracks(const EventHandler::TrackVec& tracks) const {
110  std::ostringstream sout;
111  TrackVec::const_iterator trk = tracks.begin();
112  TrackVec::const_iterator trk_end = tracks.end();
113  TrackVec::const_iterator trk_last = trk_end - 1;
114  for (; trk != trk_end; ++trk) {
115  sout << (*trk)->dump();
116  if (trk != trk_last) sout << std::endl;
117  }
118  return sout.str();
119  }
120 
121  std::string EventHandler::dumpSegments(const EventHandler::SegmentVec& segments) const {
122  std::ostringstream sout;
123  SegmentVec::const_iterator seg = segments.begin();
124  SegmentVec::const_iterator seg_end = segments.end();
125  SegmentVec::const_iterator seg_last = seg_end - 1;
126  for (; seg != seg_end; ++seg) {
127  sout << (*seg)->dump();
128  if (seg != seg_last) sout << std::endl;
129  }
130  return sout.str();
131  }
132 
133  std::string EventHandler::dumpSegments() const {
134  std::ostringstream sout;
136  sout << " Muonboy Segments " << extendedSegments(m_muonboyIndices.segment).size() << std::endl
138  if (!extendedSegments(m_mooreIndices.segment).empty()) sout << std::endl;
139  }
141  sout << " Moore Segments " << extendedSegments(m_mooreIndices.segment).size() << std::endl
143  }
144  return sout.str();
145  }
146 
147  std::string EventHandler::dumpEvent() const {
148  std::ostringstream sout;
149  sout << dumpRawHits() << std::endl << dumpTracks() << std::endl << dumpSegments();
150  return sout.str();
151  }
152 
153  std::string EventHandler::dumpTracks() const {
154  std::ostringstream sout;
155  for (const auto& it : m_extendedTracks) {
156  // skip standalone tracks at IP
157  if (it.first == 1 || it.first == 2) continue;
158 
159  sout << " Track Author " << it.first << " number of tracks " << it.second.size();
160  // only dump Muon tracks
161  if (it.first < 1000) sout << std::endl << dumpTracks(it.second);
162  sout << std::endl;
163  }
164  return sout.str();
165  }
166 
168  if (!m_event || !m_event->rawHitCollection()) return;
169 
172 
173  SegmentVec seg_to_pipe;
174  TrackVec trk_to_pipe;
175  if (segIt != m_extendedSegments.end()) seg_to_pipe = segIt->second;
176  if (trk_itr != m_extendedTracks.end()) trk_to_pipe = trk_itr->second;
177 
178  m_extendedRawHits = MuonCalibExtendedRawHits(*m_event->rawHitCollection(), seg_to_pipe, trk_to_pipe);
179  }
180 
182  // check that event is set
183  if (!m_event) return;
184 
185  // hack to get the associations right...
186  ExtendedTrackPtr previousMooreTrack;
187 
188  for (const MuonCalibEvent_E::MuonCalibTrkPtr& track_ptr : m_event->tracks()) {
189  // get author Moore/Muonboy tracks author == 0 and corresponding TrackVec
190  int author = track_ptr->author();
191  TrackVec& trackVec = m_extendedTracks[author];
192 
193  // create new extended track and add it to TrackVec
194  ExtendedTrackPtr extendedTrack = std::make_shared<MuonCalibExtendedTrack>(*track_ptr, 0, 0);
195 
196  // store previous moore track so we can add the back extrapolated ones if any
197 #ifdef TO_DO
198  if (author == 0) {
199  previousMooreTrack = extendedTrack;
200  } else if ((author == 1 || author == 2) && previousMooreTrack) {
201  std::cout << "Perform proper track association " << __FILE__ << " " << __LINE__ << std::endl;
202  // previousMooreTrack->addAssociatedTrack(extendedTrack);
203  // extendedTrack->addAssociatedTrack(previousMooreTrack);
204  } else if (author == 10 && track_ptr->nrHits() == 0) {
205  // Associate MuidSA/MooreExtrapolate to IP to author 0 if no hits on track
206  TrackVec& trackVec0 = m_extendedTracks[0];
207  double dotprodmax = -1.;
208  if (trackVec0.size() > 0) {
209  int trackcount10 = trackVec.size();
210  TrackVec::iterator it0 = trackVec0.begin();
211  TrackVec::iterator it0_end = trackVec0.end();
212  int trackcount0 = 0;
213  const MuonCalibExtendedTrack* associatedMooreTrack = 0;
214  for (; it0 != it0_end; ++it0) {
215  trackcount0++;
216  if (trackcount10 > trackcount0) continue;
217  double dotprod = extendedTrack->direction().dot((*it0)->direction());
218  if (extendedTrack->isAssociated(*it0)) continue;
219  if ((*it0)->isAssociated(extendedTrack)) continue;
220  if (dotprod > dotprodmax) {
221  dotprodmax = dotprod;
222  associatedMooreTrack = *it0;
223  if (dotprodmax > 0.8) break;
224  }
225  }
226  if (dotprodmax > 0.8 && associatedMooreTrack) {
227  extendedTrack->addAssociatedTrack(associatedMooreTrack);
228  associatedMooreTrack->addAssociatedTrack(extendedTrack);
229  }
230  }
231  }
232 #endif
233  trackVec.push_back(extendedTrack);
234  }
235  }
236 
237  template <typename T> void EventHandler::split_along_barcode(const std::vector<T>& container, std::map<int, std::set<T>>& barcode_map) {
238  for (const auto& hit_ptr : container) {
239  int barcode = hit_ptr->barCode();
240  if (barcode <= 0) continue;
241  barcode_map[barcode].insert(hit_ptr);
242  }
243  }
244 
246  // check that event is set
247  if (!m_event) return;
248  //
249  // Truth track collection
250  //
251 
252  const MuonCalibTruthCollection* truth = m_event->calibTruthCollection();
253  if (!truth) return;
254 
255  if (truth->TruthContainer().empty()) return;
256 
257  std::map<int, TruthPtr> truthTrkME, truthTrkIP, truthTrkRest;
258 
259  std::map<int, std::set<TruthMdtPtr>> truthTrkMdtHitMap;
260  std::map<int, std::set<TruthCscPtr>> truthTrkCscHitMap;
261  std::map<int, std::set<TruthRpcPtr>> truthTrkRpcHitMap;
262  std::map<int, std::set<TruthTgcPtr>> truthTrkTgcHitMap;
263 
264  MsgStream log(Athena::getMessageSvc(), "EventHandler");
265  for (const TruthPtr& truth_part : truth->TruthContainer()) {
266  int barcode = truth_part->barCode();
267  if (barcode <= 0) continue;
268  if (log.level() <= MSG::DEBUG) log << MSG::DEBUG << "createExtendedTruthTracks() truth track barcode " << barcode << endmsg;
269 
270  if (truth_part->position().perp() < 4000 && std::abs(truth_part->position().z()) < 6000.) {
271  if (truth_part->position().perp() < 100 && std::abs(truth_part->position().z()) < 500.) {
272  // Close to IP
273  truthTrkIP[barcode] = truth_part;
274  } else {
275  truthTrkRest[barcode] = truth_part;
276  }
277  } else {
278  // Take track at Muon Entry
279  truthTrkME[barcode] = truth_part;
280  }
281  }
282 
283  //
284  // Mdt truth hit information
285  //
286  split_along_barcode(truth->MdtContainer(), truthTrkMdtHitMap);
287 
288  if (truthTrkMdtHitMap.empty()) return;
289 
290  //
291  // Csc truth hit information
292  //
293  split_along_barcode(truth->CscContainer(), truthTrkCscHitMap);
294  //
295  // Rpc truth hit information
296  //
297 
298  split_along_barcode(truth->RpcContainer(), truthTrkRpcHitMap);
299 
300  //
301  // Tgc truth hit information
302  //
303  split_along_barcode(truth->TgcContainer(), truthTrkTgcHitMap);
304 
305  for (const auto& it_IP : truthTrkIP) {
306  std::shared_ptr<MuonCalibTrack_E> truth_trk =
307  transform_to_trk(it_IP.second, truthTrkMdtHitMap, truthTrkCscHitMap, truthTrkRpcHitMap, truthTrkTgcHitMap);
308  int barcode = it_IP.first;
309  int pdgcode = it_IP.second->PDGCode();
310  int author = -13;
311  if (std::abs(pdgcode) != 13) author = -113;
312  TrackVec& trackVec = m_extendedTracks[author];
313  std::shared_ptr<MuonCalibExtendedTrack> extendedTrack = std::make_shared<MuonCalibExtendedTrack>(*truth_trk, pdgcode, barcode);
314  trackVec.push_back(extendedTrack);
315  // dump truth track
316  if (m_debug) extendedTrack->dump();
317  }
318 
319  for (const auto& it_ME : truthTrkME) {
320  std::shared_ptr<MuonCalibTrack_E> truth_trk =
321  transform_to_trk(it_ME.second, truthTrkMdtHitMap, truthTrkCscHitMap, truthTrkRpcHitMap, truthTrkTgcHitMap);
322 
323  int barcode = it_ME.first;
324  int pdgcode = it_ME.second->PDGCode();
325  int author = -1013;
326  if (std::abs(pdgcode) != 13) author = -1113;
327  TrackVec& trackVec = m_extendedTracks[author];
328  std::shared_ptr<MuonCalibExtendedTrack> extendedTrack = std::make_shared<MuonCalibExtendedTrack>(*truth_trk, pdgcode, barcode);
329  trackVec.push_back(extendedTrack);
330  // dump truth track
331  if (m_debug) extendedTrack->dump();
332  }
333  }
334  std::shared_ptr<MuonCalibTrack_E> EventHandler::transform_to_trk(const TruthPtr& truth_part,
335  const std::map<int, std::set<TruthMdtPtr>>& mdt_hits,
336  const std::map<int, std::set<TruthCscPtr>>& csc_hits,
337  const std::map<int, std::set<TruthRpcPtr>>& rpc_hits,
338  const std::map<int, std::set<TruthTgcPtr>>& tgc_hits) {
339  const int barcode = truth_part->barCode();
340  MuonCalibTrack_E::defineParams build_pars{};
341  build_pars.x0 = truth_part->position().x();
342  build_pars.y0 = truth_part->position().y();
343  build_pars.z0 = truth_part->position().z();
344  build_pars.phi = truth_part->momentum().phi();
345  build_pars.theta = truth_part->momentum().theta();
346  build_pars.author = std::abs(truth_part->PDGCode());
347  build_pars.qOverP = (1. - 2. * (truth_part->PDGCode() < 0)) / (truth_part->momentum().mag());
348  build_pars.cov.setZero();
349  std::shared_ptr<MuonCalibTrack_E> track_ptr = std::make_shared<MuonCalibTrack_E>(build_pars);
350 
351  std::map<int, std::set<TruthMdtPtr>>::const_iterator mdt_itr = mdt_hits.find(barcode);
352  if (mdt_itr != mdt_hits.end()) {
353  for (const TruthMdtPtr& mdt_hit : mdt_itr->second) {
354  MuonCalibHit_E::definePars hit_pars{};
355  hit_pars.driftRadius = mdt_hit->driftRadius();
356  hit_pars.pos = Amg::Vector3D(0., mdt_hit->positionAlongTube(), 0.);
357  track_ptr->addHit(std::make_shared<MuonCalibHit_E>(mdt_hit->identify(), hit_pars));
358  }
359  }
360  std::map<int, std::set<TruthCscPtr>>::const_iterator csc_itr = csc_hits.find(barcode);
361  if (csc_itr != csc_hits.end()) {
362  for (const TruthCscPtr& csc_hit : csc_itr->second) {
363  MuonCalibHit_E::definePars hit_pars{};
364  hit_pars.driftRadius = csc_hit->time();
365  track_ptr->addHit(std::make_shared<MuonCalibHit_E>(csc_hit->identify(), hit_pars));
366  }
367  }
368 
369  std::map<int, std::set<TruthRpcPtr>>::const_iterator rpc_itr = rpc_hits.find(barcode);
370  if (rpc_itr != rpc_hits.end()) {
371  for (const TruthRpcPtr& rpc_hit : rpc_itr->second) {
372  MuonCalibHit_E::definePars hit_pars{};
373  hit_pars.driftRadius = rpc_hit->time();
374  track_ptr->addHit(std::make_shared<MuonCalibHit_E>(rpc_hit->identify(), hit_pars));
375  }
376  }
377  std::map<int, std::set<TruthTgcPtr>>::const_iterator tgc_itr = tgc_hits.find(barcode);
378  if (tgc_itr != tgc_hits.end()) {
379  for (const TruthTgcPtr& tgc_hit : tgc_itr->second) {
380  MuonCalibHit_E::definePars hit_pars{};
381  hit_pars.driftRadius = tgc_hit->time();
382  track_ptr->addHit(std::make_shared<MuonCalibHit_E>(tgc_hit->identify(), hit_pars));
383  }
384  }
385  return track_ptr;
386  }
387 
389  // check that event is set
390  if (!m_event) return;
391 
392  for (const MuonCalibEvent::PatternPtr& pat_ptr : m_event->pattern()) {
393  for (const MuonCalibPattern::MuonCalibSegPtr& seg_ptr : pat_ptr->muonSegs()) {
394  // get author
395  int author = seg_ptr->author();
397 
398  // create new extended segment
399  MuonCalibExtendedSegment* extendedSegment = new MuonCalibExtendedSegment(*seg_ptr);
400  segVec.emplace_back(extendedSegment);
401  }
402  }
403  }
404 
407  struct segmentMatchQual {
408  ExtendedSegmentPtr seg;
409  int assoc_quality{0};
410  bool vetoed{false};
411  bool operator<(const segmentMatchQual& other) const {
412  if (assoc_quality != other.assoc_quality) return assoc_quality > other.assoc_quality;
413  return seg->chi2() < other.seg->chi2();
414  };
415  segmentMatchQual(ExtendedSegmentPtr _ptr, int score) : seg{std::move(_ptr)}, assoc_quality{score} {}
416  };
417 
418  for (const ExtendedTrackPtr& trk : tracks) {
419  std::vector<segmentMatchQual> segmentTrackMatch;
420  for (const ExtendedSegmentPtr& seg : segments) {
421  int match = associateSegmentWithTrack(*seg, *trk);
422  if (match > 200) { segmentTrackMatch.emplace_back(seg, match); }
423  }
424  std::vector<segmentMatchQual>::iterator mit = segmentTrackMatch.begin();
425  std::vector<segmentMatchQual>::iterator mit_end = segmentTrackMatch.end();
426  std::sort(mit, mit_end);
427  for (; mit != mit_end; ++mit) {
429  for (; mit2 != mit_end; ++mit2) {
430  if (segmentOverlap(*mit->seg, *mit2->seg) > 1) { mit2->vetoed = true; }
431  }
432 
433  std::cout << "We need to refine the track to segment association " << __FILE__ << " " << __LINE__ << std::endl;
434  // if (!mit->vetoed) {
435  // mit->seg->addTrack(trk);
436  // trk->addSegment(mit->seg);
437  // }
438  }
439  }
440  }
442  int overlap = 0;
443  if (segment1.mdtHitsOnTrack() > 0 && segment2.mdtHitsOnTrack() > 0) {
444  std::set<MuonFixedId> segmentIds;
445  for (const MuonCalibSegment::MdtHitPtr& mdt_hit : segment1.mdtHOT()) {
446  const MuonFixedId& id = mdt_hit->identify();
447  if (!id.isValid()) {
448  MsgStream log(Athena::getMessageSvc(), "EventHandler");
449  log << MSG::WARNING << "segmentOverlap(), invalid MDT id! " << endmsg;
450  continue;
451  }
452  segmentIds.insert(id);
453  }
454  for (const MuonCalibSegment::MdtHitPtr& mdt_hit : segment2.mdtHOT()) {
455  const MuonFixedId& id = mdt_hit->identify();
456  if (!id.isValid()) {
457  MsgStream log(Athena::getMessageSvc(), "EventHandler");
458  log << MSG::WARNING << "segmentOverlap(), invalid MDT id! " << endmsg;
459  continue;
460  }
461  overlap += (segmentIds.count(id) > 0);
462  }
463  return overlap;
464  } else if (segment1.cscHitsOnTrack() > 0 && segment2.cscHitsOnTrack() > 0) {
465  std::set<MuonFixedId> segmentIds;
466  for (const MuonCalibSegment::CscHitPtr& csc_hit : segment1.cscHOT()) {
467  const MuonFixedId& id = csc_hit->identify();
468  if (!id.isValid()) {
469  MsgStream log(Athena::getMessageSvc(), "EventHandler");
470  log << MSG::WARNING << "segmentOverlap(), invalid CSC id! " << endmsg;
471  continue;
472  }
473  segmentIds.insert(id);
474  }
475  for (const MuonCalibSegment::CscHitPtr& csc_hit : segment1.cscHOT()) {
476  MuonFixedId id = csc_hit->identify();
477  if (!id.isValid()) {
478  MsgStream log(Athena::getMessageSvc(), "EventHandler");
479  log << MSG::WARNING << "segmentOverlap(), invalid CSC id! " << endmsg;
480  continue;
481  }
482  overlap += (segmentIds.count(id) > 0);
483  }
484  }
485  return overlap;
486  }
488  double minRadius = 1.; // the sign of all hits with a drift radius smaller that minRadius is not taken into account
489  unsigned int noppositeSign{0}, nsameSign{0}, nnotOnTrack{0};
490  for (const MuonCalibSegment::MdtHitPtr& mdt_hit : segment.mdtHOT()) {
491  const MuonFixedId& id = mdt_hit->identify();
492  if (!id.isValid()) {
493  MsgStream log(Athena::getMessageSvc(), "EventHandler");
494  log << MSG::WARNING << "associateSegmentWithTrack(), invalid MDT id! " << endmsg;
495  continue;
496  }
497  // look up hit on track
498  IdHitMap::const_iterator trkHit = track.idHitMap().find(id);
499  if (trkHit != track.idHitMap().end()) {
500  // found hit
501  double signSeg = mdt_hit->driftRadius() < -minRadius ? -1. : 1.;
502  double signTrk = trkHit->second->driftRadius() < -minRadius ? -1. : 1.;
503  if (signSeg == signTrk)
504  ++nsameSign;
505  else
506  ++noppositeSign;
507  } else {
508  ++nnotOnTrack;
509  }
510  }
511 
512  for (const MuonCalibSegment::CscHitPtr& csc_hit : segment.cscHOT()) {
513  MuonFixedId id = csc_hit->identify();
514  if (!id.isValid()) {
515  MsgStream log(Athena::getMessageSvc(), "EventHandler");
516  log << MSG::WARNING << "associateSegmentWithTrack(), invalid CSC id! " << endmsg;
517  continue;
518  }
519  // look up hit on track
520  IdHitMap::const_iterator trkHit = track.idHitMap().find(id);
521  if (trkHit != track.idHitMap().end()) {
522  // found hit
523  ++nsameSign;
524  } else {
525  ++nnotOnTrack;
526  }
527  }
528  // Okay the weighting factors seem a bit arbitrary
529  return nnotOnTrack + 10 * noppositeSign + 100 * nsameSign;
530  }
531 
532  void EventHandler::linkTracks(int referenceIndex) {
533  // check if author found in list
534  AuthorTrackVecMap::iterator pos = m_extendedTracks.find(referenceIndex);
535  if (pos == m_extendedTracks.end()) return;
536 
537  TrackVec& refTracks = pos->second;
538 
539  // loop over reference tracks and associate other authors
540  TrackVec::iterator rit = refTracks.begin();
541  TrackVec::iterator rit_end = refTracks.end();
542  for (; rit != rit_end; ++rit) {
543  // loop over authors
546  for (; ait != ait_end; ++ait) {
547  // skip same collection
548  if (ait->first == referenceIndex) continue;
549 
550  TrackVec& tracks = ait->second;
551 
552  match(**rit, tracks);
553  }
554  }
555  }
556 
558  const MuonCalibExtendedTrack* bestMatch = nullptr;
559  MuonCalibExtendedTrackOverlap bestOverlap;
560  // loop over tracks and calcualte overlap with reference
561  TrackVec::iterator it = tracks.begin();
562  TrackVec::iterator it_end = tracks.end();
563  for (; it != it_end; ++it) {
564  // check whether the two tracks are not already associated
565 
566  // if (reference.isAssociated(*it)) continue;
567 
568  MuonCalibExtendedTrackOverlap overlap = reference.calculateHitOverlap(**it);
569  if (overlap.sharedPrecisionHits() > 0) {
570  if (overlap.sharedPrecisionHits() > bestOverlap.sharedPrecisionHits()) {
571  bestMatch = it->get();
572  bestOverlap = overlap;
573  }
574  }
575  }
576 
577  std::cout << " Still need to be done a proper association " << __FILE__ << " " << __LINE__ << std::endl;
578  if (bestMatch) {
579  // reference.addAssociatedTrack(bestMatch);
580  // bestMatch->addAssociatedTrack(&reference);
581  }
582  }
583 
584 } // namespace MuonCalib
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
operator<
bool operator<(const DataVector< T > &a, const DataVector< T > &b)
Vector ordering relation.
MuonCalibPattern.h
MuonCalib::MuonCalibEvent_E::MuonCalibTrkPtr
std::shared_ptr< const MuonCalibTrack_E > MuonCalibTrkPtr
Definition: MuonCalibEvent_E.h:37
MuonCalib::EventHandler::m_mooreIndices
AuthorIndices m_mooreIndices
Definition: EventHandler.h:124
MuonCalib::EventHandler::match
void match(const MuonCalibExtendedTrack &reference, TrackVec &tracks)
find best match of tracks with reference
Definition: EventHandler.cxx:557
MuonCalib::EventHandler::createExtendedTruthTracks
void createExtendedTruthTracks()
create extended tracks for event
Definition: EventHandler.cxx:245
MuonCalibCscTruthHit.h
MuonCalibSegment.h
MuonCalib::MuonCalibSegment::cscHOT
const CscHitVec & cscHOT() const
retrieve the full set of CscCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:156
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
MuonCalib::MuonCalibTruthCollection::TruthContainer
TruthVec & TruthContainer()
Retrieve a reference to the full truth container.
Definition: MuonCalibTruthCollection.cxx:26
MuonCalibExtendedTrack.h
MuonCalib::MuonCalibHit_E::definePars
Definition: MuonCalibHit_E.h:23
MuonCalib::EventHandler::SegmentVec
std::vector< ExtendedSegmentPtr > SegmentVec
Definition: EventHandler.h:44
MuonCalib::MuonCalibTruthCollection
Definition: MuonCalibTruthCollection.h:38
MuonCalib::MuonCalibTruthCollection::TgcContainer
TgcTruthVec & TgcContainer()
Retrieve a referece to the full Tgc container.
Definition: MuonCalibTruthCollection.cxx:42
MuonCalib::EventHandler::setEvent
void setEvent(std::shared_ptr< const MuonCalibEvent_E > event)
set a new event (will call clear on the previous)
Definition: EventHandler.cxx:73
MuonCalib::EventHandler::muonboyIndices
const AuthorIndices & muonboyIndices() const
get author indices for Muonboy
Definition: EventHandler.cxx:64
MuonCalib::EventHandler::extendedSegments
const SegmentVec & extendedSegments(int author) const
get extended tracks
Definition: EventHandler.cxx:47
skel.it
it
Definition: skel.GENtoEVGEN.py:396
MuonCalib::MuonCalibTruthCollection::MdtContainer
MdtTruthVec & MdtContainer()
Retrieve a reference to the full Mdt container.
Definition: MuonCalibTruthCollection.cxx:30
MuonCalib::EventHandler::event
const MuonCalibEvent_E & event() const
get event
Definition: EventHandler.cxx:58
MuonCalib::MuonCalibExtendedRawHits
Definition: MuonCalibExtendedRawHits.h:28
MuonCalib::EventHandler::m_extendedSegments
AuthorSegmentVecMap m_extendedSegments
Definition: EventHandler.h:120
MuonCalib::MuonCalibHit_E::definePars::driftRadius
float driftRadius
driftRadius
Definition: MuonCalibHit_E.h:24
MuonCalib::EventHandler::createExtendedTracks
void createExtendedTracks()
create extended tracks for event
Definition: EventHandler.cxx:181
reference
Definition: hcg.cxx:437
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:620
MuonCalib::EventHandler::TruthTgcPtr
MuonCalibTruthCollection::TruthTgcPtr TruthTgcPtr
Definition: EventHandler.h:38
MuonCalibMdtTruthHit.h
MuonCalib::EventHandler::createExtendedRawHits
void createExtendedRawHits()
create extend raw hits
Definition: EventHandler.cxx:167
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MuonCalib::EventHandler::ExtendedTrackPtr
MuonCalibExtendedRawHits::ExtendedTrkPtr ExtendedTrackPtr
Definition: EventHandler.h:32
MuonCalib::EventHandler::clear
void clear()
clear all buffers
Definition: EventHandler.cxx:68
MuonCalib::EventHandler::~EventHandler
~EventHandler()
default destructor
Definition: EventHandler.cxx:37
MuonCalib::EventHandler::mooreIndices
const AuthorIndices & mooreIndices() const
get author indices for Moore
Definition: EventHandler.cxx:61
MuonCalibTrack_E.h
MuonCalib::EventHandler::m_extendedTracks
AuthorTrackVecMap m_extendedTracks
Definition: EventHandler.h:119
MuonCalib::EventHandler::dumpEvent
std::string dumpEvent() const
Definition: EventHandler.cxx:147
MuonCalib::MuonCalibSegment::cscHitsOnTrack
unsigned int cscHitsOnTrack() const
retrieve the number of CscCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:155
MuonCalib::MuonCalibTrack_E::defineParams
constructor setting all trackparameters and position
Definition: MuonCalibTrack_E.h:35
MuonCalib::MuonCalibTrack_E::direction
const Amg::Vector3D & direction() const
direction of perigee of track
Definition: MuonCalibTrack_E.cxx:33
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
MuonCalib::MuonCalibExtendedTrackOverlap
Definition: MuonCalibExtendedTrackOverlap.h:10
MuonCalibEvent_E.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
MuonCalibExtendedSegment.h
MuonCalib::EventHandler::TruthCscPtr
MuonCalibTruthCollection::TruthCscPtr TruthCscPtr
Definition: EventHandler.h:39
MuonCalibRpcTruthHit.h
MuonCalib::EventHandler::extendedRawHits
const MuonCalibExtendedRawHits & extendedRawHits() const
get extended raw hits
Definition: EventHandler.cxx:55
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::EventHandler::segmentOverlap
int segmentOverlap(const MuonCalibExtendedSegment &segment1, const MuonCalibExtendedSegment &segment2)
check whether segments share the same hits
Definition: EventHandler.cxx:441
MuonCalib::EventHandler::setdbg
void setdbg(const bool dbg_on)
Definition: EventHandler.cxx:66
MuonCalib::EventHandler::AuthorIndices
Definition: EventHandler.h:25
EventHandler.h
MuonCalib::EventHandler::associateSegmentWithTrack
int associateSegmentWithTrack(const MuonCalibExtendedSegment &segment, const MuonCalibExtendedTrack &track)
check whether segment and track share the same hits
Definition: EventHandler.cxx:487
MuonCalib::EventHandler::transform_to_trk
std::shared_ptr< MuonCalibTrack_E > transform_to_trk(const TruthPtr &truth_part, const std::map< int, std::set< TruthMdtPtr >> &mdt_hits, const std::map< int, std::set< TruthCscPtr >> &csc_hits, const std::map< int, std::set< TruthRpcPtr >> &rpc_hits, const std::map< int, std::set< TruthTgcPtr >> &tgc_hits)
Definition: EventHandler.cxx:334
MuonCalib::MuonCalibTruthCollection::RpcContainer
RpcTruthVec & RpcContainer()
Retrieve a refernece to the full Rpc container.
Definition: MuonCalibTruthCollection.cxx:34
MuonCalib::EventHandler::linkTracks
void linkTracks(int referenceIndex)
link tracks to the reference track using the hits on the track
Definition: EventHandler.cxx:532
MuonCalibHole_E.h
MuonCalib::MuonCalibSegment::CscHitPtr
std::shared_ptr< const CscCalibHitBase > CscHitPtr
typedef for a collection of CscCalibHitBase s
Definition: MuonCalibSegment.h:48
MuonCalib::EventHandler::m_muonboyIndices
AuthorIndices m_muonboyIndices
Definition: EventHandler.h:125
MuonCalib::EventHandler::dumpTracks
std::string dumpTracks() const
Definition: EventHandler.cxx:153
MuonCalib::EventHandler::m_extendedRawHits
MuonCalibExtendedRawHits m_extendedRawHits
Definition: EventHandler.h:121
MuonCalibHit_E.h
MuonCalib::MuonCalibSegment::mdtHitsOnTrack
unsigned int mdtHitsOnTrack() const
retrieve the number of MdtCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:146
MuonCalibTruth.h
MuonCalib::MuonCalibTruthCollection::CscContainer
CscTruthVec & CscContainer()
Retrieve a reference to the full Csc container.
Definition: MuonCalibTruthCollection.cxx:38
MuonCalib::MuonFixedId
Definition: MuonFixedId.h:50
MuonCalib::MuonCalibPattern::MuonCalibSegPtr
std::shared_ptr< MuonCalibSegment > MuonCalibSegPtr
typedef for a set of (pointers to) MuonCalibSegments
Definition: MuonCalibPattern.h:45
MuonCalibTruthCollection.h
MuonCalib::EventHandler::split_along_barcode
void split_along_barcode(const std::vector< T > &container, std::map< int, std::set< T >> &barcode_map)
Spltis the truth hit container into a map having the barcode of the particle as key.
Definition: EventHandler.cxx:237
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonCalib::EventHandler::m_event
std::shared_ptr< const MuonCalibEvent_E > m_event
Definition: EventHandler.h:118
MuonCalib::MuonCalibExtendedTrackOverlap::sharedPrecisionHits
unsigned int sharedPrecisionHits() const
Definition: MuonCalibExtendedTrackOverlap.h:28
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
MuonCalibCaloHit.h
xAOD::score
@ score
Definition: TrackingPrimitives.h:513
MuonCalib::MuonCalibTrack_E::defineParams::x0
float x0
Definition: MuonCalibTrack_E.h:36
MuonCalib::EventHandler::AuthorIndices::track
int track
Definition: EventHandler.h:28
MuonCalib::EventHandler::associateSegmentsWithTracks
void associateSegmentsWithTracks(SegmentVec &segments, TrackVec &tracks)
create association between tracks and segments
Definition: EventHandler.cxx:405
MuonCalib::EventHandler::TrackVec
std::vector< ExtendedTrackPtr > TrackVec
Definition: EventHandler.h:41
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
MuonCalib::EventHandler::TruthPtr
MuonCalibTruthCollection::TruthPtr TruthPtr
Definition: EventHandler.h:35
MuonCalib::MuonCalibExtendedRawHits::dumpMdtHits
std::string dumpMdtHits() const
Definition: MuonCalibExtendedRawHits.cxx:92
DEBUG
#define DEBUG
Definition: page_access.h:11
CaloCondBlobAlgs_fillNoiseFromASCII.author
string author
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:26
MuonCalibRawHitCollection.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MuonCalib::EventHandler::createExtendedSegments
void createExtendedSegments()
create extended segments for event
Definition: EventHandler.cxx:388
MuonCalib::EventHandler::AuthorIndices::segment
int segment
Definition: EventHandler.h:27
MuonCalib::EventHandler::dumpSegments
std::string dumpSegments() const
Definition: EventHandler.cxx:133
MuonCalib::EventHandler::dumpRawHits
std::string dumpRawHits() const
dump routines
Definition: EventHandler.cxx:103
MuonCalib::EventHandler::EventHandler
EventHandler()
default constructor
Definition: EventHandler.cxx:35
MuonCalib::MuonCalibSegment::mdtHOT
const MdtHitVec & mdtHOT() const
retrieve the full set of MdtCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:147
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
MuonCalib::EventHandler::extendedTracks
const TrackVec & extendedTracks(int author) const
get extended tracks
Definition: EventHandler.cxx:39
MuonCalib::EventHandler::TruthMdtPtr
MuonCalibTruthCollection::TruthMdtPtr TruthMdtPtr
Definition: EventHandler.h:36
MuonCalib::MuonCalibExtendedTrack
Definition: MuonCalibExtendedTrack.h:32
MuonCalib::MuonCalibEvent_E
Definition: MuonCalibEvent_E.h:35
MuonCalib::EventHandler::TruthRpcPtr
MuonCalibTruthCollection::TruthRpcPtr TruthRpcPtr
Definition: EventHandler.h:37
MuonCalibTgcTruthHit.h
MuonFixedId.h
MuonCalib::EventHandler::m_debug
bool m_debug
Definition: EventHandler.h:126
MuonCalib::MuonCalibEvent::PatternPtr
std::shared_ptr< MuonCalibPattern > PatternPtr
Definition: MuonCalibEvent.h:50
MuonCalibEvent.h
MuonCalib::MuonCalibExtendedSegment
Definition: MuonCalibExtendedSegment.h:27
MuonCalib::MuonCalibSegment::MdtHitPtr
std::shared_ptr< MdtCalibHitBase > MdtHitPtr
typedef for a collection of MdtCalibHitBase s
Definition: MuonCalibSegment.h:44
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
MuonCalib::EventHandler::ExtendedSegmentPtr
MuonCalibExtendedRawHits::ExtendedSegPtr ExtendedSegmentPtr
Definition: EventHandler.h:33
MuonCalibTriggerInfo.h