ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigT2CaloEgamma
src
EgammaReHadEnFex.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// ********************************************************************
6
//
7
// NAME: EgammaReHadEnFex.cxx
8
// PACKAGE: Trigger/TrigAlgorithms/TrigT2CaloEgamma
9
//
10
// AUTHOR: M.P. Casado
11
//
12
// REFERENCES: Based on Trigger/TrigT2CaloEgamma/T2EmHadAlgorithm.cxx
13
//
14
// ********************************************************************
15
16
#include "
EgammaReHadEnFex.h
"
17
#include "CaloGeoHelpers/CaloSampling.h"
18
#include "
TrigT2CaloCommon/Calo_Def.h
"
19
#include <math.h>
20
21
EgammaReHadEnFex::EgammaReHadEnFex
(
const
std::string&
type
,
const
std::string& name,
22
const
IInterface* parent) :
23
IReAlgToolCalo
(
type
, name, parent)
24
{}
25
26
StatusCode
EgammaReHadEnFex::execute
(
xAOD::TrigEMCluster
& rtrigEmCluster,
const
IRoiDescriptor
& roi,
27
const
CaloDetDescrElement
*&
/*caloDDE*/
,
28
const
EventContext& context)
const
29
{
30
double
deta = 0.;
// eta difference current cell - seed
31
double
dphi = 0.;
// phi difference current cell - seed
32
33
CaloSampling::CaloSample
samp;
34
35
double
energyEta = rtrigEmCluster.
eta
();
36
double
energyPhi = rtrigEmCluster.
phi
();
37
rtrigEmCluster.
setEhad1
(0.);
38
39
// Dump eta-phi strip ranges into arrays
40
// Define variables here so that their scope covers both the Tile and HEC loops
41
// Use arrays of length 3 since there is no samp 0 in the HAD calorimeters
42
// this avoids wasting memory but makes the code slightly less clear
43
44
int
ncells = 0;
45
46
for
(
unsigned
int
sampling = 0; sampling < 3; sampling++) {
47
48
LArTT_Selector<LArCellCont>
sel
;
49
ATH_CHECK
(
m_dataSvc
->loadCollections(context, roi,
TTHEC
, sampling,
sel
) );
50
51
for
(
const
LArCell
* larcell :
sel
) {
52
53
ncells++;
54
double
etaCell = larcell->eta();
55
double
phiCell = larcell->phi();
56
double
energyCell = larcell->energy();
57
58
// find position of current cell w.r.t. seed
59
deta = std::abs(etaCell - energyEta);
60
dphi = std::abs(phiCell - energyPhi);
61
if
(dphi >
M_PI
) dphi = 2. *
M_PI
- dphi;
// wrap (pi - 2pi)->(-pi - 0)
62
// hadronic measurements: energy sum in 0.1*0.1
63
if
(deta <= 0.12 && dphi <= 0.12) {
64
// samp = CaloSampling::getSampling(*larcell);
65
samp = larcell->caloDDE()->getSampling();
66
rtrigEmCluster.
setEnergy
(samp, rtrigEmCluster.
energy
(samp) + energyCell);
67
rtrigEmCluster.
setRawEnergy
(samp, rtrigEmCluster.
rawEnergy
(samp) + energyCell);
68
if
(CaloSampling::HEC0 == samp) {
69
rtrigEmCluster.
setEhad1
(rtrigEmCluster.
ehad1
() + energyCell);
70
}
71
}
72
73
}
// end of loop over cells
74
75
}
// End sampling loop
76
77
// Next TILECAL
78
79
std::vector<const TileCell*> seltile;
80
ATH_CHECK
(
m_dataSvc
->loadCollections(context, roi, seltile) );
81
82
for
(
const
TileCell
* tilecell : seltile) {
// loop over cells
83
84
ncells++;
85
double
etaCell = tilecell->eta();
86
double
phiCell = tilecell->phi();
87
double
energyCell = tilecell->energy();
88
89
// find position of current cell w.r.t. seed
90
deta = std::abs(etaCell - energyEta);
91
dphi = std::abs(phiCell - energyPhi);
92
if
(dphi >
M_PI
) dphi = 2. *
M_PI
- dphi;
// wrap (pi - 2pi)->(-pi - 0)
93
// hadronic measurements: energy sum in 0.1*0.1
94
if
(deta <= 0.12 && dphi <= 0.12) {
95
// samp = CaloSampling::getSampling(*tilecell);
96
samp = tilecell->caloDDE()->getSampling();
97
rtrigEmCluster.
setEnergy
(samp, rtrigEmCluster.
energy
(samp) + energyCell);
98
rtrigEmCluster.
setRawEnergy
(samp, rtrigEmCluster.
rawEnergy
(samp) + energyCell);
99
if
((CaloSampling::TileBar0 == samp) || (CaloSampling::TileExt0 == samp) ||
100
(CaloSampling::TileGap1 == samp) || (CaloSampling::TileGap2 == samp)) {
101
rtrigEmCluster.
setEhad1
(rtrigEmCluster.
ehad1
() + energyCell);
102
}
103
}
104
105
}
// end of loop over cells
106
107
rtrigEmCluster.
setNCells
(ncells + rtrigEmCluster.
nCells
());
108
109
return
StatusCode::SUCCESS;
110
}
M_PI
#define M_PI
Definition
ActiveFraction.h:14
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
Calo_Def.h
EgammaReHadEnFex.h
TTHEC
@ TTHEC
Definition
RegSelEnums.h:29
sel
sel
Definition
SUSYToolsTester.cxx:92
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloSampling::CaloSample
CaloSample
Definition
Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
EgammaReHadEnFex::execute
virtual StatusCode execute(xAOD::TrigEMCluster &rtrigEmCluster, const IRoiDescriptor &roi, const CaloDetDescrElement *&caloDDE, const EventContext &context) const override
execute feature extraction for the EM Calorimeter second layer
Definition
EgammaReHadEnFex.cxx:26
EgammaReHadEnFex::EgammaReHadEnFex
EgammaReHadEnFex(const std::string &type, const std::string &name, const IInterface *parent)
Definition
EgammaReHadEnFex.cxx:21
IReAlgToolCalo::IReAlgToolCalo
IReAlgToolCalo(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition
IReAlgToolCalo.cxx:20
IReAlgToolCalo::m_dataSvc
ServiceHandle< ITrigCaloDataAccessSvc > m_dataSvc
Definition
IReAlgToolCalo.h:70
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition
IRoiDescriptor.h:23
LArCell
Data object for LAr calorimeter readout cell.
Definition
LArCell.h:53
LArTT_Selector
Definition
LArTT_Selector.h:15
TileCell
Definition
TileCell.h:57
xAOD::TrigCaloCluster_v1::setNCells
void setNCells(int)
set number of cells used from RoI
xAOD::TrigCaloCluster_v1::rawEnergy
float rawEnergy() const
get Raw Energy (no calibration)
xAOD::TrigCaloCluster_v1::nCells
int nCells() const
get number of cells used from RoI
xAOD::TrigCaloCluster_v1::setRawEnergy
void setRawEnergy(float)
set Raw Energy (no calibration)
xAOD::TrigEMCluster_v1::setEhad1
void setEhad1(float)
set hadronic Energy (first hadronic layer)
xAOD::TrigEMCluster_v1::eta
float eta() const
get Eta (calibrated)
xAOD::TrigEMCluster_v1::setEnergy
void setEnergy(float energy)
set Energy (calibrated)
xAOD::TrigEMCluster_v1::phi
float phi() const
get Phi (calibrated)
xAOD::TrigEMCluster_v1::ehad1
float ehad1() const
get hadronic Energy (first hadronic layer)
xAOD::TrigEMCluster_v1::energy
float energy() const
get Energy (calibrated)
xAOD::TrigEMCluster
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster class.
Definition
Event/xAOD/xAODTrigCalo/xAODTrigCalo/TrigEMCluster.h:17
type
Generated on
for ATLAS Offline Software by
1.17.0