ATLAS Offline Software
Loading...
Searching...
No Matches
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
23public:
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
31private:
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
Scalar eta() const
pseudorapidity method
Header file to be included by clients of the Monitored infrastructure.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Gaudi::Property< std::string > m_WithTrigger
virtual ~MonitorElectronAlgorithm()=default
SG::ReadHandleKey< xAOD::ElectronContainer > m_ParticleContainerKey
StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Gaudi::Property< std::string > m_RecoName
Regions GetRegion(Float_t eta) const
virtual StatusCode initialize() override
initialize
Gaudi::Property< std::string > m_ParticlePrefix
SG::ReadDecorHandleKeyArray< xAOD::ElectronContainer > m_ElectronIsolationKey
MonitorElectronAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Property holding a SG store/key/clid from which a ReadHandle is made.
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray