ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Trk::DetailedMuonPatternTruthBuilder Class Reference

#include <DetailedMuonPatternTruthBuilder.h>

Inheritance diagram for Trk::DetailedMuonPatternTruthBuilder:
Collaboration diagram for Trk::DetailedMuonPatternTruthBuilder:

Public Member Functions

 DetailedMuonPatternTruthBuilder (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize ()
 
virtual void buildDetailedMuonPatternTruth (DetailedMuonPatternTruthCollection *output, const MuonPatternCombinationCollection &tracks, const std::vector< const PRD_MultiTruthCollection * > &prdTruth)
 See description for IDetailedMuonPatternTruthBuilder::buildDetailedTrackTruth() More...
 
virtual void buildDetailedTrackTruth (std::vector< DetailedTrackTruth > *output, const Muon::MuonPatternCombination &pattern, const std::vector< const PRD_MultiTruthCollection * > &prdTruth)
 
void buildDetailedTrackTruthFromSegments (std::vector< DetailedSegmentTruth > *output, const Muon::MuonSegment &segment, const std::vector< const PRD_MultiTruthCollection * > &prdTruth)
 
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 sysInitialize () override
 Perform system initialization for an algorithm. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

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 InverseMultiMap< PRD_MultiTruthCollectionPRD_InverseTruth
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

SubDetHitStatistics::SubDetType findSubDetType (Identifier id)
 
const MuonSimData::DepositgetDeposit (const MuonSimDataCollection &simCol, const HepMC::ConstGenParticlePtr &genPart, const Identifier &id)
 
const MuonSimDataCollectionretrieveTruthCollection (const std::string &colName)
 
void addTrack (DetailedMuonPatternTruthCollection *output, const ElementLink< DataVector< Muon::MuonPatternCombination > > &track, const std::vector< const PRD_MultiTruthCollection * > &orderedPRD_Truth, const PRD_InverseTruth &inverseTruth)
 
void addDetailedTrackTruth (std::vector< DetailedTrackTruth > *output, const Muon::MuonPatternCombination &pattern, const std::vector< const PRD_MultiTruthCollection * > &orderedPRD_Truth, const PRD_InverseTruth &inverseTruth)
 
SubDetHitStatistics countPRDsOnTruth (const TruthTrajectory &traj, const PRD_InverseTruth &inverseTruth, std::set< Muon::MuonStationIndex::ChIndex > chIndices)
 
Amg::Vector3D getPRDTruthPosition (const Muon::MuonSegment &segment, std::list< HepMC::ConstGenParticlePtr > genPartList, int truthPos, std::set< Muon::MuonStationIndex::ChIndex > chIndices)
 
void addDetailedTrackTruthFromSegment (std::vector< DetailedSegmentTruth > *output, const Muon::MuonSegment &segment, const std::vector< const PRD_MultiTruthCollection * > &orderedPRD_Truth, const PRD_InverseTruth &inverseTruth)
 
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

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
ToolHandle< Trk::ITruthTrajectoryBuilderm_truthTrackBuilder {this, "TruthTrajectoryTool", "Trk::ElasticTruthTrajectoryBuilder"}
 
ToolHandle< Muon::IMdtDriftCircleOnTrackCreatorm_mdtCreator
 
ToolHandle< Muon::IMuonClusterOnTrackCreatorm_muonClusterCreator
 
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 45 of file DetailedMuonPatternTruthBuilder.h.

Member Typedef Documentation

◆ PRD_InverseTruth

Definition at line 63 of file DetailedMuonPatternTruthBuilder.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ DetailedMuonPatternTruthBuilder()

Trk::DetailedMuonPatternTruthBuilder::DetailedMuonPatternTruthBuilder ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 112 of file DetailedMuonPatternTruthBuilder.cxx.

113  :
115  declareInterface<IDetailedMuonPatternTruthBuilder>(this);
116  }

Member Function Documentation

◆ addDetailedTrackTruth()

void Trk::DetailedMuonPatternTruthBuilder::addDetailedTrackTruth ( std::vector< DetailedTrackTruth > *  output,
const Muon::MuonPatternCombination pattern,
const std::vector< const PRD_MultiTruthCollection * > &  orderedPRD_Truth,
const PRD_InverseTruth inverseTruth 
)
private

Definition at line 729 of file DetailedMuonPatternTruthBuilder.cxx.

732  {
733  SubDetHitStatistics trackStat;
734  std::map<HepMcParticleLink, SubDetPRDs> pairStat; // stats for (track,GenParticle) for the current track
735 
736  // Loop over MuonPatternChamberIntersect
737  const std::vector<Muon::MuonPatternChamberIntersect>& MPCIV = pattern.chamberData();
738  for (unsigned int i_MPCI = 0; i_MPCI < MPCIV.size(); i_MPCI++) {
739  if (MPCIV.empty()) continue;
740 
741  // get the PrepRawData from the MuonPatternChamberIntersect
742  std::vector<const Trk::PrepRawData*> PRDV = MPCIV.at(i_MPCI).prepRawDataVec();
743 
744  // Loop over the PRDV
745  for (unsigned int j_PRD = 0; j_PRD < PRDV.size(); j_PRD++) {
746  if (PRDV.empty()) continue;
747 
748  Identifier id = PRDV.at(j_PRD)->identify();
750 
752  // if PRD truth collection is missing, ignore subdet in track stat calculation as well.
753  if (orderedPRD_Truth[subdet]) {
754  ++trackStat[subdet];
755 
756  typedef PRD_MultiTruthCollection::const_iterator iprdt;
757  std::pair<iprdt, iprdt> range = orderedPRD_Truth[subdet]->equal_range(id);
758 
759  int n = 0;
760  // Loop over particles contributing to this cluster
761  for (iprdt i = range.first; i != range.second; ++i) {
762  if (!i->second.isValid()) {
763  ATH_MSG_WARNING("Unexpected invalid HepMcParticleLink in PRD_MultiTruthCollection");
764  } else {
765  pairStat[i->second].subDetHits[subdet].insert(id);
766  n += 1;
767  ATH_MSG_VERBOSE("PRD-ID:" << id << " subdet:" << subdet << " number:" << n
768  << " particle link:" << i->second);
769  }
770  }
771  if (n == 0) {
772  ATH_MSG_VERBOSE("--> no link, noise ? PRD-ID:" << id << " subdet:" << subdet);
773  // add barcode 0 to pairs, we like to keep track of fake fakes
774  unsigned int BC(0), EV(0);
775  pairStat[HepMcParticleLink(BC, EV, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE)].subDetHits[subdet].insert(id); // FIXME barcode-based
776  }
777  } // orderedPRD_Truth[] available
778  } // subdet type check, warning in findSubDetType()
779  }
780  }
781 
782  if (msgLvl(MSG::VERBOSE)) {
783  msg(MSG::VERBOSE) << "PRD truth particles = ";
784  for (std::map<HepMcParticleLink, SubDetPRDs>::const_iterator i = pairStat.begin(); i != pairStat.end(); ++i) {
785  msg(MSG::VERBOSE) << i->first << ",";
786  }
787  msg(MSG::VERBOSE) << endmsg;
788  }
789 
790  //----------------------------------------------------------------
791  // The stat structures are ready.
792  // Build truth trajectories for the track
793 
794  std::set<HepMcParticleLink> seeds;
795  for (std::map<HepMcParticleLink, SubDetPRDs>::const_iterator i = pairStat.begin(); i != pairStat.end(); ++i) {
796  if (i->first.isValid()) {
797  seeds.insert(i->first);
798  } else {
799  // add barcode 0 particles, we like to keep track of fake fakes
800  TruthTrajectory traj;
801  traj.reserve(1);
802  traj.push_back(i->first);
803  ATH_MSG_VERBOSE("addTrack(): add barcode 0 hits - noise ?");
804 
805  // noise/no truth hits on this track
806  SubDetHitStatistics noiseStat = makeSubDetHitStatistics(i->second);
807 
808  // Only valid HepMcParticleLink make it into seeds and then into sprouts, and
809  // stored in the loop over sprouts below.
810  // Store output for noise/no truth particles here.
811  output->push_back(DetailedTrackTruth(traj, noiseStat, trackStat, noiseStat));
812  }
813  }
814 
815  // Grow sprouts from the seeds
816  typedef std::map<HepMcParticleLink, Sprout> SproutMap;
817  SproutMap sprouts;
818 
819  while (!seeds.empty()) {
820  HepMcParticleLink link = *seeds.begin();
821 
822  Sprout current_sprout;
823  std::queue<HepMC::ConstGenParticlePtr> tmp;
824  unsigned eventIndex = link.eventIndex();
825 #ifdef HEPMC3
827 #else
828  const HepMC::GenParticle* current = link.cptr();
829 #endif
830 
831  do {
833 
834  // remove the current particle from the list of particles to consider (if it is still there)
835  seeds.erase(curlink);
836 
837  // Have we worked on this particle before?
838  SproutMap::iterator p_old = sprouts.find(curlink);
839  if (p_old != sprouts.end()) {
840  // merge the old sprout with the current one.
841  current_sprout.splice(current_sprout.end(), p_old->second);
842  current_sprout.stat += p_old->second.stat;
843  // and remove the entry for the old
844  sprouts.erase(p_old);
845  break; // the do-while(getMother()) loop
846  } else { // No, this is a new particle. Try to extend the current truth trajectory.
847 
848  // Add the particle to the current truth trajectory.
849  // New: with the current stricter cuts on mother-daughter
850  // we don't have to require that ancestors produce hits.
851 
852  current_sprout.push_back(current);
853 
854  std::map<HepMcParticleLink, SubDetPRDs>::iterator p_newstat = pairStat.find(curlink);
855  if (p_newstat != pairStat.end()) { current_sprout.stat += p_newstat->second; }
856  }
857  } while ((current = m_truthTrackBuilder->getMother(current)));
858 
859  // Add the grown sprout to the list
860  sprouts.insert(std::make_pair(link, current_sprout));
861 
862  } // while(!seeds.empty())
863 
864  //----------------
865  // All seeds have been processed, and the upstream extensions of the
866  // sprouts are done. Extend the sprouts downstream to get the final
867  // truth trajectories and store the result.
868  //
869  // Note: so far the "sprouts" object mapped {last particle ==> sprout}
870  // Extending a sprout downstream will break this relationship,
871  // but at this point we don't care about it and will only use the
872  // value of the map, not the key.
873  for (SproutMap::iterator s = sprouts.begin(); s != sprouts.end(); ++s) {
874  // Attempt to extend the TruthTrajectory sprout to the "outside".
875  // This may add only hits that are *not* on the current track.
876  // Thus no need to update stats track and stats common.
877 
878  HepMC::ConstGenParticlePtr current = *s->second.begin();
879  while ((current = m_truthTrackBuilder->getDaughter(current))) { s->second.push_front(current); }
880 
881  // Now we have info to build the final TruthTrajectory.
882  // FIXME: what is the current average size?
883  TruthTrajectory traj;
884  traj.reserve(2); // The average size is about 1.05. Hardcode that instead of using slow list::size().
885  for (Sprout::const_iterator ppart = s->second.begin(); ppart != s->second.end(); ++ppart) {
886  traj.push_back(HepMcParticleLink(HepMC::barcode(*ppart), s->first.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE)); // FIXME barcode-based
887  }
888 
889  // Count PRDs on the TruthTrajectory
890  std::set<Muon::MuonStationIndex::ChIndex> tempSet;
891  SubDetHitStatistics truthStat = countPRDsOnTruth(traj, inverseTruth, tempSet);
892 
893  ATH_MSG_VERBOSE("addTrack(): sprout length = " << traj.size());
894  output->push_back(DetailedTrackTruth(traj, makeSubDetHitStatistics(s->second.stat), trackStat, truthStat));
895  }
896 
897  ATH_MSG_VERBOSE("addTrack(): #sprouts = " << sprouts.size() << ", output->size() = " << output->size());
898  }

◆ addDetailedTrackTruthFromSegment()

void Trk::DetailedMuonPatternTruthBuilder::addDetailedTrackTruthFromSegment ( std::vector< DetailedSegmentTruth > *  output,
const Muon::MuonSegment segment,
const std::vector< const PRD_MultiTruthCollection * > &  orderedPRD_Truth,
const PRD_InverseTruth inverseTruth 
)
private

Definition at line 943 of file DetailedMuonPatternTruthBuilder.cxx.

945  {
946  SubDetHitStatistics trackStat;
947  std::map<HepMcParticleLink, SubDetPRDs> pairStat; // stats for (track,GenParticle) for the current track
948 
949  std::set<Muon::MuonStationIndex::ChIndex> chIndices;
950 
951  // Loop over containedROTs in segment
952  for (unsigned int i_cROTv = 0; i_cROTv < segment.numberOfContainedROTs(); i_cROTv++) {
953  const Trk::RIO_OnTrack* rot = segment.rioOnTrack(i_cROTv);
954 
955  // get the PrepRawData from the ROT
956  const Trk::PrepRawData* prd = rot->prepRawData();
957 
958  Identifier id = prd->identify();
959  chIndices.insert(m_idHelperSvc->chamberIndex(id));
960 
962 
964  // if PRD truth collection is missing, ignore subdet in track stat calculation as well.
965  if (orderedPRD_Truth[subdet]) {
966  ++trackStat[subdet];
967 
968  typedef PRD_MultiTruthCollection::const_iterator iprdt;
969  std::pair<iprdt, iprdt> range = orderedPRD_Truth[subdet]->equal_range(id);
970 
971  int n = 0;
972  // Loop over particles contributing to this cluster
973  for (iprdt i = range.first; i != range.second; ++i) {
974  if (!i->second.isValid()) {
975  ATH_MSG_WARNING("Unexpected invalid HepMcParticleLink in PRD_MultiTruthCollection");
976  } else {
977  pairStat[i->second].subDetHits[subdet].insert(id);
978  n += 1;
979  ATH_MSG_VERBOSE("PRD-ID:" << id << " subdet:" << subdet << " number:" << n << " particle link:" << i->second);
980  }
981  }
982  if (n == 0) {
983  ATH_MSG_VERBOSE("--> no link, noise ? PRD-ID:" << id << " subdet:" << subdet);
984  // add barcode 0 to pairs, we like to keep track of fake fakes
985  unsigned int BC(0), EV(0);
986  pairStat[HepMcParticleLink(BC, EV, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE)].subDetHits[subdet].insert(id); // FIXME barcode-based
987  }
988  } // orderedPRD_Truth[] available
989  } // subdet type check, warning in findSubDetType()
990  }
991 
992  if (msgLvl(MSG::VERBOSE)) {
993  msg(MSG::VERBOSE) << "PRD truth particles = ";
994  for (std::map<HepMcParticleLink, SubDetPRDs>::const_iterator i = pairStat.begin(); i != pairStat.end(); ++i) {
995  msg(MSG::VERBOSE) << i->first << ",";
996  }
997  msg(MSG::VERBOSE) << endmsg;
998  }
999 
1000  //----------------------------------------------------------------
1001  // The stat structures are ready.
1002  // Build truth trajectories for the track
1003 
1004  std::set<HepMcParticleLink> seeds;
1005  for (std::map<HepMcParticleLink, SubDetPRDs>::const_iterator i = pairStat.begin(); i != pairStat.end(); ++i) {
1006  if (i->first.isValid()) {
1007  seeds.insert(i->first);
1008  } else {
1009  // add barcode 0 particles, we like to keep track of fake fakes
1010  TruthTrajectory traj;
1011  traj.reserve(1);
1012  traj.push_back(i->first);
1013  ATH_MSG_VERBOSE("addTrack(): add barcode 0 hits - noise ?");
1014 
1015  // noise/no truth hits on this track
1016  SubDetHitStatistics noiseStat = makeSubDetHitStatistics(i->second);
1017 
1018  // Only valid HepMcParticleLink make it into seeds and then into sprouts, and
1019  // stored in the loop over sprouts below.
1020  // Store output for noise/no truth particles here.
1021  output->push_back(
1022  DetailedSegmentTruth(traj, noiseStat, trackStat, noiseStat, Amg::Vector3D(0, 0, 0), Amg::Vector3D(0, 0, 0)));
1023  }
1024  }
1025 
1026  // Grow sprouts from the seeds
1027  typedef std::map<HepMcParticleLink, Sprout> SproutMap;
1028  SproutMap sprouts;
1029 
1030  while (!seeds.empty()) {
1031  HepMcParticleLink link = *seeds.begin();
1032 
1033  Sprout current_sprout;
1034  std::queue<HepMC::ConstGenParticlePtr> tmp;
1035  unsigned eventIndex = link.eventIndex();
1036 #ifdef HEPMC3
1038 #else
1039  const HepMC::GenParticle* current = link.cptr();
1040 #endif
1041 
1042  do {
1044 
1045  // remove the current particle from the list of particles to consider (if it is still there)
1046  seeds.erase(curlink);
1047 
1048  // Have we worked on this particle before?
1049  SproutMap::iterator p_old = sprouts.find(curlink);
1050  if (p_old != sprouts.end()) {
1051  // merge the old sprout with the current one.
1052  current_sprout.splice(current_sprout.end(), p_old->second);
1053  current_sprout.stat += p_old->second.stat;
1054  // and remove the entry for the old
1055  sprouts.erase(p_old);
1056  break; // the do-while(getMother()) loop
1057  } else { // No, this is a new particle. Try to extend the current truth trajectory.
1058 
1059  // Add the particle to the current truth trajectory.
1060  // New: with the current stricter cuts on mother-daughter
1061  // we don't have to require that ancestors produce hits.
1062 
1063  current_sprout.push_back(current);
1064 
1065  std::map<HepMcParticleLink, SubDetPRDs>::iterator p_newstat = pairStat.find(curlink);
1066  if (p_newstat != pairStat.end()) { current_sprout.stat += p_newstat->second; }
1067  }
1068  } while ((current = m_truthTrackBuilder->getMother(current)));
1069 
1070  // Add the grown sprout to the list
1071  sprouts.insert(std::make_pair(link, current_sprout));
1072 
1073  } // while(!seeds.empty())
1074 
1075  //----------------
1076  // All seeds have been processed, and the upstream extensions of the
1077  // sprouts are done. Extend the sprouts downstream to get the final
1078  // truth trajectories and store the result.
1079  //
1080  // Note: so far the "sprouts" object mapped {last particle ==> sprout}
1081  // Extending a sprout downstream will break this relationship,
1082  // but at this point we don't care about it and will only use the
1083  // value of the map, not the key.
1084  for (SproutMap::iterator s = sprouts.begin(); s != sprouts.end(); ++s) {
1085  // Attempt to extend the TruthTrajectory sprout to the "outside".
1086  // This may add only hits that are *not* on the current track.
1087  // Thus no need to update stats track and stats common.
1088 
1089  HepMC::ConstGenParticlePtr current = *s->second.begin();
1090  while ((current = m_truthTrackBuilder->getDaughter(current))) { s->second.push_front(current); }
1091 
1092  // Now we have info to build the final TruthTrajectory.
1093  // FIXME: what is the current average size?
1094  TruthTrajectory traj;
1095  traj.reserve(2); // The average size is about 1.05. Hardcode that instead of using slow list::size().
1096  for (Sprout::const_iterator ppart = s->second.begin(); ppart != s->second.end(); ++ppart) {
1097  traj.push_back(HepMcParticleLink(HepMC::barcode(*ppart), s->first.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE)); // FIXME barcode-based
1098  }
1099 
1100  // Count PRDs on the TruthTrajectory
1101  SubDetHitStatistics truthStat = countPRDsOnTruth(traj, inverseTruth, chIndices);
1102  Amg::Vector3D pos = getPRDTruthPosition(segment, s->second, 1, chIndices);
1103  Amg::Vector3D dir = getPRDTruthPosition(segment, s->second, 0, chIndices);
1104 
1105  ATH_MSG_VERBOSE("addTrack(): sprout length = " << traj.size());
1106  output->push_back(DetailedSegmentTruth(traj, makeSubDetHitStatistics(s->second.stat), trackStat, truthStat, pos, dir));
1107  }
1108 
1109  ATH_MSG_VERBOSE("addTrack(): #sprouts = " << sprouts.size() << ", output->size() = " << output->size());
1110  }

◆ addTrack()

void Trk::DetailedMuonPatternTruthBuilder::addTrack ( DetailedMuonPatternTruthCollection output,
const ElementLink< DataVector< Muon::MuonPatternCombination > > &  track,
const std::vector< const PRD_MultiTruthCollection * > &  orderedPRD_Truth,
const PRD_InverseTruth inverseTruth 
)
private

Definition at line 270 of file DetailedMuonPatternTruthBuilder.cxx.

273  {
274  SubDetHitStatistics trackStat;
275  std::map<HepMcParticleLink, SubDetPRDs> pairStat; // stats for (track,GenParticle) for the current track
276 
277  // Loop over MuonPatternChamberIntersect
278  const std::vector<Muon::MuonPatternChamberIntersect>& MPCIV = (*MuPatternCombo)->chamberData();
279  for (unsigned int i_MPCI = 0; i_MPCI < MPCIV.size(); i_MPCI++) {
280  if (MPCIV.empty()) continue;
281 
282  // get the PrepRawData from the MuonPatternChamberIntersect
283  std::vector<const Trk::PrepRawData*> PRDV = MPCIV.at(i_MPCI).prepRawDataVec();
284 
285  // Loop over the PRDV
286  for (unsigned int j_PRD = 0; j_PRD < PRDV.size(); j_PRD++) {
287  if (PRDV.empty()) continue;
288 
289  Identifier id = PRDV.at(j_PRD)->identify();
291 
293  // if PRD truth collection is missing, ignore subdet in track stat calculation as well.
294  if (orderedPRD_Truth[subdet]) {
295  ++trackStat[subdet];
296 
297  typedef PRD_MultiTruthCollection::const_iterator iprdt;
298  std::pair<iprdt, iprdt> range = orderedPRD_Truth[subdet]->equal_range(id);
299 
300  int n = 0;
301  // Loop over particles contributing to this cluster
302  for (iprdt i = range.first; i != range.second; ++i) {
303  if (!i->second.isValid()) {
304  ATH_MSG_WARNING("Unexpected invalid HepMcParticleLink in PRD_MultiTruthCollection");
305  } else {
306  pairStat[i->second].subDetHits[subdet].insert(id);
307  n += 1;
308  ATH_MSG_VERBOSE("PRD-ID:" << id << " subdet:" << subdet << " number:" << n
309  << " particle link:" << i->second);
310  }
311  }
312  if (n == 0) {
313  ATH_MSG_VERBOSE("--> no link, noise ? PRD-ID:" << id << " subdet:" << subdet);
314  // add barcode 0 to pairs, we like to keep track of fake fakes
315  unsigned int BC(0), EV(0);
316  pairStat[HepMcParticleLink(BC, EV, HepMcParticleLink::IS_POSITION, HepMcParticleLink::IS_BARCODE)].subDetHits[subdet].insert(id); // FIXME barcode-based
317  }
318  } // orderedPRD_Truth[] available
319  } // subdet type check, warning in findSubDetType()
320  }
321  }
322 
323  if (msgLvl(MSG::VERBOSE)) {
324  msg(MSG::VERBOSE) << "PRD truth particles = ";
325  for (std::map<HepMcParticleLink, SubDetPRDs>::const_iterator i = pairStat.begin(); i != pairStat.end(); ++i) {
326  msg(MSG::VERBOSE) << i->first << ",";
327  }
328  msg(MSG::VERBOSE) << endmsg;
329  }
330 
331  //----------------------------------------------------------------
332  // The stat structures are ready.
333  // Build truth trajectories for the track
334  std::set<HepMcParticleLink> seeds;
335  for (std::map<HepMcParticleLink, SubDetPRDs>::const_iterator i = pairStat.begin(); i != pairStat.end(); ++i) {
336  if (i->first.isValid()) {
337  seeds.insert(i->first);
338  } else {
339  // add barcode 0 particles, we like to keep track of fake fakes
340  TruthTrajectory traj;
341  traj.reserve(1);
342  traj.push_back(i->first);
343  ATH_MSG_VERBOSE("addTrack(): add barcode 0 hits - noise ?");
344 
345  // noise/no truth hits on this track
346  SubDetHitStatistics noiseStat = makeSubDetHitStatistics(i->second);
347 
348  // Only valid HepMcParticleLink make it into seeds and then into sprouts, and
349  // stored in the loop over sprouts below.
350  // Store output for noise/no truth particles here.
351  output->insert(std::make_pair(MuPatternCombo, DetailedTrackTruth(traj, noiseStat, trackStat, noiseStat)));
352  }
353  }
354 
355  // Grow sprouts from the seeds
356  typedef std::map<HepMcParticleLink, Sprout> SproutMap;
357  SproutMap sprouts;
358 
359  while (!seeds.empty()) {
360  HepMcParticleLink link = *seeds.begin();
361 
362  Sprout current_sprout;
363  std::queue<HepMC::ConstGenParticlePtr> tmp;
364  unsigned eventIndex = link.eventIndex();
365 #ifdef HEPMC3
367 #else
368  const HepMC::GenParticle* current = link.cptr();
369 #endif
370 
371  do {
373 
374  // remove the current particle from the list of particles to consider (if it is still there)
375  seeds.erase(curlink);
376 
377  // Have we worked on this particle before?
378  SproutMap::iterator p_old = sprouts.find(curlink);
379  if (p_old != sprouts.end()) {
380  // merge the old sprout with the current one.
381  current_sprout.splice(current_sprout.end(), p_old->second);
382  current_sprout.stat += p_old->second.stat;
383  // and remove the entry for the old
384  sprouts.erase(p_old);
385  break; // the do-while(getMother()) loop
386  } else { // No, this is a new particle. Try to extend the current truth trajectory.
387 
388  // Add the particle to the current truth trajectory.
389  // New: with the current stricter cuts on mother-daughter
390  // we don't have to require that ancestors produce hits.
391 
392  current_sprout.push_back(current);
393 
394  std::map<HepMcParticleLink, SubDetPRDs>::iterator p_newstat = pairStat.find(curlink);
395  if (p_newstat != pairStat.end()) { current_sprout.stat += p_newstat->second; }
396  }
397  } while ((current = m_truthTrackBuilder->getMother(current)));
398 
399  // Add the grown sprout to the list
400  sprouts.insert(std::make_pair(link, current_sprout));
401 
402  } // while(!seeds.empty())
403 
404  //----------------
405  // All seeds have been processed, and the upstream extensions of the
406  // sprouts are done. Extend the sprouts downstream to get the final
407  // truth trajectories and store the result.
408  //
409  // Note: so far the "sprouts" object mapped {last particle ==> sprout}
410  // Extending a sprout downstream will break this relationship,
411  // but at this point we don't care about it and will only use the
412  // value of the map, not the key.
413 
414  for (SproutMap::iterator s = sprouts.begin(); s != sprouts.end(); ++s) {
415  // Attempt to extend the TruthTrajectory sprout to the "outside".
416  // This may add only hits that are *not* on the current track.
417  // Thus no need to update stats track and stats common.
418 
419  HepMC::ConstGenParticlePtr current = *s->second.begin();
420  while ((current = m_truthTrackBuilder->getDaughter(current))) { s->second.push_front(current); }
421 
422  // Now we have info to build the final TruthTrajectory.
423  // FIXME: what is the current average size?
424  TruthTrajectory traj;
425  traj.reserve(2); // The average size is about 1.05. Hardcode that instead of using slow list::size().
426  for (Sprout::const_iterator ppart = s->second.begin(); ppart != s->second.end(); ++ppart) {
427  traj.push_back(HepMcParticleLink(HepMC::barcode(*ppart), s->first.eventIndex(), HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE)); // FIXME barcode-based
428  }
429 
430  // Count PRDs on the TruthTrajectory
431  std::set<Muon::MuonStationIndex::ChIndex> tempSet;
432  SubDetHitStatistics truthStat = countPRDsOnTruth(traj, inverseTruth, tempSet);
433 
434  ATH_MSG_VERBOSE("addTrack(): sprout length = " << traj.size());
435  output->insert(
436  std::make_pair(MuPatternCombo, DetailedTrackTruth(traj, makeSubDetHitStatistics(s->second.stat), trackStat, truthStat)));
437  }
438 
439  ATH_MSG_VERBOSE("addTrack(): #sprouts = " << sprouts.size() << ", output->size() = " << output->size());
440  }

◆ buildDetailedMuonPatternTruth()

void Trk::DetailedMuonPatternTruthBuilder::buildDetailedMuonPatternTruth ( DetailedMuonPatternTruthCollection output,
const MuonPatternCombinationCollection tracks,
const std::vector< const PRD_MultiTruthCollection * > &  prdTruth 
)
virtual

See description for IDetailedMuonPatternTruthBuilder::buildDetailedTrackTruth()

Implements Trk::IDetailedMuonPatternTruthBuilder.

Definition at line 128 of file DetailedMuonPatternTruthBuilder.cxx.

130  {
131  ATH_MSG_VERBOSE("DetailedMuonPatternTruthBuilder::buildDetailedMuonPatternTruth() ");
132 
133  if (!output) { return; }
134 
135  //----------------------------------------------------------------
136  // The caller can pass PRD truth collections in any order. Sort them out.
137 
138  std::vector<const PRD_MultiTruthCollection*> orderedPRD_Truth(SubDetHitStatistics::NUM_SUBDETECTORS);
139  PRD_InverseTruth inverseTruth;
140 
141  for (std::vector<const PRD_MultiTruthCollection*>::const_iterator i = prdTruth.begin(); i != prdTruth.end(); ++i) {
142  if (*i) {
143  if (!(*i)->empty()) {
144  SubDetHitStatistics::SubDetType subdet = findSubDetType((*i)->begin()->first);
145 
147  orderedPRD_Truth[subdet] = *i;
148  addToInverseMultiMap(&inverseTruth, **i);
149  } else {
150  ATH_MSG_WARNING("Got unknown SubDetType in prdTruth ");
151  }
152  } else {
153  ATH_MSG_DEBUG("Empty truth ???");
154  }
155  }
156  }
157 
158  //----------------------------------------------------------------
159  // Find associated truth for each track
160 
161  for (unsigned itrack = 0; itrack < patterns.size(); itrack++) {
163  addTrack(output, ptrack, orderedPRD_Truth, inverseTruth);
164  }
165 
166  // DEBUG
167  // FIXME: in normal production jobs that does *a lot of* formatting only to discard the result...
169  "Dumping output collection.\n"
170  " Entries with TruthTrajectories of more then one particle shown at the DEBUG level.\n"
171  " Use VERBOSE level for complete dump.");
172 
173  for (DetailedMuonPatternTruthCollection::const_iterator i = output->begin(); i != output->end(); ++i) {
174  bool interesting = (i->second.trajectory().size() > 1);
175 
176  // TODO: Reinsert the following code once I understand the compile-time error
177  // msg(interesting ? MSG::DEBUG : MSG::VERBOSE)
178  // <<"out: trk="<<i->first.index()<<" => "<<i->second<<endmsg;
179 
180  if (interesting) {
181  const TruthTrajectory& t = i->second.trajectory();
182  msg(MSG::VERBOSE) << "Particles on the trajectory:\n";
183  for (unsigned k = 0; k < t.size(); ++k) { msg(MSG::VERBOSE) << t[k] << "\n"; }
184  msg(MSG::VERBOSE) << "\n" << endmsg;
185  }
186  }
187  }

◆ buildDetailedTrackTruth()

void Trk::DetailedMuonPatternTruthBuilder::buildDetailedTrackTruth ( std::vector< DetailedTrackTruth > *  output,
const Muon::MuonPatternCombination pattern,
const std::vector< const PRD_MultiTruthCollection * > &  prdTruth 
)
virtual

Implements Trk::IDetailedMuonPatternTruthBuilder.

Definition at line 191 of file DetailedMuonPatternTruthBuilder.cxx.

193  {
194  ATH_MSG_VERBOSE("DetailedMuonPatternTruthBuilder::buildDetailedTrackTruth() ");
195 
196  if (!output) { return; }
197 
198  //----------------------------------------------------------------
199  // The caller can pass PRD truth collections in any order. Sort them out.
200 
201  std::vector<const PRD_MultiTruthCollection*> orderedPRD_Truth(SubDetHitStatistics::NUM_SUBDETECTORS);
202  PRD_InverseTruth inverseTruth;
203 
204  for (std::vector<const PRD_MultiTruthCollection*>::const_iterator i = prdTruth.begin(); i != prdTruth.end(); ++i) {
205  if (*i) {
206  if (!(*i)->empty()) {
207  SubDetHitStatistics::SubDetType subdet = findSubDetType((*i)->begin()->first);
208 
210  orderedPRD_Truth[subdet] = *i;
211  addToInverseMultiMap(&inverseTruth, **i);
212  } else {
213  ATH_MSG_WARNING("Got unknown SubDetType in prdTruth ");
214  }
215  } else {
216  ATH_MSG_DEBUG("Empty truth ???");
217  }
218  }
219  }
220 
221  //----------------------------------------------------------------
222  // Find associated truth for each track
223  addDetailedTrackTruth(output, pattern, orderedPRD_Truth, inverseTruth);
224 
225  // DEBUG
226  // FIXME: in normal production jobs that does *a lot of* formatting only to discard the result...
228  "Dumping output collection.\n"
229  " Entries with TruthTrajectories of more then one particle shown at the DEBUG level.\n"
230  " Use VERBOSE level for complete dump.");
231 
232 
233  }

◆ buildDetailedTrackTruthFromSegments()

void Trk::DetailedMuonPatternTruthBuilder::buildDetailedTrackTruthFromSegments ( std::vector< DetailedSegmentTruth > *  output,
const Muon::MuonSegment segment,
const std::vector< const PRD_MultiTruthCollection * > &  prdTruth 
)
virtual

Implements Trk::IDetailedMuonPatternTruthBuilder.

Definition at line 900 of file DetailedMuonPatternTruthBuilder.cxx.

902  {
903  ATH_MSG_VERBOSE("DetailedMuonPatternTruthBuilder::buildDetailedTrackTruthFromSegments() ");
904 
905  if (!output) { return; }
906 
907  //----------------------------------------------------------------
908  // The caller can pass PRD truth collections in any order. Sort them out.
909 
910  std::vector<const PRD_MultiTruthCollection*> orderedPRD_Truth(SubDetHitStatistics::NUM_SUBDETECTORS);
911  PRD_InverseTruth inverseTruth;
912 
913  for (std::vector<const PRD_MultiTruthCollection*>::const_iterator i = prdTruth.begin(); i != prdTruth.end(); ++i) {
914  if (*i) {
915  if (!(*i)->empty()) {
916  SubDetHitStatistics::SubDetType subdet = findSubDetType((*i)->begin()->first);
917 
919  orderedPRD_Truth[subdet] = *i;
920  addToInverseMultiMap(&inverseTruth, **i);
921  } else {
922  ATH_MSG_WARNING("Got unknown SubDetType in prdTruth ");
923  }
924  } else {
925  ATH_MSG_DEBUG("Empty truth ???");
926  }
927  }
928  }
929 
930  //----------------------------------------------------------------
931  // Find associated truth for each track
932  addDetailedTrackTruthFromSegment(output, segment, orderedPRD_Truth, inverseTruth);
933 
934  // DEBUG
935  // FIXME: in normal production jobs that does *a lot of* formatting only to discard the result...
937  "Dumping output collection.\n"
938  " Entries with TruthTrajectories of more then one particle shown at the DEBUG level.\n"
939  " Use VERBOSE level for complete dump.");
940  }

◆ countPRDsOnTruth()

SubDetHitStatistics Trk::DetailedMuonPatternTruthBuilder::countPRDsOnTruth ( const TruthTrajectory traj,
const PRD_InverseTruth inverseTruth,
std::set< Muon::MuonStationIndex::ChIndex chIndices 
)
private

Definition at line 443 of file DetailedMuonPatternTruthBuilder.cxx.

444  {
445  // Different particles from the same TruthTrajectory can contribute to the same cluster.
446  // We should be careful to avoid double-counting in such cases.
447 
448  SubDetPRDs prds;
449  for (TruthTrajectory::const_iterator p = traj.begin(); p != traj.end(); ++p) {
450  typedef PRD_InverseTruth::const_iterator iter;
451  std::pair<iter, iter> range = inverseTruth.equal_range(*p);
452  for (iter i = range.first; i != range.second; ++i) {
453  if (chIndices.find(m_idHelperSvc->chamberIndex(i->second)) != chIndices.end()) {
455  if (subdet == SubDetHitStatistics::NUM_SUBDETECTORS) continue;
456  prds.subDetHits[subdet].insert(i->second);
457  }
458  }
459  }
460 
461  return makeSubDetHitStatistics(prds);
462  }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ findSubDetType()

SubDetHitStatistics::SubDetType Trk::DetailedMuonPatternTruthBuilder::findSubDetType ( Identifier  id)
private

Definition at line 241 of file DetailedMuonPatternTruthBuilder.cxx.

241  {
242  if (!m_idHelperSvc->isMuon(id)) {
243  if (m_idHelperSvc->mdtIdHelper().is_pixel(id))
245  else if (m_idHelperSvc->mdtIdHelper().is_sct(id))
247  else if (m_idHelperSvc->mdtIdHelper().is_trt(id))
249  } else {
250  if (m_idHelperSvc->isMdt(id))
252  else if (m_idHelperSvc->isRpc(id))
254  else if (m_idHelperSvc->isTgc(id))
256  else if (m_idHelperSvc->isCsc(id))
258  else if (m_idHelperSvc->isMM(id))
260  else if (m_idHelperSvc->issTgc(id))
262  }
263 
264  ATH_MSG_WARNING("findSubDetType(): UNKNOWN subdet for id=" << id);
265 
267  }

◆ getDeposit()

const MuonSimData::Deposit * Trk::DetailedMuonPatternTruthBuilder::getDeposit ( const MuonSimDataCollection simCol,
const HepMC::ConstGenParticlePtr genPart,
const Identifier id 
)
private

Definition at line 1113 of file DetailedMuonPatternTruthBuilder.cxx.

1114  {
1115  MuonSimDataCollection::const_iterator it = simCol.find(id);
1116  if (it == simCol.end()) {
1117  ATH_MSG_WARNING(" Truth PRD not found in simdata collection: " << m_idHelperSvc->toString(id));
1118  return nullptr;
1119  }
1120 
1121  const MuonSimData& simData = it->second;
1122  const MuonSimData::Deposit* deposit = nullptr;
1123  std::vector<MuonSimData::Deposit>::const_iterator dit = simData.getdeposits().begin();
1124  std::vector<MuonSimData::Deposit>::const_iterator dit_end = simData.getdeposits().end();
1125  for (; dit != dit_end; ++dit) {
1126 #ifdef HEPMC3
1127  HepMC::ConstGenParticlePtr gp = dit->first.scptr();
1128 #else
1129  const HepMC::GenParticle* gp = dit->first;
1130 #endif
1131  if (gp == genPart) {
1132  deposit = &*dit;
1133  break;
1134  }
1135 
1136  }
1137  return deposit;
1138  }

◆ getPRDTruthPosition()

Amg::Vector3D Trk::DetailedMuonPatternTruthBuilder::getPRDTruthPosition ( const Muon::MuonSegment segment,
std::list< HepMC::ConstGenParticlePtr genPartList,
int  truthPos,
std::set< Muon::MuonStationIndex::ChIndex chIndices 
)
private

Definition at line 465 of file DetailedMuonPatternTruthBuilder.cxx.

467  {
468  double minPos = 2e8, maxPos = 0;
469  Amg::Vector3D first3D(0, 0, 0), last3D(0, 0, 0);
470 
471  if (genPartList.empty()) {
472  ATH_MSG_WARNING("No GenParticles associated to this PRD_TruthTrajectory. Exiting segment creation.");
473  return Amg::Vector3D(0, 0, 0);
474  }
475 
476  const MuonSimDataCollection* mdtSimDataMap = retrieveTruthCollection("MDT_SDO");
477  if (!mdtSimDataMap) {
478  ATH_MSG_WARNING(" failed to retrieve MuonSimDataCollection: "
479  << "MDT_SDO");
480  return Amg::Vector3D(0, 0, 0);
481  }
482  const MuonSimDataCollection* mmSimDataMap = retrieveTruthCollection("MM_SDO");
483  if (!mmSimDataMap) {
484  ATH_MSG_WARNING(" failed to retrieve MuonSimDataCollection: "
485  << "MM_SDO");
486  return Amg::Vector3D(0, 0, 0);
487  }
488  const MuonSimDataCollection* stgcSimDataMap = retrieveTruthCollection("sTGC_SDO");
489  if (!stgcSimDataMap) {
490  ATH_MSG_WARNING(" failed to retrieve MuonSimDataCollection: "
491  << "sTGC_SDO");
492  return Amg::Vector3D(0, 0, 0);
493  }
494 
495  // First sort the hits per detector layer
496  std::map<Muon::MuonStationIndex::StIndex, DetectorLayer> hitsPerLayer;
497  std::map<const Trk::TrkDetElementBase*, std::pair<std::list<const Trk::PrepRawData*>, std::list<const Trk::PrepRawData*> > >
498  clustersPerDetEl;
499 
500  // Loop over containedROTs in segment
501  for (unsigned int i_cROTv = 0; i_cROTv < segment.numberOfContainedROTs(); i_cROTv++) {
502  const Trk::RIO_OnTrack* rot = segment.rioOnTrack(i_cROTv);
503 
504  // get the PrepRawData from the ROT
505  const Trk::PrepRawData* prd = rot->prepRawData();
506 
507  Identifier id = prd->identify();
508 
509  Muon::MuonStationIndex::StIndex stIndex = m_idHelperSvc->stationIndex(id);
510  bool isEndcap = m_idHelperSvc->isEndcap(id);
511 
512  if (chIndices.find(m_idHelperSvc->chamberIndex(id)) == chIndices.end()) {
513  ATH_MSG_DEBUG("Muon station doesn't match segment. Continuing");
514  continue;
515  }
516 
517  // some patches until MuonIdHelper is updated
518  const Muon::MMPrepData* mm = dynamic_cast<const Muon::MMPrepData*>(prd);
519  if (mm) {
520  isEndcap = true;
521  stIndex = Muon::MuonStationIndex::EI;
522  }
523  const Muon::sTgcPrepData* stgc = dynamic_cast<const Muon::sTgcPrepData*>(prd);
524  if (stgc) {
525  isEndcap = true;
526  stIndex = Muon::MuonStationIndex::EI;
527  }
528  // BEGIN NEW WORK
529 
530  DetectorLayer& detLayer = hitsPerLayer[stIndex];
531  detLayer.isEndcap = isEndcap;
532  detLayer.stIndex = stIndex;
533 
534  // const Trk::MeasurementBase* meas = 0;
535  if (m_idHelperSvc->isMdt(id)) {
536  const Muon::MdtPrepData* mprd = dynamic_cast<const Muon::MdtPrepData*>(prd);
537  if (!mprd) {
538  ATH_MSG_WARNING(" MDT PRD not of type MdtPrepData " << m_idHelperSvc->toString(id));
539  continue;
540  }
541 
542  const MuonSimData::Deposit* deposit = nullptr;
543  for (auto it = genPartList.begin(); it != genPartList.end() && !deposit; ++it) {
544  deposit = getDeposit(*mdtSimDataMap, *it, id);
545  }
546  if (!deposit) {
547  ATH_MSG_WARNING(" Deposit for GenParticle not found " << m_idHelperSvc->toString(id));
548  continue;
549  }
550 
551  Amg::Vector2D lp(deposit->second.firstEntry(), deposit->second.secondEntry());
552  const Amg::Vector3D gpos = prd->detectorElement()->surface(id).localToGlobal(lp);
553 
554  double val = isEndcap ? fabs(gpos.z()) : gpos.perp();
555 
556  // nasty comparisons to figure out which MDT hit comes first
557  if (val < detLayer.minPos) {
558  if (detLayer.maxPos < -1e8 && detLayer.minPos < 1e8) {
559  detLayer.last3D = detLayer.first3D;
560  detLayer.maxPos = detLayer.minPos;
561  }
562  detLayer.first3D = gpos;
563  detLayer.minPos = val;
564  } else if (val > detLayer.maxPos) {
565  detLayer.last3D = gpos;
566  detLayer.maxPos = val;
567  }
568 
569  if (val < minPos) {
570  if (maxPos < -1e8 && minPos < 1e8) {
571  last3D = first3D;
572  maxPos = minPos;
573  }
574  minPos = val;
575  first3D = gpos;
576  } else if (val > maxPos) {
577  maxPos = val;
578  last3D = gpos;
579  }
580 
581  const Muon::MdtDriftCircleOnTrack* mdt = m_mdtCreator->createRIO_OnTrack(*mprd, gpos);
582  if (!mdt) {
583  ATH_MSG_WARNING(" ROT creation failed " << m_idHelperSvc->toString(id));
584  continue;
585  }
586  Trk::DriftCircleSide side = deposit->second.firstEntry() < 0 ? Trk::LEFT : Trk::RIGHT;
587  m_mdtCreator->updateSign(*const_cast<Muon::MdtDriftCircleOnTrack*>(mdt), side);
588  double pull = (mdt->driftRadius() - deposit->second.firstEntry()) / mdt->localCovariance()(Trk::locR);
589  ATH_MSG_VERBOSE(" new MDT " << m_idHelperSvc->toString(id) << " radius " << mdt->driftRadius() << " true radius "
590  << deposit->second.firstEntry() << " pull " << pull);
591  if (fabs(pull) > 3.) ATH_MSG_VERBOSE(" hit with large pull ");
592  detLayer.meas.push_back(mdt);
593  if (m_idHelperSvc->isSmallChamber(id))
594  ++detLayer.nmdtS;
595  else
596  ++detLayer.nmdtL;
597  // meas = mdt;
598  } else if (mm) {
599  const MuonSimData::Deposit* deposit = nullptr;
600  for (auto it = genPartList.begin(); it != genPartList.end() && !deposit; ++it) {
601  deposit = getDeposit(*mmSimDataMap, *it, id);
602  }
603  if (!deposit) {
604  ATH_MSG_WARNING(" Deposit for GenParticle not found " << m_idHelperSvc->toString(id));
605  continue;
606  }
607 
608  Amg::Vector2D lp(deposit->second.firstEntry(), deposit->second.secondEntry());
609  const Amg::Vector3D gpos = prd->detectorElement()->surface(id).localToGlobal(lp);
610 
611  // double val = isEndcap ? fabs(gpos->z()) : gpos->perp();
612  // micormegas are always endcap
613  double val = fabs(gpos.z());
614  // nasty comparisons to figure out which MDT hit comes first
615  if (val < detLayer.minPos) {
616  if (detLayer.maxPos < -1e8 && detLayer.minPos < 1e8) {
617  detLayer.last3D = detLayer.first3D;
618  detLayer.maxPos = detLayer.minPos;
619  }
620  detLayer.first3D = gpos;
621  detLayer.minPos = val;
622  } else if (val > detLayer.maxPos) {
623  detLayer.last3D = gpos;
624  detLayer.maxPos = val;
625  }
626 
627  if (val < minPos) {
628  if (maxPos < -1e8 && detLayer.minPos < 1e8) {
629  last3D = first3D;
630  maxPos = minPos;
631  }
632  minPos = val;
633  first3D = gpos;
634  } else if (val > maxPos) {
635  maxPos = val;
636  last3D = gpos;
637  }
638 
639  const Muon::MuonClusterOnTrack* rot = m_muonClusterCreator->createRIO_OnTrack(*mm, gpos);
640  if (!rot) {
641  ATH_MSG_WARNING(" ROT creation failed " << m_idHelperSvc->toString(id));
642  continue;
643  }
644  double residual = rot->localParameters().get(Trk::locX) - lp.x();
645  double pull = residual / rot->localCovariance()(Trk::locX);
646  ATH_MSG_DEBUG("Adding r " << gpos.perp() << " z " << gpos.z() << " " << m_idHelperSvc->toString(id) << " " << residual
647  << " pull " << pull);
648  detLayer.meas.push_back(rot);
649  // meas = rot;
650  ++detLayer.nnsw;
651 
652  } else if (stgc) {
653  // skip pads in outer most two chambers as here the wires are more precise
654  if (m_idHelperSvc->stgcIdHelper().channelType(id) == 0 && abs(m_idHelperSvc->stationEta(id)) > 2) continue;
655 
656  // there is already a check for this at the beginning of the method
657  // if( !stgcSimDataMap ) continue;
658 
659  const MuonSimData::Deposit* deposit = nullptr;
660  for (auto it = genPartList.begin(); it != genPartList.end() && !deposit; ++it) {
661  deposit = getDeposit(*stgcSimDataMap, *it, id);
662  }
663  if (!deposit) {
664  ATH_MSG_WARNING(" Deposit for GenParticle not found " << m_idHelperSvc->toString(id));
665  continue;
666  }
667 
668  Amg::Vector2D lp(deposit->second.firstEntry(), deposit->second.secondEntry());
669  const Amg::Vector3D gpos = prd->detectorElement()->surface(id).localToGlobal(lp);
670 
671  // double val = isEndcap ? fabs(gpos->z()) : gpos->perp();
672  // stgcs are always endcap
673  double val = fabs(gpos.z());
674  // // nasty comparisons to figure out which STGC hit comes first
675  if (val < detLayer.minPos) {
676  if (detLayer.maxPos < -1e8 && detLayer.minPos < 1e8) {
677  detLayer.last3D = detLayer.first3D;
678  detLayer.maxPos = detLayer.minPos;
679  }
680  detLayer.first3D = gpos;
681  detLayer.minPos = val;
682  } else if (val > detLayer.maxPos) {
683  detLayer.last3D = gpos;
684  detLayer.maxPos = val;
685  }
686 
687  if (val < minPos) {
688  if (maxPos < -1e8 && minPos < 1e8) {
689  last3D = first3D;
690  maxPos = minPos;
691  }
692  minPos = val;
693  first3D = gpos;
694  } else if (val > maxPos) {
695  maxPos = val;
696  last3D = gpos;
697  }
698 
699  const Muon::MuonClusterOnTrack* rot = m_muonClusterCreator->createRIO_OnTrack(*stgc, gpos);
700  if (!rot) {
701  ATH_MSG_WARNING(" ROT creation failed " << m_idHelperSvc->toString(id));
702  continue;
703  }
704  double residual = rot->localParameters().get(Trk::locX) - lp.x();
705  double pull = residual / rot->localCovariance()(Trk::locX);
706  ATH_MSG_DEBUG("Adding r " << gpos.perp() << " z " << gpos.z() << " " << m_idHelperSvc->toString(id) << " " << residual
707  << " pull " << pull);
708  detLayer.meas.push_back(rot);
709  // meas = rot;
710  ++detLayer.nnsw;
711  }
712  }
713 
714  // END NEW WORK
715  if (minPos == 2e8 || maxPos == 0) {
716  ATH_MSG_WARNING("Min and max positions not found. Filling with meaningless position");
717  return Amg::Vector3D(-15000, -15000, -15000);
718  }
719 
720  if (truthPos)
721  return (first3D + last3D) / 2;
722  else {
723  // else truth direction
724  return (last3D - first3D);
725  }
726  }

◆ initialize()

StatusCode Trk::DetailedMuonPatternTruthBuilder::initialize ( )
virtual

Definition at line 119 of file DetailedMuonPatternTruthBuilder.cxx.

119  {
120  ATH_CHECK(m_truthTrackBuilder.retrieve());
121  ATH_CHECK(m_idHelperSvc.retrieve());
122  ATH_CHECK(m_mdtCreator.retrieve());
123  ATH_CHECK(m_muonClusterCreator.retrieve());
124  return StatusCode::SUCCESS;
125  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ interfaceID()

static const InterfaceID& Trk::IDetailedMuonPatternTruthBuilder::interfaceID ( )
inlinestaticinherited

Definition at line 33 of file IDetailedMuonPatternTruthBuilder.h.

33 { return IID_IDetailedMuonPatternTruthBuilder; }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::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< AlgTool >::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< AlgTool > >::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.

◆ 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< AlgTool > >::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< AlgTool > >::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  }

◆ retrieveTruthCollection()

const MuonSimDataCollection * Trk::DetailedMuonPatternTruthBuilder::retrieveTruthCollection ( const std::string &  colName)
private

Definition at line 1140 of file DetailedMuonPatternTruthBuilder.cxx.

1140  {
1141  // Retrieve SDO map for this event
1142  if (!evtStore()->contains<MuonSimDataCollection>(colName)) return nullptr;
1143 
1144  const MuonSimDataCollection* truthCol(nullptr);
1145  if (!evtStore()->retrieve(truthCol, colName).isSuccess()) {
1146  ATH_MSG_VERBOSE("Could NOT find the MuonSimDataMap map key = " << colName);
1147  } else {
1148  ATH_MSG_VERBOSE("Retrieved MuonSimDataCollection for key = " << colName);
1149  }
1150  return truthCol;
1151  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_idHelperSvc

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

Definition at line 65 of file DetailedMuonPatternTruthBuilder.h.

◆ m_mdtCreator

ToolHandle<Muon::IMdtDriftCircleOnTrackCreator> Trk::DetailedMuonPatternTruthBuilder::m_mdtCreator
private
Initial value:
{this, "MdtDriftCircleCreator",
"Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator"}

Definition at line 68 of file DetailedMuonPatternTruthBuilder.h.

◆ m_muonClusterCreator

ToolHandle<Muon::IMuonClusterOnTrackCreator> Trk::DetailedMuonPatternTruthBuilder::m_muonClusterCreator
private
Initial value:
{this, "MuonClusterCreator",
"Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackCreator"}

Definition at line 70 of file DetailedMuonPatternTruthBuilder.h.

◆ m_truthTrackBuilder

ToolHandle<Trk::ITruthTrajectoryBuilder> Trk::DetailedMuonPatternTruthBuilder::m_truthTrackBuilder {this, "TruthTrajectoryTool", "Trk::ElasticTruthTrajectoryBuilder"}
private

Definition at line 67 of file DetailedMuonPatternTruthBuilder.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
DetailedSegmentTruth
Definition: DetailedSegmentTruth.h:18
SubDetHitStatistics::SubDetType
SubDetType
Definition: SubDetHitStatistics.h:74
MuonSimData::Deposit
std::pair< HepMcParticleLink, MuonMCData > Deposit
Definition: MuonSimData.h:66
Trk::DetailedMuonPatternTruthBuilder::addTrack
void addTrack(DetailedMuonPatternTruthCollection *output, const ElementLink< DataVector< Muon::MuonPatternCombination > > &track, const std::vector< const PRD_MultiTruthCollection * > &orderedPRD_Truth, const PRD_InverseTruth &inverseTruth)
Definition: DetailedMuonPatternTruthBuilder.cxx:270
Muon::MMPrepData
Class to represent MM measurements.
Definition: MMPrepData.h:22
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
DetectorLayer::nmdtL
int nmdtL
Definition: DetailedMuonPatternTruthBuilder.cxx:66
DetectorLayer
Definition: DetailedMuonPatternTruthBuilder.cxx:58
SubDetHitStatistics::SCT
@ SCT
Definition: SubDetHitStatistics.h:74
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trk::locX
@ locX
Definition: ParamDefs.h:43
perp
Scalar perp() const
perp method - perpenticular length
Definition: AmgMatrixBasePlugin.h:35
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
DetectorLayer::nnsw
int nnsw
Definition: DetailedMuonPatternTruthBuilder.cxx:64
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
patterns
std::vector< std::string > patterns
Definition: listroot.cxx:187
SubDetHitStatistics::NUM_SUBDETECTORS
@ NUM_SUBDETECTORS
Definition: SubDetHitStatistics.h:74
SubDetHitStatistics
Definition: SubDetHitStatistics.h:34
Trk::DetailedMuonPatternTruthBuilder::m_muonClusterCreator
ToolHandle< Muon::IMuonClusterOnTrackCreator > m_muonClusterCreator
Definition: DetailedMuonPatternTruthBuilder.h:70
Trk::DetailedMuonPatternTruthBuilder::m_truthTrackBuilder
ToolHandle< Trk::ITruthTrajectoryBuilder > m_truthTrackBuilder
Definition: DetailedMuonPatternTruthBuilder.h:67
skel.it
it
Definition: skel.GENtoEVGEN.py:423
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Trk::DetailedMuonPatternTruthBuilder::addDetailedTrackTruth
void addDetailedTrackTruth(std::vector< DetailedTrackTruth > *output, const Muon::MuonPatternCombination &pattern, const std::vector< const PRD_MultiTruthCollection * > &orderedPRD_Truth, const PRD_InverseTruth &inverseTruth)
Definition: DetailedMuonPatternTruthBuilder.cxx:729
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
DetectorLayer::meas
std::vector< const Trk::MeasurementBase * > meas
Definition: DetailedMuonPatternTruthBuilder.cxx:70
SubDetHitStatistics::MM
@ MM
Definition: SubDetHitStatistics.h:74
DetectorLayer::isEndcap
bool isEndcap
Definition: DetailedMuonPatternTruthBuilder.cxx:61
Trk::locR
@ locR
Definition: ParamDefs.h:50
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DetectorLayer::maxPos
double maxPos
Definition: DetailedMuonPatternTruthBuilder.cxx:63
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::addToInverseMultiMap
void addToInverseMultiMap(InverseMultiMap< OrigMap, CmpT > *result, const OrigMap &rec2truth)
Definition: InverseMultiMap.h:50
SubDetHitStatistics::CSC
@ CSC
Definition: SubDetHitStatistics.h:74
Trk::DetailedMuonPatternTruthBuilder::addDetailedTrackTruthFromSegment
void addDetailedTrackTruthFromSegment(std::vector< DetailedSegmentTruth > *output, const Muon::MuonSegment &segment, const std::vector< const PRD_MultiTruthCollection * > &orderedPRD_Truth, const PRD_InverseTruth &inverseTruth)
Definition: DetailedMuonPatternTruthBuilder.cxx:943
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::DetailedMuonPatternTruthBuilder::findSubDetType
SubDetHitStatistics::SubDetType findSubDetType(Identifier id)
Definition: DetailedMuonPatternTruthBuilder.cxx:241
TRT::Hit::side
@ side
Definition: HitInfo.h:83
Trk::LocalParameters::get
double get(ParamDefs par) const
Retrieve specified parameter (const version).
Trk::DetailedMuonPatternTruthBuilder::m_mdtCreator
ToolHandle< Muon::IMdtDriftCircleOnTrackCreator > m_mdtCreator
Definition: DetailedMuonPatternTruthBuilder.h:68
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::DetailedMuonPatternTruthBuilder::PRD_InverseTruth
InverseMultiMap< PRD_MultiTruthCollection > PRD_InverseTruth
Definition: DetailedMuonPatternTruthBuilder.h:63
Trk::DetailedMuonPatternTruthBuilder::countPRDsOnTruth
SubDetHitStatistics countPRDsOnTruth(const TruthTrajectory &traj, const PRD_InverseTruth &inverseTruth, std::set< Muon::MuonStationIndex::ChIndex > chIndices)
Definition: DetailedMuonPatternTruthBuilder.cxx:443
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Muon::MuonStationIndex::EI
@ EI
Definition: MuonStationIndex.h:26
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
MuonSimDataCollection
Definition: MuonSimDataCollection.h:21
SubDetHitStatistics::MDT
@ MDT
Definition: SubDetHitStatistics.h:74
Trk::RIGHT
@ RIGHT
the drift radius is positive (see Trk::AtaStraightLine)
Definition: DriftCircleSide.h:22
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::TrkDetElementBase::surface
virtual const Surface & surface() const =0
Return surface associated with this detector element.
python.StandardJetMods.pull
pull
Definition: StandardJetMods.py:264
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Muon::MdtDriftCircleOnTrack::driftRadius
double driftRadius() const
Returns the value of the drift radius.
Definition: MdtDriftCircleOnTrack.h:277
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
beamspotman.dir
string dir
Definition: beamspotman.py:623
DetectorLayer::minPos
double minPos
Definition: DetailedMuonPatternTruthBuilder.cxx:62
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
merge.output
output
Definition: merge.py:17
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
TruthTrajectory
Definition: TruthTrajectory.h:26
SubDetHitStatistics::TGC
@ TGC
Definition: SubDetHitStatistics.h:74
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Muon::MdtDriftCircleOnTrack
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
Definition: MdtDriftCircleOnTrack.h:37
MuonSimData
Definition: MuonSimData.h:62
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition: MdtPrepData.h:37
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
DetailedTrackTruth
Definition: DetailedTrackTruth.h:16
Trk::RIO_OnTrack::prepRawData
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
Trk::DriftCircleSide
DriftCircleSide
Enumerates the 'side' of the wire on which the tracks passed (i.e.
Definition: DriftCircleSide.h:16
Muon::EnumDefs::BC
@ BC
Definition: MuonEnumDefs.h:13
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
DetectorLayer::last3D
Amg::Vector3D last3D
Definition: DetailedMuonPatternTruthBuilder.cxx:69
SubDetHitStatistics::RPC
@ RPC
Definition: SubDetHitStatistics.h:74
Trk::DetailedMuonPatternTruthBuilder::getPRDTruthPosition
Amg::Vector3D getPRDTruthPosition(const Muon::MuonSegment &segment, std::list< HepMC::ConstGenParticlePtr > genPartList, int truthPos, std::set< Muon::MuonStationIndex::ChIndex > chIndices)
Definition: DetailedMuonPatternTruthBuilder.cxx:465
SubDetHitStatistics::TRT
@ TRT
Definition: SubDetHitStatistics.h:74
Trk::DetailedMuonPatternTruthBuilder::getDeposit
const MuonSimData::Deposit * getDeposit(const MuonSimDataCollection &simCol, const HepMC::ConstGenParticlePtr &genPart, const Identifier &id)
Definition: DetailedMuonPatternTruthBuilder.cxx:1113
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Trk::DetailedMuonPatternTruthBuilder::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: DetailedMuonPatternTruthBuilder.h:65
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
DetectorLayer::nmdtS
int nmdtS
Definition: DetailedMuonPatternTruthBuilder.cxx:65
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
Trk::LEFT
@ LEFT
the drift radius is negative (see Trk::AtaStraightLine)
Definition: DriftCircleSide.h:20
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
simData
constexpr bool simData
Definition: constants.h:36
DetectorLayer::stIndex
Muon::MuonStationIndex::StIndex stIndex
Definition: DetailedMuonPatternTruthBuilder.cxx:60
SubDetHitStatistics::Pixel
@ Pixel
Definition: SubDetHitStatistics.h:74
Muon::sTgcPrepData
Class to represent sTgc measurements.
Definition: sTgcPrepData.h:20
SubDetHitStatistics::STGC
@ STGC
Definition: SubDetHitStatistics.h:74
DetectorLayer::first3D
Amg::Vector3D first3D
Definition: DetailedMuonPatternTruthBuilder.cxx:68
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::Surface::localToGlobal
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const =0
Specified by each surface type: LocalToGlobal method without dynamic memory allocation.
Trk::DetailedMuonPatternTruthBuilder::retrieveTruthCollection
const MuonSimDataCollection * retrieveTruthCollection(const std::string &colName)
Definition: DetailedMuonPatternTruthBuilder.cxx:1140
Muon::MuonClusterOnTrack
Base class for Muon cluster RIO_OnTracks.
Definition: MuonClusterOnTrack.h:34
fitman.k
k
Definition: fitman.py:528
GenParticle
@ GenParticle
Definition: TruthClasses.h:30
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
Trk::PrepRawData::detectorElement
virtual const TrkDetElementBase * detectorElement() const =0
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
EventInfoCnvParams::eventIndex
thread_local event_number_t eventIndex
Definition: IEvtIdModifierSvc.h:34