ATLAS Offline Software
Loading...
Searching...
No Matches
xAODEmTauROIRetriever.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <string>
8
9#include "CLHEP/Units/SystemOfUnits.h"
10
12
13namespace JiveXML {
14
15 //--------------------------------------------------------------------------
16
17 xAODEmTauROIRetriever::xAODEmTauROIRetriever(const std::string& type, const std::string& name, const IInterface* parent):
18 AthAlgTool(type, name, parent), m_typeName("EmTauROI")
19 {
20
21 declareInterface<IDataRetriever>(this);
22 }
23
24 //--------------------------------------------------------------------------
25
26 StatusCode xAODEmTauROIRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
27
30 DataVect energy;
31 DataVect energyEM;
32 DataVect energyTAU;
33 DataVect roiWord;
34 DataVect thrPattern;
35
37
38 const xAOD::EmTauRoIContainer* emTauRoIs = 0;
39
40
41 // L1JetObject -not- available
42 m_sgKey = "LVL1EmTauRoIs";
43 if ( evtStore()->retrieve(emTauRoIs,m_sgKey).isFailure() ) {
44 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "No LVL1EmTauROIs found in SG " << endmsg;
45 return StatusCode::SUCCESS;
46 }
47 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "Found LVL1EmTauROIs in SG ! " << endmsg;
48
51
52
53 int counter = 0;
54 for (; itEM != itEMe; ++itEM)
55 {
56 phi.push_back(DataType( (*itEM)->phi()) );
57 eta.push_back(DataType( (*itEM)->eta()) );
58
59 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << "xAOD EmTauRoI #" << counter++
60 << ", eta: " << (*itEM)->eta() << ", phi: " << (*itEM)->phi() << endmsg;
61
62// Placeholders ! No direct access to those in Run-2
63// Reference:
64// Event/xAOD/xAODTrigger/trunk/Root/EmTauRoI_v2.cxx
65// jpt 9Jan15:
66 energy.push_back(DataType( 0. ));
67 energyEM.push_back(DataType( 0. ));
68 energyTAU.push_back(DataType( 0. ));
69 roiWord.push_back(DataType( 0. ));
70 thrPattern.push_back(DataType( 0. ));
71 }
72
73 DataMap myDataMap;
74 const auto nPhi = phi.size();
75 myDataMap["energy"] = energy;
76 myDataMap["phi"] = std::move(phi);
77 myDataMap["eta"] = std::move(eta);
78 myDataMap["energy"] = std::move(energy);
79 myDataMap["energyEM"] = std::move(energyEM);
80 myDataMap["energyTAU"] = std::move(energyTAU);
81 myDataMap["roiWord"] = std::move(roiWord);
82 myDataMap["thrPattern"] = std::move(thrPattern);
83
84 if (msgLvl(MSG::DEBUG)) msg(MSG::DEBUG) << dataTypeName() << ": "<< nPhi
85 << " from: " << m_sgKey << endmsg;
86
87 //forward data to formating tool
88 return FormatTool->AddToEvent(dataTypeName(), m_sgKey, &myDataMap);
89 }
90}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define endmsg
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore()
bool msgLvl(const MSG::Level lvl) const
MsgStream & msg() const
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const std::string m_typeName
The data type that is generated by this retriever.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
virtual std::string dataTypeName() const
Return the name of the data type.
xAODEmTauROIRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
std::map< std::string, DataVect > DataMap
Definition DataType.h:59
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition DataType.h:58
EmTauRoIContainer_v2 EmTauRoIContainer