ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MuonTrackPerformanceAlg Class Reference

#include <MuonTrackPerformanceAlg.h>

Inheritance diagram for MuonTrackPerformanceAlg:
Collaboration diagram for MuonTrackPerformanceAlg:

Classes

struct  ChamberData
 
struct  EventData
 
struct  EventSummary
 
struct  TrackData
 
struct  TrackSummary
 

Public Member Functions

 MuonTrackPerformanceAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~MuonTrackPerformanceAlg ()
 
virtual StatusCode initialize () override
 
virtual StatusCode execute () override
 
virtual StatusCode finalize () override
 
virtual unsigned int cardinality () const override final
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void extractEtaPhiCounts (const std::set< Identifier > &ids, int &neta, int &nphi, int &netaCh, int &nphiCh) const
 
bool handleTracks ()
 
bool handleTrackTruth (const TrackCollection &trackCollection)
 
bool handleSegmentCombi (const Muon::MuonSegmentCombination &combi)
 
void doSummary (const TrackCollection &tracks) const
 
void doSummary (const Muon::IMuonTrackTruthTool::TruthTree &truthTracks) const
 
std::string print (const Muon::IMuonTrackTruthTool::TruthTreeEntry &trackTruth) const
 
std::string eventInfo () const
 
int eventNumber () const
 
void printMissingChambers () const
 
void printMissingTracks () const
 
void printFakeTracks () const
 
std::pair< int, int > countHitsInChamber (const Identifier &chId, const std::set< Identifier > &hitIds) const
 counts number of eta (first number) and phi (second number in pair) hits in the set of hit IDs in the given chamber More...
 
bool insertChamber (const Identifier &chId, const std::set< Identifier > &hits, int minEtaHits, int minPhiHits, ChamberData &chamberData) const
 insert chamber information into ChamberData if hits counts pass cuts, returns true if anything was inserted More...
 
bool insertTechnology (const std::set< Identifier > &chIds, const std::set< Identifier > &hits, int minEtaHits, int minPhiHits, std::vector< ChamberData > &chamberData) const
 insert set of chambers into chamber data if hits counts pass cuts, returns true if anything was inserted More...
 
bool insertStationLayers (const std::set< Identifier > &chIds, const std::set< Muon::MuonStationIndex::StIndex > &exclusionList, std::set< Muon::MuonStationIndex::StIndex > &layers) const
 insert station layers into layer set if they are not in exclusion list More...
 
bool insertStationLayers (const std::vector< ChamberData > &chambers, const std::set< Muon::MuonStationIndex::StIndex > &exclusionList, std::set< Muon::MuonStationIndex::StIndex > &layers, bool usePrecision) const
 insert chamber data into layers if not in exclusion list More...
 
TrackDataevaluateTrackTruthOverlap (const Muon::MuonTrackTruth &truthTrack) const
 evaluate track/truth overlap and create the corresponding overlap description object More...
 
TrackDatacreateTrackData (const Muon::IMuonTrackTruthTool::TruthTreeEntry &trackTruth) const
 create track data object for truth track More...
 
void addTrackToTrackData (const Trk::Track &track, TrackData &trackData) const
 
std::string print (const TrackData &trackData) const
 print TrackData to a string More...
 
std::string print (const EventData &event, const std::vector< TrackData * > &tracks, const std::string &message) const
 
std::string print (const EventData &event, const std::vector< const Trk::Track * > &tracks, const std::string &message) const
 
std::string printTrackCounters (bool doSecondaries=true) const
 print all the track counters to a string to provide a summary More...
 
void clearTracks (std::vector< const Trk::Track * > tracks)
 
void clearTracks (std::vector< TrackData * > tracks)
 
void clearEvent (EventData &event)
 
HepMC::ConstGenParticlePtr getMother (const TruthTrajectory &traj) const
 
HepMC::ConstGenParticlePtr getInitialState (const TruthTrajectory &traj) const
 
bool goodTruthTrack (const Muon::IMuonTrackTruthTool::TruthTreeEntry &entry) const
 
bool isSecondary (const Muon::MuonTrackTruth &truthTrack) const
 
bool isSecondary (const Muon::IMuonTrackTruthTool::TruthTreeEntry &entry) const
 
bool isSecondary (const TruthTrajectory &truthTrajectory) const
 
bool selectPdg (int pdg) const
 
void printSummary (const std::vector< EventSummary > &summary, std::string typeName) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKey< TrackCollectionm_trackKey
 Location of the input tracks. More...
 
SG::ReadHandleKey< xAOD::MuonContainerm_muons {this, "MuonLocation", "Muons", "input muons"}
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey {this, "EventInfoKey", "EventInfo", "EventInfo key"}
 
const xAOD::EventInfom_eventInfo
 pointer to the event info More...
 
SG::ReadHandleKey< McEventCollectionm_mcEventColl {this, "McEventCollectionKey", "TruthEvent", "McEventCollection"}
 
SG::ReadHandleKeyArray< MuonSimDataCollectionm_muonSimData
 
SG::ReadHandleKey< CscSimDataCollectionm_cscSimData {this, "CSC_SDO_Container", "CSC_SDO", "CSC SDO"}
 
SG::ReadHandleKey< TrackRecordCollectionm_trackRecord {this, "TrackRecord", "MuonEntryLayerFilter", "Track Record Collection"}
 
int m_doSummary {}
 
int m_doHitResiduals {}
 
int m_doTrackDebug {}
 
bool m_doTruth {}
 
bool m_doHistos {}
 
double m_momentumCutSim {}
 
double m_momentumCut {}
 
bool m_usePtCut {}
 
bool m_isCombined {}
 
bool m_doSegments {}
 
bool m_writeToFile {}
 
bool m_doStau {}
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
PublicToolHandle< Muon::MuonEDMPrinterToolm_printer {this, "Printer", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"}
 
ServiceHandle< Muon::IMuonEDMHelperSvcm_edmHelperSvc
 
ToolHandle< Muon::IMuonTrackTruthToolm_truthTool {this, "TrackTruthTool",""}
 
ToolHandle< Trk::ITrackSummaryHelperToolm_summaryHelperTool {this, "SummaryHelperTool", ""}
 
int m_doEventListMissed {}
 
int m_doEventListIncomplete {}
 
int m_doEventListFake {}
 
int m_minMdtHits {}
 
int m_minCscEtaHits {}
 
int m_minCscPhiHits {}
 
int m_minRpcEtaHits {}
 
int m_minRpcPhiHits {}
 
int m_minTgcEtaHits {}
 
int m_minTgcPhiHits {}
 
int m_minsTgcEtaHits {}
 
int m_minsTgcPhiHits {}
 
int m_minMMEtaHits {}
 
unsigned int m_nevents {}
 
unsigned int m_ntracks {}
 
unsigned int m_nmatchedTracks {}
 
unsigned int m_nmatchedTracksSecondary {}
 
unsigned int m_nmatchedFakeTracks {}
 
unsigned int m_nfakeTracks {}
 
unsigned int m_nfakeTracksHighPt {}
 
unsigned int m_nfakeTracksLowPt {}
 
unsigned int m_nfakeTracksSL {}
 
unsigned int m_nmissedTracks {}
 
unsigned int m_nmissedTracksOneStation {}
 
unsigned int m_nmissedTracksSecondary {}
 
unsigned int m_nmissedTracksOneStationSecondary {}
 
unsigned int m_nmissingStationMomLoss {}
 
unsigned int m_nmissingStationLayer {}
 
unsigned int m_nmissingCscStationLayer {}
 
unsigned int m_nmissingStationLayerTrigger {}
 
unsigned int m_nmissingStation {}
 
unsigned int m_nwrongStationLayer {}
 
unsigned int m_nwrongStationLayerTrigger {}
 
unsigned int m_nwrongStation {}
 
unsigned int m_ntruthTracks {}
 
unsigned int m_ntruthTracksSecondary {}
 
std::vector< EventDatam_badEvents
 
std::string m_fileName
 name of external file to write statistics More...
 
std::ofstream m_fileOutput
 output file More...
 
IntegerArrayProperty m_pdgsToBeConsidered
 
std::set< int > m_selectedPdgs
 
int m_trackType {}
 
std::string m_trackTypeString
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 50 of file MuonTrackPerformanceAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuonTrackPerformanceAlg()

MuonTrackPerformanceAlg::MuonTrackPerformanceAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 18 of file MuonTrackPerformanceAlg.cxx.

18  :
19  AthAlgorithm(name, pSvcLocator),
20  m_eventInfo(nullptr),
21  m_nevents(0),
22  m_ntracks(0),
26  m_nfakeTracks(0),
29  m_nfakeTracksSL(0),
30  m_nmissedTracks(0),
41  m_nwrongStation(0),
42  m_ntruthTracks(0),
44  declareProperty("DoHistos", m_doHistos = false);
45  declareProperty("DoSummary", m_doSummary = 0);
46  declareProperty("DoHitResiduals", m_doHitResiduals = 0);
47  declareProperty("DoTrackDebug", m_doTrackDebug = 0);
48  declareProperty("DoTruth", m_doTruth = true);
49  declareProperty("writeToFile", m_writeToFile = true);
50  declareProperty("FileName", m_fileName = "trkPerformance.txt");
51  declareProperty("UsePtCut", m_usePtCut = true);
52  declareProperty("IsCombined", m_isCombined = false);
53  declareProperty("MuonMomentumCutSim", m_momentumCutSim = 2000.);
54  declareProperty("LowMomentumThreshold", m_momentumCut = 2000.);
55  declareProperty("DoSegments", m_doSegments = false);
56  declareProperty("doStau", m_doStau = false);
57  declareProperty("TrackType", m_trackType = 2);
58  declareProperty("ProduceEventListMissedTracks", m_doEventListMissed = 0, "0: off, 1: two station, 2: + one station");
59  declareProperty("ProduceEventListIncompleteTracks", m_doEventListIncomplete = 0,
60  "0: off, 1: missing precision layer, 2: +missing chamber");
61  declareProperty("ProduceEventListFakeTracks", m_doEventListFake = 0, "0: off, 1: high pt, 2: +low pt, 3: +SL");
62  declareProperty("MinMdtHits", m_minMdtHits = 3);
63  declareProperty("MinCscEtaHits", m_minCscEtaHits = 3);
64  declareProperty("MinCscPhiHits", m_minCscPhiHits = 3);
65  declareProperty("MinRPCEtaHits", m_minRpcEtaHits = 1);
66  declareProperty("MinRPCPhiits", m_minRpcPhiHits = 1);
67  declareProperty("MinTGCEtaHits", m_minTgcEtaHits = 1);
68  declareProperty("MinTGCPhiHits", m_minTgcPhiHits = 1);
69  declareProperty("MinSTGCEtaHits", m_minsTgcEtaHits = 1);
70  declareProperty("MinSTGCPhiHits", m_minsTgcPhiHits = 1);
71  declareProperty("MinMMEtaHits", m_minMMEtaHits = 3);
72  declareProperty("ConsideredPDGs", m_pdgsToBeConsidered);
73 }

◆ ~MuonTrackPerformanceAlg()

MuonTrackPerformanceAlg::~MuonTrackPerformanceAlg ( )
virtual

Definition at line 75 of file MuonTrackPerformanceAlg.cxx.

75 {}

Member Function Documentation

◆ addTrackToTrackData()

void MuonTrackPerformanceAlg::addTrackToTrackData ( const Trk::Track track,
MuonTrackPerformanceAlg::TrackData trackData 
) const
private

Definition at line 1244 of file MuonTrackPerformanceAlg.cxx.

1244  {
1245  trackData.trackPars = track.perigeeParameters() ? new Trk::Perigee(*track.perigeeParameters()) : nullptr;
1246  trackData.chi2Ndof = 0.;
1247 
1248  if (track.fitQuality() && track.fitQuality()->numberDoF())
1249  trackData.chi2Ndof = track.fitQuality()->chiSquared() / track.fitQuality()->numberDoF();
1250 
1251  trackData.trackSummary = track.trackSummary() ? new Trk::TrackSummary(*track.trackSummary()) : nullptr;
1252  if (trackData.trackSummary && !trackData.trackSummary->muonTrackSummary()) {
1253  m_summaryHelperTool->addDetailedTrackSummary(track, *trackData.trackSummary);
1254  }
1255 }

◆ cardinality()

virtual unsigned int MuonTrackPerformanceAlg::cardinality ( ) const
inlinefinaloverridevirtual

Definition at line 187 of file MuonTrackPerformanceAlg.h.

187 { return 1;}

◆ clearEvent()

void MuonTrackPerformanceAlg::clearEvent ( MuonTrackPerformanceAlg::EventData event)
private

Definition at line 1366 of file MuonTrackPerformanceAlg.cxx.

1366  {
1367  clearTracks(event.missingTruthTracks);
1368  clearTracks(event.missingTruthTracksOneStation);
1369 
1370  clearTracks(event.missingStationMomLoss);
1371  clearTracks(event.missingStationLayer);
1372  clearTracks(event.missingStation);
1373 
1374  clearTracks(event.wrongStationLayer);
1375  clearTracks(event.wrongStation);
1376 
1377  clearTracks(event.fakeTracks);
1378  clearTracks(event.fakeTracksLowPt);
1379  clearTracks(event.fakeTracksSL);
1380 }

◆ clearTracks() [1/2]

void MuonTrackPerformanceAlg::clearTracks ( std::vector< const Trk::Track * >  tracks)
private

Definition at line 1352 of file MuonTrackPerformanceAlg.cxx.

1352  {
1353  std::vector<const Trk::Track*>::const_iterator it = tracks.begin();
1354  std::vector<const Trk::Track*>::const_iterator it_end = tracks.end();
1355  for (; it != it_end; ++it) delete *it;
1356  tracks.clear();
1357 }

◆ clearTracks() [2/2]

void MuonTrackPerformanceAlg::clearTracks ( std::vector< TrackData * >  tracks)
private

Definition at line 1359 of file MuonTrackPerformanceAlg.cxx.

1359  {
1360  std::vector<TrackData*>::const_iterator it = tracks.begin();
1361  std::vector<TrackData*>::const_iterator it_end = tracks.end();
1362  for (; it != it_end; ++it) { delete *it; }
1363  tracks.clear();
1364 }

◆ countHitsInChamber()

std::pair< int, int > MuonTrackPerformanceAlg::countHitsInChamber ( const Identifier chId,
const std::set< Identifier > &  hitIds 
) const
private

counts number of eta (first number) and phi (second number in pair) hits in the set of hit IDs in the given chamber

Definition at line 997 of file MuonTrackPerformanceAlg.cxx.

997  {
998  // loop over hits in set, calculate their chID and compare it with the input chamber
999  int nhitsPhi = m_idHelperSvc->isMdt(chId) ? -1 : 0;
1000  int nhitsEta = 0;
1001  std::set<Identifier>::const_iterator it = hitIds.begin();
1002  std::set<Identifier>::const_iterator it_end = hitIds.end();
1003  for (; it != it_end; ++it) {
1004  Identifier ch = m_idHelperSvc->chamberId(*it);
1005  if (ch == chId) {
1006  if (m_idHelperSvc->measuresPhi(*it))
1007  ++nhitsPhi;
1008  else
1009  ++nhitsEta;
1010  }
1011  }
1012  return std::make_pair(nhitsEta, nhitsPhi);
1013 }

◆ createTrackData()

MuonTrackPerformanceAlg::TrackData * MuonTrackPerformanceAlg::createTrackData ( const Muon::IMuonTrackTruthTool::TruthTreeEntry trackTruth) const
private

create track data object for truth track

Definition at line 1257 of file MuonTrackPerformanceAlg.cxx.

1258  {
1259  if (!trackTruth.truthTrack) { return nullptr; }
1260 
1261  TrackData* trackData = new TrackData();
1262 
1263  std::map<Identifier, std::set<Identifier> > chambers;
1264 
1265  MuonSimDataCollection::const_iterator mit = trackTruth.mdtHits.begin();
1266  MuonSimDataCollection::const_iterator mit_end = trackTruth.mdtHits.end();
1267  for (; mit != mit_end; ++mit) {
1268  Identifier chId = m_idHelperSvc->chamberId(mit->first);
1269  chambers[chId].insert(mit->first);
1270  }
1271 
1272  if (m_idHelperSvc->hasCSC()) {
1273  CscSimDataCollection::const_iterator cit = trackTruth.cscHits.begin();
1274  CscSimDataCollection::const_iterator cit_end = trackTruth.cscHits.end();
1275  for (; cit != cit_end; ++cit) {
1276  Identifier chId = m_idHelperSvc->chamberId(cit->first);
1277  chambers[chId].insert(m_idHelperSvc->layerId(cit->first));
1278  }
1279  }
1280  if (m_idHelperSvc->hasSTGC()) {
1281  mit = trackTruth.stgcHits.begin();
1282  mit_end = trackTruth.stgcHits.end();
1283  for (; mit != mit_end; ++mit) {
1284  Identifier chId = m_idHelperSvc->chamberId(mit->first);
1285  chambers[chId].insert(mit->first);
1286  }
1287  }
1288  if (m_idHelperSvc->hasMM()) {
1289  mit = trackTruth.mmHits.begin();
1290  mit_end = trackTruth.mmHits.end();
1291  for (; mit != mit_end; ++mit) {
1292  Identifier chId = m_idHelperSvc->chamberId(mit->first);
1293  chambers[chId].insert(mit->first);
1294  }
1295  }
1296 
1297  mit = trackTruth.rpcHits.begin();
1298  mit_end = trackTruth.rpcHits.end();
1299  for (; mit != mit_end; ++mit) {
1300  Identifier chId = m_idHelperSvc->chamberId(mit->first);
1301  chambers[chId].insert(mit->first);
1302  }
1303 
1304  mit = trackTruth.tgcHits.begin();
1305  mit_end = trackTruth.tgcHits.end();
1306  for (; mit != mit_end; ++mit) {
1307  Identifier chId = m_idHelperSvc->chamberId(mit->first);
1308  chambers[chId].insert(mit->first);
1309  }
1310 
1311  std::vector<ChamberData> missingChambers;
1312  std::map<Identifier, std::set<Identifier> >::const_iterator chIt = chambers.begin();
1313  std::map<Identifier, std::set<Identifier> >::const_iterator chIt_end = chambers.end();
1314  for (; chIt != chIt_end; ++chIt) {
1315  ChamberData chamberData;
1316  unsigned int minEtaHits = 0;
1317  unsigned int minPhiHits = 0;
1318  if (m_idHelperSvc->isMdt(chIt->first)) {
1319  minEtaHits = m_minMdtHits;
1320  minPhiHits = m_minMdtHits;
1321  } else if (m_idHelperSvc->isRpc(chIt->first)) {
1322  minEtaHits = m_minRpcEtaHits;
1323  minPhiHits = m_minRpcPhiHits;
1324  } else if (m_idHelperSvc->isTgc(chIt->first)) {
1325  minEtaHits = m_minTgcEtaHits;
1326  minPhiHits = m_minTgcPhiHits;
1327  } else if (m_idHelperSvc->issTgc(chIt->first)) {
1328  minEtaHits = m_minsTgcEtaHits;
1329  minPhiHits = m_minsTgcPhiHits;
1330  } else if (m_idHelperSvc->isMM(chIt->first)) {
1331  minEtaHits = m_minMMEtaHits;
1332  minPhiHits = m_minMMEtaHits;
1333  } else if (m_idHelperSvc->isCsc(chIt->first)) {
1334  minEtaHits = m_minCscEtaHits;
1335  minPhiHits = m_minCscPhiHits;
1336  } else {
1337  ATH_MSG_WARNING("unexpected identifier");
1338  continue;
1339  }
1340  if (insertChamber(chIt->first, chIt->second, minEtaHits, minPhiHits, chamberData)) {
1341  trackData->missingChambers.push_back(chamberData);
1342  Muon::MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(chIt->first);
1343  if (m_idHelperSvc->isTrigger(chIt->first))
1344  trackData->missingLayersTrigger.insert(stIndex);
1345  else
1346  trackData->missingLayers.insert(stIndex);
1347  }
1348  }
1349  return trackData;
1350 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ doSummary() [1/2]

void MuonTrackPerformanceAlg::doSummary ( const Muon::IMuonTrackTruthTool::TruthTree truthTracks) const
private

Definition at line 622 of file MuonTrackPerformanceAlg.cxx.

622  {
623  msg() << " Summarizing tracks in event " << eventInfo() << " nevents " << m_nevents;
624  if (truthTracks.empty())
625  msg() << " : no truth tracks" << endmsg;
626  else {
627  msg() << " : " << truthTracks.size() << " truth tracks found " << std::endl;
628  Muon::IMuonTrackTruthTool::TruthTree::const_iterator tit = truthTracks.begin();
629  Muon::IMuonTrackTruthTool::TruthTree::const_iterator tit_end = truthTracks.end();
630  for (; tit != tit_end; ++tit) {
631  msg() << print(tit->second);
632  // should finish with an 'endmsg' else the buffer does not get flushed.
633  Muon::IMuonTrackTruthTool::TruthTree::const_iterator tit_temp = tit;
634  if (++tit_temp == tit_end)
635  msg() << endmsg;
636  else
637  msg() << std::endl;
638  }
639  }
640 }

◆ doSummary() [2/2]

void MuonTrackPerformanceAlg::doSummary ( const TrackCollection tracks) const
private

Definition at line 598 of file MuonTrackPerformanceAlg.cxx.

598  {
599  msg() << " Summarizing tracks in event " << eventInfo() << " nevents " << m_nevents;
600  if (trackCollection.empty())
601  msg() << " : no tracks found" << endmsg;
602  else {
603  msg() << " : " << trackCollection.size() << " tracks found " << std::endl;
604  TrackCollection::const_iterator tit = trackCollection.begin();
605  TrackCollection::const_iterator tit_end = trackCollection.end();
606  for (; tit != tit_end; ++tit) {
607  if (m_doHitResiduals > 0) {
608  msg() << m_printer->print(**tit) << " " << m_printer->printStations(**tit) << std::endl;
609  msg() << m_printer->printMeasurements(**tit);
610  } else {
611  msg() << m_printer->print(**tit) << " " << m_printer->printStations(**tit);
612  }
613  // should finish with an 'endmsg' else the buffer does not get flushed.
614  if (tit == tit_end - 1)
615  msg() << endmsg;
616  else
617  msg() << std::endl;
618  }
619  }
620 }

◆ evaluateTrackTruthOverlap()

MuonTrackPerformanceAlg::TrackData * MuonTrackPerformanceAlg::evaluateTrackTruthOverlap ( const Muon::MuonTrackTruth truthTrack) const
private

evaluate track/truth overlap and create the corresponding overlap description object

Definition at line 1082 of file MuonTrackPerformanceAlg.cxx.

1082  {
1083  TrackData* trackData = new TrackData();
1084 
1085  // handle missing chambers
1086  insertTechnology(truthTrack.mdts.missedChambers, truthTrack.mdts.missedHits, m_minMdtHits, 0, trackData->missingChambers);
1087  if (m_idHelperSvc->hasCSC())
1089  trackData->missingChambers);
1090  if (m_idHelperSvc->hasSTGC())
1092  trackData->missingChambers);
1093  if (m_idHelperSvc->hasMM())
1094  insertTechnology(truthTrack.mms.missedChambers, truthTrack.mms.missedHits, m_minMMEtaHits, 0, trackData->missingChambers);
1096  trackData->missingChambers);
1098  trackData->missingChambers);
1099 
1100  // handle wrong chambers
1101  insertTechnology(truthTrack.mdts.wrongChambers, truthTrack.mdts.wrongHits, m_minMdtHits, 0, trackData->wrongChambers);
1102  if (m_idHelperSvc->hasCSC())
1104  trackData->wrongChambers);
1105  if (m_idHelperSvc->hasSTGC())
1107  trackData->wrongChambers);
1108  if (m_idHelperSvc->hasMM())
1109  insertTechnology(truthTrack.mms.wrongChambers, truthTrack.mms.wrongHits, m_minMMEtaHits, 0, trackData->wrongChambers);
1110  insertTechnology(truthTrack.rpcs.wrongChambers, truthTrack.rpcs.wrongHits, m_minRpcEtaHits, m_minRpcPhiHits, trackData->wrongChambers);
1111  insertTechnology(truthTrack.tgcs.wrongChambers, truthTrack.tgcs.wrongHits, m_minTgcEtaHits, m_minTgcPhiHits, trackData->wrongChambers);
1112 
1113  // handle layer information for precision chambers
1114  std::set<Muon::MuonStationIndex::StIndex> dummyList;
1115  insertStationLayers(truthTrack.mdts.matchedChambers, dummyList, trackData->layers);
1116  if (m_idHelperSvc->hasCSC()) insertStationLayers(truthTrack.cscs.matchedChambers, dummyList, trackData->layers);
1117  if (m_idHelperSvc->hasMM()) insertStationLayers(truthTrack.mms.matchedChambers, dummyList, trackData->layers);
1118 
1119  insertStationLayers(trackData->missingChambers, trackData->layers, trackData->missingLayers, true);
1120  insertStationLayers(trackData->wrongChambers, trackData->layers, trackData->wrongLayers, true);
1121 
1122  // handle layer information for precision chambers
1123  insertStationLayers(truthTrack.rpcs.matchedChambers, dummyList, trackData->layersTrigger);
1124  insertStationLayers(truthTrack.tgcs.matchedChambers, dummyList, trackData->layersTrigger);
1125  if (m_idHelperSvc->hasSTGC()) insertStationLayers(truthTrack.stgcs.matchedChambers, dummyList, trackData->layersTrigger);
1126 
1127  insertStationLayers(trackData->missingChambers, trackData->layersTrigger, trackData->missingLayersTrigger, false);
1128  insertStationLayers(trackData->wrongChambers, trackData->layersTrigger, trackData->wrongLayersTrigger, false);
1129 
1130  return trackData;
1131 }

◆ eventInfo()

std::string MuonTrackPerformanceAlg::eventInfo ( ) const
private

Definition at line 596 of file MuonTrackPerformanceAlg.cxx.

596 { return std::to_string(eventNumber()); }

◆ eventNumber()

int MuonTrackPerformanceAlg::eventNumber ( ) const
private

Definition at line 591 of file MuonTrackPerformanceAlg.cxx.

591  {
592  if (!m_eventInfo) return -1;
593  return m_eventInfo->eventNumber();
594 }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode MuonTrackPerformanceAlg::execute ( )
overridevirtual

Definition at line 112 of file MuonTrackPerformanceAlg.cxx.

112  {
113 
115  if (!evInfo.isValid()) {
116  ATH_MSG_WARNING("failed to retrieve EventInfo");
117  return StatusCode::FAILURE;
118  }
119  m_eventInfo = evInfo.cptr();
120  handleTracks();
121 
122  ++m_nevents;
123 
124  return StatusCode::SUCCESS;
125 }

◆ extractEtaPhiCounts()

void MuonTrackPerformanceAlg::extractEtaPhiCounts ( const std::set< Identifier > &  ids,
int &  neta,
int &  nphi,
int &  netaCh,
int &  nphiCh 
) const
private

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode MuonTrackPerformanceAlg::finalize ( )
overridevirtual

Definition at line 563 of file MuonTrackPerformanceAlg.cxx.

563  {
565 
566  // write to file
567  if (m_writeToFile) {
568  std::string outfile = "trkPerformance_";
569  outfile.append(m_trackTypeString);
570  outfile.append(".txt");
571  m_fileOutput.open(outfile.c_str(), std::ios::trunc);
572 
574 
575  m_fileOutput.close();
576  }
577 
578  if (m_doTruth && m_doTrackDebug >= 1) {
581  printFakeTracks();
582  }
583 
586  for (; eit != eit_end; ++eit) { clearEvent(*eit); }
587 
588  return StatusCode::SUCCESS;
589 }

◆ getInitialState()

HepMC::ConstGenParticlePtr MuonTrackPerformanceAlg::getInitialState ( const TruthTrajectory traj) const
private

Definition at line 1391 of file MuonTrackPerformanceAlg.cxx.

1391  {
1392  std::vector<HepMcParticleLink>::const_reverse_iterator pit = traj.rbegin();
1393  std::vector<HepMcParticleLink>::const_reverse_iterator pit_end = traj.rend();
1394  for (; pit != pit_end; ++pit) {
1395  if (std::abs((*pit)->pdg_id()) != 13) {
1396  if (pit != traj.rbegin())
1397  --pit;
1398  else
1399  return nullptr;
1400  return *pit;
1401  }
1402  }
1403  return nullptr;
1404 }

◆ getMother()

HepMC::ConstGenParticlePtr MuonTrackPerformanceAlg::getMother ( const TruthTrajectory traj) const
private

Definition at line 1382 of file MuonTrackPerformanceAlg.cxx.

1382  {
1383  std::vector<HepMcParticleLink>::const_reverse_iterator pit = traj.rbegin();
1384  std::vector<HepMcParticleLink>::const_reverse_iterator pit_end = traj.rend();
1385  for (; pit != pit_end; ++pit) {
1386  if (std::abs((*pit)->pdg_id()) != 13) return *pit;
1387  }
1388  return nullptr;
1389 }

◆ goodTruthTrack()

bool MuonTrackPerformanceAlg::goodTruthTrack ( const Muon::IMuonTrackTruthTool::TruthTreeEntry entry) const
private

Definition at line 235 of file MuonTrackPerformanceAlg.cxx.

235  {
236  if ((!entry.cscHits.empty() || (!entry.mmHits.empty() && !entry.stgcHits.empty())) && entry.mdtHits.empty()) return false;
237  TrackRecord* trackRecord = const_cast<TrackRecord*>(entry.truthTrack);
238  if (!trackRecord) return false;
239  if (m_usePtCut) {
240  if (trackRecord->GetMomentum().perp() < m_momentumCutSim) return false;
241  } else {
242  if (trackRecord->GetMomentum().mag() < m_momentumCutSim) return false;
243  }
244  if (!selectPdg(trackRecord->GetPDGCode())) return false;
245  if (m_isCombined && std::abs(trackRecord->GetMomentum().eta()) > 2.5) return false;
246  int hits = entry.mdtHits.size();
247  if (m_idHelperSvc->hasCSC()) hits += entry.cscHits.size();
248  if (m_idHelperSvc->hasMM()) hits += entry.mmHits.size();
249  return (hits > 4);
250 }

◆ handleSegmentCombi()

bool MuonTrackPerformanceAlg::handleSegmentCombi ( const Muon::MuonSegmentCombination combi)
private

This method loops over the segments in the combi and filles them into the internal structure of the MuonCombiTrackMaker

Definition at line 127 of file MuonTrackPerformanceAlg.cxx.

127  {
130  unsigned int nstations = combi.numberOfStations();
131 
132  // loop over chambers in combi and extract segments
133  for (unsigned int i = 0; i < nstations; ++i) {
134  // loop over segments in station
135  const Muon::MuonSegmentCombination::SegmentVec* stationSegs = combi.stationSegments(i);
136 
137  // check if not empty
138  if (!stationSegs || stationSegs->empty()) continue;
139 
140  Muon::MuonSegmentCombination::SegmentVec::const_iterator ipsg = stationSegs->begin();
141  Muon::MuonSegmentCombination::SegmentVec::const_iterator ipsg_end = stationSegs->end();
142  for (; ipsg != ipsg_end; ++ipsg) {
143  const Muon::MuonSegment* seg = dynamic_cast<const Muon::MuonSegment*>((*ipsg).get());
144 
145  if (!seg) {
146  ATH_MSG_WARNING("MuonSegmentCombination contains a segment that is not a MuonSegment!!");
147  return false;
148  }
149  }
150  }
151 
152  return true;
153 }

◆ handleTracks()

bool MuonTrackPerformanceAlg::handleTracks ( )
private

Definition at line 155 of file MuonTrackPerformanceAlg.cxx.

155  {
156  std::unique_ptr<TrackCollection> allTracks = std::make_unique<TrackCollection>();
157  if (!m_trackKey.key().empty()) { // MS tracks
159  if (!trackCol.isValid()) {
160  ATH_MSG_WARNING(" Could not find tracks at " << m_trackKey.key());
161  return false;
162  }
164  ATH_MSG_DEBUG(" Retrieved " << trackCol->size() << " tracks from " << trackCol.key());
165  m_ntracks += trackCol->size();
166 
167  if (m_doTruth) { handleTrackTruth(*trackCol); }
168 
169  if ((msgLvl(MSG::DEBUG) || m_doSummary >= 2) && !m_doTruth) { doSummary(*trackCol); }
170  } else {
172  if (!muons.isValid()) {
173  ATH_MSG_WARNING("could not find muons");
174  return false;
175  }
176  if (m_doStau)
177  m_trackTypeString = "MuGirlStauCombinedTracks";
178  else {
179  if (m_isCombined)
180  m_trackTypeString = "CombinedMuonTracks";
181  else {
182  if (m_trackType == (int)xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle)
183  m_trackTypeString = "MSOnlyExtrapolatedMuonTracks";
184  else
185  m_trackTypeString = "ExtrapolatedMuonTracks";
186  }
187  }
188  for (auto muon : *muons) {
189  if (!m_doStau) {
190  // if combined and not stau, only take MuidCo and MuGirl
191  if (m_isCombined && muon->author() != 1 && muon->author() != 6) continue;
192  if (!m_isCombined) {
193  // only MuidCo, MuidSA, and STACO will have MSOnlyExtrapolated tracks
194  if (m_trackType == xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle && muon->author() != 1 &&
195  muon->author() != 5 && muon->author() != 2)
196  continue;
197  // MuGirl should also have ME tracks
198  if (m_trackType == xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle && muon->author() != 1 &&
199  muon->author() != 5 && muon->author() != 2 && muon->author() != 6)
200  continue;
201  }
202  } else {
203  // only staus
204  if (muon->author() != 7) continue;
205  }
206  // TrackCollection is a DataVector so allTracks takes ownership of these copies
207  const xAOD::TrackParticle* tp = muon->trackParticle((xAOD::Muon::TrackParticleType)m_trackType);
208  if (!tp) {
209  // possible that MS-only track doesn't exist for combined muon, if initial extrapolation fails but combined fit succeeds
210  // otherwise, the track particle should be there, throw a warning
211  if (m_trackType == xAOD::Muon::MSOnlyExtrapolatedMuonSpectrometerTrackParticle)
212  ATH_MSG_DEBUG("no track particle of type " << m_trackType << " for muon with author " << muon->author() << " and pT "
213  << muon->pt());
214  else
215  ATH_MSG_WARNING("no track particle of type " << m_trackType << " for muon with author " << muon->author() << " and pT "
216  << muon->pt());
217  continue;
218  }
219  if (tp->track()) {
220  m_ntracks++;
221  allTracks->push_back(new Trk::Track(*tp->track()));
222  } else
223  ATH_MSG_WARNING("no track for this trackParticle, skipping");
224  }
225  ATH_MSG_DEBUG("got " << allTracks->size() << " tracks");
226 
227  if (m_doTruth) { handleTrackTruth(*allTracks.get()); }
228 
229  if ((msgLvl(MSG::DEBUG) || m_doSummary >= 2) && !m_doTruth) { doSummary(*allTracks.get()); }
230  }
231 
232  return true;
233 }

◆ handleTrackTruth()

bool MuonTrackPerformanceAlg::handleTrackTruth ( const TrackCollection trackCollection)
private

Definition at line 252 of file MuonTrackPerformanceAlg.cxx.

252  {
253  bool didOutput = false;
254 
255  unsigned int ntruthTracks(0);
256  unsigned int ntruthTracksSecondary(0);
257 
260  std::vector<const MuonSimDataCollection*> muonSimData;
261  for (SG::ReadHandle<MuonSimDataCollection>& simDataMap : m_muonSimData.makeHandles()) {
262  if (!simDataMap.isValid()) {
263  ATH_MSG_WARNING(simDataMap.key() << " not valid");
264  continue;
265  }
266  if (!simDataMap.isPresent()) continue;
267  muonSimData.push_back(simDataMap.cptr());
268  }
269  const CscSimDataCollection* cscSimData = nullptr;
270  if (m_idHelperSvc->hasCSC()) {
272  if (!cscSimDataMap.isValid()) {
273  ATH_MSG_WARNING(cscSimDataMap.key() << " not valid");
274  } else {
275  cscSimData = cscSimDataMap.cptr();
276  }
277  }
278  const Muon::IMuonTrackTruthTool::TruthTree truthTree =
279  m_truthTool->createTruthTree(truthTrackCol.cptr(), mcEventCollection.cptr(), muonSimData, cscSimData);
280 
281  // map TrackRecord onto entry for printing
282  std::map<const TrackRecord*, Muon::IMuonTrackTruthTool::TruthTreeEntry> truthTrackEntryMap;
283  Muon::IMuonTrackTruthTool::TruthTree::const_iterator tit = truthTree.begin();
284  Muon::IMuonTrackTruthTool::TruthTree::const_iterator tit_end = truthTree.end();
285  for (; tit != tit_end; ++tit) {
286  if (!tit->second.truthTrack) continue;
287 
288  truthTrackEntryMap[tit->second.truthTrack] = tit->second;
289 
290  if (!goodTruthTrack(tit->second)) continue;
291 
292  bool isSec = isSecondary(tit->second);
293 
294  if (isSec)
295  ++ntruthTracksSecondary;
296  else
297  ++ntruthTracks;
298  }
299 
300  m_ntruthTracks += ntruthTracks;
301  m_ntruthTracksSecondary += ntruthTracksSecondary;
302 
303  std::set<const Trk::Track*> matchedTracks;
304  std::set<const Trk::Track*> matchedFakeTracks;
305  std::map<const TrackRecord*, Muon::IMuonTrackTruthTool::MatchResult> bestMatched;
306 
307  unsigned int nmatched(0);
308  unsigned int nmatchedSecondary(0);
309 
310  Muon::IMuonTrackTruthTool::ResultVec result = m_truthTool->match(truthTree, trackCollection);
313  for (; rit != rit_end; ++rit) {
314  Muon::MuonTrackTruth& trackTruth = rit->second;
315 
316  // skip track if not matched to any muon
317  if (!trackTruth.truthTrack) continue;
318 
319  // skip match if zero overlap with truth track
320  if (trackTruth.numberOfMatchedHits() == 0) continue;
321 
323  truthTrackEntryMap.find(trackTruth.truthTrack);
324  if (pos == truthTrackEntryMap.end()) {
325  ATH_MSG_WARNING("Truth track not found in map, this should not happen!!");
326  continue;
327  }
328 
329  if (!goodTruthTrack(pos->second)) continue;
330 
331  // see whether we already had an track matched to this truth track
332  if (!bestMatched.count(trackTruth.truthTrack)) {
333  // no track found yet, this is the best match
334  bestMatched[trackTruth.truthTrack] = *rit;
335 
336  matchedTracks.insert(rit->first);
337 
338  bool isSec = isSecondary(pos->second);
339 
340  if (isSec)
341  ++nmatchedSecondary;
342  else
343  ++nmatched;
344 
345  } else {
347  matchedFakeTracks.insert(rit->first);
348  }
349  }
350 
351  m_nmatchedTracks += nmatched;
352  m_nmatchedTracksSecondary += nmatchedSecondary;
353  m_nfakeTracks += trackCollection.size() - nmatched;
354 
355  // now we have gathered all links between the tracks and truth.
356  // Let's generate some diagnostics
357 
358  EventData eventData;
359  eventData.eventNumber = eventNumber();
360  eventData.eventPosition = m_nevents;
361 
362  if (m_doTrackDebug >= 5 || msgLvl(MSG::DEBUG)) {
363  ATH_MSG_INFO("Event " << eventData.eventNumber << " truth tracks " << ntruthTracks);
364  }
365 
366  // first loop over truth tracks that were found by reco
369  for (; mit != mit_end; ++mit) {
370  Muon::MuonTrackTruth& truthTrack = mit->second.second;
372  truthTrackEntryMap.find(truthTrack.truthTrack);
373  if (pos == truthTrackEntryMap.end()) {
374  ATH_MSG_WARNING("Truth track not found in map, this should not happen!!");
375  continue;
376  }
377 
378  // create track summary
379  TrackData* trackData = evaluateTrackTruthOverlap(truthTrack);
380  if (!trackData) continue;
381  addTrackToTrackData(*mit->second.first, *trackData);
382  trackData->truthTrack = new TrackRecord(*mit->first);
383  if (truthTrack.truthTrajectory) {
384  trackData->truthTrajectory = new TruthTrajectory(*truthTrack.truthTrajectory);
386  if (mother) {
387  trackData->motherPdg = mother->pdg_id();
388  if (mother->end_vertex())
389  trackData->productionVertex = new Amg::Vector3D(
390  mother->end_vertex()->position().x(), mother->end_vertex()->position().y(), mother->end_vertex()->position().z());
391  }
393  if (original) {
394  trackData->momentumAtProduction =
395  new Amg::Vector3D(original->momentum().x(), original->momentum().y(), original->momentum().z());
396  }
397  }
398  // check whether track is all ok
399  if (trackData->allOk()) {
400  if (m_doTrackDebug >= 5 || msgLvl(MSG::DEBUG)) {
401  ATH_MSG_INFO(print(*trackData));
402  didOutput = true;
403  }
404  delete trackData;
405  continue;
406  }
407 
408  // if we get here something was wrong, let's evaluate what
409  if (trackData->hasMissingChambers()) {
410  if (trackData->isEndcapSLTrack() && trackData->isMissingInner()) {
412  eventData.missingStationMomLoss.push_back(trackData);
413  } else if (trackData->hasMissingLayers()) {
415  eventData.missingStationLayer.push_back(trackData);
416  } else if (trackData->hasMissingLayersTrigger()) {
418  eventData.missingStationLayerTrigger.push_back(trackData);
419  } else {
421  eventData.missingStation.push_back(trackData);
422  }
423  } else if (trackData->hasWrongChambers()) {
424  if (trackData->hasWrongLayers()) {
425  eventData.wrongStationLayer.push_back(trackData);
427  } else if (trackData->hasWrongLayersTrigger()) {
428  eventData.wrongStationLayer.push_back(trackData);
430  } else {
431  ++m_nwrongStation;
432  eventData.wrongStation.push_back(trackData);
433  }
434  } else {
435  ATH_MSG_WARNING("Unknown problem with matched track " << std::endl << print(*trackData));
436  delete trackData;
437  continue;
438  }
439 
440  if (msgLvl(MSG::DEBUG) || m_doTrackDebug >= 4) {
441  ATH_MSG_INFO("Incomplete track in event " << eventInfo() << " nevents " << m_nevents << std::endl
442  << print(*trackData));
443  didOutput = true;
444  }
445  }
446 
447  // now the truth tracks that were not found
448  unsigned int nmissed(0);
449  tit = truthTree.begin();
450  tit_end = truthTree.end();
451  for (; tit != tit_end; ++tit) {
452  // skip bad truth tracks
453  if (!goodTruthTrack(tit->second)) continue;
454 
455  // check whether truth track was matched
456  if (bestMatched.count(tit->second.truthTrack)) continue;
457 
458  TrackData* trackData = createTrackData(tit->second);
459  if (!trackData) {
460  ATH_MSG_WARNING("Failed to create TrackData for truth track");
461  continue;
462  }
463  trackData->truthTrack = new TrackRecord(*tit->second.truthTrack);
464  if (tit->second.truthTrajectory) {
465  trackData->truthTrajectory = new TruthTrajectory(*tit->second.truthTrajectory);
466  HepMC::ConstGenParticlePtr mother = getMother(*tit->second.truthTrajectory);
467  if (mother) {
468  trackData->motherPdg = mother->pdg_id();
469  if (mother->end_vertex())
470  trackData->productionVertex = new Amg::Vector3D(
471  mother->end_vertex()->position().x(), mother->end_vertex()->position().y(), mother->end_vertex()->position().z());
472  }
473  HepMC::ConstGenParticlePtr original = getInitialState(*tit->second.truthTrajectory);
474  if (original) {
475  trackData->momentumAtProduction =
476  new Amg::Vector3D(original->momentum().x(), original->momentum().y(), original->momentum().z());
477  }
478  }
479  if (m_doTrackDebug >= 3 || msgLvl(MSG::DEBUG)) {
480  ATH_MSG_INFO("Truth track not found: " << std::endl << print(*trackData));
481  didOutput = true;
482  }
483  bool isSec = isSecondary(tit->second);
484 
485  if (trackData->missingLayers.size() == 1) {
486  if (isSec)
488  else
490  eventData.missingTruthTracksOneStation.push_back(trackData);
491  } else {
492  if (isSec)
494  else
495  ++m_nmissedTracks;
496  eventData.missingTruthTracks.push_back(trackData);
497  }
498  ++nmissed;
499  }
500 
501  // sanity check
502  if (ntruthTracks < nmatched)
503  ATH_MSG_WARNING("found more matched tracks than truth tracks: truth " << ntruthTracks << " matched " << nmatched);
504 
505  if (nmissed != ntruthTracks - nmatched)
506  ATH_MSG_WARNING("inconsisted number of missed tracks: truth " << ntruthTracks << " matched " << nmatched << " missed " << nmissed);
507 
508  // finally print fake tracks
509  TrackCollection::const_iterator trit = trackCollection.begin();
510  TrackCollection::const_iterator trit_end = trackCollection.end();
511  for (; trit != trit_end; ++trit) {
512  if (matchedTracks.count(*trit)) continue;
513 
514  double pt = 1e9;
515  if ((**trit).perigeeParameters()) {
516  if (m_usePtCut)
517  pt = (**trit).perigeeParameters()->momentum().perp();
518  else
519  pt = (**trit).perigeeParameters()->momentum().mag();
520  }
521  bool isSL = false;
522  if (m_edmHelperSvc->isSLTrack(**trit)) {
523  pt = 0.;
524  isSL = true;
525  }
526  bool isHighPt = pt > m_momentumCut;
527  bool matchedFake = matchedFakeTracks.count(*trit);
528  std::string fakeType = isHighPt ? "HighPt" : "LowPt";
529  if (isSL) fakeType = "SL";
530  if (matchedFake) fakeType += " (matched)";
531 
533  if (matchedFake) summary.trackPars = "(matched) ";
534  summary.trackPars += m_printer->print(**trit);
535  summary.chambers = m_printer->printStations(**trit);
536 
537  TrackData* trackData = new TrackData();
538  addTrackToTrackData(**trit, *trackData);
539  if (isHighPt) {
540  eventData.fakeTracks.push_back(trackData);
542  } else if (isSL) {
543  ++m_nfakeTracksSL;
544  eventData.fakeTracksSL.push_back(trackData);
545  } else {
547  eventData.fakeTracksLowPt.push_back(trackData);
548  }
549 
550  if (m_doTrackDebug >= 3 || msgLvl(MSG::DEBUG)) {
551  msg() << MSG::INFO << "Fake track " << fakeType << ": " << std::endl
552  << summary.trackPars << " " << summary.chambers << std::endl;
553  didOutput = true;
554  }
555  }
556  if (didOutput) { msg() << MSG::INFO << endmsg; }
557 
558  if (!eventData.goodEvent()) m_badEvents.push_back(eventData);
559 
560  return true;
561 }

