ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigT2CaloEgamma
src
EgammaAllFex.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// ********************************************************************
6
//
7
// NAME: EgammaAllFex.cxx
8
// PACKAGE: Trigger/TrigAlgorithms/TrigT2CaloEgamma
9
//
10
// AUTHOR: D.O. Damazio
11
//
12
//
13
// ********************************************************************
14
15
#include "
CaloIdentifier/LArEM_ID.h
"
16
17
//#include "TrigCaloEvent/TrigEMCluster.h"
18
#include "
xAODTrigCalo/TrigEMCluster.h
"
19
#include "CaloGeoHelpers/CaloSampling.h"
20
21
#include "
EgammaAllFex.h
"
22
#include "
TrigT2CaloCommon/Calo_Def.h
"
23
24
#include "
TrigSteeringEvent/TrigRoiDescriptor.h
"
25
26
EgammaAllFex::EgammaAllFex
(
const
std::string &
type
,
const
std::string & name,
27
const
IInterface* parent):
IReAlgToolCalo
(
type
, name, parent)
28
{
29
declareProperty
(
"IncludeHad"
,
m_includeHad
=
false
);
30
#ifndef NDEBUG
31
// Create Geometry object
32
// 0 -> CaloType EM, 2 -> Second Layer
33
// m_geometry[0] = new T2Geometry(0,2);
34
#endif
35
}
36
37
StatusCode
EgammaAllFex::execute
(
xAOD::TrigEMCluster
&rtrigEmCluster,
38
const
IRoiDescriptor
& roi,
39
const
CaloDetDescrElement
*&
/*caloDDE*/
,
40
const
EventContext& context)
const
{
41
42
// Time total AlgTool time
43
// reset error
44
int
ncells = 0;
45
// LVL1 positions
46
float
etaL1=rtrigEmCluster.
eta
();
47
float
phiL1=rtrigEmCluster.
phi
();
48
49
double
totalEnergy = 0;
50
double
totalEnergyEM = 0;
51
CaloSampling::CaloSample
samp;
52
53
ATH_MSG_DEBUG
(
"in execute(TrigEMCluster&)"
);
54
55
// Time to access RegionSelector
56
57
for
(
DETID
dd =
TTEM
; dd <=
TTHEC
; dd=(
DETID
)( ((int)dd)+1) ){
58
for
(
int
sampling=0;sampling<4;sampling++) {
59
LArTT_Selector<LArCellCont>
sel
;
60
ATH_CHECK
(
m_dataSvc
->loadCollections(context, roi, dd, sampling,
sel
) );
61
62
63
for
(
const
LArCell
* larcell :
sel
) {
64
65
double
energyCell = larcell->energy();
66
totalEnergy += energyCell;
67
if
( dd==
TTEM
) totalEnergyEM += energyCell;
68
//samp = CaloSampling::getSampling(*larcell);
69
samp = larcell->caloDDE()->getSampling();
70
rtrigEmCluster.
setEnergy
(samp,rtrigEmCluster.
energy
(samp) + energyCell);
71
rtrigEmCluster.
setRawEnergy
(samp,rtrigEmCluster.
rawEnergy
(samp) + energyCell);
72
ncells++;
73
74
}
// end of loop over sampling
75
}
// end of loop over all samples
76
}
// end of loop over DetID
77
78
// TileCAL
79
// Finished to access RegionSelector
80
std::vector<const TileCell*> seltile;
81
ATH_CHECK
(
m_dataSvc
->loadCollections(context, roi, seltile));
82
83
84
for
(
const
TileCell
* tilecell : seltile) {
85
86
double
energyCell = tilecell->energy();
87
totalEnergy += energyCell;
88
samp = tilecell->caloDDE()->getSampling();
89
rtrigEmCluster.
setEnergy
(samp,rtrigEmCluster.
energy
(samp) + energyCell);
90
rtrigEmCluster.
setRawEnergy
(samp,rtrigEmCluster.
rawEnergy
(samp) + energyCell);
91
ncells++;
92
93
}
// end of loop over sampling
94
95
96
// Update cluster Variables
97
98
if
(
m_includeHad
)
99
rtrigEmCluster.
setEnergy
(totalEnergy);
100
else
101
rtrigEmCluster.
setEnergy
(totalEnergyEM);
102
rtrigEmCluster.
setEta
(etaL1);
103
rtrigEmCluster.
setPhi
(phiL1);
104
rtrigEmCluster.
setNCells
(ncells);
105
106
// Finished save EMShowerMinimal time
107
108
109
return
StatusCode::SUCCESS;
110
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
Calo_Def.h
EgammaAllFex.h
TrigEMCluster.h
LArEM_ID.h
DETID
DETID
An enum to define subdetector names.
Definition
RegSelEnums.h:23
TTHEC
@ TTHEC
Definition
RegSelEnums.h:29
TTEM
@ TTEM
Definition
RegSelEnums.h:28
sel
sel
Definition
SUSYToolsTester.cxx:92
TrigRoiDescriptor.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
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
EgammaAllFex::execute
virtual StatusCode execute(xAOD::TrigEMCluster &rtrigEmCluster, const IRoiDescriptor &roi, const CaloDetDescrElement *&, const EventContext &context) const override
execute feature extraction for the EM Calorimeter second layer
Definition
EgammaAllFex.cxx:37
EgammaAllFex::EgammaAllFex
EgammaAllFex(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition
EgammaAllFex.cxx:26
EgammaAllFex::m_includeHad
bool m_includeHad
Definition
EgammaAllFex.h:45
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::setRawEnergy
void setRawEnergy(float)
set Raw Energy (no calibration)
xAOD::TrigEMCluster_v1::setPhi
void setPhi(float)
set Phi (calibrated)
xAOD::TrigEMCluster_v1::setEta
void setEta(float)
set Eta (calibrated)
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::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