ATLAS Offline Software
MonitorElectronAlgorithm.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 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 MonitorElectronAlgorithm_H
10 #define MonitorElectronAlgorithm_H
11 
15 
16 #include "xAODEgamma/Electron.h"
19 
20 #include <string>
21 
23 public:
24  MonitorElectronAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
25  virtual ~MonitorElectronAlgorithm() = 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 
33  SG::ReadHandleKey<xAOD::ElectronContainer> m_ParticleContainerKey {this, "ParticleContainerName", "Electrons", "Name of electron container" };
34  SG::ReadDecorHandleKeyArray<xAOD::ElectronContainer> m_ElectronIsolationKey {this, "ElectronIsolationKey", {"Electrons.ptcone20", "Electrons.topoetcone40"} };
35  Gaudi::Property<std::string> m_ParticlePrefix {this,"ParticlePrefix","electron","Name of the particle prefix to be used to define hists"};
36  Gaudi::Property<std::string> m_RecoName {this,"RecoName","LHTight","Name of particle flavor in egamma reco"};
37  Gaudi::Property<std::string> m_WithTrigger {this,"WithTrigger","","Name extension when electrons are chosen from triggered events"};
38 
39  Regions GetRegion(Float_t eta) const {
40  Float_t aeta = fabs(eta);
41  // check if object is in barrel
42  if ( aeta < 1.37 ) return MonitorElectronAlgorithm::BARREL;
43  // check if object is in end-caps
44  if ( aeta > 1.52 && aeta < 2.47 ) return MonitorElectronAlgorithm::ENDCAP;
45  // check if object is in crack region
46  if ( aeta > 1.37 && aeta < 1.52 ) return MonitorElectronAlgorithm::CRACK;
47  return MonitorElectronAlgorithm::NREGIONS; // out of acceptance
48  }
49 
50 };
51 #endif
MonitorElectronAlgorithm::CRACK
@ CRACK
Definition: MonitorElectronAlgorithm.h:29
MonitorElectronAlgorithm::m_ParticleContainerKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_ParticleContainerKey
Definition: MonitorElectronAlgorithm.h:33
MonitorElectronAlgorithm::fillHistograms
StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: MonitorElectronAlgorithm.cxx:24
MonitorElectronAlgorithm::ENDCAP
@ ENDCAP
Definition: MonitorElectronAlgorithm.h:29
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
MonitorElectronAlgorithm::m_WithTrigger
Gaudi::Property< std::string > m_WithTrigger
Definition: MonitorElectronAlgorithm.h:37
ElectronxAODHelpers.h
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
MonitorElectronAlgorithm::BARREL
@ BARREL
Definition: MonitorElectronAlgorithm.h:29
SG::ReadHandleKey< xAOD::ElectronContainer >
MonitorElectronAlgorithm::~MonitorElectronAlgorithm
virtual ~MonitorElectronAlgorithm()=default
MonitorElectronAlgorithm::m_ParticlePrefix
Gaudi::Property< std::string > m_ParticlePrefix
Definition: MonitorElectronAlgorithm.h:35
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
ElectronContainer.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthMonitorAlgorithm.h
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
MonitorElectronAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: MonitorElectronAlgorithm.cxx:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MonitorElectronAlgorithm::Regions
Regions
Definition: MonitorElectronAlgorithm.h:29
MonitorElectronAlgorithm
Definition: MonitorElectronAlgorithm.h:22
MonitorElectronAlgorithm::NREGIONS
@ NREGIONS
Definition: MonitorElectronAlgorithm.h:29
MonitorElectronAlgorithm::m_RecoName
Gaudi::Property< std::string > m_RecoName
Definition: MonitorElectronAlgorithm.h:36
MonitorElectronAlgorithm::GetRegion
Regions GetRegion(Float_t eta) const
Definition: MonitorElectronAlgorithm.h:39
MonitorElectronAlgorithm::m_ElectronIsolationKey
SG::ReadDecorHandleKeyArray< xAOD::ElectronContainer > m_ElectronIsolationKey
Definition: MonitorElectronAlgorithm.h:34
Electron.h
MonitorElectronAlgorithm::FORWARD
@ FORWARD
Definition: MonitorElectronAlgorithm.h:29
MonitorElectronAlgorithm::MonitorElectronAlgorithm
MonitorElectronAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MonitorElectronAlgorithm.cxx:10
ReadDecorHandleKeyArray.h