◆ initialize()

StatusCode MuonTrackPerformanceAlg::initialize ( )
overridevirtual

Definition at line 77 of file MuonTrackPerformanceAlg.cxx.

77  {
78 
79  ATH_CHECK(m_idHelperSvc.retrieve());
80  ATH_CHECK(m_printer.retrieve());
81  ATH_CHECK(m_edmHelperSvc.retrieve());
82  ATH_CHECK(m_truthTool.retrieve(EnableTool{m_doTruth}));
83 
84  ATH_CHECK(m_summaryHelperTool.retrieve());
85 
86  // add muons
87  if (m_pdgsToBeConsidered.value().empty()) {
88  m_selectedPdgs.insert(13);
89  m_selectedPdgs.insert(-13);
90  } else {
91  // add pdgs
92  for (auto pdg : m_pdgsToBeConsidered.value()) m_selectedPdgs.insert(pdg);
93  msg(MSG::DEBUG) << " PDG codes used for matching";
94  for (auto val : m_selectedPdgs) msg(MSG::DEBUG) << " " << val;
95  msg(MSG::DEBUG) << endmsg;
96  }
97 
98  ATH_CHECK(m_trackKey.initialize(!m_trackKey.key().empty()));
99  ATH_CHECK(m_muons.initialize(!m_muons.key().empty()));
100 
102 
104  if (!(m_idHelperSvc->hasSTGC() && m_idHelperSvc->hasMM())) m_muonSimData = {"MDT_SDO", "RPC_SDO", "TGC_SDO"};
105  ATH_CHECK(m_muonSimData.initialize(m_doTruth));
107  ATH_CHECK(m_trackRecord.initialize(m_doTruth));
108 
109  return StatusCode::SUCCESS;
110 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ insertChamber()

bool MuonTrackPerformanceAlg::insertChamber ( const Identifier chId,
const std::set< Identifier > &  hits,
int  minEtaHits,
int  minPhiHits,
MuonTrackPerformanceAlg::ChamberData chamberData 
) const
private

insert chamber information into ChamberData if hits counts pass cuts, returns true if anything was inserted

Definition at line 1015 of file MuonTrackPerformanceAlg.cxx.

1016  {
1017  // flag whether chamber passes selection
1018  bool passesThreshold = false;
1019 
1020  // count eta and phi hits in chamber
1021  std::pair<int, int> missingHits = countHitsInChamber(chId, hits);
1022  if (missingHits.first >= minEtaHits) passesThreshold = true;
1023  if (missingHits.second >= minPhiHits) passesThreshold = true;
1024 
1025 
1026  // if inside cuts, copy the hits into summary
1027  if (passesThreshold) {
1028  chamberData.chId = chId;
1029  std::set<Identifier>::const_iterator it = hits.begin();
1030  std::set<Identifier>::const_iterator it_end = hits.end();
1031  for (; it != it_end; ++it) {
1032  Identifier ch = m_idHelperSvc->chamberId(*it);
1033  if (ch == chId) {
1034  chamberData.hits.insert(*it);
1035  }
1036  }
1037  }
1038  return passesThreshold;
1039 }

◆ insertStationLayers() [1/2]

bool MuonTrackPerformanceAlg::insertStationLayers ( const std::set< Identifier > &  chIds,
const std::set< Muon::MuonStationIndex::StIndex > &  exclusionList,
std::set< Muon::MuonStationIndex::StIndex > &  layers 
) const
private

insert station layers into layer set if they are not in exclusion list

Definition at line 1053 of file MuonTrackPerformanceAlg.cxx.

1055  {
1056  unsigned int inputSize = layers.size();
1057 
1058  std::set<Identifier>::const_iterator chit = chIds.begin();
1059  std::set<Identifier>::const_iterator chit_end = chIds.end();
1060  for (; chit != chit_end; ++chit) {
1061  Muon::MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(*chit);
1062  if (!exclusionList.count(stIndex)) layers.insert(stIndex);
1063  }
1064 
1065  return inputSize != layers.size();
1066 }

◆ insertStationLayers() [2/2]

bool MuonTrackPerformanceAlg::insertStationLayers ( const std::vector< ChamberData > &  chambers,
const std::set< Muon::MuonStationIndex::StIndex > &  exclusionList,
std::set< Muon::MuonStationIndex::StIndex > &  layers,
bool  usePrecision 
) const
private

insert chamber data into layers if not in exclusion list

Definition at line 1068 of file MuonTrackPerformanceAlg.cxx.

1070  {
1071  std::set<Identifier> chIds;
1072  std::vector<ChamberData>::const_iterator chit = chambers.begin();
1073  std::vector<ChamberData>::const_iterator chit_end = chambers.end();
1074  for (; chit != chit_end; ++chit) {
1075  bool isTrigger = m_idHelperSvc->isTrigger(chit->chId);
1076  if ((usePrecision && isTrigger) || (!usePrecision && !isTrigger)) continue;
1077  chIds.insert(m_idHelperSvc->chamberId(chit->chId));
1078  }
1079  return insertStationLayers(chIds, exclusionList, layers);
1080 }

◆ insertTechnology()

bool MuonTrackPerformanceAlg::insertTechnology ( const std::set< Identifier > &  chIds,
const std::set< Identifier > &  hits,
int  minEtaHits,
int  minPhiHits,
std::vector< ChamberData > &  chamberData 
) const
private

insert set of chambers into chamber data if hits counts pass cuts, returns true if anything was inserted

Definition at line 1041 of file MuonTrackPerformanceAlg.cxx.

1042  {
1043  // loop over chambers
1044  std::set<Identifier>::const_iterator it = chIds.begin();
1045  std::set<Identifier>::const_iterator it_end = chIds.end();
1046  for (; it != it_end; ++it) {
1047  ChamberData chData;
1048  if (insertChamber(*it, hits, minEtaHits, minPhiHits, chData)) chambers.push_back(chData);
1049  }
1050  return !chambers.empty();
1051 }

◆ isSecondary() [1/3]

bool MuonTrackPerformanceAlg::isSecondary ( const Muon::IMuonTrackTruthTool::TruthTreeEntry entry) const
private

Definition at line 1411 of file MuonTrackPerformanceAlg.cxx.

1411  {
1412  if (!entry.truthTrajectory) return false;
1413  return isSecondary(*entry.truthTrajectory);
1414 }

◆ isSecondary() [2/3]

bool MuonTrackPerformanceAlg::isSecondary ( const Muon::MuonTrackTruth truthTrack) const
private

Definition at line 1406 of file MuonTrackPerformanceAlg.cxx.

1406  {
1407  if (!truthTrack.truthTrajectory) return false;
1408  return isSecondary(*truthTrack.truthTrajectory);
1409 }

◆ isSecondary() [3/3]

bool MuonTrackPerformanceAlg::isSecondary ( const TruthTrajectory truthTrajectory) const
private

Definition at line 1416 of file MuonTrackPerformanceAlg.cxx.

1416  {
1417  HepMC::ConstGenParticlePtr mother = getMother(truthTrajectory);
1418  if (mother && mother->end_vertex() && mother->end_vertex()->position().perp() > 100.) return true;
1419  return false;
1420 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print() [1/4]

std::string MuonTrackPerformanceAlg::print ( const EventData event,
const std::vector< const Trk::Track * > &  tracks,
const std::string &  message 
) const
private

Definition at line 763 of file MuonTrackPerformanceAlg.cxx.

764  {
765  std::ostringstream sout;
766  if (!tracks.empty()) {
767  sout << " Event " << event.eventNumber << " position in file " << event.eventPosition << " has " << tracks.size() << " " << message
768  << std::endl;
769  std::vector<const Trk::Track*>::const_iterator it = tracks.begin();
770  std::vector<const Trk::Track*>::const_iterator it_end = tracks.end();
771  for (; it != it_end; ++it) { sout << m_printer->print(**it) << std::endl << m_printer->printStations(**it) << std::endl; }
772  }
773  return sout.str();
774 }

◆ print() [2/4]

std::string MuonTrackPerformanceAlg::print ( const EventData event,
const std::vector< TrackData * > &  tracks,
const std::string &  message 
) const
private

Definition at line 750 of file MuonTrackPerformanceAlg.cxx.

751  {
752  std::ostringstream sout;
753  if (!tracks.empty()) {
754  sout << " Event " << event.eventNumber << " position in file " << event.eventPosition << " has " << tracks.size() << " " << message
755  << std::endl;
756  std::vector<TrackData*>::const_iterator it = tracks.begin();
757  std::vector<TrackData*>::const_iterator it_end = tracks.end();
758  for (; it != it_end; ++it) { sout << print(**it) << std::endl; }
759  }
760  return sout.str();
761 }

◆ print() [3/4]

std::string MuonTrackPerformanceAlg::print ( const Muon::IMuonTrackTruthTool::TruthTreeEntry trackTruth) const
private

Definition at line 642 of file MuonTrackPerformanceAlg.cxx.

642  {
643  std::ostringstream sout;
644  if (!trackTruth.truthTrack) {
645  sout << " No TrackRecord found! ";
646  return sout.str();
647  }
648 
649  TrackRecord& trackRecord = const_cast<TrackRecord&>(*trackTruth.truthTrack);
650  double charge = trackRecord.GetPDGCode() < 0 ? +1 : -1;
651 
652  // keep track of which chambers are present
653  std::map<Identifier, std::pair<int, int> > precisionIds;
654  std::map<Identifier, std::pair<int, int> > triggerIds;
655  std::map<Identifier, std::pair<int, int> > nhitsCompIds;
656 
657  unsigned int neta = 0;
658  unsigned int netaTrig = 0;
659  unsigned int nphi = 0;
660 
661  std::set<Identifier> allIds;
662  MuonSimDataCollection::const_iterator mit = trackTruth.mdtHits.begin();
663  MuonSimDataCollection::const_iterator mit_end = trackTruth.mdtHits.end();
664  for (; mit != mit_end; ++mit) allIds.insert(mit->first);
665 
666  if (m_idHelperSvc->hasCSC()) {
667  CscSimDataCollection::const_iterator cit = trackTruth.cscHits.begin();
668  CscSimDataCollection::const_iterator cit_end = trackTruth.cscHits.end();
669  for (; cit != cit_end; ++cit) allIds.insert(m_idHelperSvc->layerId(cit->first));
670  }
671  if (m_idHelperSvc->hasSTGC()) {
672  mit = trackTruth.stgcHits.begin();
673  mit_end = trackTruth.stgcHits.end();
674  for (; mit != mit_end; ++mit) allIds.insert(m_idHelperSvc->layerId(mit->first));
675  }
676  if (m_idHelperSvc->hasMM()) {
677  mit = trackTruth.mmHits.begin();
678  mit_end = trackTruth.mmHits.end();
679  for (; mit != mit_end; ++mit) allIds.insert(m_idHelperSvc->layerId(mit->first));
680  }
681 
682  mit = trackTruth.rpcHits.begin();
683  mit_end = trackTruth.rpcHits.end();
684  for (; mit != mit_end; ++mit) allIds.insert(m_idHelperSvc->layerId(mit->first));
685 
686  mit = trackTruth.tgcHits.begin();
687  mit_end = trackTruth.tgcHits.end();
688  for (; mit != mit_end; ++mit) allIds.insert(m_idHelperSvc->layerId(mit->first));
689 
690  std::set<Identifier>::iterator it = allIds.begin();
691  std::set<Identifier>::iterator it_end = allIds.end();
692  for (; it != it_end; ++it) {
693  Identifier id = *it;
694  Identifier chId = m_idHelperSvc->chamberId(id);
695  bool measuresPhi = m_idHelperSvc->measuresPhi(id);
696  if (measuresPhi) {
697  ++nhitsCompIds[chId].first;
698  } else {
699  ++nhitsCompIds[chId].second;
700  }
701 
702  if (m_idHelperSvc->isTrigger(chId)) {
703  if (measuresPhi) {
704  ++triggerIds[chId].first;
705  ++nphi;
706  } else {
707  ++triggerIds[chId].second;
708  ++netaTrig;
709  }
710  continue;
711  }
712  if (measuresPhi) {
713  ++precisionIds[chId].first;
714  ++nphi;
715  } else {
716  ++precisionIds[chId].second;
717  ++neta;
718  }
719  }
720  sout << "Truth: hits " << std::setw(5) << neta + nphi + netaTrig << " r " << (int)trackRecord.GetPosition().perp() << " z "
721  << (int)trackRecord.GetPosition().z() << std::setprecision(5) << " phi " << trackRecord.GetMomentum().phi() << " theta "
722  << trackRecord.GetMomentum().theta() << std::setw(6) << " q*mom " << (int)trackRecord.GetMomentum().mag() * charge << " pt "
723  << std::setw(5) << (int)trackRecord.GetMomentum().perp();
724  if (std::abs(trackRecord.GetPDGCode()) != 13) sout << " pdg " << trackRecord.GetPDGCode();
725 
726  if (trackTruth.truthTrajectory) {
728  if (mother) { sout << " mother " << mother->pdg_id(); }
729  }
730 
731  sout << " Eta hits " << neta << " phi " << nphi << " eta trig " << netaTrig << std::endl;
732  std::map<Identifier, std::pair<int, int> >::iterator iit = precisionIds.begin();
733  std::map<Identifier, std::pair<int, int> >::iterator iit_end = precisionIds.end();
734  for (; iit != iit_end; ++iit) {
735  sout.setf(std::ios::left);
736  sout << " " << std::setw(32) << m_idHelperSvc->toStringChamber(iit->first) << " hits: eta " << std::setw(3) << iit->second.second
737  << " phi " << std::setw(3) << iit->second.first << std::endl;
738  }
739  iit = triggerIds.begin();
740  iit_end = triggerIds.end();
741  for (; iit != iit_end; ++iit) {
742  sout << " " << std::setw(32) << m_idHelperSvc->toStringChamber(iit->first) << " hits: eta " << std::setw(3)
743  << nhitsCompIds[iit->first].second << " phi " << std::setw(3) << nhitsCompIds[iit->first].first << " stations: Eta "
744  << iit->second.second << " Phi " << iit->second.first << std::endl;
745  }
746 
747  return sout.str();
748 }

◆ print() [4/4]

std::string MuonTrackPerformanceAlg::print ( const TrackData trackData) const
private

print TrackData to a string

Definition at line 1133 of file MuonTrackPerformanceAlg.cxx.

1133  {
1134  std::ostringstream sout;
1135 
1136  // bool atIP = false;
1137  // if( trackData.trackPars && trackData.trackPars->associatedSurface().center().mag() < 1000. ) atIP = true;
1138 
1139  if (trackData.truthTrack) {
1140  double charge = trackData.truthTrack->GetPDGCode() < 0 ? +1 : -1;
1141  Trk::Perigee perigee(Amg::Vector3D(trackData.truthTrack->GetPosition().x(), trackData.truthTrack->GetPosition().y(),
1142  trackData.truthTrack->GetPosition().z()),
1143  Amg::Vector3D(trackData.truthTrack->GetMomentum().x(), trackData.truthTrack->GetMomentum().y(),
1144  trackData.truthTrack->GetMomentum().z()),
1145  charge, Trk::PerigeeSurface(Amg::Vector3D(0., 0., 0.)));
1146  sout << "Truth: " << m_printer->print(perigee); // << " barcode " << trackData.truthTrack->barcode();
1147  if (std::abs(trackData.truthTrack->GetPDGCode()) == 13) {
1148  if (trackData.motherPdg != -1) sout << " mother " << trackData.motherPdg;
1149  } else {
1150  sout << " pdg " << trackData.truthTrack->GetPDGCode();
1151  }
1152  if (trackData.momentumAtProduction) sout << " production p: " << trackData.momentumAtProduction->mag();
1153 
1154  // if( trackData.productionVertex ) sout << " production vertex: r " << trackData.productionVertex->perp()
1155  // << " z " << trackData.productionVertex->z();
1156  sout << std::endl;
1157  }
1158 
1159  if (trackData.trackPars) {
1160  sout << "Track: " << m_printer->print(*trackData.trackPars) << " chi2/ndof " << trackData.chi2Ndof << std::endl;
1161  if (trackData.trackPars->covariance()) {
1162  double qOverP = std::abs(trackData.trackPars->parameters()[Trk::qOverP]);
1163  double dpp = 0.;
1164  double cov00 = (*trackData.trackPars->covariance())(0, 0);
1165  double cov11 = (*trackData.trackPars->covariance())(1, 1);
1166  double cov22 = (*trackData.trackPars->covariance())(2, 2);
1167  double cov33 = (*trackData.trackPars->covariance())(3, 3);
1168  double cov44 = (*trackData.trackPars->covariance())(4, 4);
1169  if (qOverP > 0) dpp = std::sqrt(cov44) / qOverP;
1170  sout << " error d0 " << std::sqrt(cov00) << " z0 " << std::sqrt(cov11) << " phi (mrad) " << 1000 * std::sqrt(cov22)
1171  << " theta (mrad) " << 1000 * std::sqrt(cov33) << " dp/p " << dpp << std::endl;
1172  }
1173 
1174  if (trackData.trackSummary && trackData.trackSummary->muonTrackSummary())
1175  sout << m_printer->print(*trackData.trackSummary->muonTrackSummary()) << std::endl;
1176  }
1177 
1178  if (!trackData.missingChambers.empty()) {
1179  sout << " Missing Chambers: " << std::endl;
1180  std::vector<ChamberData>::const_iterator chIt = trackData.missingChambers.begin();
1181  std::vector<ChamberData>::const_iterator chIt_end = trackData.missingChambers.end();
1182  for (; chIt != chIt_end; ++chIt) {
1183  sout << " " << m_idHelperSvc->toStringChamber(chIt->chId) << " hits " << chIt->hits.size() << std::endl;
1184  if (m_doTrackDebug >= 6) {
1185  std::set<Identifier>::const_iterator hit = chIt->hits.begin();
1186  std::set<Identifier>::const_iterator hit_end = chIt->hits.end();
1187  for (; hit != hit_end; ++hit) { sout << " " << m_idHelperSvc->toString(*hit) << std::endl; }
1188  }
1189  }
1190  }
1191 
1192  if (!trackData.wrongChambers.empty()) {
1193  sout << " Wrong Chambers: " << std::endl;
1194  std::vector<ChamberData>::const_iterator chIt = trackData.wrongChambers.begin();
1195  std::vector<ChamberData>::const_iterator chIt_end = trackData.wrongChambers.end();
1196  for (; chIt != chIt_end; ++chIt) {
1197  sout << " " << m_idHelperSvc->toStringChamber(chIt->chId) << " hits " << chIt->hits.size() << std::endl;
1198  if (m_doTrackDebug >= 6) {
1199  std::set<Identifier>::const_iterator hit = chIt->hits.begin();
1200  std::set<Identifier>::const_iterator hit_end = chIt->hits.end();
1201  for (; hit != hit_end; ++hit) { sout << " " << m_idHelperSvc->toString(*hit) << std::endl; }
1202  }
1203  }
1204  }
1205 
1206  if (!trackData.missingLayers.empty() || !trackData.missingLayersTrigger.empty()) {
1207  sout << " Missing Layers: ";
1208  if (!trackData.missingLayers.empty()) {
1209  sout << " Precision: ";
1210  std::set<Muon::MuonStationIndex::StIndex>::const_iterator it = trackData.missingLayers.begin();
1211  std::set<Muon::MuonStationIndex::StIndex>::const_iterator it_end = trackData.missingLayers.end();
1212  for (; it != it_end; ++it) sout << " " << Muon::MuonStationIndex::stName(*it);
1213  }
1214 
1215  if (!trackData.missingLayersTrigger.empty()) {
1216  sout << " Trigger: ";
1217  std::set<Muon::MuonStationIndex::StIndex>::const_iterator it = trackData.missingLayersTrigger.begin();
1218  std::set<Muon::MuonStationIndex::StIndex>::const_iterator it_end = trackData.missingLayersTrigger.end();
1219  for (; it != it_end; ++it) sout << " " << Muon::MuonStationIndex::stName(*it);
1220  }
1221  sout << std::endl;
1222  }
1223 
1224  if (!trackData.wrongLayers.empty() || !trackData.wrongLayersTrigger.empty()) {
1225  sout << " TrackData.Wrong Layers: ";
1226  if (!trackData.wrongLayers.empty()) {
1227  sout << " Precision: ";
1228  std::set<Muon::MuonStationIndex::StIndex>::const_iterator it = trackData.wrongLayers.begin();
1229  std::set<Muon::MuonStationIndex::StIndex>::const_iterator it_end = trackData.wrongLayers.end();
1230  for (; it != it_end; ++it) sout << " " << Muon::MuonStationIndex::stName(*it);
1231  }
1232 
1233  if (!trackData.wrongLayersTrigger.empty()) {
1234  sout << " Trigger: ";
1235  std::set<Muon::MuonStationIndex::StIndex>::const_iterator it = trackData.wrongLayersTrigger.begin();
1236  std::set<Muon::MuonStationIndex::StIndex>::const_iterator it_end = trackData.wrongLayersTrigger.end();
1237  for (; it != it_end; ++it) sout << " " << Muon::MuonStationIndex::stName(*it);
1238  }
1239  sout << std::endl;
1240  }
1241  return sout.str();
1242 }

◆ printFakeTracks()

void MuonTrackPerformanceAlg::printFakeTracks ( ) const
private

Definition at line 885 of file MuonTrackPerformanceAlg.cxx.

885  {
886  std::fstream outputFile;
887  if (m_doEventListFake > 0) {
888  std::string filename = name();
889  filename += "EventListFakeTracks.txt";
890  outputFile.open(filename.c_str(), std::ios_base::out | std::ios_base::trunc);
891  }
892 
893  msg() << MSG::INFO << "Summarizing events with fake tracks, high pt, total " << m_nfakeTracksHighPt << std::endl;
894  std::vector<EventData>::const_iterator eit = m_badEvents.begin();
895  std::vector<EventData>::const_iterator eit_end = m_badEvents.end();
896  for (; eit != eit_end; ++eit) {
897  if (eit->fakeTracks.empty()) continue;
898  msg() << print(*eit, eit->fakeTracks, " high pt fake tracks") << std::endl;
899  if (m_doEventListFake > 0) outputFile << eit->eventNumber << std::endl;
900  }
901  msg() << endmsg;
902 
903  msg() << MSG::INFO << "Summarizing events with fake tracks, low pt, total " << m_nfakeTracksLowPt << std::endl;
904  eit = m_badEvents.begin();
905  eit_end = m_badEvents.end();
906  for (; eit != eit_end; ++eit) {
907  if (eit->fakeTracksLowPt.empty()) continue;
908  msg() << print(*eit, eit->fakeTracksLowPt, " low pt fake tracks") << std::endl;
909  if (m_doEventListFake > 1) outputFile << eit->eventNumber << std::endl;
910  }
911  msg() << endmsg;
912 
913  msg() << MSG::INFO << "Summarizing events with fake tracks, SL, total " << m_nfakeTracksSL << std::endl;
914  eit = m_badEvents.begin();
915  eit_end = m_badEvents.end();
916  for (; eit != eit_end; ++eit) {
917  if (eit->fakeTracksSL.empty()) continue;
918  msg() << print(*eit, eit->fakeTracksSL, " SL fake tracks") << std::endl;
919  if (m_doEventListFake > 2) outputFile << eit->eventNumber << std::endl;
920  }
921  msg() << endmsg;
922 }

◆ printMissingChambers()

void MuonTrackPerformanceAlg::printMissingChambers ( ) const
private

Definition at line 776 of file MuonTrackPerformanceAlg.cxx.

776  {
777  std::fstream outputFile;
778  if (m_doEventListIncomplete > 0) {
779  std::string filename = name();
780  filename += "EventListIncompleteTracks.txt";
781  outputFile.open(filename.c_str(), std::ios_base::out | std::ios_base::trunc);
782  }
783 
784  msg() << MSG::INFO << "Summarizing events with endcap track without EI layer resulting in momentum loss, total "
785  << m_nmissingStationMomLoss << std::endl;
786  std::vector<EventData>::const_iterator eit = m_badEvents.begin();
787  std::vector<EventData>::const_iterator eit_end = m_badEvents.end();
788  for (; eit != eit_end; ++eit) {
789  if (eit->missingStationMomLoss.empty()) continue;
790  msg() << print(*eit, eit->missingStationMomLoss, " tracks without inner layer in endcap") << std::endl;
791  if (m_doEventListIncomplete > 0) outputFile << eit->eventNumber << std::endl;
792  }
793  msg() << endmsg;
794 
795  msg() << MSG::INFO << "Summarizing events with track with missing layer, total " << m_nmissingStationLayer << std::endl;
796  eit = m_badEvents.begin();
797  eit_end = m_badEvents.end();
798  for (; eit != eit_end; ++eit) {
799  if (eit->missingStationLayer.empty()) continue;
800  msg() << print(*eit, eit->missingStationLayer, " tracks with a missing layer") << std::endl;
801  if (m_doEventListIncomplete > 0) outputFile << eit->eventNumber << std::endl;
802  }
803  msg() << endmsg;
804 
805  msg() << MSG::INFO << "Summarizing events with track with missing chamber, total " << m_nmissingStation << std::endl;
806  eit = m_badEvents.begin();
807  eit_end = m_badEvents.end();
808  for (; eit != eit_end; ++eit) {
809  if (eit->missingStation.empty()) continue;
810  msg() << print(*eit, eit->missingStation, " tracks with a missing chamber") << std::endl;
811  if (m_doEventListIncomplete > 1) outputFile << eit->eventNumber << std::endl;
812  }
813  msg() << endmsg;
814 
815  msg() << MSG::INFO << "Summarizing events with track with wrong layer, total " << m_nwrongStationLayer << std::endl;
816  eit = m_badEvents.begin();
817  eit_end = m_badEvents.end();
818  for (; eit != eit_end; ++eit) {
819  if (eit->wrongStation.empty()) continue;
820  msg() << print(*eit, eit->wrongStation, " tracks with a wrong layer") << std::endl;
821  if (m_doEventListIncomplete > 0) outputFile << eit->eventNumber << std::endl;
822  }
823  msg() << endmsg;
824 
825  msg() << MSG::INFO << "Summarizing events with track with wrong chamber, total " << m_nwrongStation << std::endl;
826  eit = m_badEvents.begin();
827  eit_end = m_badEvents.end();
828  for (; eit != eit_end; ++eit) {
829  if (eit->wrongStation.empty()) continue;
830  msg() << print(*eit, eit->wrongStation, " tracks with a wrong chamber") << std::endl;
831  if (m_doEventListIncomplete > 0) outputFile << eit->eventNumber << std::endl;
832  }
833  msg() << endmsg;
834 
835  msg() << MSG::INFO << "Summarizing events with track with missing trigger layer, total " << m_nmissingStationLayerTrigger << std::endl;
836  eit = m_badEvents.begin();
837  eit_end = m_badEvents.end();
838  for (; eit != eit_end; ++eit) {
839  if (eit->missingStationLayerTrigger.empty()) continue;
840  msg() << print(*eit, eit->missingStationLayerTrigger, " tracks with a missing trigger layer") << std::endl;
841  if (m_doEventListIncomplete > 0) outputFile << eit->eventNumber << std::endl;
842  }
843  msg() << endmsg;
844 
845  msg() << MSG::INFO << "Summarizing events with track with wrong trigger layer, total " << m_nwrongStationLayerTrigger << std::endl;
846  eit = m_badEvents.begin();
847  eit_end = m_badEvents.end();
848  for (; eit != eit_end; ++eit) {
849  if (eit->wrongStationLayerTrigger.empty()) continue;
850  msg() << print(*eit, eit->wrongStationLayerTrigger, " tracks with a wrong trigger layer") << std::endl;
851  if (m_doEventListIncomplete > 0) outputFile << eit->eventNumber << std::endl;
852  }
853  msg() << endmsg;
854 }

◆ printMissingTracks()

void MuonTrackPerformanceAlg::printMissingTracks ( ) const
private

Definition at line 856 of file MuonTrackPerformanceAlg.cxx.

856  {
857  std::fstream outputFile;
858  if (m_doEventListMissed > 0) {
859  std::string filename = name();
860  filename += "EventListMissedTracks.txt";
861  outputFile.open(filename.c_str(), std::ios_base::out | std::ios_base::trunc);
862  }
863 
864  msg() << MSG::INFO << "Summarizing events with missing track, total " << m_nmissedTracks << std::endl;
865  std::vector<EventData>::const_iterator eit = m_badEvents.begin();
866  std::vector<EventData>::const_iterator eit_end = m_badEvents.end();
867  for (; eit != eit_end; ++eit) {
868  if (eit->missingTruthTracks.empty()) continue;
869  msg() << print(*eit, eit->missingTruthTracks, " missing tracks") << std::endl;
870  if (m_doEventListMissed > 0) outputFile << eit->eventNumber << std::endl;
871  }
872  msg() << endmsg;
873 
874  msg() << MSG::INFO << "Summarizing events with missing single station track, total " << m_nmissedTracksOneStation << std::endl;
875  eit = m_badEvents.begin();
876  eit_end = m_badEvents.end();
877  for (; eit != eit_end; ++eit) {
878  if (eit->missingTruthTracksOneStation.empty()) continue;
879  msg() << print(*eit, eit->missingTruthTracksOneStation, " missing single station tracks") << std::endl;
880  if (m_doEventListMissed > 1) outputFile << eit->eventNumber << std::endl;
881  }
882  msg() << endmsg;
883 }

◆ printSummary()

void MuonTrackPerformanceAlg::printSummary ( const std::vector< EventSummary > &  summary,
std::string  typeName 
) const
private

◆ printTrackCounters()

std::string MuonTrackPerformanceAlg::printTrackCounters ( bool  doSecondaries = true) const
private

print all the track counters to a string to provide a summary

Definition at line 924 of file MuonTrackPerformanceAlg.cxx.

924  {
925  std::ostringstream sout;
926  sout.precision(4);
927 
928  double evScale = m_nevents != 0 ? 1. / m_nevents : 1.;
929 
930  sout << std::endl;
931  sout << "Summarizing results for track collection " << m_trackTypeString << " " << m_nevents << " events: " << std::endl
932  << " number of tracks " << std::setw(12) << m_ntracks << " average per event " << m_ntracks * evScale;
933 
934  if (m_doTruth) {
935  unsigned int nmatchedTracks = !doSecondaries ? m_nmatchedTracks : m_nmatchedTracks + m_nmatchedTracksSecondary;
936  unsigned int nmissedTracks = !doSecondaries ? m_nmissedTracks : m_nmissedTracks + m_nmissedTracksSecondary;
937  unsigned int nmissedTracksOneStation =
939  unsigned int ntruthTracks = !doSecondaries ? m_ntruthTracks : m_ntruthTracks + m_ntruthTracksSecondary;
940 
941  double trTrkScale = ntruthTracks != 0 ? 1. / ntruthTracks : 1.;
942  double trTrkScaleSec = m_ntruthTracksSecondary != 0 ? 1. / m_ntruthTracksSecondary : 1.;
943 
944  sout << std::endl
945  << " number of truth tracks " << std::setw(12) << ntruthTracks << " average per event "
946  << ntruthTracks * evScale << std::endl
947  << " number of good tracks " << std::setw(12) << nmatchedTracks << " average per event "
948  << nmatchedTracks * evScale << std::endl
949  << " number of missed multi station tracks " << std::setw(12) << nmissedTracks << " average per event "
950  << nmissedTracks * evScale << std::endl
951  << " number of missed one station tracks " << std::setw(12) << nmissedTracksOneStation << " average per event "
952  << nmissedTracksOneStation * evScale << std::endl;
953  if (doSecondaries) {
954  sout << " number of secondary truth tracks " << std::setw(12) << m_ntruthTracksSecondary << " average per event "
955  << m_ntruthTracksSecondary * evScale << std::endl
956  << " number of secondary good tracks " << std::setw(12) << m_nmatchedTracksSecondary << " average per event "
957  << m_nmatchedTracksSecondary * evScale << std::endl
958  << " number of secondary missed multi st tracks " << std::setw(12) << m_nmissedTracksSecondary << " average per event "
959  << m_nmissedTracksSecondary * evScale << std::endl
960  << " number of secondary missed one st tracks " << std::setw(12) << m_nmissedTracksOneStationSecondary
961  << " average per event " << m_nmissedTracksOneStationSecondary * evScale << std::endl;
962  }
963  sout << " number of fake tracks " << std::setw(12) << m_nfakeTracks << " average per event "
964  << m_nfakeTracks * evScale << std::endl
965  << " number of high pt fake tracks " << std::setw(12) << m_nfakeTracksHighPt << " average per event "
966  << m_nfakeTracksHighPt * evScale << std::endl
967  << " number of low pt fake tracks " << std::setw(12) << m_nfakeTracksLowPt << " average per event "
968  << m_nfakeTracksLowPt * evScale << std::endl
969  << " number of SL fake tracks " << std::setw(12) << m_nfakeTracksSL << " average per event "
970  << m_nfakeTracksSL * evScale << std::endl
971  << " number of matched fake tracks " << std::setw(12) << m_nmatchedFakeTracks << " average per event "
972  << m_nmatchedFakeTracks * evScale << std::endl
973  << " number of tracks with lost momentum " << std::setw(12) << m_nmissingStationMomLoss
974  << " average per truth track " << m_nmissingStationMomLoss * trTrkScale << std::endl
975  << " number of tracks missing precision layer " << std::setw(12) << m_nmissingStationLayer << " average per truth track "
976  << m_nmissingStationLayer * trTrkScale << std::endl
977  << " number of tracks missing trigger layer " << std::setw(12) << m_nmissingStationLayerTrigger
978  << " average per truth track " << m_nmissingStationLayerTrigger * trTrkScale << std::endl
979  << " number of tracks missing chamber " << std::setw(12) << m_nmissingStation << " average per truth track "
980  << m_nmissingStation * trTrkScale << std::endl
981  << " number of tracks wrong precision layer " << std::setw(12) << m_nwrongStationLayer << " average per truth track "
982  << m_nwrongStationLayer * trTrkScale << std::endl
983  << " number of tracks wrong trigger layer " << std::setw(12) << m_nwrongStationLayerTrigger
984  << " average per truth track " << m_nwrongStationLayerTrigger * trTrkScale << std::endl
985  << " number of tracks wrong chamber " << std::setw(12) << m_nwrongStation << " average per truth track "
986  << m_nwrongStation * trTrkScale << std::endl
987  << " efficiency: " << nmatchedTracks * trTrkScale << " fake rate " << m_nfakeTracks * evScale << " high pt "
988  << m_nfakeTracksHighPt * evScale << " low pt " << m_nfakeTracksLowPt * evScale << " missed track rate (per truth track) "
989  << nmissedTracks * trTrkScale;
990  if (doSecondaries) sout << " secondary efficiency " << m_nmatchedTracksSecondary * trTrkScaleSec;
991  }
992  sout << std::endl;
993 
994  return sout.str();
995 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ selectPdg()

bool MuonTrackPerformanceAlg::selectPdg ( int  pdg) const
inlineprivate

Definition at line 257 of file MuonTrackPerformanceAlg.h.

257 { return m_selectedPdgs.count(pdg); }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_badEvents

std::vector<EventData> MuonTrackPerformanceAlg::m_badEvents
private

Definition at line 355 of file MuonTrackPerformanceAlg.h.

◆ m_cscSimData

SG::ReadHandleKey<CscSimDataCollection> MuonTrackPerformanceAlg::m_cscSimData {this, "CSC_SDO_Container", "CSC_SDO", "CSC SDO"}
private

Definition at line 269 of file MuonTrackPerformanceAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doEventListFake

int MuonTrackPerformanceAlg::m_doEventListFake {}
private

Definition at line 298 of file MuonTrackPerformanceAlg.h.

◆ m_doEventListIncomplete

int MuonTrackPerformanceAlg::m_doEventListIncomplete {}
private

Definition at line 297 of file MuonTrackPerformanceAlg.h.

◆ m_doEventListMissed

int MuonTrackPerformanceAlg::m_doEventListMissed {}
private

Definition at line 296 of file MuonTrackPerformanceAlg.h.

◆ m_doHistos

bool MuonTrackPerformanceAlg::m_doHistos {}
private

Definition at line 277 of file MuonTrackPerformanceAlg.h.

◆ m_doHitResiduals

int MuonTrackPerformanceAlg::m_doHitResiduals {}
private

Definition at line 274 of file MuonTrackPerformanceAlg.h.

◆ m_doSegments

bool MuonTrackPerformanceAlg::m_doSegments {}
private

Definition at line 282 of file MuonTrackPerformanceAlg.h.

◆ m_doStau

bool MuonTrackPerformanceAlg::m_doStau {}
private

Definition at line 284 of file MuonTrackPerformanceAlg.h.

◆ m_doSummary

int MuonTrackPerformanceAlg::m_doSummary {}
private

Definition at line 273 of file MuonTrackPerformanceAlg.h.

◆ m_doTrackDebug

int MuonTrackPerformanceAlg::m_doTrackDebug {}
private

Definition at line 275 of file MuonTrackPerformanceAlg.h.

◆ m_doTruth

bool MuonTrackPerformanceAlg::m_doTruth {}
private

Definition at line 276 of file MuonTrackPerformanceAlg.h.

◆ m_edmHelperSvc

ServiceHandle<Muon::IMuonEDMHelperSvc> MuonTrackPerformanceAlg::m_edmHelperSvc
private
Initial value:
{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
"Handle to the service providing the IMuonEDMHelperSvc interface"}

Definition at line 290 of file MuonTrackPerformanceAlg.h.

◆ m_eventInfo

const xAOD::EventInfo* MuonTrackPerformanceAlg::m_eventInfo
private

pointer to the event info

Definition at line 263 of file MuonTrackPerformanceAlg.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> MuonTrackPerformanceAlg::m_eventInfoKey {this, "EventInfoKey", "EventInfo", "EventInfo key"}
private

Definition at line 262 of file MuonTrackPerformanceAlg.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fileName

std::string MuonTrackPerformanceAlg::m_fileName
private

name of external file to write statistics

Definition at line 358 of file MuonTrackPerformanceAlg.h.

◆ m_fileOutput

std::ofstream MuonTrackPerformanceAlg::m_fileOutput
private

output file

Definition at line 361 of file MuonTrackPerformanceAlg.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonTrackPerformanceAlg::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 286 of file MuonTrackPerformanceAlg.h.

◆ m_isCombined

bool MuonTrackPerformanceAlg::m_isCombined {}
private

Definition at line 281 of file MuonTrackPerformanceAlg.h.

◆ m_mcEventColl

SG::ReadHandleKey<McEventCollection> MuonTrackPerformanceAlg::m_mcEventColl {this, "McEventCollectionKey", "TruthEvent", "McEventCollection"}
private

Definition at line 266 of file MuonTrackPerformanceAlg.h.

◆ m_minCscEtaHits

int MuonTrackPerformanceAlg::m_minCscEtaHits {}
private

Definition at line 301 of file MuonTrackPerformanceAlg.h.

◆ m_minCscPhiHits

int MuonTrackPerformanceAlg::m_minCscPhiHits {}
private

Definition at line 302 of file MuonTrackPerformanceAlg.h.

◆ m_minMdtHits

int MuonTrackPerformanceAlg::m_minMdtHits {}
private

Definition at line 300 of file MuonTrackPerformanceAlg.h.

◆ m_minMMEtaHits

int MuonTrackPerformanceAlg::m_minMMEtaHits {}
private

Definition at line 309 of file MuonTrackPerformanceAlg.h.

◆ m_minRpcEtaHits

int MuonTrackPerformanceAlg::m_minRpcEtaHits {}
private

Definition at line 303 of file MuonTrackPerformanceAlg.h.

◆ m_minRpcPhiHits

int MuonTrackPerformanceAlg::m_minRpcPhiHits {}
private

Definition at line 304 of file MuonTrackPerformanceAlg.h.

◆ m_minsTgcEtaHits

int MuonTrackPerformanceAlg::m_minsTgcEtaHits {}
private

Definition at line 307 of file MuonTrackPerformanceAlg.h.

◆ m_minsTgcPhiHits

int MuonTrackPerformanceAlg::m_minsTgcPhiHits {}
private

Definition at line 308 of file MuonTrackPerformanceAlg.h.

◆ m_minTgcEtaHits

int MuonTrackPerformanceAlg::m_minTgcEtaHits {}
private

Definition at line 305 of file MuonTrackPerformanceAlg.h.

◆ m_minTgcPhiHits

int MuonTrackPerformanceAlg::m_minTgcPhiHits {}
private

Definition at line 306 of file MuonTrackPerformanceAlg.h.

◆ m_momentumCut

double MuonTrackPerformanceAlg::m_momentumCut {}
private

Definition at line 279 of file MuonTrackPerformanceAlg.h.

◆ m_momentumCutSim

double MuonTrackPerformanceAlg::m_momentumCutSim {}
private

Definition at line 278 of file MuonTrackPerformanceAlg.h.

◆ m_muons

SG::ReadHandleKey<xAOD::MuonContainer> MuonTrackPerformanceAlg::m_muons {this, "MuonLocation", "Muons", "input muons"}
private

Definition at line 261 of file MuonTrackPerformanceAlg.h.

◆ m_muonSimData

SG::ReadHandleKeyArray<MuonSimDataCollection> MuonTrackPerformanceAlg::m_muonSimData
private
Initial value:
{
this, "MuonSimDataNames", {"MDT_SDO", "RPC_SDO", "TGC_SDO", "sTGC_SDO", "MM_SDO"}, "Muon SDO maps"}

Definition at line 267 of file MuonTrackPerformanceAlg.h.

◆ m_nevents

unsigned int MuonTrackPerformanceAlg::m_nevents {}
private

Definition at line 311 of file MuonTrackPerformanceAlg.h.

◆ m_nfakeTracks

unsigned int MuonTrackPerformanceAlg::m_nfakeTracks {}
private

Definition at line 318 of file MuonTrackPerformanceAlg.h.

◆ m_nfakeTracksHighPt

unsigned int MuonTrackPerformanceAlg::m_nfakeTracksHighPt {}
private

Definition at line 319 of file MuonTrackPerformanceAlg.h.

◆ m_nfakeTracksLowPt

unsigned int MuonTrackPerformanceAlg::m_nfakeTracksLowPt {}
private

Definition at line 320 of file MuonTrackPerformanceAlg.h.

◆ m_nfakeTracksSL

unsigned int MuonTrackPerformanceAlg::m_nfakeTracksSL {}
private

Definition at line 321 of file MuonTrackPerformanceAlg.h.

◆ m_nmatchedFakeTracks

unsigned int MuonTrackPerformanceAlg::m_nmatchedFakeTracks {}
private

Definition at line 316 of file MuonTrackPerformanceAlg.h.

◆ m_nmatchedTracks

unsigned int MuonTrackPerformanceAlg::m_nmatchedTracks {}
private

Definition at line 314 of file MuonTrackPerformanceAlg.h.

◆ m_nmatchedTracksSecondary

unsigned int MuonTrackPerformanceAlg::m_nmatchedTracksSecondary {}
private

Definition at line 315 of file MuonTrackPerformanceAlg.h.

◆ m_nmissedTracks

unsigned int MuonTrackPerformanceAlg::m_nmissedTracks {}
private

Definition at line 323 of file MuonTrackPerformanceAlg.h.

◆ m_nmissedTracksOneStation

unsigned int MuonTrackPerformanceAlg::m_nmissedTracksOneStation {}
private

Definition at line 324 of file MuonTrackPerformanceAlg.h.

◆ m_nmissedTracksOneStationSecondary

unsigned int MuonTrackPerformanceAlg::m_nmissedTracksOneStationSecondary {}
private

Definition at line 327 of file MuonTrackPerformanceAlg.h.

◆ m_nmissedTracksSecondary

unsigned int MuonTrackPerformanceAlg::m_nmissedTracksSecondary {}
private

Definition at line 326 of file MuonTrackPerformanceAlg.h.

◆ m_nmissingCscStationLayer

unsigned int MuonTrackPerformanceAlg::m_nmissingCscStationLayer {}
private

Definition at line 331 of file MuonTrackPerformanceAlg.h.

◆ m_nmissingStation

unsigned int MuonTrackPerformanceAlg::m_nmissingStation {}
private

Definition at line 333 of file MuonTrackPerformanceAlg.h.

◆ m_nmissingStationLayer

unsigned int MuonTrackPerformanceAlg::m_nmissingStationLayer {}
private

Definition at line 330 of file MuonTrackPerformanceAlg.h.

◆ m_nmissingStationLayerTrigger

unsigned int MuonTrackPerformanceAlg::m_nmissingStationLayerTrigger {}
private

Definition at line 332 of file MuonTrackPerformanceAlg.h.

◆ m_nmissingStationMomLoss

unsigned int MuonTrackPerformanceAlg::m_nmissingStationMomLoss {}
private

Definition at line 329 of file MuonTrackPerformanceAlg.h.

◆ m_ntracks

unsigned int MuonTrackPerformanceAlg::m_ntracks {}
private

Definition at line 312 of file MuonTrackPerformanceAlg.h.

◆ m_ntruthTracks

unsigned int MuonTrackPerformanceAlg::m_ntruthTracks {}
private

Definition at line 339 of file MuonTrackPerformanceAlg.h.

◆ m_ntruthTracksSecondary

unsigned int MuonTrackPerformanceAlg::m_ntruthTracksSecondary {}
private

Definition at line 340 of file MuonTrackPerformanceAlg.h.

◆ m_nwrongStation

unsigned int MuonTrackPerformanceAlg::m_nwrongStation {}
private

Definition at line 337 of file MuonTrackPerformanceAlg.h.

◆ m_nwrongStationLayer

unsigned int MuonTrackPerformanceAlg::m_nwrongStationLayer {}
private

Definition at line 335 of file MuonTrackPerformanceAlg.h.

◆ m_nwrongStationLayerTrigger

unsigned int MuonTrackPerformanceAlg::m_nwrongStationLayerTrigger {}
private

Definition at line 336 of file MuonTrackPerformanceAlg.h.

◆ m_pdgsToBeConsidered

IntegerArrayProperty MuonTrackPerformanceAlg::m_pdgsToBeConsidered
private

Definition at line 363 of file MuonTrackPerformanceAlg.h.

◆ m_printer

PublicToolHandle<Muon::MuonEDMPrinterTool> MuonTrackPerformanceAlg::m_printer {this, "Printer", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"}
private

Definition at line 288 of file MuonTrackPerformanceAlg.h.

◆ m_selectedPdgs

std::set<int> MuonTrackPerformanceAlg::m_selectedPdgs
private

Definition at line 364 of file MuonTrackPerformanceAlg.h.

◆ m_summaryHelperTool

ToolHandle<Trk::ITrackSummaryHelperTool> MuonTrackPerformanceAlg::m_summaryHelperTool {this, "SummaryHelperTool", ""}
private

Definition at line 295 of file MuonTrackPerformanceAlg.h.

◆ m_trackKey

SG::ReadHandleKey<TrackCollection> MuonTrackPerformanceAlg::m_trackKey
private
Initial value:
{this, "TrackInputLocation", "MuonSpectrometerTracks",
"input tracks"}

Location of the input tracks.

Definition at line 259 of file MuonTrackPerformanceAlg.h.

◆ m_trackRecord

SG::ReadHandleKey<TrackRecordCollection> MuonTrackPerformanceAlg::m_trackRecord {this, "TrackRecord", "MuonEntryLayerFilter", "Track Record Collection"}
private

Definition at line 270 of file MuonTrackPerformanceAlg.h.

◆ m_trackType

int MuonTrackPerformanceAlg::m_trackType {}
private

Definition at line 367 of file MuonTrackPerformanceAlg.h.

◆ m_trackTypeString

std::string MuonTrackPerformanceAlg::m_trackTypeString
private

Definition at line 368 of file MuonTrackPerformanceAlg.h.

◆ m_truthTool

ToolHandle<Muon::IMuonTrackTruthTool> MuonTrackPerformanceAlg::m_truthTool {this, "TrackTruthTool",""}
private

Definition at line 294 of file MuonTrackPerformanceAlg.h.

◆ m_usePtCut

bool MuonTrackPerformanceAlg::m_usePtCut {}
private

Definition at line 280 of file MuonTrackPerformanceAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeToFile

bool MuonTrackPerformanceAlg::m_writeToFile {}
private

Definition at line 283 of file MuonTrackPerformanceAlg.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MuonTrackPerformanceAlg::m_mcEventColl
SG::ReadHandleKey< McEventCollection > m_mcEventColl
Definition: MuonTrackPerformanceAlg.h:266
MuonTrackPerformanceAlg::m_nmissedTracksOneStation
unsigned int m_nmissedTracksOneStation
Definition: MuonTrackPerformanceAlg.h:324
MuonTrackPerformanceAlg::m_nwrongStationLayer
unsigned int m_nwrongStationLayer
Definition: MuonTrackPerformanceAlg.h:335
MuonTrackPerformanceAlg::m_doEventListMissed
int m_doEventListMissed
Definition: MuonTrackPerformanceAlg.h:296
MuonTrackPerformanceAlg::m_momentumCut
double m_momentumCut
Definition: MuonTrackPerformanceAlg.h:279
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
MuonTrackPerformanceAlg::m_minMdtHits
int m_minMdtHits
Definition: MuonTrackPerformanceAlg.h:300
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
get_generator_info.result
result
Definition: get_generator_info.py:21
MuonTrackPerformanceAlg::evaluateTrackTruthOverlap
TrackData * evaluateTrackTruthOverlap(const Muon::MuonTrackTruth &truthTrack) const
evaluate track/truth overlap and create the corresponding overlap description object
Definition: MuonTrackPerformanceAlg.cxx:1082
MuonTrackPerformanceAlg::m_nmissedTracksSecondary
unsigned int m_nmissedTracksSecondary
Definition: MuonTrackPerformanceAlg.h:326
MuonTrackPerformanceAlg::m_doEventListFake
int m_doEventListFake
Definition: MuonTrackPerformanceAlg.h:298
MuonTrackPerformanceAlg::m_momentumCutSim
double m_momentumCutSim
Definition: MuonTrackPerformanceAlg.h:278
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
MuonTrackPerformanceAlg::m_usePtCut
bool m_usePtCut
Definition: MuonTrackPerformanceAlg.h:280
MuonTrackPerformanceAlg::printTrackCounters
std::string printTrackCounters(bool doSecondaries=true) const
print all the track counters to a string to provide a summary
Definition: MuonTrackPerformanceAlg.cxx:924
MuonTrackPerformanceAlg::eventNumber
int eventNumber() const
Definition: MuonTrackPerformanceAlg.cxx:591
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
MuonTrackPerformanceAlg::m_isCombined
bool m_isCombined
Definition: MuonTrackPerformanceAlg.h:281
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
MuonTrackPerformanceAlg::m_nmissingCscStationLayer
unsigned int m_nmissingCscStationLayer
Definition: MuonTrackPerformanceAlg.h:331
MuonTrackPerformanceAlg::printMissingTracks
void printMissingTracks() const
Definition: MuonTrackPerformanceAlg.cxx:856
Muon::MuonTrackTruth::truthTrajectory
std::shared_ptr< const TruthTrajectory > truthTrajectory
Definition: IMuonTrackTruthTool.h:43
MuonTrackPerformanceAlg::handleTrackTruth
bool handleTrackTruth(const TrackCollection &trackCollection)
Definition: MuonTrackPerformanceAlg.cxx:252
Muon::MuonTrackTruth::stgcs
MuonTechnologyTruth stgcs
Definition: IMuonTrackTruthTool.h:50
MuonTrackPerformanceAlg::m_doTrackDebug
int m_doTrackDebug
Definition: MuonTrackPerformanceAlg.h:275
MuonTrackPerformanceAlg::m_minTgcPhiHits
int m_minTgcPhiHits
Definition: MuonTrackPerformanceAlg.h:306
MuonTrackPerformanceAlg::m_fileOutput
std::ofstream m_fileOutput
output file
Definition: MuonTrackPerformanceAlg.h:361
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
skel.it
it
Definition: skel.GENtoEVGEN.py:396
MuonTrackPerformanceAlg::m_ntruthTracks
unsigned int m_ntruthTracks
Definition: MuonTrackPerformanceAlg.h:339
Muon::MuonTechnologyTruth::wrongHits
std::set< Identifier > wrongHits
Definition: IMuonTrackTruthTool.h:36
test_pyathena.pt
pt
Definition: test_pyathena.py:11
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
Muon::IMuonTrackTruthTool::TruthTreeEntry::cscHits
CscSimDataCollection cscHits
Definition: IMuonTrackTruthTool.h:79
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
ParticleTest.tp
tp
Definition: ParticleTest.py:25
Muon::MuonSegmentCombination::stationSegments
SegmentVec * stationSegments(unsigned int index) const
Access to segments in a given station.
Definition: MuonSegmentCombination.h:114
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
MuonTrackPerformanceAlg::m_truthTool
ToolHandle< Muon::IMuonTrackTruthTool > m_truthTool
Definition: MuonTrackPerformanceAlg.h:294
Muon::IMuonTrackTruthTool::TruthTreeEntry::mmHits
MuonSimDataCollection mmHits
Definition: IMuonTrackTruthTool.h:83
MuonTrackPerformanceAlg::insertTechnology
bool insertTechnology(const std::set< Identifier > &chIds, const std::set< Identifier > &hits, int minEtaHits, int minPhiHits, std::vector< ChamberData > &chamberData) const
insert set of chambers into chamber data if hits counts pass cuts, returns true if anything was inser...
Definition: MuonTrackPerformanceAlg.cxx:1041
Muon::MuonTrackTruth
Definition: IMuonTrackTruthTool.h:40
MuonTrackPerformanceAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonTrackPerformanceAlg.h:286
MuonTrackPerformanceAlg::m_badEvents
std::vector< EventData > m_badEvents
Definition: MuonTrackPerformanceAlg.h:355
MuonTrackPerformanceAlg::m_edmHelperSvc
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuonTrackPerformanceAlg.h:290
MuonTrackPerformanceAlg::m_writeToFile
bool m_writeToFile
Definition: MuonTrackPerformanceAlg.h:283
MuonTrackPerformanceAlg::m_minCscEtaHits
int m_minCscEtaHits
Definition: MuonTrackPerformanceAlg.h:301
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
InDetAccessor::qOverP
@ qOverP
perigee
Definition: InDetAccessor.h:35
MuonTrackPerformanceAlg::m_minRpcPhiHits
int m_minRpcPhiHits
Definition: MuonTrackPerformanceAlg.h:304
Muon::MuonTrackTruth::mms
MuonTechnologyTruth mms
Definition: IMuonTrackTruthTool.h:51
Muon::IMuonTrackTruthTool::TruthTreeEntry::stgcHits
MuonSimDataCollection stgcHits
Definition: IMuonTrackTruthTool.h:82
MuonTrackPerformanceAlg::m_fileName
std::string m_fileName
name of external file to write statistics
Definition: MuonTrackPerformanceAlg.h:358
Muon::MuonTechnologyTruth::missedHits
std::set< Identifier > missedHits
Definition: IMuonTrackTruthTool.h:34
Trk::Perigee
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:33
ReweightUtils.message
message
Definition: ReweightUtils.py:15
MuonTrackPerformanceAlg::m_trackKey
SG::ReadHandleKey< TrackCollection > m_trackKey
Location of the input tracks.
Definition: MuonTrackPerformanceAlg.h:259
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
MuonTrackPerformanceAlg::addTrackToTrackData
void addTrackToTrackData(const Trk::Track &track, TrackData &trackData) const
Definition: MuonTrackPerformanceAlg.cxx:1244
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
MuonTrackPerformanceAlg::TrackData::trackSummary
Trk::TrackSummary * trackSummary
Definition: MuonTrackPerformanceAlg.h:96
Muon::MuonTrackTruth::mdts
MuonTechnologyTruth mdts
Definition: IMuonTrackTruthTool.h:46
MuonTrackPerformanceAlg::isSecondary
bool isSecondary(const Muon::MuonTrackTruth &truthTrack) const
Definition: MuonTrackPerformanceAlg.cxx:1406
MuonTrackPerformanceAlg::m_minMMEtaHits
int m_minMMEtaHits
Definition: MuonTrackPerformanceAlg.h:309
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
MuonTrackPerformanceAlg::m_muonSimData
SG::ReadHandleKeyArray< MuonSimDataCollection > m_muonSimData
Definition: MuonTrackPerformanceAlg.h:267
MuonTrackPerformanceAlg::clearTracks
void clearTracks(std::vector< const Trk::Track * > tracks)
Definition: MuonTrackPerformanceAlg.cxx:1352
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
MuonTrackPerformanceAlg::m_ntracks
unsigned int m_ntracks
Definition: MuonTrackPerformanceAlg.h:312
MuonTrackPerformanceAlg::doSummary
void doSummary(const TrackCollection &tracks) const
Definition: MuonTrackPerformanceAlg.cxx:598
MuonTrackPerformanceAlg::m_nmatchedFakeTracks
unsigned int m_nmatchedFakeTracks
Definition: MuonTrackPerformanceAlg.h:316
MuonTrackPerformanceAlg::m_doSegments
bool m_doSegments
Definition: MuonTrackPerformanceAlg.h:282
TileDCSDataPlotter.tit
tit
Definition: TileDCSDataPlotter.py:890
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MuonTrackPerformanceAlg::createTrackData
TrackData * createTrackData(const Muon::IMuonTrackTruthTool::TruthTreeEntry &trackTruth) const
create track data object for truth track
Definition: MuonTrackPerformanceAlg.cxx:1257
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
MuonTrackPerformanceAlg::m_pdgsToBeConsidered
IntegerArrayProperty m_pdgsToBeConsidered
Definition: MuonTrackPerformanceAlg.h:363
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Muon::IMuonTrackTruthTool::TruthTreeEntry::tgcHits
MuonSimDataCollection tgcHits
Definition: IMuonTrackTruthTool.h:81
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonTrackPerformanceAlg::m_nmissingStationLayerTrigger
unsigned int m_nmissingStationLayerTrigger
Definition: MuonTrackPerformanceAlg.h:332
TrackRecord::GetPosition
CLHEP::Hep3Vector GetPosition() const
Position.
Definition: TrackRecord.h:88
MuonTrackPerformanceAlg::m_nwrongStationLayerTrigger
unsigned int m_nwrongStationLayerTrigger
Definition: MuonTrackPerformanceAlg.h:336
MuonTrackPerformanceAlg::clearEvent
void clearEvent(EventData &event)
Definition: MuonTrackPerformanceAlg.cxx:1366
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonTrackPerformanceAlg::m_nwrongStation
unsigned int m_nwrongStation
Definition: MuonTrackPerformanceAlg.h:337
MuonTrackPerformanceAlg::m_summaryHelperTool
ToolHandle< Trk::ITrackSummaryHelperTool > m_summaryHelperTool
Definition: MuonTrackPerformanceAlg.h:295
MuonTrackPerformanceAlg::m_nmissingStation
unsigned int m_nmissingStation
Definition: MuonTrackPerformanceAlg.h:333
MuonTrackPerformanceAlg::m_minTgcEtaHits
int m_minTgcEtaHits
Definition: MuonTrackPerformanceAlg.h:305
MuonTrackPerformanceAlg::m_eventInfo
const xAOD::EventInfo * m_eventInfo
pointer to the event info
Definition: MuonTrackPerformanceAlg.h:263
MuonTrackPerformanceAlg::m_selectedPdgs
std::set< int > m_selectedPdgs
Definition: MuonTrackPerformanceAlg.h:364
MuonTrackPerformanceAlg::m_trackType
int m_trackType
Definition: MuonTrackPerformanceAlg.h:367
EventData
Definition: Trigger/TrigAccel/TrigCudaFitter/src/EventData.h:11
Muon::MuonTechnologyTruth::matchedChambers
std::set< Identifier > matchedChambers
Definition: IMuonTrackTruthTool.h:33
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CscSimDataCollection
Definition: CscSimDataCollection.h:29
MuonTrackPerformanceAlg::printFakeTracks
void printFakeTracks() const
Definition: MuonTrackPerformanceAlg.cxx:885
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
MuonTrackPerformanceAlg::m_nmissingStationMomLoss
unsigned int m_nmissingStationMomLoss
Definition: MuonTrackPerformanceAlg.h:329
MuonTrackPerformanceAlg::m_doHitResiduals
int m_doHitResiduals
Definition: MuonTrackPerformanceAlg.h:274
MuonTrackPerformanceAlg::TrackData::chi2Ndof
double chi2Ndof
Definition: MuonTrackPerformanceAlg.h:91
Muon::IMuonTrackTruthTool::TruthTreeEntry::truthTrajectory
std::shared_ptr< const TruthTrajectory > truthTrajectory
Definition: IMuonTrackTruthTool.h:77
MuonTrackPerformanceAlg::handleTracks
bool handleTracks()
Definition: MuonTrackPerformanceAlg.cxx:155
Muon::MuonTechnologyTruth::missedChambers
std::set< Identifier > missedChambers
Definition: IMuonTrackTruthTool.h:35
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
MuonTrackPerformanceAlg::m_nfakeTracksHighPt
unsigned int m_nfakeTracksHighPt
Definition: MuonTrackPerformanceAlg.h:319
MuonTrackPerformanceAlg::TrackData::trackPars
Trk::Perigee * trackPars
Definition: MuonTrackPerformanceAlg.h:95
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
MuonTrackPerformanceAlg::m_nmissedTracksOneStationSecondary
unsigned int m_nmissedTracksOneStationSecondary
Definition: MuonTrackPerformanceAlg.h:327
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
MuonTrackPerformanceAlg::m_doHistos
bool m_doHistos
Definition: MuonTrackPerformanceAlg.h:277
MuonTrackPerformanceAlg::m_muons
SG::ReadHandleKey< xAOD::MuonContainer > m_muons
Definition: MuonTrackPerformanceAlg.h:261
TruthTrajectory
Definition: TruthTrajectory.h:26
Muon::MuonTrackTruth::tgcs
MuonTechnologyTruth tgcs
Definition: IMuonTrackTruthTool.h:49
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Muon::IMuonTrackTruthTool::TruthTreeEntry::rpcHits
MuonSimDataCollection rpcHits
Definition: IMuonTrackTruthTool.h:80
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
charge
double charge(const T &p)
Definition: AtlasPID.h:538
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
MuonTrackPerformanceAlg::m_nfakeTracksLowPt
unsigned int m_nfakeTracksLowPt
Definition: MuonTrackPerformanceAlg.h:320
MuonTrackPerformanceAlg::m_nmissingStationLayer
unsigned int m_nmissingStationLayer
Definition: MuonTrackPerformanceAlg.h:330
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonTrackPerformanceAlg::m_minsTgcPhiHits
int m_minsTgcPhiHits
Definition: MuonTrackPerformanceAlg.h:308
TrackRecord::GetMomentum
CLHEP::Hep3Vector GetMomentum() const
Momentum.
Definition: TrackRecord.h:94
MuonTrackPerformanceAlg::m_nmatchedTracks
unsigned int m_nmatchedTracks
Definition: MuonTrackPerformanceAlg.h:314
TrackRecord
Definition: TrackRecord.h:12
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
MuonTrackPerformanceAlg::m_minCscPhiHits
int m_minCscPhiHits
Definition: MuonTrackPerformanceAlg.h:302
MuonTrackPerformanceAlg::m_nmissedTracks
unsigned int m_nmissedTracks
Definition: MuonTrackPerformanceAlg.h:323
MuonTrackPerformanceAlg::ChamberData::hits
std::set< Identifier > hits
Definition: MuonTrackPerformanceAlg.h:54
MuonTrackPerformanceAlg::selectPdg
bool selectPdg(int pdg) const
Definition: MuonTrackPerformanceAlg.h:257
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
MuonTrackPerformanceAlg::m_minsTgcEtaHits
int m_minsTgcEtaHits
Definition: MuonTrackPerformanceAlg.h:307
Muon::IMuonTrackTruthTool::TruthTree
std::map< int, TruthTreeEntry > TruthTree
Definition: IMuonTrackTruthTool.h:93
MuonTrackPerformanceAlg::m_ntruthTracksSecondary
unsigned int m_ntruthTracksSecondary
Definition: MuonTrackPerformanceAlg.h:340
Muon::MuonTechnologyTruth::wrongChambers
std::set< Identifier > wrongChambers
Definition: IMuonTrackTruthTool.h:37
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
MuonTrackPerformanceAlg::m_nevents
unsigned int m_nevents
Definition: MuonTrackPerformanceAlg.h:311
MuonTrackPerformanceAlg::ChamberData::chId
Identifier chId
Definition: MuonTrackPerformanceAlg.h:53
Muon::IMuonTrackTruthTool::TruthTreeEntry::mdtHits
MuonSimDataCollection mdtHits
Definition: IMuonTrackTruthTool.h:78
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Muon::MuonSegmentCombination::SegmentVec
std::vector< std::unique_ptr< MuonSegment > > SegmentVec
Definition: MuonSegmentCombination.h:32
MuonTrackPerformanceAlg::m_trackRecord
SG::ReadHandleKey< TrackRecordCollection > m_trackRecord
Definition: MuonTrackPerformanceAlg.h:270
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
DEBUG
#define DEBUG
Definition: page_access.h:11
TrackData
Definition: TrigTrackFollowing.h:125
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
MuonTrackPerformanceAlg::printMissingChambers
void printMissingChambers() const
Definition: MuonTrackPerformanceAlg.cxx:776
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
MuonTrackPerformanceAlg::insertStationLayers
bool insertStationLayers(const std::set< Identifier > &chIds, const std::set< Muon::MuonStationIndex::StIndex > &exclusionList, std::set< Muon::MuonStationIndex::StIndex > &layers) const
insert station layers into layer set if they are not in exclusion list
Definition: MuonTrackPerformanceAlg.cxx:1053
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
MuonTrackPerformanceAlg::countHitsInChamber
std::pair< int, int > countHitsInChamber(const Identifier &chId, const std::set< Identifier > &hitIds) const
counts number of eta (first number) and phi (second number in pair) hits in the set of hit IDs in the...
Definition: MuonTrackPerformanceAlg.cxx:997
MuonTrackPerformanceAlg::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: MuonTrackPerformanceAlg.h:262
Muon::MuonStationIndex::stName
static const std::string & stName(StIndex index)
convert StIndex into a string
Definition: MuonStationIndex.cxx:141
MuonTrackPerformanceAlg::m_nfakeTracksSL
unsigned int m_nfakeTracksSL
Definition: MuonTrackPerformanceAlg.h:321
MuonTrackPerformanceAlg::insertChamber
bool insertChamber(const Identifier &chId, const std::set< Identifier > &hits, int minEtaHits, int minPhiHits, ChamberData &chamberData) const
insert chamber information into ChamberData if hits counts pass cuts, returns true if anything was in...
Definition: MuonTrackPerformanceAlg.cxx:1015
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
MuonTrackPerformanceAlg::m_doStau
bool m_doStau
Definition: MuonTrackPerformanceAlg.h:284
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
Muon::IMuonTrackTruthTool::ResultVec
std::vector< MatchResult > ResultVec
Definition: IMuonTrackTruthTool.h:87
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
MuonTrackPerformanceAlg::m_doTruth
bool m_doTruth
Definition: MuonTrackPerformanceAlg.h:276
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
MuonTrackPerformanceAlg::m_doEventListIncomplete
int m_doEventListIncomplete
Definition: MuonTrackPerformanceAlg.h:297
MuonTrackPerformanceAlg::m_nmatchedTracksSecondary
unsigned int m_nmatchedTracksSecondary
Definition: MuonTrackPerformanceAlg.h:315
Muon::MuonTrackTruth::rpcs
MuonTechnologyTruth rpcs
Definition: IMuonTrackTruthTool.h:48
Trk::TrackSummary::muonTrackSummary
const MuonTrackSummary * muonTrackSummary() const
returns a pointer to the MuonTrackSummary if available
MuonTrackPerformanceAlg::eventInfo
std::string eventInfo() const
Definition: MuonTrackPerformanceAlg.cxx:596
MuonTrackPerformanceAlg::m_nfakeTracks
unsigned int m_nfakeTracks
Definition: MuonTrackPerformanceAlg.h:318
TrackRecord::GetPDGCode
int GetPDGCode() const
PDG Code.
Definition: TrackRecord.h:100
PrepareReferenceFile.outfile
outfile
Definition: PrepareReferenceFile.py:42
MuonTrackPerformanceAlg::getMother
HepMC::ConstGenParticlePtr getMother(const TruthTrajectory &traj) const
Definition: MuonTrackPerformanceAlg.cxx:1382
Muon::MuonSegmentCombination::numberOfStations
unsigned int numberOfStations() const
Number of stations with segment.
Definition: MuonSegmentCombination.h:108
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
MuonTrackPerformanceAlg::m_doSummary
int m_doSummary
Definition: MuonTrackPerformanceAlg.h:273
Muon::MuonTrackTruth::numberOfMatchedHits
unsigned int numberOfMatchedHits() const
Definition: IMuonTrackTruthTool.h:52
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Muon::MuonTrackTruth::cscs
MuonTechnologyTruth cscs
Definition: IMuonTrackTruthTool.h:47
xAOD::TrackSummary
TrackSummary_v1 TrackSummary
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackSummary.h:10
MuonTrackPerformanceAlg::goodTruthTrack
bool goodTruthTrack(const Muon::IMuonTrackTruthTool::TruthTreeEntry &entry) const
Definition: MuonTrackPerformanceAlg.cxx:235
Muon::IMuonTrackTruthTool::TruthTreeEntry::truthTrack
const TrackRecord * truthTrack
Definition: IMuonTrackTruthTool.h:76
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
MuonTrackPerformanceAlg::getInitialState
HepMC::ConstGenParticlePtr getInitialState(const TruthTrajectory &traj) const
Definition: MuonTrackPerformanceAlg.cxx:1391
MuonTrackPerformanceAlg::m_minRpcEtaHits
int m_minRpcEtaHits
Definition: MuonTrackPerformanceAlg.h:303
MuonTrackPerformanceAlg::m_trackTypeString
std::string m_trackTypeString
Definition: MuonTrackPerformanceAlg.h:368
MuonTrackPerformanceAlg::m_cscSimData
SG::ReadHandleKey< CscSimDataCollection > m_cscSimData
Definition: MuonTrackPerformanceAlg.h:269
MuonTrackPerformanceAlg::print
std::string print(const Muon::IMuonTrackTruthTool::TruthTreeEntry &trackTruth) const
Definition: MuonTrackPerformanceAlg.cxx:642
ServiceHandle< ICondSvc >
MuonTrackPerformanceAlg::m_printer
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
Definition: MuonTrackPerformanceAlg.h:288
Muon::MuonTrackTruth::truthTrack
const TrackRecord * truthTrack
Definition: IMuonTrackTruthTool.h:42
Identifier
Definition: IdentifierFieldParser.cxx:14
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65