19#include "GaudiKernel/IToolSvc.h"
20#include "GaudiKernel/TypeNameString.h"
21#include "GaudiKernel/StatusCode.h"
31#include "CaloEvent/CaloTowerContainer.h"
40 ISvcLocator* pSvcLocator)
67 tool->setTowerSeg(theTowerSeg);
71 if ( tool->name().find(
"FC") != std::string::npos) {
73 ATH_MSG_INFO(
"Tool " << tool->name() <<
" is configured, will use FCal");
84 ATH_MSG_DEBUG(
"Initialization of TrigCaloTowerMaker completed successfully");
86 return StatusCode::SUCCESS;
107 if ( !roiCollection.
isValid()) {
108 ATH_MSG_ERROR(
"Cell maker did not get a valid RoIs collection");
109 return StatusCode::FAILURE;
111 if (roiCollection->size() == 0) {
113 return StatusCode::SUCCESS;
115 if (roiCollection->size() > 1)
117 << roiCollection->size()
118 <<
" ROI, but it should be called with 1 RoI - Will only "
119 "process the first RoI");
121 roiDescriptor = roiCollection->front();
122 ATH_MSG_DEBUG(
"Operating on " << roiCollection->size() <<
"RoI(s)");
127 <<
" located at phi = " << roiDescriptor.
phi()
128 <<
", eta = " << roiDescriptor.
eta());
138 " Attempting to use composite RoI as a normal RoI - this is probably "
139 "*not* what you want to do "
143 double eta0 = roiDescriptor.
eta();
144 double phi0 = roiDescriptor.
phi();
147 double etamin = eta0 -
m_deta / 2.;
148 double etamax = eta0 +
m_deta / 2.;
150 double phimin = phi0 -
m_dphi / 2.;
151 double phimax = phi0 +
m_dphi / 2.;
154 <<
" etamin = " << etamin <<
" etamax = " << etamax
155 <<
" phimin = " << phimin <<
" phimax = " << phimax);
162 caloTowerContainer.record(std::make_unique<CaloTowerContainer>(myseg)));
165 std::make_unique<CaloTowerContainer>(subseg.
segmentation())));
171 << caloTowerContainer.name()
172 <<
" symlinked to INavigable4MomentumCollection in StoreGate");
175 ATH_CHECK( caloCellContainer.isValid() );
182 " REGTEST: Retrieved a Cell Container of Size= " << theCellCont->
size());
190 ATH_CHECK(tool->execute(ctx, pCaloTowerContainer, theCellCont));
193 ATH_CHECK(tool->execute(ctx, pCaloTowerContainer, theCellCont, &subseg));
200 << caloTowerContainer.name() <<
" at "
201 << caloTowerContainer.cptr()
202 <<
" of Size= " << pCaloTowerContainer->
size());
204 mon_towerContainerSize =
static_cast<float>(pCaloTowerContainer->
size());
206 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define CHECK(...)
Evaluate an expression and check for errors.
Header file to be included by clients of the Monitored infrastructure.
Athena::TPCnvVers::Current TrigRoiDescriptor
An algorithm that can be simultaneously executed in multiple threads.
Container class for CaloCell.
Storable container class for CaloTower.
A rectangular window within the segmentation.
CaloTowerSeg segmentation() const
Return a new segmentation object corresponding to this window.
Data object stores CaloTower segmentation.
SubSeg subseg(double eta, double deta, double phi, double dphi) const
Return a window within the current segmentation.
size_type size() const noexcept
Returns the number of elements in the collection.
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
virtual double phi() const override final
Methods to retrieve data members.
virtual double eta() const override final
virtual bool composite() const override final
SuperRoI compatability methods.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TrigCaloTowerMaker(const std::string &name, ISvcLocator *pSvcLocator)
constructor
Gaudi::Property< unsigned int > m_nEtaTowers
Number of eta segments in which we divide the calorimeter.
bool m_includeFcal
To help structure Tower container.
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_inputRoiKey
Gaudi::Property< double > m_maxEta
Gaudi::Property< double > m_deta
Gaudi::Property< unsigned int > m_nPhiTowers
Number of phi segments in which we divide the calorimeter.
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< CaloCellContainer > m_inputCellsKey
virtual StatusCode initialize() override
HLT method to initialize.
ToolHandleArray< CaloTowerBuilderToolBase > m_towerMakerTools
Gaudi::Property< double > m_dphi
ToolHandle< GenericMonitoringTool > m_monTool
SG::WriteHandleKey< CaloTowerContainer > m_outputTowerKey
Gaudi::Property< double > m_minEta
Eta limits of the region where the towers are built.
SG::WriteHandleKey< INavigable4MomentumCollection > m_caloTowerNav4LinkKey
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
virtual unsigned int roiId() const override final
these quantities probably don't need to be used any more
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Helper for azimuthal angle calculations.