ATLAS Offline Software
TrigL2CaloLayersHypoTool.cxx
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4 */
5 
9 
11 
12 
13 using namespace TrigCompositeUtils;
14 
16  const std::string& name,
17  const IInterface* parent )
18  : base_class( type, name, parent ),
19  m_decisionId( HLT::Identifier::fromToolName( name ) )
20 {
21 }
22 
24 
25 
26  ATH_MSG_INFO("TrigL2CaloLayersHypoTool initialization completed successfully.");
27 
28  /*
29  if ( not m_monTool.name().empty() )
30  CHECK( m_monTool.retrieve() );
31  */
32 
33 
34  return StatusCode::SUCCESS;
35 }
36 
37 
38 StatusCode TrigL2CaloLayersHypoTool::decide( std::vector<ITrigL2CaloLayersHypoTool::CaloLayersInfo>& input ) const {
39 
40  for ( auto& i: input ) {
41  if ( passed ( m_decisionId.numeric(), i.previousDecisionIDs ) ) {
42  if ( decide( i ) ) {
43  addDecisionID( m_decisionId, i.decision );
44  }
45  }
46  }
47  return StatusCode::SUCCESS;
48 }
49 
51 
52  if (m_acceptAll) return true;
53  // no clusters no discussion
54  if ( !input.clusters ) return false;
55  //bool pass=false;
56 
57  // get cluster
58  const xAOD::TrigEMCluster* pClus = input.clusters->front();
59  //m_preSampFrac=m_preSamp=m_monEta=m_monPhi=m_Energy=-9999.0;
60 
61  if ( !pClus or (pClus->energy()<0.1) or (fabsf(pClus->eta())>2.1) ) {
62  ATH_MSG_DEBUG ("No EM cluster in RoI" );
63  return false;
64  }
65 
66  //m_monEta = pClus->eta();
67  //m_monPhi = pClus->phi();
68 
69  // increment event counter
70  //m_PassedCuts++; //// the ROI at least contais the cluster
71 
72  std::vector<double> fracs;
73  for(int i=0;i<4;i++){
74  fracs.push_back(0);
75  fracs[i] = (pClus->energy( ((CaloSampling::CaloSample)i) )+pClus->energy( ((CaloSampling::CaloSample)(i+4)) ))/pClus->energy();
76  }
77  //m_Energy = pClus->energy();
78 
79  if ( fracs[0] > m_EnergyFracCut[0] ) return false;
80  //m_PassedCuts++; ////
81  //m_preSampFrac = fracs[0];
82 
83  if ( (pClus->energy( ((CaloSampling::CaloSample)0) ) + pClus->energy( ((CaloSampling::CaloSample)4) ) ) > m_EnergyAbsCut[0] ) return false;
84  //m_PassedCuts++; ////
85  //m_preSamp = (fracs[0])*pClus->energy();
86 
87  ATH_MSG_DEBUG("L2 Calo Layers passed");
88 
89  return true;
90 }
xAOD::TrigEMCluster_v1::eta
float eta() const
get Eta (calibrated)
TrigL2CaloLayersHypoTool::initialize
virtual StatusCode initialize() override
Definition: TrigL2CaloLayersHypoTool.cxx:23
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
HLT::Identifier::numeric
TrigCompositeUtils::DecisionID numeric() const
numeric ID
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:47
TrigL2CaloLayersHypoTool::m_acceptAll
Gaudi::Property< bool > m_acceptAll
Definition: TrigL2CaloLayersHypoTool.h:36
TrigL2CaloLayersHypoTool.h
ITrigL2CaloLayersHypoTool::CaloLayersInfo
Definition: ITrigL2CaloLayersHypoTool.h:27
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition: TrigCompositeUtilsRoot.cxx:61
TrigL2CaloLayersHypoTool::TrigL2CaloLayersHypoTool
TrigL2CaloLayersHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigL2CaloLayersHypoTool.cxx:15
TrigL2CaloLayersHypoTool::m_EnergyAbsCut
Gaudi::Property< std::vector< float > > m_EnergyAbsCut
Definition: TrigL2CaloLayersHypoTool.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
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
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
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigL2CaloLayersHypoTool::decide
virtual StatusCode decide(std::vector< CaloLayersInfo > &input) const override
Combinators.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HLTIdentifier.h
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
TrigL2CaloLayersHypoTool::m_EnergyFracCut
Gaudi::Property< std::vector< float > > m_EnergyFracCut
Definition: TrigL2CaloLayersHypoTool.h:34
xAOD::TrigEMCluster_v1
Description of a trigger EM cluster.
Definition: TrigEMCluster_v1.h:28
TrigL2CaloLayersHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigL2CaloLayersHypoTool.h:32
xAOD::TrigEMCluster_v1::energy
float energy() const
get Energy (calibrated)
Identifier
Definition: IdentifierFieldParser.cxx:14