ATLAS Offline Software
TrigHIFwdGapHypoTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TrigHIFwdGapHypoTool.h"
6 
7 #include "GaudiKernel/SystemOfUnits.h"
9 
11  const std::string& name,
12  const IInterface* parent):
13  base_class(type, name, parent),
14  m_decisionId(HLT::Identifier::fromToolName(name)) {}
15 
16 
18  ATH_MSG_DEBUG("Initializing TrigHIFwdGapHypoTool for " << name());
19  return StatusCode::SUCCESS;
20 }
21 
23  return StatusCode::SUCCESS;
24 }
25 
26 
27 StatusCode TrigHIFwdGapHypoTool::decide(const xAOD::HIEventShapeContainer* eventShapeContainer, bool& pass) const {
28  ATH_MSG_DEBUG("Executing decide() of " << name());
29 
30  float totalFCalEtSideA = 0.;
31  float totalFCalEtSideC = 0.;
32  for (const xAOD::HIEventShape* es: *eventShapeContainer) {
33  const int layer = es->layer();
34  if (layer < 21 or layer > 23) { //only use FCal information (calo samplings 21: FCAL0, 22: FCAL1, 23: FCAL2)
35  continue;
36  }
37 
38  const float et = es->et();
39  if (std::abs(et) < 0.1) { //don't add negligible energy deposits (< 0.1 MeV)
40  continue;
41  }
42 
43  const float eta = 0.5 * (es->etaMin() + es->etaMax());
44  if (eta > 0.) {
45  totalFCalEtSideA += et;
46  }
47  else {
48  totalFCalEtSideC += et;
49  }
50  }
51 
52  ATH_MSG_DEBUG("Total FCal ET: side A = " << totalFCalEtSideA << " MeV, side C = " << totalFCalEtSideC << " MeV");
53  if (m_useDoubleSidedGap) {
54  pass = (totalFCalEtSideA < m_maxFCalEt * GeV and totalFCalEtSideC < m_maxFCalEt * GeV);
55  if (pass) ATH_MSG_DEBUG("Passed max FCal ET cut of " << m_maxFCalEt * GeV << " MeV\n");
56  }
57  else {
58  if (m_useSideA) {
59  pass = (totalFCalEtSideA < m_maxFCalEt * GeV);
60  if (pass) ATH_MSG_DEBUG("Passed max FCal ET cut of " << m_maxFCalEt * GeV << " MeV on side A\n");
61  }
62  else {
63  pass = (totalFCalEtSideC < m_maxFCalEt * GeV);
64  if (pass) ATH_MSG_DEBUG("Passed max FCal ET cut of " << m_maxFCalEt * GeV << " MeV on side C\n");
65  }
66  }
67 
68  return StatusCode::SUCCESS;
69 }
70 
71 
73  return m_decisionId;
74 }
75 
et
Extra patterns decribing particle interation process.
TrigHIFwdGapHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigHIFwdGapHypoTool.h:33
xAOD::et
et
Definition: TrigEMCluster_v1.cxx:25
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
TrigHIFwdGapHypoTool::finalize
virtual StatusCode finalize() override
Definition: TrigHIFwdGapHypoTool.cxx:22
TrigHIFwdGapHypoTool::initialize
virtual StatusCode initialize() override
Definition: TrigHIFwdGapHypoTool.cxx:17
TrigHIFwdGapHypoTool::getId
virtual const HLT::Identifier & getId() const override
Definition: TrigHIFwdGapHypoTool.cxx:72
TrigHIFwdGapHypoTool::m_useDoubleSidedGap
Gaudi::Property< bool > m_useDoubleSidedGap
Definition: TrigHIFwdGapHypoTool.h:36
TrigHIFwdGapHypoTool::decide
virtual StatusCode decide(const xAOD::HIEventShapeContainer *eventShapeContainer, bool &pass) const override
Definition: TrigHIFwdGapHypoTool.cxx:27
xAOD::HIEventShape_v2
Interface class for the HI reconstruction EDM.
Definition: HIEventShape_v2.h:31
TrigHIFwdGapHypoTool::m_maxFCalEt
Gaudi::Property< float > m_maxFCalEt
Definition: TrigHIFwdGapHypoTool.h:35
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigHIFwdGapHypoTool::m_useSideA
Gaudi::Property< bool > m_useSideA
Definition: TrigHIFwdGapHypoTool.h:37
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigHIFwdGapHypoTool::TrigHIFwdGapHypoTool
TrigHIFwdGapHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigHIFwdGapHypoTool.cxx:10
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
TrigHIFwdGapHypoTool.h