ATLAS Offline Software
Loading...
Searching...
No Matches
egammaLargeClusterCellRecoveryTool Class Reference

Recovers large 7x11 clusters for clusters in EMB & EMEC. More...

#include <egammaLargeClusterCellRecoveryTool.h>

Inheritance diagram for egammaLargeClusterCellRecoveryTool:
Collaboration diagram for egammaLargeClusterCellRecoveryTool:

Public Member Functions

 egammaLargeClusterCellRecoveryTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor.
virtual ~egammaLargeClusterCellRecoveryTool ()=default
 Destructor.
virtual StatusCode initialize () override
 Initialize method.
virtual StatusCode execute (const xAOD::CaloCluster *cluster, const CaloDetDescrManager *cmgr, const CaloCellContainer *cell_container, Info &info) const override final
 Method to recover large clusters.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool interface methods.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< CaloClusterProcessorm_caloFillRectangularTool
 Tool to fill rectangular 7x11 cluster.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Static Private Attributes

static constexpr int m_neta = 7
static constexpr int m_nphi = 7
static constexpr double m_centEtThr = 3000.

Detailed Description

Recovers large 7x11 clusters for clusters in EMB & EMEC.

Interface for the Reconstruction/egamma/egammaCaloTools/egammaLargeClusterCellRecoveryTool.cxx.

Author
Gabriel P. Matos gpinh.nosp@m.eir@.nosp@m.cern..nosp@m.ch Following discussions with Christos Anastopoulos.

Definition at line 21 of file egammaLargeClusterCellRecoveryTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ egammaLargeClusterCellRecoveryTool()

egammaLargeClusterCellRecoveryTool::egammaLargeClusterCellRecoveryTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Constructor.

Definition at line 22 of file egammaLargeClusterCellRecoveryTool.cxx.

25 : AthAlgTool(type, name, parent) {
26 declareInterface<IegammaLargeClusterCellRecoveryTool>(this);
27}
AthAlgTool()
Default constructor:

◆ ~egammaLargeClusterCellRecoveryTool()

virtual egammaLargeClusterCellRecoveryTool::~egammaLargeClusterCellRecoveryTool ( )
virtualdefault

Destructor.

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode egammaLargeClusterCellRecoveryTool::execute ( const xAOD::CaloCluster * cluster,
const CaloDetDescrManager * cmgr,
const CaloCellContainer * cell_container,
Info & info ) const
finaloverridevirtual

Method to recover large clusters.

FIXME: this tool should probably return the cluster object

Implements IegammaLargeClusterCellRecoveryTool.

Definition at line 39 of file egammaLargeClusterCellRecoveryTool.cxx.

42 {
43 ATH_MSG_DEBUG("Executing egammaLargeClusterRecoveryTool");
44
45 if (cluster->et() < m_centEtThr) {
46 ATH_MSG_DEBUG("Cluster Et below threshold for large cluster recovery: " << cluster->et());
47 return StatusCode::SUCCESS;
48 }
49
50 if (!cluster->inBarrel() && !cluster->inEndcap()) {
51 ATH_MSG_DEBUG("Cluster not in EMB or EMEC, skipping large cluster recovery.");
52 return StatusCode::SUCCESS;
53 }
54
55 // Check if cluster is in barrel or endcap
56 bool in_barrel = egammaEnergyPositionAllSamples::inBarrel(*cluster, 2);
57 CaloSampling::CaloSample sam = CaloSampling::EMB2;
58 if (!in_barrel) {
59 sam = CaloSampling::EME2;
60 }
61
62 // (eta, phi) of the cluster in the 2nd sampling
63 auto eta = cluster->etaSample(sam);
64 auto phi = cluster->phiSample(sam);
65
66 if ((eta == 0. && phi == 0.) || std::abs(eta) > 100) {
67 ATH_MSG_WARNING("Weird input cluster, eta = " << eta
68 << " phi = " << phi);
69 return StatusCode::SUCCESS;
70 }
71
72 // Here decode_sample will overwrite these variables
73 bool barrel = false;
75 int sampling_or_module = 0;
76
78 subcalo, barrel, sampling_or_module, (CaloCell_ID::CaloSample)sam);
79
80 // Get the corresponding granularities with CaloDetDescrElement
81 const CaloDetDescrElement *dde = cmgr->get_element(
82 CaloCell_ID::LAREM, sampling_or_module, barrel, eta, phi);
83
84 // If the object does not exist then return
85 if (!dde) {
86 ATH_MSG_WARNING("Weird input cluster eta = " << eta
87 << " phi = " << phi);
88 ATH_MSG_WARNING("No detetector element for seeding");
89 return StatusCode::SUCCESS;
90 }
91
92 // Local granularity
93 auto deta = dde->deta();
94 auto dphi = dde->dphi();
95
96 // Search the hottest cell around the (eta,phi).
97 // (eta,phi) are defined as etaSample() and phiSample().
98 // Around this position a hot cell is searched for in a window
99 // (m_neta*m_deta,m_nphi*m_dphi), by default (m_neta,m_nphi)=(7,7)
100 CaloLayerCalculator calc;
101 StatusCode sc =
102 calc.fill(*cmgr, cell_container, cluster->etaSample(sam),
103 cluster->phiSample(sam), m_neta * deta, m_nphi * dphi,
105
106 if (sc.isFailure()) {
107 ATH_MSG_WARNING("CaloLayerCalculator failed to fill");
108 return StatusCode::SUCCESS;
109 }
110 double etamax = calc.etarmax();
111 double phimax = calc.phirmax();
112
113 // Create 7x11 cluster with hottest cell as seed
114 std::unique_ptr<xAOD::CaloCluster> largeCluster =
116 etamax,
117 phimax,
119
120 // Fill rectangular cluster
121 if (!m_caloFillRectangularTool->execute(Gaudi::Hive::currentContext(), largeCluster.get()).isSuccess()) {
122 ATH_MSG_WARNING("CaloFillRectangularCluster tool failed");
123 return StatusCode::SUCCESS;
124 }
125
126 // Check that 7x11 cluster has cells
127 if (largeCluster->size() == 0) {
128 ATH_MSG_WARNING("Large cluster has no cells");
129 return StatusCode::SUCCESS;
130 }
131
133 // Iterate through cells and store in info
134 for (const CaloCell* cell : *largeCluster) {
135 info.cells711.push_back(cell);
136 }
137
138 return StatusCode::SUCCESS;
139}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
CaloCell_Base_ID::SUBCALO SUBCALO
Definition CaloCell_ID.h:50
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
static std::unique_ptr< xAOD::CaloCluster > makeCluster(const CaloCellContainer *cellCont)
Creates a valid CaloCluster with a private Aux-Store and CellLink container.
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
static void decode_sample(CaloCell_ID::SUBCALO &subCalo, bool &barrel, int &sampling_or_module, CaloCell_ID::CaloSample sample)
translate between the 2 ways to label a sub-detector:
ToolHandle< CaloClusterProcessor > m_caloFillRectangularTool
Tool to fill rectangular 7x11 cluster.
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool inBarrel(const xAOD::CaloCluster &cluster, int is)
return boolean to know if we are in barrel/end-cap

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode egammaLargeClusterCellRecoveryTool::initialize ( )
overridevirtual

Initialize method.

Definition at line 29 of file egammaLargeClusterCellRecoveryTool.cxx.

29 {
30 ATH_MSG_DEBUG("Initializing egammaLargeClusterCellRecoveryTool");
31
32 if (!m_caloFillRectangularTool.empty()) {
34 }
35
36 return StatusCode::SUCCESS;
37}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & IegammaLargeClusterCellRecoveryTool::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 45 of file IegammaLargeClusterCellRecoveryTool.h.

46{
48}
static const InterfaceID IID_IegammaLargeClusterCellRecoveryTool("IegammaLargeClusterCellRecoveryTool", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_caloFillRectangularTool

ToolHandle<CaloClusterProcessor> egammaLargeClusterCellRecoveryTool::m_caloFillRectangularTool
private
Initial value:
{
this,
"CaloFillRectangularClusterTool",
"",
"Handle of the CaloFillRectangularClusterTool"
}

Tool to fill rectangular 7x11 cluster.

Definition at line 53 of file egammaLargeClusterCellRecoveryTool.h.

53 {
54 this,
55 "CaloFillRectangularClusterTool",
56 "",
57 "Handle of the CaloFillRectangularClusterTool"
58 };

◆ m_centEtThr

double egammaLargeClusterCellRecoveryTool::m_centEtThr = 3000.
staticconstexprprivate

Definition at line 50 of file egammaLargeClusterCellRecoveryTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_neta

int egammaLargeClusterCellRecoveryTool::m_neta = 7
staticconstexprprivate

Definition at line 46 of file egammaLargeClusterCellRecoveryTool.h.

◆ m_nphi

int egammaLargeClusterCellRecoveryTool::m_nphi = 7
staticconstexprprivate

Definition at line 47 of file egammaLargeClusterCellRecoveryTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: