ATLAS Offline Software
MonitorPhotonAlgorithm.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 
4  Author : B. Laforge (laforge@lpnhe.in2p3.fr)
5  4 May 2020
6 */
7 
8 
9 #ifndef MonitorPhotonAlgorithm_H
10 #define MonitorPhotonAlgorithm_H
11 
15 
16 #include "xAODEgamma/Photon.h"
19 
20 #include <string>
21 
23  public:
24  MonitorPhotonAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
25  virtual ~MonitorPhotonAlgorithm() = default;
26  virtual StatusCode initialize() override;
27  StatusCode fillHistograms( const EventContext& ctx ) const override;
28 
29  enum Regions : int { BARREL=0, CRACK, ENDCAP, FORWARD, NREGIONS };
30 
31  private:
32  SG::ReadHandleKey<xAOD::PhotonContainer> m_ParticleContainerKey {this, "ParticleContainerName", "Photons", "Name of electron container" };
33  SG::ReadDecorHandleKeyArray<xAOD::PhotonContainer> m_PhotonIsolationKey {this, "PhotonIsolationKey", {"Photons.ptcone20", "Photons.topoetcone40"} };
34  Gaudi::Property<std::string> m_ParticlePrefix {this,"ParticlePrefix","photon","Name of the particle prefix to be used to define hists"};
35  Gaudi::Property<std::string> m_RecoName {this,"RecoName","Tight","Name of particle flavor in egamma reco"};
36  Gaudi::Property<std::string> m_WithTrigger {this,"WithTrigger","","Name extension when electrons are chosen from triggered events"};
37 
38  Regions GetRegion(Float_t eta) const {
39  Float_t aeta = fabs(eta);
40  // check if object is in barrel
41  if ( aeta < 1.37 ) return MonitorPhotonAlgorithm::BARREL;
42  // check if object is in end-caps
43  if ( aeta > 1.52 && aeta < 2.47 ) return MonitorPhotonAlgorithm::ENDCAP;
44  // check if object is in crack region
45  if ( aeta > 1.37 && aeta < 1.52 ) return MonitorPhotonAlgorithm::CRACK;
46  return MonitorPhotonAlgorithm::NREGIONS; // out of acceptance
47  }
48 
49 };
50 #endif
MonitorPhotonAlgorithm::fillHistograms
StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: MonitorPhotonAlgorithm.cxx:23
MonitorPhotonAlgorithm::MonitorPhotonAlgorithm
MonitorPhotonAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MonitorPhotonAlgorithm.cxx:10
MonitorPhotonAlgorithm::m_RecoName
Gaudi::Property< std::string > m_RecoName
Definition: MonitorPhotonAlgorithm.h:35
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
MonitorPhotonAlgorithm::CRACK
@ CRACK
Definition: MonitorPhotonAlgorithm.h:29
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
MonitorPhotonAlgorithm::ENDCAP
@ ENDCAP
Definition: MonitorPhotonAlgorithm.h:29
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
MonitorPhotonAlgorithm::FORWARD
@ FORWARD
Definition: MonitorPhotonAlgorithm.h:29
MonitorPhotonAlgorithm
Definition: MonitorPhotonAlgorithm.h:22
Photon.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthMonitorAlgorithm.h
PhotonxAODHelpers.h
MonitorPhotonAlgorithm::m_WithTrigger
Gaudi::Property< std::string > m_WithTrigger
Definition: MonitorPhotonAlgorithm.h:36
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
MonitorPhotonAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: MonitorPhotonAlgorithm.cxx:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MonitorPhotonAlgorithm::GetRegion
Regions GetRegion(Float_t eta) const
Definition: MonitorPhotonAlgorithm.h:38
MonitorPhotonAlgorithm::NREGIONS
@ NREGIONS
Definition: MonitorPhotonAlgorithm.h:29
MonitorPhotonAlgorithm::m_ParticlePrefix
Gaudi::Property< std::string > m_ParticlePrefix
Definition: MonitorPhotonAlgorithm.h:34
MonitorPhotonAlgorithm::m_ParticleContainerKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_ParticleContainerKey
Definition: MonitorPhotonAlgorithm.h:32
MonitorPhotonAlgorithm::~MonitorPhotonAlgorithm
virtual ~MonitorPhotonAlgorithm()=default
PhotonContainer.h
MonitorPhotonAlgorithm::m_PhotonIsolationKey
SG::ReadDecorHandleKeyArray< xAOD::PhotonContainer > m_PhotonIsolationKey
Definition: MonitorPhotonAlgorithm.h:33
ReadDecorHandleKeyArray.h
MonitorPhotonAlgorithm::BARREL
@ BARREL
Definition: MonitorPhotonAlgorithm.h:29
MonitorPhotonAlgorithm::Regions
Regions
Definition: MonitorPhotonAlgorithm.h:29