ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::CaloClusterROIPhiRZContainerMaker Class Reference

Algorithm to create a eta ordered ROIs in the eta phi plane. More...

#include <CaloClusterROIPhiRZContainerMaker.h>

Inheritance diagram for InDet::CaloClusterROIPhiRZContainerMaker:
Collaboration diagram for InDet::CaloClusterROIPhiRZContainerMaker:

Public Member Functions

 CaloClusterROIPhiRZContainerMaker (const std::string &name, ISvcLocator *pSvcLocator)
 ~CaloClusterROIPhiRZContainerMaker ()
StatusCode initialize () override
StatusCode finalize () override
StatusCode execute (const EventContext &ctx) const override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

const Trk::SurfacegetCaloSurface (const xAOD::CaloCluster &cluster, const CaloDetDescrManager &caloDDMgr) const
void addROI (const xAOD::CaloCluster &cluster, const CaloDetDescrManager &caloDDMgr, ROIPhiRZContainer &output_rois, std::vector< uint_fast8_t > &max_output, std::vector< unsigned int > &n_rois) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Static Private Member Functions

static Trk::LocalParameters getClusterLocalParameters (const xAOD::CaloCluster &cluster, const Trk::Surface &surf)

Private Attributes

SG::ReadHandleKeyArray< xAOD::CaloClusterContainerm_inputClusterContainerNames {this, "InputClusterContainerNames", {}, "Input cluster container keys for egamma objects"}
 Names of the cluster intput collections.
SG::WriteHandleKeyArray< ROIPhiRZContainerm_outputClusterContainerName {this, "OutputROIContainerName", {}, "Output collection of eta ordered ROIs"}
 Name of the ROI output collection.
SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey { this,"CaloDetDescrManager", "CaloDetDescrManager", "SG Key for CaloDetDescrManager in the Condition Store" }
 Name of the CaloDetDescrManager condition object.
ToolHandle< ICaloSurfaceBuilderm_calosurf { this, "CaloSurfaceBuilder", "CaloSurfaceBuilder", "Tool to build calorimeter layer surfaces"}
 Tool to build calorimeter layer surfaces.
ToolHandle< IegammaCaloClusterSelectorm_egammaCaloClusterSelector {this, "egammaCaloClusterSelector", "egammaCaloClusterSelector","Tool that makes the cluster selection"}
 Tool to filter the calo clusters.
Gaudi::Property< bool > m_EMEnergyOnly {this, "EMEnergyOnly", false, "Only use EM energy as the ROI energy" }
Gaudi::Property< std::vector< float > > m_phiWidth {this, "phiWidth", {} }
Gaudi::Property< std::vector< float > > m_minPtEm {this, "minPt", {}, "Minimum pt of cluster ROIs (EMFraction corrected if EMEnerygOnly is set)."}
std::vector< unsigned int > m_outputIndex
std::vector< unsigned int > m_outputSorted
std::vector< unsigned int > m_outputUnsorted
std::vector< float > m_sortedMinPtEm
float m_maxPhiWidth = 0.0F
std::atomic_uint m_allClusters {0}
std::atomic_uint m_selectedClusters {0}
std::atomic_uint m_duplicateROI {0}
std::atomic_uint m_maxNROIs {0}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Algorithm to create a eta ordered ROIs in the eta phi plane.

The algorithm creates ROIs ordered by eta in the eta phi plane from selected calorimer clusters.

Definition at line 33 of file CaloClusterROIPhiRZContainerMaker.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CaloClusterROIPhiRZContainerMaker()

InDet::CaloClusterROIPhiRZContainerMaker::CaloClusterROIPhiRZContainerMaker ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 29 of file CaloClusterROIPhiRZContainerMaker.cxx.

30 :
31 AthReentrantAlgorithm(name, pSvcLocator)
32{
33}

◆ ~CaloClusterROIPhiRZContainerMaker()

InDet::CaloClusterROIPhiRZContainerMaker::~CaloClusterROIPhiRZContainerMaker ( )
default

Member Function Documentation

◆ addROI()

void InDet::CaloClusterROIPhiRZContainerMaker::addROI ( const xAOD::CaloCluster & cluster,
const CaloDetDescrManager & caloDDMgr,
ROIPhiRZContainer & output_rois,
std::vector< uint_fast8_t > & max_output,
std::vector< unsigned int > & n_rois ) const
private

Definition at line 235 of file CaloClusterROIPhiRZContainerMaker.cxx.

239 {
240
241 double energy = cluster.e();
242
243 // do we want to make energy be EM energy only?
244 if (m_EMEnergyOnly) {
245 static const SG::AuxElement::ConstAccessor<float> acc("EMFraction");
246 double emFrac(0.);
247 if (acc.isAvailable(cluster)) {
248 emFrac = acc(cluster);
250 emFrac)) {
251 ATH_MSG_ERROR("EM energy requested, but No EM fraction momement stored");
252 return;
253 }
254 energy *= emFrac;
255 }
256
257 std::unique_ptr<const Trk::Surface> surface( getCaloSurface(cluster, caloDDMgr) );
258 if (!surface) {
259 ATH_MSG_ERROR( "Failed to create surface for cluster");
260 return;
261 }
262
263 const Trk::LocalParameters localParams( getClusterLocalParameters(cluster, *surface) );
264
265 Amg::Vector3D global_position( surface->localToGlobal( localParams) );
266 double et = energy * std::sin(global_position.theta());
267 if ( et >= m_sortedMinPtEm[0]){
268 unsigned int roi_idx=output_rois.size();
269 output_rois.addROI(global_position, m_maxPhiWidth);
270
271 unsigned int n_duplicates = output_rois.size()-roi_idx-1;
272 if (n_duplicates>0) {
273 m_duplicateROI += n_duplicates;
274 }
275
276 unsigned int output_idx=0;
277 for ( ; output_idx<m_outputIndex.size(); ++output_idx) {
278 if (et < m_sortedMinPtEm[output_idx]) break;
279 n_rois[output_idx] += n_duplicates+1;
280 }
281 // addROI may duplicate the ROI at phi - 2 pi
282 // So, have to set the last output_idx for all newly added ROIs
283 if (max_output.size() < output_rois.size()) {
284 max_output.resize (output_rois.size());
285 }
286 for (; roi_idx < output_rois.size(); ++roi_idx) {
287 max_output[roi_idx]=output_idx;
288 }
289
290 }
291 else {
292 ATH_MSG_DEBUG("Skip selected cluster " << energy << " * " << std::sin(global_position.theta()) << " = " << energy * std::sin(global_position.theta())<< " >= " << m_sortedMinPtEm[0] );
293 }
294}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
float et(const xAOD::jFexSRJetRoI *j)
static Trk::LocalParameters getClusterLocalParameters(const xAOD::CaloCluster &cluster, const Trk::Surface &surf)
const Trk::Surface * getCaloSurface(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &caloDDMgr) const
void addROI(const Amg::Vector3D &global_position, float roi_phi_width)
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
virtual double e() const
The total energy of the particle.
@ ENG_FRAC_EM
Energy fraction in EM calorimeters.
Eigen::Matrix< double, 3, 1 > Vector3D

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

62{
63 return 0;
64}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode InDet::CaloClusterROIPhiRZContainerMaker::execute ( const EventContext & ctx) const
override

Definition at line 105 of file CaloClusterROIPhiRZContainerMaker.cxx.

106{
107 if (m_inputClusterContainerNames.empty()){
108 return StatusCode::SUCCESS;
109 }
110
111 std::vector< const xAOD::CaloClusterContainer *> inputClusterContainerArr;
112 inputClusterContainerArr.reserve(m_inputClusterContainerNames.size());
113 std::size_t total_cluster_size = 0;
114 for (const SG::ReadHandleKey<xAOD::CaloClusterContainer> &input_container_key : m_inputClusterContainerNames){
115 SG::ReadHandle<xAOD::CaloClusterContainer> input_container(input_container_key, ctx);
116 ATH_CHECK(input_container.isValid());
117 inputClusterContainerArr.push_back(input_container.cptr());
118 total_cluster_size += input_container->size();
119 }
120
121 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey,ctx};
122 ATH_CHECK(caloMgrHandle.isValid());
123 const CaloDetDescrManager *caloMgr = caloMgrHandle.cptr();
124
125 unsigned int all_clusters{};
126 unsigned int selected_clusters{};
127 ROIPhiRZContainer rois; // temporary ROI container
128 std::vector<unsigned int > n_rois; // number of ROIs per output container
129 n_rois.resize(m_outputIndex.size(),0);
130
131 std::vector<uint8_t > max_output;// the outputs are ordered by the pt-cut, this is the index of the last output which passed the pt-cut per ROI
132 rois.reserve( total_cluster_size);
133 max_output.resize(total_cluster_size);
134 // Size of rois might be larger than total_cluster_size if a ROI close to +-pi gets duplicated...
135 // so don't warn. See ATLASRECTS-7160.
136
137 // create ROIs.
138 // first they are only stored in the temporary container
139 for (const xAOD::CaloClusterContainer *container : inputClusterContainerArr)
140 {
141 for (const xAOD::CaloCluster* cluster : *container){
142 all_clusters++;
143 if (m_egammaCaloClusterSelector->passSelection(cluster,*caloMgr))
144 {
145 selected_clusters++;
146 addROI(*cluster, *caloMgr, rois, max_output, n_rois);
147 }
148 }
149 }
150
151
152 // create ROI output container
153 std::vector< SG::WriteHandle<ROIPhiRZContainer> > output_rois;
154 output_rois.reserve(m_outputIndex.size());
155 for (unsigned int output_idx : m_outputIndex) {
156 unsigned int the_size = n_rois[output_rois.size()];
157 output_rois.emplace_back( m_outputClusterContainerName[output_idx], ctx);
158 ATH_CHECK( output_rois.back().record( std::make_unique<ROIPhiRZContainer>() ) );
159 output_rois.back()->reserve( the_size);
160 }
161
162 if (!m_outputSorted.empty()) {
163 // sort ROIs by phi
164 std::vector<unsigned int> roi_order;
165 roi_order.reserve( rois.size() );
166 for (unsigned int idx=0; idx< rois.size(); ++idx) { roi_order.push_back( idx ); }
167 std::sort(roi_order.begin(),roi_order.end(),[&rois](unsigned int a, unsigned int b) { return rois[a][0] < rois[b][0]; });
168 // copy ROIs in sort order to output container which are to be sorted
169 for (unsigned int roi_i : roi_order) {
170 for (unsigned int output_i : m_outputSorted) {
171 if (output_i>=max_output[roi_i]) break;
172 output_rois[output_i]->push_back( rois[ roi_i ] );
173 }
174 }
175 }
176
177 // copy ROIs in original order to output container which should have the original order
178 // also remove duplicates
179 if (!m_outputUnsorted.empty()) {
180 for (unsigned int roi_unordered_i=0; roi_unordered_i < rois.size(); ++roi_unordered_i) {
181 for (unsigned int output_i : m_outputUnsorted) {
182 if (output_i>=max_output[roi_unordered_i]) break;
183 if (std::abs(rois[ roi_unordered_i ][0])<PI_F or (rois[ roi_unordered_i ][0] == PI_F)) {
184 output_rois[output_i]->push_back( rois[ roi_unordered_i ] );
185 }
186 }
187 }
188 }
189
190 // gather statistics
191 {
192 unsigned int max_size;
193 do {
194 max_size = m_maxNROIs;
195 } while (rois.size()>max_size && ! m_maxNROIs.compare_exchange_weak(max_size, rois.size()));
196 }
197 m_allClusters += all_clusters;
198 m_selectedClusters += selected_clusters;
199 return StatusCode::SUCCESS;
200}
#define ATH_CHECK
Evaluate an expression and check for errors.
static Double_t a
SG::WriteHandleKeyArray< ROIPhiRZContainer > m_outputClusterContainerName
Name of the ROI output collection.
SG::ReadHandleKeyArray< xAOD::CaloClusterContainer > m_inputClusterContainerNames
Names of the cluster intput collections.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Name of the CaloDetDescrManager condition object.
void addROI(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &caloDDMgr, ROIPhiRZContainer &output_rois, std::vector< uint_fast8_t > &max_output, std::vector< unsigned int > &n_rois) const
ToolHandle< IegammaCaloClusterSelector > m_egammaCaloClusterSelector
Tool to filter the calo clusters.
const_pointer_type cptr()
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

88{
89 // If we didn't find any symlinks to add, just return the collection
90 // from the base class. Otherwise, return the extended collection.
91 if (!m_extendedExtraObjects.empty()) {
93 }
95}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode InDet::CaloClusterROIPhiRZContainerMaker::finalize ( )
override

Definition at line 94 of file CaloClusterROIPhiRZContainerMaker.cxx.

95{
96 //
97 // finalize method
98 //
99 ATH_MSG_DEBUG ("AllClusters " << m_allClusters << " selected " << m_selectedClusters << " max ROIs per event " << m_maxNROIs);
100
101 return StatusCode::SUCCESS;
102}

◆ getCaloSurface()

const Trk::Surface * InDet::CaloClusterROIPhiRZContainerMaker::getCaloSurface ( const xAOD::CaloCluster & cluster,
const CaloDetDescrManager & caloDDMgr ) const
inlineprivate

Definition at line 47 of file CaloClusterROIPhiRZContainerMaker.h.

49 {
50 // Determine if we want to extrapolate to the barrel or endcap. If in the
51 // crack choose the detector with largest amount of energy in the second
52 // sampling layer
53 if (xAOD::EgammaHelpers::isBarrel(&cluster)) {
54 return m_calosurf->CreateUserSurface(CaloCell_ID::EMB2, 0., cluster.eta(), &caloDDMgr);
55 } else {
56 return m_calosurf->CreateUserSurface(CaloCell_ID::EME2, 0., cluster.eta(), &caloDDMgr);
57 }
58 }
ToolHandle< ICaloSurfaceBuilder > m_calosurf
Tool to build calorimeter layer surfaces.
virtual double eta() const
The pseudorapidity ( ) of the particle.
bool isBarrel(const xAOD::Egamma *eg)
return true if the cluster is in the barrel

◆ getClusterLocalParameters()

Trk::LocalParameters InDet::CaloClusterROIPhiRZContainerMaker::getClusterLocalParameters ( const xAOD::CaloCluster & cluster,
const Trk::Surface & surf )
staticprivate

Definition at line 202 of file CaloClusterROIPhiRZContainerMaker.cxx.

204{
205
206 Amg::Vector3D surfRefPoint = surf.globalReferencePoint();
207
208 double eta = cluster.eta();
209 double theta = 2 * atan(exp(-eta)); // -log(tan(theta/2));
210 double tantheta = tan(theta);
211 double phi = cluster.phi();
212
213 if (xAOD::EgammaHelpers::isBarrel(&cluster)) {
214 // Two corindate in a cyclinder are
215 // Trk::locRPhi = 0 (ie phi)
216 // Trk::locZ = 1(ie z)
217 double r = surfRefPoint.perp();
218 double z = tantheta == 0 ? 0. : r / tantheta;
221 return Trk::LocalParameters(locRPhi, locZ);
222 } else {
223 // Local paramters of a disk are
224 // Trk::locR = 0
225 // Trk::locPhi = 1
226 double z = surfRefPoint.z();
227 double r = z * tantheta;
230 return Trk::LocalParameters(locR, locPhi);
231 }
232}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Scalar theta() const
theta method
#define z
virtual const Amg::Vector3D & globalReferencePoint() const
Returns a global reference point on the surface, for PlaneSurface, StraightLineSurface,...
virtual double phi() const
The azimuthal angle ( ) of the particle.
int r
Definition globals.cxx:22
@ locR
Definition ParamDefs.h:44
@ locRPhi
Definition ParamDefs.h:40
@ locZ
local cylindrical
Definition ParamDefs.h:42
@ locPhi
local polar
Definition ParamDefs.h:45
std::pair< double, ParamDefs > DefinedParameter
Typedef to of a std::pair<double, ParamDefs> to identify a passed-through double as a specific type o...

◆ initialize()

StatusCode InDet::CaloClusterROIPhiRZContainerMaker::initialize ( )
override

Definition at line 40 of file CaloClusterROIPhiRZContainerMaker.cxx.

41{
43 ATH_CHECK( m_calosurf.retrieve() );
44 ATH_CHECK( m_caloMgrKey.initialize() );
45
46 if (m_outputClusterContainerName.empty()) {
47 ATH_MSG_FATAL( "No OutputROIContainerName given.");
48 return StatusCode::FAILURE;
49 }
50 if (m_outputClusterContainerName.size() > std::numeric_limits<uint8_t>::max()) {
51 ATH_MSG_FATAL( "Too many OutputROIContainerNames given.");
52 return StatusCode::FAILURE;
53 }
54 if (m_minPtEm.size() != m_phiWidth.size() || m_minPtEm.size() != m_outputClusterContainerName.size() ) {
55 ATH_MSG_FATAL( "Number of entries in minPt, phiWidth must match number of entries in OutputROIContainerName.");
56 return StatusCode::FAILURE;
57 }
58 m_outputIndex.reserve(m_minPtEm.size());
60 for (unsigned int idx=0; idx<m_minPtEm.size(); ++idx) {
61 m_outputIndex.push_back(idx);
63 }
64 std::sort(m_outputIndex.begin(),m_outputIndex.end(), [this](unsigned int idx_a, unsigned int idx_b) { return this->m_minPtEm[idx_a] < this->m_minPtEm[idx_b];});
65 m_sortedMinPtEm.reserve( m_outputIndex.size());
66 for (unsigned int idx : m_outputIndex) {
67 m_sortedMinPtEm.push_back( m_minPtEm[idx] );
68 }
69
72
75
76 m_outputSorted.reserve( m_outputIndex.size() );
77 m_outputUnsorted.reserve( m_outputIndex.size() );
78 for (unsigned int output_i=0; output_i<m_outputIndex.size(); ++output_i) {
79 if (m_phiWidth[m_outputIndex[output_i]]>0.) {
80 m_outputSorted.push_back(output_i);
81 }
82 else {
83 m_outputUnsorted.push_back(output_i);
84 }
85 ATH_MSG_DEBUG( "ROIPhiRZ container " << m_outputClusterContainerName[ m_outputIndex[output_i] ]
86 << " : " << m_minPtEm[m_outputIndex[output_i] ] << " MeV " << ( m_phiWidth[m_outputIndex[output_i]]>0. ? " order by phi " : " unordered" ) );
87 }
88 return StatusCode::SUCCESS;
89}
#define ATH_MSG_FATAL(x)
Gaudi::Property< std::vector< float > > m_minPtEm
Gaudi::Property< std::vector< float > > m_phiWidth

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

75{
76 return BaseAlg::sysExecute (ctx);
77}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

105 {
107
108 if (sc.isFailure()) {
109 return sc;
110 }
111
112 ServiceHandle<ICondSvc> cs("CondSvc",name());
113 for (auto h : outputHandles()) {
114 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
115 // do this inside the loop so we don't create the CondSvc until needed
116 if ( cs.retrieve().isFailure() ) {
117 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
118 return StatusCode::SUCCESS;
119 }
120 if (cs->regHandle(this,*h).isFailure()) {
122 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
123 << " with CondSvc");
124 }
125 }
126 }
127 return sc;
128}
#define ATH_MSG_WARNING(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_allClusters

std::atomic_uint InDet::CaloClusterROIPhiRZContainerMaker::m_allClusters {0}
mutableprivate

Definition at line 105 of file CaloClusterROIPhiRZContainerMaker.h.

105{0};

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> InDet::CaloClusterROIPhiRZContainerMaker::m_caloMgrKey { this,"CaloDetDescrManager", "CaloDetDescrManager", "SG Key for CaloDetDescrManager in the Condition Store" }
private

Name of the CaloDetDescrManager condition object.

Definition at line 79 of file CaloClusterROIPhiRZContainerMaker.h.

