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 > &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 > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

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 41 of file MuidCaloEnergyTool.cxx.

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

◆ ~MuidCaloEnergyTool()

MuidCaloEnergyTool::~MuidCaloEnergyTool ( void  )
default

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ 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 113 of file MuidCaloEnergyTool.cxx.

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

◆ 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 106 of file MuidCaloEnergyTool.cxx.

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

◆ initialize()

StatusCode MuidCaloEnergyTool::initialize ( )
override

Definition at line 76 of file MuidCaloEnergyTool.cxx.

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

◆ 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 524 of file MuidCaloEnergyTool.cxx.

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

◆ measurement()

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

Definition at line 238 of file MuidCaloEnergyTool.cxx.

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

◆ 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 485 of file MuidCaloEnergyTool.cxx.

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

◆ 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 502 of file MuidCaloEnergyTool.cxx.

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

◆ 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 pointer for the debug message

Implements Rec::IMuidCaloEnergy.

Definition at line 158 of file MuidCaloEnergyTool.cxx.

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

◆ 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:26
Trk::EnergyLoss::sigmaMinusDeltaE
double sigmaMinusDeltaE() const
returns the negative side
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
Trk::TrackStateOnSurface::CaloDeposit
@ CaloDeposit
This TSOS contains a CaloEnergy object.
Definition: TrackStateOnSurface.h:135
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
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:502
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
CaloEnergy::EnergyLossType
EnergyLossType
Calo Energy Loss Type Parametrized : reconstruction configured to use the parametrization w/o looking...
Definition: CaloEnergy.h:43
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloEnergy
class extending the basic Trk::EnergyLoss to describe the measured or parameterised muon energy loss ...
Definition: CaloEnergy.h:28
Rec::MuidCaloEnergyTool::m_minFinalEnergy
double m_minFinalEnergy
Definition: MuidCaloEnergyTool.h:100
OfflineHitType::InertMaterial
@ InertMaterial
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
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.
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
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:485
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:83
Rec::MuidCaloEnergyTool::m_emF1Cut
double m_emF1Cut
Definition: MuidCaloEnergyTool.h:96
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
ParticleJetTools::p3
Amg::Vector3D p3(const xAOD::TruthVertex *p)
Definition: ParticleJetLabelCommon.cxx:55
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
Rec::MuidCaloEnergyTool::m_cosmics
bool m_cosmics
Definition: MuidCaloEnergyTool.h:87
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:524
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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:238
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:192
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
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:157
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
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
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:200
Rec::MuidCaloEnergyTool::m_minMuonPt
double m_minMuonPt
Definition: MuidCaloEnergyTool.h:101
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::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:113