ATLAS Offline Software
Loading...
Searching...
No Matches
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
13using 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
38StatusCode 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}
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Header file to be included by clients of the Monitored infrastructure.
TrigCompositeUtils::DecisionID numeric() const
numeric ID
virtual StatusCode initialize() override
Gaudi::Property< std::vector< float > > m_EnergyAbsCut
TrigL2CaloLayersHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< std::vector< float > > m_EnergyFracCut
virtual StatusCode decide(std::vector< CaloLayersInfo > &input) const override
Gaudi::Property< bool > m_acceptAll
float eta() const
get Eta (calibrated)
float energy() const
get Energy (calibrated)
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster class.