|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include "GaudiKernel/SystemOfUnits.h"
44 return StatusCode::SUCCESS;
50 if (!inputTowers.isValid())
53 return StatusCode::FAILURE;
56 std::unique_ptr<xAOD::JGTowerContainer> outputTowers(shallowCopy.first);
57 std::unique_ptr<xAOD::ShallowAuxContainer> outputTowersAux(shallowCopy.second);
62 std::array<std::vector<const xAOD::JGTower *>, nFPGAs> fpgas;
64 std::array<TH1F, nFPGAs> fpgaHistograms;
65 std::vector<float> fpgaRhos(3, 0.0);
66 for (std::size_t
i = 0;
i < nFPGAs; ++
i)
76 fpgas.at(
static_cast<std::size_t
>(fpga)).push_back(tower);
77 fpgaHistograms.at(
static_cast<std::size_t
>(fpga)).Fill(tower->et());
81 for (std::size_t
i = 0;
i < nFPGAs; ++
i)
83 float threshold = 3 * fpgaHistograms.at(
i).GetRMS();
84 const std::vector<const xAOD::JGTower *> &
towers = fpgas.at(
i);
89 float area = accArea(*tower);
90 float etSub = tower->et() -
area *
rho;
92 outputTowers->
at(tower->index())->setEt(etSub <
threshold ? 0 : etSub);
97 ATH_CHECK(outputHandle.record(std::move(outputTowers), std::move(outputTowersAux)));
100 auto rhoCont = std::make_unique<xAOD::EnergySumRoI>();
101 auto rhoContAux = std::make_unique<xAOD::EnergySumRoIAuxInfo>();
102 rhoCont->setStore(rhoContAux.get());
103 decRho(*rhoCont) = fpgaRhos;
105 ATH_CHECK(outputRhoHandle.record(std::move(rhoCont), std::move(rhoContAux)));
106 return StatusCode::SUCCESS;
117 totalEt += tower->et();
118 totalArea += accArea(*tower);
121 float rho = (totalArea == 0 ? 0.0f : totalEt / totalArea);
Description of JGTower_v1.
FPGA getFPGA(float eta)
Get the FPGA code from the tower eta.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual ~GTowerRhoSubtractionAlg() override
Helper class to provide constant type-safe access to aux data.
SG::WriteHandleKey< xAOD::JGTowerContainer > m_outputKey
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
virtual StatusCode execute(const EventContext &ctx) const override
float calculateRho(const std::vector< const xAOD::JGTower * > &towers) const
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadHandleKey< xAOD::JGTowerContainer > m_inputKey
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Handle class for recording to StoreGate.
Helper class to provide type-safe access to aux data.
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string to_string(const DetectorType &type)
SG::WriteHandleKey< xAOD::EnergySumRoI > m_outputRhoKey
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.
#define ATH_MSG_WARNING(x)
bool setOriginalObjectLink(const IParticle &original, IParticle ©)
This function should be used by CP tools when they make a deep copy of an object in their correctedCo...
GTowerRhoSubtractionAlg(const std::string &name, ISvcLocator *pSvcLocator)
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
const T * at(size_type n) const
Access an element, as an rvalue.
Handle class for reading from StoreGate.
virtual StatusCode initialize() override