ATLAS Offline Software
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 
16 
17 //#include "TrigCaloEvent/TrigEMCluster.h"
19 #include "CaloGeoHelpers/CaloSampling.h"
20 
21 #include "EgammaAllFex.h"
23 
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 
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;
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++) {
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 }
TileCell
Definition: TileCell.h:57
TTHEC
@ TTHEC
Definition: RegSelEnums.h:29
xAOD::TrigEMCluster_v1::setEta
void setEta(float)
set Eta (calibrated)
LArEM_ID.h
xAOD::TrigEMCluster_v1::eta
float eta() const
get Eta (calibrated)
xAOD::TrigEMCluster_v1::setEnergy
void setEnergy(float energy)
set Energy (calibrated)
EgammaAllFex.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
TrigEMCluster.h
xAOD::TrigCaloCluster_v1::rawEnergy
float rawEnergy() const
get Raw Energy (no calibration)
xAOD::TrigEMCluster_v1::setPhi
void setPhi(float)
set Phi (calibrated)
IReAlgToolCalo::m_dataSvc
ServiceHandle< ITrigCaloDataAccessSvc > m_dataSvc
Definition: IReAlgToolCalo.h:84
DETID
DETID
An enum to define subdetector names.
Definition: RegSelEnums.h:23
xAOD::TrigEMCluster_v1::phi
float phi() const
get Phi (calibrated)
TTEM
@ TTEM
Definition: RegSelEnums.h:28
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
EgammaAllFex::m_includeHad
bool m_includeHad
Definition: EgammaAllFex.h:45
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
sel
sel
Definition: SUSYToolsTester.cxx:97
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LArCell
Data object for LAr calorimeter readout cell.
Definition: LArCell.h:53
LArTT_Selector< LArCellCont >
xAOD::TrigCaloCluster_v1::setNCells
void setNCells(int)
set number of cells used from RoI
library_scraper.dd
list dd
Definition: library_scraper.py:46
IReAlgToolCalo
Base Class for Tools used for Egamma and Tau Feature Extraction Algorithms.
Definition: IReAlgToolCalo.h:37
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::TrigCaloCluster_v1::setRawEnergy
void setRawEnergy(float)
set Raw Energy (no calibration)
Calo_Def.h
TrigRoiDescriptor.h
xAOD::TrigEMCluster_v1
Description of a trigger EM cluster.
Definition: TrigEMCluster_v1.h:28
EgammaAllFex::EgammaAllFex
EgammaAllFex(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: EgammaAllFex.cxx:26
xAOD::TrigEMCluster_v1::energy
float energy() const
get Energy (calibrated)
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