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

#include <MuidCaloEnergyTool.h>

Inheritance diagram for Rec::MuidCaloEnergyTool:
Collaboration diagram for Rec::MuidCaloEnergyTool:

Public Member Functions

 MuidCaloEnergyTool (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~MuidCaloEnergyTool (void)
 
StatusCode initialize () override
 
StatusCode finalize () override
 
std::unique_ptr< CaloEnergyenergyLoss (const EventContext &ctx, double trackMomentum, double eta, double phi) const override
 IMuidCaloEnergy interface: to get the total energyLoss in the calorimeters. More...
 
std::unique_ptr< Trk::TrackStateOnSurfacetrackStateOnSurface (const EventContext &ctx, const Trk::TrackParameters &middleParameters, const Trk::TrackParameters *innerParameters, const Trk::TrackParameters *outerParameters) const override
 IMuidCaloEnergy interface: TrackStateOnSurface for parameters and energyLoss at the calorimeter mid-surface. 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, 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
 

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::unique_ptr< CaloEnergymeasurement (const EventContext &ctx, double trackMomentum, double eta, double phi, const CaloMeas &caloMeas) const
 
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...
 

Static Private Member Functions

static double muSpecResolParam (double trackMomentum, double eta)
 
static double paramCorrection (double trackMomentum, double eta, double MopLoss, double MopSigma)
 
static double landau (double x, double mpv, double sigma, bool norm)
 

Private Attributes

ToolHandle< IMuidCaloEnergyMeasm_caloMeasTool
 
ToolHandle< IMuidCaloEnergyParamm_caloParamTool
 
ToolHandle< IMuidTrackIsolationm_trackIsolationTool
 
bool m_cosmics
 
bool m_energyLossMeasurement
 
bool m_forceIsolationFailure
 
bool m_FSRtreatment
 
bool m_MOPparametrization
 
bool m_trackIsolation
 
double m_emEtCut
 
double m_emF1Cut
 
double m_emMinEnergy
 
double m_hecMinEnergy
 
int m_maxNTracksIso
 
double m_minFinalEnergy
 
double m_minMuonPt
 
std::atomic_int m_countMean {0}
 
std::atomic_int m_countMeasurement {0}
 
std::atomic_int m_countMop {0}
 
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 43 of file MuidCaloEnergyTool.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

◆ MuidCaloEnergyTool()

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

Definition at line 39 of file MuidCaloEnergyTool.cxx.

39  :
41  m_cosmics(false),
44  m_FSRtreatment(true),
46  m_trackIsolation(false),
47  m_emEtCut(2.5 * Units::GeV),
48  m_emF1Cut(0.15),
51  m_maxNTracksIso(2),
53  m_minMuonPt(15. * Units::GeV) {
54  declareInterface<IMuidCaloEnergy>(this);
55  declareProperty("Cosmics", m_cosmics);
56  declareProperty("EnergyLossMeasurement", m_energyLossMeasurement);
57  declareProperty("ForceIsolationFailure", m_forceIsolationFailure);
58  declareProperty("FSRtreatment", m_FSRtreatment);
59  declareProperty("MopParametrization", m_MOPparametrization);
60  declareProperty("TrackIsolation", m_trackIsolation);
61  declareProperty("EmEtCut", m_emEtCut);
62  declareProperty("EmF1Cut", m_emF1Cut);
63  declareProperty("EmMinEnergy", m_emMinEnergy);
64  declareProperty("HecMinEnergy", m_hecMinEnergy);
65  declareProperty("MaxNTracksIso", m_maxNTracksIso);
66  declareProperty("MinFinalEnergy", m_minFinalEnergy);
67  declareProperty("MinMuonPt", m_minMuonPt);
68  }

◆ ~MuidCaloEnergyTool()

MuidCaloEnergyTool::~MuidCaloEnergyTool ( void  )
default

Member Function Documentation

◆ declareGaudiProperty() [1/4]

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

◆ energyLoss()

std::unique_ptr< CaloEnergy > MuidCaloEnergyTool::energyLoss ( const EventContext &  ctx,
double  trackMomentum,
double  eta,
double  phi 
) const
overridevirtual

IMuidCaloEnergy interface: to get the total energyLoss in the calorimeters.

Implements Rec::IMuidCaloEnergy.

Definition at line 111 of file MuidCaloEnergyTool.cxx.

112  {
113  // debug
114  ATH_MSG_VERBOSE("Muon with : p = " << trackMomentum / Units::GeV << " Phi = " << phi << " Eta = " << eta);
115  std::unique_ptr<CaloEnergy> caloEnergy;
117  // Energy Dep/Iso from calorimeters (projective assumption)
118  std::unique_ptr<CaloMeas> caloMeas{m_caloMeasTool->energyMeasurement(ctx, eta, phi, eta, phi)};
119  if (caloMeas) { caloEnergy = measurement(ctx, trackMomentum, eta, phi, *caloMeas); }
120  }
121 
122  if (!caloEnergy) {
123  if (m_MOPparametrization) {
124  ++m_countMop;
125  caloEnergy.reset(m_caloParamTool->mopParametrizedEnergy(trackMomentum, eta, phi));
126  ATH_MSG_VERBOSE("Selected the Mop Parametrization value! ==> ");
127  } else {
128  ++m_countMean;
129  caloEnergy.reset(m_caloParamTool->meanParametrizedEnergy(trackMomentum, eta, phi));
130  ATH_MSG_VERBOSE("Selected the Mean Parametrization value! ==> ");
131  }
132  }
133 
134  if (msgLvl(MSG::DEBUG)) {
135  std::string eLossType = " no Calo !!";
136  switch (caloEnergy->energyLossType()) {
137  case CaloEnergy::Parametrized: eLossType = "Parametrized"; break;
138  case CaloEnergy::NotIsolated: eLossType = "NotIsolated "; break;
139  case CaloEnergy::MOP: eLossType = "MOP "; break;
140  case CaloEnergy::Tail: eLossType = "Tail "; break;
141  case CaloEnergy::FSRcandidate: eLossType = "FSRcandidate"; break;
142  default: break;
143  };
144  ATH_MSG_DEBUG(std::setiosflags(std::ios::fixed)
145  << " energyLoss with"
146  << " momentum =" << std::setw(6) << std::setprecision(1) << trackMomentum / Units::GeV
147  << " phi =" << std::setw(6) << std::setprecision(3) << phi << " eta =" << std::setw(6) << std::setprecision(3)
148  << eta << ". CaloEnergy: deltaE = " << std::setw(8) << std::setprecision(3) << caloEnergy->deltaE() / Units::GeV
149  << " +" << std::setw(5) << std::setprecision(3) << caloEnergy->sigmaPlusDeltaE() / Units::GeV << " -"
150  << std::setw(5) << std::setprecision(3) << caloEnergy->sigmaMinusDeltaE() / Units::GeV << " (" << std::setw(5)
151  << std::setprecision(3) << caloEnergy->sigmaDeltaE() / Units::GeV << ") GeV, CaloEnergy::Type " << eLossType);
152  }
153 
154  return caloEnergy;
155  }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ finalize()

StatusCode MuidCaloEnergyTool::finalize ( )
override

Definition at line 104 of file MuidCaloEnergyTool.cxx.

104  {
105  ATH_MSG_INFO("Finalizing MuidCaloEnergyTool."
106  << " Tracks used mean: " << m_countMean << ", tracks used mop: " << m_countMop
107  << ", tracks used measurement: " << m_countMeasurement);
108 
109  return StatusCode::SUCCESS;
110  }

◆ initialize()

StatusCode MuidCaloEnergyTool::initialize ( )
override

Definition at line 74 of file MuidCaloEnergyTool.cxx.

74  {
76  ATH_MSG_INFO("Initializing MuidCaloEnergyTool - measured calorimeter energy deposition ");
77  } else {
78  ATH_MSG_INFO("Initializing MuidCaloEnergyTool - parametrized calorimeter energy deposition ");
79  }
80 
81  // get the Tools
82  ATH_CHECK(m_caloParamTool.retrieve());
83  ATH_MSG_DEBUG("Retrieved tool " << m_caloParamTool);
84 
86  ATH_CHECK(m_caloMeasTool.retrieve());
87  ATH_MSG_DEBUG("Retrieved tool " << m_caloMeasTool);
88 
89  if (m_trackIsolation) {
90  ATH_CHECK(m_trackIsolationTool.retrieve());
91  ATH_MSG_DEBUG("Retrieved tool " << m_trackIsolationTool);
92  } else {
93  ATH_MSG_WARNING(" Using energy measurement without trackIsolation ");
94  m_trackIsolationTool.disable();
95  }
96  } else {
97  m_trackIsolationTool.disable();
98  m_caloMeasTool.disable();
99  }
100 
101  return StatusCode::SUCCESS;
102  }

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ interfaceID()

static const InterfaceID& Rec::IMuidCaloEnergy::interfaceID ( )
inlinestaticinherited

AlgTool and IAlgTool interface methods.

Interface ID for IMuidCaloEnergy

Definition at line 37 of file IMuidCaloEnergy.h.

37  {
39  static const InterfaceID IID_IMuidCaloEnergy("IMuidCaloEnergy", 1, 0);
40 
41  return IID_IMuidCaloEnergy;
42  }

◆ landau()

double MuidCaloEnergyTool::landau ( double  x,
double  mpv,
double  sigma,
bool  norm 
)
staticprivate

Definition at line 527 of file MuidCaloEnergyTool.cxx.

527  {
528  // The LANDAU function with mpv(most probable value) and sigma.
529  // This function has been adapted from the CERNLIB routine G110 denlan.
530  // If norm=kTRUE (default is kFALSE) the result is divided by sigma
531 
532  constexpr double p1[5] = {0.4259894875, -0.1249762550, 0.03984243700, -0.006298287635, 0.001511162253};
533  constexpr double q1[5] = {1.0, -0.3388260629, 0.09594393323, -0.01608042283, 0.003778942063};
534 
535  constexpr double p2[5] = {0.1788541609, 0.1173957403, 0.01488850518, -0.001394989411, 0.0001283617211};
536  constexpr double q2[5] = {1.0, 0.7428795082, 0.3153932961, 0.06694219548, 0.008790609714};
537 
538  constexpr double p3[5] = {0.1788544503, 0.09359161662, 0.006325387654, 0.00006611667319, -0.000002031049101};
539  constexpr double q3[5] = {1.0, 0.6097809921, 0.2560616665, 0.04746722384, 0.006957301675};
540 
541  constexpr double p4[5] = {0.9874054407, 118.6723273, 849.2794360, -743.7792444, 427.0262186};
542  constexpr double q4[5] = {1.0, 106.8615961, 337.6496214, 2016.712389, 1597.063511};
543 
544  constexpr double p5[5] = {1.003675074, 167.5702434, 4789.711289, 21217.86767, -22324.94910};
545  constexpr double q5[5] = {1.0, 156.9424537, 3745.310488, 9834.698876, 66924.28357};
546 
547  constexpr double p6[5] = {1.000827619, 664.9143136, 62972.92665, 475554.6998, -5743609.109};
548  constexpr double q6[5] = {1.0, 651.4101098, 56974.73333, 165917.4725, -2815759.939};
549 
550  constexpr double a1[3] = {0.04166666667, -0.01996527778, 0.02709538966};
551 
552  constexpr double a2[2] = {-1.845568670, -4.284640743};
553 
554  if (sigma <= 0) return 0.;
555  double v = (x - mpv) / sigma;
556  double u, ue, us, den;
557  if (v < -5.5) {
558  u = exp(v + 1.0);
559  if (u < 1e-10) return 0.0;
560  ue = std::exp(-1 / u);
561  us = std::sqrt(u);
562  den = 0.3989422803 * (ue / us) * (1 + (a1[0] + (a1[1] + a1[2] * u) * u) * u);
563  } else if (v < -1) {
564  u = std::exp(-v - 1);
565  den = exp(-u) * std::sqrt(u) * (p1[0] + (p1[1] + (p1[2] + (p1[3] + p1[4] * v) * v) * v) * v) /
566  (q1[0] + (q1[1] + (q1[2] + (q1[3] + q1[4] * v) * v) * v) * v);
567  } else if (v < 1) {
568  den = (p2[0] + (p2[1] + (p2[2] + (p2[3] + p2[4] * v) * v) * v) * v) /
569  (q2[0] + (q2[1] + (q2[2] + (q2[3] + q2[4] * v) * v) * v) * v);
570  } else if (v < 5) {
571  den = (p3[0] + (p3[1] + (p3[2] + (p3[3] + p3[4] * v) * v) * v) * v) /
572  (q3[0] + (q3[1] + (q3[2] + (q3[3] + q3[4] * v) * v) * v) * v);
573  } else if (v < 12) {
574  u = 1 / v;
575  den = u * u * (p4[0] + (p4[1] + (p4[2] + (p4[3] + p4[4] * u) * u) * u) * u) /
576  (q4[0] + (q4[1] + (q4[2] + (q4[3] + q4[4] * u) * u) * u) * u);
577  } else if (v < 50) {
578  u = 1 / v;
579  den = u * u * (p5[0] + (p5[1] + (p5[2] + (p5[3] + p5[4] * u) * u) * u) * u) /
580  (q5[0] + (q5[1] + (q5[2] + (q5[3] + q5[4] * u) * u) * u) * u);
581  } else if (v < 300) {
582  u = 1 / v;
583  den = u * u * (p6[0] + (p6[1] + (p6[2] + (p6[3] + p6[4] * u) * u) * u) * u) /
584  (q6[0] + (q6[1] + (q6[2] + (q6[3] + q6[4] * u) * u) * u) * u);
585  } else {
586  u = 1 / (v - v * log(v) / (v + 1));
587  den = u * u * (1 + (a2[0] + a2[1] * u) * u);
588  }
589  if (!norm) return den;
590  return den / sigma;
591  }

◆ measurement()

std::unique_ptr< CaloEnergy > MuidCaloEnergyTool::measurement ( const EventContext &  ctx,
double  trackMomentum,
double  eta,
double  phi,
const CaloMeas caloMeas 
) const
private

Definition at line 241 of file MuidCaloEnergyTool.cxx.

242  {
243  // Mean Energy Loss parametrization
244  std::unique_ptr<CaloEnergy> caloParamMean{m_caloParamTool->meanParametrizedEnergy(trackMomentum, eta, phi)};
245  // Mop Energy Loss parametrization
246  std::unique_ptr<CaloEnergy> caloParamMop{m_caloParamTool->mopParametrizedEnergy(trackMomentum, eta, phi)};
247  // Mip Energy Loss
248  std::unique_ptr<CaloEnergy> caloParamMip{m_caloParamTool->meanParametrizedEnergy(10. * Units::GeV, eta, phi)};
249  // Mop Energy Loss peak
250  std::unique_ptr<CaloEnergy> mopPeak{m_caloParamTool->mopPeakEnergy(trackMomentum, eta, phi)};
251 
252  // // flag upper hemisphere cosmic
253  // bool cosmic = false;
254  // if (caloParamMop->deltaE() < 0.) cosmic = true;
255 
256  // mop energy deposition
257  double MopLoss = std::abs(caloParamMop->deltaE());
258  // mop energy deposition uncertainty
259  double MopError = mopPeak->sigmaDeltaE();
260  // mop energy deposition corrected
261  double MopLossCorrected = paramCorrection(trackMomentum, eta, MopLoss, MopError);
262 
263  // percentage of inert material
264  const double InertMaterial = m_caloParamTool->x0mapInertMaterial(eta);
265  // percentage of em calorimeter material
266  const double EmMaterial = m_caloParamTool->x0mapEmMaterial(eta);
267  // percentage of hec calorimeter material
268  const double HECMaterial = m_caloParamTool->x0mapHecMaterial(eta);
269  // correction for the inert material
270  double MaterialCorrection = InertMaterial * MopLossCorrected;
271  // scale to get mop loss in em calo
272  double MopLossEm = MopLoss * m_caloParamTool->emMopFraction(eta);
273  // fraction of Tile used for the measurement
274  const double TileMeasurementMaterial = caloMeas.Tile_SamplingFraction();
275  // fraction of LArHEC used for the measurement
276  const double LArHECMeasurementMaterial = caloMeas.LArHEC_SamplingFraction();
277  // fraction of LArEM used for the measurement
278  const double LArEmMeasurementMaterial = caloMeas.LArEM_SamplingFraction();
279  // Measured energy deposition in Tile
280  const double TileEnergy = caloMeas.Tile_EnergyMeasured();
281  // Measured energy deposition in E/M
282  const double EmEnergy = caloMeas.LArEM_EnergyMeasured();
283 
284  // Correction for forward calorimetry
285  double ForwardHECCorrection = 0.;
286  if (std::abs(eta) > 2. && caloMeas.LArHEC_EnergyMeasured() > 100.)
287  ForwardHECCorrection = (1. - LArHECMeasurementMaterial) * HECMaterial * MopLossCorrected;
288  const double LArHECEnergy = caloMeas.LArHEC_EnergyMeasured() + ForwardHECCorrection; // Measured energy deposition in LArHEC
289 
290  double TotalMeasuredEnergy = TileEnergy + EmEnergy + LArHECEnergy;
291 
292  ATH_MSG_VERBOSE("Energy Deposition:Tile= " << TileEnergy / Units::GeV << ",LArHEC= " << LArHECEnergy / Units::GeV
293  << ",EM= " << EmEnergy / Units::GeV << " ForwardHECCorrection "
294  << ForwardHECCorrection / Units::GeV << " HECMaterial " << HECMaterial
295  << " MopLossCorrected " << MopLossCorrected / Units::GeV);
296 
297  bool bHEC = false; // performed HEC measurement?
298  bool bEM = false; // performed Em measurement?
299 
300  // If muon isolated, and no significant measurement is made then use the mop parameterization, else the mean
301  if (std::abs(eta) < 1.4) {
302  if (LArHECEnergy + TileEnergy > 0.1 * MopLoss * HECMaterial) bHEC = true;
303  } else if (std::abs(eta) > 1.8) {
304  if (LArHECEnergy + TileEnergy > 0.2 * MopLoss * HECMaterial) bHEC = true;
305  } else {
306  if (LArHECEnergy + TileEnergy > 0.25 * MopLoss * HECMaterial) bHEC = true;
307  }
308  if (EmEnergy > 0.5 * MopLoss * EmMaterial) bEM = true;
309 
310  if (!bHEC) {
311  // TotalMeasuredEnergy -= TileEnergy + LArHECEnergy;
312  // MaterialCorrection += HECMaterial * MopLossCorrected;
313  }
314  if (!bEM) {
315  // TotalMeasuredEnergy -= EmEnergy;
316  // MaterialCorrection += EmMaterial * MopLossCorrected;
317  }
318 
319  double MeasCorrected = TotalMeasuredEnergy + MaterialCorrection;
320  // Need to calculate the corresponding mip energy deposition
321  // Muons of 10 GeV are already in the relativistic rise region
322  // in order to obtain the mip deposition from the mean energy deposition of 10 GeV muons
323  // should divide by approximately 1.4 (Review of Particle Physics Figure 27.3 p.243)
324  const double IonizationLoss = (1. / 1.4) * std::abs(caloParamMip->deltaE());
325 
326  double eOverMipCorrectionEm = 0.;
327  double eOverMipCorrectionHEC = 0.;
328 
329  // Etrue = emip * Emeas
330  // -DE = Emeas - Etrue = Etrue ( 1./emip -1.)
331  if (bEM) {
332  const double emipEM = 0.78;
333  eOverMipCorrectionEm = -(1. / emipEM - 1.) * IonizationLoss * EmMaterial * LArEmMeasurementMaterial;
334  if (EmEnergy + eOverMipCorrectionEm < 0.) eOverMipCorrectionEm = 0.;
335  }
336  if (bHEC) {
337  const double emipTile = 0.86;
338  const double emipLAr = 0.94;
339  const double HECEnergy = TileEnergy + LArHECEnergy;
340  const double eOverMipCorrectionTile =
341  -(1. / emipTile - 1.) * TileEnergy / HECEnergy * IonizationLoss * HECMaterial * TileMeasurementMaterial;
342  const double eOverMipCorrectionLAr =
343  -(1. / emipLAr - 1.) * LArHECEnergy / HECEnergy * IonizationLoss * HECMaterial * LArHECMeasurementMaterial;
344  eOverMipCorrectionHEC = eOverMipCorrectionTile + eOverMipCorrectionLAr;
345  if (LArHECEnergy + TileEnergy + eOverMipCorrectionHEC < 0.) eOverMipCorrectionHEC = 0.;
346  }
347  const double eOverMipCorrection = eOverMipCorrectionEm + eOverMipCorrectionHEC;
348 
349  // additional offset from high-statistics Z->mumu MC (measured by Peter K
350  // 30/11/2011)
351  constexpr double fix1FromPeter[26] = {0.424104, 0.479637, 0.483419, 0.490242, 0.52806, 0.573582, 0.822098,
352  0.767301, 0.809919, 0.658745, 0.157187, 0.413214, 0.771074, 0.61815,
353  0.350113, 0.322785, 0.479294, 0.806183, 0.822161, 0.757731, -0.0857186,
354  -0.0992693, -0.0492252, 0.0650174, 0.261538, 0.360413};
355  // (update from Peter K 09/12/2011)
356  constexpr double fix2FromPeter[26] = {-0.647703, -0.303498, -0.268645, -0.261292, -0.260152, -0.269253, -0.266212,
357  -0.240837, -0.130172, -0.111638, -0.329423, -0.321011, -0.346050, -0.305592,
358  -0.313293, -0.317111, -0.428393, -0.524839, -0.599547, -0.464013, -0.159663,
359  -0.140879, -0.0975618, 0.0225352, 0.0701925, -0.24778};
360  int ieta = static_cast<int>(std::abs(eta) / 0.10);
361  if (ieta > 25) ieta = 25;
362  double FinalMeasuredEnergy = MeasCorrected + eOverMipCorrection + (fix1FromPeter[ieta] + fix2FromPeter[ieta]) * Units::GeV;
363 
364  ATH_MSG_VERBOSE("Sum of cells " << (TileEnergy + EmEnergy + LArHECEnergy) / Units::GeV << " Total energy deposition "
365  << TotalMeasuredEnergy / Units::GeV << " corrected energy deposition " << MeasCorrected / Units::GeV
366  << " e/mip corre " << FinalMeasuredEnergy / Units::GeV << std::endl
367  << "\nFinal Energy Measurement = "
368  << FinalMeasuredEnergy / Units::GeV
369  //<< "\nMean Energy Deposition = " << MeanLoss/Units::GeV
370  //<< " - " << MeanErrorLeft/Units::GeV << " + "<< MeanErrorRight/Units::GeV
371  << "\nMop Energy Deposition = " << MopLoss / Units::GeV << " +- "
372  << MopError / Units::GeV
373  //<< "\nOld parametrization energy= " << m_caloParamOld->deltaE()/Units::GeV
374  //<< " +- " << m_caloParamOld->sigmaDeltaE()/Units::GeV
375  //<< "\nTrack Momentum = " << trackMomentum/Units::GeV
376  //<< " Eta= " << eta << " Phi= " << phi
377  << std::endl
378  << "Final Meas = " << FinalMeasuredEnergy / Units::GeV << " Mop Dep = " << MopLoss / Units::GeV
379  << " +- " << MopError / Units::GeV);
380 
381  const double HECIso = caloMeas.Tile_Isolation() + caloMeas.LArHEC_Isolation();
382  const double EmIso = caloMeas.LArEM_Isolation();
383  const double sinTheta = 1. / std::cosh(eta);
384  const double pT = trackMomentum * sinTheta * Units::MeV;
385 
386  constexpr double OneOver85 = 1. / 85;
387  constexpr double FifteenGeV = 15. * Units::GeV;
388  const double EmCut = m_emMinEnergy + OneOver85 * (pT - FifteenGeV);
389  const double HECCut = m_hecMinEnergy;
390  const double pTCut = m_minMuonPt;
391  bool PassCut = true;
392  if (m_forceIsolationFailure || EmIso > EmCut || HECIso > HECCut || pT < pTCut || FinalMeasuredEnergy < m_minFinalEnergy)
393  PassCut = false;
394 
395  int nTracks = 0;
396  // double tracksEnergy = 0.;
397  if (m_trackIsolation) {
398  std::pair<int, double> inner = m_trackIsolationTool->trackIsolation(ctx, eta, phi);
399  nTracks = inner.first;
400  // tracksEnergy = inner.second - maxP;
401  if (pT < 100. * Units::GeV && nTracks > m_maxNTracksIso) PassCut = false;
402  }
403 
404  ATH_MSG_VERBOSE("pT= " << pT / Units::GeV << ",HECIso= " << HECIso / Units::GeV << ",EmIso= " << EmIso / Units::GeV
405  << ", nTracks= " << nTracks << ",PassCut= " << PassCut);
406 
408  std::unique_ptr<CaloEnergy> caloEnergy;
409 
410  // choose between lossTypes MOP, Tail, FSR and NotIsolated according
411  // to measured energy, isolation cut and Et in em
412  if (FinalMeasuredEnergy < MopLoss + 2. * MopError && FinalMeasuredEnergy > m_minFinalEnergy) {
413  ++m_countMop;
414  caloEnergy.swap(mopPeak);
415  } else if (PassCut) {
416  // tail offset from high-statistics Z->mumu MC (measured by Peter K 09/12/2011),
417  // but next we try to separate any FSR contribution from the Landau tail
418  double F1 = 0.;
419  if (caloMeas.LArEM_EnergyMeasured() > m_emEtCut) F1 = caloMeas.LArEM_FirstCompartmentEnergy() / caloMeas.LArEM_EnergyMeasured();
420  ATH_MSG_VERBOSE(" start Tail and FSR treatment: Et in e.m. " << EmEnergy * sinTheta / Units::GeV << " F1 ratio " << F1);
421  if (!m_FSRtreatment || EmEnergy * sinTheta < m_emEtCut || F1 < m_emF1Cut) {
423  double FinalEnergyErrorPlus = 0.50 * std::sqrt(FinalMeasuredEnergy / Units::GeV) * Units::GeV;
424  double FinalEnergyErrorMinus = FinalEnergyErrorPlus;
425 
426  // overall also have 50% resolution in EC rather than the 70% naively expected from LArHEC
427  if (LArHECEnergy > 1. * Units::GeV) {
428  FinalEnergyErrorMinus = FinalEnergyErrorPlus = 0.50 * std::sqrt(FinalMeasuredEnergy / Units::GeV) * Units::GeV;
429  }
430  double FinalEnergyError = 0.5 * (FinalEnergyErrorMinus + FinalEnergyErrorPlus);
431  lossType = CaloEnergy::Tail;
432  caloEnergy = std::make_unique<CaloEnergy>(FinalMeasuredEnergy, FinalEnergyError, FinalEnergyErrorMinus,
433  FinalEnergyErrorPlus, lossType);
434  ATH_MSG_VERBOSE(" CaloEnergy Tail : " << FinalMeasuredEnergy);
435  } else {
436  // significant e.m. deposit and high F1
437  double MopErrorEm = MopError * m_caloParamTool->emMopFraction(eta);
438  double FinalMeasuredEnergyNoEm = FinalMeasuredEnergy - EmEnergy + MopLossEm;
439  // lossType = CaloEnergy::FSRcandidate;
440 
441  ATH_MSG_VERBOSE(" CaloEnergy FSR : EmEnergy " << EmEnergy << " FinalMeasuredEnergy " << FinalMeasuredEnergy
442  << " MopLossEm " << MopLossEm << " MopErrorEm " << MopErrorEm
443  << " FinalMeasuredEnergyNoEm " << FinalMeasuredEnergyNoEm);
444  if (FinalMeasuredEnergyNoEm < MopLoss + 2. * MopError) {
445  // small hadronic energy deposit: like NotIsolated (MOP or Mean according to configuration)
446  lossType = CaloEnergy::NotIsolated;
447  if (m_MOPparametrization) {
448  ++m_countMop;
449  caloEnergy =
450  std::make_unique<CaloEnergy>(caloParamMop->deltaE(), caloParamMop->sigmaDeltaE(),
451  caloParamMop->sigmaMinusDeltaE(), caloParamMop->sigmaPlusDeltaE(), lossType);
452  } else {
453  ++m_countMean;
454  caloEnergy =
455  std::make_unique<CaloEnergy>(caloParamMean->deltaE(), caloParamMean->sigmaDeltaE(),
456  caloParamMean->sigmaMinusDeltaE(), caloParamMean->sigmaPlusDeltaE(), lossType);
457  }
458  ATH_MSG_VERBOSE(" CaloEnergy FSR : Small deposit, FinalMeasuredEnergyNoEm " << FinalMeasuredEnergyNoEm
459  << " using Eloss " << caloEnergy->deltaE());
460  } else {
461  // significant hadronic energy deposit
463  lossType = CaloEnergy::FSRcandidate;
464  double FinalEnergyErrorNoEm = 0.50 * std::sqrt(FinalMeasuredEnergyNoEm / Units::GeV) * Units::GeV;
465  FinalEnergyErrorNoEm = std::hypot(FinalEnergyErrorNoEm, MopErrorEm);
466  caloEnergy = std::make_unique<CaloEnergy>(FinalMeasuredEnergyNoEm, FinalEnergyErrorNoEm, FinalEnergyErrorNoEm,
467  FinalEnergyErrorNoEm, lossType);
468  ATH_MSG_VERBOSE(" CaloEnergy FSR : Large deposit, FinalMeasuredEnergyNoEm " << FinalMeasuredEnergyNoEm);
469  }
470  }
471  } else {
472  // lossType NotIsolated: MOP or Mean according to configuration
473  if (m_MOPparametrization) {
474  ++m_countMop;
475  caloEnergy = std::make_unique<CaloEnergy>(caloParamMop->deltaE(), caloParamMop->sigmaDeltaE(),
476  caloParamMop->sigmaMinusDeltaE(), caloParamMop->sigmaPlusDeltaE(), lossType);
477  } else {
478  ++m_countMean;
479  caloEnergy = std::make_unique<CaloEnergy>(caloParamMean->deltaE(), caloParamMean->sigmaDeltaE(),
480  caloParamMean->sigmaMinusDeltaE(), caloParamMean->sigmaPlusDeltaE(), lossType);
481  }
482  }
483 
484  caloEnergy->set_fsrCandidateEnergy(MopLossEm);
485  return caloEnergy;
486  }

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

◆ muSpecResolParam()

double MuidCaloEnergyTool::muSpecResolParam ( double  trackMomentum,
double  eta 
)
staticprivate

Definition at line 488 of file MuidCaloEnergyTool.cxx.

488  {
489  const double pT = trackMomentum / std::cosh(eta) / Units::GeV; // pt in GeV
490  double a = 0.;
491  double b = 0.;
492  if (std::abs(eta) < 1.) {
493  a = 0.02255;
494  b = 7.708e-5;
495  } else if (std::abs(eta) > 1. && std::abs(eta) < 2.) {
496  a = 0.04198;
497  b = 8.912e-5;
498  } else {
499  a = 0.02181;
500  b = 7.282e-5;
501  }
502  return std::hypot(a, (b * pT));
503  }

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

◆ paramCorrection()

double MuidCaloEnergyTool::paramCorrection ( double  trackMomentum,
double  eta,
double  MopLoss,
double  MopSigma 
)
staticprivate

Definition at line 505 of file MuidCaloEnergyTool.cxx.

505  {
506  const double Nsigma = 2.;
507  double MSres = muSpecResolParam(trackMomentum, eta);
508  double MSsigma = trackMomentum * MSres;
509  double sigma = std::hypot(MSsigma, MopLossSigma);
510  double sum = 0.;
511  double weight = 0.;
512  double xlow = MopLoss - Nsigma * sigma;
513  if (xlow < 0.) xlow = 0.;
514  double xup = MopLoss + Nsigma * sigma;
515  int Na = 50;
516  const double inv_Na = 1. / static_cast<double>(Na);
517  for (int j = 0; j < Na; ++j) {
518  double x = xlow + j * (xup - xlow) * inv_Na;
519  double w = landau(x, MopLoss, MopLossSigma, true);
520  sum += x * w;
521  weight += w;
522  }
523  double MopStat = sum / weight;
524  return MopStat;
525  }

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

◆ trackStateOnSurface()

std::unique_ptr< Trk::TrackStateOnSurface > MuidCaloEnergyTool::trackStateOnSurface ( const EventContext &  ctx,
const Trk::TrackParameters middleParameters,
const Trk::TrackParameters innerParameters,
const Trk::TrackParameters outerParameters 
) const
overridevirtual

IMuidCaloEnergy interface: TrackStateOnSurface for parameters and energyLoss at the calorimeter mid-surface.

WARN in case of anomalously high loss

The Trk::MaterialEffectsOnTrack contain an observer pointer of the associated surface instead of an real copy. Given that the method does no longer take ownership. Let's clone the Track parameters here, which have a real copy and pipe their surface to the ctor.

Cache the quantities for the debug message before moving the caloEnergy

Implements Rec::IMuidCaloEnergy.

Definition at line 156 of file MuidCaloEnergyTool.cxx.

159  {
160  ATH_MSG_VERBOSE("Muon with : p = " << middleParameters.momentum().mag() / Units::GeV << " Phi = "
161  << middleParameters.position().phi() << " Eta = " << middleParameters.position().eta());
162 
163  std::unique_ptr<CaloEnergy> caloEnergy;
165  // energy deposition according to the calo measurement
166  const double eta = middleParameters.position().eta();
167  const double phi = middleParameters.position().phi();
168  const double etaEM = innerParameters ? innerParameters->position().eta() : eta;
169  const double phiEM = innerParameters ? innerParameters->position().phi() : phi;
170  const double etaHad = outerParameters ? outerParameters->position().eta() : eta;
171  const double phiHad = outerParameters ? outerParameters->position().phi() : phi;
172  std::unique_ptr<CaloMeas> caloMeas{m_caloMeasTool->energyMeasurement(ctx, etaEM, phiEM, etaHad, phiHad)};
173  if (caloMeas) { caloEnergy = measurement(ctx, middleParameters.momentum().mag(), eta, phi, *caloMeas); }
174  }
175 
176  if (!caloEnergy) {
177  // parametrized energy deposition
178  ATH_MSG_DEBUG("Calculate parametrized energy loss");
179  caloEnergy =
180  energyLoss(ctx, middleParameters.momentum().mag(), middleParameters.position().eta(), middleParameters.position().phi());
182  if (caloEnergy->deltaE() > 8. * Units::GeV && middleParameters.momentum().mag() < 500. * Units::GeV)
183  ATH_MSG_WARNING(" high parametrized energy loss: " << caloEnergy->deltaE() / Units::GeV << " GeV"
184  << " for p " << middleParameters.momentum().mag() / Units::GeV
185  << " GeV"
186  << " eta " << middleParameters.position().eta());
187  }
188  // create MEOT owning CaloEnergy
189  std::bitset<Trk::MaterialEffectsBase::NumberOfMaterialEffectsTypes> typePattern(0);
194 
195  std::unique_ptr<Trk::TrackParameters> middle_clone = middleParameters.uniqueClone();
197  const CaloEnergy::EnergyLossType eLossType = caloEnergy->energyLossType();
198  const double dE = caloEnergy->deltaE() / Units::GeV;
199  const double sigPlus_dE = caloEnergy->sigmaPlusDeltaE() / Units::GeV;
200  const double sigMinus_dE = caloEnergy->sigmaMinusDeltaE() / Units::GeV;
201  const double sig_dE = caloEnergy->sigmaDeltaE() / Units::GeV;
202  //
203  auto materialEffects =
204  std::make_unique<Trk::MaterialEffectsOnTrack>(
205  0.,
206  std::move(caloEnergy),
207  middle_clone->associatedSurface(),
208  typePattern);
209 
210  // create TSOS
211  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> pattern(0);
213 
214  // debugging
215  if (msgLvl(MSG::DEBUG)) {
216  std::string eLossTypeStr = " no Calo !!";
217  switch (eLossType) {
218  case CaloEnergy::Parametrized: eLossTypeStr = "Parametrized"; break;
219  case CaloEnergy::NotIsolated: eLossTypeStr = "NotIsolated "; break;
220  case CaloEnergy::MOP: eLossTypeStr = "MOP "; break;
221  case CaloEnergy::Tail: eLossTypeStr = "Tail "; break;
222  case CaloEnergy::FSRcandidate: eLossTypeStr = "FSRcandidate"; break;
223  default: break;
224  };
225  ATH_MSG_DEBUG(std::setiosflags(std::ios::fixed)
226  << " trackStateOnSurface with"
227  << " momentum =" << std::setw(6) << std::setprecision(1) << middleParameters.momentum().mag() / Units::GeV
228  << " phi =" << std::setw(6) << std::setprecision(3) << middleParameters.position().phi()
229  << " eta =" << std::setw(6) << std::setprecision(3) << middleParameters.position().eta()
230  << ". CaloEnergy: deltaE = " << std::setw(8) << std::setprecision(3) << dE
231  << " +" << std::setw(5) << std::setprecision(3) << sigPlus_dE << " -"
232  << std::setw(5) << std::setprecision(3) << sigMinus_dE << " (" << std::setw(5)
233  << std::setprecision(3) << sig_dE << ") GeV, CaloEnergy::Type " << eLossTypeStr);
234  }
235  return std::make_unique<Trk::TrackStateOnSurface>(
236  nullptr, std::move(middle_clone), std::move(materialEffects), pattern);
237  }

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

ToolHandle<IMuidCaloEnergyMeas> Rec::MuidCaloEnergyTool::m_caloMeasTool
private
Initial value:
{
this,
"CaloMeasTool",
"Rec::MuidCaloEnergyMeas/MuidCaloEnergyMeas",
}

Definition at line 70 of file MuidCaloEnergyTool.h.

◆ m_caloParamTool

ToolHandle<IMuidCaloEnergyParam> Rec::MuidCaloEnergyTool::m_caloParamTool
private
Initial value:
{
this,
"CaloParamTool",
"Rec::MuidCaloEnergyParam/MuidCaloEnergyParam",
}

Definition at line 75 of file MuidCaloEnergyTool.h.

◆ m_cosmics

bool Rec::MuidCaloEnergyTool::m_cosmics
private

Definition at line 87 of file MuidCaloEnergyTool.h.

◆ m_countMean

std::atomic_int Rec::MuidCaloEnergyTool::m_countMean {0}
mutableprivate

Definition at line 104 of file MuidCaloEnergyTool.h.

◆ m_countMeasurement

std::atomic_int Rec::MuidCaloEnergyTool::m_countMeasurement {0}
mutableprivate

Definition at line 105 of file MuidCaloEnergyTool.h.

◆ m_countMop

std::atomic_int Rec::MuidCaloEnergyTool::m_countMop {0}
mutableprivate

Definition at line 106 of file MuidCaloEnergyTool.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_emEtCut

double Rec::MuidCaloEnergyTool::m_emEtCut
private

Definition at line 95 of file MuidCaloEnergyTool.h.

◆ m_emF1Cut

double Rec::MuidCaloEnergyTool::m_emF1Cut
private

Definition at line 96 of file MuidCaloEnergyTool.h.

◆ m_emMinEnergy

double Rec::MuidCaloEnergyTool::m_emMinEnergy
private

Definition at line 97 of file MuidCaloEnergyTool.h.

◆ m_energyLossMeasurement

bool Rec::MuidCaloEnergyTool::m_energyLossMeasurement
private

Definition at line 88 of file MuidCaloEnergyTool.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_forceIsolationFailure

bool Rec::MuidCaloEnergyTool::m_forceIsolationFailure
private

Definition at line 89 of file MuidCaloEnergyTool.h.

◆ m_FSRtreatment

bool Rec::MuidCaloEnergyTool::m_FSRtreatment
private

Definition at line 90 of file MuidCaloEnergyTool.h.

◆ m_hecMinEnergy

double Rec::MuidCaloEnergyTool::m_hecMinEnergy
private

Definition at line 98 of file MuidCaloEnergyTool.h.

◆ m_maxNTracksIso

int Rec::MuidCaloEnergyTool::m_maxNTracksIso
private

Definition at line 99 of file MuidCaloEnergyTool.h.

◆ m_minFinalEnergy

double Rec::MuidCaloEnergyTool::m_minFinalEnergy
private

Definition at line 100 of file MuidCaloEnergyTool.h.

◆ m_minMuonPt

double Rec::MuidCaloEnergyTool::m_minMuonPt
private

Definition at line 101 of file MuidCaloEnergyTool.h.

◆ m_MOPparametrization

bool Rec::MuidCaloEnergyTool::m_MOPparametrization
private

Definition at line 91 of file MuidCaloEnergyTool.h.

◆ m_trackIsolation

bool Rec::MuidCaloEnergyTool::m_trackIsolation
private

Definition at line 92 of file MuidCaloEnergyTool.h.

◆ m_trackIsolationTool

ToolHandle<IMuidTrackIsolation> Rec::MuidCaloEnergyTool::m_trackIsolationTool
private
Initial value:
{
this,
"TrackIsolationTool",
"Rec::MuidTrackIsolation/MuidTrackIsolation",
}

Definition at line 80 of file MuidCaloEnergyTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
str::trackMomentum
const std::string trackMomentum
Definition: BTagTrackIpAccessor.cxx:15
Rec::MuidCaloEnergyTool::m_forceIsolationFailure
bool m_forceIsolationFailure
Definition: MuidCaloEnergyTool.h:89
CaloEnergy::Tail
@ Tail
Definition: CaloEnergy.h:43
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:25
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Trk::EnergyLoss::sigmaMinusDeltaE
double sigmaMinusDeltaE() const
returns the negative side
python.HION7.pTCut
int pTCut
Definition: HION7.py:72
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
test_pyathena.eta
eta
Definition: test_pyathena.py:10
Trk::TrackStateOnSurface::CaloDeposit
@ CaloDeposit
This TSOS contains a CaloEnergy object.
Definition: TrackStateOnSurface.h:135
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:18
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
Rec::MuidCaloEnergyTool::paramCorrection
static double paramCorrection(double trackMomentum, double eta, double MopLoss, double MopSigma)
Definition: MuidCaloEnergyTool.cxx:505
CaloEnergy::EnergyLossType
EnergyLossType
Calo Energy Loss Type Parametrized : reconstruction configured to use the parametrization w/o looking...
Definition: CaloEnergy.h:43
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Rec::MuidCaloEnergyTool::m_minFinalEnergy
double m_minFinalEnergy
Definition: MuidCaloEnergyTool.h:100
OfflineHitType::InertMaterial
@ InertMaterial
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
Rec::MuidCaloEnergyTool::m_countMean
std::atomic_int m_countMean
Definition: MuidCaloEnergyTool.h:104
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
Trk::ParametersBase::uniqueClone
std::unique_ptr< ParametersBase< DIM, T > > uniqueClone() const
clone method for polymorphic deep copy returning unique_ptr; it is not overriden, but uses the existi...
Definition: ParametersBase.h:97
Rec::MuidCaloEnergyTool::m_caloMeasTool
ToolHandle< IMuidCaloEnergyMeas > m_caloMeasTool
Definition: MuidCaloEnergyTool.h:70
Rec::MuidCaloEnergyTool::m_emEtCut
double m_emEtCut
Definition: MuidCaloEnergyTool.h:95
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
Trk::EnergyLoss::sigmaDeltaE
double sigmaDeltaE() const
returns the symmatric error
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Rec::MuidCaloEnergyTool::m_energyLossMeasurement
bool m_energyLossMeasurement
Definition: MuidCaloEnergyTool.h:88
Rec::MuidCaloEnergyTool::m_MOPparametrization
bool m_MOPparametrization
Definition: MuidCaloEnergyTool.h:91
Rec::MuidCaloEnergyTool::muSpecResolParam
static double muSpecResolParam(double trackMomentum, double eta)
Definition: MuidCaloEnergyTool.cxx:488
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
x
#define x
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
Rec::MuidCaloEnergyTool::m_emF1Cut
double m_emF1Cut
Definition: MuidCaloEnergyTool.h:96
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
python.SystemOfUnits.MeV
float MeV
Definition: SystemOfUnits.py:172
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:190
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
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
Rec::MuidCaloEnergyTool::m_cosmics
bool m_cosmics
Definition: MuidCaloEnergyTool.h:87
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
python.SystemOfUnits.us
float us
Definition: SystemOfUnits.py:149
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
CaloEnergy::energyLossType
CaloEnergy::EnergyLossType energyLossType(void) const
Accessor methods.
Definition: CaloEnergy.h:162
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Rec::MuidCaloEnergyTool::m_maxNTracksIso
int m_maxNTracksIso
Definition: MuidCaloEnergyTool.h:99
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
Rec::MuidCaloEnergyTool::landau
static double landau(double x, double mpv, double sigma, bool norm)
Definition: MuidCaloEnergyTool.cxx:527
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
Rec::MuidCaloEnergyTool::m_caloParamTool
ToolHandle< IMuidCaloEnergyParam > m_caloParamTool
Definition: MuidCaloEnergyTool.h:75
Trk::EnergyLoss::deltaE
double deltaE() const
returns the
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Rec::MuidCaloEnergyTool::m_FSRtreatment
bool m_FSRtreatment
Definition: MuidCaloEnergyTool.h:90
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Rec::MuidCaloEnergyTool::measurement
std::unique_ptr< CaloEnergy > measurement(const EventContext &ctx, double trackMomentum, double eta, double phi, const CaloMeas &caloMeas) const
Definition: MuidCaloEnergyTool.cxx:241
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:
CaloEnergy::FSRcandidate
@ FSRcandidate
Definition: CaloEnergy.h:43
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
Rec::MuidCaloEnergyTool::m_countMeasurement
std::atomic_int m_countMeasurement
Definition: MuidCaloEnergyTool.h:105
Trk::MaterialEffectsBase::EnergyLossEffects
@ EnergyLossEffects
contains energy loss corrections
Definition: MaterialEffectsBase.h:48
python.PyAthena.v
v
Definition: PyAthena.py:154
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
Rec::MuidCaloEnergyTool::m_trackIsolationTool
ToolHandle< IMuidTrackIsolation > m_trackIsolationTool
Definition: MuidCaloEnergyTool.h:80
CaloEnergy::set_fsrCandidateEnergy
void set_fsrCandidateEnergy(const float fs)
FSR Candidate Energy.
Definition: CaloEnergy.h:118
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloEnergy::Parametrized
@ Parametrized
Definition: CaloEnergy.h:43
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
CaloEnergy::NotIsolated
@ NotIsolated
Definition: CaloEnergy.h:43
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
Rec::MuidCaloEnergyTool::m_countMop
std::atomic_int m_countMop
Definition: MuidCaloEnergyTool.h:106
CaloEnergy::MOP
@ MOP
Definition: CaloEnergy.h:43
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:198
TRTCalib_cfilter.p3
p3
Definition: TRTCalib_cfilter.py:132
Rec::MuidCaloEnergyTool::m_minMuonPt
double m_minMuonPt
Definition: MuidCaloEnergyTool.h:101
Trk::EnergyLoss::sigmaPlusDeltaE
double sigmaPlusDeltaE() const
returns the positive side
Rec::MuidCaloEnergyTool::m_trackIsolation
bool m_trackIsolation
Definition: MuidCaloEnergyTool.h:92
fitman.k
k
Definition: fitman.py:528
Rec::MuidCaloEnergyTool::m_hecMinEnergy
double m_hecMinEnergy
Definition: MuidCaloEnergyTool.h:98
Rec::MuidCaloEnergyTool::m_emMinEnergy
double m_emMinEnergy
Definition: MuidCaloEnergyTool.h:97
Rec::MuidCaloEnergyTool::energyLoss
std::unique_ptr< CaloEnergy > energyLoss(const EventContext &ctx, double trackMomentum, double eta, double phi) const override
IMuidCaloEnergy interface: to get the total energyLoss in the calorimeters.
Definition: MuidCaloEnergyTool.cxx:111