ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MuonR4::SegmentActsRefitAlg Class Reference

#include <SegmentActsRefitAlg.h>

Inheritance diagram for MuonR4::SegmentActsRefitAlg:
Collaboration diagram for MuonR4::SegmentActsRefitAlg:

Public Member Functions

virtual StatusCode initialize () override final
 
virtual StatusCode execute (const EventContext &ctx) const override final
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

std::tuple< Amg::Vector3D, Amg::Vector3DsmearSegment (const ActsTrk::GeometryContext &gctx, const MuonR4::Segment &segment, CLHEP::HepRandomEngine *engine) const
 Smear the segment's position and direction by one sigma defined by the segment's covariance. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKey< xAOD::MuonSegmentContainerm_readKey {this, "SegmentContainer", "MuonSegmentsFromR4"}
 Declare the data dependency on the standard Mdt+Rpc+Tgc segment container. More...
 
SG::WriteHandleKey< xAOD::MuonSegmentContainerm_writeKey {this, "OutContainer", "ActsRefitSegments"}
 Declare the key for the refitted segment container. More...
 
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainerm_linkKey {this, "LinkKey", m_writeKey, "prefitSegmentLink"}
 Construct a link from the refitted segment to the input segment. More...
 
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainerm_localParsKey {this, "LocalParsKey", m_writeKey, "localSegPars"}
 Decorate directly the local segment parameters on to the object. More...
 
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainerm_seedParsKey {this, "SeedParsKey", m_readKey, "seedSegPars"}
 Decorate the seed parameters entering the fit. More...
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 IdHelperSvc to decode the Identifiers. More...
 
ToolHandle< ActsTrk::IFitterToolm_trackFitTool {this, "FittingTool", ""}
 Track fitting tool. More...
 
PublicToolHandle< ActsTrk::ITrackingGeometryToolm_trackingGeometryTool {this, "TrackingGeometryTool", ""}
 Tracking geometry tool. More...
 
ToolHandle< ActsTrk::IExtrapolationToolm_extrapolationTool {this, "ExtrapolationTool" ,"" }
 Track extrapolation tool. More...
 
ToolHandle< MuonR4::ISegmentSelectionToolm_segSelector {this, "SegmentSelectionTool" , "" }
 Segment selection tool to pick the good quality segments. More...
 
ServiceHandle< IAthRNGSvcm_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""}
 Range service to smear the segment parameters. More...
 
Gaudi::Property< double > m_smearRange {this, "SmearRange", 1.}
 Smear interval in terms of standard deviations. More...
 
SG::WriteHandleKey< xAOD::TrackSurfaceContainerm_surfKey {this, "SurfaceKey", "RefitSegmentSurf"}
 Key to setup a surface container for the external constraints. More...
 
Gaudi::Property< bool > m_drawEvent {this , "drawEvent", false }
 Dump the segment line in obj files. More...
 
ActsTrk::AuxiliaryMeasurementHandler m_auxMeasProv {this}
 
const MuonGMR4::MuonDetectorManagerm_detMgr {nullptr}
 Detector manager to access the spectrometer sector surfaces. More...
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
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 32 of file SegmentActsRefitAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64 {
65  return 0;
66 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > &  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< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode MuonR4::SegmentActsRefitAlg::execute ( const EventContext &  ctx) const
finaloverridevirtual

Create the context object

Random engine to smear the segment parameters

Loop over the segment container

Fetch a smeared segment position & direction

Decorate the initial seed parameters to the segment

Fetch the measurements

We add two pseudo measurements above & beneath the segment to stabilize the fit

Draw the reference segment as a red line

Construct the reference surface before the first measurement

Reference position of the surface.

Plane surface

Fetch the measurements from the track state

Direction is always expressed in global frame -> transform to local

Express the parameters at the reference surface of the original segment

Straight line extension to plane

Definition at line 110 of file SegmentActsRefitAlg.cxx.

110  {
111 
112  const xAOD::MuonSegmentContainer* segments{nullptr};
113  ATH_CHECK(SG::get(segments, m_readKey, ctx));
115  const ActsTrk::GeometryContext& gctx{m_trackingGeometryTool->getGeometryContext(ctx)};
116  const Acts::GeometryContext tgContext = gctx.context();
117  const Acts::MagneticFieldContext mfContext = m_extrapolationTool->getMagneticFieldContext(ctx);
118  const Acts::CalibrationContext calContext = ActsTrk::getCalibrationContext(ctx);
119 
121  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, name());
122  rngWrapper->setSeed(name(), ctx);
123  CLHEP::HepRandomEngine* randEngine = rngWrapper->getEngine(ctx);
124 
125  SG::WriteHandle outHandle{m_writeKey, ctx};
126  ATH_CHECK(outHandle.record(std::make_unique<xAOD::MuonSegmentContainer>(),
127  std::make_unique<xAOD::MuonSegmentAuxContainer>()));
128 
129  SG::WriteHandle surfaceHandle{m_surfKey, ctx};
130  ATH_CHECK(surfaceHandle.record(std::make_unique<xAOD::TrackSurfaceContainer>(),
131  std::make_unique<xAOD::TrackStateAuxContainer>()));
132 
134  auto auxMeasHandle = m_auxMeasProv.makeHandle(ctx, *surfaceHandle);
135 
139  xAOD::MeasVector<Acts::toUnderlying(ParamDefs::nPars)>>;
140 
141  ParDecor_t dec_locPars{m_localParsKey, ctx};
142  ParDecor_t dec_seedPars{m_seedParsKey, ctx};
143 
144  Acts::ObjVisualization3D visualHelper{};
145 
147  for (const xAOD::MuonSegment* reFitMe: *segments){
148  const auto msSector = m_detMgr->getSectorEnvelope(reFitMe->chamberIndex(),
149  reFitMe->sector(),
150  reFitMe->etaIndex());
151  const Amg::Transform3D& sectorTrf{msSector->localToGlobalTrans(gctx)};
152 
154  const auto [seedPos, seedDir] = smearSegment(gctx, *MuonR4::detailedSegment(*reFitMe), randEngine);
156  {
157  auto invTrf = sectorTrf.inverse();
158  const Amg::Vector3D locSeedPos = invTrf * seedPos;
159  const Amg::Vector3D locSeedDir = invTrf.linear() * seedDir;
160  auto& seedPars = dec_seedPars(*reFitMe);
161  seedPars[Acts::toUnderlying(ParamDefs::x0)] = locSeedPos.x();
162  seedPars[Acts::toUnderlying(ParamDefs::y0)] = locSeedPos.y();
163  seedPars[Acts::toUnderlying(ParamDefs::theta)] = locSeedDir.theta();
164  seedPars[Acts::toUnderlying(ParamDefs::phi)] = locSeedDir.phi();
165  }
166 
167  const GeoTrf::CoordEulerAngles sectorAngles = GeoTrf::getCoordRotationAngles(sectorTrf);
169  std::vector<const xAOD::UncalibratedMeasurement*> startMeas = MuonR4::collectMeasurements(*reFitMe);
170 
171  const auto* refMeas = startMeas.front();
172 
173  const Amg::Vector3D firstSurfPos{surfAcc.get(refMeas)->transform(tgContext).translation()};
174 
175  if (reFitMe->nPhiLayers() < 1) {
176  ATH_MSG_VERBOSE("Skip phi layer free segment");
177  continue;
178  const Amg::Vector3D planeNormal = sectorTrf.linear().col(2);
179 
180  const Amg::Vector3D lastSurfPos = surfAcc.get(startMeas.back())->transform(tgContext).translation();
182 
183  const Amg::Transform3D trfBeneath = GeoTrf::GeoTransformRT{sectorAngles, firstSurfPos - pseudoSurfDist * planeNormal};
184  const Amg::Transform3D trfAbove = GeoTrf::GeoTransformRT{sectorAngles, lastSurfPos + pseudoSurfDist * planeNormal};
185 
186  auto surfBeneath = Acts::Surface::makeShared<Acts::PlaneSurface>(trfBeneath);
187  auto surfAbove = Acts::Surface::makeShared<Acts::PlaneSurface>(trfAbove);
188  const double covVal = std::pow(1.*Gaudi::Units::cm, 2);
189  startMeas.insert(startMeas.begin(), auxMeasHandle.newMeasurement<1>(surfBeneath, ProjectorType::e1DimNoTime, AmgSymMatrix(1){covVal}));
190  startMeas.insert(startMeas.end(), auxMeasHandle.newMeasurement<1>(surfAbove, ProjectorType::e1DimNoTime, AmgSymMatrix(1){covVal}));
191 
192  }
193  if (m_drawEvent) {
195  MuonValR4::drawSegmentLine(gctx, *reFitMe, visualHelper,
196  Acts::ViewConfig{.color = {220, 0, 0}});
197  MuonValR4::drawSegmentMeasurements(gctx, *reFitMe, visualHelper, Acts::s_viewSurface);
198  }
199  //else if (const auto& firstMeas = reFitMe->measurements().front(); firstMeas->type() == xAOD::UncalibMeasType::Other) {
200  // auto pseudoSurf = Acts::Surface::makeShared<Acts::PlaneSurface>(
201  // GeoTrf::GeoTransformRT{sectorAngles, Amg::Vector3D::Zero()});
202  // startMeas.insert(startMeas.begin(), auxMeasHandle.newMeasurement<2>(pseudoSurf, ProjectorType::e2DimNoTime, AmgSymMatrix(2)::Identity()));
203  //}
204 
206  const Amg::Vector3D trfZ = sectorTrf.linear().col(2);
207  const double extDist = Amg::intersect<3>(seedPos, seedDir, trfZ,
208  firstSurfPos.dot(trfZ) - 10.*Gaudi::Units::cm).value_or(0.);
209  // const double extDist = dir.dot(firstSurfPos - pos) - 5.*Gaudi::Units::cm;
211  const Amg::Vector3D refPos = seedPos + extDist * seedDir;
212  const Amg::Transform3D trf{GeoTrf::GeoTransformRT{sectorAngles, refPos}};
213  if (msgLvl(MSG::VERBOSE)) {
214  const auto [locPos, locDir] = makeLine(localSegmentPars(*reFitMe));
215 
216  std::stringstream sstr{};
217  sstr<<"pos: "<<Amg::toString(seedPos)<<", dir: "<<Amg::toString(seedDir)<<", chi2/nDoF: "
218  <<reFitMe->chiSquared() / reFitMe->numberDoF()<<", nDoF: "<<reFitMe->numberDoF()<<", "
219  <<reFitMe->nPrecisionHits()<<", "<<reFitMe->nPhiLayers()<<std::endl;
220  for (const auto& meas : MuonR4::detailedSegment(*reFitMe)->measurements()) {
221  sstr<<" **** "<<(*meas)<<", chi2: "<<SeedingAux::chi2Term(locPos, locDir, *meas)
222  <<", sign: "<<(meas->isStraw() ?
223  (SeedingAux::strawSign(locPos,locDir, *meas) == 1 ? "R" : "L") : "-")
224  <<", geoId: "<<(meas->spacePoint() ? surfAcc.get(meas->spacePoint()->primaryMeasurement())->geometryId()
225  : Acts::GeometryIdentifier{})<<std::endl;
226  }
227 
228  sstr<<" Target surf: "<<Amg::toString(trf)<<", firstSurf: "<< Amg::toString(trf.inverse()*firstSurfPos)
229  <<", refPoint: "<<Amg::toString(trf.inverse()*refPos)<<std::endl;
230  ATH_MSG_VERBOSE("Run G2F fit on "<<msSector->identString()<<std::endl<<sstr.str());
231  }
233  auto target = Acts::Surface::makeShared<Acts::PlaneSurface>(trf);
234 
235  auto fourPos{ActsTrk::convertPosToActs(refPos, refPos.mag() / Gaudi::Units::c_light)};
236  Acts::BoundMatrix initialCov{Acts::BoundMatrix::Identity()};
237 
238  auto initialPars = Acts::BoundTrackParameters::create(tgContext, target, fourPos, seedDir, straightQoverP,
239  initialCov, Acts::ParticleHypothesis::muon());
240  if (!initialPars.ok()) {
241  ATH_MSG_WARNING("Initial estimate of the parameters failed");
242  continue;
243  }
244  if (m_drawEvent) {
245  MuonValR4::drawBoundParameters(gctx, *initialPars, visualHelper,
246  Acts::ViewConfig{.color={0,220,0}});
247  }
248  ATH_MSG_ALWAYS("Initial parameters "<<Amg::toString((*initialPars).parameters()));
249  auto fitTraject = m_trackFitTool->fit(startMeas, *initialPars,
250  tgContext, mfContext, calContext, target.get());
251  if (!fitTraject) {
252  ATH_MSG_WARNING("Track fit failed.");
253  if (m_drawEvent) {
254  visualHelper.write(std::format("SegmentReFitTest_failed_{:}_{:}_{:}.obj",
255  ctx.eventID().event_number(), reFitMe->index(),
256  MuonR4::printID(*reFitMe)));
257  }
258  continue;
259  }
260 
261  auto track = fitTraject->getTrack(0);
262  ATH_MSG_DEBUG("Track fit succeeded. ");
263 
266  std::vector<const xAOD::UncalibratedMeasurement*> goodMeas{};
267  unsigned int itr{0};
268  fitTraject->trackStateContainer().visitBackwards(track.tipIndex(),[&](const auto& state){
269  if (!state.hasUncalibratedSourceLink()){
270  return;
271  }
272  goodMeas.insert(goodMeas.begin(),
273  ActsTrk::detail::xAODUncalibMeasCalibrator::unpack(state.getUncalibratedSourceLink()));
274  ATH_MSG_VERBOSE("Loop over track state: "<<(itr++)<<", "<<m_idHelperSvc->toString(xAOD::identify(goodMeas.front()))
275  <<", id: "<<surfAcc.get(goodMeas.front())->geometryId());
276 
277  const xAOD::UncalibratedMeasurement* m = goodMeas.front();
278  summary.nPrecHits += (m->type() == xAOD::UncalibMeasType::MdtDriftCircleType);
279  if (m->type() == xAOD::UncalibMeasType::Other) {
280  }
281  else if (m_idHelperSvc->measuresPhi(xAOD::identify(m))){
282  ++summary.nPhiHits;
283  } else {
284  summary.nEtaTrigHits += (m->type() != xAOD::UncalibMeasType::MdtDriftCircleType);
285  }
286  });
287 
288  Acts::BoundTrackParameters parameters = track.createParametersAtReference();
289  if (m_drawEvent) {
290  MuonValR4::drawBoundParameters(gctx, parameters, visualHelper,
291  Acts::ViewConfig{.color={0, 0, 220}});
292 
293  visualHelper.write(std::format("SegmentReFitTest_goodone_{:}_{:}_{:}.obj",
294  ctx.eventID().event_number(), reFitMe->index(),
295  MuonR4::printID(*reFitMe)));
296  }
298  const Amg::Vector3D globDir = parameters.direction();
300  const Amg::Transform3D globToLoc{sectorTrf.inverse()};
301  const Amg::Vector3D refitPos = globToLoc * parameters.position(tgContext);
302  const Amg::Vector3D refitDir = globToLoc.linear() * globDir;
304  const Amg::Vector3D refitSeg = refitPos + Amg::intersect<3>(refitPos, refitDir, Amg::Vector3D::UnitZ(), 0).value_or(0.) * refitDir;
305  const Amg::Vector3D globPos{msSector->localToGlobalTrans(gctx) * refitSeg};
306 
307  auto newSegment = outHandle->push_back(std::make_unique<xAOD::MuonSegment>());
308  dec_segLink(*newSegment) = Link_t{*segments, reFitMe->index(), ctx};
309 
310  newSegment->setDirection(globDir.x(), globDir.y(), globDir.z());
311  newSegment->setPosition(globPos.x(), globPos.y(), globPos.z());
312 
313  newSegment->setFitQuality(track.chi2(), track.nDoF());
314  newSegment->setNHits(summary.nPrecHits, summary.nPhiHits, summary.nEtaTrigHits);
315  auto& locFitPars = dec_locPars(*newSegment);
316  locFitPars[Acts::toUnderlying(ParamDefs::x0)] = refitSeg.x();
317  locFitPars[Acts::toUnderlying(ParamDefs::y0)] = refitSeg.y();
318  locFitPars[Acts::toUnderlying(ParamDefs::theta)] = refitDir.theta();
319  locFitPars[Acts::toUnderlying(ParamDefs::phi)] = refitDir.phi();
320  }
321  return StatusCode::SUCCESS;
322  }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90 {
91  // If we didn't find any symlinks to add, just return the collection
92  // from the base class. Otherwise, return the extended collection.
93  if (!m_extendedExtraObjects.empty()) {
95  }
96  return BaseAlg::extraOutputDeps();
97 }

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96  {
97  return execState( ctx ).filterPassed();
98  }

◆ initialize()

StatusCode MuonR4::SegmentActsRefitAlg::initialize ( )
finaloverridevirtual

Definition at line 39 of file SegmentActsRefitAlg.cxx.

39  {
45  ATH_CHECK(m_surfKey.initialize());
47 
48  ATH_CHECK(m_idHelperSvc.retrieve());
49  ATH_CHECK(m_trackFitTool.retrieve());
51  ATH_CHECK(m_extrapolationTool.retrieve());
52  ATH_CHECK(m_segSelector.retrieve());
54 
55  auto trkGeo = m_trackingGeometryTool->trackingGeometry();
56  trkGeo->visitSurfaces([this](const Acts::Surface* surf){
57  const auto detEl = surf->associatedDetectorElement();
58  if (!detEl) {
59  ATH_MSG_ALWAYS("Insensitive surface "<<surf->geometryId());
60  return;
61  }
62  const auto* det = static_cast<const ActsTrk::IDetectorElementBase*>(detEl);
63  if (!m_idHelperSvc->isMuon(det->identify())){
64  return;
65  }
66  ATH_MSG_ALWAYS("Sensitive muon surface "<<m_idHelperSvc->toString(det->identify())<<" -> geoId: "
67  <<surf->geometryId());
68 
69  });
70  return StatusCode::SUCCESS;
71  }

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ isClonable()

bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::isClonable
overridevirtualinherited

Specify if the algorithm is clonable.

Reentrant algorithms are clonable.

Definition at line 68 of file AthCommonReentrantAlgorithm.cxx.

52 {
53  // Reentrant algorithms are clonable.
54  return true;
55 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ 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< Gaudi::Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100  {
101  execState( ctx ).setFilterPassed( state );
102  }

◆ smearSegment()

std::tuple< Amg::Vector3D, Amg::Vector3D > MuonR4::SegmentActsRefitAlg::smearSegment ( const ActsTrk::GeometryContext gctx,
const MuonR4::Segment segment,
CLHEP::HepRandomEngine *  engine 
) const
private

Smear the segment's position and direction by one sigma defined by the segment's covariance.

Returns a tuple of smeared position & direction.

Parameters
gctxGeometry context to fetch the alignment of the segment
segmentReference to the segment to smear
engineRandom engine to pass through the random number sequence

Smear the parameters

Ensure that the left-right ambiguity is preserved

Definition at line 73 of file SegmentActsRefitAlg.cxx.

75  {
76  // return std::make_pair(segment.position(), segment.direction()* (segment.direction().z() < 0 ? -1. : 1.));
77  const auto segPars = localSegmentPars(gctx, segment);
78  auto smearedPars = segPars;
80  for (ParamDefs precPar : {ParamDefs::y0, ParamDefs::theta,
81  ParamDefs::x0, ParamDefs::phi}) {
82  if (precPar == ParamDefs::phi && !segment.summary().nPhiHits) {
83  break;
84  }
85  const unsigned idx = Acts::toUnderlying(precPar);
86  const double uncert = Amg::error(segment.covariance(), idx) * m_smearRange;
87  smearedPars[idx] = CLHEP::RandGaussZiggurat::shoot(engine, segPars[idx], uncert);
88  ATH_MSG_VERBOSE("Apply smearing to "<<SeedingAux::parName(precPar)
89  <<" parameter -- cov: "<<uncert
90  <<", original: "<<segPars[idx]<<", smeared: "<<smearedPars[idx]<<", deviation: "
91  <<(smearedPars[idx] - segPars[idx]) / uncert );
92 
93  }
94  auto [smearLocPos, smearLocDir] = makeLine(smearedPars);
95  const auto [locPos, locDir] = makeLine(segPars);
97  if (SeedingAux::strawSigns(locPos,locDir, segment.measurements()) !=
98  SeedingAux::strawSigns(smearLocPos, smearLocDir, segment.measurements())) {
99  ATH_MSG_ALWAYS("Parameter smearng from "<<toString(segPars)<<" -> "<<toString(smearedPars)
100  <<" changes the L/R ambiguity -> avoid for this test");
101  return smearSegment(gctx, segment, engine);
102  }
103 
104  const Amg::Transform3D& locToGlob{segment.msSector()->localToGlobalTrans(gctx)};
105  if (smearLocDir.z() < 0) {
106  smearLocDir = -smearLocDir;
107  }
108  return std::make_tuple(locToGlob * smearLocPos, locToGlob.linear() * smearLocDir);
109  }

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77 {
78  return BaseAlg::sysExecute (ctx);
79 }

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

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

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

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107  {
109 
110  if (sc.isFailure()) {
111  return sc;
112  }
113 
114  ServiceHandle<ICondSvc> cs("CondSvc",name());
115  for (auto h : outputHandles()) {
116  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117  // do this inside the loop so we don't create the CondSvc until needed
118  if ( cs.retrieve().isFailure() ) {
119  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120  return StatusCode::SUCCESS;
121  }
122  if (cs->regHandle(this,*h).isFailure()) {
123  sc = StatusCode::FAILURE;
124  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125  << " with CondSvc");
126  }
127  }
128  }
129  return sc;
130 }

◆ sysStart()

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

Handle START transition.

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

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_auxMeasProv

ActsTrk::AuxiliaryMeasurementHandler MuonR4::SegmentActsRefitAlg::m_auxMeasProv {this}
private

Definition at line 76 of file SegmentActsRefitAlg.h.

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* MuonR4::SegmentActsRefitAlg::m_detMgr {nullptr}
private

Detector manager to access the spectrometer sector surfaces.

Definition at line 78 of file SegmentActsRefitAlg.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_drawEvent

Gaudi::Property<bool> MuonR4::SegmentActsRefitAlg::m_drawEvent {this , "drawEvent", false }
private

Dump the segment line in obj files.

Definition at line 74 of file SegmentActsRefitAlg.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_extrapolationTool

ToolHandle<ActsTrk::IExtrapolationTool> MuonR4::SegmentActsRefitAlg::m_extrapolationTool {this, "ExtrapolationTool" ,"" }
private

Track extrapolation tool.

Definition at line 64 of file SegmentActsRefitAlg.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonR4::SegmentActsRefitAlg::m_idHelperSvc {this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

IdHelperSvc to decode the Identifiers.

Definition at line 58 of file SegmentActsRefitAlg.h.

◆ m_linkKey

SG::WriteDecorHandleKey<xAOD::MuonSegmentContainer> MuonR4::SegmentActsRefitAlg::m_linkKey {this, "LinkKey", m_writeKey, "prefitSegmentLink"}
private

Construct a link from the refitted segment to the input segment.

Definition at line 51 of file SegmentActsRefitAlg.h.

◆ m_localParsKey

SG::WriteDecorHandleKey<xAOD::MuonSegmentContainer> MuonR4::SegmentActsRefitAlg::m_localParsKey {this, "LocalParsKey", m_writeKey, "localSegPars"}
private

Decorate directly the local segment parameters on to the object.

Definition at line 53 of file SegmentActsRefitAlg.h.

◆ m_readKey

SG::ReadHandleKey<xAOD::MuonSegmentContainer> MuonR4::SegmentActsRefitAlg::m_readKey {this, "SegmentContainer", "MuonSegmentsFromR4"}
private

Declare the data dependency on the standard Mdt+Rpc+Tgc segment container.

Definition at line 47 of file SegmentActsRefitAlg.h.

◆ m_rndmSvc

ServiceHandle<IAthRNGSvc> MuonR4::SegmentActsRefitAlg::m_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""}
private

Range service to smear the segment parameters.

Definition at line 68 of file SegmentActsRefitAlg.h.

◆ m_seedParsKey

SG::WriteDecorHandleKey<xAOD::MuonSegmentContainer> MuonR4::SegmentActsRefitAlg::m_seedParsKey {this, "SeedParsKey", m_readKey, "seedSegPars"}
private

Decorate the seed parameters entering the fit.

Definition at line 55 of file SegmentActsRefitAlg.h.

◆ m_segSelector

ToolHandle<MuonR4::ISegmentSelectionTool> MuonR4::SegmentActsRefitAlg::m_segSelector {this, "SegmentSelectionTool" , "" }
private

Segment selection tool to pick the good quality segments.

Definition at line 66 of file SegmentActsRefitAlg.h.

◆ m_smearRange

Gaudi::Property<double> MuonR4::SegmentActsRefitAlg::m_smearRange {this, "SmearRange", 1.}
private

Smear interval in terms of standard deviations.

Definition at line 70 of file SegmentActsRefitAlg.h.

◆ m_surfKey

SG::WriteHandleKey<xAOD::TrackSurfaceContainer> MuonR4::SegmentActsRefitAlg::m_surfKey {this, "SurfaceKey", "RefitSegmentSurf"}
private

Key to setup a surface container for the external constraints.

Definition at line 72 of file SegmentActsRefitAlg.h.

◆ m_trackFitTool

ToolHandle<ActsTrk::IFitterTool> MuonR4::SegmentActsRefitAlg::m_trackFitTool {this, "FittingTool", ""}
private

Track fitting tool.

Definition at line 60 of file SegmentActsRefitAlg.h.

◆ m_trackingGeometryTool

PublicToolHandle<ActsTrk::ITrackingGeometryTool> MuonR4::SegmentActsRefitAlg::m_trackingGeometryTool {this, "TrackingGeometryTool", ""}
private

Tracking geometry tool.

Definition at line 62 of file SegmentActsRefitAlg.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeKey

SG::WriteHandleKey<xAOD::MuonSegmentContainer> MuonR4::SegmentActsRefitAlg::m_writeKey {this, "OutContainer", "ActsRefitSegments"}
private

Declare the key for the refitted segment container.

Definition at line 49 of file SegmentActsRefitAlg.h.


The documentation for this class was generated from the following files:
ActsTrk::AuxiliaryMeasurementHandler::makeHandle
MeasurementProvider makeHandle(const EventContext &ctx, xAOD::TrackSurfaceContainer &surfaceBackend) const
Creates a new MeasurementProvider and triggers the write of the container backend to StoreGate.
Definition: AuxiliaryMeasurementHandler.cxx:51
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MuonR4::collectMeasurements
std::vector< const xAOD::UncalibratedMeasurement * > collectMeasurements(const Segment &seg, bool skipOutlier=true)
Helper function to extract the measurements from the segment.
Definition: TrackingHelpers.cxx:33
MuonR4::printID
std::string printID(const xAOD::MuonSegment &seg)
Print the chamber ID of a segment, e.g.
Definition: TrackingHelpers.cxx:15
ATHRNG::RNGWrapper::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition: RNGWrapper.h:169
ActsTrk::getCalibrationContext
Acts::CalibrationContext getCalibrationContext(const EventContext &ctx)
The Acts::Calibration context is piped through the Acts fitters to (re)calibrate the Acts::SourceLink...
Definition: CalibrationContext.h:15
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:196
xAOD::identify
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:95
MuonR4::Segment::summary
const HitSummary & summary() const
Returns the hit summary.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:74
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
vtune_athena.format
format
Definition: vtune_athena.py:14
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
MuonGMR4::SpectrometerSector::localToGlobalTrans
const Amg::Transform3D & localToGlobalTrans(const ActsTrk::GeometryContext &gctx) const
Returns the local -> global tarnsformation from the sector.
Definition: SpectrometerSector.cxx:75
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
MuonR4::Segment::measurements
const MeasVec & measurements() const
Returns the associated measurements.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:49
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
MuonR4::SegmentActsRefitAlg::m_linkKey
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_linkKey
Construct a link from the refitted segment to the input segment.
Definition: SegmentActsRefitAlg.h:51
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
MuonR4::SegmentActsRefitAlg::m_localParsKey
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_localParsKey
Decorate directly the local segment parameters on to the object.
Definition: SegmentActsRefitAlg.h:53
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ActsTrk::convertPosToActs
Acts::Vector4 convertPosToActs(const Amg::Vector3D &athenaPos, const double athenaTime=0.)
Converts a position vector & time from Athena units into Acts units.
Definition: UnitConverters.h:74
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
MuonR4::SegmentFit::makeLine
std::pair< Amg::Vector3D, Amg::Vector3D > makeLine(const Parameters &pars)
Returns the parsed parameters into an Eigen line parametrization.
Definition: SegmentFitterEventData.cxx:35
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
MuonValR4::drawSegmentLine
void drawSegmentLine(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewLine, const double standardLength=1.*Gaudi::Units::m)
Draw a segment line inside the obj file.
Definition: ObjVisualizationHelpers.cxx:46
ActsTrk::detail::xAODUncalibMeasCalibrator::unpack
static const xAOD::UncalibratedMeasurement * unpack(const Acts::SourceLink &sl)
Helper method to unpack an Acts source link to an uncalibrated measurement.
Definition: xAODUncalibMeasCalibrator.cxx:12
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
MuonR4::detailedSegment
const Segment * detailedSegment(const xAOD::MuonSegment &seg)
Helper function to navigate from the xAOD::MuonSegment to the MuonR4::Segment.
Definition: TrackingHelpers.cxx:22
ActsTrk::AuxiliaryMeasurementHandler::initialize
StatusCode initialize(const std::string &preFix)
Initialize the write handle keys.
Definition: AuxiliaryMeasurementHandler.cxx:26
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
MuonR4::SegmentActsRefitAlg::m_readKey
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_readKey
Declare the data dependency on the standard Mdt+Rpc+Tgc segment container.
Definition: SegmentActsRefitAlg.h:47
MuonR4::SegmentActsRefitAlg::m_smearRange
Gaudi::Property< double > m_smearRange
Smear interval in terms of standard deviations.
Definition: SegmentActsRefitAlg.h:70
MuonR4::SegmentActsRefitAlg::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Detector manager to access the spectrometer sector surfaces.
Definition: SegmentActsRefitAlg.h:78
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonReentrantAlgorithm::extraOutputDeps
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Definition: AthCommonReentrantAlgorithm.cxx:89
MuonR4::SegmentActsRefitAlg::m_drawEvent
Gaudi::Property< bool > m_drawEvent
Dump the segment line in obj files.
Definition: SegmentActsRefitAlg.h:74
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonR4::SegmentActsRefitAlg::m_writeKey
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_writeKey
Declare the key for the refitted segment container.
Definition: SegmentActsRefitAlg.h:49
ActsTrk::IDetectorElementBase
base class interface providing the bare minimal interface extension.
Definition: IDetectorElement.h:32
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition: ReadCondHandle.h:287
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
MuonR4::SegmentActsRefitAlg::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Range service to smear the segment parameters.
Definition: SegmentActsRefitAlg.h:68
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
AthCommonReentrantAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthCommonReentrantAlgorithm.cxx:76
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonR4::SegmentActsRefitAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc to decode the Identifiers.
Definition: SegmentActsRefitAlg.h:58
beamspotnt.parName
list parName
Definition: bin/beamspotnt.py:1286
MuonR4::SegmentActsRefitAlg::m_extrapolationTool
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
Track extrapolation tool.
Definition: SegmentActsRefitAlg.h:64
xAOD::Other
@ Other
ATH_MSG_ALWAYS
#define ATH_MSG_ALWAYS(x)
Definition: AthMsgStreamMacros.h:35
MuonR4::SegmentActsRefitAlg::m_trackFitTool
ToolHandle< ActsTrk::IFitterTool > m_trackFitTool
Track fitting tool.
Definition: SegmentActsRefitAlg.h:60
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
ActsTrk::GeometryContext
Definition: GeometryContext.h:28
MuonR4::Segment::msSector
const MuonGMR4::SpectrometerSector * msSector() const
Returns the associated MS sector.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:39
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
xAOD::MuonSegmentContainer
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
Definition: MuonSegmentContainer.h:14
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
xAOD::MeasVector
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
Definition: MeasurementDefs.h:53
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
MuonValR4::drawSegmentMeasurements
void drawSegmentMeasurements(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewSensitive)
Draw all uncalibrated measurements associated to the segment.
Definition: ObjVisualizationHelpers.cxx:81
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:73
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.copyTCTOutput.locDir
locDir
Definition: copyTCTOutput.py:110
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
MuonValR4::drawBoundParameters
void drawBoundParameters(const ActsTrk::GeometryContext &gctx, const Acts::BoundTrackParameters &pars, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewLine, const double standardLength=3.*Gaudi::Units::cm)
Draw a line representing the bound track parameters.
Definition: ObjVisualizationHelpers.cxx:175
a
TList * a
Definition: liststreamerinfos.cxx:10
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
h
MuonR4::Segment::HitSummary
Helper struct to summarize the hit count
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:61
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
copySelective.target
string target
Definition: copySelective.py:36
MuonR4::SegmentActsRefitAlg::m_surfKey
SG::WriteHandleKey< xAOD::TrackSurfaceContainer > m_surfKey
Key to setup a surface container for the external constraints.
Definition: SegmentActsRefitAlg.h:72
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
MuonR4::SegmentFit::localSegmentPars
Parameters localSegmentPars(const xAOD::MuonSegment &seg)
Returns the localSegPars decoration from a xAODMuon::Segment.
Definition: SegmentFitterEventData.cxx:42
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthCommonReentrantAlgorithm.cxx:107
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
MuonR4::Segment::HitSummary::nPhiHits
unsigned nPhiHits
Number of good Rpc / Tgc / sTgc phi hits.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:67
ActsTrk::detail::xAODUncalibMeasSurfAcc
Helper class to access the Acts::surface associated with an Uncalibrated xAOD measurement.
Definition: xAODUncalibMeasSurfAcc.h:22
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:13
Pmt::ParamDefs
ParamDefs
This file defines the parameter enums in the Trk namespace.
Definition: PoorMansIpAugmenterAlg.cxx:26
CaloLCW_tf.trf
trf
Definition: CaloLCW_tf.py:20
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthCommonReentrantAlgorithm.h:114
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
xAOD::UncalibMeasType::MdtDriftCircleType
@ MdtDriftCircleType
MuonR4::SegmentActsRefitAlg::smearSegment
std::tuple< Amg::Vector3D, Amg::Vector3D > smearSegment(const ActsTrk::GeometryContext &gctx, const MuonR4::Segment &segment, CLHEP::HepRandomEngine *engine) const
Smear the segment's position and direction by one sigma defined by the segment's covariance.
Definition: SegmentActsRefitAlg.cxx:73
fitman.k
k
Definition: fitman.py:528
MuonGMR4::MuonDetectorManager::getSectorEnvelope
const SpectrometerSector * getSectorEnvelope(const Identifier &channelId) const
Retrieves the spectrometer envelope enclosing the channel's readout element.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:198
python.SystemOfUnits.m
float m
Definition: SystemOfUnits.py:106
MuonR4::SegmentActsRefitAlg::m_trackingGeometryTool
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
Tracking geometry tool.
Definition: SegmentActsRefitAlg.h:62
MuonR4::Segment::covariance
const SegmentFit::Covariance & covariance() const
Returns the uncertainties of the defining parameters.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonPatternEvent/MuonPatternEvent/Segment.h:53
MuonR4::SegmentActsRefitAlg::m_segSelector
ToolHandle< MuonR4::ISegmentSelectionTool > m_segSelector
Segment selection tool to pick the good quality segments.
Definition: SegmentActsRefitAlg.h:66
ServiceHandle< ICondSvc >
MuonR4::SegmentActsRefitAlg::m_seedParsKey
SG::WriteDecorHandleKey< xAOD::MuonSegmentContainer > m_seedParsKey
Decorate the seed parameters entering the fit.
Definition: SegmentActsRefitAlg.h:55
MuonR4::SegmentActsRefitAlg::m_auxMeasProv
ActsTrk::AuxiliaryMeasurementHandler m_auxMeasProv
Definition: SegmentActsRefitAlg.h:76
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65