80{ this,"CaloDetDescrManager", "CaloDetDescrManager", "SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_calosurf

ToolHandle<ICaloSurfaceBuilder> InDet::CaloClusterROIPhiRZContainerMaker::m_calosurf { this, "CaloSurfaceBuilder", "CaloSurfaceBuilder", "Tool to build calorimeter layer surfaces"}
private

Tool to build calorimeter layer surfaces.

Definition at line 83 of file CaloClusterROIPhiRZContainerMaker.h.

84{ this, "CaloSurfaceBuilder", "CaloSurfaceBuilder", "Tool to build calorimeter layer surfaces"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_duplicateROI

std::atomic_uint InDet::CaloClusterROIPhiRZContainerMaker::m_duplicateROI {0}
mutableprivate

Definition at line 107 of file CaloClusterROIPhiRZContainerMaker.h.

107{0};

◆ m_egammaCaloClusterSelector

ToolHandle<IegammaCaloClusterSelector> InDet::CaloClusterROIPhiRZContainerMaker::m_egammaCaloClusterSelector {this, "egammaCaloClusterSelector", "egammaCaloClusterSelector","Tool that makes the cluster selection"}
private

Tool to filter the calo clusters.

Definition at line 87 of file CaloClusterROIPhiRZContainerMaker.h.

88{this, "egammaCaloClusterSelector", "egammaCaloClusterSelector","Tool that makes the cluster selection"};

◆ m_EMEnergyOnly

Gaudi::Property< bool > InDet::CaloClusterROIPhiRZContainerMaker::m_EMEnergyOnly {this, "EMEnergyOnly", false, "Only use EM energy as the ROI energy" }
private

Definition at line 90 of file CaloClusterROIPhiRZContainerMaker.h.

91{this, "EMEnergyOnly", false, "Only use EM energy as the ROI energy" };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_inputClusterContainerNames

SG::ReadHandleKeyArray<xAOD::CaloClusterContainer> InDet::CaloClusterROIPhiRZContainerMaker::m_inputClusterContainerNames {this, "InputClusterContainerNames", {}, "Input cluster container keys for egamma objects"}
private

Names of the cluster intput collections.

Definition at line 70 of file CaloClusterROIPhiRZContainerMaker.h.

70{this, "InputClusterContainerNames", {}, "Input cluster container keys for egamma objects"};

◆ m_maxNROIs

std::atomic_uint InDet::CaloClusterROIPhiRZContainerMaker::m_maxNROIs {0}
mutableprivate

Definition at line 108 of file CaloClusterROIPhiRZContainerMaker.h.

108{0};

◆ m_maxPhiWidth

float InDet::CaloClusterROIPhiRZContainerMaker::m_maxPhiWidth = 0.0F
private

Definition at line 103 of file CaloClusterROIPhiRZContainerMaker.h.

◆ m_minPtEm

Gaudi::Property< std::vector<float> > InDet::CaloClusterROIPhiRZContainerMaker::m_minPtEm {this, "minPt", {}, "Minimum pt of cluster ROIs (EMFraction corrected if EMEnerygOnly is set)."}
private

Definition at line 96 of file CaloClusterROIPhiRZContainerMaker.h.

97{this, "minPt", {}, "Minimum pt of cluster ROIs (EMFraction corrected if EMEnerygOnly is set)."};

◆ m_outputClusterContainerName

SG::WriteHandleKeyArray<ROIPhiRZContainer> InDet::CaloClusterROIPhiRZContainerMaker::m_outputClusterContainerName {this, "OutputROIContainerName", {}, "Output collection of eta ordered ROIs"}
private

Name of the ROI output collection.

Definition at line 73 of file CaloClusterROIPhiRZContainerMaker.h.

74{this, "OutputROIContainerName", {}, "Output collection of eta ordered ROIs"};

◆ m_outputIndex

std::vector<unsigned int> InDet::CaloClusterROIPhiRZContainerMaker::m_outputIndex
private

Definition at line 99 of file CaloClusterROIPhiRZContainerMaker.h.

◆ m_outputSorted

std::vector<unsigned int> InDet::CaloClusterROIPhiRZContainerMaker::m_outputSorted
private

Definition at line 100 of file CaloClusterROIPhiRZContainerMaker.h.

◆ m_outputUnsorted

std::vector<unsigned int> InDet::CaloClusterROIPhiRZContainerMaker::m_outputUnsorted
private

Definition at line 101 of file CaloClusterROIPhiRZContainerMaker.h.

◆ m_phiWidth

Gaudi::Property< std::vector<float> > InDet::CaloClusterROIPhiRZContainerMaker::m_phiWidth {this, "phiWidth", {} }
private

Definition at line 93 of file CaloClusterROIPhiRZContainerMaker.h.

94{this, "phiWidth", {} };

◆ m_selectedClusters

std::atomic_uint InDet::CaloClusterROIPhiRZContainerMaker::m_selectedClusters {0}
mutableprivate

Definition at line 106 of file CaloClusterROIPhiRZContainerMaker.h.

106{0};

◆ m_sortedMinPtEm

std::vector<float> InDet::CaloClusterROIPhiRZContainerMaker::m_sortedMinPtEm
private

Definition at line 102 of file CaloClusterROIPhiRZContainerMaker.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: