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

Tool to visualise muon structure, authors and content in logfile or extra dump text file, combining code from Staco/Mutag and the muon builder. More...

#include <MuonPrintingTool.h>

Inheritance diagram for Rec::MuonPrintingTool:
Collaboration diagram for Rec::MuonPrintingTool:

Public Member Functions

 MuonPrintingTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Constructor. More...
 
virtual ~MuonPrintingTool ()
 Standard destructor. More...
 
virtual StatusCode initialize ()
 Overriding initialize and finalize. More...
 
virtual StatusCode finalize ()
 end of the job - finalize More...
 
std::string print (const xAOD::Muon &muon) const
 print muon object to a string More...
 
std::string print (const xAOD::MuonContainer &muons) const
 print a muon container to a string 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 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 ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

std::string print (const xAOD::TrackParticle &tp) 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

ToolHandle< Muon::MuonEDMPrinterToolm_edmPrinter
 
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

Tool to visualise muon structure, authors and content in logfile or extra dump text file, combining code from Staco/Mutag and the muon builder.

Author
Jean-Francois Laporte, Wolfgang Liebig, Niels van Eldik

Definition at line 34 of file MuonPrintingTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuonPrintingTool()

Rec::MuonPrintingTool::MuonPrintingTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Standard Constructor.

Rec::MuonPringingTool.h, (c) ATLAS Detector software /// /// This tool creates dump output of different detail to strings/// strings or files for an Analysis::Muon or a whole collection.

/// constructor

Definition at line 24 of file MuonPrintingTool.cxx.

24  :
26  declareInterface<IMuonPrintingTool>(this);
27 }

◆ ~MuonPrintingTool()

Rec::MuonPrintingTool::~MuonPrintingTool ( )
virtual

Standard destructor.

destructor

Definition at line 30 of file MuonPrintingTool.cxx.

30 {}

Member Function Documentation

◆ 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

◆ finalize()

StatusCode Rec::MuonPrintingTool::finalize ( )
virtual

end of the job - finalize

Definition at line 42 of file MuonPrintingTool.cxx.

42  {
43  ATH_MSG_DEBUG("Nothing to finalize.");
44  return StatusCode::SUCCESS;
45 }

◆ initialize()

StatusCode Rec::MuonPrintingTool::initialize ( )
virtual

Overriding initialize and finalize.

initialization

Definition at line 33 of file MuonPrintingTool.cxx.

33  {
34  ATH_CHECK(m_edmPrinter.retrieve());
35  ATH_MSG_DEBUG("Retrieved " << m_edmPrinter);
36 
37  ATH_MSG_INFO("Initialize() successful in " << name());
38  return StatusCode::SUCCESS;
39 }

◆ 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& Rec::IMuonPrintingTool::interfaceID ( )
inlinestaticinherited

Definition at line 25 of file IMuonPrintingTool.h.

25 { return IID_IMuonPrintingTool; };

◆ 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.

◆ print() [1/3]

std::string Rec::MuonPrintingTool::print ( const xAOD::Muon muon) const
virtual

print muon object to a string

Implements Rec::IMuonPrintingTool.

Definition at line 53 of file MuonPrintingTool.cxx.

53  {
54  std::ostringstream sout;
55 
56  sout << "##### Muon, pt : " << muon.pt() << " eta : " << muon.eta() << " phi : " << muon.phi() << " mass : " << muon.m()
57  << " author " << muon.author() << " type : " << muon.muonType() << " secondary authors: ";
58  for (int a = 0; a < xAOD::Muon::NumberOfMuonAuthors; ++a) {
60  if (author != muon.author() && muon.isAuthor(author)) sout << " " << a;
61  }
62  sout << std::endl;
63 
64  sout << " ParamDef available:" << std::endl;
65  float spectrometerFieldIntegral = 0;
67  sout << " spectrometerFieldIntegral : " << spectrometerFieldIntegral << std::endl;
70  sout << " scatteringCurvatureSignificance : " << scatteringCurvatureSignificance << std::endl;
73  sout << " scatteringNeighbourSignificance : " << scatteringNeighbourSignificance << std::endl;
76  sout << " momentumBalanceSignificance : " << momentumBalanceSignificance << std::endl;
77  float segmentDeltaEta = 0;
78  if (muon.parameter(segmentDeltaEta, xAOD::Muon::segmentDeltaEta)) sout << " segmentDeltaEta : " << segmentDeltaEta << std::endl;
79  float segmentDeltaPhi = 0;
80  if (muon.parameter(segmentDeltaPhi, xAOD::Muon::segmentDeltaPhi)) sout << " segmentDeltaPhi : " << segmentDeltaPhi << std::endl;
81  float segmentChi2OverDoF = 0;
83  sout << " segmentChi2OverDoF : " << segmentChi2OverDoF << std::endl;
84  float t0 = 0;
85  if (muon.parameter(t0, xAOD::Muon::t0)) sout << " t0 : " << t0 << std::endl;
86  float beta = 0;
87  if (muon.parameter(beta, xAOD::Muon::beta)) sout << " beta : " << beta << std::endl;
88  float annBarrel = 0;
89  if (muon.parameter(annBarrel, xAOD::Muon::annBarrel)) sout << " annBarrel : " << annBarrel << std::endl;
90  float annEndCap = 0;
91  if (muon.parameter(annEndCap, xAOD::Muon::annEndCap)) sout << " annEndCap : " << annEndCap << std::endl;
92  float innAngle = 0;
93  if (muon.parameter(innAngle, xAOD::Muon::innAngle)) sout << " innAngle : " << innAngle << std::endl;
94  float midAngle = 0;
95  if (muon.parameter(midAngle, xAOD::Muon::midAngle)) sout << " midAngle : " << midAngle << std::endl;
96  float msInnerMatchChi2 = 0;
97  if (muon.parameter(msInnerMatchChi2, xAOD::Muon::msInnerMatchChi2)) sout << " msInnerMatchChi2 : " << msInnerMatchChi2 << std::endl;
98  int msInnerMatchDOF = 0;
99  if (muon.parameter(msInnerMatchDOF, xAOD::Muon::msInnerMatchDOF)) sout << " msInnerMatchDOF : " << msInnerMatchDOF << std::endl;
100  float msOuterMatchChi2 = 0;
101  if (muon.parameter(msOuterMatchChi2, xAOD::Muon::msOuterMatchChi2)) sout << " msOuterMatchChi2 : " << msOuterMatchChi2 << std::endl;
102  int msOuterMatchDOF = 0;
103  if (muon.parameter(msOuterMatchDOF, xAOD::Muon::msOuterMatchDOF)) sout << " msOuterMatchDOF : " << msOuterMatchDOF << std::endl;
104  float meanDeltaADCCountsMDT = 0;
105  if (muon.parameter(meanDeltaADCCountsMDT, xAOD::Muon::meanDeltaADCCountsMDT))
106  sout << " meanDeltaADCCountsMDT : " << meanDeltaADCCountsMDT << std::endl;
107  float CaloLRLikelihood = 0;
108  if (muon.parameter(CaloLRLikelihood, xAOD::Muon::CaloLRLikelihood)) sout << " CaloLRLikelihood : " << CaloLRLikelihood << std::endl;
109  float CaloMuonScore = 0;
110  if (muon.parameter(CaloLRLikelihood, xAOD::Muon::CaloMuonScore)) sout << " CaloMuonScore : " << CaloMuonScore << std::endl;
111  int CaloMuonIDTag = 0;
112  if (muon.parameter(CaloMuonIDTag, xAOD::Muon::CaloMuonIDTag)) sout << " CaloMuonIDTag : " << CaloMuonIDTag << std::endl;
113  float FSR_CandidateEnergy = 0;
114  if (muon.parameter(FSR_CandidateEnergy, xAOD::Muon::FSR_CandidateEnergy))
115  sout << " FSR_CandidateEnergy : " << FSR_CandidateEnergy << std::endl;
116  float EnergyLoss = 0;
117  if (muon.parameter(EnergyLoss, xAOD::Muon::EnergyLoss)) sout << " EnergyLoss : " << EnergyLoss << std::endl;
118  float ParamEnergyLoss = 0;
119  if (muon.parameter(ParamEnergyLoss, xAOD::Muon::ParamEnergyLoss)) sout << " ParamEnergyLoss : " << ParamEnergyLoss << std::endl;
120  float MeasEnergyLoss = 0;
121  if (muon.parameter(MeasEnergyLoss, xAOD::Muon::MeasEnergyLoss)) sout << " MeasEnergyLoss : " << MeasEnergyLoss << std::endl;
122  float EnergyLossSigma = 0;
123  if (muon.parameter(EnergyLossSigma, xAOD::Muon::EnergyLossSigma)) sout << " EnergyLossSigma : " << EnergyLossSigma << std::endl;
124  float ParamEnergyLossSigmaPlus = 0;
125  if (muon.parameter(ParamEnergyLossSigmaPlus, xAOD::Muon::ParamEnergyLossSigmaPlus))
126  sout << " ParamEnergyLossSigmaPlus : " << ParamEnergyLossSigmaPlus << std::endl;
127  float ParamEnergyLossSigmaMinus = 0;
128  if (muon.parameter(ParamEnergyLossSigmaMinus, xAOD::Muon::ParamEnergyLossSigmaMinus))
129  sout << " ParamEnergyLossSigmaMinus : " << ParamEnergyLossSigmaMinus << std::endl;
130  float MeasEnergyLossSigma = 0;
131  if (muon.parameter(MeasEnergyLossSigma, xAOD::Muon::MeasEnergyLossSigma))
132  sout << " MeasEnergyLossSigma : " << MeasEnergyLossSigma << std::endl;
133  uint8_t energyLossType = muon.energyLossType();
134  // if(muon.parameter(energyLossType, xAOD::Muon::EnergyLossType))
135  sout << " EnergyLossType : " << static_cast<int>(energyLossType) << std::endl;
136 
137  uint8_t nprecisionLayers = 0;
138  uint8_t nprecisionHoleLayers = 0;
139  uint8_t nphiLayers = 0;
140  uint8_t ntrigEtaLayers = 0;
141  uint8_t nphiHoleLayers = 0;
142  uint8_t ntrigEtaHoleLayers = 0;
143  uint8_t mainSector = 0;
144  uint8_t secondSector = 0;
145  if (muon.primaryTrackParticleLink().isValid()) {
146  const xAOD::TrackParticle& tp = **muon.primaryTrackParticleLink();
147  if (!tp.summaryValue(nprecisionLayers, xAOD::numberOfPrecisionLayers)) nprecisionLayers = 0;
148  if (!tp.summaryValue(nprecisionHoleLayers, xAOD::numberOfPrecisionHoleLayers)) nprecisionHoleLayers = 0;
149  if (!tp.summaryValue(nphiLayers, xAOD::numberOfPhiLayers)) nphiLayers = 0;
150  if (!tp.summaryValue(nphiHoleLayers, xAOD::numberOfPhiHoleLayers)) nphiHoleLayers = 0;
151  if (!tp.summaryValue(ntrigEtaLayers, xAOD::numberOfTriggerEtaLayers)) ntrigEtaLayers = 0;
152  if (!tp.summaryValue(ntrigEtaHoleLayers, xAOD::numberOfTriggerEtaHoleLayers)) ntrigEtaHoleLayers = 0;
153  } else
154  sout << " No valid primaryTrackParticleLink for this muon" << std::endl;
155 
156  if (!muon.summaryValue(mainSector, xAOD::primarySector)) mainSector = 0;
157  if (!muon.summaryValue(secondSector, xAOD::secondarySector)) secondSector = 0;
158  sout << " Station Layers: precision " << static_cast<int>(nprecisionLayers) << " holes " << static_cast<int>(nprecisionHoleLayers)
159  << " phi " << static_cast<int>(nphiLayers) << " holes " << static_cast<int>(nphiHoleLayers) << " trigEta "
160  << static_cast<int>(ntrigEtaLayers) << " holes " << static_cast<int>(ntrigEtaHoleLayers) << " main sector "
161  << static_cast<int>(mainSector) << " secondary " << static_cast<int>(secondSector) << std::endl;
162 
163  bool printMeasurements = true;
164 
165  if (muon.combinedTrackParticleLink().isValid()) {
166  const xAOD::TrackParticle* cbtp = *muon.combinedTrackParticleLink();
167  if (cbtp) {
168  sout << " --- Combined Muon track --- " << print(*cbtp);
169  if (!cbtp->trackLink().isValid()) {
170  sout << " No Track link";
171  ATH_MSG_DEBUG("Combined track particle without Trk::Track");
172  } else {
173  const Trk::Track* cbtr = *cbtp->trackLink();
174  if (cbtr) sout << std::endl << m_edmPrinter->printStations(*cbtr);
175  if (cbtr && printMeasurements) sout << std::endl << m_edmPrinter->printMeasurements(*cbtr);
176  }
177  sout << std::endl;
178  }
179  }
180 
181  if (muon.inDetTrackParticleLink().isValid()) {
182  const xAOD::TrackParticle* idtp = *muon.inDetTrackParticleLink();
183  if (idtp) {
184  sout << " --- InDet --- " << print(*idtp);
185 
186  if (!idtp->trackLink().isValid()) {
187  sout << " No Track link";
188  ATH_MSG_DEBUG("ID track particle without Trk::Track");
189  } else {
190  // uint8_t numberOfInnermostPixelLayerHits=0;
191  // uint8_t numberOfPixelHits=0;
192  // uint8_t numberOfSCTHits=0;
193  // uint8_t numberOfTRTHits=0;
194 
195  // if( !muon.summaryValue(numberOfInnermostPixelLayerHits,xAOD::numberOfInnermostPixelLayerHits) )
196  // numberOfInnermostPixelLayerHits = 0; if(
197  // !muon.summaryValue(numberOfPixelHits,xAOD::numberOfPixelHits) ) numberOfPixelHits = 0; if(
198  // !muon.summaryValue(numberOfSCTHits,xAOD::numberOfSCTHits) ) numberOfSCTHits = 0; if(
199  // !muon.summaryValue(numberOfTRTHits,xAOD::numberOfTRTHits) ) numberOfTRTHits = 0;
200 
201  // sout << " Hits in B Layer " << static_cast<int>(numberOfInnermostPixelLayerHits)
202  // << " Pixels " << static_cast<int>(numberOfPixelHits)
203  // << " SCT " << static_cast<int>(numberOfSCTHits)
204  // << " TRT " << static_cast<int>(numberOfTRTHits);
205  }
206  sout << std::endl;
207  }
208  }
209 
210  if (muon.extrapolatedMuonSpectrometerTrackParticleLink().isValid()) {
211  const xAOD::TrackParticle* satp = *muon.extrapolatedMuonSpectrometerTrackParticleLink();
212  if (satp) {
213  sout << " --- Extrapolated Muon track --- " << print(*satp);
214  if (!satp->trackLink().isValid()) {
215  sout << " No Track link";
216  ATH_MSG_DEBUG("Extrapolated track particle without Trk::Track");
217  } else {
218  const Trk::Track* satr = *satp->trackLink();
219  if (satr) sout << std::endl << m_edmPrinter->printStations(*satr);
220  if (satr && printMeasurements) sout << std::endl << m_edmPrinter->printMeasurements(*satr);
221  }
222  sout << std::endl;
223  }
224  }
225 
226  if (muon.muonSpectrometerTrackParticleLink().isValid()) {
227  const xAOD::TrackParticle* satp = *muon.muonSpectrometerTrackParticleLink();
228  if (satp) {
229  sout << " --- MuonSpectrometer track --- " << print(*satp);
230  if (!satp->trackLink().isValid()) {
231  sout << " No Track link";
232  ATH_MSG_DEBUG("SA track particle without Trk::Track");
233  } else {
234  const Trk::Track* satr = *satp->trackLink();
235  if (satr) sout << std::endl << m_edmPrinter->printStations(*satr);
236  if (satr && printMeasurements) sout << std::endl << m_edmPrinter->printMeasurements(*satr);
237  }
238  sout << std::endl;
239  }
240  }
241 
242  // if( !muon.muonSegments().empty() ){
243 
244  // std::vector< ElementLink< Trk::SegmentCollection > > segments = muon.muonSegments();
245  // unsigned int nseg = segments.size();
246  // sout << " --- Segments: " << nseg << std::endl;
247  // for (unsigned int i = 0; i < nseg; ++i) {
248  // const Trk::Segment* tseg = *segments[i];
249  // const Muon::MuonSegment* seg = dynamic_cast<const Muon::MuonSegment* > (tseg);
250  // sout << " " << (seg==NULL ? "not a MuonSegment!" : m_edmPrinter->print(*seg))
251  // << std::endl;
252  // }
253  // }
254 
255  return sout.str();
256 }

◆ print() [2/3]

std::string Rec::MuonPrintingTool::print ( const xAOD::MuonContainer muons) const
virtual

print a muon container to a string

Implements Rec::IMuonPrintingTool.

Definition at line 258 of file MuonPrintingTool.cxx.

258  {
259  std::ostringstream sout;
260  sout << "Muon Container Size :" << muons.size() << std::endl;
261 
262  for (const auto *m : muons) { sout << print(*m); }
263  return sout.str();
264 }

◆ print() [3/3]

std::string Rec::MuonPrintingTool::print ( const xAOD::TrackParticle tp) const
private

Definition at line 47 of file MuonPrintingTool.cxx.

47  {
48  std::ostringstream sout;
49  sout << " pt : " << tp.pt() << " eta : " << tp.eta() << " phi : " << tp.phi();
50  return sout.str();
51 }

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

◆ 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_edmPrinter

ToolHandle<Muon::MuonEDMPrinterTool> Rec::MuonPrintingTool::m_edmPrinter
private
Initial value:
{
this,
"MuonStationPrinter",
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
}

Definition at line 55 of file MuonPrintingTool.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_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:
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
xAOD::primarySector
@ primarySector
primary sector crossed by the muon
Definition: TrackingPrimitives.h:327
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
xAOD::numberOfPrecisionHoleLayers
@ numberOfPrecisionHoleLayers
layers with holes AND no hits [unit8_t].
Definition: TrackingPrimitives.h:289
Rec::MuonPrintingTool::print
std::string print(const xAOD::Muon &muon) const
print muon object to a string
Definition: MuonPrintingTool.cxx:53
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
MuonParameters::scatteringNeighbourSignificance
@ scatteringNeighbourSignificance
Definition: MuonParamDefs.h:135
xAOD::numberOfPhiHoleLayers
@ numberOfPhiHoleLayers
layers with trigger phi holes but no hits [unit8_t].
Definition: TrackingPrimitives.h:291
MuonParameters::innAngle
@ innAngle
common MuGirl and MuTag parameters
Definition: MuonParamDefs.h:148
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
ParticleTest.tp
tp
Definition: ParticleTest.py:25
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MuonParameters::segmentDeltaPhi
@ segmentDeltaPhi
Definition: MuonParamDefs.h:140
MuonParameters::annBarrel
@ annBarrel
Definition: MuonParamDefs.h:145
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
MuonParameters::momentumBalanceSignificance
@ momentumBalanceSignificance
Definition: MuonParamDefs.h:136
Rec::MuonPrintingTool::m_edmPrinter
ToolHandle< Muon::MuonEDMPrinterTool > m_edmPrinter
Definition: MuonPrintingTool.h:55
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::numberOfTriggerEtaLayers
@ numberOfTriggerEtaLayers
layers with trigger eta hits [unit8_t].
Definition: TrackingPrimitives.h:292
xAOD::numberOfTriggerEtaHoleLayers
@ numberOfTriggerEtaHoleLayers
layers with trigger eta holes but no hits [unit8_t].
Definition: TrackingPrimitives.h:293
MuonParameters::midAngle
@ midAngle
Definition: MuonParamDefs.h:149
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonParameters::segmentDeltaEta
@ segmentDeltaEta
MuTag parameters.
Definition: MuonParamDefs.h:139
test_pyathena.parent
parent
Definition: test_pyathena.py:15
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
MuonParameters::NumberOfMuonAuthors
@ NumberOfMuonAuthors
Definition: MuonParamDefs.h:69
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
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
xAOD::energyLossType
energyLossType
Definition: Muon_v1.cxx:576
MuonParameters::scatteringCurvatureSignificance
@ scatteringCurvatureSignificance
Definition: MuonParamDefs.h:134
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
xAOD::TrackParticle_v1::trackLink
const ElementLink< TrackCollection > & trackLink() const
Returns a link (which can be invalid) to the Trk::Track which was used to make this TrackParticle.
Definition: TrackParticle_v1.cxx:779
xAOD::secondarySector
@ secondarySector
secondary sector crossed by the muon (set to the primary if the muon only passed one sector)
Definition: TrackingPrimitives.h:328
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonParameters::annEndCap
@ annEndCap
Definition: MuonParamDefs.h:146
CaloCondBlobAlgs_fillNoiseFromASCII.author
string author
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:26
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
MuonParameters::segmentChi2OverDoF
@ segmentChi2OverDoF
Definition: MuonParamDefs.h:141
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
ParticleJetParams::Author
Author
Definition: ParticleJetParamDefs.h:33
xAOD::numberOfPhiLayers
@ numberOfPhiLayers
layers with a trigger phi hit [unit8_t].
Definition: TrackingPrimitives.h:290
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
MuonParameters::spectrometerFieldIntegral
@ spectrometerFieldIntegral
Discriminators and further variables.
Definition: MuonParamDefs.h:133
fitman.k
k
Definition: fitman.py:528
xAOD::numberOfPrecisionLayers
@ numberOfPrecisionLayers
layers with at least 3 hits [unit8_t].
Definition: TrackingPrimitives.h:288