7#include "GaudiKernel/MsgStream.h"
8#include "GaudiKernel/IToolSvc.h"
9#include "GaudiKernel/StatusCode.h"
14#include "TLorentzVector.h"
33 return StatusCode::SUCCESS;
46 std::unique_ptr<TrigRoiDescriptorCollection> roiCollection = std::make_unique<TrigRoiDescriptorCollection>();
58 float eta = roiDescriptor->
eta();
59 float phi = roiDescriptor->
phi();
61 const float dEta = (roiDescriptor->
etaPlus() - roiDescriptor->
etaMinus()) / 2;
77 if(!RoICaloClusterContainer) {
79 return StatusCode::FAILURE;
82 ATH_MSG_DEBUG(
"Size of vector CaloCluster container is: " << RoICaloClusterContainer->
size());
85 TLorentzVector tau_barycenter;
88 if(cluster->e() < 0)
continue;
90 tau_barycenter += cluster->p4();
94 TLorentzVector tau_detector_axis;
97 if(cluster->e() < 0)
continue;
100 if(tau_barycenter.DeltaR(cluster->p4()) >
m_dRForCenter)
continue;
102 tau_detector_axis += cluster->p4();
112 if(tau_detector_axis.Pt() > 0) {
113 eta = tau_detector_axis.Eta();
114 phi = tau_detector_axis.Phi();
118 outputRoIHandle->push_back(std::make_unique<TrigRoiDescriptor>(
129 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
An algorithm that can be simultaneously executed in multiple threads.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual double etaMinus() const override final
gets eta at zMinus
virtual double etaPlus() const override final
gets eta at zedPlus
virtual double zed() const override final
virtual double phi() const override final
Methods to retrieve data members.
virtual double phiMinus() const override final
gets phiMinus
virtual double zedPlus() const override final
z at the most forward end of the RoI
virtual double zedMinus() const override final
z at the most backward end of the RoI
virtual double eta() const override final
virtual double phiPlus() const override final
gets phiPlus
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
virtual unsigned int roiWord() const override final
virtual unsigned int roiId() const override final
these quantities probably don't need to be used any more
virtual unsigned int l1Id() const override final
virtual StatusCode execute(const EventContext &ctx) const override
virtual StatusCode initialize() override
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roIInputKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clustersKey
SG::WriteHandleKey< TrigRoiDescriptorCollection > m_roIOutputKey
TrigTauCaloRoiUpdater(const std::string &, ISvcLocator *)
Gaudi::Property< float > m_dRForCenter
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
T deltaPhi(T phiA, T phiB)
Return difference phiA - phiB in range [-pi, pi].
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Helper for azimuthal angle calculations.