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

#include <MuonAlignmentUncertTool.h>

Inheritance diagram for Muon::MuonAlignmentUncertTool:
Collaboration diagram for Muon::MuonAlignmentUncertTool:

Public Member Functions

 MuonAlignmentUncertTool (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~MuonAlignmentUncertTool ()=default
 
StatusCode initialize () override
 
float get_uncertainty (const Trk::Track *trk) const override
 IMuonAlignmentUncertTool interface: retrieve the associated uncertainties. More...
 
void get_track_state_measures (const Trk::Track *track, const Trk::TrackStateOnSurface *&id_exit, const Trk::TrackStateOnSurface *&calo_entrance, const Trk::TrackStateOnSurface *&calo_exit, const Trk::TrackStateOnSurface *&ms_entrance) const override
 Helper method to retrieve the last measurement of the ID, the first and last scatterer in the calorimeter and finally to retrieve the first measurement inside the MS. 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 ()
 AlgTool and IAlgTool interface methods. More...
 

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::function< int(const Trk::Track *trk)> make_reader (const TAxis *axis) const
 Helper function to assign the uncertainty from the Axis. More...
 
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< Trk::ITrackingVolumesSvcm_trackingVolumesSvc {this, "TrackingVolumesSvc", "TrackingVolumesSvc/TrackingVolumesSvc"}
 Volume service to. More...
 
Gaudi::Property< std::string > m_in_file
 
Gaudi::Property< std::string > m_histo_name {this, "HistoName", "", "Name of the histogram in the file"}
 
std::unique_ptr< TH1 > m_histo
 Histogram to be cached. More...
 
unsigned int m_dim
 
std::function< int(const Trk::Track *trk)> m_x_reader
 Standard functions used to read the histogram having as input a Trk::Track. More...
 
std::function< int(const Trk::Track *trk)> m_y_reader
 
std::function< int(const Trk::Track *trk)> m_z_reader
 
std::unique_ptr< const Trk::Volumem_calorimeterVolume
 
std::unique_ptr< const Trk::Volumem_indetVolume
 
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 34 of file MuonAlignmentUncertTool.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

◆ MuonAlignmentUncertTool()

Muon::MuonAlignmentUncertTool::MuonAlignmentUncertTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 27 of file MuonAlignmentUncertTool.cxx.

27  :
29  m_histo(nullptr),
30  m_dim(-1),
31  m_x_reader(make_reader(nullptr)),
32  m_y_reader(make_reader(nullptr)),
33  m_z_reader(make_reader(nullptr)),
34  m_calorimeterVolume(nullptr),
35  m_indetVolume(nullptr) {}

◆ ~MuonAlignmentUncertTool()

Muon::MuonAlignmentUncertTool::~MuonAlignmentUncertTool ( )
default

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

◆ get_track_state_measures()

void Muon::MuonAlignmentUncertTool::get_track_state_measures ( const Trk::Track track,
const Trk::TrackStateOnSurface *&  id_exit,
const Trk::TrackStateOnSurface *&  calo_entrance,
const Trk::TrackStateOnSurface *&  calo_exit,
const Trk::TrackStateOnSurface *&  ms_entrance 
) const
overridevirtual

Helper method to retrieve the last measurement of the ID, the first and last scatterer in the calorimeter and finally to retrieve the first measurement inside the MS.

Try to find the calorimeter entrance and leaving points

inside muon system

Implements Muon::IMuonAlignmentUncertTool.

Definition at line 219 of file MuonAlignmentUncertTool.cxx.

222  {
223  id_exit = calo_entrance = calo_exit = ms_entrance = nullptr;
224  if (!track) {
225  ATH_MSG_DEBUG("No track has been given. Where is my track?!");
226  return;
227  }
228  for (const Trk::TrackStateOnSurface* trk_srf : *track->trackStateOnSurfaces()) {
229  if (!trk_srf->trackParameters()) { continue; }
230  if (m_indetVolume->inside(trk_srf->trackParameters()->position())) {
231  if (trk_srf->type(Trk::TrackStateOnSurface::Measurement)) id_exit = trk_srf;
232  continue;
233  }
235  if (m_calorimeterVolume->inside(trk_srf->trackParameters()->position())) {
236  // first scattering plane in Calorimeter
237  if (trk_srf->type(Trk::TrackStateOnSurface::Scatterer) && trk_srf->materialEffectsOnTrack()) {
238  if (trk_srf->materialEffectsOnTrack()->thicknessInX0() < 10) { continue; }
239  if (!calo_entrance) {
240  calo_entrance = trk_srf;
241  } else {
242  calo_exit = trk_srf;
243  }
244  }
245  }
247  else if (trk_srf->measurementOnTrack()) {
248  ms_entrance = trk_srf;
249  break;
250  }
251  }
252  }

◆ get_uncertainty()

float Muon::MuonAlignmentUncertTool::get_uncertainty ( const Trk::Track trk) const
overridevirtual

IMuonAlignmentUncertTool interface: retrieve the associated uncertainties.

The second and third arguments of the GetBin method are 0 as default

Implements Muon::IMuonAlignmentUncertTool.

Definition at line 64 of file MuonAlignmentUncertTool.cxx.

64  {
65  if (!trk) {
66  ATH_MSG_ERROR("No track has been given. Return FLT_MAX");
67  return FLT_MAX;
68  }
69  const int bin_x = m_x_reader(trk);
72  const int bin_y = m_dim > 1 ? m_y_reader(trk) : 0;
73  const int bin_z = m_dim > 2 ? m_z_reader(trk) : 0;
74  return m_histo->GetBinContent(bin_x, bin_y, bin_z);
75  }

◆ initialize()

StatusCode Muon::MuonAlignmentUncertTool::initialize ( )
override

Open the TFile

Read the histogram from the file

Set the dimension and the readers to be used

Definition at line 36 of file MuonAlignmentUncertTool.cxx.

36  {
38  std::unique_ptr<TFile> r_file(TFile::Open(PathResolverFindCalibFile(m_in_file).c_str(), "READ"));
39  if (!r_file || !r_file->IsOpen()) {
40  ATH_MSG_FATAL("No such file or directory " << m_in_file);
41  return StatusCode::FAILURE;
42  }
44  TH1* histo_in_file = nullptr;
45  r_file->GetObject(m_histo_name.value().c_str(), histo_in_file);
46  m_histo = std::unique_ptr<TH1>(histo_in_file);
47  if (!m_histo) {
48  ATH_MSG_FATAL("File " << m_in_file << " does not contain the histogram " << m_histo_name << ".");
49  return StatusCode::FAILURE;
50  }
51  m_histo->SetDirectory(nullptr);
53  m_dim = m_histo->GetDimension();
54  m_x_reader = make_reader(m_histo->GetXaxis());
55  m_y_reader = make_reader(m_histo->GetYaxis());
56  m_z_reader = make_reader(m_histo->GetZaxis());
57 
58  ATH_CHECK(m_trackingVolumesSvc.retrieve());
60  std::make_unique<Trk::Volume>(m_trackingVolumesSvc->volume(Trk::ITrackingVolumesSvc::MuonSpectrometerEntryLayer));
62  return StatusCode::SUCCESS;
63  }

◆ 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& Muon::IMuonAlignmentUncertTool::interfaceID ( )
inlinestaticinherited

AlgTool and IAlgTool interface methods.

Definition at line 32 of file IMuonAlignmentUncertTool.h.

32 { return IID_IMuonAlignmentUncertTool; }

◆ make_reader()

std::function< int(const Trk::Track *trk)> Muon::MuonAlignmentUncertTool::make_reader ( const TAxis *  axis) const
private

Helper function to assign the uncertainty from the Axis.

Assignment is based on the title of the axis

Dummy function just returning 0 if no axis is given

Definition at line 76 of file MuonAlignmentUncertTool.cxx.

76  {
78  if (!axis) {
79  return [](const Trk::Track*) { return 0; };
80  }
81  std::string axis_title = axis->GetTitle();
82  if (axis_title == "#eta" || axis_title == "eta") {
83  return [axis](const Trk::Track* trk) {
84  const Trk::Perigee* perigee = trk->perigeeParameters();
85  return axis->FindBin(perigee->eta());
86  };
87  } else if (axis_title == "|#eta|" || axis_title == "abseta") {
88  return [axis](const Trk::Track* trk) {
89  const Trk::Perigee* perigee = trk->perigeeParameters();
90  return axis->FindBin(std::abs(perigee->eta()));
91  };
92  } else if (axis_title == "#phi" || axis_title == "phi") {
93  return [axis](const Trk::Track* trk) {
94  const Trk::Perigee* perigee = trk->perigeeParameters();
95  return axis->FindBin(perigee->parameters()[2]);
96  };
97  } else if (axis_title == "|#phi|" || axis_title == "absphi") {
98  return [axis](const Trk::Track* trk) {
99  const Trk::Perigee* perigee = trk->perigeeParameters();
100  return axis->FindBin(std::abs(perigee->parameters()[2]));
101  };
102  } else if (axis_title == "#theta" || axis_title == "theta") {
103  return [axis](const Trk::Track* trk) {
104  const Trk::Perigee* perigee = trk->perigeeParameters();
105  return axis->FindBin(perigee->parameters()[3]);
106  };
107  } else if (axis_title == "|#theta|" || axis_title == "abstheta") {
108  return [axis](const Trk::Track* trk) {
109  const Trk::Perigee* perigee = trk->perigeeParameters();
110  return axis->FindBin(std::abs(perigee->parameters()[3]));
111  };
112  } else if (axis_title == "p_{T}" || axis_title == "pT") {
113  return [axis](const Trk::Track* trk) {
114  const Trk::Perigee* perigee = trk->perigeeParameters();
115  return axis->FindBin(perigee->pT());
116  };
117  } else if (axis_title == "p_{T} [GeV]" || axis_title == "pTinGeV") {
118  return [axis](const Trk::Track* trk) {
119  const Trk::Perigee* perigee = trk->perigeeParameters();
120  return axis->FindBin(perigee->pT() * MeVtoGeV);
121  };
122  } else if (axis_title == "#rho @ ID-exit") {
123  return [axis, this](const Trk::Track* trk) {
124  const Trk::TrackStateOnSurface* id_exit;
126  get_track_state_measures(trk, id_exit, dummy, dummy, dummy);
127  return axis->FindBin(id_exit->trackParameters()->position().perp());
128  };
129  } else if (axis_title == "R @ ID-exit") {
130  return [axis, this](const Trk::Track* trk) {
131  const Trk::TrackStateOnSurface* id_exit;
133  get_track_state_measures(trk, id_exit, dummy, dummy, dummy);
134  return axis->FindBin(id_exit->trackParameters()->position().mag());
135  };
136  } else if (axis_title == "z @ ID-exit") {
137  return [axis, this](const Trk::Track* trk) {
138  const Trk::TrackStateOnSurface* id_exit;
140  get_track_state_measures(trk, id_exit, dummy, dummy, dummy);
141  return axis->FindBin(id_exit->trackParameters()->position()[2]);
142  };
143  } else if (axis_title == "#rho @ Calo-entrance") {
144  return [axis, this](const Trk::Track* trk) {
145  const Trk::TrackStateOnSurface* calo_entrance;
147  get_track_state_measures(trk, dummy, calo_entrance, dummy, dummy);
148  return axis->FindBin(calo_entrance->trackParameters()->position().perp());
149  };
150  } else if (axis_title == "R @ Calo-entrance") {
151  return [axis, this](const Trk::Track* trk) {
152  const Trk::TrackStateOnSurface* calo_entrance;
154  get_track_state_measures(trk, dummy, calo_entrance, dummy, dummy);
155  return axis->FindBin(calo_entrance->trackParameters()->position().mag());
156  };
157  } else if (axis_title == "z @ Calo-entrance") {
158  return [axis, this](const Trk::Track* trk) {
159  const Trk::TrackStateOnSurface* calo_entrance;
161  get_track_state_measures(trk, dummy, calo_entrance, dummy, dummy);
162  return axis->FindBin(calo_entrance->trackParameters()->position()[2]);
163  };
164  } else if (axis_title == "#rho @ Calo-centre") {
165  return [axis, this](const Trk::Track* trk) {
166  const Trk::TrackStateOnSurface* calo_entrance;
167  const Trk::TrackStateOnSurface* calo_exit;
169  get_track_state_measures(trk, dummy, calo_entrance, calo_exit, dummy);
170  const Amg::Vector3D calo_centre =
171  0.5 * (calo_entrance->trackParameters()->position() + calo_exit->trackParameters()->position());
172  return axis->FindBin(calo_centre.perp());
173  };
174  } else if (axis_title == "R @ Calo-centre") {
175  return [axis, this](const Trk::Track* trk) {
176  const Trk::TrackStateOnSurface* calo_entrance;
177  const Trk::TrackStateOnSurface* calo_exit;
179  get_track_state_measures(trk, dummy, calo_entrance, calo_exit, dummy);
180  const Amg::Vector3D calo_centre =
181  0.5 * (calo_entrance->trackParameters()->position() + calo_exit->trackParameters()->position());
182  return axis->FindBin(calo_centre.mag());
183  };
184  } else if (axis_title == "z @ Calo-centre") {
185  return [axis, this](const Trk::Track* trk) {
186  const Trk::TrackStateOnSurface* calo_entrance;
187  const Trk::TrackStateOnSurface* calo_exit;
189  get_track_state_measures(trk, dummy, calo_entrance, calo_exit, dummy);
190  const Amg::Vector3D calo_centre =
191  0.5 * (calo_entrance->trackParameters()->position() + calo_exit->trackParameters()->position());
192  return axis->FindBin(calo_centre[2]);
193  };
194  } else if (axis_title == "#rho @ MS-entrance") {
195  return [axis, this](const Trk::Track* trk) {
196  const Trk::TrackStateOnSurface* ms_entrance;
198  get_track_state_measures(trk, dummy, dummy, dummy, ms_entrance);
199  return axis->FindBin(ms_entrance->trackParameters()->position().perp());
200  };
201  } else if (axis_title == "R @ MS-entrance") {
202  return [axis, this](const Trk::Track* trk) {
203  const Trk::TrackStateOnSurface* ms_entrance;
205  get_track_state_measures(trk, dummy, dummy, dummy, ms_entrance);
206  return axis->FindBin(ms_entrance->trackParameters()->position().mag());
207  };
208  } else if (axis_title == "z @ MS-entrance") {
209  return [axis, this](const Trk::Track* trk) {
210  const Trk::TrackStateOnSurface* ms_entrance;
212  get_track_state_measures(trk, dummy, dummy, dummy, ms_entrance);
213  return axis->FindBin(ms_entrance->trackParameters()->position()[2]);
214  };
215  }
216  return make_reader(nullptr);
217  }

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

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

std::unique_ptr<const Trk::Volume> Muon::MuonAlignmentUncertTool::m_calorimeterVolume
private

Definition at line 73 of file MuonAlignmentUncertTool.h.

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

unsigned int Muon::MuonAlignmentUncertTool::m_dim
private

Definition at line 66 of file MuonAlignmentUncertTool.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_histo

std::unique_ptr<TH1> Muon::MuonAlignmentUncertTool::m_histo
private

Histogram to be cached.

Definition at line 65 of file MuonAlignmentUncertTool.h.

◆ m_histo_name

Gaudi::Property<std::string> Muon::MuonAlignmentUncertTool::m_histo_name {this, "HistoName", "", "Name of the histogram in the file"}
private

Definition at line 62 of file MuonAlignmentUncertTool.h.

◆ m_in_file

Gaudi::Property<std::string> Muon::MuonAlignmentUncertTool::m_in_file
private
Initial value:
{this, "InFile",
"MuonCombinedBaseTools/AlignmentUncertainties/201029_initial/ID_MS_Uncertainties.root",
"Location of the calibration file"}

Definition at line 59 of file MuonAlignmentUncertTool.h.

◆ m_indetVolume

std::unique_ptr<const Trk::Volume> Muon::MuonAlignmentUncertTool::m_indetVolume
private

Definition at line 74 of file MuonAlignmentUncertTool.h.

◆ m_trackingVolumesSvc

ServiceHandle<Trk::ITrackingVolumesSvc> Muon::MuonAlignmentUncertTool::m_trackingVolumesSvc {this, "TrackingVolumesSvc", "TrackingVolumesSvc/TrackingVolumesSvc"}
private

Volume service to.

Definition at line 57 of file MuonAlignmentUncertTool.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.

◆ m_x_reader

std::function<int(const Trk::Track* trk)> Muon::MuonAlignmentUncertTool::m_x_reader
private

Standard functions used to read the histogram having as input a Trk::Track.

Definition at line 69 of file MuonAlignmentUncertTool.h.

◆ m_y_reader

std::function<int(const Trk::Track* trk)> Muon::MuonAlignmentUncertTool::m_y_reader
private

Definition at line 70 of file MuonAlignmentUncertTool.h.

◆ m_z_reader

std::function<int(const Trk::Track* trk)> Muon::MuonAlignmentUncertTool::m_z_reader
private

Definition at line 71 of file MuonAlignmentUncertTool.h.


The documentation for this class was generated from the following files:
Trk::TrackStateOnSurface::trackParameters
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Muon::MuonAlignmentUncertTool::m_x_reader
std::function< int(const Trk::Track *trk)> m_x_reader
Standard functions used to read the histogram having as input a Trk::Track.
Definition: MuonAlignmentUncertTool.h:69
Muon::MuonAlignmentUncertTool::m_trackingVolumesSvc
ServiceHandle< Trk::ITrackingVolumesSvc > m_trackingVolumesSvc
Volume service to.
Definition: MuonAlignmentUncertTool.h:57
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Muon::MuonAlignmentUncertTool::m_z_reader
std::function< int(const Trk::Track *trk)> m_z_reader
Definition: MuonAlignmentUncertTool.h:71
yodamerge_tmp.axis
list axis
Definition: yodamerge_tmp.py:241
Trk::ITrackingVolumesSvc::MuonSpectrometerEntryLayer
@ MuonSpectrometerEntryLayer
Tracking Volume which defines the entrance surfaces of the MS.
Definition: ITrackingVolumesSvc.h:41
CP::MeVtoGeV
constexpr float MeVtoGeV
Definition: IsolationCloseByCorrectionTool.cxx:33
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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Muon::MuonAlignmentUncertTool::m_y_reader
std::function< int(const Trk::Track *trk)> m_y_reader
Definition: MuonAlignmentUncertTool.h:70
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
python.xAODType.dummy
dummy
Definition: xAODType.py:4
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
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
Trk::ITrackingVolumesSvc::CalorimeterEntryLayer
@ CalorimeterEntryLayer
Tracking Volume which defines the entrance srufaces of the calorimeter.
Definition: ITrackingVolumesSvc.h:40
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
Muon::MuonAlignmentUncertTool::make_reader
std::function< int(const Trk::Track *trk)> make_reader(const TAxis *axis) const
Helper function to assign the uncertainty from the Axis.
Definition: MuonAlignmentUncertTool.cxx:76
Muon::MuonAlignmentUncertTool::m_histo
std::unique_ptr< TH1 > m_histo
Histogram to be cached.
Definition: MuonAlignmentUncertTool.h:65
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Muon::MuonAlignmentUncertTool::m_calorimeterVolume
std::unique_ptr< const Trk::Volume > m_calorimeterVolume
Definition: MuonAlignmentUncertTool.h:73
Muon::MuonAlignmentUncertTool::m_histo_name
Gaudi::Property< std::string > m_histo_name
Definition: MuonAlignmentUncertTool.h:62
CheckAppliedSFs.axis_title
axis_title
Definition: CheckAppliedSFs.py:241
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
Muon::MuonAlignmentUncertTool::m_in_file
Gaudi::Property< std::string > m_in_file
Definition: MuonAlignmentUncertTool.h:59
Muon::MuonAlignmentUncertTool::m_dim
unsigned int m_dim
Definition: MuonAlignmentUncertTool.h:66
a
TList * a
Definition: liststreamerinfos.cxx:10
h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Trk::TrackStateOnSurface::Scatterer
@ Scatterer
This represents a scattering point on the track, and so will contain TrackParameters and MaterialEffe...
Definition: TrackStateOnSurface.h:113
Muon::MuonAlignmentUncertTool::get_track_state_measures
void get_track_state_measures(const Trk::Track *track, const Trk::TrackStateOnSurface *&id_exit, const Trk::TrackStateOnSurface *&calo_entrance, const Trk::TrackStateOnSurface *&calo_exit, const Trk::TrackStateOnSurface *&ms_entrance) const override
Helper method to retrieve the last measurement of the ID, the first and last scatterer in the calorim...
Definition: MuonAlignmentUncertTool.cxx:219
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
Muon::MuonAlignmentUncertTool::m_indetVolume
std::unique_ptr< const Trk::Volume > m_indetVolume
Definition: MuonAlignmentUncertTool.h:74
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
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::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
fitman.k
k
Definition: fitman.py:528