Skip to content
Snippets Groups Projects
Commit 0e546e76 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'const.DerivationFrameworkMuons-20190513' into 'master'

DerivationFrameworkMuons: Make methods of MuonTPExtrapolationTool const.

See merge request atlas/athena!23386
parents a14e5fd4 fcae8d1b
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// IMuonTPExtrapolationTool.h
#ifndef IMuonTPExtrapolationTool_H
......@@ -23,7 +23,7 @@ class IMuonTPExtrapolationTool : virtual public asg::IAsgTool {
/// This also applies decorations for the eta and phi coordinates in said plane to the tag and the probe track particles
/// If we are processing a DAOD in AthAnalysis, it attempts to read the decorations that should be provided by the derivation
/// In full athena, it will check for the decoration, and run extrapolation if it is not (yet) in place
virtual double dROnTriggerPivotPlane(const xAOD::Muon& tag, const xAOD::IParticle* probe)=0;
virtual double dROnTriggerPivotPlane(const xAOD::Muon& tag, const xAOD::IParticle* probe) const =0;
// this method is intended for use in the DAOD production. It takes only one particle as argument, and handles the decoration.
virtual StatusCode decoratePivotPlaneCoords(const xAOD::IParticle* particle)=0;
......
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
//////////////////////////////////////////////////////////////////////////////
// MuonTPExtrapolationTool
......@@ -27,18 +27,18 @@ class MuonTPExtrapolationTool
MuonTPExtrapolationTool(std::string myname);
virtual ~MuonTPExtrapolationTool();
virtual StatusCode initialize();
virtual StatusCode initialize() override;
/// compute dR on trigger pivot plane
/// see interface class for full description
double dROnTriggerPivotPlane(const xAOD::Muon& tag, const xAOD::IParticle* probe);
virtual double dROnTriggerPivotPlane(const xAOD::Muon& tag, const xAOD::IParticle* probe) const override;
// this method is intended for use in the DAOD production. It takes only one particle as argument, and handles the decoration.
virtual StatusCode decoratePivotPlaneCoords(const xAOD::IParticle* particle);
virtual StatusCode decoratePivotPlaneCoords(const xAOD::IParticle* particle) override;
#ifndef XAOD_ANALYSIS
/// run the extrapolation - only available in full athena
const Trk::TrackParameters* extrapolateToTriggerPivotPlane(const xAOD::TrackParticle& track);
const Trk::TrackParameters* extrapolateToTriggerPivotPlane(const xAOD::TrackParticle& track) const;
#endif
// Utility method to handle extrapolation and decoration for one TrackParticle.
......@@ -48,7 +48,7 @@ class MuonTPExtrapolationTool
// Returns success (true) or failure (false) of the procedure, fills eta and phi coordinates via reference
// If the extrapolation fails or the decoration is missing in AthAnalysis, it will *not* change eta and phi
// So you can set them to defaults before calling this guy, and they will be preserved in case of failure.
bool extrapolateAndDecorateTrackParticle(const xAOD::TrackParticle* particle, float & eta, float & phi);
bool extrapolateAndDecorateTrackParticle(const xAOD::TrackParticle* particle, float & eta, float & phi) const;
private:
......@@ -58,7 +58,7 @@ class MuonTPExtrapolationTool
// utility method: Obtains the track particle which we want to extrapolate into the MS.
// Works for all kinds of probes.
const xAOD::TrackParticle* getPreferredTrackParticle (const xAOD::IParticle* probe);
const xAOD::TrackParticle* getPreferredTrackParticle (const xAOD::IParticle* probe) const;
// these define the surfaces that we extrapolate to.
// We approximate the pivot plane in the form of a cylinder surface and two disks
......
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
// MuonTPExtrapolationTool.cxx
#include "DerivationFrameworkMuons/MuonTPExtrapolationTool.h"
......@@ -53,19 +53,19 @@ StatusCode MuonTPExtrapolationTool::initialize()
//**********************************************************************
bool MuonTPExtrapolationTool::extrapolateAndDecorateTrackParticle(const xAOD::TrackParticle* particle, float & eta, float & phi){
bool MuonTPExtrapolationTool::extrapolateAndDecorateTrackParticle(const xAOD::TrackParticle* particle, float & eta, float & phi) const {
#ifndef XAOD_ANALYSIS
// decorators used to access or store the information
static SG::AuxElement::Decorator< char > Decorated ("DecoratedPivotEtaPhi");
static SG::AuxElement::Decorator< std::string > DecoOutcome ("DecorationOutcome");
static SG::AuxElement::Decorator< float > Eta ("EtaTriggerPivot");
static SG::AuxElement::Decorator< float > Phi ("PhiTriggerPivot");
static const SG::AuxElement::Decorator< char > Decorated ("DecoratedPivotEtaPhi");
static const SG::AuxElement::Decorator< std::string > DecoOutcome ("DecorationOutcome");
static const SG::AuxElement::Decorator< float > Eta ("EtaTriggerPivot");
static const SG::AuxElement::Decorator< float > Phi ("PhiTriggerPivot");
#else
static SG::AuxElement::Accessor< char > Decorated ("DecoratedPivotEtaPhi");
static SG::AuxElement::Accessor< std::string > DecoOutcome ("DecorationOutcome");
static SG::AuxElement::Accessor< float > Eta ("EtaTriggerPivot");
static SG::AuxElement::Accessor< float > Phi ("PhiTriggerPivot");
static const SG::AuxElement::Accessor< char > Decorated ("DecoratedPivotEtaPhi");
static const SG::AuxElement::Accessor< std::string > DecoOutcome ("DecorationOutcome");
static const SG::AuxElement::Accessor< float > Eta ("EtaTriggerPivot");
static const SG::AuxElement::Accessor< float > Phi ("PhiTriggerPivot");
#endif
if (! Decorated.isAvailable(*particle) || !Decorated(*particle)){
......@@ -107,7 +107,7 @@ bool MuonTPExtrapolationTool::extrapolateAndDecorateTrackParticle(const xAOD::Tr
//**********************************************************************
const xAOD::TrackParticle* MuonTPExtrapolationTool::getPreferredTrackParticle (const xAOD::IParticle* probe){
const xAOD::TrackParticle* MuonTPExtrapolationTool::getPreferredTrackParticle (const xAOD::IParticle* probe) const {
if (dynamic_cast<const xAOD::TruthParticle*>(probe)){
ATH_MSG_WARNING("Pivot plane extrapolation not supported for Truth probes!");
return 0;
......@@ -144,7 +144,7 @@ StatusCode MuonTPExtrapolationTool::decoratePivotPlaneCoords(const xAOD::IPartic
// **********************************************************************
double MuonTPExtrapolationTool::dROnTriggerPivotPlane(const xAOD::Muon& tag, const xAOD::IParticle* probe)
double MuonTPExtrapolationTool::dROnTriggerPivotPlane(const xAOD::Muon& tag, const xAOD::IParticle* probe) const
{
// should never happen, but better be safe than sorry
if(!probe){
......@@ -212,9 +212,9 @@ const xAOD::EventInfo* info = 0;
float dr = sqrt( deta*deta + dphi*dphi);
// decorators for the delta eta and delta phi and dR
static SG::AuxElement::Decorator< float > DecDeta ("probe_dEtaTriggerPivot");
static SG::AuxElement::Decorator< float > DecDphi ("probe_dPhiTriggerPivot");
static SG::AuxElement::Decorator< float > DecDR ("probe_dRTriggerPivot");
static const SG::AuxElement::Decorator< float > DecDeta ("probe_dEtaTriggerPivot");
static const SG::AuxElement::Decorator< float > DecDphi ("probe_dPhiTriggerPivot");
static const SG::AuxElement::Decorator< float > DecDR ("probe_dRTriggerPivot");
// here, we copy the eta and phi decorations from the TrackParticles to the
// tag and probe IParticles - to make them easier to access during the
......@@ -222,8 +222,8 @@ const xAOD::EventInfo* info = 0;
// In the case of an unsuccessful extrap, this additionally ensures that the
// IP direction for eta/phi is written to the output tree
// instead of a garbage value that would result from a missing decoration
static SG::AuxElement::Decorator< float > DecEta ("probe_EtaTriggerPivot");
static SG::AuxElement::Decorator< float > DecPhi ("probe_PhiTriggerPivot");
static const SG::AuxElement::Decorator< float > DecEta ("probe_EtaTriggerPivot");
static const SG::AuxElement::Decorator< float > DecPhi ("probe_PhiTriggerPivot");
// special unphysical values to signify an ID probe not reaching the pivot plane
if (IDProbeMissesMS){
......@@ -262,7 +262,7 @@ const xAOD::EventInfo* info = 0;
//**********************************************************************
#ifndef XAOD_ANALYSIS
const Trk::TrackParameters* MuonTPExtrapolationTool::extrapolateToTriggerPivotPlane(const xAOD::TrackParticle& track)
const Trk::TrackParameters* MuonTPExtrapolationTool::extrapolateToTriggerPivotPlane(const xAOD::TrackParticle& track) const
{
// BARREL
const Trk::Perigee& perigee = track.perigeeParameters();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment